recaho-print-react 0.0.122 → 0.0.123

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(Oe,xe){typeof exports=="object"&&typeof module<"u"?xe(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],xe):(Oe=typeof globalThis<"u"?globalThis:Oe||self,xe(Oe["recaho-print-react"]={},Oe.React,Oe.ReactDOM))})(this,function(Oe,xe,Xa){"use strict";function pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os={exports:{}},Xt={};/**
1
+ (function(Oe,xe){typeof exports=="object"&&typeof module<"u"?xe(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],xe):(Oe=typeof globalThis<"u"?globalThis:Oe||self,xe(Oe["recaho-print-react"]={},Oe.React,Oe.ReactDOM))})(this,function(Oe,xe,Xa){"use strict";function pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms={exports:{}},Xt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -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 gr;function ti(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var e=xe,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"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,b="@@iterator";function _(y){if(y===null||typeof y!="object")return null;var N=g&&y[g]||y[b];return typeof N=="function"?N:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(y){{for(var N=arguments.length,P=new Array(N>1?N-1:0),z=1;z<N;z++)P[z-1]=arguments[z];M("error",y,P)}}function M(y,N,P){{var z=w.ReactDebugCurrentFrame,oe=z.getStackAddendum();oe!==""&&(N+="%s",P=P.concat([oe]));var he=P.map(function(ae){return String(ae)});he.unshift("Warning: "+N),Function.prototype.apply.call(console[y],console,he)}}var F=!1,O=!1,G=!1,K=!1,te=!1,Q;Q=Symbol.for("react.module.reference");function le(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||te||y===i||y===l||y===c||K||y===p||F||O||G||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===u||y.$$typeof===d||y.$$typeof===m||y.$$typeof===o||y.$$typeof===Q||y.getModuleId!==void 0))}function W(y,N,P){var z=y.displayName;if(z)return z;var oe=N.displayName||N.name||"";return oe!==""?P+"("+oe+")":P}function Ce(y){return y.displayName||"Context"}function $(y){if(y==null)return null;if(typeof y.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){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 y=="object")switch(y.$$typeof){case m:var N=y;return Ce(N)+".Consumer";case d:var P=y;return Ce(P._context)+".Provider";case o:return W(y,y.render,"ForwardRef");case u:var z=y.displayName||null;return z!==null?z:$(y.type)||"Memo";case f:{var oe=y,he=oe._payload,ae=oe._init;try{return $(ae(he))}catch{return null}}}return null}var V=Object.assign,Se=0,A,Be,st,nt,ft,Mt,J;function Ne(){}Ne.__reactDisabledLog=!0;function pt(){{if(Se===0){A=console.log,Be=console.info,st=console.warn,nt=console.error,ft=console.group,Mt=console.groupCollapsed,J=console.groupEnd;var y={configurable:!0,enumerable:!0,value:Ne,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}Se++}}function yt(){{if(Se--,Se===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},y,{value:A}),info:V({},y,{value:Be}),warn:V({},y,{value:st}),error:V({},y,{value:nt}),group:V({},y,{value:ft}),groupCollapsed:V({},y,{value:Mt}),groupEnd:V({},y,{value:J})})}Se<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var x=w.ReactCurrentDispatcher,h;function C(y,N,P){{if(h===void 0)try{throw Error()}catch(oe){var z=oe.stack.trim().match(/\n( *(at )?)/);h=z&&z[1]||""}return`
17
+ */var gr;function ti(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var e=xe,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"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,b="@@iterator";function v(y){if(y===null||typeof y!="object")return null;var N=g&&y[g]||y[b];return typeof N=="function"?N:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(y){{for(var N=arguments.length,P=new Array(N>1?N-1:0),z=1;z<N;z++)P[z-1]=arguments[z];M("error",y,P)}}function M(y,N,P){{var z=w.ReactDebugCurrentFrame,oe=z.getStackAddendum();oe!==""&&(N+="%s",P=P.concat([oe]));var he=P.map(function(ae){return String(ae)});he.unshift("Warning: "+N),Function.prototype.apply.call(console[y],console,he)}}var F=!1,O=!1,G=!1,K=!1,te=!1,Q;Q=Symbol.for("react.module.reference");function le(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||te||y===i||y===l||y===c||K||y===p||F||O||G||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===u||y.$$typeof===d||y.$$typeof===m||y.$$typeof===o||y.$$typeof===Q||y.getModuleId!==void 0))}function W(y,N,P){var z=y.displayName;if(z)return z;var oe=N.displayName||N.name||"";return oe!==""?P+"("+oe+")":P}function Ce(y){return y.displayName||"Context"}function $(y){if(y==null)return null;if(typeof y.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){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 y=="object")switch(y.$$typeof){case m:var N=y;return Ce(N)+".Consumer";case d:var P=y;return Ce(P._context)+".Provider";case o:return W(y,y.render,"ForwardRef");case u:var z=y.displayName||null;return z!==null?z:$(y.type)||"Memo";case f:{var oe=y,he=oe._payload,ae=oe._init;try{return $(ae(he))}catch{return null}}}return null}var q=Object.assign,Se=0,A,Be,st,nt,ft,Mt,J;function Ne(){}Ne.__reactDisabledLog=!0;function pt(){{if(Se===0){A=console.log,Be=console.info,st=console.warn,nt=console.error,ft=console.group,Mt=console.groupCollapsed,J=console.groupEnd;var y={configurable:!0,enumerable:!0,value:Ne,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}Se++}}function yt(){{if(Se--,Se===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},y,{value:A}),info:q({},y,{value:Be}),warn:q({},y,{value:st}),error:q({},y,{value:nt}),group:q({},y,{value:ft}),groupCollapsed:q({},y,{value:Mt}),groupEnd:q({},y,{value:J})})}Se<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var x=w.ReactCurrentDispatcher,h;function C(y,N,P){{if(h===void 0)try{throw Error()}catch(oe){var z=oe.stack.trim().match(/\n( *(at )?)/);h=z&&z[1]||""}return`
18
18
  `+h+y}}var j=!1,I;{var D=typeof WeakMap=="function"?WeakMap:Map;I=new D}function S(y,N){if(!y||j)return"";{var P=I.get(y);if(P!==void 0)return P}var z;j=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var he;he=x.current,x.current=null,pt();try{if(N){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Fe){z=Fe}Reflect.construct(y,[],ae)}else{try{ae.call()}catch(Fe){z=Fe}y.call(ae.prototype)}}else{try{throw Error()}catch(Fe){z=Fe}y()}}catch(Fe){if(Fe&&z&&typeof Fe.stack=="string"){for(var ne=Fe.stack.split(`
19
19
  `),Ee=z.stack.split(`
20
20
  `),_e=ne.length-1,we=Ee.length-1;_e>=1&&we>=0&&ne[_e]!==Ee[we];)we--;for(;_e>=1&&we>=0;_e--,we--)if(ne[_e]!==Ee[we]){if(_e!==1||we!==1)do if(_e--,we--,we<0||ne[_e]!==Ee[we]){var We=`
21
- `+ne[_e].replace(" at new "," at ");return y.displayName&&We.includes("<anonymous>")&&(We=We.replace("<anonymous>",y.displayName)),typeof y=="function"&&I.set(y,We),We}while(_e>=1&&we>=0);break}}}finally{j=!1,x.current=he,yt(),Error.prepareStackTrace=oe}var Jt=y?y.displayName||y.name:"",kt=Jt?C(Jt):"";return typeof y=="function"&&I.set(y,kt),kt}function k(y,N,P){return S(y,!1)}function H(y){var N=y.prototype;return!!(N&&N.isReactComponent)}function fe(y,N,P){if(y==null)return"";if(typeof y=="function")return S(y,H(y));if(typeof y=="string")return C(y);switch(y){case l:return C("Suspense");case c:return C("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case o:return k(y.render);case u:return fe(y.type,N,P);case f:{var z=y,oe=z._payload,he=z._init;try{return fe(he(oe),N,P)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Le={},Pe=w.ReactDebugCurrentFrame;function Ae(y){if(y){var N=y._owner,P=fe(y.type,y._source,N?N.type:null);Pe.setExtraStackFrame(P)}else Pe.setExtraStackFrame(null)}function At(y,N,P,z,oe){{var he=Function.call.bind(Te);for(var ae in y)if(he(y,ae)){var ne=void 0;try{if(typeof y[ae]!="function"){var Ee=Error((z||"React class")+": "+P+" type `"+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}ne=y[ae](N,ae,z,P,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_e){ne=_e}ne&&!(ne instanceof Error)&&(Ae(oe),T("%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).",z||"React class",P,ae,typeof ne),Ae(null)),ne instanceof Error&&!(ne.message in Le)&&(Le[ne.message]=!0,Ae(oe),T("Failed %s type: %s",P,ne.message),Ae(null))}}}var Et=Array.isArray;function gt(y){return Et(y)}function q(y){{var N=typeof Symbol=="function"&&Symbol.toStringTag,P=N&&y[Symbol.toStringTag]||y.constructor.name||"Object";return P}}function Rt(y){try{return St(y),!1}catch{return!0}}function St(y){return""+y}function xs(y){if(Rt(y))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q(y)),St(y)}var Ns=w.ReactCurrentOwner,on={key:!0,ref:!0,__self:!0,__source:!0},js,vs;function cn(y){if(Te.call(y,"ref")){var N=Object.getOwnPropertyDescriptor(y,"ref").get;if(N&&N.isReactWarning)return!1}return y.ref!==void 0}function dn(y){if(Te.call(y,"key")){var N=Object.getOwnPropertyDescriptor(y,"key").get;if(N&&N.isReactWarning)return!1}return y.key!==void 0}function hn(y,N){typeof y.ref=="string"&&Ns.current}function un(y,N){{var P=function(){js||(js=!0,T("%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)",N))};P.isReactWarning=!0,Object.defineProperty(y,"key",{get:P,configurable:!0})}}function mn(y,N){{var P=function(){vs||(vs=!0,T("%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)",N))};P.isReactWarning=!0,Object.defineProperty(y,"ref",{get:P,configurable:!0})}}var fn=function(y,N,P,z,oe,he,ae){var ne={$$typeof:t,type:y,key:N,ref:P,props:ae,_owner:he};return ne._store={},Object.defineProperty(ne._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ne,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(ne,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(ne.props),Object.freeze(ne)),ne};function pn(y,N,P,z,oe){{var he,ae={},ne=null,Ee=null;P!==void 0&&(xs(P),ne=""+P),dn(N)&&(xs(N.key),ne=""+N.key),cn(N)&&(Ee=N.ref,hn(N,oe));for(he in N)Te.call(N,he)&&!on.hasOwnProperty(he)&&(ae[he]=N[he]);if(y&&y.defaultProps){var _e=y.defaultProps;for(he in _e)ae[he]===void 0&&(ae[he]=_e[he])}if(ne||Ee){var we=typeof y=="function"?y.displayName||y.name||"Unknown":y;ne&&un(ae,we),Ee&&mn(ae,we)}return fn(y,ne,Ee,oe,z,Ns.current,ae)}}var Kt=w.ReactCurrentOwner,_s=w.ReactDebugCurrentFrame;function xt(y){if(y){var N=y._owner,P=fe(y.type,y._source,N?N.type:null);_s.setExtraStackFrame(P)}else _s.setExtraStackFrame(null)}var Qt;Qt=!1;function Zt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function bs(){{if(Kt.current){var y=$(Kt.current.type);if(y)return`
21
+ `+ne[_e].replace(" at new "," at ");return y.displayName&&We.includes("<anonymous>")&&(We=We.replace("<anonymous>",y.displayName)),typeof y=="function"&&I.set(y,We),We}while(_e>=1&&we>=0);break}}}finally{j=!1,x.current=he,yt(),Error.prepareStackTrace=oe}var Jt=y?y.displayName||y.name:"",kt=Jt?C(Jt):"";return typeof y=="function"&&I.set(y,kt),kt}function k(y,N,P){return S(y,!1)}function H(y){var N=y.prototype;return!!(N&&N.isReactComponent)}function fe(y,N,P){if(y==null)return"";if(typeof y=="function")return S(y,H(y));if(typeof y=="string")return C(y);switch(y){case l:return C("Suspense");case c:return C("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case o:return k(y.render);case u:return fe(y.type,N,P);case f:{var z=y,oe=z._payload,he=z._init;try{return fe(he(oe),N,P)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Le={},Pe=w.ReactDebugCurrentFrame;function Ae(y){if(y){var N=y._owner,P=fe(y.type,y._source,N?N.type:null);Pe.setExtraStackFrame(P)}else Pe.setExtraStackFrame(null)}function At(y,N,P,z,oe){{var he=Function.call.bind(Te);for(var ae in y)if(he(y,ae)){var ne=void 0;try{if(typeof y[ae]!="function"){var Ee=Error((z||"React class")+": "+P+" type `"+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}ne=y[ae](N,ae,z,P,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_e){ne=_e}ne&&!(ne instanceof Error)&&(Ae(oe),T("%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).",z||"React class",P,ae,typeof ne),Ae(null)),ne instanceof Error&&!(ne.message in Le)&&(Le[ne.message]=!0,Ae(oe),T("Failed %s type: %s",P,ne.message),Ae(null))}}}var Et=Array.isArray;function gt(y){return Et(y)}function V(y){{var N=typeof Symbol=="function"&&Symbol.toStringTag,P=N&&y[Symbol.toStringTag]||y.constructor.name||"Object";return P}}function Rt(y){try{return St(y),!1}catch{return!0}}function St(y){return""+y}function Ns(y){if(Rt(y))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",V(y)),St(y)}var js=w.ReactCurrentOwner,on={key:!0,ref:!0,__self:!0,__source:!0},vs,_s;function cn(y){if(Te.call(y,"ref")){var N=Object.getOwnPropertyDescriptor(y,"ref").get;if(N&&N.isReactWarning)return!1}return y.ref!==void 0}function dn(y){if(Te.call(y,"key")){var N=Object.getOwnPropertyDescriptor(y,"key").get;if(N&&N.isReactWarning)return!1}return y.key!==void 0}function hn(y,N){typeof y.ref=="string"&&js.current}function un(y,N){{var P=function(){vs||(vs=!0,T("%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)",N))};P.isReactWarning=!0,Object.defineProperty(y,"key",{get:P,configurable:!0})}}function mn(y,N){{var P=function(){_s||(_s=!0,T("%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)",N))};P.isReactWarning=!0,Object.defineProperty(y,"ref",{get:P,configurable:!0})}}var fn=function(y,N,P,z,oe,he,ae){var ne={$$typeof:t,type:y,key:N,ref:P,props:ae,_owner:he};return ne._store={},Object.defineProperty(ne._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ne,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(ne,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(ne.props),Object.freeze(ne)),ne};function pn(y,N,P,z,oe){{var he,ae={},ne=null,Ee=null;P!==void 0&&(Ns(P),ne=""+P),dn(N)&&(Ns(N.key),ne=""+N.key),cn(N)&&(Ee=N.ref,hn(N,oe));for(he in N)Te.call(N,he)&&!on.hasOwnProperty(he)&&(ae[he]=N[he]);if(y&&y.defaultProps){var _e=y.defaultProps;for(he in _e)ae[he]===void 0&&(ae[he]=_e[he])}if(ne||Ee){var we=typeof y=="function"?y.displayName||y.name||"Unknown":y;ne&&un(ae,we),Ee&&mn(ae,we)}return fn(y,ne,Ee,oe,z,js.current,ae)}}var Kt=w.ReactCurrentOwner,bs=w.ReactDebugCurrentFrame;function xt(y){if(y){var N=y._owner,P=fe(y.type,y._source,N?N.type:null);bs.setExtraStackFrame(P)}else bs.setExtraStackFrame(null)}var Qt;Qt=!1;function Zt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function Ss(){{if(Kt.current){var y=$(Kt.current.type);if(y)return`
22
22
 
23
- Check the render method of \``+y+"`."}return""}}function yn(y){return""}var Ss={};function gn(y){{var N=bs();if(!N){var P=typeof y=="string"?y:y.displayName||y.name;P&&(N=`
23
+ Check the render method of \``+y+"`."}return""}}function yn(y){return""}var Ts={};function gn(y){{var N=Ss();if(!N){var P=typeof y=="string"?y:y.displayName||y.name;P&&(N=`
24
24
 
25
- Check the top-level render call using <`+P+">.")}return N}}function Ts(y,N){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var P=gn(N);if(Ss[P])return;Ss[P]=!0;var z="";y&&y._owner&&y._owner!==Kt.current&&(z=" It was passed a child from "+$(y._owner.type)+"."),xt(y),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',P,z),xt(null)}}function ws(y,N){{if(typeof y!="object")return;if(gt(y))for(var P=0;P<y.length;P++){var z=y[P];Zt(z)&&Ts(z,N)}else if(Zt(y))y._store&&(y._store.validated=!0);else if(y){var oe=_(y);if(typeof oe=="function"&&oe!==y.entries)for(var he=oe.call(y),ae;!(ae=he.next()).done;)Zt(ae.value)&&Ts(ae.value,N)}}}function xn(y){{var N=y.type;if(N==null||typeof N=="string")return;var P;if(typeof N=="function")P=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===o||N.$$typeof===u))P=N.propTypes;else return;if(P){var z=$(N);At(P,y.props,"prop",z,y)}else if(N.PropTypes!==void 0&&!Qt){Qt=!0;var oe=$(N);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nn(y){{for(var N=Object.keys(y.props),P=0;P<N.length;P++){var z=N[P];if(z!=="children"&&z!=="key"){xt(y),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),xt(null);break}}y.ref!==null&&(xt(y),T("Invalid attribute `ref` supplied to `React.Fragment`."),xt(null))}}var Is={};function Cs(y,N,P,z,oe,he){{var ae=le(y);if(!ae){var ne="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(ne+=" 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 Ee=yn();Ee?ne+=Ee:ne+=bs();var _e;y===null?_e="null":gt(y)?_e="array":y!==void 0&&y.$$typeof===t?(_e="<"+($(y.type)||"Unknown")+" />",ne=" Did you accidentally export a JSX literal instead of a component?"):_e=typeof y,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_e,ne)}var we=pn(y,N,P,oe,he);if(we==null)return we;if(ae){var We=N.children;if(We!==void 0)if(z)if(gt(We)){for(var Jt=0;Jt<We.length;Jt++)ws(We[Jt],y);Object.freeze&&Object.freeze(We)}else T("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 ws(We,y)}if(Te.call(N,"key")){var kt=$(y),Fe=Object.keys(N).filter(function(Yh){return Yh!=="key"}),fr=Fe.length>0?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Is[kt+fr]){var Dh=Fe.length>0?"{"+Fe.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+P+">.")}return N}}function ws(y,N){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var P=gn(N);if(Ts[P])return;Ts[P]=!0;var z="";y&&y._owner&&y._owner!==Kt.current&&(z=" It was passed a child from "+$(y._owner.type)+"."),xt(y),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',P,z),xt(null)}}function Is(y,N){{if(typeof y!="object")return;if(gt(y))for(var P=0;P<y.length;P++){var z=y[P];Zt(z)&&ws(z,N)}else if(Zt(y))y._store&&(y._store.validated=!0);else if(y){var oe=v(y);if(typeof oe=="function"&&oe!==y.entries)for(var he=oe.call(y),ae;!(ae=he.next()).done;)Zt(ae.value)&&ws(ae.value,N)}}}function xn(y){{var N=y.type;if(N==null||typeof N=="string")return;var P;if(typeof N=="function")P=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===o||N.$$typeof===u))P=N.propTypes;else return;if(P){var z=$(N);At(P,y.props,"prop",z,y)}else if(N.PropTypes!==void 0&&!Qt){Qt=!0;var oe=$(N);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nn(y){{for(var N=Object.keys(y.props),P=0;P<N.length;P++){var z=N[P];if(z!=="children"&&z!=="key"){xt(y),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),xt(null);break}}y.ref!==null&&(xt(y),T("Invalid attribute `ref` supplied to `React.Fragment`."),xt(null))}}var Cs={};function Os(y,N,P,z,oe,he){{var ae=le(y);if(!ae){var ne="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(ne+=" 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 Ee=yn();Ee?ne+=Ee:ne+=Ss();var _e;y===null?_e="null":gt(y)?_e="array":y!==void 0&&y.$$typeof===t?(_e="<"+($(y.type)||"Unknown")+" />",ne=" Did you accidentally export a JSX literal instead of a component?"):_e=typeof y,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_e,ne)}var we=pn(y,N,P,oe,he);if(we==null)return we;if(ae){var We=N.children;if(We!==void 0)if(z)if(gt(We)){for(var Jt=0;Jt<We.length;Jt++)Is(We[Jt],y);Object.freeze&&Object.freeze(We)}else T("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 Is(We,y)}if(Te.call(N,"key")){var kt=$(y),Fe=Object.keys(N).filter(function(Yh){return Yh!=="key"}),fr=Fe.length>0?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Cs[kt+fr]){var Dh=Fe.length>0?"{"+Fe.join(": ..., ")+": ...}":"{}";T(`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} />`,fr,kt,Dh,kt),Is[kt+fr]=!0}}return y===r?Nn(we):xn(we),we}}function ee(y,N,P){return Cs(y,N,P,!0)}function v(y,N,P){return Cs(y,N,P,!1)}var Z=v,ue=ee;es.Fragment=r,es.jsx=Z,es.jsxs=ue}()),es}var xr;function si(){return xr||(xr=1,process.env.NODE_ENV==="production"?Os.exports=ei():Os.exports=ti()),Os.exports}var s=si(),Lt={},Nr;function ni(){if(Nr)return Lt;Nr=1;var e=Xa;if(process.env.NODE_ENV==="production")Lt.createRoot=e.createRoot,Lt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Lt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Lt.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return Lt}var ri=ni();const ai=pr(ri),ts=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
30
+ <%s key={someKey} {...props} />`,fr,kt,Dh,kt),Cs[kt+fr]=!0}}return y===r?Nn(we):xn(we),we}}function ee(y,N,P){return Os(y,N,P,!0)}function _(y,N,P){return Os(y,N,P,!1)}var Z=_,ue=ee;es.Fragment=r,es.jsx=Z,es.jsxs=ue}()),es}var xr;function si(){return xr||(xr=1,process.env.NODE_ENV==="production"?Ms.exports=ei():Ms.exports=ti()),Ms.exports}var s=si(),Lt={},Nr;function ni(){if(Nr)return Lt;Nr=1;var e=Xa;if(process.env.NODE_ENV==="production")Lt.createRoot=e.createRoot,Lt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Lt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Lt.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return Lt}var ri=ni();const ai=pr(ri),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 jr;function R(){return jr.apply(null,arguments)}function ii(e){jr=e}function ze(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 ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(ce(e,t))return!1;return!0}function Re(e){return e===void 0}function rt(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 vr(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function Nt(e,t){for(var n in t)ce(t,n)&&(e[n]=t[n]);return ce(t,"toString")&&(e.toString=t.toString),ce(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Qe(e,t,n,r){return qr(e,t,n,r,!0).utc()}function li(){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 X(e){return e._pf==null&&(e._pf=li()),e._pf}var vn;Array.prototype.some?vn=Array.prototype.some:vn=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 _n(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=X(e),n=vn.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 Ms(e){var t=Qe(NaN);return e!=null?Nt(X(t),e):X(t).userInvalidated=!0,t}var _r=R.momentProperties=[],bn=!1;function Sn(e,t){var n,r,i,a=_r.length;if(Re(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Re(t._i)||(e._i=t._i),Re(t._f)||(e._f=t._f),Re(t._l)||(e._l=t._l),Re(t._strict)||(e._strict=t._strict),Re(t._tzm)||(e._tzm=t._tzm),Re(t._isUTC)||(e._isUTC=t._isUTC),Re(t._offset)||(e._offset=t._offset),Re(t._pf)||(e._pf=X(t)),Re(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=_r[n],i=t[r],Re(i)||(e[r]=i);return e}function ns(e){Sn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),bn===!1&&(bn=!0,R.updateOffset(this),bn=!1)}function Ge(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function br(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=[],i,a,d,m=arguments.length;for(a=0;a<m;a++){if(i="",typeof arguments[a]=="object"){i+=`
35
+ var jr;function R(){return jr.apply(null,arguments)}function ii(e){jr=e}function ze(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 ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(ce(e,t))return!1;return!0}function Re(e){return e===void 0}function rt(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 vr(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function Nt(e,t){for(var n in t)ce(t,n)&&(e[n]=t[n]);return ce(t,"toString")&&(e.toString=t.toString),ce(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Qe(e,t,n,r){return qr(e,t,n,r,!0).utc()}function li(){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 X(e){return e._pf==null&&(e._pf=li()),e._pf}var vn;Array.prototype.some?vn=Array.prototype.some:vn=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 _n(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=X(e),n=vn.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 As(e){var t=Qe(NaN);return e!=null?Nt(X(t),e):X(t).userInvalidated=!0,t}var _r=R.momentProperties=[],bn=!1;function Sn(e,t){var n,r,i,a=_r.length;if(Re(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Re(t._i)||(e._i=t._i),Re(t._f)||(e._f=t._f),Re(t._l)||(e._l=t._l),Re(t._strict)||(e._strict=t._strict),Re(t._tzm)||(e._tzm=t._tzm),Re(t._isUTC)||(e._isUTC=t._isUTC),Re(t._offset)||(e._offset=t._offset),Re(t._pf)||(e._pf=X(t)),Re(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=_r[n],i=t[r],Re(i)||(e[r]=i);return e}function ns(e){Sn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),bn===!1&&(bn=!0,R.updateOffset(this),bn=!1)}function Ge(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function br(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=[],i,a,d,m=arguments.length;for(a=0;a<m;a++){if(i="",typeof arguments[a]=="object"){i+=`
36
36
  [`+a+"] ";for(d in arguments[0])ce(arguments[0],d)&&(i+=d+": "+arguments[0][d]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}br(e+`
37
37
  Arguments: `+Array.prototype.slice.call(r).join("")+`
38
- `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Sr={};function Tr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),Sr[e]||(br(t),Sr[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Ze(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function oi(e){var t,n;for(n in e)ce(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 Tn(e,t){var n=Nt({},e),r;for(r in t)ce(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)ce(e,r)&&!ce(t,r)&&Tt(e[r])&&(n[r]=Nt({},n[r]));return n}function wn(e){e!=null&&this.set(e)}var In;Object.keys?In=Object.keys:In=function(e){var t,n=[];for(t in e)ce(e,t)&&n.push(t);return n};var ci={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function di(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 Cn=/(\[[^\[]*\])|(\\)?([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,As=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,On={},Pt={};function B(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Pt[e]=i),t&&(Pt[t[0]]=function(){return Je(i.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function hi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function ui(e){var t=e.match(Cn),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=hi(t[n]);return function(i){var a="",d;for(d=0;d<r;d++)a+=Ze(t[d])?t[d].call(i,e):t[d];return a}}function Es(e,t){return e.isValid()?(t=wr(t,e.localeData()),On[t]=On[t]||ui(t),On[t](e)):e.localeData().invalidDate()}function wr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(As.lastIndex=0;n>=0&&As.test(e);)e=e.replace(As,r),As.lastIndex=0,n-=1;return e}var mi={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 fi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Cn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var pi="Invalid date";function yi(){return this._invalidDate}var gi="%d",xi=/\d{1,2}/;function Ni(e){return this._ordinal.replace("%d",e)}var ji={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 vi(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function _i(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var Ir={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"?Ir[e]||Ir[e.toLowerCase()]:void 0}function Mn(e){var t={},n,r;for(r in e)ce(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var bi={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 Si(e){var t=[],n;for(n in e)ce(e,n)&&t.push({unit:n,priority:bi[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Cr=/\d/,De=/\d\d/,Or=/\d{3}/,An=/\d{4}/,Rs=/[+-]?\d{6}/,pe=/\d\d?/,Mr=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,En=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,Ps=/[+-]?\d+/,Ti=/Z|[+-]\d\d:?\d\d/gi,Fs=/Z|[+-]\d\d(?::?\d\d)?/gi,wi=/[+-]?\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?/,Rn=/^([1-9]\d|\d)/,Ds;Ds={};function Y(e,t,n){Ds[e]=Ze(t)?t:function(r,i){return r&&n?n:t}}function Ii(e,t){return ce(Ds,e)?Ds[e](t._strict,t._locale):new RegExp(Ci(e))}function Ci(e){return at(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function at(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function He(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function se(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=He(t)),n}var kn={};function me(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),rt(t)&&(r=function(a,d){d[t]=se(a)}),i=e.length,n=0;n<i;n++)kn[e[n]]=r}function as(e,t){me(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Oi(e,t,n){t!=null&&ce(kn,e)&&kn[e](t,n._a,n,e)}function Ys(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,it=1,Xe=2,Ie=3,Ve=4,lt=5,wt=6,Mi=7,Ai=8;B("Y",0,0,function(){var e=this.year();return e<=9999?Je(e,4):"+"+e}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),Y("Y",Ps),Y("YY",pe,De),Y("YYYY",En,An),Y("YYYYY",Ls,Rs),Y("YYYYYY",Ls,Rs),me(["YYYYY","YYYYYY"],Me),me("YYYY",function(e,t){t[Me]=e.length===2?R.parseTwoDigitYear(e):se(e)}),me("YY",function(e,t){t[Me]=R.parseTwoDigitYear(e)}),me("Y",function(e,t){t[Me]=parseInt(e,10)});function is(e){return Ys(e)?366:365}R.parseTwoDigitYear=function(e){return se(e)+(se(e)>68?1900:2e3)};var Er=Yt("FullYear",!0);function Ei(){return Ys(this.year())}function Yt(e,t){return function(n){return n!=null?(Rr(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 Rr(e,t,n){var r,i,a,d,m;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,d=e.month(),m=e.date(),m=m===29&&d===1&&!Ys(a)?28:m,i?r.setUTCFullYear(a,d,m):r.setFullYear(a,d,m)}}function Ri(e){return e=$e(e),Ze(this[e])?this[e]():this}function ki(e,t){if(typeof e=="object"){e=Mn(e);var n=Si(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),Ze(this[e]))return this[e](t);return this}function Li(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 Ln(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Li(t,12);return e+=(t-n)/12,n===1?Ys(e)?29:28:31-n%7%2}B("M",["MM",2],"Mo",function(){return this.month()+1}),B("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),B("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("M",pe,Dt),Y("MM",pe,De),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[it]=se(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[it]=i:X(n).invalidMonth=e});var Pi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Lr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fi=rs,Di=rs;function Yi(e,t){return e?ze(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Lr).test(t)?"format":"standalone"][e.month()]:ze(this._months)?this._months:this._months.standalone}function Ui(e,t){return e?ze(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Lr.test(t)?"format":"standalone"][e.month()]:ze(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $i(e,t,n){var r,i,a,d=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,d),i!==-1?i:null):(i=je.call(this._longMonthsParse,d),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,d),i!==-1?i:(i=je.call(this._longMonthsParse,d),i!==-1?i:null)):(i=je.call(this._longMonthsParse,d),i!==-1?i:(i=je.call(this._shortMonthsParse,d),i!==-1?i:null))}function Hi(e,t,n){var r,i,a;if(this._monthsParseExact)return $i.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 Pr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=se(t);else if(t=e.localeData().monthsParse(t),!rt(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Ln(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Fr(e){return e!=null?(Pr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Bi(){return Ln(this.year(),this.month())}function Wi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Dr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=Fi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function zi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Dr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=Di),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Dr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,d,m;for(i=0;i<12;i++)a=Qe([2e3,i]),d=at(this.monthsShort(a,"")),m=at(this.months(a,"")),t.push(d),n.push(m),r.push(m),r.push(d);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 Gi(e,t,n,r,i,a,d){var m;return e<100&&e>=0?(m=new Date(e+400,t,n,r,i,a,d),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,n,r,i,a,d),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 Us(e,t,n){var r=7+t-n,i=(7+os(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Yr(e,t,n,r,i){var a=(7+n-r)%7,d=Us(e,r,i),m=1+7*(t-1)+a+d,o,l;return m<=0?(o=e-1,l=is(o)+m):m>is(e)?(o=e+1,l=m-is(e)):(o=e,l=m),{year:o,dayOfYear:l}}function cs(e,t,n){var r=Us(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,d;return i<1?(d=e.year()-1,a=i+ot(d,t,n)):i>ot(e.year(),t,n)?(a=i-ot(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ot(e,t,n){var r=Us(e,t,n),i=Us(e+1,t,n);return(is(e)-r+i)/7}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),Y("w",pe,Dt),Y("ww",pe,De),Y("W",pe,Dt),Y("WW",pe,De),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=se(e)});function Vi(e){return cs(e,this._week.dow,this._week.doy).week}var qi={dow:0,doy:6};function Ki(){return this._week.dow}function Qi(){return this._week.doy}function Zi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Ji(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}B("d",0,"do","day"),B("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),Y("d",pe),Y("e",pe),Y("E",pe),Y("dd",function(e,t){return t.weekdaysMinRegex(e)}),Y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Y("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:X(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=se(e)});function Xi(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function el(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var tl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ur="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),nl=rs,rl=rs,al=rs;function il(e,t){var n=ze(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Pn(n,this._week.dow):e?n[e.day()]:n}function ll(e){return e===!0?Pn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ol(e){return e===!0?Pn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function cl(e,t,n){var r,i,a,d=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,d),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,d),i!==-1||(i=je.call(this._shortWeekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null))}function dl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return cl.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 hl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Xi(e,this.localeData()),this.add(e-t,"d")):t}function ul(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 ml(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=el(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function fl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=nl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function pl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=rl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function yl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=al),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fn(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],i=[],a,d,m,o,l;for(a=0;a<7;a++)d=Qe([2e3,1]).day(a),m=at(this.weekdaysMin(d,"")),o=at(this.weekdaysShort(d,"")),l=at(this.weekdays(d,"")),t.push(m),n.push(o),r.push(l),i.push(m),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 Dn(){return this.hours()%12||12}function gl(){return this.hours()||24}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Dn),B("k",["kk",2],0,gl),B("hmm",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)}),B("hmmss",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)+Je(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+Je(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+Je(this.minutes(),2)+Je(this.seconds(),2)});function $r(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}$r("a",!0),$r("A",!1);function Hr(e,t){return t._meridiemParse}Y("a",Hr),Y("A",Hr),Y("H",pe,Rn),Y("h",pe,Dt),Y("k",pe,Dt),Y("HH",pe,De),Y("hh",pe,De),Y("kk",pe,De),Y("hmm",Mr),Y("hmmss",Ar),Y("Hmm",Mr),Y("Hmmss",Ar),me(["H","HH"],Ie),me(["k","kk"],function(e,t,n){var r=se(e);t[Ie]=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[Ie]=se(e),X(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r)),X(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r,2)),t[lt]=se(e.substr(i)),X(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r,2)),t[lt]=se(e.substr(i))});function xl(e){return(e+"").toLowerCase().charAt(0)==="p"}var Nl=/[ap]\.?m?\.?/i,jl=Yt("Hours",!0);function vl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Br={calendar:ci,longDateFormat:mi,invalidDate:pi,ordinal:gi,dayOfMonthOrdinalParse:xi,relativeTime:ji,months:Pi,monthsShort:kr,week:qi,weekdays:tl,weekdaysMin:sl,weekdaysShort:Ur,meridiemParse:Nl},ge={},ds={},hs;function _l(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 Wr(e){return e&&e.toLowerCase().replace("_","-")}function bl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Wr(e[t]).split("-"),n=a.length,r=Wr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=$s(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&_l(a,r)>=n-1)break;n--}t++}return hs}function Sl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function $s(e){var t=null,n;if(ge[e]===void 0&&typeof module<"u"&&module&&module.exports&&Sl(e))try{t=hs._abbr,n=require,n("./locale/"+e),jt(t)}catch{ge[e]=null}return ge[e]}function jt(e,t){var n;return e&&(Re(t)?n=ct(e):n=Yn(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 Yn(e,t){if(t!==null){var n,r=Br;if(t.abbr=e,ge[e]!=null)Tr("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=$s(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 ge[e]=new wn(Tn(r,t)),ds[e]&&ds[e].forEach(function(i){Yn(i.name,i.config)}),jt(e),ge[e]}else return delete ge[e],null}function Tl(e,t){if(t!=null){var n,r,i=Br;ge[e]!=null&&ge[e].parentLocale!=null?ge[e].set(Tn(ge[e]._config,t)):(r=$s(e),r!=null&&(i=r._config),t=Tn(i,t),r==null&&(t.abbr=e),n=new wn(t),n.parentLocale=ge[e],ge[e]=n),jt(e)}else ge[e]!=null&&(ge[e].parentLocale!=null?(ge[e]=ge[e].parentLocale,e===jt()&&jt(e)):ge[e]!=null&&delete ge[e]);return ge[e]}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!ze(e)){if(t=$s(e),t)return t;e=[e]}return bl(e)}function wl(){return In(ge)}function Un(e){var t,n=e._a;return n&&X(e).overflow===-2&&(t=n[it]<0||n[it]>11?it:n[Xe]<1||n[Xe]>Ln(n[Me],n[it])?Xe:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[Ve]!==0||n[lt]!==0||n[wt]!==0)?Ie:n[Ve]<0||n[Ve]>59?Ve:n[lt]<0||n[lt]>59?lt:n[wt]<0||n[wt]>999?wt:-1,X(e)._overflowDayOfYear&&(t<Me||t>Xe)&&(t=Xe),X(e)._overflowWeeks&&t===-1&&(t=Mi),X(e)._overflowWeekday&&t===-1&&(t=Ai),X(e).overflow=t),e}var Il=/^\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)?)?$/,Cl=/^\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)?)?$/,Ol=/Z|[+-]\d\d(?::?\d\d)?/,Hs=[["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]],$n=[["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/]],Ml=/^\/?Date\((-?\d+)/i,Al=/^(?:(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}))$/,El={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 zr(e){var t,n,r=e._i,i=Il.exec(r)||Cl.exec(r),a,d,m,o,l=Hs.length,c=$n.length;if(i){for(X(e).iso=!0,t=0,n=l;t<n;t++)if(Hs[t][1].exec(i[1])){d=Hs[t][0],a=Hs[t][2]!==!1;break}if(d==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if($n[t][1].exec(i[3])){m=(i[2]||" ")+$n[t][0];break}if(m==null){e._isValid=!1;return}}if(!a&&m!=null){e._isValid=!1;return}if(i[4])if(Ol.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(m||"")+(o||""),Bn(e)}else e._isValid=!1}function Rl(e,t,n,r,i,a){var d=[kl(e),kr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function kl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ll(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Pl(e,t,n){if(e){var r=Ur.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return X(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Fl(e,t,n){if(e)return El[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Gr(e){var t=Al.exec(Ll(e._i)),n;if(t){if(n=Rl(t[4],t[3],t[2],t[5],t[6],t[7]),!Pl(t[1],n,e))return;e._a=n,e._tzm=Fl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),X(e).rfc2822=!0}else e._isValid=!1}function Dl(e){var t=Ml.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(zr(e),e._isValid===!1)delete e._isValid;else return;if(Gr(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 Yl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Hn(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Yl(e),e._w&&e._a[Xe]==null&&e._a[it]==null&&Ul(e),e._dayOfYear!=null&&(d=Ut(e._a[Me],i[Me]),(e._dayOfYear>is(d)||e._dayOfYear===0)&&(X(e)._overflowDayOfYear=!0),n=os(d,0,e._dayOfYear),e._a[it]=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[Ie]===24&&e._a[Ve]===0&&e._a[lt]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:Gi).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[Ie]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(X(e).weekdayMismatch=!0)}}function Ul(e){var t,n,r,i,a,d,m,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,d=4,n=Ut(t.GG,e._a[Me],cs(ye(),1,4).year),r=Ut(t.W,1),i=Ut(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,d=e._locale._week.doy,l=cs(ye(),a,d),n=Ut(t.gg,e._a[Me],l.year),r=Ut(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>ot(n,a,d)?X(e)._overflowWeeks=!0:o!=null?X(e)._overflowWeekday=!0:(m=Yr(n,r,i,a,d),e._a[Me]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Bn(e){if(e._f===R.ISO_8601){zr(e);return}if(e._f===R.RFC_2822){Gr(e);return}e._a=[],X(e).empty=!0;var t=""+e._i,n,r,i,a,d,m=t.length,o=0,l,c;for(i=wr(e._f,e._locale).match(Cn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ii(a,e))||[])[0],r&&(d=t.substr(0,t.indexOf(r)),d.length>0&&X(e).unusedInput.push(d),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Pt[a]?(r?X(e).empty=!1:X(e).unusedTokens.push(a),Oi(a,r,e)):e._strict&&!r&&X(e).unusedTokens.push(a);X(e).charsLeftOver=m-o,t.length>0&&X(e).unusedInput.push(t),e._a[Ie]<=12&&X(e).bigHour===!0&&e._a[Ie]>0&&(X(e).bigHour=void 0),X(e).parsedDateParts=e._a.slice(0),X(e).meridiem=e._meridiem,e._a[Ie]=$l(e._locale,e._a[Ie],e._meridiem),l=X(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),Hn(e),Un(e)}function $l(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 Hl(e){var t,n,r,i,a,d,m=!1,o=e._f.length;if(o===0){X(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,d=!1,t=Sn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Bn(t),_n(t)&&(d=!0),a+=X(t).charsLeftOver,a+=X(t).unusedTokens.length*10,X(t).score=a,m?a<r&&(r=a,n=t):(r==null||a<r||d)&&(r=a,n=t,d&&(m=!0));Nt(e,n||t)}function Bl(e){if(!e._d){var t=Mn(e._i),n=t.day===void 0?t.date:t.day;e._a=vr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Hn(e)}}function Wl(e){var t=new ns(Un(Vr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Vr(e){var t=e._i,n=e._f;return e._locale=e._locale||ct(e._l),t===null||n===void 0&&t===""?Ms({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ge(t)?new ns(Un(t)):(ss(t)?e._d=t:ze(n)?Hl(e):n?Bn(e):zl(e),_n(e)||(e._d=null),e))}function zl(e){var t=e._i;Re(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Dl(e):ze(t)?(e._a=vr(t.slice(0),function(n){return parseInt(n,10)}),Hn(e)):Tt(t)?Bl(e):rt(t)?e._d=new Date(t):R.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),(Tt(e)&&jn(e)||ze(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,Wl(a)}function ye(e,t,n,r){return qr(e,t,n,r,!1)}var Gl=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:Ms()}),Vl=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:Ms()});function Kr(e,t){var n,r;if(t.length===1&&ze(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 Kr("isBefore",e)}function Kl(){var e=[].slice.call(arguments,0);return Kr("isAfter",e)}var Ql=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Zl(e){var t,n=!1,r,i=us.length;for(t in e)if(ce(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==se(e[us[r]])&&(n=!0)}return!0}function Jl(){return this._isValid}function Xl(){return qe(NaN)}function Bs(e){var t=Mn(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,m=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Zl(t),this._milliseconds=+c+l*1e3+o*6e4+m*1e3*60*60,this._days=+d+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ct(),this._bubble()}function Ws(e){return e instanceof Bs}function Wn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function eo(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,d;for(d=0;d<r;d++)se(e[d])!==se(t[d])&&a++;return a+i}function Qr(e,t){B(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)})}Qr("Z",":"),Qr("ZZ",""),Y("Z",Fs),Y("ZZ",Fs),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zn(Fs,e)});var to=/([\+\-]|\d\d)/gi;function zn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(to)||["-",0,0],a=+(i[1]*60)+se(i[2]),a===0?0:i[0]==="+"?a:-a)}function Gn(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 Vn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function so(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=zn(Fs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Vn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ea(this,qe(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Vn(this)}function no(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ro(e){return this.utcOffset(0,e)}function ao(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vn(this),"m")),this}function io(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=zn(Ti,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function lo(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function oo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function co(){if(!Re(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Sn(e,this),e=Vr(e),e._a?(t=e._isUTC?Qe(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&eo(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ho(){return this.isValid()?!this._isUTC:!1}function uo(){return this.isValid()?this._isUTC:!1}function Zr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var mo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,fo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function qe(e,t){var n=e,r=null,i,a,d;return Ws(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:rt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[Xe])*i,h:se(r[Ie])*i,m:se(r[Ve])*i,s:se(r[lt])*i,ms:se(Wn(r[wt]*1e3))*i}):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:It(r[2],i),M:It(r[3],i),w:It(r[4],i),d:It(r[5],i),h:It(r[6],i),m:It(r[7],i),s:It(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(d=po(ye(n.from),ye(n.to)),n={},n.ms=d.milliseconds,n.M=d.months),a=new Bs(n),Ws(e)&&ce(e,"_locale")&&(a._locale=e._locale),Ws(e)&&ce(e,"_isValid")&&(a._isValid=e._isValid),a}qe.fn=Bs.prototype,qe.invalid=Xl;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jr(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 po(e,t){var n;return e.isValid()&&t.isValid()?(t=Gn(t,e),e.isBefore(t)?n=Jr(e,t):(n=Jr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Xr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Tr(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=qe(n,r),ea(this,i,e),this}}function ea(e,t,n,r){var i=t._milliseconds,a=Wn(t._days),d=Wn(t._months);e.isValid()&&(r=r??!0,d&&Pr(e,ls(e,"Month")+d*n),a&&Rr(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var yo=Xr(1,"add"),go=Xr(-1,"subtract");function ta(e){return typeof e=="string"||e instanceof String}function xo(e){return Ge(e)||ss(e)||ta(e)||rt(e)||jo(e)||No(e)||e===null||e===void 0}function No(e){var t=Tt(e)&&!jn(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,d=r.length;for(i=0;i<d;i+=1)a=r[i],n=n||ce(e,a);return t&&n}function jo(e){var t=ze(e),n=!1;return t&&(n=e.filter(function(r){return!rt(r)&&ta(e)}).length===0),t&&n}function vo(e){var t=Tt(e)&&!jn(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||ce(e,a);return t&&n}function _o(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 bo(e,t){arguments.length===1&&(arguments[0]?xo(arguments[0])?(e=arguments[0],t=void 0):vo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=Gn(n,this).startOf("day"),i=R.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,ye(n)))}function So(){return new ns(this)}function To(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 wo(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 Io(e,t,n,r){var i=Ge(e)?e:ye(e),a=Ge(t)?t:ye(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 Co(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 Oo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Mo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ao(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=Gn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=$e(t),t){case"year":a=zs(this,r)/12;break;case"month":a=zs(this,r);break;case"quarter":a=zs(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:He(a)}function zs(e,t){if(e.date()<t.date())return-zs(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}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Eo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ro(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Es(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",Es(n,"Z")):Es(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){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 Lo(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Es(this,e);return this.localeData().postformat(t)}function Po(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?qe({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Fo(e){return this.from(ye(),e)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?qe({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.to(ye(),e)}function sa(e){var t;return e===void 0?this._locale._abbr:(t=ct(e),t!=null&&(this._locale=t),this)}var na=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 ra(){return this._locale}var Gs=1e3,$t=60*Gs,Vs=60*$t,aa=(365*400+97)*24*Vs;function Ht(e,t){return(e%t+t)%t}function ia(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-aa:new Date(e,t,n).valueOf()}function la(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-aa:Date.UTC(e,t,n)}function Uo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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),Vs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Gs);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function $o(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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+=Vs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),Vs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Gs-Ht(t,Gs)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Ho(){return this._d.valueOf()-(this._offset||0)*6e4}function Bo(){return Math.floor(this.valueOf()/1e3)}function Wo(){return new Date(this.valueOf())}function zo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Go(){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 Vo(){return this.isValid()?this.toISOString():null}function qo(){return _n(this)}function Ko(){return Nt({},X(this))}function Qo(){return X(this).overflow}function Zo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Y("N",qn),Y("NN",qn),Y("NNN",qn),Y("NNNN",oc),Y("NNNNN",cc),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?X(n).era=i:X(n).invalidEra=e}),Y("y",Ft),Y("yy",Ft),Y("yyy",Ft),Y("yyyy",Ft),Y("yo",dc),me(["y","yy","yyy","yyyy"],Me),me(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Me]=n._locale.eraYearOrdinalParse(e,i):t[Me]=parseInt(e,10)});function Jo(e,t){var n,r,i,a=this._eras||ct("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=R(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=R(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function Xo(e,t,n){var r,i,a=this.eras(),d,m,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(d=a[r].name.toUpperCase(),m=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(m===e)return a[r];break;case"NNNN":if(d===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([d,m,o].indexOf(e)>=0)return a[r]}function ec(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 tc(){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 sc(){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 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].abbr;return""}function rc(){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()-R(i[e].since).year())*n+i[e].offset;return this.year()}function ac(e){return ce(this,"_erasNameRegex")||Kn.call(this),e?this._erasNameRegex:this._erasRegex}function ic(e){return ce(this,"_erasAbbrRegex")||Kn.call(this),e?this._erasAbbrRegex:this._erasRegex}function lc(e){return ce(this,"_erasNarrowRegex")||Kn.call(this),e?this._erasNarrowRegex:this._erasRegex}function qn(e,t){return t.erasAbbrRegex(e)}function oc(e,t){return t.erasNameRegex(e)}function cc(e,t){return t.erasNarrowRegex(e)}function dc(e,t){return t._eraYearOrdinalRegex||Ft}function Kn(){var e=[],t=[],n=[],r=[],i,a,d,m,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=at(l[i].name),m=at(l[i].abbr),o=at(l[i].narrow),t.push(d),e.push(m),n.push(o),r.push(d),r.push(m),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")}B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100});function qs(e,t){B(0,[e,e.length],0,t)}qs("gggg","weekYear"),qs("ggggg","weekYear"),qs("GGGG","isoWeekYear"),qs("GGGGG","isoWeekYear"),Y("G",Ps),Y("g",Ps),Y("GG",pe,De),Y("gg",pe,De),Y("GGGG",En,An),Y("gggg",En,An),Y("GGGGG",Ls,Rs),Y("ggggg",Ls,Rs),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=se(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function hc(e){return oa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function uc(e){return oa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function mc(){return ot(this.year(),1,4)}function fc(){return ot(this.isoWeekYear(),1,4)}function pc(){var e=this.localeData()._week;return ot(this.year(),e.dow,e.doy)}function yc(){var e=this.localeData()._week;return ot(this.weekYear(),e.dow,e.doy)}function oa(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=ot(e,r,i),t>a&&(t=a),gc.call(this,e,t,n,r,i))}function gc(e,t,n,r,i){var a=Yr(e,t,n,r,i),d=os(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}B("Q",0,"Qo","quarter"),Y("Q",Cr),me("Q",function(e,t){t[it]=(se(e)-1)*3});function xc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}B("D",["DD",2],"Do","date"),Y("D",pe,Dt),Y("DD",pe,De),Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],Xe),me("Do",function(e,t){t[Xe]=se(e.match(pe)[0])});var ca=Yt("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",ks),Y("DDDD",Or),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=se(e)});function Nc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}B("m",["mm",2],0,"minute"),Y("m",pe,Rn),Y("mm",pe,De),me(["m","mm"],Ve);var jc=Yt("Minutes",!1);B("s",["ss",2],0,"second"),Y("s",pe,Rn),Y("ss",pe,De),me(["s","ss"],lt);var vc=Yt("Seconds",!1);B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return this.millisecond()*10}),B(0,["SSSSS",5],0,function(){return this.millisecond()*100}),B(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),B(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),B(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),B(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Y("S",ks,Cr),Y("SS",ks,De),Y("SSS",ks,Or);var vt,da;for(vt="SSSS";vt.length<=9;vt+="S")Y(vt,Ft);function _c(e,t){t[wt]=se(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,_c);da=Yt("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");function bc(){return this._isUTC?"UTC":""}function Sc(){return this._isUTC?"Coordinated Universal Time":""}var E=ns.prototype;E.add=yo,E.calendar=bo,E.clone=So,E.diff=Ao,E.endOf=$o,E.format=Lo,E.from=Po,E.fromNow=Fo,E.to=Do,E.toNow=Yo,E.get=Ri,E.invalidAt=Qo,E.isAfter=To,E.isBefore=wo,E.isBetween=Io,E.isSame=Co,E.isSameOrAfter=Oo,E.isSameOrBefore=Mo,E.isValid=qo,E.lang=na,E.locale=sa,E.localeData=ra,E.max=Vl,E.min=Gl,E.parsingFlags=Ko,E.set=ki,E.startOf=Uo,E.subtract=go,E.toArray=zo,E.toObject=Go,E.toDate=Wo,E.toISOString=Ro,E.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Vo,E.toString=Eo,E.unix=Bo,E.valueOf=Ho,E.creationData=Zo,E.eraName=tc,E.eraNarrow=sc,E.eraAbbr=nc,E.eraYear=rc,E.year=Er,E.isLeapYear=Ei,E.weekYear=hc,E.isoWeekYear=uc,E.quarter=E.quarters=xc,E.month=Fr,E.daysInMonth=Bi,E.week=E.weeks=Zi,E.isoWeek=E.isoWeeks=Ji,E.weeksInYear=pc,E.weeksInWeekYear=yc,E.isoWeeksInYear=mc,E.isoWeeksInISOWeekYear=fc,E.date=ca,E.day=E.days=hl,E.weekday=ul,E.isoWeekday=ml,E.dayOfYear=Nc,E.hour=E.hours=jl,E.minute=E.minutes=jc,E.second=E.seconds=vc,E.millisecond=E.milliseconds=da,E.utcOffset=so,E.utc=ro,E.local=ao,E.parseZone=io,E.hasAlignedHourOffset=lo,E.isDST=oo,E.isLocal=ho,E.isUtcOffset=uo,E.isUtc=Zr,E.isUTC=Zr,E.zoneAbbr=bc,E.zoneName=Sc,E.dates=Ue("dates accessor is deprecated. Use date instead.",ca),E.months=Ue("months accessor is deprecated. Use month instead",Fr),E.years=Ue("years accessor is deprecated. Use year instead",Er),E.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",no),E.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",co);function Tc(e){return ye(e*1e3)}function wc(){return ye.apply(null,arguments).parseZone()}function ha(e){return e}var de=wn.prototype;de.calendar=di,de.longDateFormat=fi,de.invalidDate=yi,de.ordinal=Ni,de.preparse=ha,de.postformat=ha,de.relativeTime=vi,de.pastFuture=_i,de.set=oi,de.eras=Jo,de.erasParse=Xo,de.erasConvertYear=ec,de.erasAbbrRegex=ic,de.erasNameRegex=ac,de.erasNarrowRegex=lc,de.months=Yi,de.monthsShort=Ui,de.monthsParse=Hi,de.monthsRegex=zi,de.monthsShortRegex=Wi,de.week=Vi,de.firstDayOfYear=Qi,de.firstDayOfWeek=Ki,de.weekdays=il,de.weekdaysMin=ol,de.weekdaysShort=ll,de.weekdaysParse=dl,de.weekdaysRegex=fl,de.weekdaysShortRegex=pl,de.weekdaysMinRegex=yl,de.isPM=xl,de.meridiem=vl;function Ks(e,t,n,r){var i=ct(),a=Qe().set(r,t);return i[n](a,e)}function ua(e,t,n){if(rt(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ks(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ks(e,r,n,"month");return i}function Qn(e,t,n,r){typeof e=="boolean"?(rt(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,rt(t)&&(n=t,t=void 0),t=t||"");var i=ct(),a=e?i._week.dow:0,d,m=[];if(n!=null)return Ks(t,(n+a)%7,r,"day");for(d=0;d<7;d++)m[d]=Ks(t,(d+a)%7,r,"day");return m}function Ic(e,t){return ua(e,t,"months")}function Cc(e,t){return ua(e,t,"monthsShort")}function Oc(e,t,n){return Qn(e,t,n,"weekdays")}function Mc(e,t,n){return Qn(e,t,n,"weekdaysShort")}function Ac(e,t,n){return Qn(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=se(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.",ct);var dt=Math.abs;function Ec(){var e=this._data;return this._milliseconds=dt(this._milliseconds),this._days=dt(this._days),this._months=dt(this._months),e.milliseconds=dt(e.milliseconds),e.seconds=dt(e.seconds),e.minutes=dt(e.minutes),e.hours=dt(e.hours),e.months=dt(e.months),e.years=dt(e.years),this}function ma(e,t,n,r){var i=qe(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Rc(e,t){return ma(this,e,t,1)}function kc(e,t){return ma(this,e,t,-1)}function fa(e){return e<0?Math.floor(e):Math.ceil(e)}function Lc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,d,m,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=fa(Zn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=He(e/1e3),r.seconds=i%60,a=He(i/60),r.minutes=a%60,d=He(a/60),r.hours=d%24,t+=He(d/24),o=He(pa(t)),n+=o,t-=fa(Zn(o)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function pa(e){return e*4800/146097}function Zn(e){return e*146097/4800}function Pc(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+pa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Zn(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 ht(e){return function(){return this.as(e)}}var ya=ht("ms"),Fc=ht("s"),Dc=ht("m"),Yc=ht("h"),Uc=ht("d"),$c=ht("w"),Hc=ht("M"),Bc=ht("Q"),Wc=ht("y"),zc=ya;function Gc(){return qe(this)}function Vc(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"),Kc=Ct("seconds"),Qc=Ct("minutes"),Zc=Ct("hours"),Jc=Ct("days"),Xc=Ct("months"),ed=Ct("years");function td(){return He(this.days()/7)}var ut=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function sd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function nd(e,t,n,r){var i=qe(e).abs(),a=ut(i.as("s")),d=ut(i.as("m")),m=ut(i.as("h")),o=ut(i.as("d")),l=ut(i.as("M")),c=ut(i.as("w")),u=ut(i.as("y")),f=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||d<=1&&["m"]||d<n.m&&["mm",d]||m<=1&&["h"]||m<n.h&&["hh",m]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),f=f||l<=1&&["M"]||l<n.M&&["MM",l]||u<=1&&["y"]||["yy",u],f[2]=t,f[3]=+e>0,f[4]=r,sd.apply(null,f)}function rd(e){return e===void 0?ut:typeof e=="function"?(ut=e,!0):!1}function ad(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function id(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,i,a;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)),i=this.localeData(),a=nd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Jn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Qs(){if(!this.isValid())return this.localeData().invalidDate();var e=Jn(this._milliseconds)/1e3,t=Jn(this._days),n=Jn(this._months),r,i,a,d,m=this.asSeconds(),o,l,c,u;return m?(r=He(e/60),i=He(r/60),e%=60,r%=60,a=He(n/12),n%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=m<0?"-":"",l=Wt(this._months)!==Wt(m)?"-":"",c=Wt(this._days)!==Wt(m)?"-":"",u=Wt(this._milliseconds)!==Wt(m)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?u+i+"H":"")+(r?u+r+"M":"")+(e?u+d+"S":"")):"P0D"}var re=Bs.prototype;re.isValid=Jl,re.abs=Ec,re.add=Rc,re.subtract=kc,re.as=Pc,re.asMilliseconds=ya,re.asSeconds=Fc,re.asMinutes=Dc,re.asHours=Yc,re.asDays=Uc,re.asWeeks=$c,re.asMonths=Hc,re.asQuarters=Bc,re.asYears=Wc,re.valueOf=zc,re._bubble=Lc,re.clone=Gc,re.get=Vc,re.milliseconds=qc,re.seconds=Kc,re.minutes=Qc,re.hours=Zc,re.days=Jc,re.weeks=td,re.months=Xc,re.years=ed,re.humanize=id,re.toISOString=Qs,re.toString=Qs,re.toJSON=Qs,re.locale=sa,re.localeData=ra,re.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qs),re.lang=na,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Y("x",Ps),Y("X",wi),me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),me("x",function(e,t,n){n._d=new Date(se(e))});//! moment.js
39
- R.version="2.30.1",ii(ye),R.fn=E,R.min=ql,R.max=Kl,R.now=Ql,R.utc=Qe,R.unix=Tc,R.months=Ic,R.isDate=ss,R.locale=jt,R.invalid=Ms,R.duration=qe,R.isMoment=Ge,R.weekdays=Oc,R.parseZone=wc,R.localeData=ct,R.isDuration=Ws,R.monthsShort=Cc,R.weekdaysMin=Ac,R.defineLocale=Yn,R.updateLocale=Tl,R.locales=wl,R.weekdaysShort=Mc,R.normalizeUnits=$e,R.relativeTimeRounding=rd,R.relativeTimeThreshold=ad,R.calendarFormat=_o,R.prototype=E,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 _t=(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},Ke=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(" ")},Zs=(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},ld=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},od=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Js={exports:{}};/*! @preserve
38
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Sr={};function Tr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),Sr[e]||(br(t),Sr[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Ze(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function oi(e){var t,n;for(n in e)ce(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 Tn(e,t){var n=Nt({},e),r;for(r in t)ce(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)ce(e,r)&&!ce(t,r)&&Tt(e[r])&&(n[r]=Nt({},n[r]));return n}function wn(e){e!=null&&this.set(e)}var In;Object.keys?In=Object.keys:In=function(e){var t,n=[];for(t in e)ce(e,t)&&n.push(t);return n};var ci={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function di(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 Cn=/(\[[^\[]*\])|(\\)?([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,Es=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,On={},Pt={};function B(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Pt[e]=i),t&&(Pt[t[0]]=function(){return Je(i.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function hi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function ui(e){var t=e.match(Cn),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=hi(t[n]);return function(i){var a="",d;for(d=0;d<r;d++)a+=Ze(t[d])?t[d].call(i,e):t[d];return a}}function Rs(e,t){return e.isValid()?(t=wr(t,e.localeData()),On[t]=On[t]||ui(t),On[t](e)):e.localeData().invalidDate()}function wr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Es.lastIndex=0;n>=0&&Es.test(e);)e=e.replace(Es,r),Es.lastIndex=0,n-=1;return e}var mi={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 fi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Cn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var pi="Invalid date";function yi(){return this._invalidDate}var gi="%d",xi=/\d{1,2}/;function Ni(e){return this._ordinal.replace("%d",e)}var ji={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 vi(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function _i(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var Ir={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"?Ir[e]||Ir[e.toLowerCase()]:void 0}function Mn(e){var t={},n,r;for(r in e)ce(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var bi={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 Si(e){var t=[],n;for(n in e)ce(e,n)&&t.push({unit:n,priority:bi[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Cr=/\d/,De=/\d\d/,Or=/\d{3}/,An=/\d{4}/,ks=/[+-]?\d{6}/,pe=/\d\d?/,Mr=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,Ls=/\d{1,3}/,En=/\d{1,4}/,Ps=/[+-]?\d{1,6}/,Ft=/\d+/,Fs=/[+-]?\d+/,Ti=/Z|[+-]\d\d:?\d\d/gi,Ds=/Z|[+-]\d\d(?::?\d\d)?/gi,wi=/[+-]?\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?/,Rn=/^([1-9]\d|\d)/,Ys;Ys={};function Y(e,t,n){Ys[e]=Ze(t)?t:function(r,i){return r&&n?n:t}}function Ii(e,t){return ce(Ys,e)?Ys[e](t._strict,t._locale):new RegExp(Ci(e))}function Ci(e){return at(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function at(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function He(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function se(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=He(t)),n}var kn={};function me(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),rt(t)&&(r=function(a,d){d[t]=se(a)}),i=e.length,n=0;n<i;n++)kn[e[n]]=r}function as(e,t){me(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Oi(e,t,n){t!=null&&ce(kn,e)&&kn[e](t,n._a,n,e)}function Us(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,it=1,Xe=2,Ie=3,Ve=4,lt=5,wt=6,Mi=7,Ai=8;B("Y",0,0,function(){var e=this.year();return e<=9999?Je(e,4):"+"+e}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),Y("Y",Fs),Y("YY",pe,De),Y("YYYY",En,An),Y("YYYYY",Ps,ks),Y("YYYYYY",Ps,ks),me(["YYYYY","YYYYYY"],Me),me("YYYY",function(e,t){t[Me]=e.length===2?R.parseTwoDigitYear(e):se(e)}),me("YY",function(e,t){t[Me]=R.parseTwoDigitYear(e)}),me("Y",function(e,t){t[Me]=parseInt(e,10)});function is(e){return Us(e)?366:365}R.parseTwoDigitYear=function(e){return se(e)+(se(e)>68?1900:2e3)};var Er=Yt("FullYear",!0);function Ei(){return Us(this.year())}function Yt(e,t){return function(n){return n!=null?(Rr(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 Rr(e,t,n){var r,i,a,d,m;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,d=e.month(),m=e.date(),m=m===29&&d===1&&!Us(a)?28:m,i?r.setUTCFullYear(a,d,m):r.setFullYear(a,d,m)}}function Ri(e){return e=$e(e),Ze(this[e])?this[e]():this}function ki(e,t){if(typeof e=="object"){e=Mn(e);var n=Si(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),Ze(this[e]))return this[e](t);return this}function Li(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 Ln(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Li(t,12);return e+=(t-n)/12,n===1?Us(e)?29:28:31-n%7%2}B("M",["MM",2],"Mo",function(){return this.month()+1}),B("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),B("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("M",pe,Dt),Y("MM",pe,De),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[it]=se(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[it]=i:X(n).invalidMonth=e});var Pi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Lr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fi=rs,Di=rs;function Yi(e,t){return e?ze(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Lr).test(t)?"format":"standalone"][e.month()]:ze(this._months)?this._months:this._months.standalone}function Ui(e,t){return e?ze(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Lr.test(t)?"format":"standalone"][e.month()]:ze(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $i(e,t,n){var r,i,a,d=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,d),i!==-1?i:null):(i=je.call(this._longMonthsParse,d),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,d),i!==-1?i:(i=je.call(this._longMonthsParse,d),i!==-1?i:null)):(i=je.call(this._longMonthsParse,d),i!==-1?i:(i=je.call(this._shortMonthsParse,d),i!==-1?i:null))}function Hi(e,t,n){var r,i,a;if(this._monthsParseExact)return $i.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 Pr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=se(t);else if(t=e.localeData().monthsParse(t),!rt(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Ln(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Fr(e){return e!=null?(Pr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Bi(){return Ln(this.year(),this.month())}function Wi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Dr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=Fi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function zi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Dr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=Di),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Dr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,d,m;for(i=0;i<12;i++)a=Qe([2e3,i]),d=at(this.monthsShort(a,"")),m=at(this.months(a,"")),t.push(d),n.push(m),r.push(m),r.push(d);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 Gi(e,t,n,r,i,a,d){var m;return e<100&&e>=0?(m=new Date(e+400,t,n,r,i,a,d),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,n,r,i,a,d),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 $s(e,t,n){var r=7+t-n,i=(7+os(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Yr(e,t,n,r,i){var a=(7+n-r)%7,d=$s(e,r,i),m=1+7*(t-1)+a+d,o,l;return m<=0?(o=e-1,l=is(o)+m):m>is(e)?(o=e+1,l=m-is(e)):(o=e,l=m),{year:o,dayOfYear:l}}function cs(e,t,n){var r=$s(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,d;return i<1?(d=e.year()-1,a=i+ot(d,t,n)):i>ot(e.year(),t,n)?(a=i-ot(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ot(e,t,n){var r=$s(e,t,n),i=$s(e+1,t,n);return(is(e)-r+i)/7}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),Y("w",pe,Dt),Y("ww",pe,De),Y("W",pe,Dt),Y("WW",pe,De),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=se(e)});function Vi(e){return cs(e,this._week.dow,this._week.doy).week}var qi={dow:0,doy:6};function Ki(){return this._week.dow}function Qi(){return this._week.doy}function Zi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Ji(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}B("d",0,"do","day"),B("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),Y("d",pe),Y("e",pe),Y("E",pe),Y("dd",function(e,t){return t.weekdaysMinRegex(e)}),Y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Y("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:X(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=se(e)});function Xi(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function el(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var tl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ur="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),nl=rs,rl=rs,al=rs;function il(e,t){var n=ze(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Pn(n,this._week.dow):e?n[e.day()]:n}function ll(e){return e===!0?Pn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ol(e){return e===!0?Pn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function cl(e,t,n){var r,i,a,d=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,d),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,d),i!==-1||(i=je.call(this._shortWeekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null))}function dl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return cl.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 hl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Xi(e,this.localeData()),this.add(e-t,"d")):t}function ul(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 ml(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=el(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function fl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=nl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function pl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=rl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function yl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=al),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fn(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],i=[],a,d,m,o,l;for(a=0;a<7;a++)d=Qe([2e3,1]).day(a),m=at(this.weekdaysMin(d,"")),o=at(this.weekdaysShort(d,"")),l=at(this.weekdays(d,"")),t.push(m),n.push(o),r.push(l),i.push(m),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 Dn(){return this.hours()%12||12}function gl(){return this.hours()||24}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Dn),B("k",["kk",2],0,gl),B("hmm",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)}),B("hmmss",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)+Je(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+Je(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+Je(this.minutes(),2)+Je(this.seconds(),2)});function $r(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}$r("a",!0),$r("A",!1);function Hr(e,t){return t._meridiemParse}Y("a",Hr),Y("A",Hr),Y("H",pe,Rn),Y("h",pe,Dt),Y("k",pe,Dt),Y("HH",pe,De),Y("hh",pe,De),Y("kk",pe,De),Y("hmm",Mr),Y("hmmss",Ar),Y("Hmm",Mr),Y("Hmmss",Ar),me(["H","HH"],Ie),me(["k","kk"],function(e,t,n){var r=se(e);t[Ie]=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[Ie]=se(e),X(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r)),X(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r,2)),t[lt]=se(e.substr(i)),X(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[Ve]=se(e.substr(r,2)),t[lt]=se(e.substr(i))});function xl(e){return(e+"").toLowerCase().charAt(0)==="p"}var Nl=/[ap]\.?m?\.?/i,jl=Yt("Hours",!0);function vl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Br={calendar:ci,longDateFormat:mi,invalidDate:pi,ordinal:gi,dayOfMonthOrdinalParse:xi,relativeTime:ji,months:Pi,monthsShort:kr,week:qi,weekdays:tl,weekdaysMin:sl,weekdaysShort:Ur,meridiemParse:Nl},ge={},ds={},hs;function _l(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 Wr(e){return e&&e.toLowerCase().replace("_","-")}function bl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Wr(e[t]).split("-"),n=a.length,r=Wr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Hs(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&_l(a,r)>=n-1)break;n--}t++}return hs}function Sl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Hs(e){var t=null,n;if(ge[e]===void 0&&typeof module<"u"&&module&&module.exports&&Sl(e))try{t=hs._abbr,n=require,n("./locale/"+e),jt(t)}catch{ge[e]=null}return ge[e]}function jt(e,t){var n;return e&&(Re(t)?n=ct(e):n=Yn(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 Yn(e,t){if(t!==null){var n,r=Br;if(t.abbr=e,ge[e]!=null)Tr("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=Hs(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 ge[e]=new wn(Tn(r,t)),ds[e]&&ds[e].forEach(function(i){Yn(i.name,i.config)}),jt(e),ge[e]}else return delete ge[e],null}function Tl(e,t){if(t!=null){var n,r,i=Br;ge[e]!=null&&ge[e].parentLocale!=null?ge[e].set(Tn(ge[e]._config,t)):(r=Hs(e),r!=null&&(i=r._config),t=Tn(i,t),r==null&&(t.abbr=e),n=new wn(t),n.parentLocale=ge[e],ge[e]=n),jt(e)}else ge[e]!=null&&(ge[e].parentLocale!=null?(ge[e]=ge[e].parentLocale,e===jt()&&jt(e)):ge[e]!=null&&delete ge[e]);return ge[e]}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!ze(e)){if(t=Hs(e),t)return t;e=[e]}return bl(e)}function wl(){return In(ge)}function Un(e){var t,n=e._a;return n&&X(e).overflow===-2&&(t=n[it]<0||n[it]>11?it:n[Xe]<1||n[Xe]>Ln(n[Me],n[it])?Xe:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[Ve]!==0||n[lt]!==0||n[wt]!==0)?Ie:n[Ve]<0||n[Ve]>59?Ve:n[lt]<0||n[lt]>59?lt:n[wt]<0||n[wt]>999?wt:-1,X(e)._overflowDayOfYear&&(t<Me||t>Xe)&&(t=Xe),X(e)._overflowWeeks&&t===-1&&(t=Mi),X(e)._overflowWeekday&&t===-1&&(t=Ai),X(e).overflow=t),e}var Il=/^\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)?)?$/,Cl=/^\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)?)?$/,Ol=/Z|[+-]\d\d(?::?\d\d)?/,Bs=[["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]],$n=[["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/]],Ml=/^\/?Date\((-?\d+)/i,Al=/^(?:(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}))$/,El={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 zr(e){var t,n,r=e._i,i=Il.exec(r)||Cl.exec(r),a,d,m,o,l=Bs.length,c=$n.length;if(i){for(X(e).iso=!0,t=0,n=l;t<n;t++)if(Bs[t][1].exec(i[1])){d=Bs[t][0],a=Bs[t][2]!==!1;break}if(d==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if($n[t][1].exec(i[3])){m=(i[2]||" ")+$n[t][0];break}if(m==null){e._isValid=!1;return}}if(!a&&m!=null){e._isValid=!1;return}if(i[4])if(Ol.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(m||"")+(o||""),Bn(e)}else e._isValid=!1}function Rl(e,t,n,r,i,a){var d=[kl(e),kr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function kl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ll(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Pl(e,t,n){if(e){var r=Ur.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return X(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Fl(e,t,n){if(e)return El[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Gr(e){var t=Al.exec(Ll(e._i)),n;if(t){if(n=Rl(t[4],t[3],t[2],t[5],t[6],t[7]),!Pl(t[1],n,e))return;e._a=n,e._tzm=Fl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),X(e).rfc2822=!0}else e._isValid=!1}function Dl(e){var t=Ml.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(zr(e),e._isValid===!1)delete e._isValid;else return;if(Gr(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 Yl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Hn(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Yl(e),e._w&&e._a[Xe]==null&&e._a[it]==null&&Ul(e),e._dayOfYear!=null&&(d=Ut(e._a[Me],i[Me]),(e._dayOfYear>is(d)||e._dayOfYear===0)&&(X(e)._overflowDayOfYear=!0),n=os(d,0,e._dayOfYear),e._a[it]=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[Ie]===24&&e._a[Ve]===0&&e._a[lt]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:Gi).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[Ie]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(X(e).weekdayMismatch=!0)}}function Ul(e){var t,n,r,i,a,d,m,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,d=4,n=Ut(t.GG,e._a[Me],cs(ye(),1,4).year),r=Ut(t.W,1),i=Ut(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,d=e._locale._week.doy,l=cs(ye(),a,d),n=Ut(t.gg,e._a[Me],l.year),r=Ut(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>ot(n,a,d)?X(e)._overflowWeeks=!0:o!=null?X(e)._overflowWeekday=!0:(m=Yr(n,r,i,a,d),e._a[Me]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Bn(e){if(e._f===R.ISO_8601){zr(e);return}if(e._f===R.RFC_2822){Gr(e);return}e._a=[],X(e).empty=!0;var t=""+e._i,n,r,i,a,d,m=t.length,o=0,l,c;for(i=wr(e._f,e._locale).match(Cn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ii(a,e))||[])[0],r&&(d=t.substr(0,t.indexOf(r)),d.length>0&&X(e).unusedInput.push(d),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Pt[a]?(r?X(e).empty=!1:X(e).unusedTokens.push(a),Oi(a,r,e)):e._strict&&!r&&X(e).unusedTokens.push(a);X(e).charsLeftOver=m-o,t.length>0&&X(e).unusedInput.push(t),e._a[Ie]<=12&&X(e).bigHour===!0&&e._a[Ie]>0&&(X(e).bigHour=void 0),X(e).parsedDateParts=e._a.slice(0),X(e).meridiem=e._meridiem,e._a[Ie]=$l(e._locale,e._a[Ie],e._meridiem),l=X(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),Hn(e),Un(e)}function $l(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 Hl(e){var t,n,r,i,a,d,m=!1,o=e._f.length;if(o===0){X(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,d=!1,t=Sn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Bn(t),_n(t)&&(d=!0),a+=X(t).charsLeftOver,a+=X(t).unusedTokens.length*10,X(t).score=a,m?a<r&&(r=a,n=t):(r==null||a<r||d)&&(r=a,n=t,d&&(m=!0));Nt(e,n||t)}function Bl(e){if(!e._d){var t=Mn(e._i),n=t.day===void 0?t.date:t.day;e._a=vr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Hn(e)}}function Wl(e){var t=new ns(Un(Vr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Vr(e){var t=e._i,n=e._f;return e._locale=e._locale||ct(e._l),t===null||n===void 0&&t===""?As({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ge(t)?new ns(Un(t)):(ss(t)?e._d=t:ze(n)?Hl(e):n?Bn(e):zl(e),_n(e)||(e._d=null),e))}function zl(e){var t=e._i;Re(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Dl(e):ze(t)?(e._a=vr(t.slice(0),function(n){return parseInt(n,10)}),Hn(e)):Tt(t)?Bl(e):rt(t)?e._d=new Date(t):R.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),(Tt(e)&&jn(e)||ze(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,Wl(a)}function ye(e,t,n,r){return qr(e,t,n,r,!1)}var Gl=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:As()}),Vl=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:As()});function Kr(e,t){var n,r;if(t.length===1&&ze(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 Kr("isBefore",e)}function Kl(){var e=[].slice.call(arguments,0);return Kr("isAfter",e)}var Ql=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Zl(e){var t,n=!1,r,i=us.length;for(t in e)if(ce(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==se(e[us[r]])&&(n=!0)}return!0}function Jl(){return this._isValid}function Xl(){return qe(NaN)}function Ws(e){var t=Mn(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,m=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Zl(t),this._milliseconds=+c+l*1e3+o*6e4+m*1e3*60*60,this._days=+d+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ct(),this._bubble()}function zs(e){return e instanceof Ws}function Wn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function eo(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,d;for(d=0;d<r;d++)se(e[d])!==se(t[d])&&a++;return a+i}function Qr(e,t){B(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)})}Qr("Z",":"),Qr("ZZ",""),Y("Z",Ds),Y("ZZ",Ds),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zn(Ds,e)});var to=/([\+\-]|\d\d)/gi;function zn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(to)||["-",0,0],a=+(i[1]*60)+se(i[2]),a===0?0:i[0]==="+"?a:-a)}function Gn(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 Vn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function so(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=zn(Ds,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Vn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ea(this,qe(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Vn(this)}function no(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ro(e){return this.utcOffset(0,e)}function ao(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vn(this),"m")),this}function io(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=zn(Ti,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function lo(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function oo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function co(){if(!Re(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Sn(e,this),e=Vr(e),e._a?(t=e._isUTC?Qe(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&eo(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ho(){return this.isValid()?!this._isUTC:!1}function uo(){return this.isValid()?this._isUTC:!1}function Zr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var mo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,fo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function qe(e,t){var n=e,r=null,i,a,d;return zs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:rt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[Xe])*i,h:se(r[Ie])*i,m:se(r[Ve])*i,s:se(r[lt])*i,ms:se(Wn(r[wt]*1e3))*i}):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:It(r[2],i),M:It(r[3],i),w:It(r[4],i),d:It(r[5],i),h:It(r[6],i),m:It(r[7],i),s:It(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(d=po(ye(n.from),ye(n.to)),n={},n.ms=d.milliseconds,n.M=d.months),a=new Ws(n),zs(e)&&ce(e,"_locale")&&(a._locale=e._locale),zs(e)&&ce(e,"_isValid")&&(a._isValid=e._isValid),a}qe.fn=Ws.prototype,qe.invalid=Xl;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jr(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 po(e,t){var n;return e.isValid()&&t.isValid()?(t=Gn(t,e),e.isBefore(t)?n=Jr(e,t):(n=Jr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Xr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Tr(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=qe(n,r),ea(this,i,e),this}}function ea(e,t,n,r){var i=t._milliseconds,a=Wn(t._days),d=Wn(t._months);e.isValid()&&(r=r??!0,d&&Pr(e,ls(e,"Month")+d*n),a&&Rr(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var yo=Xr(1,"add"),go=Xr(-1,"subtract");function ta(e){return typeof e=="string"||e instanceof String}function xo(e){return Ge(e)||ss(e)||ta(e)||rt(e)||jo(e)||No(e)||e===null||e===void 0}function No(e){var t=Tt(e)&&!jn(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,d=r.length;for(i=0;i<d;i+=1)a=r[i],n=n||ce(e,a);return t&&n}function jo(e){var t=ze(e),n=!1;return t&&(n=e.filter(function(r){return!rt(r)&&ta(e)}).length===0),t&&n}function vo(e){var t=Tt(e)&&!jn(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||ce(e,a);return t&&n}function _o(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 bo(e,t){arguments.length===1&&(arguments[0]?xo(arguments[0])?(e=arguments[0],t=void 0):vo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=Gn(n,this).startOf("day"),i=R.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,ye(n)))}function So(){return new ns(this)}function To(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 wo(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 Io(e,t,n,r){var i=Ge(e)?e:ye(e),a=Ge(t)?t:ye(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 Co(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 Oo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Mo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ao(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=Gn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=$e(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:He(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}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Eo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ro(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Rs(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",Rs(n,"Z")):Rs(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){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 Lo(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Rs(this,e);return this.localeData().postformat(t)}function Po(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?qe({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Fo(e){return this.from(ye(),e)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?qe({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.to(ye(),e)}function sa(e){var t;return e===void 0?this._locale._abbr:(t=ct(e),t!=null&&(this._locale=t),this)}var na=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 ra(){return this._locale}var Vs=1e3,$t=60*Vs,qs=60*$t,aa=(365*400+97)*24*qs;function Ht(e,t){return(e%t+t)%t}function ia(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-aa:new Date(e,t,n).valueOf()}function la(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-aa:Date.UTC(e,t,n)}function Uo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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),qs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Vs);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function $o(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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+=qs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),qs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Vs-Ht(t,Vs)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Ho(){return this._d.valueOf()-(this._offset||0)*6e4}function Bo(){return Math.floor(this.valueOf()/1e3)}function Wo(){return new Date(this.valueOf())}function zo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Go(){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 Vo(){return this.isValid()?this.toISOString():null}function qo(){return _n(this)}function Ko(){return Nt({},X(this))}function Qo(){return X(this).overflow}function Zo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Y("N",qn),Y("NN",qn),Y("NNN",qn),Y("NNNN",oc),Y("NNNNN",cc),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?X(n).era=i:X(n).invalidEra=e}),Y("y",Ft),Y("yy",Ft),Y("yyy",Ft),Y("yyyy",Ft),Y("yo",dc),me(["y","yy","yyy","yyyy"],Me),me(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Me]=n._locale.eraYearOrdinalParse(e,i):t[Me]=parseInt(e,10)});function Jo(e,t){var n,r,i,a=this._eras||ct("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=R(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=R(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function Xo(e,t,n){var r,i,a=this.eras(),d,m,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(d=a[r].name.toUpperCase(),m=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(m===e)return a[r];break;case"NNNN":if(d===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([d,m,o].indexOf(e)>=0)return a[r]}function ec(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 tc(){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 sc(){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 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].abbr;return""}function rc(){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()-R(i[e].since).year())*n+i[e].offset;return this.year()}function ac(e){return ce(this,"_erasNameRegex")||Kn.call(this),e?this._erasNameRegex:this._erasRegex}function ic(e){return ce(this,"_erasAbbrRegex")||Kn.call(this),e?this._erasAbbrRegex:this._erasRegex}function lc(e){return ce(this,"_erasNarrowRegex")||Kn.call(this),e?this._erasNarrowRegex:this._erasRegex}function qn(e,t){return t.erasAbbrRegex(e)}function oc(e,t){return t.erasNameRegex(e)}function cc(e,t){return t.erasNarrowRegex(e)}function dc(e,t){return t._eraYearOrdinalRegex||Ft}function Kn(){var e=[],t=[],n=[],r=[],i,a,d,m,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=at(l[i].name),m=at(l[i].abbr),o=at(l[i].narrow),t.push(d),e.push(m),n.push(o),r.push(d),r.push(m),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")}B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ks(e,t){B(0,[e,e.length],0,t)}Ks("gggg","weekYear"),Ks("ggggg","weekYear"),Ks("GGGG","isoWeekYear"),Ks("GGGGG","isoWeekYear"),Y("G",Fs),Y("g",Fs),Y("GG",pe,De),Y("gg",pe,De),Y("GGGG",En,An),Y("gggg",En,An),Y("GGGGG",Ps,ks),Y("ggggg",Ps,ks),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=se(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function hc(e){return oa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function uc(e){return oa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function mc(){return ot(this.year(),1,4)}function fc(){return ot(this.isoWeekYear(),1,4)}function pc(){var e=this.localeData()._week;return ot(this.year(),e.dow,e.doy)}function yc(){var e=this.localeData()._week;return ot(this.weekYear(),e.dow,e.doy)}function oa(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=ot(e,r,i),t>a&&(t=a),gc.call(this,e,t,n,r,i))}function gc(e,t,n,r,i){var a=Yr(e,t,n,r,i),d=os(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}B("Q",0,"Qo","quarter"),Y("Q",Cr),me("Q",function(e,t){t[it]=(se(e)-1)*3});function xc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}B("D",["DD",2],"Do","date"),Y("D",pe,Dt),Y("DD",pe,De),Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],Xe),me("Do",function(e,t){t[Xe]=se(e.match(pe)[0])});var ca=Yt("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",Ls),Y("DDDD",Or),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=se(e)});function Nc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}B("m",["mm",2],0,"minute"),Y("m",pe,Rn),Y("mm",pe,De),me(["m","mm"],Ve);var jc=Yt("Minutes",!1);B("s",["ss",2],0,"second"),Y("s",pe,Rn),Y("ss",pe,De),me(["s","ss"],lt);var vc=Yt("Seconds",!1);B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return this.millisecond()*10}),B(0,["SSSSS",5],0,function(){return this.millisecond()*100}),B(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),B(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),B(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),B(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Y("S",Ls,Cr),Y("SS",Ls,De),Y("SSS",Ls,Or);var vt,da;for(vt="SSSS";vt.length<=9;vt+="S")Y(vt,Ft);function _c(e,t){t[wt]=se(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,_c);da=Yt("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");function bc(){return this._isUTC?"UTC":""}function Sc(){return this._isUTC?"Coordinated Universal Time":""}var E=ns.prototype;E.add=yo,E.calendar=bo,E.clone=So,E.diff=Ao,E.endOf=$o,E.format=Lo,E.from=Po,E.fromNow=Fo,E.to=Do,E.toNow=Yo,E.get=Ri,E.invalidAt=Qo,E.isAfter=To,E.isBefore=wo,E.isBetween=Io,E.isSame=Co,E.isSameOrAfter=Oo,E.isSameOrBefore=Mo,E.isValid=qo,E.lang=na,E.locale=sa,E.localeData=ra,E.max=Vl,E.min=Gl,E.parsingFlags=Ko,E.set=ki,E.startOf=Uo,E.subtract=go,E.toArray=zo,E.toObject=Go,E.toDate=Wo,E.toISOString=Ro,E.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Vo,E.toString=Eo,E.unix=Bo,E.valueOf=Ho,E.creationData=Zo,E.eraName=tc,E.eraNarrow=sc,E.eraAbbr=nc,E.eraYear=rc,E.year=Er,E.isLeapYear=Ei,E.weekYear=hc,E.isoWeekYear=uc,E.quarter=E.quarters=xc,E.month=Fr,E.daysInMonth=Bi,E.week=E.weeks=Zi,E.isoWeek=E.isoWeeks=Ji,E.weeksInYear=pc,E.weeksInWeekYear=yc,E.isoWeeksInYear=mc,E.isoWeeksInISOWeekYear=fc,E.date=ca,E.day=E.days=hl,E.weekday=ul,E.isoWeekday=ml,E.dayOfYear=Nc,E.hour=E.hours=jl,E.minute=E.minutes=jc,E.second=E.seconds=vc,E.millisecond=E.milliseconds=da,E.utcOffset=so,E.utc=ro,E.local=ao,E.parseZone=io,E.hasAlignedHourOffset=lo,E.isDST=oo,E.isLocal=ho,E.isUtcOffset=uo,E.isUtc=Zr,E.isUTC=Zr,E.zoneAbbr=bc,E.zoneName=Sc,E.dates=Ue("dates accessor is deprecated. Use date instead.",ca),E.months=Ue("months accessor is deprecated. Use month instead",Fr),E.years=Ue("years accessor is deprecated. Use year instead",Er),E.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",no),E.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",co);function Tc(e){return ye(e*1e3)}function wc(){return ye.apply(null,arguments).parseZone()}function ha(e){return e}var de=wn.prototype;de.calendar=di,de.longDateFormat=fi,de.invalidDate=yi,de.ordinal=Ni,de.preparse=ha,de.postformat=ha,de.relativeTime=vi,de.pastFuture=_i,de.set=oi,de.eras=Jo,de.erasParse=Xo,de.erasConvertYear=ec,de.erasAbbrRegex=ic,de.erasNameRegex=ac,de.erasNarrowRegex=lc,de.months=Yi,de.monthsShort=Ui,de.monthsParse=Hi,de.monthsRegex=zi,de.monthsShortRegex=Wi,de.week=Vi,de.firstDayOfYear=Qi,de.firstDayOfWeek=Ki,de.weekdays=il,de.weekdaysMin=ol,de.weekdaysShort=ll,de.weekdaysParse=dl,de.weekdaysRegex=fl,de.weekdaysShortRegex=pl,de.weekdaysMinRegex=yl,de.isPM=xl,de.meridiem=vl;function Qs(e,t,n,r){var i=ct(),a=Qe().set(r,t);return i[n](a,e)}function ua(e,t,n){if(rt(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 Qn(e,t,n,r){typeof e=="boolean"?(rt(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,rt(t)&&(n=t,t=void 0),t=t||"");var i=ct(),a=e?i._week.dow:0,d,m=[];if(n!=null)return Qs(t,(n+a)%7,r,"day");for(d=0;d<7;d++)m[d]=Qs(t,(d+a)%7,r,"day");return m}function Ic(e,t){return ua(e,t,"months")}function Cc(e,t){return ua(e,t,"monthsShort")}function Oc(e,t,n){return Qn(e,t,n,"weekdays")}function Mc(e,t,n){return Qn(e,t,n,"weekdaysShort")}function Ac(e,t,n){return Qn(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=se(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.",ct);var dt=Math.abs;function Ec(){var e=this._data;return this._milliseconds=dt(this._milliseconds),this._days=dt(this._days),this._months=dt(this._months),e.milliseconds=dt(e.milliseconds),e.seconds=dt(e.seconds),e.minutes=dt(e.minutes),e.hours=dt(e.hours),e.months=dt(e.months),e.years=dt(e.years),this}function ma(e,t,n,r){var i=qe(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Rc(e,t){return ma(this,e,t,1)}function kc(e,t){return ma(this,e,t,-1)}function fa(e){return e<0?Math.floor(e):Math.ceil(e)}function Lc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,d,m,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=fa(Zn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=He(e/1e3),r.seconds=i%60,a=He(i/60),r.minutes=a%60,d=He(a/60),r.hours=d%24,t+=He(d/24),o=He(pa(t)),n+=o,t-=fa(Zn(o)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function pa(e){return e*4800/146097}function Zn(e){return e*146097/4800}function Pc(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+pa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Zn(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 ht(e){return function(){return this.as(e)}}var ya=ht("ms"),Fc=ht("s"),Dc=ht("m"),Yc=ht("h"),Uc=ht("d"),$c=ht("w"),Hc=ht("M"),Bc=ht("Q"),Wc=ht("y"),zc=ya;function Gc(){return qe(this)}function Vc(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"),Kc=Ct("seconds"),Qc=Ct("minutes"),Zc=Ct("hours"),Jc=Ct("days"),Xc=Ct("months"),ed=Ct("years");function td(){return He(this.days()/7)}var ut=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function sd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function nd(e,t,n,r){var i=qe(e).abs(),a=ut(i.as("s")),d=ut(i.as("m")),m=ut(i.as("h")),o=ut(i.as("d")),l=ut(i.as("M")),c=ut(i.as("w")),u=ut(i.as("y")),f=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||d<=1&&["m"]||d<n.m&&["mm",d]||m<=1&&["h"]||m<n.h&&["hh",m]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),f=f||l<=1&&["M"]||l<n.M&&["MM",l]||u<=1&&["y"]||["yy",u],f[2]=t,f[3]=+e>0,f[4]=r,sd.apply(null,f)}function rd(e){return e===void 0?ut:typeof e=="function"?(ut=e,!0):!1}function ad(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function id(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,i,a;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)),i=this.localeData(),a=nd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Jn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Zs(){if(!this.isValid())return this.localeData().invalidDate();var e=Jn(this._milliseconds)/1e3,t=Jn(this._days),n=Jn(this._months),r,i,a,d,m=this.asSeconds(),o,l,c,u;return m?(r=He(e/60),i=He(r/60),e%=60,r%=60,a=He(n/12),n%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=m<0?"-":"",l=Wt(this._months)!==Wt(m)?"-":"",c=Wt(this._days)!==Wt(m)?"-":"",u=Wt(this._milliseconds)!==Wt(m)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?u+i+"H":"")+(r?u+r+"M":"")+(e?u+d+"S":"")):"P0D"}var re=Ws.prototype;re.isValid=Jl,re.abs=Ec,re.add=Rc,re.subtract=kc,re.as=Pc,re.asMilliseconds=ya,re.asSeconds=Fc,re.asMinutes=Dc,re.asHours=Yc,re.asDays=Uc,re.asWeeks=$c,re.asMonths=Hc,re.asQuarters=Bc,re.asYears=Wc,re.valueOf=zc,re._bubble=Lc,re.clone=Gc,re.get=Vc,re.milliseconds=qc,re.seconds=Kc,re.minutes=Qc,re.hours=Zc,re.days=Jc,re.weeks=td,re.months=Xc,re.years=ed,re.humanize=id,re.toISOString=Zs,re.toString=Zs,re.toJSON=Zs,re.locale=sa,re.localeData=ra,re.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zs),re.lang=na,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Y("x",Fs),Y("X",wi),me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),me("x",function(e,t,n){n._d=new Date(se(e))});//! moment.js
39
+ R.version="2.30.1",ii(ye),R.fn=E,R.min=ql,R.max=Kl,R.now=Ql,R.utc=Qe,R.unix=Tc,R.months=Ic,R.isDate=ss,R.locale=jt,R.invalid=As,R.duration=qe,R.isMoment=Ge,R.weekdays=Oc,R.parseZone=wc,R.localeData=ct,R.isDuration=zs,R.monthsShort=Cc,R.weekdaysMin=Ac,R.defineLocale=Yn,R.updateLocale=Tl,R.locales=wl,R.weekdaysShort=Mc,R.normalizeUnits=$e,R.relativeTimeRounding=rd,R.relativeTimeThreshold=ad,R.calendarFormat=_o,R.prototype=E,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 _t=(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},Ke=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 i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},ld=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},od=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Js={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 cd=Js.exports,ga;function dd(){return ga||(ga=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(cd,function(){var t,n,r="2.0.6",i={},a={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},m={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,u,f,p;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(m.zeroFormat&&l===m.zeroFormat)c=0;else if(m.nullFormat&&l===m.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(u in i)if(p=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,p&&l.match(p)){f=i[u].unformat;break}f=f||t._.stringToNumber,c=f(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,u){var f=a[t.options.currentLocale],p=!1,g=!1,b=0,_="",w=1e12,T=1e9,M=1e6,F=1e3,O="",G=!1,K,te,Q,le,W,Ce,$;if(l=l||0,te=Math.abs(l),t._.includes(c,"(")?(p=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(W=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(K=c.match(/a(k|m|b|t)?/),K=K?K[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),te>=w&&!K||K==="t"?(_+=f.abbreviations.trillion,l=l/w):te<w&&te>=T&&!K||K==="b"?(_+=f.abbreviations.billion,l=l/T):te<T&&te>=M&&!K||K==="m"?(_+=f.abbreviations.million,l=l/M):(te<M&&te>=F&&!K||K==="k")&&(_+=f.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(g=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],le=c.split(".")[1],Ce=c.indexOf(","),b=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,le?(t._.includes(le,"[")?(le=le.replace("]",""),le=le.split("["),O=t._.toFixed(l,le[0].length+le[1].length,u,le[1].length)):O=t._.toFixed(l,le.length,u),Q=O.split(".")[0],t._.includes(O,".")?O=f.delimiters.decimal+O.split(".")[1]:O="",g&&Number(O.slice(1))===0&&(O="")):Q=t._.toFixed(l,0,u),_&&!K&&Number(Q)>=1e3&&_!==f.abbreviations.trillion)switch(Q=String(Number(Q)/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(Q,"-")&&(Q=Q.slice(1),G=!0),Q.length<b)for(var V=b-Q.length;V>0;V--)Q="0"+Q;return Ce>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),$=Q+O+(_||""),p?$=(p&&G?"(":"")+$+(p&&G?")":""):W>=0?$=W===0?(G?"-":"+")+$:$+(G?"-":"+"):G&&($="-"+$),$},stringToNumber:function(l){var c=a[m.currentLocale],u=l,f={thousand:3,million:6,billion:9,trillion:12},p,g,b;if(m.zeroFormat&&l===m.zeroFormat)g=0;else if(m.nullFormat&&l===m.nullFormat||!l.replace(/[^0-9]+/g,"").length)g=null;else{g=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(p in f)if(b=new RegExp("[^a-zA-Z]"+c.abbreviations[p]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),u.match(b)){g*=Math.pow(10,f[p]);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,u){return l.slice(0,u)+c+l.slice(u)},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 u=Object(l),f=u.length>>>0,p=0,g;if(arguments.length===3)g=arguments[2];else{for(;p<f&&!(p in u);)p++;if(p>=f)throw new TypeError("Reduce of empty array with no initial value");g=u[p++]}for(;p<f;p++)p in u&&(g=c(g,u[p],p,u));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,u){var f=n.multiplier(u);return c>f?c:f},1)},toFixed:function(l,c,u,f){var p=l.toString().split("."),g=c-(f||0),b,_,w,T;return p.length===2?b=Math.min(Math.max(p[1].length,g),c):b=g,w=Math.pow(10,b),T=(u(l+"e+"+b)/w).toFixed(b),f>c-b&&(_=new RegExp("\\.?0{1,"+(f-(c-b))+"}$"),T=T.replace(_,"")),T}},t.options=m,t.formats=i,t.locales=a,t.locale=function(l){return l&&(m.currentLocale=l.toLowerCase()),m.currentLocale},t.localeData=function(l){if(!l)return a[m.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in d)m[l]=d[l]},t.zeroFormat=function(l){m.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){m.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){m.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,u){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=u,u},t.validate=function(l,c){var u,f,p,g,b,_,w,T;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{w=t.localeData(c)}catch{w=t.localeData(t.locale())}return p=w.currency.symbol,b=w.abbreviations,u=w.delimiters.decimal,w.delimiters.thousands==="."?f="\\.":f=w.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==p)||(T=l.match(/[^\d]+$/),T!==null&&(l=l.slice(0,-1),T[0]!==b.thousand&&T[0]!==b.million&&T[0]!==b.billion&&T[0]!==b.trillion))?!1:(_=new RegExp(f+"{2}"),l.match(/[^\d.,]/g)?!1:(g=l.split(u),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 u=this._value,f=l||m.defaultFormat,p,g,b;if(c=c||Math.round,u===0&&m.zeroFormat!==null)g=m.zeroFormat;else if(u===null&&m.nullFormat!==null)g=m.nullFormat;else{for(p in i)if(f.match(i[p].regexps.format)){b=i[p].format;break}b=b||t._.numberToFormat,g=b(u,f,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 u(f,p,g,b){return f+Math.round(c*p)}return this._value=n.reduce([this._value,l],u,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function u(f,p,g,b){return f-Math.round(c*p)}return this._value=n.reduce([l],u,Math.round(this._value*c))/c,this},multiply:function(l){function c(u,f,p,g){var b=n.correctionFactor(u,f);return Math.round(u*b)*Math.round(f*b)/Math.round(b*b)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(u,f,p,g){var b=n.correctionFactor(u,f);return Math.round(u*b)/Math.round(f*b)}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,u){var f=t._.includes(c," BPS")?" ":"",p;return l=l*1e4,c=c.replace(/\s?BPS/,""),p=t._.numberToFormat(l,c,u),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,f+"BPS"),p=p.join("")):p=p+f+"BPS",p},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"]},u=l.suffixes.concat(c.suffixes.filter(function(p){return l.suffixes.indexOf(p)<0})),f=u.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(p,g,b){var _,w=t._.includes(g,"ib")?c:l,T=t._.includes(g," b")||t._.includes(g," ib")?" ":"",M,F,O;for(g=g.replace(/\s?i?b/,""),M=0;M<=w.suffixes.length;M++)if(F=Math.pow(w.base,M),O=Math.pow(w.base,M+1),p===null||p===0||p>=F&&p<O){T+=w.suffixes[M],F>0&&(p=p/F);break}return _=t._.numberToFormat(p,g,b),_+T},unformat:function(p){var g=t._.stringToNumber(p),b,_;if(g){for(b=l.suffixes.length-1;b>=0;b--){if(t._.includes(p,l.suffixes[b])){_=Math.pow(l.base,b);break}if(t._.includes(p,c.suffixes[b])){_=Math.pow(c.base,b);break}}g*=_||1}return g}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,u){var f=t.locales[t.options.currentLocale],p={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,b,_;for(c=c.replace(/\s?\$\s?/,""),g=t._.numberToFormat(l,c,u),l>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),_=0;_<p.before.length;_++)switch(b=p.before[_],b){case"$":g=t._.insert(g,f.currency.symbol,_);break;case" ":g=t._.insert(g," ",_+f.currency.symbol.length-1);break}for(_=p.after.length-1;_>=0;_--)switch(b=p.after[_],b){case"$":g=_===p.after.length-1?g+f.currency.symbol:t._.insert(g,f.currency.symbol,-(p.after.length-(1+_)));break;case" ":g=_===p.after.length-1?g+" ":t._.insert(g," ",-(p.after.length-(1+_)+f.currency.symbol.length-1));break}return g}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,u){var f,p=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",g=p.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(g[0]),c,u),f+"e"+g[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),u=Number(c[0]),f=Number(c[1]);f=t._.includes(l,"e-")?f*=-1:f;function p(g,b,_,w){var T=t._.correctionFactor(g,b),M=g*T*(b*T)/(T*T);return M}return t._.reduce([u,Math.pow(10,f)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,u){var f=t.locales[t.options.currentLocale],p,g=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),g+=f.ordinal(l),p=t._.numberToFormat(l,c,u),p+g}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,u){var f=t._.includes(c," %")?" ":"",p;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),p=t._.numberToFormat(l,c,u),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,f+"%"),p=p.join("")):p=p+f+"%",p},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,u){var f=Math.floor(l/60/60),p=Math.floor((l-f*60*60)/60),g=Math.round(l-f*60*60-p*60);return f+":"+(p<10?"0"+p:p)+":"+(g<10?"0"+g:g)},unformat:function(l){var c=l.split(":"),u=0;return c.length===3?(u=u+Number(c[0])*60*60,u=u+Number(c[1])*60,u=u+Number(c[2])):c.length===2&&(u=u+Number(c[0])*60,u=u+Number(c[1])),Number(u)}})}(),t})}(Js)),Js.exports}var hd=dd();const Xs=pr(hd),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ud={_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}},xa=(e,t)=>{const n=ud[`_${tn[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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",tn={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 md(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(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(f){if(f<10)return t[f];if(f<20)return n[f-11];{const p=f%10,g=Math.floor(f/10);return`${r[g]}${p?" "+t[p]:""}`}}function a(f){var p=f.toString(),g,b,_,w,T,M,F,O,G,K,te,Q,le="and";if(p=p.replace(/[, ]/g,""),parseInt(p)===0)return"zero";for(g=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],b=["","","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"],w=p.length,M=[];w>0;)T=w,M.push(p.slice(w=Math.max(0,w-3),T));if(F=M.length,F>_.length)return"";for(Q=[],K=0;K<F;K++)O=parseInt(M[K]),O&&(G=M[K].split("").reverse().map(parseFloat),G[1]===1&&(G[0]+=10),(te=_[K])&&Q.push(te),(te=g[G[0]])&&Q.push(te),(te=b[G[1]])&&Q.push(te),(G[0]||G[1])&&(G[2]||K+1>F)&&Q.push(le),(te=g[G[2]])&&Q.push(te+" Hundred"));return Q.reverse().join(" ")}const[d,m]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(m,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>`${tn[t].symbol} ${xa(e||0,t)}`,U=(e,t)=>`${tn[t].symbol} ${md(e||0,t)}`,Xn=()=>{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},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),er=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var m;(m=d.discounts)==null||m.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:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},tr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const m=`${d[t]}`;n[m]?(n[m].amt+=d.amt,n[m].taxAmt+=d.taxAmt):n[m]={amt:d.amt,chargeType:d.chargeType?d.chargeType:d.type,defaultSelcted:d.defaultSelcted,rate:d.rate,tax:d.tax,taxAmt:d.taxAmt,name:d.name,type:d.type}})}),Object.values(n)},sr=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 yd(e,t,n,r,i){const a=ms("1",e),d=ms("2",t),m=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,d,m,o,l]);return c.toString("base64")}const gd=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"}),xd=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=Xn(),Nd=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),d=Math.floor(t%3600/60),m=`${a} hr ${d} min`;return m}else return r},jd=(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=Zs(i,"internalName");let d;for(let m in e.paymentModes)!r[m]&&e.paymentModes[m]&&(d=a[m],n.push({displayName:d?d.displayName:Ke(m.replace("_"," ")),value:et(e.paymentModes[m])}));return n},vd=(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 i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var d=i.toDataURL("image/png");t(d)},r.onerror=i=>{t(null)}}catch{t(null)}})}const sn=(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},nr=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},rr=(e,t)=>{var c;let n,r,i,a,d;const m={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let u=0;u<e.length;u++)if(n=e[u],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],d=0;d<n.addons.length;d++)a=n.addons[d],a.serviceRate&&i.push(a);else i=n.addons;o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,m[r]?(m[r].qty+=n.qty,m[r].sub_total+=n.sub_total):m[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(m)},ar=e=>{var m;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(m=t.taxation)!=null&&m.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),d+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),d+=r.taxAmt);return{obj:Object.values(a),sum:d}},ir=(e,t,n)=>{var a,d,m,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 sn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=sn((d=t.siteSetting)==null?void 0:d.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.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 sn((m=t.siteSetting)==null?void 0:m.billPrinters,i,"value");{let l=sn((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(u=>u.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:m,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((_=e.customFeilds)!=null&&_.length){let w=_t(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(d=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,M)=>{var W,Ce,$;let F=T.station?T.station.split("::"):"",O=F&&F.length>1?F[1]:F[0],G=e.tableNo?e.tableNo.split("::"):null,K=G&&G.length>0?G[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,Q;(W=r==null?void 0:r[w.createdBy])!=null&&W.name&&(Q=r[w.createdBy].name);let le=!1;(m||O&&T.status==l)&&(le=!0),le&&lr(O)&&(i[O]||(i[O]={},i[O].station=O,i[O].services=[],i[O].tableName=te,i[O].customerName=e.name==t.companyName?null:e.name,i[O].time=R().format("DD-MM-YYYY hh:mm a"),i[O].type=e.orderFrom,i[O].subOrderFrom=e.subOrderFrom,i[O].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[O].orderId=new Set([i[O].orderId]),i[O].instruction=e.instruction,i[O].orderSource=e.orderSource,i[O].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[O].aggregatorOrderId=e.externalOrderId,i[O].otp=e.otp,i[O].totalQty=0,i[O].tokenId=e.tokenId,i[O].kotId=T.kotId?new Set([T.kotId]):null,i[O].waiterName=e.waiterName,i[O].duplicate=m,i[O].createdBy=Q,i[O].zomatoInstant=c,d&&(i[O].customFields=d),o&&(i[O].onlyCancelledItems=o),e.preparationTime&&(i[O].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[O]?(i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:T.isUrgent,index:M,status:T.status,addons:T.addons}),i[O].totalQty+=ve(T.qty),(Ce=i[O].kotId)==null||Ce.add(T.kotId),e.externalOrderId||e.offlineOrderId||($=i[O].orderId)==null||$.add(w.subOrderId)):(i[O]=[],i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:M,status:T.status}),i[O].totalQty+=ve(T.qty)))})});let u={},f="2INCH";Xn();let p,g=[],b={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==T.station.toUpperCase()&&(p=fs=="Android OS"?M:M.value??void 0,f=M.paperSize?M.paperSize:t.printerSize,g.push({printer:p,paperSize:f}))}),g.length==0&&g.push({printer:p,paperSize:t.printerSize||f});for(let M=0;M<T.services.length;M++){let F=T.services[M],O=e.orderList.find(K=>K.subOrderId==F.subOrderId),G=u[F.subOrderId];O&&(G?G.services.push(O.services[F.index]):(u[F.subOrderId]={},u[F.subOrderId].subOrderId=O.subOrderId,u[F.subOrderId].services=[O.services[F.index]]))}}catch(M){console.log(M)}b[w]=g,g=[],p=null}for(const w in u)Object.hasOwnProperty.call(u,w)&&u[w];return{obj:i,paperSize:f,printer:p,printersMap:b}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",m,o=[],l,c;const u=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let f=_t(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(l=t.packagingSlipPrinters[f],l.label==e.subOrderFrom&&(m=fs=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let p,g,b,_,w,T={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:u},M={},F=!1,O,G=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),b=0;b<e.orderList.length;b++)for(p=e.orderList[b],_=0;_<p.services.length;_++)g=p.services[_],g={...g,instruction:g.isUrgent&&g.instruction?`(URGENT -${g.instruction})`:g.instruction?`(${g.instruction})`:g.isUrgent?"(URGENT)":null},F=!1,g.status===r&&((a=l.stations)!=null&&a.length?(O=ld(l.stations),O[g.station]&&(F=!0)):F=!0),F&&g.kotId&&g.station&&(w=g.station.split("::")[1],G+=g.qty,M[`${w}/${g.kotId}`]?M[`${w}/${g.kotId}`].push(g):M[`${w}/${g.kotId}`]=[g]);Object.keys(M).length&&(T.services=M,T.totalQty=et(G),o.push({printer:m,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},Sd=(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 u=(c=l.station.split("::"))==null?void 0:c[1];u&&lr(u)&&(r[u]?r[u].activeKots[l.kotId]=l.kotId:r[u]={from:[n.from],to:[n.to],station:u,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,u,f={},p=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],p.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],f[u]=u;for(let g=0;g<n.orderData.length;g++)o=n.orderData[g],f[o.id]&&o.orderList.forEach(b=>{b.services.forEach(_=>{var w;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let T=(w=_.station.split("::"))==null?void 0:w[1];T&&lr(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:p,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,d=[],m={};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,d.push({printer:a,paperSize:i}))}),d.length==0&&d.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}m[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:m}},Td=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:m}=t,o={},l;const c=!!_t(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...G}=i;i={...G,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let u=c&&(n==null?void 0:n.length)&&n.some(O=>O.slugName==="online-menu")&&e.isAggregatorEnabled==!0,f=u?r.aggregator_collection:void 0,p=u?r.zomato_collection:void 0,g=u?r.swiggy_collection:void 0,b=c?Nd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const G in O)G.endsWith("collection")?l[ts(G)]=et(O[G]):l[ts(G)]=O[G]}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&&((M=Object.keys(r.itemTypeList))!=null&&M.length))for(let O in r.itemTypeList)_+=r.itemTypeList[O];let w=d;return m.toDate!==m.fromDate&&(w=`${sr(m.fromDate)} - ${sr(m.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:f,zomato_aggregator_collection:p,swiggy_aggregator_collection:g,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.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:w,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}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,p;const{invoiceFormat:a,userData:d}=n;let m,o,l=[],c;try{if((u=e.appliedDiscounts)!=null&&u.length){c=0;for(let $=0;$<e.appliedDiscounts.length;$++)m=e.appliedDiscounts[$],c+=m.discountAmt}const g=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const $=_t(e.customFeilds,"INSTRUCTION","customType");$!=null&&$.customValue&&(l=[{customName:$.customName,customValue:$.customValue}])}m={};let b=(p=t==null?void 0:t.footerAddress)!=null&&p.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",M=(b!=""?b+",":"")+(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,O={companyName:t.companyName,companyAddress:M,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={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},te={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},Q=en(t.curr),le={...e,companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q},W=null,Ce=null;a.companyLogo&&(W=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(Ce=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter($=>{$.services.forEach(async(V,Se)=>{var st,nt;let A="kitchen",Be=e.tableName?e.tableName:e.orderFrom;A&&(m[A]||(m[A]={},m[A].station=A,m[A].services=[],m[A].tableName=Be,m[A].customerName=e.name,m[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),m[A].type=e.orderFrom,m[A].orderId=e.orderId,m[A].instruction=e.instruction,m[A].totalQty=0,m[A].tokenId=e.tokenId,m[A].orderSource=e.orderSource,m[A].aggregatorOrderId=e.externalOrderId,m[A].otp=e.otp,m[A].paymentState=e.paymentState,m[A].discountAmt=c,m[A].otherCharges=e.otherCharges,m[A].taxAmt=e.taxAmt,m[A].customFeilds=l,m[A].curr=t.curr??"INR",m[A].zomatoInstant=g),m[A]?(o={serviceName:V.serviceName,qty:V.qty,instruction:V.isUrgent&&V.instruction?`(URGENT -${V.instruction})`:V.instruction?`(${V.instruction})`:V.isUrgent?"(URGENT)":"",subOrderId:$.subOrderId,isUrgent:V.isUrgent,index:Se},(st=V.addons)!=null&&st.length&&(o.addons=V.addons),m[A].services.push(o),m[A].totalQty+=V.qty):(m[A]=[],m[A].services.push({serviceName:V.serviceName,qty:V.qty,instruction:V.instruction?V.instruction:"",subOrderId:$.subOrderId,index:Se}),m[A].totalQty+=V.qty),m[A]={...m[A],companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q},m[A].domain=a.siteURL,m[A].paymentMethods=a.paymentMode?le.paymentMethods:null,m[A].companyInfo.companyName=a.companyName,m[A].companyInfo.companyEmail=a.email,m[A].companyInfo.companyAddress=a.address,m[A].companyInfo.companyContact=a.mobile,m[A].tokenId=a.token?le.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(le.upiId=a.upiId),m[A].gstNo=a.gst?le.gst:null,m[A].footerMessage=a.footerMessage,m[A].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),m[A].fssai=t.fssai,m[A].vatNo=t.vatNo,m[A].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,m[A].disabledPoweredBy=t.disabledPoweredBy===!0,m[A].printTime=R().format("DD-MM-YYYY hh:mm A"),m[A].printedBy=d.userRole=="admin"?"Admin":d.name,e.deliveryTimestamp&&(m[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),m[A].itemInstructionOnBill=a.itemInstructionOnBill,m[A]={...m[A],companyLogo:W,companyQrCode:Ce})})});for(const $ in m)if(Object.hasOwnProperty.call(m,$)){const V=m[$];try{let Se=t.printerSize??"2inch";r(new Object({obj:new Object({...V,paperSize:Se}),orderList:e.orderList}));return}catch(Se){console.log(Se)}}}catch(g){console.log("err::",g)}}),Id=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let f=0;f<e[u].orderList.length;f++)t.push(e[u].orderList[f]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let f=0;f<t[u].services.length;f++)t[u].services[f].status!="CANCELLED"&&t[u].services[f].status!="RETURNED"&&t[u].services[f].status!="SHIFTED"&&n.push(t[u].services[f]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let f=0;f<n[u].addons.length;f++){let p={...n[u].addons[f]};p.qty=n[u].qty,i.push(p)}n.forEach(u=>{let{attachedCat:f,serviceId:p}=u;r[f]||(r[f]=[]);let g=r[f].findIndex(b=>b.serviceId===p);g!==-1?r[f][g].qty=r[f][g].qty+u.qty:r[f].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedCat,station:u.station})});const a=Object.keys(r).sort(),d={};a.forEach(u=>{d[u]=r[u]});for(let u in d)d[u].sort((f,p)=>f.serviceName.localeCompare(p.serviceName));let m={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:f,serviceId:p}=u;o[f]||(o[f]=[]);let g=o[f].findIndex(b=>b.serviceId===p);g!==-1?o[f][g].qty=o[f][g].qty+u.qty:o[f].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedAddonCat,station:u.station})});const l=Object.keys(o).sort(),c={};l.forEach(u=>{c[u]=o[u]});for(let u in c)c[u].sort((f,p)=>f.serviceName.localeCompare(p.serviceName));return m.Addon=c,m},Na={"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"},ja=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return Na[t]?Na[t]:"SGST"},va=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,o,l,c,u;try{const{invoiceFormat:f,custName:p,custMobile:g,custAddress:b,userData:_={}}=n,{itemList:w}=e;let T=_==null?void 0:_.userRole;if(_.userRole=="admin"?T="ADMIN":T=_==null?void 0:_.name,!(w!=null&&w.length))return;let M=t.printerSize,F=ir(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});M=F?(d=F[0])!=null&&d.paperSize?(m=F[0])==null?void 0:m.paperSize:M||"2INCH":M;let O=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",G=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",K=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",Q=(O!=""?O+",":"")+(G!=""?G+",":"")+(K!=""?K+",":"")+(te!=""?te+",":""),le=t.gstNo,W={companyName:t.companyName,companyAddress:Q,companyContact:t.contactNumber,companyEmail:t.contactEmail},$={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},V={custName:f&&f.custName?p==t.companyName?null:p:null,custAddress:f&&f.custAddress&&b||null,custContact:f&&f.custMobile?g:null,custEmail:"ajaybaglane7@gmail.com"},Se=en(t.curr),A={...e,companyInfo:W,orderInfo:$,customerInfo:V,gst:le,curr:Se};if(f){if(A.domain=f.siteURL,A.paymentMethods=f.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=f.companyName,A.companyInfo.companyEmail=f.email,A.companyInfo.companyAddress=f.address,A.companyInfo.companyContact=f.mobile,A.customerInfo.custName=f.custName?p:null,A.tokenId=f.token?A.tokenId:null,f.isPayQR&&f.upiId&&f.upiId!==""&&(A.upiId=f.upiId),A.gstNo=f.gst?A.gst:null,A.footerMessage=f.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ja(t),A.printOperatorInfo=f.printOperatorInfo===null||f.printOperatorInfo===!0,A.disabledPoweredBy=t.disabledPoweredBy===!0,A.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(A.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),A.itemInstructionOnBill=f.itemInstructionOnBill,A.noOfInvoice=f.noOfInvoice,A.printby=T,A.newFormat=!0,!f.itemInstructionOnBill&&A.itemList){let J;for(let Ne=0;Ne<A.itemList.length;Ne++)J=A.itemList[Ne],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Be=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let Ne=0;Ne<e.customFeilds.length;Ne++)J=e.customFeilds[Ne],J!=null&&J.customValue&&((u=J.availability)!=null&&u.includes("BILL"))&&Be.push({customName:J.customName,customValue:J.customValue});A.customFields=Be}let st=null,nt=null;f.companyLogo&&(st=await zt(`https://${f.companyLogo.bucket}.s3.amazonaws.com/${f.companyLogo.key}`)),f.qrcode&&(nt=await zt(`https://${f.qrcode.bucket}.s3.amazonaws.com/${f.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 ft={};(function(){let J,Ne,pt=0,yt=0,x=0,h=0,C=0,j=0,I=0,D=0,S=[],k=[],H=0,fe;if(M==="A4"||M==="A5"){for(Ne=0;Ne<w.length;Ne++)J=w[Ne],yt+=J.sub_total,x+=J.afterdiscAmt,h+=J.afterdiscAmt+(J.total_charges??0),pt+=J.afterdiscAmt+(J.total_charges??0),H+=J.qty;let Te=er(w,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(w);ft={itemList:rr(w,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(w,"name"),taxation:Pe,subTotal:ve(yt),afterDisc:ve(x),afterCharges:ve(h),total:ve(pt+Ae),qty:H}}else{for(Ne=0;Ne<w.length;Ne++)J=w[Ne],J.taxType==="VAT"?(k.push(J),D+=J.sub_total,j+=J.afterdiscAmt,C+=J.afterdiscAmt+(J.total_charges??0),I+=J.afterdiscAmt+(J.total_charges??0)):(S.push(J),yt+=J.sub_total,x+=J.afterdiscAmt,h+=J.afterdiscAmt+(J.total_charges??0),pt+=J.afterdiscAmt+(J.total_charges??0));if(S.length){let Te=er(S,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(S);ft.GST={itemList:rr(S,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(S,"name"),taxation:Pe,subTotal:ve(yt),afterDisc:ve(x),afterCharges:ve(h),total:ve(pt+Ae)}}if(k.length){let Te=er(k,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(k);ft.VAT={itemList:rr(k,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(k,"name"),taxation:Pe,subTotal:ve(D),afterDisc:ve(j),afterCharges:ve(C),total:ve(I+Ae)}}}})(),A.distributedData=ft;let Mt={obj:A,companyLogo:st,companyQrCode:nt,paperSize:t.printerSize,Name:a};r(Mt)}}catch(f){console.log("err",f),i(f)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,o,l;try{const{invoiceFormat:c,custName:u,custMobile:f,custAddress:p,orderData:g}=n;let b=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",M=(b!=""?b+",":"")+(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,O={companyName:t.companyName,companyAddress:M,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={orderStatus:"COMPLETED",orderDate:g&&g.timestamp?R.unix(g.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:g&&g.orderId?g.orderId:null,timestamp:g.timestamp},te={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&p||null,custContact:c&&c.custMobile?f:null,custEmail:"ajaybaglane7@gmail.com"},Q=en(t.curr),le="",W={...e,companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q};if(c){if(W.domain=c.siteURL,W.paymentMethods=c.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=c.companyName,W.companyInfo.companyEmail=c.email,W.companyInfo.companyAddress=c.address,W.companyInfo.companyContact=c.mobile,W.customerInfo.custName=c.custName?u:null,W.tokenId=c.token?W.tokenId:null,c.isPayQR&&c.upiId&&c.upiId!==""&&(W.upiId=c.upiId),W.gstNo=c.gst?W.gst:null,W.footerMessage=c.footerMessage,W.orderFrom=(d=g.subOrderFrom)==null?void 0:d.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ja(t),W.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),g.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(g.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=c.itemInstructionOnBill,W.noOfInvoice=c.noOfInvoice,W.area=g.area,W.captainName=g.captainName,!c.itemInstructionOnBill&&W.itemList){let $;for(let V=0;V<W.itemList.length;V++)$=W.itemList[V],$.instruction&&delete $.instruction}t.enabledOutstandingOnPay&&((m=e.custoutStandingData)!=null&&m.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Ce=[];if((o=g.customFeilds)!=null&&o.length){let $;for(let V=0;V<g.customFeilds.length;V++)$=g.customFeilds[V],$!=null&&$.customValue&&((l=$.availability)!=null&&l.includes("BILL"))&&Ce.push({customName:$.customName,customValue:$.customValue});W.customFields=Ce}if(t&&t.isOld&&t.isOld==!0){let $=null,V=null;c.companyLogo&&($=await zt(`https://${c.companyLogo.bucket}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(V=await zt(`https://${c.qrcode.bucket}.s3.amazonaws.com/${c.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 Se={obj:W,companyLogo:$,companyQrCode:V,paperSize:t.printerSize,Name:a};r(Se)}}}catch(c){console.log("err",c)}}),Od=(e,t)=>new Promise(async(n,r)=>{var M;let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",d=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",m=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(m!=""?m+",":"")+(o!=""?o+",":""),c=[],u,f=0,p=0,g=0,b=[],_,w;const T=Zs(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(u=e[F],c.push({date:u.date,orderId:u.orderId,finalAmount:u.finalAmount}),f+=u.finalAmount,p+=u.paidAmt,g+=u.balanceAmt,_=0;_<u.orderTransactions.length;_++)w=u.orderTransactions[_],w.paidAmt&&b.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:ve(w.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:f,totalPaid:p,totalPayable:g,paperSize:t.printerSize,curr:en(t.curr),transactions:b})}),Md=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 va({...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 Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),_a=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},lr=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(d=>d.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Ad(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 Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function bt(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ba(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=bt(window.getComputedStyle(document.documentElement)),Gt))}function nn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=nn(e,"border-left-width"),n=nn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=nn(e,"border-top-width"),n=nn(e,"border-bottom-width");return e.clientHeight+t+n}function Sa(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ye=16384;function Pd(e){(e.width>Ye||e.height>Ye)&&(e.width>Ye&&e.height>Ye?e.width>e.height?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye):e.width>Ye?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye))}function rn(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 Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(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),Fd(i)}const ke=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return ba(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function Ta(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=Ed();try{t.className=`${t.className} ${d}`}catch{return}const m=document.createElement("style");m.appendChild($d(d,n,i,r)),t.appendChild(m)}function Hd(e,t,n){Ta(e,t,":before",n),Ta(e,t,":after",n)}const wa="application/font-woff",Ia="image/jpeg",Bd={woff:wa,woff2:wa,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ia,jpeg:Ia,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 or(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function cr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Ca(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,d)=>{const m=new FileReader;m.onerror=d,m.onloadend=()=>{try{a(n({res:r,result:m.result}))}catch(o){d(o)}},m.readAsDataURL(i)})}const dr={};function Vd(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 hr(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(dr[r]!=null)return dr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ca(e,n.fetchRequestInit,({res:d,result:m})=>(t||(t=d.headers.get("Content-Type")||""),zd(m)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let d=`Failed to fetch resource: ${e}`;a&&(d=typeof a=="string"?a:a.message),d&&console.warn(d)}return dr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),d=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,d==null||d.drawImage(e,0,0,a.width,a.height);const m=a.toDataURL();return rn(m)}const n=e.poster,r=or(n),i=await hr(n,r,t);return rn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await an(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return ke(e,HTMLCanvasElement)?qd(e):ke(e,HTMLVideoElement)?Kd(e,t):ke(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Oa(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Oa(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=bt(e.assignedNodes()):ke(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=bt(e.contentDocument.body.childNodes):a=bt(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||ke(e,HTMLVideoElement)||await a.reduce((d,m)=>d.then(()=>an(m,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(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):ba(n).forEach(a=>{let d=i.getPropertyValue(a);a==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&a==="display"&&d==="inline"&&(d="block"),a==="d"&&t.getAttribute("d")&&(d=`path(${t.getAttribute("d")})`),r.setProperty(a,d,i.getPropertyPriority(a))})}function th(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(ke(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return ke(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(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 m=n[a].getAttribute("xlink:href");if(m){const o=e.querySelector(m),l=document.querySelector(m);!o&&l&&!r[m]&&(r[m]=await an(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const m=document.createElementNS(a,"defs");d.appendChild(m);for(let o=0;o<i.length;o++)m.appendChild(i[o]);e.appendChild(d)}return e}async function an(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Ma=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Ma,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,d=or(t);let m;return i||(m=await hr(a,d,r)),e.replace(lh(t),`$1${m}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Aa(e){return e.search(Ma)!==-1}async function Ea(e,t,n){if(!Aa(e))return e;const r=dh(e,n);return oh(r).reduce((a,d)=>a.then(m=>ch(m,d,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ea(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function uh(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!cr(e.src))&&!(ke(e,SVGImageElement)&&!cr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hr(r,or(r),t);await new Promise((a,d)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){d(l)}}:d;const m=e;m.decode&&(m.decode=a),m.loading==="lazy"&&(m.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=bt(e.childNodes).map(i=>Ra(i,t));await Promise.all(r).then(()=>e)}async function Ra(e,t){ke(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(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 ka={};async function La(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Pa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let m=d.replace(r,"$1");return m.startsWith("https://")||(m=new URL(m,e.url).href),Ca(m,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function Fa(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,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",m=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=m.exec(r),o===null)break;a.lastIndex=m.lastIndex}else m.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let m=d+1;const o=a.href,l=La(o).then(c=>Pa(c,t)).then(c=>Fa(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?m+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:u,error:f})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(m=>m.href==null)||document.styleSheets[0];i.href!=null&&r.push(La(i.href).then(m=>Pa(m,t)).then(m=>Fa(m).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(m=>{console.error("Error loading remote stylesheet",m)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Aa(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=bt(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Da(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Da(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Da(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ea(a.cssText,d,t)}))).join(`
46
- `)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(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 Ya(e,t={}){const{width:n,height:r}=Sa(e,t),i=await an(e,t,!0);return await jh(i,t),await Ra(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Sa(e,t),i=await Ya(e,t),a=await rn(i),d=document.createElement("canvas"),m=d.getContext("2d"),o=t.pixelRatio||Ld(),l=t.canvasWidth||n,c=t.canvasHeight||r;return d.width=l*o,d.height=c*o,t.skipAutoScale||Pd(d),d.style.width=`${l}`,d.style.height=`${c}`,t.backgroundColor&&(m.fillStyle=t.backgroundColor,m.fillRect(0,0,d.width,d.height)),m.drawImage(a,0,0,d.width,d.height),d}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,ln=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Ha=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t)=>{for(var n in t||(t={}))Ua.call(t,n)&&Ha(e,n,t[n]);if(ln)for(var n of ln(t))$a.call(t,n)&&Ha(e,n,t[n]);return e},ur=(e,t)=>{var n={};for(var r in e)Ua.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ln)for(var r of ln(e))t.indexOf(r)<0&&$a.call(e,r)&&(n[r]=e[r]);return n};/**
45
+ */var cd=Js.exports,ga;function dd(){return ga||(ga=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(cd,function(){var t,n,r="2.0.6",i={},a={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},m={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,u,f,p;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(m.zeroFormat&&l===m.zeroFormat)c=0;else if(m.nullFormat&&l===m.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(u in i)if(p=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,p&&l.match(p)){f=i[u].unformat;break}f=f||t._.stringToNumber,c=f(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,u){var f=a[t.options.currentLocale],p=!1,g=!1,b=0,v="",w=1e12,T=1e9,M=1e6,F=1e3,O="",G=!1,K,te,Q,le,W,Ce,$;if(l=l||0,te=Math.abs(l),t._.includes(c,"(")?(p=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(W=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(K=c.match(/a(k|m|b|t)?/),K=K?K[1]:!1,t._.includes(c," a")&&(v=" "),c=c.replace(new RegExp(v+"a[kmbt]?"),""),te>=w&&!K||K==="t"?(v+=f.abbreviations.trillion,l=l/w):te<w&&te>=T&&!K||K==="b"?(v+=f.abbreviations.billion,l=l/T):te<T&&te>=M&&!K||K==="m"?(v+=f.abbreviations.million,l=l/M):(te<M&&te>=F&&!K||K==="k")&&(v+=f.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(g=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],le=c.split(".")[1],Ce=c.indexOf(","),b=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,le?(t._.includes(le,"[")?(le=le.replace("]",""),le=le.split("["),O=t._.toFixed(l,le[0].length+le[1].length,u,le[1].length)):O=t._.toFixed(l,le.length,u),Q=O.split(".")[0],t._.includes(O,".")?O=f.delimiters.decimal+O.split(".")[1]:O="",g&&Number(O.slice(1))===0&&(O="")):Q=t._.toFixed(l,0,u),v&&!K&&Number(Q)>=1e3&&v!==f.abbreviations.trillion)switch(Q=String(Number(Q)/1e3),v){case f.abbreviations.thousand:v=f.abbreviations.million;break;case f.abbreviations.million:v=f.abbreviations.billion;break;case f.abbreviations.billion:v=f.abbreviations.trillion;break}if(t._.includes(Q,"-")&&(Q=Q.slice(1),G=!0),Q.length<b)for(var q=b-Q.length;q>0;q--)Q="0"+Q;return Ce>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),$=Q+O+(v||""),p?$=(p&&G?"(":"")+$+(p&&G?")":""):W>=0?$=W===0?(G?"-":"+")+$:$+(G?"-":"+"):G&&($="-"+$),$},stringToNumber:function(l){var c=a[m.currentLocale],u=l,f={thousand:3,million:6,billion:9,trillion:12},p,g,b;if(m.zeroFormat&&l===m.zeroFormat)g=0;else if(m.nullFormat&&l===m.nullFormat||!l.replace(/[^0-9]+/g,"").length)g=null;else{g=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(p in f)if(b=new RegExp("[^a-zA-Z]"+c.abbreviations[p]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),u.match(b)){g*=Math.pow(10,f[p]);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,u){return l.slice(0,u)+c+l.slice(u)},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 u=Object(l),f=u.length>>>0,p=0,g;if(arguments.length===3)g=arguments[2];else{for(;p<f&&!(p in u);)p++;if(p>=f)throw new TypeError("Reduce of empty array with no initial value");g=u[p++]}for(;p<f;p++)p in u&&(g=c(g,u[p],p,u));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,u){var f=n.multiplier(u);return c>f?c:f},1)},toFixed:function(l,c,u,f){var p=l.toString().split("."),g=c-(f||0),b,v,w,T;return p.length===2?b=Math.min(Math.max(p[1].length,g),c):b=g,w=Math.pow(10,b),T=(u(l+"e+"+b)/w).toFixed(b),f>c-b&&(v=new RegExp("\\.?0{1,"+(f-(c-b))+"}$"),T=T.replace(v,"")),T}},t.options=m,t.formats=i,t.locales=a,t.locale=function(l){return l&&(m.currentLocale=l.toLowerCase()),m.currentLocale},t.localeData=function(l){if(!l)return a[m.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in d)m[l]=d[l]},t.zeroFormat=function(l){m.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){m.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){m.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,u){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=u,u},t.validate=function(l,c){var u,f,p,g,b,v,w,T;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{w=t.localeData(c)}catch{w=t.localeData(t.locale())}return p=w.currency.symbol,b=w.abbreviations,u=w.delimiters.decimal,w.delimiters.thousands==="."?f="\\.":f=w.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==p)||(T=l.match(/[^\d]+$/),T!==null&&(l=l.slice(0,-1),T[0]!==b.thousand&&T[0]!==b.million&&T[0]!==b.billion&&T[0]!==b.trillion))?!1:(v=new RegExp(f+"{2}"),l.match(/[^\d.,]/g)?!1:(g=l.split(u),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(v):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(v)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(v)&&!!g[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var u=this._value,f=l||m.defaultFormat,p,g,b;if(c=c||Math.round,u===0&&m.zeroFormat!==null)g=m.zeroFormat;else if(u===null&&m.nullFormat!==null)g=m.nullFormat;else{for(p in i)if(f.match(i[p].regexps.format)){b=i[p].format;break}b=b||t._.numberToFormat,g=b(u,f,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 u(f,p,g,b){return f+Math.round(c*p)}return this._value=n.reduce([this._value,l],u,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function u(f,p,g,b){return f-Math.round(c*p)}return this._value=n.reduce([l],u,Math.round(this._value*c))/c,this},multiply:function(l){function c(u,f,p,g){var b=n.correctionFactor(u,f);return Math.round(u*b)*Math.round(f*b)/Math.round(b*b)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(u,f,p,g){var b=n.correctionFactor(u,f);return Math.round(u*b)/Math.round(f*b)}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,u){var f=t._.includes(c," BPS")?" ":"",p;return l=l*1e4,c=c.replace(/\s?BPS/,""),p=t._.numberToFormat(l,c,u),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,f+"BPS"),p=p.join("")):p=p+f+"BPS",p},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"]},u=l.suffixes.concat(c.suffixes.filter(function(p){return l.suffixes.indexOf(p)<0})),f=u.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(p,g,b){var v,w=t._.includes(g,"ib")?c:l,T=t._.includes(g," b")||t._.includes(g," ib")?" ":"",M,F,O;for(g=g.replace(/\s?i?b/,""),M=0;M<=w.suffixes.length;M++)if(F=Math.pow(w.base,M),O=Math.pow(w.base,M+1),p===null||p===0||p>=F&&p<O){T+=w.suffixes[M],F>0&&(p=p/F);break}return v=t._.numberToFormat(p,g,b),v+T},unformat:function(p){var g=t._.stringToNumber(p),b,v;if(g){for(b=l.suffixes.length-1;b>=0;b--){if(t._.includes(p,l.suffixes[b])){v=Math.pow(l.base,b);break}if(t._.includes(p,c.suffixes[b])){v=Math.pow(c.base,b);break}}g*=v||1}return g}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,u){var f=t.locales[t.options.currentLocale],p={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,b,v;for(c=c.replace(/\s?\$\s?/,""),g=t._.numberToFormat(l,c,u),l>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),v=0;v<p.before.length;v++)switch(b=p.before[v],b){case"$":g=t._.insert(g,f.currency.symbol,v);break;case" ":g=t._.insert(g," ",v+f.currency.symbol.length-1);break}for(v=p.after.length-1;v>=0;v--)switch(b=p.after[v],b){case"$":g=v===p.after.length-1?g+f.currency.symbol:t._.insert(g,f.currency.symbol,-(p.after.length-(1+v)));break;case" ":g=v===p.after.length-1?g+" ":t._.insert(g," ",-(p.after.length-(1+v)+f.currency.symbol.length-1));break}return g}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,u){var f,p=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",g=p.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(g[0]),c,u),f+"e"+g[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),u=Number(c[0]),f=Number(c[1]);f=t._.includes(l,"e-")?f*=-1:f;function p(g,b,v,w){var T=t._.correctionFactor(g,b),M=g*T*(b*T)/(T*T);return M}return t._.reduce([u,Math.pow(10,f)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,u){var f=t.locales[t.options.currentLocale],p,g=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),g+=f.ordinal(l),p=t._.numberToFormat(l,c,u),p+g}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,u){var f=t._.includes(c," %")?" ":"",p;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),p=t._.numberToFormat(l,c,u),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,f+"%"),p=p.join("")):p=p+f+"%",p},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,u){var f=Math.floor(l/60/60),p=Math.floor((l-f*60*60)/60),g=Math.round(l-f*60*60-p*60);return f+":"+(p<10?"0"+p:p)+":"+(g<10?"0"+g:g)},unformat:function(l){var c=l.split(":"),u=0;return c.length===3?(u=u+Number(c[0])*60*60,u=u+Number(c[1])*60,u=u+Number(c[2])):c.length===2&&(u=u+Number(c[0])*60,u=u+Number(c[1])),Number(u)}})}(),t})}(Js)),Js.exports}var hd=dd();const Xs=pr(hd),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ud={_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}},xa=(e,t)=>{const n=ud[`_${tn[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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",tn={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 md(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(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(f){if(f<10)return t[f];if(f<20)return n[f-11];{const p=f%10,g=Math.floor(f/10);return`${r[g]}${p?" "+t[p]:""}`}}function a(f){var p=f.toString(),g,b,v,w,T,M,F,O,G,K,te,Q,le="and";if(p=p.replace(/[, ]/g,""),parseInt(p)===0)return"zero";for(g=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],b=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],v=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],w=p.length,M=[];w>0;)T=w,M.push(p.slice(w=Math.max(0,w-3),T));if(F=M.length,F>v.length)return"";for(Q=[],K=0;K<F;K++)O=parseInt(M[K]),O&&(G=M[K].split("").reverse().map(parseFloat),G[1]===1&&(G[0]+=10),(te=v[K])&&Q.push(te),(te=g[G[0]])&&Q.push(te),(te=b[G[1]])&&Q.push(te),(G[0]||G[1])&&(G[2]||K+1>F)&&Q.push(le),(te=g[G[2]])&&Q.push(te+" Hundred"));return Q.reverse().join(" ")}const[d,m]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(m,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>`${tn[t].symbol} ${xa(e||0,t)}`,U=(e,t)=>`${tn[t].symbol} ${md(e||0,t)}`,Xn=()=>{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},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),er=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var m;(m=d.discounts)==null||m.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:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},tr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const m=`${d[t]}`;n[m]?(n[m].amt+=d.amt,n[m].taxAmt+=d.taxAmt):n[m]={amt:d.amt,chargeType:d.chargeType?d.chargeType:d.type,defaultSelcted:d.defaultSelcted,rate:d.rate,tax:d.tax,taxAmt:d.taxAmt,name:d.name,type:d.type}})}),Object.values(n)},sr=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"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function yd(e,t,n,r,i){const a=fs("1",e),d=fs("2",t),m=fs("3",n),o=fs("4",r),l=fs("5",i);var c=Buffer.concat([a,d,m,o,l]);return c.toString("base64")}const gd=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"}),xd=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=Xn(),Nd=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),d=Math.floor(t%3600/60),m=`${a} hr ${d} min`;return m}else return r},jd=(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=ms(i,"internalName");let d;for(let m in e.paymentModes)!r[m]&&e.paymentModes[m]&&(d=a[m],n.push({displayName:d?d.displayName:Ke(m.replace("_"," ")),value:et(e.paymentModes[m])}));return n},vd=(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 i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var d=i.toDataURL("image/png");t(d)},r.onerror=i=>{t(null)}}catch{t(null)}})}const sn=(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},nr=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},rr=(e,t)=>{var c,u,f,p;let n,r,i,a,d;const m={},{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=[],d=0;d<n.addons.length;d++)a=n.addons[d],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"}`,m[r]){if(m[r].qty+=n.qty,m[r].sub_total+=n.sub_total,(u=m[r].addons)!=null&&u.length&&((f=n.addons)!=null&&f.length)){const b=ms(n.addons,"serviceId"),v=[];let w;for(let T=0;T<m[r].addons.length;T++)a=m[r].addons[T],(p=b[a.serviceId])!=null&&p.serviceId&&(w=b[a.serviceId],a.sub_total+=w.sub_total??0),v.push(a);m[r].addons=v}}else m[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(m)},ar=e=>{var m;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(m=t.taxation)!=null&&m.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),d+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),d+=r.taxAmt);return{obj:Object.values(a),sum:d}},ir=(e,t,n)=>{var a,d,m,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 sn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=sn((d=t.siteSetting)==null?void 0:d.packagingSlipPrinters,i,"value");if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.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 sn((m=t.siteSetting)==null?void 0:m.billPrinters,i,"value");{let l=sn((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var v;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:m,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((v=e.customFeilds)!=null&&v.length){let w=_t(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(d=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,M)=>{var W,Ce,$;let F=T.station?T.station.split("::"):"",O=F&&F.length>1?F[1]:F[0],G=e.tableNo?e.tableNo.split("::"):null,K=G&&G.length>0?G[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,Q;(W=r==null?void 0:r[w.createdBy])!=null&&W.name&&(Q=r[w.createdBy].name);let le=!1;(m||O&&T.status==l)&&(le=!0),le&&lr(O)&&(i[O]||(i[O]={},i[O].station=O,i[O].services=[],i[O].tableName=te,i[O].customerName=e.name==t.companyName?null:e.name,i[O].time=R().format("DD-MM-YYYY hh:mm a"),i[O].type=e.orderFrom,i[O].subOrderFrom=e.subOrderFrom,i[O].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[O].orderId=new Set([i[O].orderId]),i[O].instruction=e.instruction,i[O].orderSource=e.orderSource,i[O].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[O].aggregatorOrderId=e.externalOrderId,i[O].otp=e.otp,i[O].totalQty=0,i[O].tokenId=e.tokenId,i[O].kotId=T.kotId?new Set([T.kotId]):null,i[O].waiterName=e.waiterName,i[O].duplicate=m,i[O].createdBy=Q,i[O].zomatoInstant=c,d&&(i[O].customFields=d),o&&(i[O].onlyCancelledItems=o),e.preparationTime&&(i[O].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[O]?(i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:T.isUrgent,index:M,status:T.status,addons:T.addons}),i[O].totalQty+=ve(T.qty),(Ce=i[O].kotId)==null||Ce.add(T.kotId),e.externalOrderId||e.offlineOrderId||($=i[O].orderId)==null||$.add(w.subOrderId)):(i[O]=[],i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:M,status:T.status}),i[O].totalQty+=ve(T.qty)))})});let u={},f="2INCH";Xn();let p,g=[],b={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==T.station.toUpperCase()&&(p=ps=="Android OS"?M:M.value??void 0,f=M.paperSize?M.paperSize:t.printerSize,g.push({printer:p,paperSize:f}))}),g.length==0&&g.push({printer:p,paperSize:t.printerSize||f});for(let M=0;M<T.services.length;M++){let F=T.services[M],O=e.orderList.find(K=>K.subOrderId==F.subOrderId),G=u[F.subOrderId];O&&(G?G.services.push(O.services[F.index]):(u[F.subOrderId]={},u[F.subOrderId].subOrderId=O.subOrderId,u[F.subOrderId].services=[O.services[F.index]]))}}catch(M){console.log(M)}b[w]=g,g=[],p=null}for(const w in u)Object.hasOwnProperty.call(u,w)&&u[w];return{obj:i,paperSize:f,printer:p,printersMap:b}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",m,o=[],l,c;const u=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let f=_t(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(l=t.packagingSlipPrinters[f],l.label==e.subOrderFrom&&(m=ps=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let p,g,b,v,w,T={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:u},M={},F=!1,O,G=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),b=0;b<e.orderList.length;b++)for(p=e.orderList[b],v=0;v<p.services.length;v++)g=p.services[v],g={...g,instruction:g.isUrgent&&g.instruction?`(URGENT -${g.instruction})`:g.instruction?`(${g.instruction})`:g.isUrgent?"(URGENT)":null},F=!1,g.status===r&&((a=l.stations)!=null&&a.length?(O=ld(l.stations),O[g.station]&&(F=!0)):F=!0),F&&g.kotId&&g.station&&(w=g.station.split("::")[1],G+=g.qty,M[`${w}/${g.kotId}`]?M[`${w}/${g.kotId}`].push(g):M[`${w}/${g.kotId}`]=[g]);Object.keys(M).length&&(T.services=M,T.totalQty=et(G),o.push({printer:m,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},Sd=(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 u=(c=l.station.split("::"))==null?void 0:c[1];u&&lr(u)&&(r[u]?r[u].activeKots[l.kotId]=l.kotId:r[u]={from:[n.from],to:[n.to],station:u,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,u,f={},p=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],p.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],f[u]=u;for(let g=0;g<n.orderData.length;g++)o=n.orderData[g],f[o.id]&&o.orderList.forEach(b=>{b.services.forEach(v=>{var w;if((v.status==="KOT_GENERATED"||v.status==="IN_PROCESS")&&v.station){let T=(w=v.station.split("::"))==null?void 0:w[1];T&&lr(T)&&(r[T]?r[T].activeKots[v.kotId]=v.kotId:r[T]={from:p,to:[n.to],station:T,activeKots:{[v.kotId]:v.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:v.id})}})})}let i="2INCH",a,d=[],m={};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?ps=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,d.push({printer:a,paperSize:i}))}),d.length==0&&d.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}m[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:m}},Td=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:m}=t,o={},l;const c=!!_t(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...G}=i;i={...G,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let u=c&&(n==null?void 0:n.length)&&n.some(O=>O.slugName==="online-menu")&&e.isAggregatorEnabled==!0,f=u?r.aggregator_collection:void 0,p=u?r.zomato_collection:void 0,g=u?r.swiggy_collection:void 0,b=c?Nd(r.avgTableTime):void 0;l={};let v=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const G in O)G.endsWith("collection")?l[ts(G)]=et(O[G]):l[ts(G)]=O[G]}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&&((M=Object.keys(r.itemTypeList))!=null&&M.length))for(let O in r.itemTypeList)v+=r.itemTypeList[O];let w=d;return m.toDate!==m.fromDate&&(w=`${sr(m.fromDate)} - ${sr(m.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:f,zomato_aggregator_collection:p,swiggy_aggregator_collection:g,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.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:w,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:v,itemTypeList:r.itemTypeList}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,p;const{invoiceFormat:a,userData:d}=n;let m,o,l=[],c;try{if((u=e.appliedDiscounts)!=null&&u.length){c=0;for(let $=0;$<e.appliedDiscounts.length;$++)m=e.appliedDiscounts[$],c+=m.discountAmt}const g=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const $=_t(e.customFeilds,"INSTRUCTION","customType");$!=null&&$.customValue&&(l=[{customName:$.customName,customValue:$.customValue}])}m={};let b=(p=t==null?void 0:t.footerAddress)!=null&&p.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",v=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",M=(b!=""?b+",":"")+(v!=""?v+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,O={companyName:t.companyName,companyAddress:M,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={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},te={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},Q=en(t.curr),le={...e,companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q},W=null,Ce=null;a.companyLogo&&(W=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(Ce=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter($=>{$.services.forEach(async(q,Se)=>{var st,nt;let A="kitchen",Be=e.tableName?e.tableName:e.orderFrom;A&&(m[A]||(m[A]={},m[A].station=A,m[A].services=[],m[A].tableName=Be,m[A].customerName=e.name,m[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),m[A].type=e.orderFrom,m[A].orderId=e.orderId,m[A].instruction=e.instruction,m[A].totalQty=0,m[A].tokenId=e.tokenId,m[A].orderSource=e.orderSource,m[A].aggregatorOrderId=e.externalOrderId,m[A].otp=e.otp,m[A].paymentState=e.paymentState,m[A].discountAmt=c,m[A].otherCharges=e.otherCharges,m[A].taxAmt=e.taxAmt,m[A].customFeilds=l,m[A].curr=t.curr??"INR",m[A].zomatoInstant=g),m[A]?(o={serviceName:q.serviceName,qty:q.qty,instruction:q.isUrgent&&q.instruction?`(URGENT -${q.instruction})`:q.instruction?`(${q.instruction})`:q.isUrgent?"(URGENT)":"",subOrderId:$.subOrderId,isUrgent:q.isUrgent,index:Se},(st=q.addons)!=null&&st.length&&(o.addons=q.addons),m[A].services.push(o),m[A].totalQty+=q.qty):(m[A]=[],m[A].services.push({serviceName:q.serviceName,qty:q.qty,instruction:q.instruction?q.instruction:"",subOrderId:$.subOrderId,index:Se}),m[A].totalQty+=q.qty),m[A]={...m[A],companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q},m[A].domain=a.siteURL,m[A].paymentMethods=a.paymentMode?le.paymentMethods:null,m[A].companyInfo.companyName=a.companyName,m[A].companyInfo.companyEmail=a.email,m[A].companyInfo.companyAddress=a.address,m[A].companyInfo.companyContact=a.mobile,m[A].tokenId=a.token?le.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(le.upiId=a.upiId),m[A].gstNo=a.gst?le.gst:null,m[A].footerMessage=a.footerMessage,m[A].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),m[A].fssai=t.fssai,m[A].vatNo=t.vatNo,m[A].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,m[A].disabledPoweredBy=t.disabledPoweredBy===!0,m[A].printTime=R().format("DD-MM-YYYY hh:mm A"),m[A].printedBy=d.userRole=="admin"?"Admin":d.name,e.deliveryTimestamp&&(m[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),m[A].itemInstructionOnBill=a.itemInstructionOnBill,m[A]={...m[A],companyLogo:W,companyQrCode:Ce})})});for(const $ in m)if(Object.hasOwnProperty.call(m,$)){const q=m[$];try{let Se=t.printerSize??"2inch";r(new Object({obj:new Object({...q,paperSize:Se}),orderList:e.orderList}));return}catch(Se){console.log(Se)}}}catch(g){console.log("err::",g)}}),Id=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let f=0;f<e[u].orderList.length;f++)t.push(e[u].orderList[f]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let f=0;f<t[u].services.length;f++)t[u].services[f].status!="CANCELLED"&&t[u].services[f].status!="RETURNED"&&t[u].services[f].status!="SHIFTED"&&n.push(t[u].services[f]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let f=0;f<n[u].addons.length;f++){let p={...n[u].addons[f]};p.qty=n[u].qty,i.push(p)}n.forEach(u=>{let{attachedCat:f,serviceId:p}=u;r[f]||(r[f]=[]);let g=r[f].findIndex(b=>b.serviceId===p);g!==-1?r[f][g].qty=r[f][g].qty+u.qty:r[f].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedCat,station:u.station})});const a=Object.keys(r).sort(),d={};a.forEach(u=>{d[u]=r[u]});for(let u in d)d[u].sort((f,p)=>f.serviceName.localeCompare(p.serviceName));let m={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:f,serviceId:p}=u;o[f]||(o[f]=[]);let g=o[f].findIndex(b=>b.serviceId===p);g!==-1?o[f][g].qty=o[f][g].qty+u.qty:o[f].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedAddonCat,station:u.station})});const l=Object.keys(o).sort(),c={};l.forEach(u=>{c[u]=o[u]});for(let u in c)c[u].sort((f,p)=>f.serviceName.localeCompare(p.serviceName));return m.Addon=c,m},Na={"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"},ja=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return Na[t]?Na[t]:"SGST"},va=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,o,l,c,u;try{const{invoiceFormat:f,custName:p,custMobile:g,custAddress:b,userData:v={}}=n,{itemList:w}=e;let T=v==null?void 0:v.userRole;if(v.userRole=="admin"?T="ADMIN":T=v==null?void 0:v.name,!(w!=null&&w.length))return;let M=t.printerSize,F=ir(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});M=F?(d=F[0])!=null&&d.paperSize?(m=F[0])==null?void 0:m.paperSize:M||"2INCH":M;let O=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",G=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",K=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",Q=(O!=""?O+",":"")+(G!=""?G+",":"")+(K!=""?K+",":"")+(te!=""?te+",":""),le=t.gstNo,W={companyName:t.companyName,companyAddress:Q,companyContact:t.contactNumber,companyEmail:t.contactEmail},$={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},q={custName:f&&f.custName?p==t.companyName?null:p:null,custAddress:f&&f.custAddress&&b||null,custContact:f&&f.custMobile?g:null,custEmail:"ajaybaglane7@gmail.com"},Se=en(t.curr),A={...e,companyInfo:W,orderInfo:$,customerInfo:q,gst:le,curr:Se};if(f){if(A.domain=f.siteURL,A.paymentMethods=f.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=f.companyName,A.companyInfo.companyEmail=f.email,A.companyInfo.companyAddress=f.address,A.companyInfo.companyContact=f.mobile,A.customerInfo.custName=f.custName?p:null,A.tokenId=f.token?A.tokenId:null,f.isPayQR&&f.upiId&&f.upiId!==""&&(A.upiId=f.upiId),A.gstNo=f.gst?A.gst:null,A.footerMessage=f.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ja(t),A.printOperatorInfo=f.printOperatorInfo===null||f.printOperatorInfo===!0,A.disabledPoweredBy=t.disabledPoweredBy===!0,A.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(A.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),A.itemInstructionOnBill=f.itemInstructionOnBill,A.noOfInvoice=f.noOfInvoice,A.printby=T,A.newFormat=!0,!f.itemInstructionOnBill&&A.itemList){let J;for(let Ne=0;Ne<A.itemList.length;Ne++)J=A.itemList[Ne],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Be=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let Ne=0;Ne<e.customFeilds.length;Ne++)J=e.customFeilds[Ne],J!=null&&J.customValue&&((u=J.availability)!=null&&u.includes("BILL"))&&Be.push({customName:J.customName,customValue:J.customValue});A.customFields=Be}let st=null,nt=null;f.companyLogo&&(st=await zt(`https://${f.companyLogo.bucket}.s3.amazonaws.com/${f.companyLogo.key}`)),f.qrcode&&(nt=await zt(`https://${f.qrcode.bucket}.s3.amazonaws.com/${f.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 ft={};(function(){let J,Ne,pt=0,yt=0,x=0,h=0,C=0,j=0,I=0,D=0,S=[],k=[],H=0,fe;if(M==="A4"||M==="A5"){for(Ne=0;Ne<w.length;Ne++)J=w[Ne],yt+=J.sub_total,x+=J.afterdiscAmt,h+=J.afterdiscAmt+(J.total_charges??0),pt+=J.afterdiscAmt+(J.total_charges??0),H+=J.qty;let Te=er(w,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(w);ft={itemList:rr(w,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(w,"name"),taxation:Pe,subTotal:ve(yt),afterDisc:ve(x),afterCharges:ve(h),total:ve(pt+Ae),qty:H}}else{for(Ne=0;Ne<w.length;Ne++)J=w[Ne],J.taxType==="VAT"?(k.push(J),D+=J.sub_total,j+=J.afterdiscAmt,C+=J.afterdiscAmt+(J.total_charges??0),I+=J.afterdiscAmt+(J.total_charges??0)):(S.push(J),yt+=J.sub_total,x+=J.afterdiscAmt,h+=J.afterdiscAmt+(J.total_charges??0),pt+=J.afterdiscAmt+(J.total_charges??0));if(S.length){let Te=er(S,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(S);ft.GST={itemList:rr(S,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(S,"name"),taxation:Pe,subTotal:ve(yt),afterDisc:ve(x),afterCharges:ve(h),total:ve(pt+Ae)}}if(k.length){let Te=er(k,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(k);ft.VAT={itemList:rr(k,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:tr(k,"name"),taxation:Pe,subTotal:ve(D),afterDisc:ve(j),afterCharges:ve(C),total:ve(I+Ae)}}}})(),A.distributedData=ft;let Mt={obj:A,companyLogo:st,companyQrCode:nt,paperSize:t.printerSize,Name:a};r(Mt)}}catch(f){console.log("err",f),i(f)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,o,l;try{const{invoiceFormat:c,custName:u,custMobile:f,custAddress:p,orderData:g}=n;let b=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",v=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",M=(b!=""?b+",":"")+(v!=""?v+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,O={companyName:t.companyName,companyAddress:M,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={orderStatus:"COMPLETED",orderDate:g&&g.timestamp?R.unix(g.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:g&&g.orderId?g.orderId:null,timestamp:g.timestamp},te={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&p||null,custContact:c&&c.custMobile?f:null,custEmail:"ajaybaglane7@gmail.com"},Q=en(t.curr),le="",W={...e,companyInfo:O,orderInfo:K,customerInfo:te,gst:F,curr:Q};if(c){if(W.domain=c.siteURL,W.paymentMethods=c.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=c.companyName,W.companyInfo.companyEmail=c.email,W.companyInfo.companyAddress=c.address,W.companyInfo.companyContact=c.mobile,W.customerInfo.custName=c.custName?u:null,W.tokenId=c.token?W.tokenId:null,c.isPayQR&&c.upiId&&c.upiId!==""&&(W.upiId=c.upiId),W.gstNo=c.gst?W.gst:null,W.footerMessage=c.footerMessage,W.orderFrom=(d=g.subOrderFrom)==null?void 0:d.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ja(t),W.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),g.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(g.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=c.itemInstructionOnBill,W.noOfInvoice=c.noOfInvoice,W.area=g.area,W.captainName=g.captainName,!c.itemInstructionOnBill&&W.itemList){let $;for(let q=0;q<W.itemList.length;q++)$=W.itemList[q],$.instruction&&delete $.instruction}t.enabledOutstandingOnPay&&((m=e.custoutStandingData)!=null&&m.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Ce=[];if((o=g.customFeilds)!=null&&o.length){let $;for(let q=0;q<g.customFeilds.length;q++)$=g.customFeilds[q],$!=null&&$.customValue&&((l=$.availability)!=null&&l.includes("BILL"))&&Ce.push({customName:$.customName,customValue:$.customValue});W.customFields=Ce}if(t&&t.isOld&&t.isOld==!0){let $=null,q=null;c.companyLogo&&($=await zt(`https://${c.companyLogo.bucket}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(q=await zt(`https://${c.qrcode.bucket}.s3.amazonaws.com/${c.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 Se={obj:W,companyLogo:$,companyQrCode:q,paperSize:t.printerSize,Name:a};r(Se)}}}catch(c){console.log("err",c)}}),Od=(e,t)=>new Promise(async(n,r)=>{var M;let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",d=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",m=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(m!=""?m+",":"")+(o!=""?o+",":""),c=[],u,f=0,p=0,g=0,b=[],v,w;const T=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(u=e[F],c.push({date:u.date,orderId:u.orderId,finalAmount:u.finalAmount}),f+=u.finalAmount,p+=u.paidAmt,g+=u.balanceAmt,v=0;v<u.orderTransactions.length;v++)w=u.orderTransactions[v],w.paidAmt&&b.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:ve(w.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:f,totalPaid:p,totalPayable:g,paperSize:t.printerSize,curr:en(t.curr),transactions:b})}),Md=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 va({...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 Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),_a=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},lr=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(d=>d.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Ad(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 Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function bt(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ba(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=bt(window.getComputedStyle(document.documentElement)),Gt))}function nn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=nn(e,"border-left-width"),n=nn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=nn(e,"border-top-width"),n=nn(e,"border-bottom-width");return e.clientHeight+t+n}function Sa(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ye=16384;function Pd(e){(e.width>Ye||e.height>Ye)&&(e.width>Ye&&e.height>Ye?e.width>e.height?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye):e.width>Ye?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye))}function rn(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 Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(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),Fd(i)}const ke=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return ba(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function Ta(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=Ed();try{t.className=`${t.className} ${d}`}catch{return}const m=document.createElement("style");m.appendChild($d(d,n,i,r)),t.appendChild(m)}function Hd(e,t,n){Ta(e,t,":before",n),Ta(e,t,":after",n)}const wa="application/font-woff",Ia="image/jpeg",Bd={woff:wa,woff2:wa,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ia,jpeg:Ia,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 or(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function cr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Ca(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,d)=>{const m=new FileReader;m.onerror=d,m.onloadend=()=>{try{a(n({res:r,result:m.result}))}catch(o){d(o)}},m.readAsDataURL(i)})}const dr={};function Vd(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 hr(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(dr[r]!=null)return dr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ca(e,n.fetchRequestInit,({res:d,result:m})=>(t||(t=d.headers.get("Content-Type")||""),zd(m)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let d=`Failed to fetch resource: ${e}`;a&&(d=typeof a=="string"?a:a.message),d&&console.warn(d)}return dr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),d=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,d==null||d.drawImage(e,0,0,a.width,a.height);const m=a.toDataURL();return rn(m)}const n=e.poster,r=or(n),i=await hr(n,r,t);return rn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await an(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return ke(e,HTMLCanvasElement)?qd(e):ke(e,HTMLVideoElement)?Kd(e,t):ke(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Oa(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Oa(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=bt(e.assignedNodes()):ke(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=bt(e.contentDocument.body.childNodes):a=bt(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||ke(e,HTMLVideoElement)||await a.reduce((d,m)=>d.then(()=>an(m,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(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):ba(n).forEach(a=>{let d=i.getPropertyValue(a);a==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&a==="display"&&d==="inline"&&(d="block"),a==="d"&&t.getAttribute("d")&&(d=`path(${t.getAttribute("d")})`),r.setProperty(a,d,i.getPropertyPriority(a))})}function th(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(ke(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return ke(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(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 m=n[a].getAttribute("xlink:href");if(m){const o=e.querySelector(m),l=document.querySelector(m);!o&&l&&!r[m]&&(r[m]=await an(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const m=document.createElementNS(a,"defs");d.appendChild(m);for(let o=0;o<i.length;o++)m.appendChild(i[o]);e.appendChild(d)}return e}async function an(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Ma=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Ma,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,d=or(t);let m;return i||(m=await hr(a,d,r)),e.replace(lh(t),`$1${m}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Aa(e){return e.search(Ma)!==-1}async function Ea(e,t,n){if(!Aa(e))return e;const r=dh(e,n);return oh(r).reduce((a,d)=>a.then(m=>ch(m,d,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ea(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function uh(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!cr(e.src))&&!(ke(e,SVGImageElement)&&!cr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hr(r,or(r),t);await new Promise((a,d)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){d(l)}}:d;const m=e;m.decode&&(m.decode=a),m.loading==="lazy"&&(m.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=bt(e.childNodes).map(i=>Ra(i,t));await Promise.all(r).then(()=>e)}async function Ra(e,t){ke(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(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 ka={};async function La(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Pa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let m=d.replace(r,"$1");return m.startsWith("https://")||(m=new URL(m,e.url).href),Ca(m,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function Fa(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,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",m=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=m.exec(r),o===null)break;a.lastIndex=m.lastIndex}else m.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let m=d+1;const o=a.href,l=La(o).then(c=>Pa(c,t)).then(c=>Fa(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?m+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:u,error:f})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(m=>m.href==null)||document.styleSheets[0];i.href!=null&&r.push(La(i.href).then(m=>Pa(m,t)).then(m=>Fa(m).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(m=>{console.error("Error loading remote stylesheet",m)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Aa(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=bt(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Da(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Da(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Da(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ea(a.cssText,d,t)}))).join(`
46
+ `)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(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 Ya(e,t={}){const{width:n,height:r}=Sa(e,t),i=await an(e,t,!0);return await jh(i,t),await Ra(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Sa(e,t),i=await Ya(e,t),a=await rn(i),d=document.createElement("canvas"),m=d.getContext("2d"),o=t.pixelRatio||Ld(),l=t.canvasWidth||n,c=t.canvasHeight||r;return d.width=l*o,d.height=c*o,t.skipAutoScale||Pd(d),d.style.width=`${l}`,d.style.height=`${c}`,t.backgroundColor&&(m.fillStyle=t.backgroundColor,m.fillRect(0,0,d.width,d.height)),m.drawImage(a,0,0,d.width,d.height),d}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,ln=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Ha=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ys=(e,t)=>{for(var n in t||(t={}))Ua.call(t,n)&&Ha(e,n,t[n]);if(ln)for(var n of ln(t))$a.call(t,n)&&Ha(e,n,t[n]);return e},ur=(e,t)=>{var n={};for(var r in e)Ua.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ln)for(var r of ln(e))t.indexOf(r)<0&&$a.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 Ot;(e=>{const t=class{constructor(o,l,c,u){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(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let f=[];for(let g=0;g<this.size;g++)f.push(!1);for(let g=0;g<this.size;g++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(c);if(this.drawCodewords(p),u==-1){let g=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const _=this.getPenaltyScore();_<g&&(u=b,g=_),this.applyMask(b)}}a(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),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,u=40,f=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let g,b;for(g=c;;g++){const M=t.getNumDataCodewords(g,l)*8,F=m.getTotalBits(o,g);if(F<=M){b=F;break}if(g>=u)throw new RangeError("Data too long")}for(const M of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&b<=t.getNumDataCodewords(g,M)*8&&(l=M);let _=[];for(const M of o){r(M.mode.modeBits,4,_),r(M.numChars,M.mode.numCharCountBits(g),_);for(const F of M.getData())_.push(F)}a(_.length==b);const w=t.getNumDataCodewords(g,l)*8;a(_.length<=w),r(0,Math.min(4,w-_.length),_),r(0,(8-_.length%8)%8,_),a(_.length%8==0);for(let M=236;_.length<w;M^=253)r(M,8,_);let T=[];for(;T.length*8<_.length;)T.push(0);return _.forEach((M,F)=>T[F>>>3]|=M<<7-(F&7)),new t(g,l,T,f)}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 u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(o[c],o[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let f=0;f<10;f++)c=c<<1^(c>>>9)*1335;const u=(l<<10|c)^21522;a(u>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,i(u,f));this.setFunctionModule(8,7,i(u,6)),this.setFunctionModule(8,8,i(u,7)),this.setFunctionModule(7,8,i(u,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,i(u,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,i(u,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,i(u,f));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 u=i(l,c),f=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(f,p,u),this.setFunctionModule(p,f,u)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const f=Math.max(Math.abs(u),Math.abs(c)),p=o+u,g=l+c;0<=p&&p<this.size&&0<=g&&g<this.size&&this.setFunctionModule(p,g,f!=2&&f!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(o+u,l+c,Math.max(Math.abs(u),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 u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],f=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),g=u-p%u,b=Math.floor(p/u);let _=[];const w=t.reedSolomonComputeDivisor(f);for(let M=0,F=0;M<u;M++){let O=o.slice(F,F+b-f+(M<g?0:1));F+=O.length;const G=t.reedSolomonComputeRemainder(O,w);M<g&&O.push(0),_.push(O.concat(G))}let T=[];for(let M=0;M<_[0].length;M++)_.forEach((F,O)=>{(M!=b-f||O>=g)&&T.push(F[M])});return a(T.length==p),T}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 u=0;u<this.size;u++)for(let f=0;f<2;f++){const p=c-f,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][p]&&l<o.length*8&&(this.modules[b][p]=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 u;switch(o){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let f=0;f<this.size;f++){let p=!1,g=0,b=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[f][_]==p?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,b),p||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),p=this.modules[f][_],g=1);o+=this.finderPenaltyTerminateAndCount(p,g,b)*t.PENALTY_N3}for(let f=0;f<this.size;f++){let p=!1,g=0,b=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][f]==p?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,b),p||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),p=this.modules[_][f],g=1);o+=this.finderPenaltyTerminateAndCount(p,g,b)*t.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){const g=this.modules[f][p];g==this.modules[f][p+1]&&g==this.modules[f+1][p]&&g==this.modules[f+1][p+1]&&(o+=t.PENALTY_N2)}let l=0;for(const f of this.modules)l=f.reduce((p,g)=>p+(g?1:0),l);const c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=u&&u<=9),o+=u*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 u=this.size-7;c.length<o;u-=l)c.splice(1,0,u);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 u=0;u<o-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<o;u++){for(let f=0;f<l.length;f++)l[f]=t.reedSolomonMultiply(l[f],c),f+1<l.length&&(l[f]^=l[f+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(u=>0);for(const u of o){const f=u^c.shift();c.push(0),l.forEach((p,g)=>c[g]^=t.reedSolomonMultiply(p,f))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(l>>>u&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 u=l-1;u>=0;u--)c.push(o>>>u&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const d=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 d(d.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!d.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const u=Math.min(o.length-c,3);r(parseInt(o.substr(c,u),10),u*3+1,l),c+=u}return new d(d.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!d.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 u=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;u+=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(u,11,l)}return c<o.length&&r(d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new d(d.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:d.isNumeric(o)?[d.makeNumeric(o)]:d.isAlphanumeric(o)?[d.makeAlphanumeric(o)]:[d.makeBytes(d.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 d(d.Mode.ECI,0,l)}static isNumeric(o){return d.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return d.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const u of o){const f=u.mode.numCharCountBits(l);if(u.numChars>=1<<f)return 1/0;c+=4+f+u.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 m=d;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(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={}))})(Ot||(Ot={})),(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={}))})(Ot||(Ot={}));var qt=Ot;/**
50
+ */var Ot;(e=>{const t=class{constructor(o,l,c,u){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(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let f=[];for(let g=0;g<this.size;g++)f.push(!1);for(let g=0;g<this.size;g++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(c);if(this.drawCodewords(p),u==-1){let g=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const v=this.getPenaltyScore();v<g&&(u=b,g=v),this.applyMask(b)}}a(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),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,u=40,f=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let g,b;for(g=c;;g++){const M=t.getNumDataCodewords(g,l)*8,F=m.getTotalBits(o,g);if(F<=M){b=F;break}if(g>=u)throw new RangeError("Data too long")}for(const M of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&b<=t.getNumDataCodewords(g,M)*8&&(l=M);let v=[];for(const M of o){r(M.mode.modeBits,4,v),r(M.numChars,M.mode.numCharCountBits(g),v);for(const F of M.getData())v.push(F)}a(v.length==b);const w=t.getNumDataCodewords(g,l)*8;a(v.length<=w),r(0,Math.min(4,w-v.length),v),r(0,(8-v.length%8)%8,v),a(v.length%8==0);for(let M=236;v.length<w;M^=253)r(M,8,v);let T=[];for(;T.length*8<v.length;)T.push(0);return v.forEach((M,F)=>T[F>>>3]|=M<<7-(F&7)),new t(g,l,T,f)}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 u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(o[c],o[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let f=0;f<10;f++)c=c<<1^(c>>>9)*1335;const u=(l<<10|c)^21522;a(u>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,i(u,f));this.setFunctionModule(8,7,i(u,6)),this.setFunctionModule(8,8,i(u,7)),this.setFunctionModule(7,8,i(u,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,i(u,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,i(u,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,i(u,f));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 u=i(l,c),f=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(f,p,u),this.setFunctionModule(p,f,u)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const f=Math.max(Math.abs(u),Math.abs(c)),p=o+u,g=l+c;0<=p&&p<this.size&&0<=g&&g<this.size&&this.setFunctionModule(p,g,f!=2&&f!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(o+u,l+c,Math.max(Math.abs(u),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 u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],f=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),g=u-p%u,b=Math.floor(p/u);let v=[];const w=t.reedSolomonComputeDivisor(f);for(let M=0,F=0;M<u;M++){let O=o.slice(F,F+b-f+(M<g?0:1));F+=O.length;const G=t.reedSolomonComputeRemainder(O,w);M<g&&O.push(0),v.push(O.concat(G))}let T=[];for(let M=0;M<v[0].length;M++)v.forEach((F,O)=>{(M!=b-f||O>=g)&&T.push(F[M])});return a(T.length==p),T}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 u=0;u<this.size;u++)for(let f=0;f<2;f++){const p=c-f,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][p]&&l<o.length*8&&(this.modules[b][p]=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 u;switch(o){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let f=0;f<this.size;f++){let p=!1,g=0,b=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[f][v]==p?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,b),p||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),p=this.modules[f][v],g=1);o+=this.finderPenaltyTerminateAndCount(p,g,b)*t.PENALTY_N3}for(let f=0;f<this.size;f++){let p=!1,g=0,b=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][f]==p?(g++,g==5?o+=t.PENALTY_N1:g>5&&o++):(this.finderPenaltyAddHistory(g,b),p||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),p=this.modules[v][f],g=1);o+=this.finderPenaltyTerminateAndCount(p,g,b)*t.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){const g=this.modules[f][p];g==this.modules[f][p+1]&&g==this.modules[f+1][p]&&g==this.modules[f+1][p+1]&&(o+=t.PENALTY_N2)}let l=0;for(const f of this.modules)l=f.reduce((p,g)=>p+(g?1:0),l);const c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=u&&u<=9),o+=u*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 u=this.size-7;c.length<o;u-=l)c.splice(1,0,u);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 u=0;u<o-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<o;u++){for(let f=0;f<l.length;f++)l[f]=t.reedSolomonMultiply(l[f],c),f+1<l.length&&(l[f]^=l[f+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(u=>0);for(const u of o){const f=u^c.shift();c.push(0),l.forEach((p,g)=>c[g]^=t.reedSolomonMultiply(p,f))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(l>>>u&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 u=l-1;u>=0;u--)c.push(o>>>u&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const d=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 d(d.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!d.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const u=Math.min(o.length-c,3);r(parseInt(o.substr(c,u),10),u*3+1,l),c+=u}return new d(d.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!d.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 u=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;u+=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(u,11,l)}return c<o.length&&r(d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new d(d.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:d.isNumeric(o)?[d.makeNumeric(o)]:d.isAlphanumeric(o)?[d.makeAlphanumeric(o)]:[d.makeBytes(d.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 d(d.Mode.ECI,0,l)}static isNumeric(o){return d.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return d.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const u of o){const f=u.mode.numCharCountBits(l);if(u.numChars>=1<<f)return 1/0;c+=4+f+u.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 m=d;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(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={}))})(Ot||(Ot={})),(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={}))})(Ot||(Ot={}));var qt=Ot;/**
51
51
  * @license qrcode.react
52
52
  * Copyright (c) Paul O'Shannessy
53
53
  * SPDX-License-Identifier: ISC
54
- */var Ba={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Wa=128,za="L",Ga="#FFFFFF",Va="#000000",qa=!1,mr=4,Sh=.1;function Ka(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(d,m){if(!d&&a!==null){n.push(`M${a+t} ${i+t}h${m-a}v1H${a+t}z`),a=null;return}if(m===r.length-1){if(!d)return;a===null?n.push(`M${m+t},${i+t} h1v1H${m+t}z`):n.push(`M${a+t},${i+t} h${m+1-a}v1H${a+t}z`);return}d&&a===null&&(a=m)})}),n.join("")}function Qa(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 Za(e,t,n,r){if(r==null)return null;const i=n?mr:0,a=e.length+i*2,d=Math.floor(t*Sh),m=a/t,o=(r.width||d)*m,l=(r.height||d)*m,c=r.x==null?e.length/2-o/2:r.x*m,u=r.y==null?e.length/2-l/2:r.y*m;let f=null;if(r.excavate){let p=Math.floor(c),g=Math.floor(u),b=Math.ceil(o+c-p),_=Math.ceil(l+u-g);f={x:p,y:g,w:b,h:_}}return{x:c,y:u,h:l,w:o,excavation:f}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:d=Va,includeMargin:m=qa,style:o,imageSettings:l}=t,c=ur(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),u=l==null?void 0:l.src,f=xe.useRef(null),p=xe.useRef(null),[g,b]=xe.useState(!1);xe.useEffect(()=>{if(f.current!=null){const T=f.current,M=T.getContext("2d");if(!M)return;let F=qt.QrCode.encodeText(n,Ba[i]).getModules();const O=m?mr:0,G=F.length+O*2,K=Za(F,r,m,l),te=p.current,Q=K!=null&&te!==null&&te.complete&&te.naturalHeight!==0&&te.naturalWidth!==0;Q&&K.excavation!=null&&(F=Qa(F,K.excavation));const le=window.devicePixelRatio||1;T.height=T.width=r*le;const W=r/G*le;M.scale(W,W),M.fillStyle=a,M.fillRect(0,0,G,G),M.fillStyle=d,Th?M.fill(new Path2D(Ka(F,O))):F.forEach(function(Ce,$){Ce.forEach(function(V,Se){V&&M.fillRect(Se+O,$+O,1,1)})}),Q&&M.drawImage(te,K.x+O,K.y+O,K.w,K.h)}}),xe.useEffect(()=>{b(!1)},[u]);const _=ps({height:r,width:r},o);let w=null;return u!=null&&(w=xe.createElement("img",{src:u,key:u,style:{display:"none"},onLoad:()=>{b(!0)},ref:p})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ps({style:_,height:r,width:r,ref:f},c)),w)}function Ih(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:d=Va,includeMargin:m=qa,imageSettings:o}=t,l=ur(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ba[i]).getModules();const u=m?mr:0,f=c.length+u*2,p=Za(c,r,m,o);let g=null;o!=null&&p!=null&&(p.excavation!=null&&(c=Qa(c,p.excavation)),g=xe.createElement("image",{xlinkHref:o.src,height:p.h,width:p.w,x:p.x+u,y:p.y+u,preserveAspectRatio:"none"}));const b=Ka(c,u);return xe.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${f} ${f}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:d,d:b,shapeRendering:"crispEdges"}),g)}var Ja=e=>{const t=e,{renderAs:n}=t,r=ur(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ps({},r)):xe.createElement(wh,ps({},r))};const ys=(e,t)=>t*100/e,Ch={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},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 gs=Xn(),be="normal-class";(gs=="Android OS"||gs==="iOS")&&(be="bold-class");const tt=e=>{var Mt,J,Ne,pt,yt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:d,type:m}=e.printerDataObject,o=((J=(Mt=e.value)==null?void 0:Mt.settingData)==null?void 0:J.curr)??((Ne=e.settingData)==null?void 0:Ne.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ir(d,{type:m,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const u=r.customLabels??gd();l=c?(pt=c[0])!=null&&pt.paperSize?(yt=c[0])==null?void 0:yt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function f(x){const h=Math.abs(parseFloat(x));return p(h)}function p(x){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(x).format("0,00.000");default:return Xs(x).format("0,00.00")}}xe.useEffect(()=>{w()},[e.newId]);const g=()=>new Promise(async(x,h)=>{if(gs=="Android OS"||gs==="iOS"){let C=await _h(n.current);if(C){const j=await _(C);x(j)}}else{let C=await Ya(n.current);C&&x(C)}}),b=()=>new Promise(async(x,h)=>{const C=await g();x(C)}),_=x=>new Promise((h,C)=>{let j=new Image;j.src=x,j.onload=()=>{let I=document.createElement("canvas");const D=600,S=j.height;let k=j.width,H=j.height;k>H?k>D&&(H*=D/k,k=D):H>S&&(k*=S/H,H=S),I.width=k,I.height=H,I.getContext("2d").drawImage(j,0,0,k,H),h(I.toDataURL())}}),w=async()=>{if(n&&n.current){const x=await b();e.onImageGenerated(x)}},T=x=>{let h=new Array;for(const C in x.menusCollection)C.endsWith("collection")||(x.menusCollection[`${C}_collection`]||x.menusCollection[C])&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${x.menusCollection[C]}):`}),s.jsx("span",{children:ie(x.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:p(ys(x.salesCollection.totalCollection,x.menusCollection[`${C}_collection`]??0))+"%"})]}));return x.salesCollection.online_aggregator_collection&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${x.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(x.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${x.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(x.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${x.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(x.salesCollection.swiggy_aggregator_collection,o)})]})),h},M=x=>{let h=new Array,C=new Object;for(let j=0;j<x.todayCollection.length;j++)C=x.todayCollection[j],h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:ie(C.value,o)}),s.jsx("span",{children:p(ys(x.totalCollection,C.value))+"%"})]}));return h},F=(x,h,C,j,I={})=>{let D=x.includes("upi://");const S=`upi://pay?pa=${x}&pn=${C}&cu=INR&am=${j}&tr=${h}`;return s.jsx(Ja,{value:D?x:S,renderAs:"canvas",size:I.size??250})},O=(x,h)=>{var D,S;let C=0;if((D=h.taxObj)!=null&&D.VAT.length){let k,H,fe;for(H=0;H<((S=h.taxObj)==null?void 0:S.VAT.length);H++){k=h.taxObj.VAT[H];for(fe in k)C+=ve(k[fe])}}const j={sellerName:h.companyInfo.companyName,vatRegistrationNumber:x,invoiceTimestamp:new Date(h.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:h.finalAmount,invoiceVatTotal:C},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Ja,{value:I,renderAs:"canvas",size:250})},G=x=>{const h=[];return(x.totalBalanceAmt||x.refundAmt||x.writeOffAmt||x.rewardAmt||x.cashCard)&&(h.push(s.jsx("hr",{})),x.rewardAmt&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(x.rewardAmt,o)})]})),x.totalBalanceAmt&&h.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(x.totalBalanceAmt,o)})]})),x.writeOffAmt&&h.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(x.writeOffAmt,o)})]})),x.refundAmt&&h.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(x.refundAmt,o)})]})),x.cashCard&&h.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(x.cashCard,o)})]}))),h},K=(x,h)=>{if(h&&h.length){for(let C=0;C<h.length;C++)if(h[C].slugName===x)return h[C]}return!1},te=(x,h)=>{if(h&&h.length){for(let C=0;C<h.length;C++)if(h[C].itemType===x)return h[C]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=x=>x.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${x.discountValue}${Ch[x.discountType]}`,W=x=>{const h=new Array;if(x&&Object.keys(x).length!==0){h.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in x)if(h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[C]}:`}),s.jsx("span",{children:ie(x[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const j in x[C])j!=="total"&&x[C][j]&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(j)}:`}),s.jsx("span",{children:ie(x[C][j],o)})]}))}return h},Ce=(x,h)=>{let C=!1;x.totalValue&&(C=Object.keys(x.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[x.totalValue&&Object.keys(x.totalValue).map(D=>{if(j=x.totalValue[D],D==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList&&x.itemList.length&&x.itemList.length>0&&x.itemList.map(S=>{if(S.taxType===D||!S.taxType)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.rate?f(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&x.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>{const k=K(S,x.discArr);if(k&&j.cat[S]!==0&&k.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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.cat[S])})]})}):"",x.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,x.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.itemTypes[S])})]})}):"",x.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:h[`segment_disc${x.segMentObj.segmentName.toLowerCase()}`]??x.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+x.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.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:x.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[x.couponCode?`(${x.couponCode.toUpperCase()})`:"",p(x.dicsEnterValue)?`@${x.dicsEnterValue}${x.discountType=="RELATIVE"||x.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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:["  ",x.couponCode?"COUPON DISC":"خصم الطلب",x.couponCode?`(${x.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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"})]}):"",x.taxObj&&x.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H/2;k.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:h.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/2)})]})]}))}return k}):x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H;k.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:h.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H])})]})}))}return k})}):"",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:h.total}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p((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"})]}),x.totalValue&&(Object.keys(x.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),x.totalValue&&Object.keys(x.totalValue).map(D=>{if(j=x.totalValue[D],D==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList&&x.itemList.length&&x.itemList.length>0&&x.itemList.map(S=>{if(S.taxType===D)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:S.rate?f(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&x.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>{const k=K(S,x.discArr);if(k&&j.cat[S]!==0&&k.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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.cat[S])})]})}):"",x.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,x.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.itemTypes[S])})]})}):"",x.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:h[`segment_disc${x.segMentObj.segmentName.toLowerCase()}`]??x.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+x.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.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:x.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[x.couponCode?`(${x.couponCode.toUpperCase()})`:"",p(x.dicsEnterValue)?`@${x.dicsEnterValue}${x.discountType=="RELATIVE"||x.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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:["  ",x.couponCode?"COUPON DISC":"خصم الطلب",x.couponCode?`(${x.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>s.jsx(s.Fragment,{children:S.taxOnAmount&&S.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:h.cgst}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.taxOnAmount/2)})]})]}):""})):"",x.taxObj&&x.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H/2;k.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:h.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/2)})]})]}))}return k}):x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H;k.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:h.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H])})]})}))}return k})}):"",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:h.total}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p((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"})]})]})]})})]})},$=(x,h,{labels:C,doMultipleTax:j,type:I})=>{var S,k,H,fe,Te,Le,Pe,Ae,At,Et,gt;const D=x.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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList.map(q=>{var Rt;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[l].dynamicClassname}`,style:{lineHeight:1.2},children:[q.status==="RETURNED"?"(R) ":"",q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:q.serviceRate?f(q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:q.sub_total?p(q.sub_total):""})]}),(Rt=q.addons)!=null&&Rt.length?q.addons.map(St=>s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(St.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",St.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]})):"",q.instruction?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[l].dynamicClassname} ${be}`,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:h.curr+" "+p(x.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"})]}):""]}),(S=D.DISCOUNT_ITEMS)!=null&&S.length?D.DISCOUNT_ITEMS.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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:le(q)})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(q.discountAmt)})]})):"",(k=D.CATEGORY_DISCOUNT)!=null&&k.length?D.CATEGORY_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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:h.curr+" "+p(q.discountAmt)})]})):"",(H=D.ITEM_DISCOUNT)!=null&&H.length?D.ITEM_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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:h.curr+" "+p(q.discountAmt)})]})):"",(Te=(fe=D.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Te.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${D.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+D.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+D.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=D.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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:`(${D.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${D.COUPON_DISCOUNT[0].discountValue}${D.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.COUPON_DISCOUNT[0].discountAmt)})]}):"",(At=(Ae=D.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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(D.ORDER_DISCOUNT[0].discountValue)?`@${D.ORDER_DISCOUNT[0].discountValue}${D.ORDER_DISCOUNT[0].discountType=="RELATIVE"||D.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&x&&x.orderDisc?s.jsxs("div",{className:`bottom-section-div ${be}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",h.couponCode?"COUPON DISC":"خصم الطلب",h.couponCode?`(${h.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=x.charges)!=null&&Et.length?x.charges.map(q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${q.name.toLowerCase()}`]??q.name}})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(q.amt)})]})})):"",x.subTotal!==x.afterCharges&&x.afterCharges!==x.total?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(x.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&x.subTotal!==x.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(gt=x.taxation)!=null&&gt.length?x.taxation.map(q=>{if(q.taxAmt)return q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${be}`,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:h.curr+" "+p(q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[h.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${be}`,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:h.curr+" "+p(q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(x.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"})]}):""}):""]})},V=(x,h)=>{var D,S;let C=!1;const j=x.distributedData;return x.distributedData&&(C=Object.keys(x.distributedData).length>1),s.jsxs(s.Fragment,{children:[((D=j.GST)==null?void 0:D.itemList)&&$(j.GST,x,{labels:h,doMultipleTax:C,type:"GST"}),((S=j.VAT)==null?void 0:S.itemList)&&$(j.VAT,x,{labels:h,doMultipleTax:C,type:"VAT"})]})},Se=x=>{const h=x.services,C=Object.keys(x.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${be}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].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((D,S)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[D.toUpperCase(),":"]})}),h[D].map(k=>{var H;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(fe=>{var Te;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Te=fe.serviceName)==null?void 0:Te.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),j!==S+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},A=x=>{const h=x.slice(0,-4),C=x.slice(-4);return{firstDigits:h,last4Dgits:C}},Be=(x,h,C,j={})=>{const I=Object.keys(h??{});let D=[],S,k="flex-two-items";if(j.action==="addCharges"&&(k="display-percentage"),x&&I.length){D.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:ie(x,o)})]})]}));for(let H=0;H<I.length;H++)S=I[H],h[S]&&D.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${S.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(h[S],o)}),j.action==="addCharges"?s.jsx("span",{children:p(ys(x,h[S]))+"%"}):""]}));D.push(s.jsx("hr",{}))}return D},st=x=>{const h=Object.keys(x.Category),C=Object.keys(x.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"})]})),h.forEach((I,D)=>{const S=x.Category[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,D!=h.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((I,D)=>{const S=x.Addon[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,D!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=x=>{var C;const h={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",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=x==null?void 0:x.customBillLabels)!=null&&C.length){let j;for(let I=0;I<x.customBillLabels.length;I++)j=x.customBillLabels[I],h[j.defaultName]=j.displayName}return h},ft=(x,h,C,j)=>{var H,fe,Te,Le,Pe,Ae,At,Et,gt,q,Rt,St,xs,Ns,on,js,vs,cn,dn,hn,un,mn,fn,pn,Kt,_s,xt,Qt,Zt,bs,yn,Ss,gn,Ts,ws,xn,Nn,Is,Cs;const I=nt(r.customLabelsMap),D=Zs(xd(r.paymentModes),"internalName"),S=ee=>{var v;return(v=D[ee])!=null&&v.displayName?D[ee].displayName.toUpperCase():ee};if(x==="BILL"){let ee;if(l==="A4"||l==="A5"){let v={...h},Z=0,ue=v.distributedData;const y=ue.discounts;ee=s.jsx("div",{className:`invoiceContainer main-div ${L[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:[v.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:v.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:v.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:[(v.customerInfo.custName||((H=v.customFields)==null?void 0:H.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),v.customerInfo.custName&&v.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custName})}),v.customerInfo.custContact&&v.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custContact})}),v.customerInfo.custAddress&&v.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custAddress})}),v.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.deliveryTimestamp})}),(fe=v.customFields)!=null&&fe.length?v.customFields.map(N=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[N.customName,": ",N.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:v.companyInfo.companyName})}),v.companyInfo.companyAddress&&v.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyAddress})}),v.companyInfo.companyEmail&&v.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyEmail})}),v.companyInfo.companyContact&&v.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyContact})}),v.fssai&&v.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:v.fssai})]})}),v.gst&&v.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:v.gst})]})}),v.vatNo&&v.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:v.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:[v.itemList.map(N=>{var oe;let P="",z=[];return Z++,z.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:P,children:[s.jsx("td",{className:"text-align-left",children:N.serviceRate?Z:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:N.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:N.qty}),s.jsx("td",{className:"text-align-right",children:N.serviceRate?U(N.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:N.sub_total?U(N.sub_total,o):""})]}),N.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+N.instruction+")"})]})]})),(oe=N.addons)!=null&&oe.length&&N.addons.map(he=>{z.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:["+ ",he.serviceName.toUpperCase()]}),s.jsx("td",{children:he.qty})]}),he.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+he.instruction+")"})]})]}))}),z}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Z} Items and ${ve(ue.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",{}),fd(xa(v.finalAmount,o).toFixed(tn[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),v.upiId&&h.companyInfo.companyName&&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:F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmt,{size:100})})})})]}),v.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:v.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:U(ue.subTotal,o)})]}),(Te=y==null?void 0:y.DISCOUNT_ITEMS)!=null&&Te.length?y.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:le(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Le=y==null?void 0:y.CATEGORY_DISCOUNT)!=null&&Le.length?y.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Pe=y==null?void 0:y.ITEM_DISCOUNT)!=null&&Pe.length?y.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(At=(Ae=y==null?void 0:y.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`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("td",{className:"text-align-right",width:"50%",children:U(y.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(gt=(Et=y==null?void 0:y.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&gt.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:`(${y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${y.COUPON_DISCOUNT[0].discountValue}${y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(q=y==null?void 0:y.ORDER_DISCOUNT)==null?void 0:q[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:p(y.ORDER_DISCOUNT[0].discountValue)?`@${y.ORDER_DISCOUNT[0].discountValue}${y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(St=ue.charges)!=null&&St.length?ue.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.amt,o)})]})):"",ue.subTotal!==ue.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:U(ue.afterCharges,o)})]}):"",(xs=ue.taxation)!=null&&xs.length?ue.taxation.map(N=>N.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:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:" @"+N.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:U(v.finalAmount,o)})]}),(Ns=h==null?void 0:h.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:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((on=v==null?void 0:v.custoutStandingData)==null?void 0:on.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:U(v.grandTotal+((js=v==null?void 0:v.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",v.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:U(v.rewardAmt,o)})]}):"",(vs=h.paymentMethods)!=null&&vs.length?h.paymentMethods.map(N=>{var P;if(N.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(P=N.paymentMode)==null?void 0:P.toLowerCase()}`]??S(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),N.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(N.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.paidAmt,o)})]})}):"",v.balanceAmt&&h.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:U(h.balanceAmt,o)})]}):"",h.balPoint&&!Number.isNaN(h.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:h.balPoint})]}):"",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 :${v.printby} Printed On: ${v.printTime}`}),v.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else ee=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[h.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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&h.companyInfo.companyName&&h.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:h.companyInfo.companyName}),h.companyInfo.companyAddress&&h.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.companyInfo.companyAddress}}),h.companyInfo.companyContact&&h.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:h.companyInfo.companyContact})]})}),h.companyInfo.companyEmail&&h.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:h.companyInfo.companyEmail})]})}),h.fssai&&h.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:h.fssai})]})}),h.gst&&h.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:h.gst})]})}),h.vatNo&&h.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:h.vatNo})]})}),s.jsx("hr",{}),h.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.orderFrom}),h.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[h.area," : ",h.tableName?h.tableName:h.tableNo]}),h.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:h.tokenId})]})}),h.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${be}`,children:[h.customerInfo.custName&&h.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:h.customerInfo.custName})]})}),h.customerInfo.custContact&&h.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:h.customerInfo.custContact})]})}),h.customerInfo.custAddress&&h.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:h.customerInfo.custAddress})]})}),_t(h.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),h.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:h.orderId})]})}),h.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:h.orderInfo.orderDate})]})}),h.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:h.deliveryTimestamp})]})}),h.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:h.captainName})]})})]}),(cn=h.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),h.customFields.map(v=>s.jsx("h4",{className:"left-align-entity",children:v.customName+": "+v.customValue}))]}):"",h.newFormat?V(h,I):Ce(h,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=h.custoutStandingData)!=null&&dn.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.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=h.custoutStandingData)!=null&&hn.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+p(h.finalAmount)})]}),(un=h.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:h.curr+" "+p(h.custoutStandingData.balanceAmt)})]}),!h.rewardAmt&&!h.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:h.curr+" "+p(h.finalAmount+h.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"}})]}):"",h.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:"("+h.usedPoints+" Points)"})]}),s.jsx("h5",{children:h.curr+" "+h.rewardAmt})]}):"",h.paymentMethods&&h.paymentMethods.length?h.paymentMethods.map(v=>{var Z;if(v.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Z=v.paymentMode)==null?void 0:Z.toLowerCase()}`]??S(v.paymentMode)??"CASH"}}),s.jsx("span",{children:v.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:v.isRefund?s.jsx(s.Fragment,{children:h.curr+" ("+p(v.paidAmt)+")"}):s.jsx(s.Fragment,{children:h.curr+" "+p(v.paidAmt)})})]})}):"",h.rewardAmt&&!h.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:h.curr+" "+p(h.finalAmount+(((mn=h==null?void 0:h.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-h.rewardAmt)})]})}):"",h.balanceAmt&&h.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:h.curr+" "+p(h.balanceAmt)})]}):"",s.jsx("hr",{})]}),h.earnPoints&&h.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:h.earnPoints})]}):"",(h.balPoint||h.earnPoints)&&!Number.isNaN(h.balPoint||h.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:h.balPoint+h.earnPoints||0})]}):"",h.upiId&&h.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmount)]}),h.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."}),O(r.vatNo,h)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",h.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.footerMessage}}):"",h.printby&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${h.printby}`}):"",h.printTime&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${h.printTime}`}):"",h.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return ee}else if(x==="PRINT_DASHBOARD"&&h.salesCollection){const ee=h.salesCollection.totalDiscountAmt?ys(h.salesCollection.grandTotal,h.salesCollection.totalDiscountAmt):null,v=h.salesCollection.totalCollection-h.salesCollection.totalTax;var k=R().format("DD/MM/YYYY LT");const Z=(fn=h.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?ys(h.monthTillDateSalesColl.grandTotal,h.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[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:- ${k}`}),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:h.selectedDate})]}),s.jsx("hr",{}),h.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(h.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(h.monthTillDateSalesColl.totalDiscountAmt,o)}${Z?`(${p(Z)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(h.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(h.monthTillDateSalesColl.totalCollection-h.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(h.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(h.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(h.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(h.salesCollection.totalDiscountAmt,o)}${ee?`(${p(ee)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(h.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(v,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(h.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(h.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Be(h.otherFields.totalDiscountAmt,h.otherFields.discountList,"Discount",{action:"addCharges"}),Be(h.otherFields.totalOtherCharges,h.otherFields.otherChargesList,"Charges"),Be(h.otherFields.totalTax,h.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(h.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:h.salesCollection.totalOrders})]}),T(h)]}),s.jsx("hr",{}),h.otherFields.totalItemType?s.jsx("div",{children:Be(h.otherFields.totalItemType,h.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",h.averageCollection.avgTableTime||h.averageCollection.avgorderValue||h.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),h.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:h.averageCollection.avgTableTime})]}):"",h.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(h.averageCollection.avgorderValue,o)})]}):"",h.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:h.averageCollection.noOfGuest})]}):"",h.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(h.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(h.totalCollection,o)})]}),M(h)]}),G(h.averageCollection),h.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(h.otherFields.salesCollection,o)})]}),h.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(h.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),W(h.averageCollection.dailyExpanse)]}),s.jsx("br",{}),gs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(x==="AGGREGATOR_BILL"){let ee;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].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: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.orderFrom}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",ee.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 ${L[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.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:L[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:[((pn=a.services)==null?void 0:pn.length)&&a.services.map(Z=>{var ue;return s.jsxs("div",{style:Z.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:Z.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Z.qty})]}),((ue=Z.addons)==null?void 0:ue.length)&&Z.addons.map(y=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(y.serviceName)})),Z.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Z.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(Z=>{if(Z.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Z.name}),s.jsx("h5",{children:a.curr+" "+p(Z.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Z=>{let ue=new Array;for(const y in Z)if(Z[y]&&Z[y]!=0){let N=y/2;ue.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",N]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[h.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]})]}))}return ue})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(Z=>s.jsx("h4",{className:"left-align-entity",children:Z.customName+": "+Z.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[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(x==="UPDATE_TABLE"){let ee="";return a.action==="SWITCH_TABLE"?ee=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:["**",(_s=u.Table)==null?void 0:_s.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(xt=a.from)==null?void 0:xt.map((v,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[v])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[v])==null?void 0:N.tableName}${Z+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:`${(Zt=(Qt=e.tableData[a.to[0]])==null?void 0:Qt.attachedArea)==null?void 0:Zt.toUpperCase()} - ${(bs=e.tableData[a.to[0]])==null?void 0:bs.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):ee=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 ",(yn=u.Table)==null?void 0:yn.toUpperCase(),"**"]}),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((v,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[v])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[v])==null?void 0:N.tableName}${Z+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=(gn=e.tableData[a.to[0]])==null?void 0:gn.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(ws=e.tableData[a.to[0]])==null?void 0:ws.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),ee}else if(x==="COUNTER_OPERATION"){let ee;return l=="2INCH"||l=="1.8INCH"?ee=s.jsx("div",{className:"main-div",style:{width:L[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: ",U(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: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(v=>{if(v.value>0||v.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",v.displayName," : ",U(v.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(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:["    ",U(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:["    ",U(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:["    ",U(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(v=>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"?U(v.denomination,o):v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(v.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:U(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:["    ",U(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:["    ",U(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:["   ",U(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:["    ",U(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:["    -",U(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:["    +",U(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:["   -",U(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:["   +",U(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(v=>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"?U(v.denomination,o):v.curr+" "+v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(v.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:U(a.TotalDenomationsAmount,o)})]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:L[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: ",U(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: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(v=>{if(v.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",v.displayName," : ",U(v.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(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 : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(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(v=>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"?U(v.denomination,o):v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(v.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:U(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 : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(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 : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(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(v=>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"?U(v.denomination,o):v.curr+" "+v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(v.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:U(a.TotalDenomationsAmount,o)})]})]})}),ee}else if(x==="ITEMWISE_SALES_COUNTER"){let ee,{counterDetails:v}=e.printerDataObject;return ee=s.jsx("div",{className:"main-div",style:{width:L[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:v.currentDate}),s.jsx("hr",{}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",v.CounterName]}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",v.openedBy]}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",v.loginTime]}),v.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",v.logoutTime]}),v.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${v.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${v.printedOn}`})]})}),ee}else if(x==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ee}=e.printerDataObject;return getRechargeDetails(ee)}else if(x==="PACKAGING_SLIP"){let ee,v=0;h.aggregatorOrderId&&h.aggregatorOrderId!==""&&(ee=A(h.aggregatorOrderId));const Z=h.services;for(let y in Z)v+=Z[y].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[h.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:h.subOrderFrom.toUpperCase()}),h.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",h.tokenId]}),h.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.tableName}),h.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+h.otp}),h.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${h.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),h.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:h.zomatoInstant}),s.jsx("hr",{}),h.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+h.orderId}),h.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",h.date]}),h.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+h.prepareBy}):"",h.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${u.Waiter} Name: `+h.waiterName})]}),Se(h),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",v]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(h.totalQty)]})]}),(xn=h.customFields)==null?void 0:xn.map(y=>s.jsx("h4",{className:"left-align-entity",children:y.customName+": "+y.customValue})),s.jsx("br",{}),h.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",h.paymentStatus.replace("_"," ")]})]})})}else{if(x==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[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 ${L[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 ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(v=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:sr(v.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:v.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(v.finalAmount)})]})},v.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)})]})]}),(Nn=a.transactions)!=null&&Nn.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[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(v=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:v.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:v.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(v.amount)})]})},v.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 ee,v=0,Z,ue;for(let N=0;N<(((Is=a.services)==null?void 0:Is.length)||0);N++)ue=a.services[N],ue.status==="CANCELLED"&&!a.onlyCancelledItems&&(v+=ue.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[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"}):"",v||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&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.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:`${u.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:`${u.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${be}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${be}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?Z=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}):Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}),s.jsx("div",{children:Z}))),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-v)]})]}),(Cs=a.customFields)==null?void 0:Cs.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.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:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:ft(m,a.obj,a.companyLogo,a.companyQrCode)})})},Oh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var d,m,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((d=n[e.primaryWaiter])==null?void 0:d.name)||null);const{obj:c,printersMap:u}=_d(e,t,r);let f=[],p=[];const g=_a(c).flatMap(b=>{var _;return(_=u[b.station])==null?void 0:_.map(w=>new Promise(T=>s.jsx(tt,{printerDataObject:{staticDataKOT:b,paperSize:w.paperSize,printer:w.printer},newId:b.newId,value:{settingData:t},onImageGenerated:M=>{f.push({paperSize:w.paperSize,printer:w.printer,image:M,type:"KOT"}),T()},additionalActions:r},b.newId)))});if(l&&((m=t.packagingSlipPrinters)!=null&&m.length)){const b=bd(e,t,r);(o=b.printers)!=null&&o.length&&b.printers.forEach(_=>{p.push(new Promise(w=>{g.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:T=>{f.push({paperSize:_.paperSize,printer:_.printer,image:T,type:"PACKAGING_SLIP"}),w()},additionalActions:r},_.obj.newId))}))})}g.length&&mt("root2",g),await Promise.all(p),i(f)}catch(l){a(l)}}),Mh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let d=[],m=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),u=_a(o).flatMap(f=>{var p;return(p=c[f.station])==null?void 0:p.map(g=>new Promise(b=>{const _=s.jsx(tt,{printerDataObject:{staticDataKOT:f,paperSize:l,printer:g.printer,type:f.type},newId:f.newId,settingData:t,tableData:Zs(a,"typeValue"),onImageGenerated:w=>{d.push({paperSize:g.paperSize,printer:g.printer,image:w,type:"UPDATE_TABLE"}),b()},additionalActions:n});return m.push(b),_}))});u.length&&mt("root1",u),await Promise.all(m.map(f=>new Promise(f)))}r(d)}catch(a){i(a)}}),Ah=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(m=>{const o=s.jsx(tt,{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"}),m()},additionalActions:t});mt("root1",o)}),n(a)}catch(i){r(i)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let d=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});mt("root1",l)}),r(d)}catch(a){i(a)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await va(e,t,n),d=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});mt("root1",l)}),r(d)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let d=await Id(e);if(d&&Object.keys(d.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(u=>{const f=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:p=>{l.push({paperSize:t.printerSize,image:p,type:"ITEMWISE_SALES_COUNTER"}),u()},additionalActions:r});mt("root1",f)}),i(l)}else i([])}catch(d){a(d)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let d=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:d,settingData:t,onImageGenerated:u=>{m.push({paperSize:t.printerSize,image:u,type:"COUNTER_OPERATION"}),l()},additionalActions:n});mt("root1",c)}),r(m)}catch(a){i(a)}}),Ph=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var d;try{const m=await Od(e,t);let o=[],l=ir(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(d=l[0])==null?void 0:d.paperSize:t.printerSize;await new Promise(f=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:{...m,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"}),f()},additionalActions:r});mt("root1",p)}),i(o)}catch(m){a(m)}}),Fh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const d=[];let m=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=od(l.invoiceFormats,"createdAt")[0],u=await Md(c);await new Promise(p=>{const g=s.jsx(tt,{printerDataObject:{staticDataKOT:u,paperSize:u.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:b=>{m.push({paperSize:u.paperSize,image:b,type:"BILL"}),p()},additionalActions:n});d.push(g)})}}d.length&&mt("root1",d),r(m)}catch(d){i(d)}}),mt=(e,t)=>{const n=document.getElementById(e);n&&ai.createRoot(n).render(t)};Oe.counterDetailsPrint=Lh,Oe.handleAggregatorBillPrint=Eh,Oe.handleBillPrint=Rh,Oe.handleDashboardPrint=Ah,Oe.handleItemWisePrint=kh,Oe.handleKOTPrint=Oh,Oe.handleOldBillPrints=Fh,Oe.handleSummaryPrint=Ph,Oe.handleUpdateTablePrint=Mh,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
54
+ */var Ba={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Wa=128,za="L",Ga="#FFFFFF",Va="#000000",qa=!1,mr=4,Sh=.1;function Ka(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(d,m){if(!d&&a!==null){n.push(`M${a+t} ${i+t}h${m-a}v1H${a+t}z`),a=null;return}if(m===r.length-1){if(!d)return;a===null?n.push(`M${m+t},${i+t} h1v1H${m+t}z`):n.push(`M${a+t},${i+t} h${m+1-a}v1H${a+t}z`);return}d&&a===null&&(a=m)})}),n.join("")}function Qa(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 Za(e,t,n,r){if(r==null)return null;const i=n?mr:0,a=e.length+i*2,d=Math.floor(t*Sh),m=a/t,o=(r.width||d)*m,l=(r.height||d)*m,c=r.x==null?e.length/2-o/2:r.x*m,u=r.y==null?e.length/2-l/2:r.y*m;let f=null;if(r.excavate){let p=Math.floor(c),g=Math.floor(u),b=Math.ceil(o+c-p),v=Math.ceil(l+u-g);f={x:p,y:g,w:b,h:v}}return{x:c,y:u,h:l,w:o,excavation:f}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:d=Va,includeMargin:m=qa,style:o,imageSettings:l}=t,c=ur(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),u=l==null?void 0:l.src,f=xe.useRef(null),p=xe.useRef(null),[g,b]=xe.useState(!1);xe.useEffect(()=>{if(f.current!=null){const T=f.current,M=T.getContext("2d");if(!M)return;let F=qt.QrCode.encodeText(n,Ba[i]).getModules();const O=m?mr:0,G=F.length+O*2,K=Za(F,r,m,l),te=p.current,Q=K!=null&&te!==null&&te.complete&&te.naturalHeight!==0&&te.naturalWidth!==0;Q&&K.excavation!=null&&(F=Qa(F,K.excavation));const le=window.devicePixelRatio||1;T.height=T.width=r*le;const W=r/G*le;M.scale(W,W),M.fillStyle=a,M.fillRect(0,0,G,G),M.fillStyle=d,Th?M.fill(new Path2D(Ka(F,O))):F.forEach(function(Ce,$){Ce.forEach(function(q,Se){q&&M.fillRect(Se+O,$+O,1,1)})}),Q&&M.drawImage(te,K.x+O,K.y+O,K.w,K.h)}}),xe.useEffect(()=>{b(!1)},[u]);const v=ys({height:r,width:r},o);let w=null;return u!=null&&(w=xe.createElement("img",{src:u,key:u,style:{display:"none"},onLoad:()=>{b(!0)},ref:p})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ys({style:v,height:r,width:r,ref:f},c)),w)}function Ih(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:d=Va,includeMargin:m=qa,imageSettings:o}=t,l=ur(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ba[i]).getModules();const u=m?mr:0,f=c.length+u*2,p=Za(c,r,m,o);let g=null;o!=null&&p!=null&&(p.excavation!=null&&(c=Qa(c,p.excavation)),g=xe.createElement("image",{xlinkHref:o.src,height:p.h,width:p.w,x:p.x+u,y:p.y+u,preserveAspectRatio:"none"}));const b=Ka(c,u);return xe.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${f} ${f}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:d,d:b,shapeRendering:"crispEdges"}),g)}var Ja=e=>{const t=e,{renderAs:n}=t,r=ur(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ys({},r)):xe.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},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 xs=Xn(),be="normal-class";(xs=="Android OS"||xs==="iOS")&&(be="bold-class");const tt=e=>{var Mt,J,Ne,pt,yt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:d,type:m}=e.printerDataObject,o=((J=(Mt=e.value)==null?void 0:Mt.settingData)==null?void 0:J.curr)??((Ne=e.settingData)==null?void 0:Ne.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ir(d,{type:m,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const u=r.customLabels??gd();l=c?(pt=c[0])!=null&&pt.paperSize?(yt=c[0])==null?void 0:yt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function f(x){const h=Math.abs(parseFloat(x));return p(h)}function p(x){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(x).format("0,00.000");default:return Xs(x).format("0,00.00")}}xe.useEffect(()=>{w()},[e.newId]);const g=()=>new Promise(async(x,h)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const j=await v(C);x(j)}}else{let C=await Ya(n.current);C&&x(C)}}),b=()=>new Promise(async(x,h)=>{const C=await g();x(C)}),v=x=>new Promise((h,C)=>{let j=new Image;j.src=x,j.onload=()=>{let I=document.createElement("canvas");const D=600,S=j.height;let k=j.width,H=j.height;k>H?k>D&&(H*=D/k,k=D):H>S&&(k*=S/H,H=S),I.width=k,I.height=H,I.getContext("2d").drawImage(j,0,0,k,H),h(I.toDataURL())}}),w=async()=>{if(n&&n.current){const x=await b();e.onImageGenerated(x)}},T=x=>{let h=new Array;for(const C in x.menusCollection)C.endsWith("collection")||(x.menusCollection[`${C}_collection`]||x.menusCollection[C])&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${x.menusCollection[C]}):`}),s.jsx("span",{children:ie(x.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:p(gs(x.salesCollection.totalCollection,x.menusCollection[`${C}_collection`]??0))+"%"})]}));return x.salesCollection.online_aggregator_collection&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${x.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(x.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${x.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(x.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${x.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(x.salesCollection.swiggy_aggregator_collection,o)})]})),h},M=x=>{let h=new Array,C=new Object;for(let j=0;j<x.todayCollection.length;j++)C=x.todayCollection[j],h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:ie(C.value,o)}),s.jsx("span",{children:p(gs(x.totalCollection,C.value))+"%"})]}));return h},F=(x,h,C,j,I={})=>{let D=x.includes("upi://");const S=`upi://pay?pa=${x}&pn=${C}&cu=INR&am=${j}&tr=${h}`;return s.jsx(Ja,{value:D?x:S,renderAs:"canvas",size:I.size??250})},O=(x,h)=>{var D,S;let C=0;if((D=h.taxObj)!=null&&D.VAT.length){let k,H,fe;for(H=0;H<((S=h.taxObj)==null?void 0:S.VAT.length);H++){k=h.taxObj.VAT[H];for(fe in k)C+=ve(k[fe])}}const j={sellerName:h.companyInfo.companyName,vatRegistrationNumber:x,invoiceTimestamp:new Date(h.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:h.finalAmount,invoiceVatTotal:C},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Ja,{value:I,renderAs:"canvas",size:250})},G=x=>{const h=[];return(x.totalBalanceAmt||x.refundAmt||x.writeOffAmt||x.rewardAmt||x.cashCard)&&(h.push(s.jsx("hr",{})),x.rewardAmt&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(x.rewardAmt,o)})]})),x.totalBalanceAmt&&h.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(x.totalBalanceAmt,o)})]})),x.writeOffAmt&&h.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(x.writeOffAmt,o)})]})),x.refundAmt&&h.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(x.refundAmt,o)})]})),x.cashCard&&h.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(x.cashCard,o)})]}))),h},K=(x,h)=>{if(h&&h.length){for(let C=0;C<h.length;C++)if(h[C].slugName===x)return h[C]}return!1},te=(x,h)=>{if(h&&h.length){for(let C=0;C<h.length;C++)if(h[C].itemType===x)return h[C]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=x=>x.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${x.discountValue}${Ch[x.discountType]}`,W=x=>{const h=new Array;if(x&&Object.keys(x).length!==0){h.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in x)if(h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[C]}:`}),s.jsx("span",{children:ie(x[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const j in x[C])j!=="total"&&x[C][j]&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(j)}:`}),s.jsx("span",{children:ie(x[C][j],o)})]}))}return h},Ce=(x,h)=>{let C=!1;x.totalValue&&(C=Object.keys(x.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[x.totalValue&&Object.keys(x.totalValue).map(D=>{if(j=x.totalValue[D],D==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList&&x.itemList.length&&x.itemList.length>0&&x.itemList.map(S=>{if(S.taxType===D||!S.taxType)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.rate?f(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&x.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>{const k=K(S,x.discArr);if(k&&j.cat[S]!==0&&k.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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.cat[S])})]})}):"",x.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,x.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.itemTypes[S])})]})}):"",x.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:h[`segment_disc${x.segMentObj.segmentName.toLowerCase()}`]??x.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+x.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.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:x.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[x.couponCode?`(${x.couponCode.toUpperCase()})`:"",p(x.dicsEnterValue)?`@${x.dicsEnterValue}${x.discountType=="RELATIVE"||x.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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:["  ",x.couponCode?"COUPON DISC":"خصم الطلب",x.couponCode?`(${x.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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"})]}):"",x.taxObj&&x.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H/2;k.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:h.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/2)})]})]}))}return k}):x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H;k.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:h.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H])})]})}))}return k})}):"",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:h.total}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p((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"})]}),x.totalValue&&(Object.keys(x.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),x.totalValue&&Object.keys(x.totalValue).map(D=>{if(j=x.totalValue[D],D==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList&&x.itemList.length&&x.itemList.length>0&&x.itemList.map(S=>{if(S.taxType===D)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:S.rate?f(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&x.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>{const k=K(S,x.discArr);if(k&&j.cat[S]!==0&&k.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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.cat[S])})]})}):"",x.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,x.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(j.itemTypes[S])})]})}):"",x.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:h[`segment_disc${x.segMentObj.segmentName.toLowerCase()}`]??x.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+x.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.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:x.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[x.couponCode?`(${x.couponCode.toUpperCase()})`:"",p(x.dicsEnterValue)?`@${x.dicsEnterValue}${x.discountType=="RELATIVE"||x.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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:["  ",x.couponCode?"COUPON DISC":"خصم الطلب",x.couponCode?`(${x.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(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(S=>s.jsx(s.Fragment,{children:S.taxOnAmount&&S.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:h.cgst}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S.taxOnAmount/2)})]})]}):""})):"",x.taxObj&&x.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H/2;k.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:h.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/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:h[x.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H]/2)})]})]}))}return k}):x.taxObj[D].map(S=>{let k=new Array;for(const H in S)if(S[H]&&S[H]!=0){let fe=H;k.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:h.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p(S[H])})]})}))}return k})}):"",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:h.total}}),s.jsx("h5",{className:"actual-qty",children:x.curr+" "+p((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"})]})]})]})})]})},$=(x,h,{labels:C,doMultipleTax:j,type:I})=>{var S,k,H,fe,Te,Le,Pe,Ae,At,Et,gt;const D=x.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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[x.itemList.map(V=>{var Rt;return s.jsxs("div",{style:V.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[V.status==="RETURNED"?"(R) ":"",V.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:V.serviceRate?f(V.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:V.sub_total?p(V.sub_total):""})]}),(Rt=V.addons)!=null&&Rt.length?V.addons.map(St=>s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(St.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",St.qty*V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]})):"",V.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+V.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${be}`,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:h.curr+" "+p(x.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"})]}):""]}),(S=D.DISCOUNT_ITEMS)!=null&&S.length?D.DISCOUNT_ITEMS.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:le(V)})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.discountAmt)})]})):"",(k=D.CATEGORY_DISCOUNT)!=null&&k.length?D.CATEGORY_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.discountAmt)})]})):"",(H=D.ITEM_DISCOUNT)!=null&&H.length?D.ITEM_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+ts(V.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.discountAmt)})]})):"",(Te=(fe=D.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Te.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${D.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+D.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+D.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=D.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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:`(${D.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${D.COUPON_DISCOUNT[0].discountValue}${D.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.COUPON_DISCOUNT[0].discountAmt)})]}):"",(At=(Ae=D.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,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(D.ORDER_DISCOUNT[0].discountValue)?`@${D.ORDER_DISCOUNT[0].discountValue}${D.ORDER_DISCOUNT[0].discountType=="RELATIVE"||D.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(D.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&x&&x.orderDisc?s.jsxs("div",{className:`bottom-section-div ${be}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",h.couponCode?"COUPON DISC":"خصم الطلب",h.couponCode?`(${h.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=x.charges)!=null&&Et.length?x.charges.map(V=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${V.name.toLowerCase()}`]??V.name}})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.amt)})]})})):"",x.subTotal!==x.afterCharges&&x.afterCharges!==x.total?s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(x.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&x.subTotal!==x.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(gt=x.taxation)!=null&&gt.length?x.taxation.map(V=>{if(V.taxAmt)return V.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${be}`,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:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${be}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[h.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${be}`,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:"@"+V.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(V.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+p(x.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"})]}):""}):""]})},q=(x,h)=>{var D,S;let C=!1;const j=x.distributedData;return x.distributedData&&(C=Object.keys(x.distributedData).length>1),s.jsxs(s.Fragment,{children:[((D=j.GST)==null?void 0:D.itemList)&&$(j.GST,x,{labels:h,doMultipleTax:C,type:"GST"}),((S=j.VAT)==null?void 0:S.itemList)&&$(j.VAT,x,{labels:h,doMultipleTax:C,type:"VAT"})]})},Se=x=>{const h=x.services,C=Object.keys(x.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${be}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].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((D,S)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[D.toUpperCase(),":"]})}),h[D].map(k=>{var H;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(fe=>{var Te;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Te=fe.serviceName)==null?void 0:Te.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),j!==S+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},A=x=>{const h=x.slice(0,-4),C=x.slice(-4);return{firstDigits:h,last4Dgits:C}},Be=(x,h,C,j={})=>{const I=Object.keys(h??{});let D=[],S,k="flex-two-items";if(j.action==="addCharges"&&(k="display-percentage"),x&&I.length){D.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:ie(x,o)})]})]}));for(let H=0;H<I.length;H++)S=I[H],h[S]&&D.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${S.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(h[S],o)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(x,h[S]))+"%"}):""]}));D.push(s.jsx("hr",{}))}return D},st=x=>{const h=Object.keys(x.Category),C=Object.keys(x.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"})]})),h.forEach((I,D)=>{const S=x.Category[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,D!=h.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((I,D)=>{const S=x.Addon[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,D!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=x=>{var C;const h={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",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=x==null?void 0:x.customBillLabels)!=null&&C.length){let j;for(let I=0;I<x.customBillLabels.length;I++)j=x.customBillLabels[I],h[j.defaultName]=j.displayName}return h},ft=(x,h,C,j)=>{var H,fe,Te,Le,Pe,Ae,At,Et,gt,V,Rt,St,Ns,js,on,vs,_s,cn,dn,hn,un,mn,fn,pn,Kt,bs,xt,Qt,Zt,Ss,yn,Ts,gn,ws,Is,xn,Nn,Cs,Os;const I=nt(r.customLabelsMap),D=ms(xd(r.paymentModes),"internalName"),S=ee=>{var _;return(_=D[ee])!=null&&_.displayName?D[ee].displayName.toUpperCase():ee};if(x==="BILL"){let ee;if(l==="A4"||l==="A5"){let _={...h},Z=0,ue=_.distributedData;const y=ue.discounts;ee=s.jsx("div",{className:`invoiceContainer main-div ${L[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:[_.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:_.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:_.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:[(_.customerInfo.custName||((H=_.customFields)==null?void 0:H.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),_.customerInfo.custName&&_.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custName})}),_.customerInfo.custContact&&_.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custContact})}),_.customerInfo.custAddress&&_.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custAddress})}),_.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.deliveryTimestamp})}),(fe=_.customFields)!=null&&fe.length?_.customFields.map(N=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[N.customName,": ",N.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:_.companyInfo.companyName})}),_.companyInfo.companyAddress&&_.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyAddress})}),_.companyInfo.companyEmail&&_.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyEmail})}),_.companyInfo.companyContact&&_.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyContact})}),_.fssai&&_.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:_.fssai})]})}),_.gst&&_.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:_.gst})]})}),_.vatNo&&_.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:_.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:[_.itemList.map(N=>{var oe;let P="",z=[];return Z++,z.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:P,children:[s.jsx("td",{className:"text-align-left",children:N.serviceRate?Z:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:N.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:N.qty}),s.jsx("td",{className:"text-align-right",children:N.serviceRate?U(N.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:N.sub_total?U(N.sub_total,o):""})]}),N.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+N.instruction+")"})]})]})),(oe=N.addons)!=null&&oe.length&&N.addons.map(he=>{z.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:["+ ",he.serviceName.toUpperCase()]}),s.jsx("td",{children:he.qty*N.qty})]}),he.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+he.instruction+")"})]})]}))}),z}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Z} Items and ${ve(ue.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",{}),fd(xa(_.finalAmount,o).toFixed(tn[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),_.upiId&&h.companyInfo.companyName&&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:F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmt,{size:100})})})})]}),_.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:_.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:U(ue.subTotal,o)})]}),(Te=y==null?void 0:y.DISCOUNT_ITEMS)!=null&&Te.length?y.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:le(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Le=y==null?void 0:y.CATEGORY_DISCOUNT)!=null&&Le.length?y.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Pe=y==null?void 0:y.ITEM_DISCOUNT)!=null&&Pe.length?y.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(At=(Ae=y==null?void 0:y.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`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("td",{className:"text-align-right",width:"50%",children:U(y.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(gt=(Et=y==null?void 0:y.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&gt.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:`(${y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${y.COUPON_DISCOUNT[0].discountValue}${y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(V=y==null?void 0:y.ORDER_DISCOUNT)==null?void 0:V[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:p(y.ORDER_DISCOUNT[0].discountValue)?`@${y.ORDER_DISCOUNT[0].discountValue}${y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(St=ue.charges)!=null&&St.length?ue.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.amt,o)})]})):"",ue.subTotal!==ue.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:U(ue.afterCharges,o)})]}):"",(Ns=ue.taxation)!=null&&Ns.length?ue.taxation.map(N=>N.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:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:" @"+N.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.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:U(_.finalAmount,o)})]}),(js=h==null?void 0:h.custoutStandingData)!=null&&js.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:U((on=_==null?void 0:_.custoutStandingData)==null?void 0:on.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:U(_.grandTotal+((vs=_==null?void 0:_.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",_.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:U(_.rewardAmt,o)})]}):"",(_s=h.paymentMethods)!=null&&_s.length?h.paymentMethods.map(N=>{var P;if(N.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(P=N.paymentMode)==null?void 0:P.toLowerCase()}`]??S(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),N.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(N.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.paidAmt,o)})]})}):"",_.balanceAmt&&h.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:U(h.balanceAmt,o)})]}):"",h.balPoint&&!Number.isNaN(h.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:h.balPoint})]}):"",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 :${_.printby} Printed On: ${_.printTime}`}),_.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else ee=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[h.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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&h.companyInfo.companyName&&h.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:h.companyInfo.companyName}),h.companyInfo.companyAddress&&h.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.companyInfo.companyAddress}}),h.companyInfo.companyContact&&h.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:h.companyInfo.companyContact})]})}),h.companyInfo.companyEmail&&h.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:h.companyInfo.companyEmail})]})}),h.fssai&&h.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:h.fssai})]})}),h.gst&&h.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:h.gst})]})}),h.vatNo&&h.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:h.vatNo})]})}),s.jsx("hr",{}),h.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.orderFrom}),h.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[h.area," : ",h.tableName?h.tableName:h.tableNo]}),h.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:h.tokenId})]})}),h.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${be}`,children:[h.customerInfo.custName&&h.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:h.customerInfo.custName})]})}),h.customerInfo.custContact&&h.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:h.customerInfo.custContact})]})}),h.customerInfo.custAddress&&h.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:h.customerInfo.custAddress})]})}),_t(h.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),h.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:h.orderId})]})}),h.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:h.orderInfo.orderDate})]})}),h.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:h.deliveryTimestamp})]})}),h.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:h.captainName})]})})]}),(cn=h.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),h.customFields.map(_=>s.jsx("h4",{className:"left-align-entity",children:_.customName+": "+_.customValue}))]}):"",h.newFormat?q(h,I):Ce(h,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=h.custoutStandingData)!=null&&dn.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.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=h.custoutStandingData)!=null&&hn.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+p(h.finalAmount)})]}),(un=h.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:h.curr+" "+p(h.custoutStandingData.balanceAmt)})]}),!h.rewardAmt&&!h.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:h.curr+" "+p(h.finalAmount+h.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"}})]}):"",h.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:"("+h.usedPoints+" Points)"})]}),s.jsx("h5",{children:h.curr+" "+h.rewardAmt})]}):"",h.paymentMethods&&h.paymentMethods.length?h.paymentMethods.map(_=>{var Z;if(_.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${be}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Z=_.paymentMode)==null?void 0:Z.toLowerCase()}`]??S(_.paymentMode)??"CASH"}}),s.jsx("span",{children:_.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:_.isRefund?s.jsx(s.Fragment,{children:h.curr+" ("+p(_.paidAmt)+")"}):s.jsx(s.Fragment,{children:h.curr+" "+p(_.paidAmt)})})]})}):"",h.rewardAmt&&!h.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:h.curr+" "+p(h.finalAmount+(((mn=h==null?void 0:h.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-h.rewardAmt)})]})}):"",h.balanceAmt&&h.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:h.curr+" "+p(h.balanceAmt)})]}):"",s.jsx("hr",{})]}),h.earnPoints&&h.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:h.earnPoints})]}):"",(h.balPoint||h.earnPoints)&&!Number.isNaN(h.balPoint||h.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:h.balPoint+h.earnPoints||0})]}):"",h.upiId&&h.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmount)]}),h.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."}),O(r.vatNo,h)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",h.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.footerMessage}}):"",h.printby&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${h.printby}`}):"",h.printTime&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${h.printTime}`}):"",h.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return ee}else if(x==="PRINT_DASHBOARD"&&h.salesCollection){const ee=h.salesCollection.totalDiscountAmt?gs(h.salesCollection.grandTotal,h.salesCollection.totalDiscountAmt):null,_=h.salesCollection.totalCollection-h.salesCollection.totalTax;var k=R().format("DD/MM/YYYY LT");const Z=(fn=h.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(h.monthTillDateSalesColl.grandTotal,h.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[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:- ${k}`}),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:h.selectedDate})]}),s.jsx("hr",{}),h.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(h.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(h.monthTillDateSalesColl.totalDiscountAmt,o)}${Z?`(${p(Z)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(h.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(h.monthTillDateSalesColl.totalCollection-h.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(h.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(h.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(h.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(h.salesCollection.totalDiscountAmt,o)}${ee?`(${p(ee)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(h.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(_,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(h.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(h.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Be(h.otherFields.totalDiscountAmt,h.otherFields.discountList,"Discount",{action:"addCharges"}),Be(h.otherFields.totalOtherCharges,h.otherFields.otherChargesList,"Charges"),Be(h.otherFields.totalTax,h.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(h.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:h.salesCollection.totalOrders})]}),T(h)]}),s.jsx("hr",{}),h.otherFields.totalItemType?s.jsx("div",{children:Be(h.otherFields.totalItemType,h.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",h.averageCollection.avgTableTime||h.averageCollection.avgorderValue||h.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),h.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:h.averageCollection.avgTableTime})]}):"",h.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(h.averageCollection.avgorderValue,o)})]}):"",h.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:h.averageCollection.noOfGuest})]}):"",h.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(h.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(h.totalCollection,o)})]}),M(h)]}),G(h.averageCollection),h.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(h.otherFields.salesCollection,o)})]}),h.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(h.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),W(h.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(x==="AGGREGATOR_BILL"){let ee;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].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: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.orderFrom}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",ee.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 ${L[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.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:L[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:[((pn=a.services)==null?void 0:pn.length)&&a.services.map(Z=>{var ue;return s.jsxs("div",{style:Z.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:Z.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Z.qty})]}),((ue=Z.addons)==null?void 0:ue.length)&&Z.addons.map(y=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(y.serviceName)})),Z.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Z.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(Z=>{if(Z.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Z.name}),s.jsx("h5",{children:a.curr+" "+p(Z.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Z=>{let ue=new Array;for(const y in Z)if(Z[y]&&Z[y]!=0){let N=y/2;ue.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",N]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[h.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]})]}))}return ue})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(Z=>s.jsx("h4",{className:"left-align-entity",children:Z.customName+": "+Z.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[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(x==="UPDATE_TABLE"){let ee="";return a.action==="SWITCH_TABLE"?ee=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=u.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:(xt=a.from)==null?void 0:xt.map((_,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[_])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[_])==null?void 0:N.tableName}${Z+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:`${(Zt=(Qt=e.tableData[a.to[0]])==null?void 0:Qt.attachedArea)==null?void 0:Zt.toUpperCase()} - ${(Ss=e.tableData[a.to[0]])==null?void 0:Ss.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):ee=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 ",(yn=u.Table)==null?void 0:yn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ts=a.from)==null?void 0:Ts.map((_,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[_])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[_])==null?void 0:N.tableName}${Z+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:`${(ws=(gn=e.tableData[a.to[0]])==null?void 0:gn.attachedArea)==null?void 0:ws.toUpperCase()} - ${(Is=e.tableData[a.to[0]])==null?void 0:Is.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),ee}else if(x==="COUNTER_OPERATION"){let ee;return l=="2INCH"||l=="1.8INCH"?ee=s.jsx("div",{className:"main-div",style:{width:L[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: ",U(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: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(_=>{if(_.value>0||_.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",_.displayName," : ",U(_.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(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:["    ",U(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:["    ",U(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:["    ",U(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(_=>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"?U(_.denomination,o):_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(_.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:U(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:["    ",U(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:["    ",U(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:["   ",U(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:["    ",U(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:["    -",U(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:["    +",U(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:["   -",U(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:["   +",U(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(_=>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"?U(_.denomination,o):_.curr+" "+_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(_.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:U(a.TotalDenomationsAmount,o)})]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:L[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: ",U(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: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(_=>{if(_.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",_.displayName," : ",U(_.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(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 : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(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(_=>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"?U(_.denomination,o):_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(_.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:U(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 : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(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 : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(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(_=>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"?U(_.denomination,o):_.curr+" "+_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(_.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:U(a.TotalDenomationsAmount,o)})]})]})}),ee}else if(x==="ITEMWISE_SALES_COUNTER"){let ee,{counterDetails:_}=e.printerDataObject;return ee=s.jsx("div",{className:"main-div",style:{width:L[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:_.currentDate}),s.jsx("hr",{}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",_.CounterName]}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",_.openedBy]}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",_.loginTime]}),_.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",_.logoutTime]}),_.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${_.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${_.printedOn}`})]})}),ee}else if(x==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ee}=e.printerDataObject;return getRechargeDetails(ee)}else if(x==="PACKAGING_SLIP"){let ee,_=0;h.aggregatorOrderId&&h.aggregatorOrderId!==""&&(ee=A(h.aggregatorOrderId));const Z=h.services;for(let y in Z)_+=Z[y].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[h.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:h.subOrderFrom.toUpperCase()}),h.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",h.tokenId]}),h.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.tableName}),h.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+h.otp}),h.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${h.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),h.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:h.zomatoInstant}),s.jsx("hr",{}),h.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+h.orderId}),h.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",h.date]}),h.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+h.prepareBy}):"",h.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${u.Waiter} Name: `+h.waiterName})]}),Se(h),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",_]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(h.totalQty)]})]}),(xn=h.customFields)==null?void 0:xn.map(y=>s.jsx("h4",{className:"left-align-entity",children:y.customName+": "+y.customValue})),s.jsx("br",{}),h.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",h.paymentStatus.replace("_"," ")]})]})})}else{if(x==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[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 ${L[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 ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(_=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:sr(_.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:_.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(_.finalAmount)})]})},_.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)})]})]}),(Nn=a.transactions)!=null&&Nn.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[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(_=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:_.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:_.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(_.amount)})]})},_.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 ee,_=0,Z,ue;for(let N=0;N<(((Cs=a.services)==null?void 0:Cs.length)||0);N++)ue=a.services[N],ue.status==="CANCELLED"&&!a.onlyCancelledItems&&(_+=ue.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[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"}):"",_||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&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.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:`${u.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:`${u.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${be}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${be}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?Z=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}):Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}),s.jsx("div",{children:Z}))),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-_)]})]}),(Os=a.customFields)==null?void 0:Os.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.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:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:ft(m,a.obj,a.companyLogo,a.companyQrCode)})})},Oh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var d,m,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((d=n[e.primaryWaiter])==null?void 0:d.name)||null);const{obj:c,printersMap:u}=_d(e,t,r);let f=[],p=[];const g=_a(c).flatMap(b=>{var v;return(v=u[b.station])==null?void 0:v.map(w=>new Promise(T=>s.jsx(tt,{printerDataObject:{staticDataKOT:b,paperSize:w.paperSize,printer:w.printer},newId:b.newId,value:{settingData:t},onImageGenerated:M=>{f.push({paperSize:w.paperSize,printer:w.printer,image:M,type:"KOT"}),T()},additionalActions:r},b.newId)))});if(l&&((m=t.packagingSlipPrinters)!=null&&m.length)){const b=bd(e,t,r);(o=b.printers)!=null&&o.length&&b.printers.forEach(v=>{p.push(new Promise(w=>{g.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:v.obj},paperSize:v.paperSize,printer:v.printer,type:"PACKAGING_SLIP"},newId:v.obj.newId,value:{settingData:t},onImageGenerated:T=>{f.push({paperSize:v.paperSize,printer:v.printer,image:T,type:"PACKAGING_SLIP"}),w()},additionalActions:r},v.obj.newId))}))})}g.length&&mt("root2",g),await Promise.all(p),i(f)}catch(l){a(l)}}),Mh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let d=[],m=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),u=_a(o).flatMap(f=>{var p;return(p=c[f.station])==null?void 0:p.map(g=>new Promise(b=>{const v=s.jsx(tt,{printerDataObject:{staticDataKOT:f,paperSize:l,printer:g.printer,type:f.type},newId:f.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:w=>{d.push({paperSize:g.paperSize,printer:g.printer,image:w,type:"UPDATE_TABLE"}),b()},additionalActions:n});return m.push(b),v}))});u.length&&mt("root1",u),await Promise.all(m.map(f=>new Promise(f)))}r(d)}catch(a){i(a)}}),Ah=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(m=>{const o=s.jsx(tt,{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"}),m()},additionalActions:t});mt("root1",o)}),n(a)}catch(i){r(i)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let d=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});mt("root1",l)}),r(d)}catch(a){i(a)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await va(e,t,n),d=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});mt("root1",l)}),r(d)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let d=await Id(e);if(d&&Object.keys(d.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(u=>{const f=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:p=>{l.push({paperSize:t.printerSize,image:p,type:"ITEMWISE_SALES_COUNTER"}),u()},additionalActions:r});mt("root1",f)}),i(l)}else i([])}catch(d){a(d)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let d=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:d,settingData:t,onImageGenerated:u=>{m.push({paperSize:t.printerSize,image:u,type:"COUNTER_OPERATION"}),l()},additionalActions:n});mt("root1",c)}),r(m)}catch(a){i(a)}}),Ph=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var d;try{const m=await Od(e,t);let o=[],l=ir(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(d=l[0])==null?void 0:d.paperSize:t.printerSize;await new Promise(f=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:{...m,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"}),f()},additionalActions:r});mt("root1",p)}),i(o)}catch(m){a(m)}}),Fh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const d=[];let m=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=od(l.invoiceFormats,"createdAt")[0],u=await Md(c);await new Promise(p=>{const g=s.jsx(tt,{printerDataObject:{staticDataKOT:u,paperSize:u.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:b=>{m.push({paperSize:u.paperSize,image:b,type:"BILL"}),p()},additionalActions:n});d.push(g)})}}d.length&&mt("root1",d),r(m)}catch(d){i(d)}}),mt=(e,t)=>{const n=document.getElementById(e);n&&ai.createRoot(n).render(t)};Oe.counterDetailsPrint=Lh,Oe.handleAggregatorBillPrint=Eh,Oe.handleBillPrint=Rh,Oe.handleDashboardPrint=Ah,Oe.handleItemWisePrint=kh,Oe.handleKOTPrint=Oh,Oe.handleOldBillPrints=Fh,Oe.handleSummaryPrint=Ph,Oe.handleUpdateTablePrint=Mh,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});