recaho-print-react 0.0.118 → 0.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/recaho-print-react.js +1755 -1755
- package/dist/recaho-print-react.umd.cjs +17 -17
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Oe,
|
|
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,Ja){"use strict";function fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os={exports:{}},Xt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var pr;function Xa(){if(pr)return Xt;pr=1;var e=
|
|
9
|
+
*/var pr;function Xa(){if(pr)return Xt;pr=1;var e=xe,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function d(m,o,l){var c,u={},f=null,p=null;l!==void 0&&(f=""+l),o.key!==void 0&&(f=""+o.key),o.ref!==void 0&&(p=o.ref);for(c in o)r.call(o,c)&&!a.hasOwnProperty(c)&&(u[c]=o[c]);if(m&&m.defaultProps)for(c in o=m.defaultProps,o)u[c]===void 0&&(u[c]=o[c]);return{$$typeof:t,type:m,key:f,ref:p,props:u,_owner:i.current}}return Xt.Fragment=n,Xt.jsx=d,Xt.jsxs=d,Xt}var es={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,41 +14,41 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var yr;function ei(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){var e=
|
|
18
|
-
`+h+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+ne[
|
|
17
|
+
*/var yr;function ei(){return yr||(yr=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,tt,st,ft,Mt,J;function Ne(){}Ne.__reactDisabledLog=!0;function pt(){{if(Se===0){A=console.log,Be=console.info,tt=console.warn,st=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:tt}),error:V({},y,{value:st}),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`
|
|
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
|
+
`),Ee=z.stack.split(`
|
|
20
|
+
`),ve=ne.length-1,we=Ee.length-1;ve>=1&&we>=0&&ne[ve]!==Ee[we];)we--;for(;ve>=1&&we>=0;ve--,we--)if(ne[ve]!==Ee[we]){if(ve!==1||we!==1)do if(ve--,we--,we<0||ne[ve]!==Ee[we]){var We=`
|
|
21
|
+
`+ne[ve].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(ve>=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(ve){ne=ve}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,ln={key:!0,ref:!0,__self:!0,__source:!0},js,vs;function on(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 cn(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 dn(y,N){typeof y.ref=="string"&&Ns.current}function hn(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 un(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 mn=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 fn(y,N,P,z,oe){{var he,ae={},ne=null,Ee=null;P!==void 0&&(xs(P),ne=""+P),cn(N)&&(xs(N.key),ne=""+N.key),on(N)&&(Ee=N.ref,dn(N,oe));for(he in N)Te.call(N,he)&&!ln.hasOwnProperty(he)&&(ae[he]=N[he]);if(y&&y.defaultProps){var ve=y.defaultProps;for(he in ve)ae[he]===void 0&&(ae[he]=ve[he])}if(ne||Ee){var we=typeof y=="function"?y.displayName||y.name||"Unknown":y;ne&&hn(ae,we),Ee&&un(ae,we)}return mn(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`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+y+"`."}return""}}function pn(y){return""}var Ss={};function yn(y){{var N=bs();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(
|
|
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=yn(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 gn(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 xn(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=pn();Ee?ne+=Ee:ne+=bs();var ve;y===null?ve="null":gt(y)?ve="array":y!==void 0&&y.$$typeof===t?(ve="<"+($(y.type)||"Unknown")+" />",ne=" Did you accidentally export a JSX literal instead of a component?"):ve=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",ve,ne)}var we=fn(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(Fh){return Fh!=="key"}),mr=Fe.length>0?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Is[kt+mr]){var Ph=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} />`,mr,kt,Ph,kt),Is[kt+mr]=!0}}return
|
|
30
|
+
<%s key={someKey} {...props} />`,mr,kt,Ph,kt),Is[kt+mr]=!0}}return y===r?xn(we):gn(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 gr;function ti(){return gr||(gr=1,process.env.NODE_ENV==="production"?Os.exports=Xa():Os.exports=ei()),Os.exports}var s=ti(),Lt={},xr;function si(){if(xr)return Lt;xr=1;var e=Ja;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 ni=si();const ri=fr(ni),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 Nr;function R(){return Nr.apply(null,arguments)}function ai(e){Nr=e}function
|
|
35
|
+
var Nr;function R(){return Nr.apply(null,arguments)}function ai(e){Nr=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 Nn(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 nt(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 jr(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 Vr(e,t,n,r,!0).utc()}function ii(){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=ii()),e._pf}var jn;Array.prototype.some?jn=Array.prototype.some:jn=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 vn(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=X(e),n=jn.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 vr=R.momentProperties=[],_n=!1;function bn(e,t){var n,r,i,a=vr.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=vr[n],i=t[r],Re(i)||(e[r]=i);return e}function ns(e){bn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),_n===!1&&(_n=!0,R.updateOffset(this),_n=!1)}function Ge(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function _r(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)}_r(e+`
|
|
37
37
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
38
|
-
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var br={};function Sr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),br[e]||(_r(t),br[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Je(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function li(e){var t,n;for(n in e)ce(e,n)&&(t=e[n],Je(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 Sn(e,t){var n=jt({},e),r;for(r in t)ce(t,r)&&(wt(e[r])&&wt(t[r])?(n[r]={},jt(n[r],e[r]),jt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)ce(e,r)&&!ce(t,r)&&wt(e[r])&&(n[r]=jt({},n[r]));return n}function Tn(e){e!=null&&this.set(e)}var wn;Object.keys?wn=Object.keys:wn=function(e){var t,n=[];for(t in e)ce(e,t)&&n.push(t);return n};var oi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ci(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Je(r)?r.call(t,n):r}function Xe(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 In=/(\[[^\[]*\])|(\\)?([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,Cn={},Pt={};function H(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 Xe(i.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function di(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function hi(e){var t=e.match(In),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=di(t[n]);return function(i){var a="",d;for(d=0;d<r;d++)a+=Je(t[d])?t[d].call(i,e):t[d];return a}}function Es(e,t){return e.isValid()?(t=Tr(t,e.localeData()),Cn[t]=Cn[t]||hi(t),Cn[t](e)):e.localeData().invalidDate()}function Tr(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 ui={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 mi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(In).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var fi="Invalid date";function pi(){return this._invalidDate}var yi="%d",gi=/\d{1,2}/;function xi(e){return this._ordinal.replace("%d",e)}var Ni={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 ji(e,t,n,r){var i=this._relativeTime[n];return Je(i)?i(e,t,n,r):i.replace(/%d/i,e)}function vi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Je(n)?n(t):n.replace(/%s/i,t)}var wr={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 Be(e){return typeof e=="string"?wr[e]||wr[e.toLowerCase()]:void 0}function On(e){var t={},n,r;for(r in e)ce(e,r)&&(n=Be(r),n&&(t[n]=e[r]));return t}var _i={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 bi(e){var t=[],n;for(n in e)ce(e,n)&&t.push({unit:n,priority:_i[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Ir=/\d/,Ye=/\d\d/,Cr=/\d{3}/,Mn=/\d{4}/,Rs=/[+-]?\d{6}/,ye=/\d\d?/,Or=/\d\d\d\d?/,Mr=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,An=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,Ps=/[+-]?\d+/,Si=/Z|[+-]\d\d:?\d\d/gi,Fs=/Z|[+-]\d\d(?::?\d\d)?/gi,Ti=/[+-]?\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?/,En=/^([1-9]\d|\d)/,Ds;Ds={};function Y(e,t,n){Ds[e]=Je(t)?t:function(r,i){return r&&n?n:t}}function wi(e,t){return ce(Ds,e)?Ds[e](t._strict,t._locale):new RegExp(Ii(e))}function Ii(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function We(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=We(t)),n}var Rn={};function pe(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(a,d){d[t]=se(a)}),i=e.length,n=0;n<i;n++)Rn[e[n]]=r}function as(e,t){pe(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Ci(e,t,n){t!=null&&ce(Rn,e)&&Rn[e](t,n._a,n,e)}function Ys(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,lt=1,et=2,Ie=3,qe=4,ot=5,It=6,Oi=7,Mi=8;H("Y",0,0,function(){var e=this.year();return e<=9999?Xe(e,4):"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),Y("Y",Ps),Y("YY",ye,Ye),Y("YYYY",An,Mn),Y("YYYYY",Ls,Rs),Y("YYYYYY",Ls,Rs),pe(["YYYYY","YYYYYY"],Me),pe("YYYY",function(e,t){t[Me]=e.length===2?R.parseTwoDigitYear(e):se(e)}),pe("YY",function(e,t){t[Me]=R.parseTwoDigitYear(e)}),pe("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 Ar=Yt("FullYear",!0);function Ai(){return Ys(this.year())}function Yt(e,t){return function(n){return n!=null?(Er(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 Er(e,t,n){var r,i,a,d,y;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(),y=e.date(),y=y===29&&d===1&&!Ys(a)?28:y,i?r.setUTCFullYear(a,d,y):r.setFullYear(a,d,y)}}function Ei(e){return e=Be(e),Je(this[e])?this[e]():this}function Ri(e,t){if(typeof e=="object"){e=On(e);var n=bi(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Be(e),Je(this[e]))return this[e](t);return this}function ki(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 kn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ki(t,12);return e+=(t-n)/12,n===1?Ys(e)?29:28:31-n%7%2}H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("M",ye,Dt),Y("MM",ye,Ye),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[lt]=se(e)-1}),pe(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[lt]=i:X(n).invalidMonth=e});var Li="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Rr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pi=rs,Fi=rs;function Di(e,t){return e?Ge(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||kr).test(t)?"format":"standalone"][e.month()]:Ge(this._months)?this._months:this._months.standalone}function Yi(e,t){return e?Ge(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[kr.test(t)?"format":"standalone"][e.month()]:Ge(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ui(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=Ze([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 $i(e,t,n){var r,i,a;if(this._monthsParseExact)return Ui.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Ze([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 Lr(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),!at(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,kn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Pr(e){return e!=null?(Lr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Hi(){return kn(this.year(),this.month())}function Bi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=Pi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Wi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=Fi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Fr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,d,y;for(i=0;i<12;i++)a=Ze([2e3,i]),d=it(this.monthsShort(a,"")),y=it(this.months(a,"")),t.push(d),n.push(y),r.push(y),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 zi(e,t,n,r,i,a,d){var y;return e<100&&e>=0?(y=new Date(e+400,t,n,r,i,a,d),isFinite(y.getFullYear())&&y.setFullYear(e)):y=new Date(e,t,n,r,i,a,d),y}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 Dr(e,t,n,r,i){var a=(7+n-r)%7,d=Us(e,r,i),y=1+7*(t-1)+a+d,o,l;return y<=0?(o=e-1,l=is(o)+y):y>is(e)?(o=e+1,l=y-is(e)):(o=e,l=y),{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+ct(d,t,n)):i>ct(e.year(),t,n)?(a=i-ct(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ct(e,t,n){var r=Us(e,t,n),i=Us(e+1,t,n);return(is(e)-r+i)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),Y("w",ye,Dt),Y("ww",ye,Ye),Y("W",ye,Dt),Y("WW",ye,Ye),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=se(e)});function Gi(e){return cs(e,this._week.dow,this._week.doy).week}var Vi={dow:0,doy:6};function qi(){return this._week.dow}function Ki(){return this._week.doy}function Qi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),Y("d",ye),Y("e",ye),Y("E",ye),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 Ji(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Xi(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ln(e,t){return e.slice(t,7).concat(e.slice(0,t))}var el="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),sl=rs,nl=rs,rl=rs;function al(e,t){var n=Ge(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Ln(n,this._week.dow):e?n[e.day()]:n}function il(e){return e===!0?Ln(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ll(e){return e===!0?Ln(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ol(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=Ze([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 cl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return ol.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Ze([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 dl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Ji(e,this.localeData()),this.add(e-t,"d")):t}function hl(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 ul(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Xi(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ml(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=sl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function fl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function pl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pn(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],i=[],a,d,y,o,l;for(a=0;a<7;a++)d=Ze([2e3,1]).day(a),y=it(this.weekdaysMin(d,"")),o=it(this.weekdaysShort(d,"")),l=it(this.weekdays(d,"")),t.push(y),n.push(o),r.push(l),i.push(y),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 Fn(){return this.hours()%12||12}function yl(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Fn),H("k",["kk",2],0,yl),H("hmm",0,0,function(){return""+Fn.apply(this)+Xe(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Fn.apply(this)+Xe(this.minutes(),2)+Xe(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+Xe(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+Xe(this.minutes(),2)+Xe(this.seconds(),2)});function Ur(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Ur("a",!0),Ur("A",!1);function $r(e,t){return t._meridiemParse}Y("a",$r),Y("A",$r),Y("H",ye,En),Y("h",ye,Dt),Y("k",ye,Dt),Y("HH",ye,Ye),Y("hh",ye,Ye),Y("kk",ye,Ye),Y("hmm",Or),Y("hmmss",Mr),Y("Hmm",Or),Y("Hmmss",Mr),pe(["H","HH"],Ie),pe(["k","kk"],function(e,t,n){var r=se(e);t[Ie]=r===24?0:r}),pe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),pe(["h","hh"],function(e,t,n){t[Ie]=se(e),X(n).bigHour=!0}),pe("hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r)),X(n).bigHour=!0}),pe("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r,2)),t[ot]=se(e.substr(i)),X(n).bigHour=!0}),pe("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r))}),pe("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r,2)),t[ot]=se(e.substr(i))});function gl(e){return(e+"").toLowerCase().charAt(0)==="p"}var xl=/[ap]\.?m?\.?/i,Nl=Yt("Hours",!0);function jl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Hr={calendar:oi,longDateFormat:ui,invalidDate:fi,ordinal:yi,dayOfMonthOrdinalParse:gi,relativeTime:Ni,months:Li,monthsShort:Rr,week:Vi,weekdays:el,weekdaysMin:tl,weekdaysShort:Yr,meridiemParse:xl},xe={},ds={},hs;function vl(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 Br(e){return e&&e.toLowerCase().replace("_","-")}function _l(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Br(e[t]).split("-"),n=a.length,r=Br(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&&vl(a,r)>=n-1)break;n--}t++}return hs}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function $s(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(e))try{t=hs._abbr,n=require,n("./locale/"+e),vt(t)}catch{xe[e]=null}return xe[e]}function vt(e,t){var n;return e&&(ke(t)?n=dt(e):n=Dn(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 Dn(e,t){if(t!==null){var n,r=Hr;if(t.abbr=e,xe[e]!=null)Sr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=$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 xe[e]=new Tn(Sn(r,t)),ds[e]&&ds[e].forEach(function(i){Dn(i.name,i.config)}),vt(e),xe[e]}else return delete xe[e],null}function Sl(e,t){if(t!=null){var n,r,i=Hr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(Sn(xe[e]._config,t)):(r=$s(e),r!=null&&(i=r._config),t=Sn(i,t),r==null&&(t.abbr=e),n=new Tn(t),n.parentLocale=xe[e],xe[e]=n),vt(e)}else xe[e]!=null&&(xe[e].parentLocale!=null?(xe[e]=xe[e].parentLocale,e===vt()&&vt(e)):xe[e]!=null&&delete xe[e]);return xe[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!Ge(e)){if(t=$s(e),t)return t;e=[e]}return _l(e)}function Tl(){return wn(xe)}function Yn(e){var t,n=e._a;return n&&X(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[et]<1||n[et]>kn(n[Me],n[lt])?et:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[qe]!==0||n[ot]!==0||n[It]!==0)?Ie:n[qe]<0||n[qe]>59?qe:n[ot]<0||n[ot]>59?ot:n[It]<0||n[It]>999?It:-1,X(e)._overflowDayOfYear&&(t<Me||t>et)&&(t=et),X(e)._overflowWeeks&&t===-1&&(t=Oi),X(e)._overflowWeekday&&t===-1&&(t=Mi),X(e).overflow=t),e}var wl=/^\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)?)?$/,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=/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]],Un=[["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/]],Ol=/^\/?Date\((-?\d+)/i,Ml=/^(?:(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}))$/,Al={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 Wr(e){var t,n,r=e._i,i=wl.exec(r)||Il.exec(r),a,d,y,o,l=Hs.length,c=Un.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(Un[t][1].exec(i[3])){y=(i[2]||" ")+Un[t][0];break}if(y==null){e._isValid=!1;return}}if(!a&&y!=null){e._isValid=!1;return}if(i[4])if(Cl.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(y||"")+(o||""),Hn(e)}else e._isValid=!1}function El(e,t,n,r,i,a){var d=[Rl(e),Rr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Rl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function kl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ll(e,t,n){if(e){var r=Yr.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 Pl(e,t,n){if(e)return Al[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function zr(e){var t=Ml.exec(kl(e._i)),n;if(t){if(n=El(t[4],t[3],t[2],t[5],t[6],t[7]),!Ll(t[1],n,e))return;e._a=n,e._tzm=Pl(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 Fl(e){var t=Ol.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Wr(e),e._isValid===!1)delete e._isValid;else return;if(zr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=He("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 Dl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function $n(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Dl(e),e._w&&e._a[et]==null&&e._a[lt]==null&&Yl(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[lt]=n.getUTCMonth(),e._a[et]=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[qe]===0&&e._a[ot]===0&&e._a[It]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:zi).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 Yl(e){var t,n,r,i,a,d,y,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(ge(),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(ge(),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>ct(n,a,d)?X(e)._overflowWeeks=!0:o!=null?X(e)._overflowWeekday=!0:(y=Dr(n,r,i,a,d),e._a[Me]=y.year,e._dayOfYear=y.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Hn(e){if(e._f===R.ISO_8601){Wr(e);return}if(e._f===R.RFC_2822){zr(e);return}e._a=[],X(e).empty=!0;var t=""+e._i,n,r,i,a,d,y=t.length,o=0,l,c;for(i=Tr(e._f,e._locale).match(In)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(wi(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),Ci(a,r,e)):e._strict&&!r&&X(e).unusedTokens.push(a);X(e).charsLeftOver=y-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]=Ul(e._locale,e._a[Ie],e._meridiem),l=X(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),$n(e),Yn(e)}function Ul(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 $l(e){var t,n,r,i,a,d,y=!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=bn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Hn(t),vn(t)&&(d=!0),a+=X(t).charsLeftOver,a+=X(t).unusedTokens.length*10,X(t).score=a,y?a<r&&(r=a,n=t):(r==null||a<r||d)&&(r=a,n=t,d&&(y=!0));jt(e,n||t)}function Hl(e){if(!e._d){var t=On(e._i),n=t.day===void 0?t.date:t.day;e._a=jr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),$n(e)}}function Bl(e){var t=new ns(Yn(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,n=e._f;return e._locale=e._locale||dt(e._l),t===null||n===void 0&&t===""?Ms({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ve(t)?new ns(Yn(t)):(ss(t)?e._d=t:Ge(n)?$l(e):n?Hn(e):Wl(e),vn(e)||(e._d=null),e))}function Wl(e){var t=e._i;ke(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Fl(e):Ge(t)?(e._a=jr(t.slice(0),function(n){return parseInt(n,10)}),$n(e)):wt(t)?Hl(e):at(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Vr(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),(wt(e)&&Nn(e)||Ge(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,Bl(a)}function ge(e,t,n,r){return Vr(e,t,n,r,!1)}var zl=He("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Ms()}),Gl=He("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Ms()});function qr(e,t){var n,r;if(t.length===1&&Ge(t[0])&&(t=t[0]),!t.length)return ge();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Vl(){var e=[].slice.call(arguments,0);return qr("isBefore",e)}function ql(){var e=[].slice.call(arguments,0);return qr("isAfter",e)}var Kl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ql(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 Zl(){return this._isValid}function Jl(){return Ke(NaN)}function Bs(e){var t=On(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,y=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Ql(t),this._milliseconds=+c+l*1e3+o*6e4+y*1e3*60*60,this._days=+d+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Ws(e){return e instanceof Bs}function Bn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Xl(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 Kr(e,t){H(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Xe(~~(n/60),2)+t+Xe(~~n%60,2)})}Kr("Z",":"),Kr("ZZ",""),Y("Z",Fs),Y("ZZ",Fs),pe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Wn(Fs,e)});var eo=/([\+\-]|\d\d)/gi;function Wn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(eo)||["-",0,0],a=+(i[1]*60)+se(i[2]),a===0?0:i[0]==="+"?a:-a)}function zn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ve(e)||ss(e)?e.valueOf():ge(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):ge(e).local()}function Gn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function to(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=Wn(Fs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Gn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Xr(this,Ke(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Gn(this)}function so(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function no(e){return this.utcOffset(0,e)}function ro(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gn(this),"m")),this}function ao(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Wn(Si,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function io(e){return this.isValid()?(e=e?ge(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function lo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function oo(){if(!ke(this._isDSTShifted))return this._isDSTShifted;var e={},t;return bn(e,this),e=Gr(e),e._a?(t=e._isUTC?Ze(e._a):ge(e._a),this._isDSTShifted=this.isValid()&&Xl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function co(){return this.isValid()?!this._isUTC:!1}function ho(){return this.isValid()?this._isUTC:!1}function Qr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var uo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,mo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ke(e,t){var n=e,r=null,i,a,d;return Ws(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:at(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=uo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[et])*i,h:se(r[Ie])*i,m:se(r[qe])*i,s:se(r[ot])*i,ms:se(Bn(r[It]*1e3))*i}):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:Ct(r[2],i),M:Ct(r[3],i),w:Ct(r[4],i),d:Ct(r[5],i),h:Ct(r[6],i),m:Ct(r[7],i),s:Ct(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(d=fo(ge(n.from),ge(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}Ke.fn=Bs.prototype,Ke.invalid=Jl;function Ct(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zr(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 fo(e,t){var n;return e.isValid()&&t.isValid()?(t=zn(t,e),e.isBefore(t)?n=Zr(e,t):(n=Zr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Jr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Sr(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=Ke(n,r),Xr(this,i,e),this}}function Xr(e,t,n,r){var i=t._milliseconds,a=Bn(t._days),d=Bn(t._months);e.isValid()&&(r=r??!0,d&&Lr(e,ls(e,"Month")+d*n),a&&Er(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var po=Jr(1,"add"),yo=Jr(-1,"subtract");function ea(e){return typeof e=="string"||e instanceof String}function go(e){return Ve(e)||ss(e)||ea(e)||at(e)||No(e)||xo(e)||e===null||e===void 0}function xo(e){var t=wt(e)&&!Nn(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 No(e){var t=Ge(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&ea(e)}).length===0),t&&n}function jo(e){var t=wt(e)&&!Nn(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 vo(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 _o(e,t){arguments.length===1&&(arguments[0]?go(arguments[0])?(e=arguments[0],t=void 0):jo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ge(),r=zn(n,this).startOf("day"),i=R.calendarFormat(this,r)||"sameElse",a=t&&(Je(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,ge(n)))}function bo(){return new ns(this)}function So(e,t){var n=Ve(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function To(e,t){var n=Ve(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function wo(e,t,n,r){var i=Ve(e)?e:ge(e),a=Ve(t)?t:ge(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 Io(e,t){var n=Ve(e)?e:ge(e),r;return this.isValid()&&n.isValid()?(t=Be(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 Co(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Oo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Mo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=zn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Be(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:We(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 Ao(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Eo(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"):Je(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 Ro(){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 ko(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Es(this,e);return this.localeData().postformat(t)}function Lo(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||ge(e).isValid())?Ke({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Po(e){return this.from(ge(),e)}function Fo(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||ge(e).isValid())?Ke({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.to(ge(),e)}function ta(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var sa=He("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 na(){return this._locale}var Gs=1e3,$t=60*Gs,Vs=60*$t,ra=(365*400+97)*24*Vs;function Ht(e,t){return(e%t+t)%t}function aa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ra:new Date(e,t,n).valueOf()}function ia(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ra:Date.UTC(e,t,n)}function Yo(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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 Uo(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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 $o(){return this._d.valueOf()-(this._offset||0)*6e4}function Ho(){return Math.floor(this.valueOf()/1e3)}function Bo(){return new Date(this.valueOf())}function Wo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function zo(){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 Go(){return this.isValid()?this.toISOString():null}function Vo(){return vn(this)}function qo(){return jt({},X(this))}function Ko(){return X(this).overflow}function Qo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Y("N",Vn),Y("NN",Vn),Y("NNN",Vn),Y("NNNN",lc),Y("NNNNN",oc),pe(["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",cc),pe(["y","yy","yyy","yyyy"],Me),pe(["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 Zo(e,t){var n,r,i,a=this._eras||dt("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=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 Jo(e,t,n){var r,i,a=this.eras(),d,y,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(d=a[r].name.toUpperCase(),y=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(y===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,y,o].indexOf(e)>=0)return a[r]}function Xo(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 ec(){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 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].narrow;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].abbr;return""}function nc(){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 rc(e){return ce(this,"_erasNameRegex")||qn.call(this),e?this._erasNameRegex:this._erasRegex}function ac(e){return ce(this,"_erasAbbrRegex")||qn.call(this),e?this._erasAbbrRegex:this._erasRegex}function ic(e){return ce(this,"_erasNarrowRegex")||qn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vn(e,t){return t.erasAbbrRegex(e)}function lc(e,t){return t.erasNameRegex(e)}function oc(e,t){return t.erasNarrowRegex(e)}function cc(e,t){return t._eraYearOrdinalRegex||Ft}function qn(){var e=[],t=[],n=[],r=[],i,a,d,y,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=it(l[i].name),y=it(l[i].abbr),o=it(l[i].narrow),t.push(d),e.push(y),n.push(o),r.push(d),r.push(y),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")}H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100});function qs(e,t){H(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",ye,Ye),Y("gg",ye,Ye),Y("GGGG",An,Mn),Y("gggg",An,Mn),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 dc(e){return la.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function hc(e){return la.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function uc(){return ct(this.year(),1,4)}function mc(){return ct(this.isoWeekYear(),1,4)}function fc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function pc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function la(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=ct(e,r,i),t>a&&(t=a),yc.call(this,e,t,n,r,i))}function yc(e,t,n,r,i){var a=Dr(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}H("Q",0,"Qo","quarter"),Y("Q",Ir),pe("Q",function(e,t){t[lt]=(se(e)-1)*3});function gc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),Y("D",ye,Dt),Y("DD",ye,Ye),Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],et),pe("Do",function(e,t){t[et]=se(e.match(ye)[0])});var oa=Yt("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",ks),Y("DDDD",Cr),pe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=se(e)});function xc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}H("m",["mm",2],0,"minute"),Y("m",ye,En),Y("mm",ye,Ye),pe(["m","mm"],qe);var Nc=Yt("Minutes",!1);H("s",["ss",2],0,"second"),Y("s",ye,En),Y("ss",ye,Ye),pe(["s","ss"],ot);var jc=Yt("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Y("S",ks,Ir),Y("SS",ks,Ye),Y("SSS",ks,Cr);var _t,ca;for(_t="SSSS";_t.length<=9;_t+="S")Y(_t,Ft);function vc(e,t){t[It]=se(("0."+e)*1e3)}for(_t="S";_t.length<=9;_t+="S")pe(_t,vc);ca=Yt("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function _c(){return this._isUTC?"UTC":""}function bc(){return this._isUTC?"Coordinated Universal Time":""}var E=ns.prototype;E.add=po,E.calendar=_o,E.clone=bo,E.diff=Mo,E.endOf=Uo,E.format=ko,E.from=Lo,E.fromNow=Po,E.to=Fo,E.toNow=Do,E.get=Ei,E.invalidAt=Ko,E.isAfter=So,E.isBefore=To,E.isBetween=wo,E.isSame=Io,E.isSameOrAfter=Co,E.isSameOrBefore=Oo,E.isValid=Vo,E.lang=sa,E.locale=ta,E.localeData=na,E.max=Gl,E.min=zl,E.parsingFlags=qo,E.set=Ri,E.startOf=Yo,E.subtract=yo,E.toArray=Wo,E.toObject=zo,E.toDate=Bo,E.toISOString=Eo,E.inspect=Ro,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Go,E.toString=Ao,E.unix=Ho,E.valueOf=$o,E.creationData=Qo,E.eraName=ec,E.eraNarrow=tc,E.eraAbbr=sc,E.eraYear=nc,E.year=Ar,E.isLeapYear=Ai,E.weekYear=dc,E.isoWeekYear=hc,E.quarter=E.quarters=gc,E.month=Pr,E.daysInMonth=Hi,E.week=E.weeks=Qi,E.isoWeek=E.isoWeeks=Zi,E.weeksInYear=fc,E.weeksInWeekYear=pc,E.isoWeeksInYear=uc,E.isoWeeksInISOWeekYear=mc,E.date=oa,E.day=E.days=dl,E.weekday=hl,E.isoWeekday=ul,E.dayOfYear=xc,E.hour=E.hours=Nl,E.minute=E.minutes=Nc,E.second=E.seconds=jc,E.millisecond=E.milliseconds=ca,E.utcOffset=to,E.utc=no,E.local=ro,E.parseZone=ao,E.hasAlignedHourOffset=io,E.isDST=lo,E.isLocal=co,E.isUtcOffset=ho,E.isUtc=Qr,E.isUTC=Qr,E.zoneAbbr=_c,E.zoneName=bc,E.dates=He("dates accessor is deprecated. Use date instead.",oa),E.months=He("months accessor is deprecated. Use month instead",Pr),E.years=He("years accessor is deprecated. Use year instead",Ar),E.zone=He("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",so),E.isDSTShifted=He("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",oo);function Sc(e){return ge(e*1e3)}function Tc(){return ge.apply(null,arguments).parseZone()}function da(e){return e}var de=Tn.prototype;de.calendar=ci,de.longDateFormat=mi,de.invalidDate=pi,de.ordinal=xi,de.preparse=da,de.postformat=da,de.relativeTime=ji,de.pastFuture=vi,de.set=li,de.eras=Zo,de.erasParse=Jo,de.erasConvertYear=Xo,de.erasAbbrRegex=ac,de.erasNameRegex=rc,de.erasNarrowRegex=ic,de.months=Di,de.monthsShort=Yi,de.monthsParse=$i,de.monthsRegex=Wi,de.monthsShortRegex=Bi,de.week=Gi,de.firstDayOfYear=Ki,de.firstDayOfWeek=qi,de.weekdays=al,de.weekdaysMin=ll,de.weekdaysShort=il,de.weekdaysParse=cl,de.weekdaysRegex=ml,de.weekdaysShortRegex=fl,de.weekdaysMinRegex=pl,de.isPM=gl,de.meridiem=jl;function Ks(e,t,n,r){var i=dt(),a=Ze().set(r,t);return i[n](a,e)}function ha(e,t,n){if(at(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 Kn(e,t,n,r){typeof e=="boolean"?(at(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,at(t)&&(n=t,t=void 0),t=t||"");var i=dt(),a=e?i._week.dow:0,d,y=[];if(n!=null)return Ks(t,(n+a)%7,r,"day");for(d=0;d<7;d++)y[d]=Ks(t,(d+a)%7,r,"day");return y}function wc(e,t){return ha(e,t,"months")}function Ic(e,t){return ha(e,t,"monthsShort")}function Cc(e,t,n){return Kn(e,t,n,"weekdays")}function Oc(e,t,n){return Kn(e,t,n,"weekdaysShort")}function Mc(e,t,n){return Kn(e,t,n,"weekdaysMin")}vt("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=He("moment.lang is deprecated. Use moment.locale instead.",vt),R.langData=He("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Ac(){var e=this._data;return this._milliseconds=ht(this._milliseconds),this._days=ht(this._days),this._months=ht(this._months),e.milliseconds=ht(e.milliseconds),e.seconds=ht(e.seconds),e.minutes=ht(e.minutes),e.hours=ht(e.hours),e.months=ht(e.months),e.years=ht(e.years),this}function ua(e,t,n,r){var i=Ke(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ec(e,t){return ua(this,e,t,1)}function Rc(e,t){return ua(this,e,t,-1)}function ma(e){return e<0?Math.floor(e):Math.ceil(e)}function kc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,d,y,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ma(Qn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=We(e/1e3),r.seconds=i%60,a=We(i/60),r.minutes=a%60,d=We(a/60),r.hours=d%24,t+=We(d/24),o=We(fa(t)),n+=o,t-=ma(Qn(o)),y=We(n/12),n%=12,r.days=t,r.months=n,r.years=y,this}function fa(e){return e*4800/146097}function Qn(e){return e*146097/4800}function Lc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Be(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+fa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Qn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function ut(e){return function(){return this.as(e)}}var pa=ut("ms"),Pc=ut("s"),Fc=ut("m"),Dc=ut("h"),Yc=ut("d"),Uc=ut("w"),$c=ut("M"),Hc=ut("Q"),Bc=ut("y"),Wc=pa;function zc(){return Ke(this)}function Gc(e){return e=Be(e),this.isValid()?this[e+"s"]():NaN}function Ot(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vc=Ot("milliseconds"),qc=Ot("seconds"),Kc=Ot("minutes"),Qc=Ot("hours"),Zc=Ot("days"),Jc=Ot("months"),Xc=Ot("years");function ed(){return We(this.days()/7)}var mt=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function td(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function sd(e,t,n,r){var i=Ke(e).abs(),a=mt(i.as("s")),d=mt(i.as("m")),y=mt(i.as("h")),o=mt(i.as("d")),l=mt(i.as("M")),c=mt(i.as("w")),u=mt(i.as("y")),m=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||d<=1&&["m"]||d<n.m&&["mm",d]||y<=1&&["h"]||y<n.h&&["hh",y]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(m=m||c<=1&&["w"]||c<n.w&&["ww",c]),m=m||l<=1&&["M"]||l<n.M&&["MM",l]||u<=1&&["y"]||["yy",u],m[2]=t,m[3]=+e>0,m[4]=r,td.apply(null,m)}function nd(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function rd(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function ad(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=sd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Zn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Qs(){if(!this.isValid())return this.localeData().invalidDate();var e=Zn(this._milliseconds)/1e3,t=Zn(this._days),n=Zn(this._months),r,i,a,d,y=this.asSeconds(),o,l,c,u;return y?(r=We(e/60),i=We(r/60),e%=60,r%=60,a=We(n/12),n%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=y<0?"-":"",l=Wt(this._months)!==Wt(y)?"-":"",c=Wt(this._days)!==Wt(y)?"-":"",u=Wt(this._milliseconds)!==Wt(y)?"-":"",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=Zl,re.abs=Ac,re.add=Ec,re.subtract=Rc,re.as=Lc,re.asMilliseconds=pa,re.asSeconds=Pc,re.asMinutes=Fc,re.asHours=Dc,re.asDays=Yc,re.asWeeks=Uc,re.asMonths=$c,re.asQuarters=Hc,re.asYears=Bc,re.valueOf=Wc,re._bubble=kc,re.clone=zc,re.get=Gc,re.milliseconds=Vc,re.seconds=qc,re.minutes=Kc,re.hours=Qc,re.days=Zc,re.weeks=ed,re.months=Jc,re.years=Xc,re.humanize=ad,re.toISOString=Qs,re.toString=Qs,re.toJSON=Qs,re.locale=ta,re.localeData=na,re.toIsoString=He("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qs),re.lang=sa,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Ps),Y("X",Ti),pe("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),pe("x",function(e,t,n){n._d=new Date(se(e))});//! moment.js
|
|
39
|
-
R.version="2.30.1",ai(ge),R.fn=E,R.min=Vl,R.max=ql,R.now=Kl,R.utc=Ze,R.unix=Sc,R.months=wc,R.isDate=ss,R.locale=vt,R.invalid=Ms,R.duration=Ke,R.isMoment=Ve,R.weekdays=Cc,R.parseZone=Tc,R.localeData=dt,R.isDuration=Ws,R.monthsShort=Ic,R.weekdaysMin=Mc,R.defineLocale=Dn,R.updateLocale=Sl,R.locales=Tl,R.weekdaysShort=Oc,R.normalizeUnits=Be,R.relativeTimeRounding=nd,R.relativeTimeThreshold=rd,R.calendarFormat=vo,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 bt=(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},Qe=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},id=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},ld=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e),Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Xs={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 od(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(m){if(m<10)return t[m];if(m<20)return n[m-11];{const f=m%10,x=Math.floor(m/10);return`${r[x]}${f?" "+t[f]:""}`}}function a(m){var f=m.toString(),x,b,_,w,T,M,F,O,B,K,te,q,he="and";if(f=f.replace(/[, ]/g,""),parseInt(f)===0)return"zero";for(x=["","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=f.length,M=[];w>0;)T=w,M.push(f.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&&(B=M[K].split("").reverse().map(parseFloat),B[1]===1&&(B[0]+=10),(te=_[K])&&q.push(te),(te=x[B[0]])&&q.push(te),(te=b[B[1]])&&q.push(te),(B[0]||B[1])&&(B[2]||K+1>F)&&q.push(he),(te=x[B[2]])&&q.push(te+" Hundred"));return q.reverse().join(" ")}const[d,y]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(y,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>`${Xs[t].symbol} ${roundAccordingly(e||0,t)}`,U=(e,t)=>`${Xs[t].symbol} ${formatDecimalPlaces(e||0,t)}`,Jn=()=>{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},cd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),Xn=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var y;(y=d.discounts)==null||y.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:cd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},er=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const y=`${d[t]}`;n[y]?(n[y].amt+=d.amt,n[y].taxAmt+=d.taxAmt):n[y]={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)},tr=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 dd(e,t,n,r,i){const a=ms("1",e),d=ms("2",t),y=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,d,y,o,l]);return c.toString("base64")}const hd=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"}),ud=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},Se=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),ft=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fs=Jn(),md=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),y=`${a} hr ${d} min`;return y}else return r},fd=(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 y in e.paymentModes)!r[y]&&e.paymentModes[y]&&(d=a[y],n.push({displayName:d?d.displayName:Qe(y.replace("_"," ")),value:ft(e.paymentModes[y])}));return n},pd=(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 en=(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},sr=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},nr=(e,t)=>{var c;let n,r,i,a,d;const y={},{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"}`,y[r]?(y[r].qty+=n.qty,y[r].sub_total+=n.sub_total):y[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(y)},rr=e=>{var y;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(y=t.taxation)!=null&&y.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}},ar=(e,t,n)=>{var a,d,y,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 en((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=en((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 en((y=t.siteSetting)==null?void 0:y.billPrinters,i,"value");{let l=en((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}}}},yd=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:y,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((_=e.customFeilds)!=null&&_.length){let w=bt(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 ve,W,le;let F=T.station?T.station.split("::"):"",O=F&&F.length>1?F[1]:F[0],B=e.tableNo?e.tableNo.split("::"):null,K=B&&B.length>0?B[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,q;(ve=r==null?void 0:r[w.createdBy])!=null&&ve.name&&(q=r[w.createdBy].name);let he=!1;(y||O&&T.status==l)&&(he=!0),he&&ir(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=y,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+=Se(T.qty),(W=i[O].kotId)==null||W.add(T.kotId),e.externalOrderId||e.offlineOrderId||(le=i[O].orderId)==null||le.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+=Se(T.qty)))})});let u={},m="2INCH";Jn();let f,x=[],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()&&(f=fs=="Android OS"?M:M.value??void 0,m=M.paperSize?M.paperSize:t.printerSize,x.push({printer:f,paperSize:m}))}),x.length==0&&x.push({printer:f,paperSize:t.printerSize||m});for(let M=0;M<T.services.length;M++){let F=T.services[M],O=e.orderList.find(K=>K.subOrderId==F.subOrderId),B=u[F.subOrderId];O&&(B?B.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]=x,x=[],f=null}for(const w in u)Object.hasOwnProperty.call(u,w)&&u[w];return{obj:i,paperSize:m,printer:f,printersMap:b}},gd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",y,o=[],l,c;const u=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let m=bt(e.customFeilds,"INSTRUCTION","customType");m!=null&&m.customValue&&(c=[{customName:m.customName,customValue:m.customValue}])}for(let m=0;m<t.packagingSlipPrinters.length;m++)if(l=t.packagingSlipPrinters[m],l.label==e.subOrderFrom&&(y=fs=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let f,x,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,B=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(f=e.orderList[b],_=0;_<f.services.length;_++)x=f.services[_],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},F=!1,x.status===r&&((a=l.stations)!=null&&a.length?(O=id(l.stations),O[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(w=x.station.split("::")[1],B+=x.qty,M[`${w}/${x.kotId}`]?M[`${w}/${x.kotId}`].push(x):M[`${w}/${x.kotId}`]=[x]);Object.keys(M).length&&(T.services=M,T.totalQty=ft(B),o.push({printer:y,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},xd=(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&&ir(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,m={},f=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],f.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],m[u]=u;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[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&&ir(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:f,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,d=[],y={};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)}y[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:y}},Nd=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:y}=t,o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...B}=i;i={...B,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,m=u?r.aggregator_collection:void 0,f=u?r.zomato_collection:void 0,x=u?r.swiggy_collection:void 0,b=c?md(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const B in O)B.endsWith("collection")?l[ts(B)]=ft(O[B]):l[ts(B)]=O[B]}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 y.toDate!==y.fromDate&&(w=`${tr(y.fromDate)} - ${tr(y.toDate)}`),{salesCollection:c?{...r,totalCollection:ft(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:m,zomato_aggregator_collection:f,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:fd(i,e.paymentModes),totalCollection:ft(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:pd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?ft(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?ft(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?ft(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?ft(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}}},jd=(e,t,n={})=>new Promise(async(r,i)=>{var m,f,x;const{invoiceFormat:d,userData:y}=n;let o,l,c=[],u;try{if((m=e.appliedDiscounts)!=null&&m.length){u=0;for(let V=0;V<e.appliedDiscounts.length;V++)o=e.appliedDiscounts[V],u+=o.discountAmt}const b=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const V=bt(e.customFeilds,"INSTRUCTION","customType");V!=null&&V.customValue&&(c=[{customName:V.customName,customValue:V.customValue}])}o={};let _=(x=t==null?void 0:t.footerAddress)!=null&&x.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={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:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},he=Js(t.curr),ve={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},W=null,le=null;d.companyLogo&&(W=await zt(`https://undefined.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(le=await zt(`https://undefined.s3.amazonaws.com/${d.qrcode.key}`)),e.orderList.filter(V=>{V.services.forEach(async(Z,Ce)=>{var st,nt;let A="kitchen",yt=e.tableName?e.tableName:e.orderFrom;A&&(o[A]||(o[A]={},o[A].station=A,o[A].services=[],o[A].tableName=yt,o[A].customerName=e.name,o[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),o[A].type=e.orderFrom,o[A].orderId=e.orderId,o[A].instruction=e.instruction,o[A].totalQty=0,o[A].tokenId=e.tokenId,o[A].orderSource=e.orderSource,o[A].aggregatorOrderId=e.externalOrderId,o[A].otp=e.otp,o[A].paymentState=e.paymentState,o[A].discountAmt=u,o[A].otherCharges=e.otherCharges,o[A].taxAmt=e.taxAmt,o[A].customFeilds=c,o[A].curr=t.curr??"INR",o[A].zomatoInstant=b),o[A]?(l={serviceName:Z.serviceName,qty:Z.qty,instruction:Z.isUrgent&&Z.instruction?`(URGENT -${Z.instruction})`:Z.instruction?`(${Z.instruction})`:Z.isUrgent?"(URGENT)":"",subOrderId:V.subOrderId,isUrgent:Z.isUrgent,index:Ce},(st=Z.addons)!=null&&st.length&&(l.addons=Z.addons),o[A].services.push(l),o[A].totalQty+=Z.qty):(o[A]=[],o[A].services.push({serviceName:Z.serviceName,qty:Z.qty,instruction:Z.instruction?Z.instruction:"",subOrderId:V.subOrderId,index:Ce}),o[A].totalQty+=Z.qty),o[A]={...o[A],companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},o[A].domain=d.siteURL,o[A].paymentMethods=d.paymentMode?ve.paymentMethods:null,o[A].companyInfo.companyName=d.companyName,o[A].companyInfo.companyEmail=d.email,o[A].companyInfo.companyAddress=d.address,o[A].companyInfo.companyContact=d.mobile,o[A].tokenId=d.token?ve.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(ve.upiId=d.upiId),o[A].gstNo=d.gst?ve.gst:null,o[A].footerMessage=d.footerMessage,o[A].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),o[A].fssai=t.fssai,o[A].vatNo=t.vatNo,o[A].printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,o[A].disabledPoweredBy=t.disabledPoweredBy===!0,o[A].printTime=R().format("DD-MM-YYYY hh:mm A"),o[A].printedBy=y.userRole=="admin"?"Admin":y.name,e.deliveryTimestamp&&(o[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),o[A].itemInstructionOnBill=d.itemInstructionOnBill,o[A]={...o[A],companyLogo:W,companyQrCode:le})})});for(const V in o)if(Object.hasOwnProperty.call(o,V)){const Z=o[V];try{let Ce=t.printerSize??"2inch";r(new Object({obj:new Object({...Z,paperSize:Ce}),orderList:e.orderList}));return}catch(Ce){console.log(Ce)}}}catch(b){console.log("err::",b)}}),vd=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let m=0;m<e[u].orderList.length;m++)t.push(e[u].orderList[m]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let m=0;m<t[u].services.length;m++)t[u].services[m].status!="CANCELLED"&&t[u].services[m].status!="RETURNED"&&t[u].services[m].status!="SHIFTED"&&n.push(t[u].services[m]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let m=0;m<n[u].addons.length;m++){let f={...n[u].addons[m]};f.qty=n[u].qty,i.push(f)}n.forEach(u=>{let{attachedCat:m,serviceId:f}=u;r[m]||(r[m]=[]);let x=r[m].findIndex(b=>b.serviceId===f);x!==-1?r[m][x].qty=r[m][x].qty+u.qty:r[m].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((m,f)=>m.serviceName.localeCompare(f.serviceName));let y={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:m,serviceId:f}=u;o[m]||(o[m]=[]);let x=o[m].findIndex(b=>b.serviceId===f);x!==-1?o[m][x].qty=o[m][x].qty+u.qty:o[m].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((m,f)=>m.serviceName.localeCompare(f.serviceName));return y.Addon=c,y},ya={"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"},ga=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ya[t]?ya[t]:"SGST"},xa=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l,c,u;try{const{invoiceFormat:m,custName:f,custMobile:x,custAddress:b,userData:_={}}=n,{itemList:w}=e,T=void 0;let M=_==null?void 0:_.userRole;if(_.userRole=="admin"?M="ADMIN":M=_==null?void 0:_.name,!(w!=null&&w.length))return;let F=t.printerSize,O=ar(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});F=O?(d=O[0])!=null&&d.paperSize?(y=O[0])==null?void 0:y.paperSize:F||"2INCH":F;let B=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",K=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",te=t.footerAddress.city?t.footerAddress.city:"",q=t.footerAddress.zip?t.footerAddress.zip:"",he=(B!=""?B+",":"")+(K!=""?K+",":"")+(te!=""?te+",":"")+(q!=""?q+",":""),ve=t.gstNo,W={companyName:t.companyName,companyAddress:he,companyContact:t.contactNumber,companyEmail:t.contactEmail},V={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},Z={custName:m&&m.custName?f==t.companyName?null:f:null,custAddress:m&&m.custAddress&&b||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},Ce=Js(t.curr),A={...e,companyInfo:W,orderInfo:V,customerInfo:Z,gst:ve,curr:Ce};if(m){if(A.domain=m.siteURL,A.paymentMethods=m.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=m.companyName,A.companyInfo.companyEmail=m.email,A.companyInfo.companyAddress=m.address,A.companyInfo.companyContact=m.mobile,A.customerInfo.custName=m.custName?f:null,A.tokenId=m.token?A.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(A.upiId=m.upiId),A.gstNo=m.gst?A.gst:null,A.footerMessage=m.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ga(t),A.printOperatorInfo=m.printOperatorInfo===null||m.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=m.itemInstructionOnBill,A.noOfInvoice=m.noOfInvoice,A.printby=M,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let J;for(let _e=0;_e<A.itemList.length;_e++)J=A.itemList[_e],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let yt=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let _e=0;_e<e.customFeilds.length;_e++)J=e.customFeilds[_e],J!=null&&J.customValue&&((u=J.availability)!=null&&u.includes("BILL"))&&yt.push({customName:J.customName,customValue:J.customValue});A.customFields=yt}let st=null,nt=null;m.companyLogo&&(st=await zt(`https://${T}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(nt=await zt(`https://${T}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let rt={};(function(){let J,_e,gt=0,g=0,h=0,I=0,j=0,C=0,D=0,S=0,k=[],$=[],fe=0,Ee;if(F==="A4"||F==="A5"){for(_e=0;_e<w.length;_e++)J=w[_e],g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0),fe+=J.qty;let Pe=Xn(w,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(w);rt={itemList:nr(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(w,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e),qty:fe}}else{for(_e=0;_e<w.length;_e++)J=w[_e],J.taxType==="VAT"?($.push(J),S+=J.sub_total,C+=J.afterdiscAmt,j+=J.afterdiscAmt+(J.total_charges??0),D+=J.afterdiscAmt+(J.total_charges??0)):(k.push(J),g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0));if(k.length){let Pe=Xn(k,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(k);rt.GST={itemList:nr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(k,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e)}}if($.length){let Pe=Xn($,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr($);rt.VAT={itemList:nr($,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er($,"name"),taxation:Ae,subTotal:Se(S),afterDisc:Se(C),afterCharges:Se(j),total:Se(D+$e)}}}})(),A.distributedData=rt;let At={obj:A,companyLogo:st,companyQrCode:nt,paperSize:t.printerSize,Name:a};r(At)}}catch(m){console.log("err",m),i(m)}}),_d=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l;try{const{invoiceFormat:c,custName:u,custMobile:m,custAddress:f,orderData:x}=n,b=void 0;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:x&&x.timestamp?R.unix(x.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:x&&x.orderId?x.orderId:null,timestamp:x.timestamp},q={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&f||null,custContact:c&&c.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},he=Js(t.curr),ve="",W={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he};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=x.subOrderFrom)==null?void 0:d.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ga(t),W.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),x.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(x.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=c.itemInstructionOnBill,W.noOfInvoice=c.noOfInvoice,W.area=x.area,W.captainName=x.captainName,!c.itemInstructionOnBill&&W.itemList){let V;for(let Z=0;Z<W.itemList.length;Z++)V=W.itemList[Z],V.instruction&&delete V.instruction}t.enabledOutstandingOnPay&&((y=e.custoutStandingData)!=null&&y.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let le=[];if((o=x.customFeilds)!=null&&o.length){let V;for(let Z=0;Z<x.customFeilds.length;Z++)V=x.customFeilds[Z],V!=null&&V.customValue&&((l=V.availability)!=null&&l.includes("BILL"))&&le.push({customName:V.customName,customValue:V.customValue});W.customFields=le}if(t&&t.isOld&&t.isOld==!0){let V=null,Z=null;c.companyLogo&&(V=await zt(`https://${b}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(Z=await zt(`https://${b}.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 Ce={obj:W,companyLogo:V,companyQrCode:Z,paperSize:t.printerSize,Name:a};r(Ce)}}}catch(c){console.log("err",c)}}),bd=(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:"",y=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(y!=""?y+",":"")+(o!=""?o+",":""),c=[],u,m=0,f=0,x=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}),m+=u.finalAmount,f+=u.paidAmt,x+=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:Se(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:m,totalPaid:f,totalPayable:x,paperSize:t.printerSize,curr:Js(t.curr),transactions:b})}),Sd=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 xa({...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 _d(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),Na=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},ir=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 Td(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 wd=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ja(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Id(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Cd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function va(e,t={}){const n=t.width||Id(e),r=t.height||Cd(e);return{width:n,height:r}}function Od(){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 Ue=16384;function Md(e){(e.width>Ue||e.height>Ue)&&(e.width>Ue&&e.height>Ue?e.width>e.height?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue):e.width>Ue?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Ad(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ed(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),Ad(i)}const Le=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Le(n,t)};function Rd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function kd(e,t){return ja(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function Ld(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Rd(n):kd(n,r);return document.createTextNode(`${i}{${a}}`)}function _a(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=wd();try{t.className=`${t.className} ${d}`}catch{return}const y=document.createElement("style");y.appendChild(Ld(d,n,i,r)),t.appendChild(y)}function Pd(e,t,n){_a(e,t,":before",n),_a(e,t,":after",n)}const ba="application/font-woff",Sa="image/jpeg",Fd={woff:ba,woff2:ba,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sa,jpeg:Sa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Dd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lr(e){const t=Dd(e).toLowerCase();return Fd[t]||""}function Yd(e){return e.split(/,/)[1]}function or(e){return e.search(/^(data:)/)!==-1}function Ud(e,t){return`data:${t};base64,${e}`}async function Ta(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 y=new FileReader;y.onerror=d,y.onloadend=()=>{try{a(n({res:r,result:y.result}))}catch(o){d(o)}},y.readAsDataURL(i)})}const cr={};function $d(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 dr(e,t,n){const r=$d(e,t,n.includeQueryParams);if(cr[r]!=null)return cr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ta(e,n.fetchRequestInit,({res:d,result:y})=>(t||(t=d.headers.get("Content-Type")||""),Yd(y)));i=Ud(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 cr[r]=i,i}async function Hd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Bd(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 y=a.toDataURL();return sn(y)}const n=e.poster,r=lr(n),i=await dr(n,r,t);return sn(i)}async function Wd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function zd(e,t){return Le(e,HTMLCanvasElement)?Hd(e):Le(e,HTMLVideoElement)?Bd(e,t):Le(e,HTMLIFrameElement)?Wd(e,t):e.cloneNode(wa(e))}const Gd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",wa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vd(e,t,n){var r,i;if(wa(t))return t;let a=[];return Gd(e)&&e.assignedNodes?a=St(e.assignedNodes()):Le(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=St(e.contentDocument.body.childNodes):a=St(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Le(e,HTMLVideoElement)||await a.reduce((d,y)=>d.then(()=>nn(y,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function qd(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):ja(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`),Le(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 Kd(e,t){Le(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Le(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Qd(e,t){if(Le(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Zd(e,t,n){return Le(t,Element)&&(qd(e,t,n),Pd(e,t,n),Kd(e,t),Qd(e,t)),t}async function Jd(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 y=n[a].getAttribute("xlink:href");if(y){const o=e.querySelector(y),l=document.querySelector(y);!o&&l&&!r[y]&&(r[y]=await nn(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 y=document.createElementNS(a,"defs");d.appendChild(y);for(let o=0;o<i.length;o++)y.appendChild(i[o]);e.appendChild(d)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>zd(r,t)).then(r=>Vd(e,r,t)).then(r=>Zd(e,r,t)).then(r=>Jd(r,t))}const Ia=/url\((['"]?)([^'"]+?)\1\)/g,Xd=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function th(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function sh(e){const t=[];return e.replace(Ia,(n,r,i)=>(t.push(i),n)),t.filter(n=>!or(n))}async function nh(e,t,n,r,i){try{const a=n?Td(t,n):t,d=lr(t);let y;return i||(y=await dr(a,d,r)),e.replace(th(t),`$1${y}$3`)}catch{}return e}function rh(e,{preferredFontFormat:t}){return t?e.replace(eh,n=>{for(;;){const[r,,i]=Xd.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ca(e){return e.search(Ia)!==-1}async function Oa(e,t,n){if(!Ca(e))return e;const r=rh(e,n);return sh(r).reduce((a,d)=>a.then(y=>nh(y,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 Oa(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ah(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 ih(e,t){const n=Le(e,HTMLImageElement);if(!(n&&!or(e.src))&&!(Le(e,SVGImageElement)&&!or(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dr(r,lr(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 y=e;y.decode&&(y.decode=a),y.loading==="lazy"&&(y.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function lh(e,t){const r=St(e.childNodes).map(i=>Ma(i,t));await Promise.all(r).then(()=>e)}async function Ma(e,t){Le(e,Element)&&(await ah(e,t),await ih(e,t),await lh(e,t))}function oh(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 Aa={};async function Ea(e){let t=Aa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Aa[e]=t,t}async function Ra(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let y=d.replace(r,"$1");return y.startsWith("https://")||(y=new URL(y,e.url).href),Ta(y,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function ka(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]*?)})",y=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=y.exec(r),o===null)break;a.lastIndex=y.lastIndex}else y.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ch(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let y=d+1;const o=a.href,l=Ea(o).then(c=>Ra(c,t)).then(c=>ka(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?y+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:u,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(y=>y.href==null)||document.styleSheets[0];i.href!=null&&r.push(Ea(i.href).then(y=>Ra(y,t)).then(y=>ka(y).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(y=>{console.error("Error loading remote stylesheet",y)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function dh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ca(t.style.getPropertyValue("src")))}async function hh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ch(n,t);return dh(r)}function La(e){return e.trim().replace(/["']/g,"")}function uh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(La(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function mh(e,t){const n=await hh(e,t),r=uh(e);return(await Promise.all(n.filter(a=>r.has(La(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oa(a.cssText,d,t)}))).join(`
|
|
40
|
-
`)}async function fh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await mh(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 Pa(e,t={}){const{width:n,height:r}=va(e,t),i=await nn(e,t,!0);return await fh(i,t),await Ma(i,t),oh(i,t),await Ed(i,n,r)}async function ph(e,t={}){const{width:n,height:r}=va(e,t),i=await Pa(e,t),a=await sn(i),d=document.createElement("canvas"),
|
|
38
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var br={};function Sr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),br[e]||(_r(t),br[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 li(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 Sn(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 Tn(e){e!=null&&this.set(e)}var wn;Object.keys?wn=Object.keys:wn=function(e){var t,n=[];for(t in e)ce(e,t)&&n.push(t);return n};var oi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ci(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 In=/(\[[^\[]*\])|(\\)?([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,Cn={},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 di(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function hi(e){var t=e.match(In),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=di(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=Tr(t,e.localeData()),Cn[t]=Cn[t]||hi(t),Cn[t](e)):e.localeData().invalidDate()}function Tr(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 ui={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 mi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(In).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var fi="Invalid date";function pi(){return this._invalidDate}var yi="%d",gi=/\d{1,2}/;function xi(e){return this._ordinal.replace("%d",e)}var Ni={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 ji(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function vi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var wr={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"?wr[e]||wr[e.toLowerCase()]:void 0}function On(e){var t={},n,r;for(r in e)ce(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var _i={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 bi(e){var t=[],n;for(n in e)ce(e,n)&&t.push({unit:n,priority:_i[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Ir=/\d/,De=/\d\d/,Cr=/\d{3}/,Mn=/\d{4}/,Rs=/[+-]?\d{6}/,pe=/\d\d?/,Or=/\d\d\d\d?/,Mr=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,An=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,Ps=/[+-]?\d+/,Si=/Z|[+-]\d\d:?\d\d/gi,Fs=/Z|[+-]\d\d(?::?\d\d)?/gi,Ti=/[+-]?\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?/,En=/^([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 wi(e,t){return ce(Ds,e)?Ds[e](t._strict,t._locale):new RegExp(Ii(e))}function Ii(e){return rt(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function rt(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 Rn={};function me(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),nt(t)&&(r=function(a,d){d[t]=se(a)}),i=e.length,n=0;n<i;n++)Rn[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 Ci(e,t,n){t!=null&&ce(Rn,e)&&Rn[e](t,n._a,n,e)}function Ys(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,at=1,Xe=2,Ie=3,Ve=4,it=5,wt=6,Oi=7,Mi=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",An,Mn),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 Ar=Yt("FullYear",!0);function Ai(){return Ys(this.year())}function Yt(e,t){return function(n){return n!=null?(Er(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 Er(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 Ei(e){return e=$e(e),Ze(this[e])?this[e]():this}function Ri(e,t){if(typeof e=="object"){e=On(e);var n=bi(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 ki(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 kn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ki(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[at]=se(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[at]=i:X(n).invalidMonth=e});var Li="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Rr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pi=rs,Fi=rs;function Di(e,t){return e?ze(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||kr).test(t)?"format":"standalone"][e.month()]:ze(this._months)?this._months:this._months.standalone}function Yi(e,t){return e?ze(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[kr.test(t)?"format":"standalone"][e.month()]:ze(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ui(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 $i(e,t,n){var r,i,a;if(this._monthsParseExact)return Ui.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 Lr(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),!nt(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,kn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Pr(e){return e!=null?(Lr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Hi(){return kn(this.year(),this.month())}function Bi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=Pi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Wi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=Fi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Fr(){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=rt(this.monthsShort(a,"")),m=rt(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 zi(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 Dr(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+lt(d,t,n)):i>lt(e.year(),t,n)?(a=i-lt(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function lt(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 Gi(e){return cs(e,this._week.dow,this._week.doy).week}var Vi={dow:0,doy:6};function qi(){return this._week.dow}function Ki(){return this._week.doy}function Qi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(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 Ji(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Xi(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ln(e,t){return e.slice(t,7).concat(e.slice(0,t))}var el="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),sl=rs,nl=rs,rl=rs;function al(e,t){var n=ze(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Ln(n,this._week.dow):e?n[e.day()]:n}function il(e){return e===!0?Ln(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ll(e){return e===!0?Ln(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ol(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 cl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return ol.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 dl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Ji(e,this.localeData()),this.add(e-t,"d")):t}function hl(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 ul(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Xi(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ml(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=sl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function fl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function pl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pn(){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=rt(this.weekdaysMin(d,"")),o=rt(this.weekdaysShort(d,"")),l=rt(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 Fn(){return this.hours()%12||12}function yl(){return this.hours()||24}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Fn),B("k",["kk",2],0,yl),B("hmm",0,0,function(){return""+Fn.apply(this)+Je(this.minutes(),2)}),B("hmmss",0,0,function(){return""+Fn.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 Ur(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Ur("a",!0),Ur("A",!1);function $r(e,t){return t._meridiemParse}Y("a",$r),Y("A",$r),Y("H",pe,En),Y("h",pe,Dt),Y("k",pe,Dt),Y("HH",pe,De),Y("hh",pe,De),Y("kk",pe,De),Y("hmm",Or),Y("hmmss",Mr),Y("Hmm",Or),Y("Hmmss",Mr),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[it]=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[it]=se(e.substr(i))});function gl(e){return(e+"").toLowerCase().charAt(0)==="p"}var xl=/[ap]\.?m?\.?/i,Nl=Yt("Hours",!0);function jl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Hr={calendar:oi,longDateFormat:ui,invalidDate:fi,ordinal:yi,dayOfMonthOrdinalParse:gi,relativeTime:Ni,months:Li,monthsShort:Rr,week:Vi,weekdays:el,weekdaysMin:tl,weekdaysShort:Yr,meridiemParse:xl},ge={},ds={},hs;function vl(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 Br(e){return e&&e.toLowerCase().replace("_","-")}function _l(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Br(e[t]).split("-"),n=a.length,r=Br(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&&vl(a,r)>=n-1)break;n--}t++}return hs}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function $s(e){var t=null,n;if(ge[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(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=ot(e):n=Dn(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 Dn(e,t){if(t!==null){var n,r=Hr;if(t.abbr=e,ge[e]!=null)Sr("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 Tn(Sn(r,t)),ds[e]&&ds[e].forEach(function(i){Dn(i.name,i.config)}),jt(e),ge[e]}else return delete ge[e],null}function Sl(e,t){if(t!=null){var n,r,i=Hr;ge[e]!=null&&ge[e].parentLocale!=null?ge[e].set(Sn(ge[e]._config,t)):(r=$s(e),r!=null&&(i=r._config),t=Sn(i,t),r==null&&(t.abbr=e),n=new Tn(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 ot(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 _l(e)}function Tl(){return wn(ge)}function Yn(e){var t,n=e._a;return n&&X(e).overflow===-2&&(t=n[at]<0||n[at]>11?at:n[Xe]<1||n[Xe]>kn(n[Me],n[at])?Xe:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[Ve]!==0||n[it]!==0||n[wt]!==0)?Ie:n[Ve]<0||n[Ve]>59?Ve:n[it]<0||n[it]>59?it:n[wt]<0||n[wt]>999?wt:-1,X(e)._overflowDayOfYear&&(t<Me||t>Xe)&&(t=Xe),X(e)._overflowWeeks&&t===-1&&(t=Oi),X(e)._overflowWeekday&&t===-1&&(t=Mi),X(e).overflow=t),e}var wl=/^\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)?)?$/,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=/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]],Un=[["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/]],Ol=/^\/?Date\((-?\d+)/i,Ml=/^(?:(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}))$/,Al={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 Wr(e){var t,n,r=e._i,i=wl.exec(r)||Il.exec(r),a,d,m,o,l=Hs.length,c=Un.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(Un[t][1].exec(i[3])){m=(i[2]||" ")+Un[t][0];break}if(m==null){e._isValid=!1;return}}if(!a&&m!=null){e._isValid=!1;return}if(i[4])if(Cl.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(m||"")+(o||""),Hn(e)}else e._isValid=!1}function El(e,t,n,r,i,a){var d=[Rl(e),Rr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Rl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function kl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ll(e,t,n){if(e){var r=Yr.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 Pl(e,t,n){if(e)return Al[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function zr(e){var t=Ml.exec(kl(e._i)),n;if(t){if(n=El(t[4],t[3],t[2],t[5],t[6],t[7]),!Ll(t[1],n,e))return;e._a=n,e._tzm=Pl(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 Fl(e){var t=Ol.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Wr(e),e._isValid===!1)delete e._isValid;else return;if(zr(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 Dl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function $n(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Dl(e),e._w&&e._a[Xe]==null&&e._a[at]==null&&Yl(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[at]=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[it]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:zi).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 Yl(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>lt(n,a,d)?X(e)._overflowWeeks=!0:o!=null?X(e)._overflowWeekday=!0:(m=Dr(n,r,i,a,d),e._a[Me]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Hn(e){if(e._f===R.ISO_8601){Wr(e);return}if(e._f===R.RFC_2822){zr(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=Tr(e._f,e._locale).match(In)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(wi(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),Ci(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]=Ul(e._locale,e._a[Ie],e._meridiem),l=X(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),$n(e),Yn(e)}function Ul(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 $l(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=bn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Hn(t),vn(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 Hl(e){if(!e._d){var t=On(e._i),n=t.day===void 0?t.date:t.day;e._a=jr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),$n(e)}}function Bl(e){var t=new ns(Yn(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,n=e._f;return e._locale=e._locale||ot(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(Yn(t)):(ss(t)?e._d=t:ze(n)?$l(e):n?Hn(e):Wl(e),vn(e)||(e._d=null),e))}function Wl(e){var t=e._i;Re(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Fl(e):ze(t)?(e._a=jr(t.slice(0),function(n){return parseInt(n,10)}),$n(e)):Tt(t)?Hl(e):nt(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Vr(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)&&Nn(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,Bl(a)}function ye(e,t,n,r){return Vr(e,t,n,r,!1)}var zl=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()}),Gl=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 qr(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 Vl(){var e=[].slice.call(arguments,0);return qr("isBefore",e)}function ql(){var e=[].slice.call(arguments,0);return qr("isAfter",e)}var Kl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ql(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 Zl(){return this._isValid}function Jl(){return qe(NaN)}function Bs(e){var t=On(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=Ql(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=ot(),this._bubble()}function Ws(e){return e instanceof Bs}function Bn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Xl(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 Kr(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)})}Kr("Z",":"),Kr("ZZ",""),Y("Z",Fs),Y("ZZ",Fs),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Wn(Fs,e)});var eo=/([\+\-]|\d\d)/gi;function Wn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(eo)||["-",0,0],a=+(i[1]*60)+se(i[2]),a===0?0:i[0]==="+"?a:-a)}function zn(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 Gn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function to(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=Wn(Fs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Gn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Xr(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:Gn(this)}function so(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function no(e){return this.utcOffset(0,e)}function ro(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gn(this),"m")),this}function ao(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Wn(Si,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function io(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function lo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function oo(){if(!Re(this._isDSTShifted))return this._isDSTShifted;var e={},t;return bn(e,this),e=Gr(e),e._a?(t=e._isUTC?Qe(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&Xl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function co(){return this.isValid()?!this._isUTC:!1}function ho(){return this.isValid()?this._isUTC:!1}function Qr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var uo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,mo=/^(-|\+)?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}:nt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=uo.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[it])*i,ms:se(Bn(r[wt]*1e3))*i}):(r=mo.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=fo(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=Jl;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zr(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 fo(e,t){var n;return e.isValid()&&t.isValid()?(t=zn(t,e),e.isBefore(t)?n=Zr(e,t):(n=Zr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Jr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Sr(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),Xr(this,i,e),this}}function Xr(e,t,n,r){var i=t._milliseconds,a=Bn(t._days),d=Bn(t._months);e.isValid()&&(r=r??!0,d&&Lr(e,ls(e,"Month")+d*n),a&&Er(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var po=Jr(1,"add"),yo=Jr(-1,"subtract");function ea(e){return typeof e=="string"||e instanceof String}function go(e){return Ge(e)||ss(e)||ea(e)||nt(e)||No(e)||xo(e)||e===null||e===void 0}function xo(e){var t=Tt(e)&&!Nn(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 No(e){var t=ze(e),n=!1;return t&&(n=e.filter(function(r){return!nt(r)&&ea(e)}).length===0),t&&n}function jo(e){var t=Tt(e)&&!Nn(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 vo(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 _o(e,t){arguments.length===1&&(arguments[0]?go(arguments[0])?(e=arguments[0],t=void 0):jo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=zn(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 bo(){return new ns(this)}function So(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 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():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function wo(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 Io(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 Co(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Oo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Mo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=zn(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 Ao(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Eo(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 Ro(){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 ko(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Es(this,e);return this.localeData().postformat(t)}function Lo(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 Po(e){return this.from(ye(),e)}function Fo(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 Do(e){return this.to(ye(),e)}function ta(e){var t;return e===void 0?this._locale._abbr:(t=ot(e),t!=null&&(this._locale=t),this)}var sa=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 na(){return this._locale}var Gs=1e3,$t=60*Gs,Vs=60*$t,ra=(365*400+97)*24*Vs;function Ht(e,t){return(e%t+t)%t}function aa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ra:new Date(e,t,n).valueOf()}function ia(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ra:Date.UTC(e,t,n)}function Yo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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 Uo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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 $o(){return this._d.valueOf()-(this._offset||0)*6e4}function Ho(){return Math.floor(this.valueOf()/1e3)}function Bo(){return new Date(this.valueOf())}function Wo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function zo(){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 Go(){return this.isValid()?this.toISOString():null}function Vo(){return vn(this)}function qo(){return Nt({},X(this))}function Ko(){return X(this).overflow}function Qo(){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",Vn),Y("NN",Vn),Y("NNN",Vn),Y("NNNN",lc),Y("NNNNN",oc),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",cc),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 Zo(e,t){var n,r,i,a=this._eras||ot("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 Jo(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 Xo(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 ec(){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 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].narrow;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].abbr;return""}function nc(){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 rc(e){return ce(this,"_erasNameRegex")||qn.call(this),e?this._erasNameRegex:this._erasRegex}function ac(e){return ce(this,"_erasAbbrRegex")||qn.call(this),e?this._erasAbbrRegex:this._erasRegex}function ic(e){return ce(this,"_erasNarrowRegex")||qn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vn(e,t){return t.erasAbbrRegex(e)}function lc(e,t){return t.erasNameRegex(e)}function oc(e,t){return t.erasNarrowRegex(e)}function cc(e,t){return t._eraYearOrdinalRegex||Ft}function qn(){var e=[],t=[],n=[],r=[],i,a,d,m,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=rt(l[i].name),m=rt(l[i].abbr),o=rt(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",An,Mn),Y("gggg",An,Mn),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 dc(e){return la.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function hc(e){return la.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function uc(){return lt(this.year(),1,4)}function mc(){return lt(this.isoWeekYear(),1,4)}function fc(){var e=this.localeData()._week;return lt(this.year(),e.dow,e.doy)}function pc(){var e=this.localeData()._week;return lt(this.weekYear(),e.dow,e.doy)}function la(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=lt(e,r,i),t>a&&(t=a),yc.call(this,e,t,n,r,i))}function yc(e,t,n,r,i){var a=Dr(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",Ir),me("Q",function(e,t){t[at]=(se(e)-1)*3});function gc(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 oa=Yt("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",ks),Y("DDDD",Cr),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=se(e)});function xc(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,En),Y("mm",pe,De),me(["m","mm"],Ve);var Nc=Yt("Minutes",!1);B("s",["ss",2],0,"second"),Y("s",pe,En),Y("ss",pe,De),me(["s","ss"],it);var jc=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,Ir),Y("SS",ks,De),Y("SSS",ks,Cr);var vt,ca;for(vt="SSSS";vt.length<=9;vt+="S")Y(vt,Ft);function vc(e,t){t[wt]=se(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,vc);ca=Yt("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");function _c(){return this._isUTC?"UTC":""}function bc(){return this._isUTC?"Coordinated Universal Time":""}var E=ns.prototype;E.add=po,E.calendar=_o,E.clone=bo,E.diff=Mo,E.endOf=Uo,E.format=ko,E.from=Lo,E.fromNow=Po,E.to=Fo,E.toNow=Do,E.get=Ei,E.invalidAt=Ko,E.isAfter=So,E.isBefore=To,E.isBetween=wo,E.isSame=Io,E.isSameOrAfter=Co,E.isSameOrBefore=Oo,E.isValid=Vo,E.lang=sa,E.locale=ta,E.localeData=na,E.max=Gl,E.min=zl,E.parsingFlags=qo,E.set=Ri,E.startOf=Yo,E.subtract=yo,E.toArray=Wo,E.toObject=zo,E.toDate=Bo,E.toISOString=Eo,E.inspect=Ro,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Go,E.toString=Ao,E.unix=Ho,E.valueOf=$o,E.creationData=Qo,E.eraName=ec,E.eraNarrow=tc,E.eraAbbr=sc,E.eraYear=nc,E.year=Ar,E.isLeapYear=Ai,E.weekYear=dc,E.isoWeekYear=hc,E.quarter=E.quarters=gc,E.month=Pr,E.daysInMonth=Hi,E.week=E.weeks=Qi,E.isoWeek=E.isoWeeks=Zi,E.weeksInYear=fc,E.weeksInWeekYear=pc,E.isoWeeksInYear=uc,E.isoWeeksInISOWeekYear=mc,E.date=oa,E.day=E.days=dl,E.weekday=hl,E.isoWeekday=ul,E.dayOfYear=xc,E.hour=E.hours=Nl,E.minute=E.minutes=Nc,E.second=E.seconds=jc,E.millisecond=E.milliseconds=ca,E.utcOffset=to,E.utc=no,E.local=ro,E.parseZone=ao,E.hasAlignedHourOffset=io,E.isDST=lo,E.isLocal=co,E.isUtcOffset=ho,E.isUtc=Qr,E.isUTC=Qr,E.zoneAbbr=_c,E.zoneName=bc,E.dates=Ue("dates accessor is deprecated. Use date instead.",oa),E.months=Ue("months accessor is deprecated. Use month instead",Pr),E.years=Ue("years accessor is deprecated. Use year instead",Ar),E.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",so),E.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",oo);function Sc(e){return ye(e*1e3)}function Tc(){return ye.apply(null,arguments).parseZone()}function da(e){return e}var de=Tn.prototype;de.calendar=ci,de.longDateFormat=mi,de.invalidDate=pi,de.ordinal=xi,de.preparse=da,de.postformat=da,de.relativeTime=ji,de.pastFuture=vi,de.set=li,de.eras=Zo,de.erasParse=Jo,de.erasConvertYear=Xo,de.erasAbbrRegex=ac,de.erasNameRegex=rc,de.erasNarrowRegex=ic,de.months=Di,de.monthsShort=Yi,de.monthsParse=$i,de.monthsRegex=Wi,de.monthsShortRegex=Bi,de.week=Gi,de.firstDayOfYear=Ki,de.firstDayOfWeek=qi,de.weekdays=al,de.weekdaysMin=ll,de.weekdaysShort=il,de.weekdaysParse=cl,de.weekdaysRegex=ml,de.weekdaysShortRegex=fl,de.weekdaysMinRegex=pl,de.isPM=gl,de.meridiem=jl;function Ks(e,t,n,r){var i=ot(),a=Qe().set(r,t);return i[n](a,e)}function ha(e,t,n){if(nt(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 Kn(e,t,n,r){typeof e=="boolean"?(nt(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,nt(t)&&(n=t,t=void 0),t=t||"");var i=ot(),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 wc(e,t){return ha(e,t,"months")}function Ic(e,t){return ha(e,t,"monthsShort")}function Cc(e,t,n){return Kn(e,t,n,"weekdays")}function Oc(e,t,n){return Kn(e,t,n,"weekdaysShort")}function Mc(e,t,n){return Kn(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.",ot);var ct=Math.abs;function Ac(){var e=this._data;return this._milliseconds=ct(this._milliseconds),this._days=ct(this._days),this._months=ct(this._months),e.milliseconds=ct(e.milliseconds),e.seconds=ct(e.seconds),e.minutes=ct(e.minutes),e.hours=ct(e.hours),e.months=ct(e.months),e.years=ct(e.years),this}function ua(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 Ec(e,t){return ua(this,e,t,1)}function Rc(e,t){return ua(this,e,t,-1)}function ma(e){return e<0?Math.floor(e):Math.ceil(e)}function kc(){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+=ma(Qn(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(fa(t)),n+=o,t-=ma(Qn(o)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function fa(e){return e*4800/146097}function Qn(e){return e*146097/4800}function Lc(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+fa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Qn(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 dt(e){return function(){return this.as(e)}}var pa=dt("ms"),Pc=dt("s"),Fc=dt("m"),Dc=dt("h"),Yc=dt("d"),Uc=dt("w"),$c=dt("M"),Hc=dt("Q"),Bc=dt("y"),Wc=pa;function zc(){return qe(this)}function Gc(e){return e=$e(e),this.isValid()?this[e+"s"]():NaN}function Ct(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vc=Ct("milliseconds"),qc=Ct("seconds"),Kc=Ct("minutes"),Qc=Ct("hours"),Zc=Ct("days"),Jc=Ct("months"),Xc=Ct("years");function ed(){return He(this.days()/7)}var ht=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function td(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function sd(e,t,n,r){var i=qe(e).abs(),a=ht(i.as("s")),d=ht(i.as("m")),m=ht(i.as("h")),o=ht(i.as("d")),l=ht(i.as("M")),c=ht(i.as("w")),u=ht(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,td.apply(null,f)}function nd(e){return e===void 0?ht:typeof e=="function"?(ht=e,!0):!1}function rd(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function ad(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=sd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Zn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Qs(){if(!this.isValid())return this.localeData().invalidDate();var e=Zn(this._milliseconds)/1e3,t=Zn(this._days),n=Zn(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=Zl,re.abs=Ac,re.add=Ec,re.subtract=Rc,re.as=Lc,re.asMilliseconds=pa,re.asSeconds=Pc,re.asMinutes=Fc,re.asHours=Dc,re.asDays=Yc,re.asWeeks=Uc,re.asMonths=$c,re.asQuarters=Hc,re.asYears=Bc,re.valueOf=Wc,re._bubble=kc,re.clone=zc,re.get=Gc,re.milliseconds=Vc,re.seconds=qc,re.minutes=Kc,re.hours=Qc,re.days=Zc,re.weeks=ed,re.months=Jc,re.years=Xc,re.humanize=ad,re.toISOString=Qs,re.toString=Qs,re.toJSON=Qs,re.locale=ta,re.localeData=na,re.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qs),re.lang=sa,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Y("x",Ps),Y("X",Ti),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",ai(ye),R.fn=E,R.min=Vl,R.max=ql,R.now=Kl,R.utc=Qe,R.unix=Sc,R.months=wc,R.isDate=ss,R.locale=jt,R.invalid=Ms,R.duration=qe,R.isMoment=Ge,R.weekdays=Cc,R.parseZone=Tc,R.localeData=ot,R.isDuration=Ws,R.monthsShort=Ic,R.weekdaysMin=Mc,R.defineLocale=Dn,R.updateLocale=Sl,R.locales=Tl,R.weekdaysShort=Oc,R.normalizeUnits=$e,R.relativeTimeRounding=nd,R.relativeTimeThreshold=rd,R.calendarFormat=vo,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},id=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},ld=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e),Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Xs={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 od(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)=>`${Xs[t].symbol} ${roundAccordingly(e||0,t)}`,U=(e,t)=>`${Xs[t].symbol} ${formatDecimalPlaces(e||0,t)}`,Jn=()=>{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},cd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),Xn=(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:cd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},er=(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)},tr=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 dd(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 hd=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"}),ud=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},_e=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),ut=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fs=Jn(),md=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},fd=(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:ut(e.paymentModes[m])}));return n},pd=(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 en=(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},sr=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},nr=(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)},rr=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}},ar=(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 en((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=en((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 en((m=t.siteSetting)==null?void 0:m.billPrinters,i,"value");{let l=en((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}}}},yd=(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&&ir(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+=_e(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+=_e(T.qty)))})});let u={},f="2INCH";Jn();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}},gd=(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=id(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=ut(G),o.push({printer:m,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},xd=(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&&ir(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&&ir(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}},Nd=(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?md(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)]=ut(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=`${tr(m.fromDate)} - ${tr(m.toDate)}`),{salesCollection:c?{...r,totalCollection:ut(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:fd(i,e.paymentModes),totalCollection:ut(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:pd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?ut(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?ut(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?ut(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?ut(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}}},jd=(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=Js(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 tt,st;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},(tt=V.addons)!=null&&tt.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=(st=e.subOrderFrom)==null?void 0:st.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)}}),vd=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},ya={"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"},ga=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ya[t]?ya[t]:"SGST"},xa=(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=ar(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=Js(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=ga(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 tt=null,st=null;f.companyLogo&&(tt=await zt(`https://${f.companyLogo.bucket}.s3.amazonaws.com/${f.companyLogo.key}`)),f.qrcode&&(st=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=Xn(w,"discountName",{separateItemsDisc:!0});const Le=sr(Te);let{obj:Pe,sum:Ae}=rr(w);ft={itemList:nr(w,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:er(w,"name"),taxation:Pe,subTotal:_e(yt),afterDisc:_e(x),afterCharges:_e(h),total:_e(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=Xn(S,"discountName",{separateItemsDisc:!0});const Le=sr(Te);let{obj:Pe,sum:Ae}=rr(S);ft.GST={itemList:nr(S,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:er(S,"name"),taxation:Pe,subTotal:_e(yt),afterDisc:_e(x),afterCharges:_e(h),total:_e(pt+Ae)}}if(k.length){let Te=Xn(k,"discountName",{separateItemsDisc:!0});const Le=sr(Te);let{obj:Pe,sum:Ae}=rr(k);ft.VAT={itemList:nr(k,{itemInstructionOnBill:f.itemInstructionOnBill,printZeroPriceAddons:f.printZeroPriceAddons}),discounts:Le,charges:er(k,"name"),taxation:Pe,subTotal:_e(D),afterDisc:_e(j),afterCharges:_e(C),total:_e(I+Ae)}}}})(),A.distributedData=ft;let Mt={obj:A,companyLogo:tt,companyQrCode:st,paperSize:t.printerSize,Name:a};r(Mt)}}catch(f){console.log("err",f),i(f)}}),_d=(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=Js(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=ga(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)}}),bd=(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:_e(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:Js(t.curr),transactions:b})}),Sd=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 xa({...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 _d(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),Na=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},ir=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 Td(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 wd=(()=>{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 ja(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=bt(window.getComputedStyle(document.documentElement)),Gt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Id(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Cd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function va(e,t={}){const n=t.width||Id(e),r=t.height||Cd(e);return{width:n,height:r}}function Od(){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 Md(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 sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Ad(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ed(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),Ad(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 Rd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function kd(e,t){return ja(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function Ld(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Rd(n):kd(n,r);return document.createTextNode(`${i}{${a}}`)}function _a(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=wd();try{t.className=`${t.className} ${d}`}catch{return}const m=document.createElement("style");m.appendChild(Ld(d,n,i,r)),t.appendChild(m)}function Pd(e,t,n){_a(e,t,":before",n),_a(e,t,":after",n)}const ba="application/font-woff",Sa="image/jpeg",Fd={woff:ba,woff2:ba,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sa,jpeg:Sa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Dd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lr(e){const t=Dd(e).toLowerCase();return Fd[t]||""}function Yd(e){return e.split(/,/)[1]}function or(e){return e.search(/^(data:)/)!==-1}function Ud(e,t){return`data:${t};base64,${e}`}async function Ta(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 cr={};function $d(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 dr(e,t,n){const r=$d(e,t,n.includeQueryParams);if(cr[r]!=null)return cr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ta(e,n.fetchRequestInit,({res:d,result:m})=>(t||(t=d.headers.get("Content-Type")||""),Yd(m)));i=Ud(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 cr[r]=i,i}async function Hd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Bd(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 sn(m)}const n=e.poster,r=lr(n),i=await dr(n,r,t);return sn(i)}async function Wd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function zd(e,t){return ke(e,HTMLCanvasElement)?Hd(e):ke(e,HTMLVideoElement)?Bd(e,t):ke(e,HTMLIFrameElement)?Wd(e,t):e.cloneNode(wa(e))}const Gd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",wa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vd(e,t,n){var r,i;if(wa(t))return t;let a=[];return Gd(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(()=>nn(m,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function qd(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):ja(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 Kd(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Qd(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 Zd(e,t,n){return ke(t,Element)&&(qd(e,t,n),Pd(e,t,n),Kd(e,t),Qd(e,t)),t}async function Jd(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 nn(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 nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>zd(r,t)).then(r=>Vd(e,r,t)).then(r=>Zd(e,r,t)).then(r=>Jd(r,t))}const Ia=/url\((['"]?)([^'"]+?)\1\)/g,Xd=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function th(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function sh(e){const t=[];return e.replace(Ia,(n,r,i)=>(t.push(i),n)),t.filter(n=>!or(n))}async function nh(e,t,n,r,i){try{const a=n?Td(t,n):t,d=lr(t);let m;return i||(m=await dr(a,d,r)),e.replace(th(t),`$1${m}$3`)}catch{}return e}function rh(e,{preferredFontFormat:t}){return t?e.replace(eh,n=>{for(;;){const[r,,i]=Xd.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ca(e){return e.search(Ia)!==-1}async function Oa(e,t,n){if(!Ca(e))return e;const r=rh(e,n);return sh(r).reduce((a,d)=>a.then(m=>nh(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 Oa(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ah(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 ih(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!or(e.src))&&!(ke(e,SVGImageElement)&&!or(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dr(r,lr(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 lh(e,t){const r=bt(e.childNodes).map(i=>Ma(i,t));await Promise.all(r).then(()=>e)}async function Ma(e,t){ke(e,Element)&&(await ah(e,t),await ih(e,t),await lh(e,t))}function oh(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 Aa={};async function Ea(e){let t=Aa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Aa[e]=t,t}async function Ra(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),Ta(m,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function ka(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 ch(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=Ea(o).then(c=>Ra(c,t)).then(c=>ka(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(Ea(i.href).then(m=>Ra(m,t)).then(m=>ka(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 dh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ca(t.style.getPropertyValue("src")))}async function hh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=bt(e.ownerDocument.styleSheets),r=await ch(n,t);return dh(r)}function La(e){return e.trim().replace(/["']/g,"")}function uh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(La(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function mh(e,t){const n=await hh(e,t),r=uh(e);return(await Promise.all(n.filter(a=>r.has(La(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oa(a.cssText,d,t)}))).join(`
|
|
40
|
+
`)}async function fh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await mh(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 Pa(e,t={}){const{width:n,height:r}=va(e,t),i=await nn(e,t,!0);return await fh(i,t),await Ma(i,t),oh(i,t),await Ed(i,n,r)}async function ph(e,t={}){const{width:n,height:r}=va(e,t),i=await Pa(e,t),a=await sn(i),d=document.createElement("canvas"),m=d.getContext("2d"),o=t.pixelRatio||Od(),l=t.canvasWidth||n,c=t.canvasHeight||r;return d.width=l*o,d.height=c*o,t.skipAutoScale||Md(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 yh(e,t={}){return(await ph(e,t)).toDataURL("image/jpeg",t.quality||1)}var rn={exports:{}};/*! @preserve
|
|
41
41
|
* numeral.js
|
|
42
42
|
* version : 2.0.6
|
|
43
43
|
* author : Adam Draper
|
|
44
44
|
* license : MIT
|
|
45
45
|
* http://adamwdraper.github.com/Numeral-js/
|
|
46
|
-
*/var gh=rn.exports,Fa;function xh(){return Fa||(Fa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(gh,function(){var t,n,r="2.0.6",i={},a={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},y={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,m,f;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(y.zeroFormat&&l===y.zeroFormat)c=0;else if(y.nullFormat&&l===y.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(u in i)if(f=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,f&&l.match(f)){m=i[u].unformat;break}m=m||t._.stringToNumber,c=m(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 m=a[t.options.currentLocale],f=!1,x=!1,b=0,_="",w=1e12,T=1e9,M=1e6,F=1e3,O="",B=!1,K,te,q,he,ve,W,le;if(l=l||0,te=Math.abs(l),t._.includes(c,"(")?(f=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(ve=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"?(_+=m.abbreviations.trillion,l=l/w):te<w&&te>=T&&!K||K==="b"?(_+=m.abbreviations.billion,l=l/T):te<T&&te>=M&&!K||K==="m"?(_+=m.abbreviations.million,l=l/M):(te<M&&te>=F&&!K||K==="k")&&(_+=m.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),q=l.toString().split(".")[0],he=c.split(".")[1],W=c.indexOf(","),b=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,he?(t._.includes(he,"[")?(he=he.replace("]",""),he=he.split("["),O=t._.toFixed(l,he[0].length+he[1].length,u,he[1].length)):O=t._.toFixed(l,he.length,u),q=O.split(".")[0],t._.includes(O,".")?O=m.delimiters.decimal+O.split(".")[1]:O="",x&&Number(O.slice(1))===0&&(O="")):q=t._.toFixed(l,0,u),_&&!K&&Number(q)>=1e3&&_!==m.abbreviations.trillion)switch(q=String(Number(q)/1e3),_){case m.abbreviations.thousand:_=m.abbreviations.million;break;case m.abbreviations.million:_=m.abbreviations.billion;break;case m.abbreviations.billion:_=m.abbreviations.trillion;break}if(t._.includes(q,"-")&&(q=q.slice(1),B=!0),q.length<b)for(var V=b-q.length;V>0;V--)q="0"+q;return W>-1&&(q=q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),c.indexOf(".")===0&&(q=""),le=q+O+(_||""),f?le=(f&&B?"(":"")+le+(f&&B?")":""):ve>=0?le=ve===0?(B?"-":"+")+le:le+(B?"-":"+"):B&&(le="-"+le),le},stringToNumber:function(l){var c=a[y.currentLocale],u=l,m={thousand:3,million:6,billion:9,trillion:12},f,x,b;if(y.zeroFormat&&l===y.zeroFormat)x=0;else if(y.nullFormat&&l===y.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(f in m)if(b=new RegExp("[^a-zA-Z]"+c.abbreviations[f]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),u.match(b)){x*=Math.pow(10,m[f]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},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),m=u.length>>>0,f=0,x;if(arguments.length===3)x=arguments[2];else{for(;f<m&&!(f in u);)f++;if(f>=m)throw new TypeError("Reduce of empty array with no initial value");x=u[f++]}for(;f<m;f++)f in u&&(x=c(x,u[f],f,u));return x},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 m=n.multiplier(u);return c>m?c:m},1)},toFixed:function(l,c,u,m){var f=l.toString().split("."),x=c-(m||0),b,_,w,T;return f.length===2?b=Math.min(Math.max(f[1].length,x),c):b=x,w=Math.pow(10,b),T=(u(l+"e+"+b)/w).toFixed(b),m>c-b&&(_=new RegExp("\\.?0{1,"+(m-(c-b))+"}$"),T=T.replace(_,"")),T}},t.options=y,t.formats=i,t.locales=a,t.locale=function(l){return l&&(y.currentLocale=l.toLowerCase()),y.currentLocale},t.localeData=function(l){if(!l)return a[y.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in d)y[l]=d[l]},t.zeroFormat=function(l){y.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){y.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){y.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,m,f,x,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 f=w.currency.symbol,b=w.abbreviations,u=w.delimiters.decimal,w.delimiters.thousands==="."?m="\\.":m=w.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==f)||(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(m+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(u),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var u=this._value,m=l||y.defaultFormat,f,x,b;if(c=c||Math.round,u===0&&y.zeroFormat!==null)x=y.zeroFormat;else if(u===null&&y.nullFormat!==null)x=y.nullFormat;else{for(f in i)if(m.match(i[f].regexps.format)){b=i[f].format;break}b=b||t._.numberToFormat,x=b(u,m,c)}return x},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(m,f,x,b){return m+Math.round(c*f)}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(m,f,x,b){return m-Math.round(c*f)}return this._value=n.reduce([l],u,Math.round(this._value*c))/c,this},multiply:function(l){function c(u,m,f,x){var b=n.correctionFactor(u,m);return Math.round(u*b)*Math.round(m*b)/Math.round(b*b)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(u,m,f,x){var b=n.correctionFactor(u,m);return Math.round(u*b)/Math.round(m*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 m=t._.includes(c," BPS")?" ":"",f;return l=l*1e4,c=c.replace(/\s?BPS/,""),f=t._.numberToFormat(l,c,u),t._.includes(f,")")?(f=f.split(""),f.splice(-1,0,m+"BPS"),f=f.join("")):f=f+m+"BPS",f},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(f){return l.suffixes.indexOf(f)<0})),m=u.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(f,x,b){var _,w=t._.includes(x,"ib")?c:l,T=t._.includes(x," b")||t._.includes(x," ib")?" ":"",M,F,O;for(x=x.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),f===null||f===0||f>=F&&f<O){T+=w.suffixes[M],F>0&&(f=f/F);break}return _=t._.numberToFormat(f,x,b),_+T},unformat:function(f){var x=t._.stringToNumber(f),b,_;if(x){for(b=l.suffixes.length-1;b>=0;b--){if(t._.includes(f,l.suffixes[b])){_=Math.pow(l.base,b);break}if(t._.includes(f,c.suffixes[b])){_=Math.pow(c.base,b);break}}x*=_||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,u){var m=t.locales[t.options.currentLocale],f={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,b,_;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,u),l>=0?(f.before=f.before.replace(/[\-\(]/,""),f.after=f.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(f.before,"-")&&!t._.includes(f.before,"(")&&(f.before="-"+f.before),_=0;_<f.before.length;_++)switch(b=f.before[_],b){case"$":x=t._.insert(x,m.currency.symbol,_);break;case" ":x=t._.insert(x," ",_+m.currency.symbol.length-1);break}for(_=f.after.length-1;_>=0;_--)switch(b=f.after[_],b){case"$":x=_===f.after.length-1?x+m.currency.symbol:t._.insert(x,m.currency.symbol,-(f.after.length-(1+_)));break;case" ":x=_===f.after.length-1?x+" ":t._.insert(x," ",-(f.after.length-(1+_)+m.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,u){var m,f=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=f.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(x[0]),c,u),m+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),u=Number(c[0]),m=Number(c[1]);m=t._.includes(l,"e-")?m*=-1:m;function f(x,b,_,w){var T=t._.correctionFactor(x,b),M=x*T*(b*T)/(T*T);return M}return t._.reduce([u,Math.pow(10,m)],f,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,u){var m=t.locales[t.options.currentLocale],f,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=m.ordinal(l),f=t._.numberToFormat(l,c,u),f+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,u){var m=t._.includes(c," %")?" ":"",f;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),f=t._.numberToFormat(l,c,u),t._.includes(f,")")?(f=f.split(""),f.splice(-1,0,m+"%"),f=f.join("")):f=f+m+"%",f},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 m=Math.floor(l/60/60),f=Math.floor((l-m*60*60)/60),x=Math.round(l-m*60*60-f*60);return m+":"+(f<10?"0"+f:f)+":"+(x<10?"0"+x:x)},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})}(rn)),rn.exports}var Nh=xh();const Da=fr(Nh);var jh=Object.defineProperty,an=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?jh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t)=>{for(var n in t||(t={}))Ya.call(t,n)&&$a(e,n,t[n]);if(an)for(var n of an(t))Ua.call(t,n)&&$a(e,n,t[n]);return e},hr=(e,t)=>{var n={};for(var r in e)Ya.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&an)for(var r of an(e))t.indexOf(r)<0&&Ua.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
46
|
+
*/var gh=rn.exports,Fa;function xh(){return Fa||(Fa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(gh,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})}(rn)),rn.exports}var Nh=xh();const Da=fr(Nh);var jh=Object.defineProperty,an=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?jh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t)=>{for(var n in t||(t={}))Ya.call(t,n)&&$a(e,n,t[n]);if(an)for(var n of an(t))Ua.call(t,n)&&$a(e,n,t[n]);return e},hr=(e,t)=>{var n={};for(var r in e)Ya.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&an)for(var r of an(e))t.indexOf(r)<0&&Ua.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 Mt;(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 m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let x=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const _=this.getPenaltyScore();_<x&&(u=b,x=_),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,m=-1,f=!0){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,b;for(x=c;;x++){const M=t.getNumDataCodewords(x,l)*8,F=y.getTotalBits(o,x);if(F<=M){b=F;break}if(x>=u)throw new RangeError("Data too long")}for(const M of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&b<=t.getNumDataCodewords(x,M)*8&&(l=M);let _=[];for(const M of o){r(M.mode.modeBits,4,_),r(M.numChars,M.mode.numCharCountBits(x),_);for(const F of M.getData())_.push(F)}a(_.length==b);const w=t.getNumDataCodewords(x,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(x,l,T,m)}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 m=0;m<10;m++)c=c<<1^(c>>>9)*1335;const u=(l<<10|c)^21522;a(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,i(u,m));this.setFunctionModule(8,7,i(u,6)),this.setFunctionModule(8,8,i(u,7)),this.setFunctionModule(7,8,i(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,i(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,i(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,i(u,m));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),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const m=Math.max(Math.abs(u),Math.abs(c)),f=o+u,x=l+c;0<=f&&f<this.size&&0<=x&&x<this.size&&this.setFunctionModule(f,x,m!=2&&m!=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],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),x=u-f%u,b=Math.floor(f/u);let _=[];const w=t.reedSolomonComputeDivisor(m);for(let M=0,F=0;M<u;M++){let O=o.slice(F,F+b-m+(M<x?0:1));F+=O.length;const B=t.reedSolomonComputeRemainder(O,w);M<x&&O.push(0),_.push(O.concat(B))}let T=[];for(let M=0;M<_[0].length;M++)_.forEach((F,O)=>{(M!=b-m||O>=x)&&T.push(F[M])});return a(T.length==f),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 m=0;m<2;m++){const f=c-m,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][f]&&l<o.length*8&&(this.modules[b][f]=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 m=0;m<this.size;m++){let f=!1,x=0,b=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[m][_]==f?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,b),f||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),f=this.modules[m][_],x=1);o+=this.finderPenaltyTerminateAndCount(f,x,b)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let f=!1,x=0,b=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][m]==f?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,b),f||(o+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),f=this.modules[_][m],x=1);o+=this.finderPenaltyTerminateAndCount(f,x,b)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){const x=this.modules[m][f];x==this.modules[m][f+1]&&x==this.modules[m+1][f]&&x==this.modules[m+1][f+1]&&(o+=t.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((f,x)=>f+(x?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 m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(u=>0);for(const u of o){const m=u^c.shift();c.push(0),l.forEach((f,x)=>c[x]^=t.reedSolomonMultiply(f,m))}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 m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+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 y=d;y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=y})(Mt||(Mt={})),(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={}))})(Mt||(Mt={})),(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={}))})(Mt||(Mt={}));var qt=Mt;/**
|
|
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;/**
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Ha={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Ba=128,Wa="L",za="#FFFFFF",Ga="#000000",Va=!1,ur=4,vh=.1;function qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(d,y){if(!d&&a!==null){n.push(`M${a+t} ${i+t}h${y-a}v1H${a+t}z`),a=null;return}if(y===r.length-1){if(!d)return;a===null?n.push(`M${y+t},${i+t} h1v1H${y+t}z`):n.push(`M${a+t},${i+t} h${y+1-a}v1H${a+t}z`);return}d&&a===null&&(a=y)})}),n.join("")}function Ka(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 Qa(e,t,n,r){if(r==null)return null;const i=n?ur:0,a=e.length+i*2,d=Math.floor(t*vh),y=a/t,o=(r.width||d)*y,l=(r.height||d)*y,c=r.x==null?e.length/2-o/2:r.x*y,u=r.y==null?e.length/2-l/2:r.y*y;let m=null;if(r.excavate){let f=Math.floor(c),x=Math.floor(u),b=Math.ceil(o+c-f),_=Math.ceil(l+u-x);m={x:f,y:x,w:b,h:_}}return{x:c,y:u,h:l,w:o,excavation:m}}var _h=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function bh(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:y=Va,style:o,imageSettings:l}=t,c=hr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),u=l==null?void 0:l.src,m=Ne.useRef(null),f=Ne.useRef(null),[x,b]=Ne.useState(!1);Ne.useEffect(()=>{if(m.current!=null){const T=m.current,M=T.getContext("2d");if(!M)return;let F=qt.QrCode.encodeText(n,Ha[i]).getModules();const O=y?ur:0,B=F.length+O*2,K=Qa(F,r,y,l),te=f.current,q=K!=null&&te!==null&&te.complete&&te.naturalHeight!==0&&te.naturalWidth!==0;q&&K.excavation!=null&&(F=Ka(F,K.excavation));const he=window.devicePixelRatio||1;T.height=T.width=r*he;const ve=r/B*he;M.scale(ve,ve),M.fillStyle=a,M.fillRect(0,0,B,B),M.fillStyle=d,_h?M.fill(new Path2D(qa(F,O))):F.forEach(function(W,le){W.forEach(function(V,Z){V&&M.fillRect(Z+O,le+O,1,1)})}),q&&M.drawImage(te,K.x+O,K.y+O,K.w,K.h)}}),Ne.useEffect(()=>{b(!1)},[u]);const _=ps({height:r,width:r},o);let w=null;return u!=null&&(w=Ne.createElement("img",{src:u,key:u,style:{display:"none"},onLoad:()=>{b(!0)},ref:f})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ps({style:_,height:r,width:r,ref:m},c)),w)}function Sh(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:y=Va,imageSettings:o}=t,l=hr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ha[i]).getModules();const u=y?ur:0,m=c.length+u*2,f=Qa(c,r,y,o);let x=null;o!=null&&f!=null&&(f.excavation!=null&&(c=Ka(c,f.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:f.h,width:f.w,x:f.x+u,y:f.y+u,preserveAspectRatio:"none"}));const b=qa(c,u);return Ne.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${m} ${m}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:d,d:b,shapeRendering:"crispEdges"}),x)}var Za=e=>{const t=e,{renderAs:n}=t,r=hr(t,["renderAs"]);return n==="svg"?Ne.createElement(Sh,ps({},r)):Ne.createElement(bh,ps({},r))};const ys=(e,t)=>t*100/e,Th=(e,t)=>{const n=validators[`_${Xs[t].minimumFractionDigits??2}`].roundUpto;return n(e)},wh={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=Jn(),Te="normal-class";(gs=="Android OS"||gs==="iOS")&&(Te="bold-class");const tt=e=>{var rt,At,J,_e,gt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:d,type:y}=e.printerDataObject,o=((At=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:At.curr)??((J=e.settingData)==null?void 0:J.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ar(d,{type:y,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const u=r.customLabels??hd();l=c?(_e=c[0])!=null&&_e.paperSize?(gt=c[0])==null?void 0:gt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function m(g){const h=Math.abs(parseFloat(g));return f(h)}function f(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Da(g).format("0,00.000");default:return Da(g).format("0,00.00")}}Ne.useEffect(()=>{w()},[e.newId]);const x=()=>new Promise(async(g,h)=>{if(gs=="Android OS"||gs==="iOS"){let I=await yh(n.current);if(I){const j=await _(I);g(j)}}else{let I=await Pa(n.current);I&&g(I)}}),b=()=>new Promise(async(g,h)=>{const I=await x();g(I)}),_=g=>new Promise((h,I)=>{let j=new Image;j.src=g,j.onload=()=>{let C=document.createElement("canvas");const D=600,S=j.height;let k=j.width,$=j.height;k>$?k>D&&($*=D/k,k=D):$>S&&(k*=S/$,$=S),C.width=k,C.height=$,C.getContext("2d").drawImage(j,0,0,k,$),h(C.toDataURL())}}),w=async()=>{if(n&&n.current){const g=await b();e.onImageGenerated(g)}},T=g=>{let h=new Array;for(const I in g.menusCollection)I.endsWith("collection")||(g.menusCollection[`${I}_collection`]||g.menusCollection[I])&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${I.replace("_"," ")}(${g.menusCollection[I]}):`}),s.jsx("span",{children:ie(g.menusCollection[`${I}_collection`],o)}),s.jsx("span",{children:f(ys(g.salesCollection.totalCollection,g.menusCollection[`${I}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(g.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(g.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(g.salesCollection.swiggy_aggregator_collection,o)})]})),h},M=g=>{let h=new Array,I=new Object;for(let j=0;j<g.todayCollection.length;j++)I=g.todayCollection[j],h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${I.displayName}:`}),s.jsx("span",{children:ie(I.value,o)}),s.jsx("span",{children:f(ys(g.totalCollection,I.value))+"%"})]}));return h},F=(g,h,I,j,C={})=>{let D=g.includes("upi://");const S=`upi://pay?pa=${g}&pn=${I}&cu=INR&am=${j}&tr=${h}`;return s.jsx(Za,{value:D?g:S,renderAs:"canvas",size:C.size??250})},O=(g,h)=>{var D,S;let I=0;if((D=h.taxObj)!=null&&D.VAT.length){let k,$,fe;for($=0;$<((S=h.taxObj)==null?void 0:S.VAT.length);$++){k=h.taxObj.VAT[$];for(fe in k)I+=Se(k[fe])}}const j={sellerName:h.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(h.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:h.finalAmount,invoiceVatTotal:I},C=dd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Za,{value:C,renderAs:"canvas",size:250})},B=g=>{const h=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(h.push(s.jsx("hr",{})),g.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(g.rewardAmt,o)})]})),g.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(g.totalBalanceAmt,o)})]})),g.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(g.writeOffAmt,o)})]})),g.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(g.refundAmt,o)})]})),g.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(g.cashCard,o)})]}))),h},K=(g,h)=>{if(h&&h.length){for(let I=0;I<h.length;I++)if(h[I].slugName===g)return h[I]}return!1},te=(g,h)=>{if(h&&h.length){for(let I=0;I<h.length;I++)if(h[I].itemType===g)return h[I]}return!1},q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),he=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${wh[g.discountType]}`,ve=g=>{const h=new Array;if(g&&Object.keys(g).length!==0){h.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const I in g)if(h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${q[I]}:`}),s.jsx("span",{children:ie(g[I].total,o)})]})),I&&Object.keys(I).length!==0)for(const j in g[I])j!=="total"&&g[I][j]&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Qe(j)}:`}),s.jsx("span",{children:ie(g[I][j],o)})]}))}return h},W=(g,h)=>{let I=!1;g.totalValue&&(I=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.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:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.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?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.status==="RETURNED"?S.serviceAmount?f(S.serviceAmount):"":S.price?f(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Qe(k.serviceName)})),S.instruction&&g.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:g.curr+" "+f(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,g.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:g.curr+" "+f(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.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:g.curr+" "+f(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:h[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",f(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+f(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:g.curr+" "+f(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"})]}):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let fe=$/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:g.curr+" "+f(S[$]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let fe=$;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:g.curr+" "+f(S[$])})]})}))}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:g.curr+" "+f((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"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",I&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.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:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.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?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:S.status==="RETURNED"?S.serviceAmount?f(S.serviceAmount):"":S.price?f(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Qe(k.serviceName)})),S.instruction&&g.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:g.curr+" "+f(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,g.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:g.curr+" "+f(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.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:g.curr+" "+f(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:h[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",f(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+f(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:g.curr+" "+f(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:g.curr+" "+f(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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(S.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let fe=$/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:g.curr+" "+f(S[$]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let fe=$;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:g.curr+" "+f(S[$])})]})}))}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:g.curr+" "+f((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"})]})]})]})})]})},le=(g,h,{labels:I,doMultipleTax:j,type:C})=>{var S,k,$,fe,Ee,Pe,Fe,Ae,$e,Et,xt;const D=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(z=>{var Rt;return s.jsxs("div",{style:z.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:[z.status==="RETURNED"?"(R) ":"",z.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[z.status==="RETURNED"?"-":"",z.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:z.serviceRate?m(z.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:z.status==="RETURNED"?z.serviceAmount?f(z.serviceAmount):"":z.sub_total?f(z.sub_total):""})]}),(Rt=z.addons)!=null&&Rt.length?z.addons.map(Tt=>s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Qe(Tt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[z.status==="RETURNED"?"-":"",Tt.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]})):"",z.instruction?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 ${L[l].dynamicClassname} ${Te}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.subtotal}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(g.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(z=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${z.discountName.toLowerCase()}`]??"DISC-"+z.discountName.toUpperCase()}}),s.jsx("span",{children:he(z)})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.discountAmt)})]})):"",(k=D.CATEGORY_DISCOUNT)!=null&&k.length?D.CATEGORY_DISCOUNT.map(z=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${z.discountName.toLowerCase()}`]??"DISC-"+z.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+z.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.discountAmt)})]})):"",($=D.ITEM_DISCOUNT)!=null&&$.length?D.ITEM_DISCOUNT.map(z=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${z.discountName.toLowerCase()}`]??"DISC-"+ts(z.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+z.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.discountAmt)})]})):"",(Ee=(fe=D.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Ee.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`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+" "+f(D.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Fe=(Pe=D.COUPON_DISCOUNT)==null?void 0:Pe[0])!=null&&Fe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,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+" "+f(D.COUPON_DISCOUNT[0].discountAmt)})]}):"",($e=(Ae=D.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&$e.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:f(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+" "+f(D.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",h.couponCode?"COUPON DISC":"خصم الطلب",h.couponCode?`(${h.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=g.charges)!=null&&Et.length?g.charges.map(z=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${z.name.toLowerCase()}`]??z.name}})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(g.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(xt=g.taxation)!=null&&xt.length?g.taxation.map(z=>{if(z.taxAmt)return z.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:"@"+z.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I[h.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+z.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:"@"+z.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(z.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.total}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(g.total)})]}),j?s.jsx(s.Fragment,{children:C==="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=(g,h)=>{var D,S;let I=!1;const j=g.distributedData;return g.distributedData&&(I=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((D=j.GST)==null?void 0:D.itemList)&&le(j.GST,g,{labels:h,doMultipleTax:I,type:"GST"}),((S=j.VAT)==null?void 0:S.itemList)&&le(j.VAT,g,{labels:h,doMultipleTax:I,type:"VAT"})]})},Z=g=>{const h=g.services,I=Object.keys(g.services),j=I.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Te}`,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&&I.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 $;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:Qe(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),(($=k.addons)==null?void 0:$.length)&&k.addons.map(fe=>{var Ee;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ee=fe.serviceName)==null?void 0:Ee.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",{})]})]})},Ce=g=>{const h=g.slice(0,-4),I=g.slice(-4);return{firstDigits:h,last4Dgits:I}},A=(g,h,I,j={})=>{const C=Object.keys(h??{});let D=[],S,k="flex-two-items";if(j.action==="addCharges"&&(k="display-percentage"),g&&C.length){D.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${I.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",I,":"]}),s.jsx("span",{children:ie(g,o)})]})]}));for(let $=0;$<C.length;$++)S=C[$],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:f(ys(g,h[S]))+"%"}):""]}));D.push(s.jsx("hr",{}))}return D},yt=g=>{const h=Object.keys(g.Category),I=Object.keys(g.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),h.forEach((C,D)=>{const S=g.Category[C];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(C)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{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:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=h.length-1&&s.jsx("hr",{})]})]}))}),I.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"})]})),I.forEach((C,D)=>{const S=g.Addon[C];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(C)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{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:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=I.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},st=g=>{var I;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((I=g==null?void 0:g.customBillLabels)!=null&&I.length){let j;for(let C=0;C<g.customBillLabels.length;C++)j=g.customBillLabels[C],h[j.defaultName]=j.displayName}return h},nt=(g,h,I,j)=>{var $,fe,Ee,Pe,Fe,Ae,$e,Et,xt,z,Rt,Tt,xs,Ns,ln,js,vs,on,cn,dn,hn,un,mn,fn,Kt,_s,Nt,Qt,Zt,bs,pn,Ss,yn,Ts,ws,gn,xn,Is,Cs;const C=st(r.customLabelsMap),D=Zs(ud(r.paymentModes),"internalName"),S=ee=>{var v;return(v=D[ee])!=null&&v.displayName?D[ee].displayName.toUpperCase():ee};if(g==="BILL"){let ee;if(l==="A4"||l==="A5"){let v={...h},Q=0,me=v.distributedData;const p=me.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:`${C.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:v.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.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:I&&s.jsx("img",{src:I,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||(($=v.customFields)==null?void 0:$.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:`${C.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:`${C.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:`${C.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="",G=[];return Q++,G.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?Q:""}),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(ue=>{G.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:["+ ",ue.serviceName.toUpperCase()]}),s.jsx("td",{children:ue.qty})]}),ue.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+ue.instruction+")"})]})]}))}),G}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Q} Items and ${Se(me.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",{}),od(Th(v.finalAmount,o).toFixed(Xs[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:C.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(me.subTotal,o)})]}),(Ee=p==null?void 0:p.DISCOUNT_ITEMS)!=null&&Ee.length?p.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:he(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Pe=p==null?void 0:p.CATEGORY_DISCOUNT)!=null&&Pe.length?p.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`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)})]})):"",(Fe=p==null?void 0:p.ITEM_DISCOUNT)!=null&&Fe.length?p.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`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)})]})):"",($e=(Ae=p==null?void 0:p.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&$e.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${p.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+p.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+p.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(p.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(xt=(Et=p==null?void 0:p.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&xt.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:`(${p.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${p.COUPON_DISCOUNT[0].discountValue}${p.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(p.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(z=p==null?void 0:p.ORDER_DISCOUNT)==null?void 0:z[0])!=null&&Rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),s.jsx("span",{children:f(p.ORDER_DISCOUNT[0].discountValue)?`@${p.ORDER_DISCOUNT[0].discountValue}${p.ORDER_DISCOUNT[0].discountType=="RELATIVE"||p.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(p.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(Tt=me.charges)!=null&&Tt.length?me.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.amt,o)})]})):"",me.subTotal!==me.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(me.afterCharges,o)})]}):"",(xs=me.taxation)!=null&&xs.length?me.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:C.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:C.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:C.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:C.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:C.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((ln=v==null?void 0:v.custoutStandingData)==null?void 0:ln.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:C.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:C.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:C[`${(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:C.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:C.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",{}),I&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:I,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!I&&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:C.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:C.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:C.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:C.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:C.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:C.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} ${Te}`,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:C.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:C.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:C.address}}),": ",s.jsx("span",{children:h.customerInfo.custAddress})]})}),bt(h.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:C.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:C.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:C.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:C.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:C.captain_name}}),":",s.jsx("span",{children:h.captainName})]})})]}),(on=h.customFields)!=null&&on.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,C):W(h,C),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 ${(cn=h.custoutStandingData)!=null&&cn.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:C.grand_total}}),s.jsx("h6",{className:`actual-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.40rem":"1.75rem"},children:h.curr+" "+f(h.finalAmount)})]}),(hn=h.custoutStandingData)!=null&&hn.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:C.previous_outstanding}})}),s.jsx("h5",{children:h.curr+" "+f(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:C.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+f(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:C.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 Q;if(v.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`${(Q=v.paymentMode)==null?void 0:Q.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+" ("+f(v.paidAmt)+")"}):s.jsx(s.Fragment,{children:h.curr+" "+f(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:C.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+f(h.finalAmount+(((un=h==null?void 0:h.custoutStandingData)==null?void 0:un.balanceAmt)||0)-h.rewardAmt)})]})}):"",h.balanceAmt&&h.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:C.balance_amt}}),s.jsx("h5",{children:h.curr+" "+f(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:C.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(g==="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 Q=(mn=h.monthTillDateSalesColl)!=null&&mn.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)}${Q?`(${f(Q)}%)`:""}`})]}),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?`(${f(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",{}),A(h.otherFields.totalDiscountAmt,h.otherFields.discountList,"Discount",{action:"addCharges"}),A(h.otherFields.totalOtherCharges,h.otherFields.otherChargesList,"Charges"),A(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:A(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)]}),B(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",{}),ve(h.averageCollection.dailyExpanse)]}),s.jsx("br",{}),gs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let ee;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=Ce(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",{}),I&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:I,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!I&&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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:C.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:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(Q=>{var me;return s.jsxs("div",{style:Q.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:Q.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Q.qty})]}),((me=Q.addons)==null?void 0:me.length)&&Q.addons.map(p=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Qe(p.serviceName)})),Q.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Q.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",Se(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(Q=>{if(Q.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Q.name}),s.jsx("h5",{children:a.curr+" "+f(Q.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Q=>{let me=new Array;for(const p in Q)if(Q[p]&&Q[p]!=0){let N=p/2;me.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+" "+f(Q[p]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[h.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+f(Q[p]/2)})]})]}))}return me})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(Q=>s.jsx("h4",{className:"left-align-entity",children:Q.customName+": "+Q.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(g==="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:(Nt=a.from)==null?void 0:Nt.map((v,Q)=>{var me,p,N;return`${(p=(me=e.tableData[v])==null?void 0:me.attachedArea)==null?void 0:p.toUpperCase()} - ${(N=e.tableData[v])==null?void 0:N.tableName}${Q+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 ",(pn=u.Table)==null?void 0:pn.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,Q)=>{var me,p,N;return`${(p=(me=e.tableData[v])==null?void 0:me.attachedArea)==null?void 0:p.toUpperCase()} - ${(N=e.tableData[v])==null?void 0:N.tableName}${Q+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=(yn=e.tableData[a.to[0]])==null?void 0:yn.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(g==="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(g==="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",{}),yt(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(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ee}=e.printerDataObject;return getRechargeDetails(ee)}else if(g==="PACKAGING_SLIP"){let ee,v=0;h.aggregatorOrderId&&h.aggregatorOrderId!==""&&(ee=Ce(h.aggregatorOrderId));const Q=h.services;for(let p in Q)v+=Q[p].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})]}),Z(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: ",Se(h.totalQty)]})]}),(gn=h.customFields)==null?void 0:gn.map(p=>s.jsx("h4",{className:"left-align-entity",children:p.customName+": "+p.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(g==="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:C.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:C.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:C.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:C.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:C.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.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:tr(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+" "+f(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+" "+f(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+" "+f(a.totalPaid)})]})]}),(xn=a.transactions)!=null&&xn.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+" "+f(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+" "+f(a.totalPayable)})]})]})]})});{let ee,v=0,Q,me;for(let N=0;N<(((Is=a.services)==null?void 0:Is.length)||0);N++)me=a.services[N],me.status==="CANCELLED"&&!a.onlyCancelledItems&&(v+=me.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=Ce(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 ${Te}`,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 ${Te}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?Q=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Qe(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:"- "+Qe(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})})]}):Q=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Qe(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:"- "+Qe(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:Q}))),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: ",Se(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:nt(y,a.obj,a.companyLogo,a.companyQrCode)})})},Ih=async(e,t,n,r={})=>new Promise(async(i,a)=>{var d,y,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}=yd(e,t,r);let m=[],f=[];const x=Na(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=>{m.push({paperSize:w.paperSize,printer:w.printer,image:M,type:"KOT"}),T()},additionalActions:r},b.newId)))});if(l&&((y=t.packagingSlipPrinters)!=null&&y.length)){const b=gd(e,t,r);(o=b.printers)!=null&&o.length&&b.printers.forEach(_=>{f.push(new Promise(w=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:T=>{m.push({paperSize:_.paperSize,printer:_.printer,image:T,type:"PACKAGING_SLIP"}),w()},additionalActions:r},_.obj.newId))}))})}x.length&&pt("root2",x),await Promise.all(f),i(m)}catch(l){a(l)}}),Ch=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let d=[],y=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=xd(e,t,n),u=Na(o).flatMap(m=>{var f;return(f=c[m.station])==null?void 0:f.map(x=>new Promise(b=>{const _=s.jsx(tt,{printerDataObject:{staticDataKOT:m,paperSize:l,printer:x.printer,type:m.type},newId:m.newId,settingData:t,tableData:Zs(a,"typeValue"),onImageGenerated:w=>{d.push({paperSize:x.paperSize,printer:x.printer,image:w,type:"UPDATE_TABLE"}),b()},additionalActions:n});return y.push(b),_}))});u.length&&pt("root1",u),await Promise.all(y.map(m=>new Promise(m)))}r(d)}catch(a){i(a)}}),Oh=(e,t)=>new Promise(async(n,r)=>{try{const i=Nd(e,t);let a=[];await new Promise(y=>{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"}),y()},additionalActions:t});pt("root1",o)}),n(a)}catch(i){r(i)}}),Mh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await jd(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});pt("root1",l)}),r(d)}catch(a){i(a)}}),Ah=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await xa(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});pt("root1",l)}),r(d)}catch(a){i(a)}}),Eh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let d=await vd(e);if(d&&Object.keys(d.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(u=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:f=>{l.push({paperSize:t.printerSize,image:f,type:"ITEMWISE_SALES_COUNTER"}),u()},additionalActions:r});pt("root1",m)}),i(l)}else i([])}catch(d){a(d)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let d=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,y=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:d,settingData:t,onImageGenerated:u=>{y.push({paperSize:t.printerSize,image:u,type:"COUNTER_OPERATION"}),l()},additionalActions:n});pt("root1",c)}),r(y)}catch(a){i(a)}}),kh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var d;try{const y=await bd(e,t);let o=[],l=ar(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(m=>{const f=s.jsx(tt,{printerDataObject:{staticDataKOT:{...y,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),m()},additionalActions:r});pt("root1",f)}),i(o)}catch(y){a(y)}}),Lh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const d=[];let y=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=ld(l.invoiceFormats,"createdAt")[0],u=await Sd(c);await new Promise(f=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:u,paperSize:u.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:b=>{y.push({paperSize:u.paperSize,image:b,type:"BILL"}),f()},additionalActions:n});d.push(x)})}}d.length&&pt("root1",d),r(y)}catch(d){i(d)}}),pt=(e,t)=>{const n=document.getElementById(e);n&&ri.createRoot(n).render(t)};Oe.counterDetailsPrint=Rh,Oe.handleAggregatorBillPrint=Mh,Oe.handleBillPrint=Ah,Oe.handleDashboardPrint=Oh,Oe.handleItemWisePrint=Eh,Oe.handleKOTPrint=Ih,Oe.handleOldBillPrints=Lh,Oe.handleSummaryPrint=kh,Oe.handleUpdateTablePrint=Ch,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Ha={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Ba=128,Wa="L",za="#FFFFFF",Ga="#000000",Va=!1,ur=4,vh=.1;function qa(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 Ka(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 Qa(e,t,n,r){if(r==null)return null;const i=n?ur:0,a=e.length+i*2,d=Math.floor(t*vh),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 _h=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function bh(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:m=Va,style:o,imageSettings:l}=t,c=hr(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,Ha[i]).getModules();const O=m?ur:0,G=F.length+O*2,K=Qa(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=Ka(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,_h?M.fill(new Path2D(qa(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 Sh(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:m=Va,imageSettings:o}=t,l=hr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ha[i]).getModules();const u=m?ur:0,f=c.length+u*2,p=Qa(c,r,m,o);let g=null;o!=null&&p!=null&&(p.excavation!=null&&(c=Ka(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=qa(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 Za=e=>{const t=e,{renderAs:n}=t,r=hr(t,["renderAs"]);return n==="svg"?xe.createElement(Sh,ps({},r)):xe.createElement(bh,ps({},r))};const ys=(e,t)=>t*100/e,Th=(e,t)=>{const n=validators[`_${Xs[t].minimumFractionDigits??2}`].roundUpto;return n(e)},wh={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=Jn(),be="normal-class";(gs=="Android OS"||gs==="iOS")&&(be="bold-class");const et=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=ar(d,{type:m,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const u=r.customLabels??hd();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 Da(x).format("0,00.000");default:return Da(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 yh(n.current);if(C){const j=await _(C);x(j)}}else{let C=await Pa(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(Za,{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+=_e(k[fe])}}const j={sellerName:h.companyInfo.companyName,vatRegistrationNumber:x,invoiceTimestamp:new Date(h.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:h.finalAmount,invoiceVatTotal:C},I=dd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Za,{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}${wh[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&>.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},tt=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},st=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,ln,js,vs,on,cn,dn,hn,un,mn,fn,Kt,_s,xt,Qt,Zt,bs,pn,Ss,yn,Ts,ws,gn,xn,Is,Cs;const I=st(r.customLabelsMap),D=Zs(ud(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 ${_e(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",{}),od(Th(v.finalAmount,o).toFixed(Xs[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&>.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((ln=v==null?void 0:v.custoutStandingData)==null?void 0:ln.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})]})})]}),(on=h.customFields)!=null&&on.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 ${(cn=h.custoutStandingData)!=null&&cn.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 ${(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.40rem":"1.75rem"},children:h.curr+" "+p(h.finalAmount)})]}),(hn=h.custoutStandingData)!=null&&hn.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+(((un=h==null?void 0:h.custoutStandingData)==null?void 0:un.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=(mn=h.monthTillDateSalesColl)!=null&&mn.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:[((fn=a.services)==null?void 0:fn.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: ",_e(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 ",(pn=u.Table)==null?void 0:pn.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=(yn=e.tableData[a.to[0]])==null?void 0:yn.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",{}),tt(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: ",_e(h.totalQty)]})]}),(gn=h.customFields)==null?void 0:gn.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:tr(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)})]})]}),(xn=a.transactions)!=null&&xn.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: ",_e(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)})})},Ih=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}=yd(e,t,r);let f=[],p=[];const g=Na(c).flatMap(b=>{var _;return(_=u[b.station])==null?void 0:_.map(w=>new Promise(T=>s.jsx(et,{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=gd(e,t,r);(o=b.printers)!=null&&o.length&&b.printers.forEach(_=>{p.push(new Promise(w=>{g.push(s.jsx(et,{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)}}),Ch=(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}=xd(e,t,n),u=Na(o).flatMap(f=>{var p;return(p=c[f.station])==null?void 0:p.map(g=>new Promise(b=>{const _=s.jsx(et,{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)}}),Oh=(e,t)=>new Promise(async(n,r)=>{try{const i=Nd(e,t);let a=[];await new Promise(m=>{const o=s.jsx(et,{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)}}),Mh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await jd(e,t,n);let d=[];await new Promise(o=>{const l=s.jsx(et,{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)}}),Ah=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await xa(e,t,n),d=[];await new Promise(o=>{const l=s.jsx(et,{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)}}),Eh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let d=await vd(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(et,{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)}}),Rh=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(et,{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)}}),kh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var d;try{const m=await bd(e,t);let o=[],l=ar(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(et,{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)}}),Lh=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=ld(l.invoiceFormats,"createdAt")[0],u=await Sd(c);await new Promise(p=>{const g=s.jsx(et,{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&&ri.createRoot(n).render(t)};Oe.counterDetailsPrint=Rh,Oe.handleAggregatorBillPrint=Mh,Oe.handleBillPrint=Ah,Oe.handleDashboardPrint=Oh,Oe.handleItemWisePrint=Eh,Oe.handleKOTPrint=Ih,Oe.handleOldBillPrints=Lh,Oe.handleSummaryPrint=kh,Oe.handleUpdateTablePrint=Ch,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|