@feedmepos/mf-report 5.21.45 → 5.21.46
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/App-DUh6U-OB.js +272 -0
- package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-CcZBwZrG.js → BaseDialog.vue_vue_type_script_setup_true_lang-yBoJyNC8.js} +35 -6
- package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-FajTQaEF.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-tB8numVw.js} +2 -2
- package/dist/{Default.vue_vue_type_script_setup_true_lang-D8Anmn3U.js → Default.vue_vue_type_script_setup_true_lang-Cfl5Ct4b.js} +2 -2
- package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-C3dnlKD1.js → FilterSelector.vue_vue_type_script_setup_true_lang-DuhjAzQP.js} +1000 -988
- package/dist/{InsightView-BcaNLAio.js → InsightView-DkIcQpCD.js} +6 -6
- package/dist/{Integration-B2oUigBV.js → Integration-C0f0Q2os.js} +3 -3
- package/dist/{Integrations-BXs7ebr_.js → Integrations-BM_vRj0F.js} +3 -3
- package/dist/{Layout-B7UzdpMO.js → Layout-C4YVePzi.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CxcGWRnH.js → MenuTab.vue_vue_type_script_setup_true_lang-a72Tflwl.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DRC8oo7m.js → NavigationTab.vue_vue_type_script_setup_true_lang-5oGeza_s.js} +5 -5
- package/dist/{NoData.vue_vue_type_script_setup_true_lang-COEmI1sC.js → NoData.vue_vue_type_script_setup_true_lang-DYFzIaeX.js} +1 -1
- package/dist/{OverviewView-CylqH3pr.js → OverviewView-AKRzXwKb.js} +5 -5
- package/dist/{Report-YSloja2n.js → Report-aKG6wWUi.js} +4 -4
- package/dist/{ReportEditor-D4uSvRt1.js → ReportEditor-ZRBQHo6K.js} +6 -6
- package/dist/{ReportView-Dzd79Cmz.js → ReportView-cWqrG_Nd.js} +8 -8
- package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Bx_tLA09.js → SelectComponent.vue_vue_type_script_setup_true_lang-J0guqNmX.js} +1 -1
- package/dist/{Setting-BFXBp6DS.js → Setting-BXEPHSGB.js} +5 -5
- package/dist/TileEditor-Bqhu78EZ.js +2919 -0
- package/dist/{TransitionFade-CdTx6vpZ.js → TransitionFade-CXHZsIPF.js} +6 -6
- package/dist/{app-Doxhqiyk.js → app-Fb6OY58U.js} +74 -74
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-Bf22-3_a.js → formatChartData.worker-DAwFx8Qz.js} +31 -2
- package/dist/assets/{processTableData.worker-GbyPQNAF.js → processTableData.worker-CGM71S-g.js} +31 -2
- package/dist/{vue-i18n-DViZeYne.js → vue-i18n-DLsuRxx8.js} +1 -1
- package/package.json +1 -1
- package/dist/App-YB3K2Pla.js +0 -270
- package/dist/TileEditor-DcuHmPe3.js +0 -2899
package/dist/assets/{formatChartData.worker-Bf22-3_a.js → formatChartData.worker-DAwFx8Qz.js}
RENAMED
|
@@ -81,13 +81,42 @@ Arguments: [`+D+"]"}},t.UnsupportedError.prototype={toString$0(r){return"Unsuppo
|
|
|
81
81
|
`+_.JSString_methods.$mul(" ",m-d+c.length)+`^
|
|
82
82
|
`}else return m!=null?g+(" (at offset "+t.S(m)+")"):g}},t.Iterable.prototype={cast$1$0(r,e){return t.CastIterable_CastIterable(this,t._instanceType(this)._eval$1("Iterable.E"),e)},map$1$1(r,e,i){return t.MappedIterable_MappedIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"),i)},map$1(r,e){return this.map$1$1(r,e,$.dynamic)},where$1(r,e){return new t.WhereIterable(this,e,t._instanceType(this)._eval$1("WhereIterable<Iterable.E>"))},contains$1(r,e){var i;for(i=this.get$iterator(this);i.moveNext$0();)if(u.$eq$(i.get$current(),e))return!0;return!1},fold$1$2(r,e,i){var n,a;for(n=this.get$iterator(this),a=e;n.moveNext$0();)a=i.call$2(a,n.get$current());return a},fold$2(r,e,i){return this.fold$1$2(r,e,i,$.dynamic)},join$1(r,e){var i,n=this.get$iterator(this);if(!n.moveNext$0())return"";if(e===""){i="";do i+=t.S(u.toString$0$(n.get$current()));while(n.moveNext$0())}else for(i=""+t.S(u.toString$0$(n.get$current()));n.moveNext$0();)i=i+e+t.S(u.toString$0$(n.get$current()));return i.charCodeAt(0)==0,i},toList$1$growable(r,e){return t.List_List$of(this,e,t._instanceType(this)._eval$1("Iterable.E"))},toList$0(r){return this.toList$1$growable(r,!0)},toSet$0(r){var e=t.LinkedHashSet_LinkedHashSet(t._instanceType(this)._eval$1("Iterable.E"));return e.addAll$1(0,this),e},get$length(r){var e,i=this.get$iterator(this);for(e=0;i.moveNext$0();)++e;return e},get$isEmpty(r){return!this.get$iterator(this).moveNext$0()},get$isNotEmpty(r){return!this.get$isEmpty(this)},skip$1(r,e){return t.SkipIterable_SkipIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"))},get$first(r){var e=this.get$iterator(this);if(!e.moveNext$0())throw t.wrapException(t.IterableElementError_noElement());return e.get$current()},firstWhere$1(r,e){var i,n;for(i=this.get$iterator(this);i.moveNext$0();)if(n=i.get$current(),e.call$1(n))return n;throw t.wrapException(t.IterableElementError_noElement())},elementAt$1(r,e){var i,n,a;for(t.RangeError_checkNotNegative(e,"index"),i=this.get$iterator(this),n=0;i.moveNext$0();){if(a=i.get$current(),e===n)return a;++n}throw t.wrapException(t.IndexError$withLength(e,n,this,null,"index"))},toString$0(r){return t.IterableBase_iterableToShortString(this,"(",")")}},t._GeneratorIterable.prototype={elementAt$1(r,e){var i=this.length;return(0>e||e>=i)&&t.throwExpression(t.IndexError$withLength(e,i,this,null,"index")),this._generator.call$1(e)},get$length(r){return this.length}},t.Iterator.prototype={},t.MapEntry.prototype={toString$0(r){return"MapEntry("+t.S(this.key)+": "+t.S(this.value)+")"}},t.Null.prototype={get$hashCode(r){return t.Object.prototype.get$hashCode.call(this,this)},toString$0(r){return"null"}},t.Object.prototype={$isObject:1,$eq(r,e){return this===e},get$hashCode(r){return t.Primitives_objectHashCode(this)},toString$0(r){return"Instance of '"+t.Primitives_objectTypeName(this)+"'"},noSuchMethod$1(r,e){throw t.wrapException(t.NoSuchMethodError$_(this,e.get$memberName(),e.get$positionalArguments(),e.get$namedArguments(),null))},toString(){return this.toString$0(this)}},t.Sink.prototype={},t.StringBuffer.prototype={get$length(r){return this._contents.length},toString$0(r){var e=this._contents;return e.charCodeAt(0)==0,e}},t.Endian.prototype={},t.Digest.prototype={$eq(r,e){var i,n,a,s,o;if(e==null)return!1;if(e instanceof t.Digest){if(i=this.bytes,n=e.bytes,a=i.length,a!==n.length)return!1;for(s=0,o=0;o<a;++o)s|=i[o]^n[o];return s===0}return!1},get$hashCode(r){return t.Object_hashAll(this.bytes)},toString$0(r){return t._hexEncode(this.bytes)}},t.DigestSink.prototype={},t.HashSink.prototype={close$0(r){var e,i,n=this;n._isClosed||(n._isClosed=!0,n._finalizeData$0(),n._iterate$0(),e=n._hash_sink$_sink,i=n._byteDigest$0(),e._value!=null&&t.throwExpression(t.StateError$("add may only be called once.")),e._value=new t.Digest(i))},_byteDigest$0(){var r,e,i,n,a;if(_.C_Endian===E.$get$Endian_host())return t.NativeUint8List_NativeUint8List$view(this.digest.buffer,0,null);for(r=this.digest,e=r.byteLength,i=new Uint8Array(e),n=t.NativeByteData_NativeByteData$view(i.buffer,0,null),a=0;a<5;++a)n.setUint32(a*4,r[a],!1);return i},_iterate$0(){var r,e,i,n=this._pendingData,a=t.NativeByteData_NativeByteData$view(n._buffer.buffer,0,null),s=this._currentChunk,o=_.JSInt_methods.$tdiv(n._typed_buffer$_length,s.byteLength);for(r=s.length,e=0;e<o;++e){for(i=0;i<r;++i)s[i]=a.getUint32(e*s.byteLength+i*4,!1);this.updateHash$1(s)}s=o*s.byteLength,t.RangeError_checkValidRange(0,s,n.get$length(n)),s>0&&n._closeGap$2(n,0,s)},_finalizeData$0(){var r,e,i,n,a,s,o=this,l=o._pendingData;for(l._add$1(128),r=o._lengthInBytes+1+8,e=o._currentChunk.byteLength,e=((r+e-1&-e)>>>0)-r,i=0;i<e;++i)l._add$1(0);if(e=o._lengthInBytes,e>0x3ffffffffffff)throw t.wrapException(t.UnsupportedError$("Hashing is unsupported for messages with more than 2^53 bits."));n=e*8,a=l._typed_buffer$_length,l.addAll$1(0,new Uint8Array(8)),s=t.NativeByteData_NativeByteData$view(l._buffer.buffer,0,null),s.setUint32(a,_.JSInt_methods._tdivFast$1(n,4294967296),!1),s.setUint32(a+4,n>>>0,!1)}},t._Sha1Sink.prototype={updateHash$1(r){var e,i,n,a,s,o=this.digest,l=o[0],D=o[1],d=o[2],c=o[3],p=o[4];for(e=this._extended,i=0;i<80;++i,p=c,c=d,d=s,D=l,l=a)i<16?e[i]=r[i]:(n=e[i-3]^e[i-8]^e[i-14]^e[i-16],e[i]=(n<<1|n>>>31)>>>0),a=(((l<<5|l>>>27)>>>0)+p>>>0)+e[i]>>>0,i<20?a=(a+((D&d|~D&c)>>>0)>>>0)+1518500249>>>0:i<40?a=(a+((D^d^c)>>>0)>>>0)+1859775393>>>0:a=i<60?(a+((D&d|D&c|d&c)>>>0)>>>0)+2400959708>>>0:(a+((D^d^c)>>>0)>>>0)+3395469782>>>0,s=(D<<30|D>>>2)>>>0;o[0]=l+o[0]>>>0,o[1]=D+o[1]>>>0,o[2]=d+o[2]>>>0,o[3]=c+o[3]>>>0,o[4]=p+o[4]>>>0}},t.DateSymbols.prototype={toString$0(r){return this.NAME}},t.DateBuilder.prototype={setYear$1(r){this.year=r},setMonth$1(r){this.month=r},setDay$1(r){this.day=r},setDayOfYear$1(r){this.dayOfYear=r},setHour$1(r){this.hour=r},setMinute$1(r){this.minute=r},setSecond$1(r){this.second=r},setFractionalSecond$1(r){this.fractionalSecond=r},_offsetYear$2(r,e){return this._dateTimeConstructor.call$8(r.get$year()+e,r.get$month(),r.get$day(),r.get$hour(),r.get$minute(),r.get$second(),r.get$millisecond(),r.get$isUtc())},asDate$1$retries(r){var e,i,n,a,s,o,l,D,d,c,p,y=this,g=y._date;return g!=null||(y._hasAmbiguousCentury?(g=y.year,e=g<0||g>=100):e=!0,e?(g=y.year,i=y.month,n=y.dayOfYear,n===0&&(n=y.day),a=y.pm,s=y.hour,a=a?s+12:s,o=y._dateTimeConstructor.call$8(g,i,n,a,y.minute,y.second,y.fractionalSecond,y.utc)):(E.$get$_clockKey(),l=t.systemTime(),y.utc&&(l=l.toUtc$0()),D=y._offsetYear$2(l,-80),d=y._offsetYear$2(l,20),g=_.JSInt_methods._tdivFast$1(D.get$year(),100),i=_.JSInt_methods._tdivFast$1(d.get$year(),100),n=y.year,a=y.month,s=y.dayOfYear,s===0&&(s=y.day),c=y.pm,p=y.hour,c=c?p+12:p,p=y._dateTimeConstructor,o=p.call$8(i*100+n,a,s,c,y.minute,y.second,y.fractionalSecond,y.utc),o.compareTo$1(0,d)<=0||(i=y.year,n=y.month,a=y.dayOfYear,a===0&&(a=y.day),s=y.pm,c=y.hour,s=s?c+12:c,o=p.call$8(g*100+i,n,a,s,y.minute,y.second,y.fractionalSecond,y.utc))),y.utc&&e?(y._date=o,g=o):g=y._date=y._correctForErrors$2(o,r)),g},asDate$0(){return this.asDate$1$retries(3)},_correctForErrors$2(r,e){var i,n,a,s,o,l,D,d,c=this;return e<=0?r:(i=r.get$year(),i=t.Primitives_valueFromDecomposedDate(i,2,29,0,0,0,0,!1),t._isInt(i)||t.throwExpression(t.argumentErrorValue(i)),n=t.Primitives_getMonth(new t.DateTime(i,!1))===2,a=t.dayOfYear(r.get$month(),r.get$day(),n),c.utc?i=!1:r.get$isUtc()?(i=r.get$hour(),s=c.pm,o=c.hour,i===(s?o+12:o)&&r.get$day(),i=!0):i=!1,i?(++c._retried,c.asDate$1$retries(e-1)):c.dateOnly&&r.get$hour()!==0?(l=c.asDate$1$retries(e-1),l.$eq(0,r)?(D=c.dayOfYear,D===0&&(D=t.dayOfYear(c.month,c.day,n)),d=r.add$1(0,t.Duration$(0,(D-a)*24-r.get$hour(),0,0,0,0)),d.get$hour()===0?d:t.dayOfYear(d.get$month(),d.get$day(),n)!==D?r:d):l):r)}},t.DateFormat.prototype={_parse$3$strict$utc(r,e,i){var n,a,s,o=this,l=new t.DateBuilder(o._locale,o.dateTimeConstructor),D=o._dateOnly;for(l.dateOnly=D??(o._dateOnly=o.get$_checkDateOnly()),n=new t.StringStack(r),D=o.get$_formatFields(),a=D.length,s=0;s<D.length;D.length===a||(0,t.throwConcurrentModificationError)(D),++s)D[s].parse$2(n,l);return l.asDate$0()},get$_checkDateOnly(){return _.JSArray_methods.every$1(this.get$_formatFields(),new t.DateFormat__checkDateOnly_closure)},get$_formatFields(){var r,e=this,i=e._formatFieldsPrivate;return i==null&&(e._date_format$_pattern==null&&(e.addPattern$1("yMMMMd"),e.addPattern$1("jms")),i=e._date_format$_pattern,i.toString,i=e._parsePatternHelper$1(i),r=t._arrayInstanceType(i)._eval$1("ReversedListIterable<1>"),r=e._formatFieldsPrivate=t.List_List$of(new t.ReversedListIterable(i,r),!0,r._eval$1("ListIterable.E")),i=r),i},_appendPattern$2(r,e){var i=this._date_format$_pattern;this._date_format$_pattern=i==null?r:i+e+r},addPattern$1(r){var e,i,n=this;return n._formatFieldsPrivate=null,e=E.$get$dateTimePatterns(),i=n._locale,e.toString,(t.canonicalizedLocale(i)==="en_US"?e.fallbackData:e._throwException$0()).containsKey$1(r)?(e=E.$get$dateTimePatterns(),e.toString,n._appendPattern$2((t.canonicalizedLocale(i)==="en_US"?e.fallbackData:e._throwException$0()).$index(0,r)," ")):n._appendPattern$2(r," "),n},get$dateSymbols(){var r,e=this._locale;return e!==E.lastDateSymbolLocale&&(E.lastDateSymbolLocale=e,r=E.$get$_dateTimeSymbols(),r.toString,E.cachedDateSymbols=t.canonicalizedLocale(e)==="en_US"?r.fallbackData:r._throwException$0()),e=E.cachedDateSymbols,e.toString,e},get$useNativeDigits(){var r=this._useNativeDigits;return r==null&&(E.DateFormat__useNativeDigitsByDefault.$index(0,this._locale),r=this._useNativeDigits=!0),r},get$digitMatcher(){var r=this,e=r._digitMatcher;return e!=null||(e=E.DateFormat__digitMatchers.putIfAbsent$2(r.get$localeZero(),r.get$_initDigitMatcher()),r._digitMatcher=e,e.toString),e},get$localeZeroCodeUnit(){var r=this._localeZeroCodeUnit;return r??(this._localeZeroCodeUnit=_.JSString_methods._codeUnitAt$1(this.get$localeZero(),0))},get$localeZero(){var r=this,e=r._localeZero;return e==null&&(r.get$useNativeDigits(),r.get$dateSymbols(),e=r._localeZero="0"),e},_initDigitMatcher$0(){var r,e;return this.get$useNativeDigits(),r=this._localeZeroCodeUnit,e=E.$get$asciiZeroCodeUnit(),r==e?E.$get$asciiDigitMatcher():(r=$.int,t.RegExp_RegExp("^["+t.String_String$fromCharCodes(t.Iterable_Iterable$generate(10,new t.DateFormat__initDigitMatcher_closure,r).map$1$1(0,new t.DateFormat__initDigitMatcher_closure0(this),r).toList$0(0),0,null)+"]+",!1))},_parsePatternHelper$1(r){var e,i;return r.length===0?t._setArrayType([],$.JSArray__DateFormatField):(e=this._date_format$_match$1(r),e==null?t._setArrayType([],$.JSArray__DateFormatField):(i=this._parsePatternHelper$1(_.JSString_methods.substring$1(r,e.fullPattern$0().length)),i.push(e),i))},_date_format$_match$1(r){var e,i,n,a;for(e=0;i=E.$get$DateFormat__matchers(),e<3;++e)if(n=i[e].firstMatch$1(r),n!=null)return i=t.DateFormat__fieldConstructors()[e],a=n._match[0],a.toString,i.call$2(a,this);return null}},t.DateFormat_dateTimeConstructor_closure.prototype={call$8(r,e,i,n,a,s,o,l){var D;return l?(D=t.Primitives_valueFromDecomposedDate(r,e,i,n,a,s,o,!0),t._isInt(D)||t.throwExpression(t.argumentErrorValue(D)),new t.DateTime(D,!0)):(D=t.Primitives_valueFromDecomposedDate(r,e,i,n,a,s,o,!1),t._isInt(D)||t.throwExpression(t.argumentErrorValue(D)),new t.DateTime(D,!1))},"call*":"call$8",$requiredArgCount:8,$signature:50},t.DateFormat__checkDateOnly_closure.prototype={call$1(r){return r.get$forDate()},$signature:67},t.DateFormat__initDigitMatcher_closure.prototype={call$1(r){return r},$signature:43},t.DateFormat__initDigitMatcher_closure0.prototype={call$1(r){return this.$this.get$localeZeroCodeUnit()+r},$signature:43},t.DateFormat__fieldConstructors_closure.prototype={call$2(r,e){var i=t._DateFormatQuotedField__patchQuotes(r);return _.JSString_methods.trim$0(i),new t._DateFormatQuotedField(r,i,e)},$signature:90},t.DateFormat__fieldConstructors_closure0.prototype={call$2(r,e){return _.JSString_methods.trim$0(r),new t._DateFormatPatternField(r,e)},$signature:93},t.DateFormat__fieldConstructors_closure1.prototype={call$2(r,e){return _.JSString_methods.trim$0(r),new t._DateFormatLiteralField(r,e)},$signature:99},t._DateFormatField.prototype={get$forDate(){return!0},fullPattern$0(){return this.pattern},toString$0(r){return this.pattern},parseLiteral$1(r){var e=this.pattern,i=e.length,n=r.peek$1(i);r._string_stack$_index+=i,n!==e&&this.throwFormatException$1(r)},throwFormatException$1(r){throw t.wrapException(t.FormatException$("Trying to read "+this.toString$0(0)+" from "+r.toString$0(0),null,null))}},t._DateFormatLiteralField.prototype={parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatQuotedField.prototype={fullPattern$0(){return this._fullPattern},parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatPatternField.prototype={parse$2(r,e){this.parseField$2(r,e)},get$forDate(){var r=this._forDate;return r==null&&(r=this.pattern[0],r=this._forDate=t.stringContainsUnchecked("cdDEGLMQvyZz",r,0)),r},parseField$2(r,e){var i,n,a=this;try{switch(i=a.pattern,i[0]){case"a":a.parseEnumeratedString$2(r,a.parent.get$dateSymbols().AMPMS)===1&&(e.pm=!0);break;case"c":a.parseStandaloneDay$1(r);break;case"d":a.handleNumericField$2(r,e.get$setDay());break;case"D":a.handleNumericField$2(r,e.get$setDayOfYear());break;case"E":n=a.parent,a.parseEnumeratedString$2(r,i.length>=4?n.get$dateSymbols().WEEKDAYS:n.get$dateSymbols().SHORTWEEKDAYS);break;case"G":n=a.parent,a.parseEnumeratedString$2(r,i.length>=4?n.get$dateSymbols().ERANAMES:n.get$dateSymbols().ERAS);break;case"h":a.handleNumericField$2(r,e.get$setHour()),e.hour===12&&(e.hour=0);break;case"H":a.handleNumericField$2(r,e.get$setHour());break;case"K":a.handleNumericField$2(r,e.get$setHour());break;case"k":a.handleNumericField$3(r,e.get$setHour(),-1);break;case"L":a.parseStandaloneMonth$2(r,e);break;case"M":a.parseMonth$2(r,e);break;case"m":a.handleNumericField$2(r,e.get$setMinute());break;case"Q":break;case"S":a.handleNumericField$2(r,e.get$setFractionalSecond());break;case"s":a.handleNumericField$2(r,e.get$setSecond());break;case"v":break;case"y":a.handleNumericField$2(r,e.get$setYear()),e._hasAmbiguousCentury=i.length===2;break;case"z":break;case"Z":break;default:return}}catch{a.throwFormatException$1(r)}},handleNumericField$3(r,e,i){var n=this.parent;e.call$1(this._nextInteger$3(r,n.get$digitMatcher(),n.get$localeZeroCodeUnit())+i)},handleNumericField$2(r,e){return this.handleNumericField$3(r,e,0)},_nextInteger$3(r,e,i){var n,a,s,o,l=e.stringMatch$1(r.peek$1(r.contents.length-r._string_stack$_index));if(l==null||l.length===0)return this.throwFormatException$1(r);if(n=l.length,r._string_stack$_index+=n,a=E.$get$asciiZeroCodeUnit(),i!==a){for(n>4294967295&&t.throwExpression(t.RangeError$range(n,0,4294967295,"length",null)),s=u.JSArray_JSArray$markFixed(new Array(n),$.int),o=0;o<n;++o)s[o]=_.JSString_methods._codeUnitAt$1(l,o)-i+a;l=t.String_String$fromCharCodes(s,0,null)}return t.int_parse(l)},parseEnumeratedString$2(r,e){var i,n,a,s,o,l,D,d,c=t._setArrayType([],$.JSArray_int);for(i=e.length,n=r.contents,a=n.length,s=0;s<i;++s)o=e[s],l=r._string_stack$_index,_.JSString_methods.substring$2(n,l,Math.min(l+o.length,a))===o&&c.push(s);for(c.length===0&&this.throwFormatException$1(r),D=_.JSArray_methods.get$first(c),c=t.SubListIterable$(c,1,null,$.int),c=new t.ListIterator(c,c.get$length(c)),i=t._instanceType(c)._precomputed1;c.moveNext$0();)n=c.__internal$_current,d=n??i._as(n),e[d].length>=e[D].length&&(D=d);return r._string_stack$_index+=e[D].length,D},parseMonth$2(r,e){var i,n=this;switch(n.pattern.length){case 5:i=n.parent.get$dateSymbols().NARROWMONTHS;break;case 4:i=n.parent.get$dateSymbols().MONTHS;break;case 3:i=n.parent.get$dateSymbols().SHORTMONTHS;break;default:return n.handleNumericField$2(r,e.get$setMonth())}e.month=n.parseEnumeratedString$2(r,i)+1},parseStandaloneDay$1(r){var e,i=this;switch(i.pattern.length){case 5:e=i.parent.get$dateSymbols().STANDALONENARROWWEEKDAYS;break;case 4:e=i.parent.get$dateSymbols().STANDALONEWEEKDAYS;break;case 3:e=i.parent.get$dateSymbols().STANDALONESHORTWEEKDAYS;break;default:return i.handleNumericField$2(r,new t._DateFormatPatternField_parseStandaloneDay_closure)}i.parseEnumeratedString$2(r,e)},parseStandaloneMonth$2(r,e){var i,n=this;switch(n.pattern.length){case 5:i=n.parent.get$dateSymbols().STANDALONENARROWMONTHS;break;case 4:i=n.parent.get$dateSymbols().STANDALONEMONTHS;break;case 3:i=n.parent.get$dateSymbols().STANDALONESHORTMONTHS;break;default:return n.handleNumericField$2(r,e.get$setMonth())}e.month=n.parseEnumeratedString$2(r,i)+1}},t._DateFormatPatternField_parseStandaloneDay_closure.prototype={call$1(r){return r},$signature:6},t.StringStack.prototype={peek$1(r){var e=this.contents,i=this._string_stack$_index;return _.JSString_methods.substring$2(e,i,Math.min(i+r,e.length))},toString$0(r){return this.contents+" at "+this._string_stack$_index}},t.UninitializedLocaleData.prototype={$index(r,e){return t.canonicalizedLocale(e)==="en_US"?this.fallbackData:this._throwException$0()},_throwException$0(){throw t.wrapException(new t.LocaleDataException("Locale data has not been initialized, call "+this.message+"."))}},t.LocaleDataException.prototype={toString$0(r){return"LocaleDataException: "+this.message}},t.StartOfWeek.prototype={_enumToString$0(){return"StartOfWeek."+this._name}},t.Units.prototype={_enumToString$0(){return"Units."+this._name}},t.Jiffy.prototype={get$dateTime(){var r=this.__Jiffy__dateTime_A;return r===E&&t.throwUnnamedLateFieldNI(),r},_parseMap$1(r){var e,i,n,a,s,o,l;return r.forEach$1(0,new t.Jiffy__parseMap_closure),r.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=r.$index(0,"year"),e==null&&(e=r.$index(0,"years")),e==null&&(e=r.$index(0,"y")),e==null&&(e=t.Primitives_getYear(new t.DateTime(Date.now(),!1))),i=r.$index(0,"month"),i==null&&(i=r.$index(0,"months")),i==null&&(i=r.$index(0,"M")),i==null&&(i=t.Primitives_getMonth(new t.DateTime(Date.now(),!1))),n=r.$index(0,"day"),n==null&&(n=r.$index(0,"days")),n==null&&(n=r.$index(0,"d")),n==null&&(n=t.Primitives_getDay(new t.DateTime(Date.now(),!1))),a=r.$index(0,"hour"),a==null&&(a=r.$index(0,"hours")),a==null&&(a=r.$index(0,"h")),a==null&&(a=t.Primitives_getHours(new t.DateTime(Date.now(),!1))),s=r.$index(0,"minute"),s==null&&(s=r.$index(0,"minutes")),s==null&&(s=r.$index(0,"m")),s==null&&(s=t.Primitives_getMinutes(new t.DateTime(Date.now(),!1))),o=r.$index(0,"second"),o==null&&(o=r.$index(0,"seconds")),o==null&&(o=r.$index(0,"s")),o==null&&(o=t.Primitives_getSeconds(new t.DateTime(Date.now(),!1))),l=r.$index(0,"millisecond"),l==null&&(l=r.$index(0,"milliseconds")),l==null&&(l=r.$index(0,"ms")),l==null&&(l=t.Primitives_getMilliseconds(new t.DateTime(Date.now(),!1))),e=t.Primitives_valueFromDecomposedDate(e,i,n,a,s,o,l,!1),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!1))},_parseList$1(r){var e,i,n,a,s,o,l=u.getInterceptor$asx(r);return l.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=l.$index(r,0),i=l.get$length(r)>1?l.$index(r,1):1,n=l.get$length(r)>2?l.$index(r,2):1,a=l.get$length(r)>3?l.$index(r,3):0,s=l.get$length(r)>4?l.$index(r,4):0,o=l.get$length(r)>5?l.$index(r,5):0,l=l.get$length(r)>6?l.$index(r,6):0,l=t.Primitives_valueFromDecomposedDate(e,i,n,a,s,o,l,!1),t._isInt(l)||t.throwExpression(t.argumentErrorValue(l)),new t.DateTime(l,!1))},_parseString$2(r,e){var i="yyyy/MM/dd",n="(\\d{4})(\\d{1,2})(\\d{1,2})$",a=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}$",!1);if(a._nativeRegExp.test(r))return t.DateFormat$("yyyy-MM-dd")._parse$3$strict$utc(r,!1,!1);if(a=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),a._nativeRegExp.test(r)?a=!0:(a=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),a=a._nativeRegExp.test(r)),a)return t.DateTime_parse(r).toLocal$0();if(a=t.RegExp_RegExp("\\d{4}\\/\\d{1,2}\\/\\d{1,2}$",!1),a._nativeRegExp.test(r))return t.DateFormat$(i)._parse$3$strict$utc(r,!1,!1);if(a=t.RegExp_RegExp(n,!1),a._nativeRegExp.test(r))return t.DateFormat$(i)._parse$3$strict$utc(t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(n,!1),new t.Jiffy__parseString_closure,null),!1,!1);throw t.wrapException(t.JiffyException$('Date time not recognized, a pattern must be passed, e.g. Jiffy("12, Oct", "dd, MMM")').get$cause())},add$1$minutes(r,e){var i=this,n=i.__Jiffy__dateTime_A;return n===E&&t.throwUnnamedLateFieldNI(),n=n.add$1(0,_.Duration_0),i.__Jiffy__dateTime_A=n,n=n.add$1(0,t.Duration$(0,0,0,0,e,0)),i.__Jiffy__dateTime_A=n,n=i._addMonths$2(n,0),i.__Jiffy__dateTime_A=n,i.__Jiffy__dateTime_A=i._addMonths$2(n,0),t.Jiffy$(i)},subtract$1$days(r){var e=this,i=e.__Jiffy__dateTime_A;return i===E&&t.throwUnnamedLateFieldNI(),i=i.subtract$1(_.Duration_0),e.__Jiffy__dateTime_A=i,i=i.subtract$1(t.Duration$(r,0,0,0,0,0)),e.__Jiffy__dateTime_A=i,i=e._addMonths$2(i,-0),e.__Jiffy__dateTime_A=i,e.__Jiffy__dateTime_A=e._addMonths$2(i,-0),t.Jiffy$(e)},_addMonths$2(r,e){var i,n,a,s,o,l,D,d=_.JSInt_methods.$mod(e,12),c=_.JSInt_methods._tdivFast$1(e-d,12),p=r.get$year()+c,y=r.get$month()+d;return y>12&&(++p,y-=12),i=r.get$day(),n=_.List_mC8[y],y===2&&_.JSInt_methods.$mod(p,4)===0?a=_.JSInt_methods.$mod(p,100)!==0||_.JSInt_methods.$mod(p,400)===0:a=!1,a&&++n,s=Math.min(i,n),r.get$isUtc()?(i=r.get$hour(),a=r.get$minute(),o=r.get$second(),l=r.get$millisecond(),D=r.get$microsecond(),i=t.Primitives_valueFromDecomposedDate(p,y,s,i,a,o,l+_.JSNumber_methods.round$0(D/1e3),!0),t._isInt(i)||t.throwExpression(t.argumentErrorValue(i)),new t.DateTime(i,!0)):(i=r.get$hour(),a=r.get$minute(),o=r.get$second(),l=r.get$millisecond(),D=r.get$microsecond(),i=t.Primitives_valueFromDecomposedDate(p,y,s,i,a,o,l+_.JSNumber_methods.round$0(D/1e3),!1),t._isInt(i)||t.throwExpression(t.argumentErrorValue(i)),new t.DateTime(i,!1))}},t.Jiffy__parseMap_closure.prototype={call$2(r,e){(r==="M"?r:t.normalizeUnits(r))==="0"&&t.throwExpression(t.JiffyException$('Invalid unit passed, the following units are available "year", "month", "week", "day", "hour", "minute", "second", "millisecond"').get$cause())},$signature:35},t.Jiffy__parseString_closure.prototype={call$1(r){return t.S(r.group$1(0,1))+"/"+t.S(r.group$1(0,2))+"/"+t.S(r.group$1(0,3))},$signature:15},t.ArLyLocale.prototype={},t.ArSaMaDzKwTnLocale.prototype={},t.AzLocale.prototype={},t.BnLocale.prototype={},t.DeLocale.prototype={},t.EnLocale.prototype={},t.EsLocale.prototype={},t.FaLocale.prototype={},t.FrLocale.prototype={},t.HiLocale.prototype={},t.IdLocale.prototype={},t.ItLocale.prototype={},t.JaLocale.prototype={},t.KoLocale.prototype={},t.Locale.prototype={},t.NbLocale.prototype={},t.NlLocale.prototype={},t.PlLocale.prototype={},t.PtLocale.prototype={},t.RuLocale.prototype={},t.SvLocale.prototype={},t.ThLocale.prototype={},t.TrLocale.prototype={},t.UkLocale.prototype={},t.ZhCnLocale.prototype={},t.ZhLocale.prototype={},t.JiffyException.prototype={get$cause(){return"JiffyException: "+this._cause}},t.BufferModule.prototype={},t.BufferConstants.prototype={},t.Buffer.prototype={},t.ConsoleModule.prototype={},t.Console.prototype={},t.EventEmitter.prototype={},t.Promise.prototype={},t.Date.prototype={},t.JsError.prototype={},t.Atomics.prototype={},t.Modules.prototype={},t.Module.prototype={},t.Net.prototype={},t.Socket.prototype={},t.NetAddress.prototype={},t.NetServer.prototype={},t.NodeJsError.prototype={},t.JsAssertionError.prototype={},t.JsRangeError.prototype={},t.JsReferenceError.prototype={},t.JsSyntaxError.prototype={},t.JsTypeError.prototype={},t.JsSystemError.prototype={},t.Process.prototype={},t.CPUUsage.prototype={},t.Release.prototype={},t.StreamModule.prototype={},t.Readable.prototype={},t.Writable.prototype={},t.Duplex.prototype={},t.Transform.prototype={},t.WritableOptions.prototype={},t.ReadableOptions.prototype={},t.Immediate.prototype={},t.Timeout.prototype={},t.TTY.prototype={},t.TTYReadStream.prototype={},t.TTYWriteStream.prototype={},t.Util.prototype={},t.Connection.prototype={},t.SchemaLibrary.prototype={SchemaLibrary$2$connection$schemas(r,e){var i,n,a,s,o;for(i=this._schemas,n=r.sourceDatasetId,a=r.targetDatasetId,s=0;s<75;++s)o=i[s],o._rawTablePrefix=n,o._materializeTablePrefix=a},getSchema$1(r){return _.JSArray_methods.firstWhere$1(this._schemas,new t.SchemaLibrary_getSchema_closure(r))},get$visualizationSchemas(){var r=this._schemas,e=t._arrayInstanceType(r),i=e._eval$1("MappedIterable<1,VisualizationSchema>");return t.List_List$of(new t.MappedIterable(new t.WhereIterable(r,new t.SchemaLibrary_visualizationSchemas_closure,e._eval$1("WhereIterable<1>")),new t.SchemaLibrary_visualizationSchemas_closure0,i),!0,i._eval$1("Iterable.E"))}},t.SchemaLibrary_getSchema_closure.prototype={call$1(r){return r.name===this.name},$signature:28},t.SchemaLibrary_visualizationSchemas_closure.prototype={call$1(r){return!r.isMaterializeOnly},$signature:28},t.SchemaLibrary_visualizationSchemas_closure0.prototype={call$1(r){return r.get$visualizationSchema()},$signature:45},t.QueryEngineContext.prototype={},t.Materialize_get_createMaterializedTableSql_closure.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure0.prototype={call$1(r){return"ADD COLUMN IF NOT EXISTS "+r.name+" "+r.type._name},$signature:10},t.Materialize_get_createMaterializedTableSql_closure1.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure2.prototype={call$1(r){return r.name+" "+r.type._name},$signature:10},t.Materialize_getMergeSql_closure.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure0.prototype={call$1(r){return"SAFE_CAST(JSON_VALUE("+this._this.name._name+", '$."+t.S(r.pointTo)+"') AS "+r.type._name+") AS "+r.name},$signature:10},t.Materialize_getMergeSql_closure1.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure2.prototype={call$1(r){return r.name},$signature:10},t.Materialize_getMergeSql_closure3.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure4.prototype={call$1(r){var e=r.name;return e+"=source_table."+e},$signature:10},t.SOURCE_TYPE.prototype={_enumToString$0(){return"SOURCE_TYPE."+this._name}},t.SCHEMA_NAME.prototype={_enumToString$0(){return"SCHEMA_NAME."+this._name}},t.DATA_TYPE.prototype={_enumToString$0(){return"DATA_TYPE."+this._name}},t.AGGREGATION_TYPE.prototype={_enumToString$0(){return"AGGREGATION_TYPE."+this._name}},t.COMPARISON_OPERATOR.prototype={_enumToString$0(){return"COMPARISON_OPERATOR."+this._name}},t.DIMENSION_OPTION.prototype={_enumToString$0(){return"DIMENSION_OPTION."+this._name}},t.TIME_FORMATTER.prototype={_enumToString$0(){return"TIME_FORMATTER."+this._name}},t.FORMATTER_TYPE.prototype={_enumToString$0(){return"FORMATTER_TYPE."+this._name}},t.PERIOD_TYPE.prototype={_enumToString$0(){return"PERIOD_TYPE."+this._name}},t.SORT_TYPE.prototype={_enumToString$0(){return"SORT_TYPE."+this._name}},t.PermissionType.prototype={_enumToString$0(){return"PermissionType."+this._name}},t.Permission.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"field",this.field],$.String,$.dynamic)}},t.TopLevelFilters.prototype={toJson$0(){var r=this.permissions,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>");return t.LinkedHashMap_LinkedHashMap$_literal(["timeControl",this.timeControl,"permissions",t.List_List$of(new t.MappedListIterable(r,new t.TopLevelFilters_toJson_closure,e),!0,e._eval$1("ListIterable.E"))],$.String,$.dynamic)}},t.TopLevelFilters_fromJson_closure.prototype={call$1(r){return new t.Permission(t.EnumByName_byName(_.List_wsa,r.$index(0,"type")),r.$index(0,"field"))},$signature:52},t.TopLevelFilters_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:53},t.Source.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"table",this.table,"field",this.field],$.String,$.dynamic)}},t.INDEX_METHOD.prototype={_enumToString$0(){return"INDEX_METHOD."+this._name}},t.Index.prototype={toJson$0(){var r=this.indexMethod;return r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["column",this.column,"customName",this.customName,"indexMethod",r],$.String,$.dynamic)}},t.Schema.prototype={setConnection$1(r){this._rawTablePrefix=r.sourceDatasetId,this._materializeTablePrefix=r.targetDatasetId},getTransformedTableQuery$1$getParentDocs(r){var e=this.source,i=e.type===_.SOURCE_TYPE_1?"transformCouchdbDoc":"transformMongodbDoc",n="`"+this._materializeTablePrefix+"."+i+"`(data, id, db_name, publish_time, deleted, '"+e.table+"')";return e=e.field,e!=null&&!r?(e=t.S(e),e="SELECT JSON_QUERY_ARRAY(JSON_EXTRACT("+n+", '$."+e+"')) AS "+e+" FROM docs"):e="SELECT "+n+" AS "+this.name._name+" FROM docs",e},get$fullRawTableName(){var r=this._rawTablePrefix;return r=r!==""?r+".":"",r+this.rawTableName},get$fullMaterializedTableName(){var r=this._materializeTablePrefix;return r=r!==""?r+".":"",r+this.materializedTableName},get$visualizationSchema(){var r=this,e=u.where$1$ax(r.fields,new t.Schema_visualizationSchema_closure),i=e.$ti._eval$1("MappedIterable<1,VisualizationField>");return t.VisualizationSchema$(t.List_List$of(new t.MappedIterable(e,new t.Schema_visualizationSchema_closure0,i),!0,i._eval$1("Iterable.E")),r.isJoinOnly,u.map$1$1$ax(r.joins,new t.Schema_visualizationSchema_closure1,$.SCHEMA_NAME).toList$0(0),r.label,r.name)},toJson$0(){var r=this,e=$.Map_String_dynamic,i=u.map$1$1$ax(r.fields,new t.Schema_toJson_closure,e).toList$0(0),n=u.map$1$1$ax(r.joins,new t.Schema_toJson_closure0,e).toList$0(0),a=r.topLevelFilters.toJson$0(),s=r.source.toJson$0(),o=r.filters,l=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,Map<String,@>>");return l=t.List_List$of(new t.MappedListIterable(o,new t.Schema_toJson_closure1,l),!0,l._eval$1("ListIterable.E")),o=r.indexes,e=o==null?null:u.map$1$1$ax(o,new t.Schema_toJson_closure2,e).toList$0(0),t.LinkedHashMap_LinkedHashMap$_literal(["fields",i,"label",r.label,"name",r.name._name,"joins",n,"topLevelFilters",a,"source",s,"dynamicRawTable",r.dynamicRawTable,"rawTableName",r.rawTableName,"materializedTableName",r.materializedTableName,"materializedPostgresqlTableName",r.materializedPostgresqlTableName,"isJoinOnly",r.isJoinOnly,"isContinuousUpdate",r.isContinuousUpdate,"interval",r.interval,"partition",r.partition,"clusters",r.clusters,"filters",l,"indexes",e,"isGlobal",r.isGlobal,"isAiHidden",r.isAiHidden,"aiKeywords",r.aiKeywords,"aiCategory",r.aiCategory,"aiPriority",r.aiPriority],$.String,$.dynamic)}},t.Schema_visualizationSchema_closure.prototype={call$1(r){return!r.hidden},$signature:2},t.Schema_visualizationSchema_closure0.prototype={call$1(r){var e=r.type,i=r.name,n=r.label,a=r.schemaName,s=t.getFilterOperators(e);return new t.VisualizationField(a,i,n,e,t.getAggregationTypes(e),t.getDimensionOptions(e),s)},$signature:54},t.Schema_visualizationSchema_closure1.prototype={call$1(r){return r.joinSchemaName},$signature:55},t.Schema_fromJson_closure.prototype={call$1(r){return t.Field_fromJson(r)},$signature:3},t.Schema_fromJson_closure0.prototype={call$1(r){return t.Join_fromJson(r)},$signature:56},t.Schema_fromJson_closure1.prototype={call$1(r){var e=r.$index(0,"column");return e==null&&(e=t._setArrayType([],$.JSArray_String)),new t.Index(e,r.$index(0,"customName"),t.EnumByName_byName(_.List_88s,r.$index(0,"indexMethod")))},$signature:63},t.Schema_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:19},t.Schema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:72},t.Schema_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:73},t.Schema_toJson_closure1.prototype={call$1(r){return r.toJson$0()},$signature:20},t.Schema_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:75},t.Field.prototype={getSql$3$option$schema$value(r,e,i){var n,a;return i!=null?u.toString$0$(i):(n=this.formula,a=e.name._name,n!=null?(a=t.ReCase$(a)._getCamelCase$0(),t.stringReplaceAllUnchecked(n,"@",a+".")):t.ReCase$(a)._getCamelCase$0()+"."+this.name)},getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(r,e,i,n){var a=i.getSchema$1(this.schemaName),s=u.firstWhere$1$ax(a.fields,new t.Field_getQueryPlainSql_closure(this)),o=a.name._name,l=t.ReCase$(o)._getCamelCase$0()+"."+s.name,D=s.formula;switch(D!=null&&(o=t.ReCase$(o)._getCamelCase$0(),l=t.stringReplaceAllUnchecked(D,"@",o+".")),s.type.index){case 1:l=e==null?A.FORMAT+l+")":t.DimensionOptionExtension_formatSql(e,l,n);break;case 0:l="ANY_VALUE("+l+") OVER (PARTITION BY REGEXP_REPLACE(IFNULL("+l+",''), ' ', ''))";break}return l},toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name,"schemaName",r.schemaName._name,"pointTo",r.pointTo,"formula",r.formula,"postgresqlFormula",r.postgresqlFormula,"label",r.label,"hidden",r.hidden,"type",r.type._name,"isAiHidden",r.isAiHidden,"isCompareIgnoreSpaces",r.isCompareIgnoreSpaces,"description",r.description],$.String,$.dynamic)}},t.Field_getQueryPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t._NumericField.prototype={getSql$3$option$schema$value(r,e,i){return this.super$Field$getSql(r,e,i)}},t._TimestampField.prototype={_getExtractTimestampSql$3$part$sql$value(r,e,i){return i!=null?e:"CAST(EXTRACT("+r+" FROM "+e+" AT TIME ZONE @TIMEZONE) as INT64)"},getSql$3$option$schema$value(r,e,i){var n=this,a=n.super$Field$getSql(r,e,i);switch(r){case _.DIMENSION_OPTION_5:a="TIME("+(i!=null?"TIMESTAMP('"+a+"')":a)+", @TIMEZONE)";break;case _.DIMENSION_OPTION_6:a=n._getExtractTimestampSql$3$part$sql$value("HOUR",a,i);break;case _.DIMENSION_OPTION_7:a=n._getExtractTimestampSql$3$part$sql$value("DAYOFWEEK",a,i);break;case _.DIMENSION_OPTION_8:a=n._getExtractTimestampSql$3$part$sql$value("DAY",a,i);break;case _.DIMENSION_OPTION_9:a=n._getExtractTimestampSql$3$part$sql$value("MONTH",a,i);break;case _.DIMENSION_OPTION_10:a=n._getExtractTimestampSql$3$part$sql$value("YEAR",a,i);break;case _.DIMENSION_OPTION_0:case _.DIMENSION_OPTION_1:case _.DIMENSION_OPTION_2:case _.DIMENSION_OPTION_3:case _.DIMENSION_OPTION_4:case _.DIMENSION_OPTION_11:default:i!=null&&(a="TIMESTAMP('"+a+"')");break}return a}},t._BoolField.prototype={getSql$3$option$schema$value(r,e,i){return this.super$Field$getSql(r,e,i)}},t._StringField.prototype={getSql$3$option$schema$value(r,e,i){var n=this.super$Field$getSql(r,e,i);return u.$eq$(i,"NULL")?n:i!=null?"'"+n+"'":n}},t.Join.prototype={getConditionsSql$1(r){return _.JSArray_methods.fold$2(this.conditions,"",new t.Join_getConditionsSql_closure(this,r))},toJson$0(){var r=this,e=r.conditions,i=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>");return i=t.List_List$of(new t.MappedListIterable(e,new t.Join_toJson_closure,i),!0,i._eval$1("ListIterable.E")),e=r.lateral,e=e==null?null:e.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["joinSchemaName",r.joinSchemaName._name,"mainSchemaName",r.mainSchemaName._name,"conditions",i,"topLevelTimeControl",r.topLevelTimeControl,"lateral",e],$.String,$.dynamic)}},t.Join_getConditionsSql_closure.prototype={call$2(r,e){var i=this.$this,n=t._setArrayType([e.joinField],$.JSArray_String),a=e.option,s=t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(null,n,a,i.joinSchemaName),e.operator,this.schemaLibrary,t._QueryRequestComparisonTargetVariable$(null,e.mainFields,a,i.mainSchemaName)).getSql$0();return r===""?s:r+" and "+s},$signature:76},t.Join_fromJson_closure.prototype={call$1(r){var e=r.$index(0,"joinField"),i=r.$index(0,"mainFields"),n=t.EnumByName_byName(_.List_LO4,r.$index(0,"operator"));return new t.JoinCondition(e,i,n,r.$index(0,"option")!=null?t.EnumByName_byName(_.List_yRY,r.$index(0,"option")):null)},$signature:83},t.Join_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:85},t.JoinLateralSort.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["name",this.name,"type",this.type._name],$.String,$.dynamic)}},t.JoinLateral.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["distinctFields",this.distinctFields,"sorts",u.map$1$1$ax(this.sorts,new t.JoinLateral_toJson_closure,$.Map_String_dynamic).toList$0(0)],$.String,$.dynamic)}},t.JoinLateral_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:86},t.JoinCondition.prototype={toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["joinField",r.joinField,"mainFields",r.mainFields,"operator",r.operator._name,"option",e],$.String,$.dynamic)}},t.QueryRequestComparisonTarget.prototype={},t._QueryRequestComparisonTargetValue.prototype={},t._QueryRequestComparisonTargetVariable.prototype={},t.QueryRequestComparison.prototype={getSql$0(){var r,e,i,n=this,a=n.operator;switch(a.index){case 0:a=n.to,r=a.length,r===0?e="":r===1?(i=a[0],a=n.from,e=i==="NULL"?a+" is "+i:a+"="+i):(r=n.from,e=r+" in ("+_.JSArray_methods.join$1(a,",")+")",_.JSArray_methods.contains$1(a,"NULL")&&(e=e+" OR "+r+" IS NULL"));break;case 1:a=n.to,r=a.length,r===0?e="":r===1?(i=a[0],a=n.from,e=i==="NULL"?a+" is not "+i:a+"!="+i):(r=n.from,e=r+" not in ("+_.JSArray_methods.join$1(a,",")+")",_.JSArray_methods.contains$1(a,"NULL")&&(e=e+" AND "+r+" IS NOT NULL"));break;case 7:a=n.to,e=a.length===0?"":new t.MappedListIterable(a,new t.QueryRequestComparison_getSql_closure(n),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>")).join$1(0," or ");break;case 8:a=n.to,e=a.length===0?"":new t.MappedListIterable(a,new t.QueryRequestComparison_getSql_closure0(n),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>")).join$1(0," and ");break;case 3:e=n.from+"<"+t.S(n.to[0]);break;case 5:e=n.from+"<="+t.S(n.to[0]);break;case 2:e=n.from+">"+t.S(n.to[0]);break;case 4:e=n.from+">="+t.S(n.to[0]);break;case 6:a=n.to,e=n.from+" between "+t.S(a[0])+" and "+t.S(a[1]);break;case 10:a=t._setArrayType([n.from],$.JSArray_String),_.JSArray_methods.addAll$1(a,n.to),e=_.JSArray_methods.join$1(a," or ");break;case 9:a=t._setArrayType([n.from],$.JSArray_String),_.JSArray_methods.addAll$1(a,n.to),e=_.JSArray_methods.join$1(a," and ");break;default:throw t.wrapException(t.Exception_Exception("invalid operator "+a._name))}return e!==""?"("+e+")":e}},t.QueryRequestComparison_QueryRequestComparison$nested_closure.prototype={call$1(r){return r.getSql$0()},$signature:87},t.QueryRequestComparison_getToValues_closure.prototype={call$1(r){var e=this.toSchema;return u.firstWhere$1$ax(e.fields,new t.QueryRequestComparison_getToValues__closure0(r)).getSql$3$option$schema$value(this.to.option,e,null)},$signature:4},t.QueryRequestComparison_getToValues__closure0.prototype={call$1(r){return r.name===this.name},$signature:2},t.QueryRequestComparison_getToValues_closure0.prototype={call$1(r){var e,i=this.operator;return i===_.COMPARISON_OPERATOR_7||i===_.COMPARISON_OPERATOR_8?"'%"+t.S(r)+"%'":(i=this.toSchema,e=this.to,u.firstWhere$1$ax(i.fields,new t.QueryRequestComparison_getToValues__closure(e)).getSql$3$option$schema$value(e.option,i,r))},$signature:7},t.QueryRequestComparison_getToValues__closure.prototype={call$1(r){return r.name===u.get$first$ax(this.to.names)},$signature:2},t.QueryRequestComparison_getFromValue_closure.prototype={call$1(r){return r.name===u.get$first$ax(this.from.names)},$signature:2},t.QueryRequestComparison_getSql_closure.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') like "+(e+r+"), ' ', '')")},$signature:4},t.QueryRequestComparison_getSql_closure0.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') not like "+(e+r+"), ' ', '')")},$signature:4},t.uniqueAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.Primitives_stringFromCharCode(97+t.int_parse(e))},$signature:15},t.QueryRequestCommonField.prototype={getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r,e,i,n,a,s,o,l){var D,d,c=s!=null;if(r!=null)switch(D="ORDER BY "+e+"_sort ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING",r.index){case 0:case 10:return"SUM("+e+") OVER ("+a+") "+e;case 2:case 12:return c?"SUM("+e+") OVER ("+a+") "+e:"COUNT("+e+") OVER ("+a+") "+e;case 3:return c?"SUM("+e+") OVER ("+a+") "+e:"COUNT(DISTINCT "+e+") OVER ("+a+") "+e;case 1:case 11:return"AVG("+e+") OVER ("+a+") "+e;case 7:return c?"'' "+e:"STRING_AGG("+e+") OVER ("+a+") "+e;case 4:return _.JSArray_methods.join$1(t._setArrayType(["FIRST_VALUE("+e+") OVER ("+a+" "+D+") "+e,"LAST_VALUE("+e+"_sort) OVER ("+a+" "+D+") "+e+"_sort"],$.JSArray_String),",");case 5:return d="LAST_VALUE("+e,_.JSArray_methods.join$1(t._setArrayType([d+") OVER ("+a+" "+D+") "+e,d+"_sort) OVER ("+a+" "+D+") "+e+"_sort"],$.JSArray_String),",");case 8:return"MIN("+e+") OVER ("+a+") "+e;case 9:return"MAX("+e+") OVER ("+a+") "+e;case 6:return c?"'' "+e:"ANY_VALUE(CAST("+e+" as STRING)) OVER ("+a+") "+e}else return c&&i>=s?"CAST(NULL as "+t.S(t.DataTypeExtension_get_sqlType(u.firstWhere$1$ax(o.getSchema$1(this.schemaName).fields,new t.QueryRequestCommonField_getAggregatedSql_closure(this)).type))+") "+e:n?"ANY_VALUE("+e+") OVER ("+a+") "+e:e}},t.QueryRequestCommonField_getAggregatedSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension.prototype={toJson$0(){var r,e,i=this,n=i.timeFormatter;return n=n==null?null:n._name,r=i.formatter,r=r==null?null:r._name,e=i.option,e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",i.schemaName._name,"name",i.name,"decimal",i.decimal,"timeFormatter",n,"formatter",r,"label",i.label,"option",e,"fillGap",i.fillGap,"hide",i.hide,"dataFormula",i.dataFormula,"displayFormula",i.displayFormula,"dateComparison",i.dateComparison],$.String,$.dynamic)},get$idV1(){var r=this.name,e=this.option;return e!=null&&(r=r+"_"+e._name),(this.schemaName._name+"_"+r).toLowerCase()},get$alias(){var r=this,e=r.name,i=r.option;return i!=null&&(e=e+"_"+i._name),i=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0),(r.schemaName._name+"_"+e+"_"+t.stringReplaceAllUnchecked(r.label,i,"")).toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){return u.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestDimension_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,this.option,r,e)},generateTimestampArraySql$2$timeFilters$timezone(r,e){var i,n,a,s,o,l,D;switch(this.option){case _.DIMENSION_OPTION_1:case _.DIMENSION_OPTION_6:i=_.Units_3;break;case _.DIMENSION_OPTION_2:case _.DIMENSION_OPTION_7:case _.DIMENSION_OPTION_8:case _.DIMENSION_OPTION_11:i=_.Units_4;break;case _.DIMENSION_OPTION_3:i=_.Units_5;break;case _.DIMENSION_OPTION_4:case _.DIMENSION_OPTION_9:i=_.Units_6;break;case _.DIMENSION_OPTION_10:i=_.Units_7;break;case _.DIMENSION_OPTION_0:case _.DIMENSION_OPTION_5:default:i=null;break}if(n=t.DateTime_parse(u.$index$asx(_.JSArray_methods.get$first(r).values,0)).toUtc$0(),a=t.DateTime_parse(u.$index$asx(_.JSArray_methods.get$first(r).values,1)).toUtc$0(),s=new t.QueryRequestDimension_generateTimestampArraySql_closure(r,n).call$0(),o=new t.QueryRequestDimension_generateTimestampArraySql_closure0(r,a).call$0(),s.isAfter$1(o)&&(o=o.add$1(0,t.Duration$(1,0,0,0,0,0))),i!=null)switch(l=t.DateTimeExtension_startOfUtc(s,i,s,e)._toString$1$iso8601(!0),D=t.DateTimeExtension_endOfUtc(o,i,o,e)._toString$1$iso8601(!0),i.index){case 3:case 4:return'UNNEST(GENERATE_TIMESTAMP_ARRAY(TIMESTAMP("'+l+'"),TIMESTAMP("'+D+'"),INTERVAL 1 '+i._name+"))";case 5:case 6:case 7:return'UNNEST(ARRAY(SELECT TIMESTAMP(date, "'+e+'") FROM UNNEST(GENERATE_DATE_ARRAY(DATE(TIMESTAMP "'+l+'", "'+e+'"),DATE(TIMESTAMP "'+D+'", "'+e+'"),INTERVAL 1 '+i._name+")) as date))";default:return"[]"}else return[]},getColumn$1(r){var e=this,i=e.schemaName,n=u.firstWhere$1$ax(r.getSchema$1(i).fields,new t.QueryRequestDimension_getColumn_closure(e)),a=t.uniqueAlias(e.get$alias()),s=n.type;return new t.QueryResponseColumn(i,e.label,s,_.FIELD_TYPE_0,a,null,e.option,e.decimal,e.timeFormatter,e.formatter,e.hide,e.dateComparison===!0)},$eq(r,e){var i=this;return e==null?!1:e instanceof t.QueryRequestDimension&&i.option==e.option&&i.name===e.name&&i.schemaName===e.schemaName&&i.label===e.label},get$hashCode(r){var e=this;return _.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+u.get$hashCode$(e.option)+_.JSString_methods.get$hashCode(e.label)}},t.QueryRequestDimension_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension_generateTimestampArraySql_closure.prototype={call$0(){var r=t.DateTime_parse(u.$index$asx(_.JSArray_methods.get$last(this.timeFilters).values,0)).toUtc$0(),e=this.startTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:26},t.QueryRequestDimension_generateTimestampArraySql_closure0.prototype={call$0(){var r=t.DateTime_parse(u.$index$asx(_.JSArray_methods.get$last(this.timeFilters).values,1)).toUtc$0(),e=this.endTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:26},t.QueryRequestDimension_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric.prototype={toJson$0(){var r,e=this,i=e.timeFormatter;return i=i==null?null:i._name,r=e.formatter,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"label",e.label,"decimal",e.decimal,"aggregation",e.aggregation._name,"hide",e.hide,"dataFormula",e.dataFormula,"displayFormula",e.displayFormula,"timeFormatter",i,"formatter",r],$.String,$.dynamic)},get$alias(){var r=this,e=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0);return(r.schemaName._name+"_"+r.name+"_"+r.aggregation._name+"_"+t.stringReplaceAllUnchecked(r.label,e,"")).toLowerCase()},getColumn$1(r){var e=this,i=e.schemaName,n=u.firstWhere$1$ax(r.getSchema$1(i).fields,new t.QueryRequestMetric_getColumn_closure(e)).type,a=e.aggregation;switch(a.index){case 2:case 3:case 0:n=_.DATA_TYPE_3;break}return new t.QueryResponseColumn(i,e.label,n,_.FIELD_TYPE_1,t.uniqueAlias(e.get$alias()),a,null,e.decimal,e.timeFormatter,e.formatter,e.hide,!1)},getPlainSql$2$schemaLibrary$timezone(r,e){return u.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestMetric_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(this.aggregation,null,r,e)},$eq(r,e){var i=this;return e==null?!1:e instanceof t.QueryRequestMetric&&i.aggregation===e.aggregation&&i.name===e.name&&i.schemaName===e.schemaName&&i.label===e.label},get$hashCode(r){var e=this;return _.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+t.Primitives_objectHashCode(e.aggregation)+_.JSString_methods.get$hashCode(e.label)}},t.QueryRequestMetric_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestFilter.prototype={toComparison$2$timezone(r,e){var i,n,a,s,o,l,D,d,c,p=this,y=p.schemaName,g=r.getSchema$1(y),m=p.operator;return m===_.COMPARISON_OPERATOR_6&&p.option===_.DIMENSION_OPTION_5&&(i=p.values,n=u.getInterceptor$asx(i),a=t.Jiffy$(n.$index(i,0)),s=t.Jiffy$(n.$index(i,1)),i=a.__Jiffy__dateTime_A,i===E&&t.throwUnnamedLateFieldNI(),i=i.get$hour(),n=a.__Jiffy__dateTime_A.get$minute(),o=s.__Jiffy__dateTime_A,o===E&&t.throwUnnamedLateFieldNI(),o.get$hour()*60+s.__Jiffy__dateTime_A.get$minute()<i*60+n)?(y=g.name,m=p.name,i=$.JSArray_String,n=p.option,o=p.dataFormula,l=t._QueryRequestComparisonTargetVariable$(o,t._setArrayType([m],i),n,y),D=t.Jiffy$(a),d=D.__Jiffy__dateTime_A,d===E&&t.throwUnnamedLateFieldNI(),d=d.toUtc$0(),D.__Jiffy__dateTime_A=d,d=d.toIso8601String$0(),D=a.__Jiffy__dateTime_A,D=t.DateTimeExtension_endOfUtc(D,_.Units_4,D,e)._toString$1$iso8601(!0),D=t.QueryRequestComparison_QueryRequestComparison$single(l,_.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([m],i),[d,D],n,null)),o=t._QueryRequestComparisonTargetVariable$(o,t._setArrayType([m],i),n,y),d=s.__Jiffy__dateTime_A,d=t.DateTimeExtension_startOfUtc(d,_.Units_4,d,e)._toString$1$iso8601(!0),l=t.Jiffy$(s),c=l.__Jiffy__dateTime_A,c===E&&t.throwUnnamedLateFieldNI(),c=c.toUtc$0(),l.__Jiffy__dateTime_A=c,c=c.toIso8601String$0(),t.QueryRequestComparison_QueryRequestComparison$nested(_.COMPARISON_OPERATOR_10,t._setArrayType([D,t.QueryRequestComparison_QueryRequestComparison$single(o,_.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([m],i),[d,c],n,null))],$.JSArray_QueryRequestComparison))):(i=p.name,n=$.JSArray_String,o=p.option,t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(p.dataFormula,t._setArrayType([i],n),o,y),m,r,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([i],n),p.values,o,null)))},toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",r.schemaName._name,"name",r.name,"operator",r.operator._name,"option",e,"dataFormula",r.dataFormula,"values",r.values],$.String,$.dynamic)}},t._GetSourceTableResponse.prototype={},t._PlainSqlColumn.prototype={},t.QueryRequest.prototype={get$populatedSorts(){var r,e,i,n,a=null,s=this.sorts;return s.length!==0?s:(s=this.dimensions,r=u.getInterceptor$asx(s),r.get$isNotEmpty(s)?(e=r.get$first(s),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,a,a,a,e.schemaName,e.name)],$.JSArray_QueryRequestSort)):(s=this.metrics,r=u.getInterceptor$asx(s),i=$.JSArray_QueryRequestSort,r.get$isNotEmpty(s)?(n=r.get$first(s),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,a,a,a,n.schemaName,n.name)],i)):t._setArrayType([],i)))},_getJoins$1(r){var e=this.joins,i=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Join>");return t.List_List$of(new t.MappedListIterable(e,new t.QueryRequest__getJoins_closure(this,r),i),!0,i._eval$1("ListIterable.E"))},toJson$0(){var r,e,i,n,a,s,o=this,l=$.Map_String_dynamic,D=u.map$1$1$ax(o.dimensions,new t.QueryRequest_toJson_closure,l).toList$0(0);return l=u.map$1$1$ax(o.metrics,new t.QueryRequest_toJson_closure0,l).toList$0(0),r=o.joins,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),r=o.timeDimension,r=r==null?null:r.toJson$0(),i=o.filters,n=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>"),n=t.List_List$of(new t.MappedListIterable(i,new t.QueryRequest_toJson_closure2,n),!0,n._eval$1("ListIterable.E")),i=o.sorts,a=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(i,new t.QueryRequest_toJson_closure3,a),!0,a._eval$1("ListIterable.E")),i=o.blendConditions,i==null&&(i=t._setArrayType([],$.JSArray_JoinDatasourceCondition)),s=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",o.schemaName._name,"dimensions",D,"metrics",l,"joins",e,"timeDimension",r,"restaurantIds",o.restaurantIds,"warehouseIds",o.warehouseIds,"businessIds",o.businessIds,"filters",n,"sorts",a,"blendConditions",t.List_List$of(new t.MappedListIterable(i,new t.QueryRequest_toJson_closure4,s),!0,s._eval$1("ListIterable.E")),"limit",o.limit,"rollup",o.rollup,"rollupPosition",o.rollupPosition,"timezone",o.timezone],$.String,$.dynamic)},copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,i,n,a){var s=this,o=a??s.sorts,l=i??s.rollup,D=n??s.rollupPosition,d=r??s.blendConditions;return t.QueryRequest$(d,s.businessIds,e,s.filters,s.joins,s.limit,s.metrics,s.restaurantIds,l,D,s.schemaName,o,s.timeDimension,s.timezone,s.warehouseIds)},copyWith$2$dimensions$sorts(r,e){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,e)},copyWith$1$dimensions(r){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,null)},copyWith$3$dimensions$rollup$rollupPosition(r,e,i){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,e,i,null)},copyWith$3$blendConditions$dimensions$rollup(r,e,i){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,i,null,null)},getColumns$1(r){var e=$.QueryResponseColumn,i=t.List_List$of(u.map$1$1$ax(this.dimensions,new t.QueryRequest_getColumns_closure(r),e),!0,e);return _.JSArray_methods.addAll$1(i,u.map$1$1$ax(this.metrics,new t.QueryRequest_getColumns_closure0(r),e)),i},_getPlainSqlColumns$1(r){var e=this,i=$._PlainSqlColumn,n=t.List_List$of(u.map$1$1$ax(e.dimensions,new t.QueryRequest__getPlainSqlColumns_closure(e,r),i),!0,i),a=e.metrics,s=u.getInterceptor$ax(a);return _.JSArray_methods.addAll$1(n,s.map$1$1(a,new t.QueryRequest__getPlainSqlColumns_closure0(e,r),i)),i=e.sorts,_.JSArray_methods.addAll$1(n,new t.MappedListIterable(i,new t.QueryRequest__getPlainSqlColumns_closure1(e,r),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,_PlainSqlColumn>"))),_.JSArray_methods.addAll$1(n,s.fold$2(a,t._setArrayType([],$.JSArray__PlainSqlColumn),new t.QueryRequest__getPlainSqlColumns_closure2(e,r))),n},_getPlainSqlSorts$1(r){var e=this.get$populatedSorts(),i=new t.MappedListIterable(e,new t.QueryRequest__getPlainSqlSorts_closure(this,r),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>"));return i.get$length(i)===0?"":" order by "+i.join$1(0,",")},_getTimeFilters$1(r){var e,i,n,a,s,o,l,D,d,c,p,y=t._setArrayType([],$.JSArray_QueryRequestFilter),g=r.topLevelFilters.timeControl;return g!=null&&(e=this.timeDimension,i=e.timeStart,i!=null&&e.timeEnd!=null?(n=t.Jiffy$(i),a=e.timeEnd,s=t.Jiffy$(a),o=n.__Jiffy__dateTime_A,o===E&&t.throwUnnamedLateFieldNI(),l=o.get$hour()*60+n.__Jiffy__dateTime_A.get$minute(),o=s.__Jiffy__dateTime_A,o===E&&t.throwUnnamedLateFieldNI(),D=o.get$hour()*60+s.__Jiffy__dateTime_A.get$minute(),d=D-l,d<=0&&(d+=1440),c=l>720&&d>720,p=D<l?s.__Jiffy__dateTime_A.toLocal$0().get$hour()*60+s.__Jiffy__dateTime_A.toLocal$0().get$minute()+1:0,i.toString,a.toString,y.push(new t.QueryRequestFilter(_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_5,null,[i,a],r.name,g))):(p=0,c=!1),i=t.Jiffy$(e.start),i=i.subtract$1$days(c?1:0).add$1$minutes(0,p),a=i.__Jiffy__dateTime_A,a===E&&t.throwUnnamedLateFieldNI(),a=a.toUtc$0(),i.__Jiffy__dateTime_A=a,a=a.toIso8601String$0(),e=t.Jiffy$(e.end),e=e.subtract$1$days(c?1:0).add$1$minutes(0,p),i=e.__Jiffy__dateTime_A,i===E&&t.throwUnnamedLateFieldNI(),i=i.toUtc$0(),e.__Jiffy__dateTime_A=i,y.push(new t.QueryRequestFilter(_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0,null,[a,i.toIso8601String$0()],r.name,g))),y},_getSqlFilters$1(r){var e,i,n,a,s=this,o=t._setArrayType([],$.JSArray_QueryRequestFilter),l=r.getSchema$1(s.schemaName);return s.timeDimension!=null&&(e=t.List_List$of(o,!0,$.QueryRequestFilter),_.JSArray_methods.addAll$1(e,s._getTimeFilters$1(l)),o=e),e=l.topLevelFilters.permissions,e.length!==0?(i=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,QueryRequestFilter>"),n=i._eval$1("MappedListIterable<ListIterable.E,QueryRequestComparison>"),a=t.QueryRequestComparison_QueryRequestComparison$nested(_.COMPARISON_OPERATOR_10,t.List_List$of(new t.MappedListIterable(new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure(s),i),new t.QueryRequest__getSqlFilters_closure0(s,r),n),!0,n._eval$1("ListIterable.E"))).getSql$0()):a="id='_'",e=t._setArrayType([a],$.JSArray_String),_.JSArray_methods.addAll$1(e,new t.MappedListIterable(o,new t.QueryRequest__getSqlFilters_closure1(s,r),t._arrayInstanceType(o)._eval$1("MappedListIterable<1,String>"))),i=s.filters,_.JSArray_methods.addAll$1(e,new t.MappedListIterable(i,new t.QueryRequest__getSqlFilters_closure2(s,r),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>"))),i=l.filters,_.JSArray_methods.addAll$1(e,new t.MappedListIterable(i,new t.QueryRequest__getSqlFilters_closure3(s,r),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>"))),e.length!==0?" where "+new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure4,$.MappedListIterable_String_String).join$1(0," and "):""},_getSqlJoins$1(r){return _.JSArray_methods.fold$2(this._getJoins$1(r),"",new t.QueryRequest__getSqlJoins_closure(this,r))},_getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(r,e,i,n){var a,s,o,l,D,d,c,p,y=this,g=r!=null,m=y.dimensions,h=$.QueryRequestDimension,S=t.ListExtensions_whereIndexed(m,new t.QueryRequest__getRollupSelect_closure(r),h),T=S.get$isEmpty(S)?"":"PARTITION BY "+t.MappedIterable_MappedIterable(S,new t.QueryRequest__getRollupSelect_closure0,S.$ti._eval$1("Iterable.E"),$.String).join$1(0,","),b=$.String;return h=t.List_List$of(t.ListExtensions_mapIndexed(m,new t.QueryRequest__getRollupSelect_closure1(y,e,r,T),h,b),!0,b),a=y.metrics,s=$.JSArray_String,_.JSArray_methods.addAll$1(h,t.IterableExtension_foldIndexed(a,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure2(y,e,r,T))),o=y.sorts,l=t._arrayInstanceType(o),D=l._eval$1("MappedListIterable<1,String>"),_.JSArray_methods.addAll$1(h,new t.MappedListIterable(o,new t.QueryRequest__getRollupSelect_closure3(y,e,r,T),D)),h=_.JSArray_methods.join$1(h,","),d=u.getInterceptor$ax(m),c=t.List_List$of(d.map$1$1(m,new t.QueryRequest__getRollupSelect_closure4(n),b),!0,b),_.JSArray_methods.addAll$1(c,u.fold$2$ax(a,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure5(n,g))),_.JSArray_methods.addAll$1(c,new t.MappedListIterable(o,new t.QueryRequest__getRollupSelect_closure6,D)),c.push(""+g+" _is_rollup"),p="select "+_.JSArray_methods.join$1(c,",")+" from ("+("select "+h+" from "+i)+")",d.get$isNotEmpty(m)&&(m=t.List_List$of(d.map$1$1(m,new t.QueryRequest__getRollupSelect_closure7,b),!0,b),h=l._eval$1("MappedIterable<1,String>"),_.JSArray_methods.addAll$1(m,t.List_List$of(new t.MappedIterable(new t.WhereIterable(o,new t.QueryRequest__getRollupSelect_closure8,l._eval$1("WhereIterable<1>")),new t.QueryRequest__getRollupSelect_closure9,h),!0,h._eval$1("Iterable.E"))),p=p+" group by "+_.JSArray_methods.join$1(m,",")),p},get$_hasFillGap(){var r=u.where$1$ax(this.dimensions,new t.QueryRequest__hasFillGap_closure);return!r.get$isEmpty(r)},_getSqlSelectSorts$1(r){var e,i=this,n=i.rollup;return n==null&&(n=0),e=$.String,e=t.List_List$of(u.map$1$1$ax(u.sublist$2$ax(i.dimensions,0,n),new t.QueryRequest__getSqlSelectSorts_closure(i,r),e),!0,e),e.push("_is_rollup "+(i.rollupPosition==="BOTTOM"?"ASC":"DESC")),_.JSArray_methods.addAll$1(e,_.JSArray_methods.fold$2(i.sorts,t._setArrayType([],$.JSArray_String),new t.QueryRequest__getSqlSelectSorts_closure0(r)))," ORDER BY "+_.JSArray_methods.join$1(e,",")},_getSortedLimitTable$2$schemaLibrary$sourceTableName(r,e){var i,n=this.limit,a=n!=null?" LIMIT "+t.S(n):"";return n=this.sorts,i=n.length!==0?" ORDER BY "+u.join$1$ax(_.JSArray_methods.fold$2(n,t._setArrayType([],$.JSArray_String),new t.QueryRequest__getSortedLimitTable_closure(r)),","):"","SELECT * from "+e+i+a},getSqlSelect$1(r){var e,i,n,a,s,o,l,D,d=this,c="source_table",p=d.dimensions,y=u.getInterceptor$asx(p);if(y.get$isEmpty(p)&&u.get$isEmpty$asx(d.metrics))throw t.wrapException(t.Exception_Exception("column is empty"));for(e=d._getSourceTable$1$schemaLibrary(r),i="with source_table as ("+e.sql+")",i=d.get$_hasFillGap()?i+",fill_gap_table as ("+d._getFillGapTable$2$schemaLibrary$sourceTableName(r,c)+"),full_table as ("+d._getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName("fill_gap_table",r,c)+")":i+",full_table as (SELECT * FROM source_table)",i=i+",aggregated_table as ("+d._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(null,r,"full_table",!1)+"),sorted_limit_table as ("+d._getSortedLimitTable$2$schemaLibrary$sourceTableName(r,"aggregated_table")+")",n=d.rollup,n!=null&&y.get$isNotEmpty(p)&&n>=y.get$length(p)&&(n=y.get$length(p)-1),a=n!=null?n+1:0,a<0&&t.throwExpression(t.ArgumentError$("Length must be a non-negative integer: "+a)),s=t._setArrayType(new Array(a),$.JSArray_String),o=0;o<a;++o)s[o]=d._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(o,r,"sorted_limit_table",!0);return l=$.String,D=t.List_List$of(s,!0,l),p=t.List_List$of(y.map$1$1(p,new t.QueryRequest_getSqlSelect_closure,l),!0,l),_.JSArray_methods.addAll$1(p,u.map$1$1$ax(d.metrics,new t.QueryRequest_getSqlSelect_closure0,l)),l=d.sorts,_.JSArray_methods.addAll$1(p,new t.MappedListIterable(l,new t.QueryRequest_getSqlSelect_closure1,t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),p.push("_is_rollup"),D.push("SELECT "+_.JSArray_methods.join$1(p,",")+" FROM sorted_limit_table"),D.length!==0&&(i=i+" "+_.JSArray_methods.join$1(D," UNION ALL ")),p=d._getSqlSelectSorts$1(r),d._transformSqlAlias$2(t.stringReplaceAllUnchecked(i+p,"@TIMEZONE","'"+d.timezone+"'"),e.aliases)},_transformSqlAlias$2(r,e){return e.length===0?r:t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(new t.MappedListIterable(e,t.core_RegExp_escape$closure(),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>")).join$1(0,"|"),!1),new t.QueryRequest__transformSqlAlias_closure,null)},_getSourceTable$1$schemaLibrary(r){var e=this,i=r.getSchema$1(e.schemaName),n=e._getPlainSqlColumns$1(r),a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"),s=new t.MappedListIterable(n,new t.QueryRequest__getSourceTable_closure,a).join$1(0,","),o=i.get$fullMaterializedTableName(),l=t.ReCase$(i.name._name)._getCamelCase$0(),D=e._getSqlJoins$1(r),d=e._getSqlFilters$1(r),c=e._getPlainSqlSorts$1(r),p=t._setArrayType([],$.JSArray_String);return new t._GetSourceTableResponse("SELECT "+new t.MappedListIterable(n,new t.QueryRequest__getSourceTable_closure0(p),a).join$1(0,",")+" FROM ("+("SELECT "+s+" FROM `"+o+"` AS "+l+D+d+c)+")",p)},_getFillGapTable$2$schemaLibrary$sourceTableName(r,e){var i,n,a,s,o,l,D,d,c,p,y,g=this,m=" CROSS JOIN ",h=$.JSArray_String,S=t._setArrayType([],h),T=g._getTimeFilters$1(r.getSchema$1(g.schemaName));for(i=g.dimensions,n=u.getInterceptor$ax(i),a=n.get$iterator(i),s=g.timeDimension!=null,o=g.timezone;a.moveNext$0();)l=a.get$current(),D=l.getColumn$1(r),l.fillGap&&D.dataType===_.DATA_TYPE_1&&s&&(d=l.generateTimestampArraySql$2$timeFilters$timezone(T,o),D=l.option,D.toString,S.push("SELECT "+t.DimensionOptionExtension_formatSql(D,t.uniqueAlias(l.get$alias()),o)+" "+t.uniqueAlias(l.get$alias())+" FROM "+t.S(d)+" "+t.uniqueAlias(l.get$alias())+" GROUP BY "+t.uniqueAlias(l.get$alias())));return a=$.String,c=t.ListExtensions_mapIndexed(S,new t.QueryRequest__getFillGapTable_closure,a,a).join$1(0,m),a=t.List_List$of(n.map$1$1(i,new t.QueryRequest__getFillGapTable_closure0,a),!0,a),_.JSArray_methods.addAll$1(a,u.fold$2$ax(g.metrics,t._setArrayType([],h),new t.QueryRequest__getFillGapTable_closure1(g,r))),s=g.sorts,_.JSArray_methods.addAll$1(a,new t.MappedListIterable(s,new t.QueryRequest__getFillGapTable_closure2(g,r),t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"))),p=t._setArrayType(["SELECT "+_.JSArray_methods.join$1(a,",")+" FROM ("+c+")"],h),y=n.where$1(i,new t.QueryRequest__getFillGapTable_closure3),y.get$isEmpty(y)||p.push("(SELECT DISTINCT "+new t.MappedIterable(y,new t.QueryRequest__getFillGapTable_closure4,y.$ti._eval$1("MappedIterable<1,String>")).join$1(0,",")+" FROM "+e+")"),_.JSArray_methods.join$1(p,m)},_getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName(r,e,i){var n,a="fill_gap_table",s=this.dimensions,o=$.String,l=u.getInterceptor$ax(s),D=t.List_List$of(l.map$1$1(s,new t.QueryRequest__getFullTable_closure(a,i),o),!0,o);return _.JSArray_methods.addAll$1(D,u.fold$2$ax(this.metrics,t._setArrayType([],$.JSArray_String),new t.QueryRequest__getFullTable_closure0(i,a))),n=this.sorts,_.JSArray_methods.addAll$1(D,new t.MappedListIterable(n,new t.QueryRequest__getFullTable_closure1(i,a),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),"SELECT "+_.JSArray_methods.join$1(D,",")+" FROM fill_gap_table LEFT JOIN "+i+" ON "+l.map$1$1(s,new t.QueryRequest__getFullTable_closure2(a,i),o).join$1(0," AND ")}},t.QueryRequest_closure.prototype={call$2(r,e){var i=u.getInterceptor$ax(r),n=i.map$1$1(r,new t.QueryRequest__closure0,$.String).toSet$0(0);return _.JSArray_methods.contains$1(t.List_List$of(n,!0,t._instanceType(n)._precomputed1),t.uniqueAlias(e.get$alias()))||i.add$1(r,e),r},$signature:95},t.QueryRequest__closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_closure0.prototype={call$2(r,e){var i=u.getInterceptor$ax(r),n=i.map$1$1(r,new t.QueryRequest__closure,$.String).toSet$0(0);return _.JSArray_methods.contains$1(t.List_List$of(n,!0,t._instanceType(n)._precomputed1),t.uniqueAlias(e.get$alias()))||i.add$1(r,e),r},$signature:112},t.QueryRequest__closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:16},t.QueryRequest__getJoins_closure.prototype={call$1(r){return u.firstWhere$1$ax(this.schemaLibrary.getSchema$1(this.$this.schemaName).joins,new t.QueryRequest__getJoins__closure(r))},$signature:116},t.QueryRequest__getJoins__closure.prototype={call$1(r){return r.joinSchemaName===this.joinSchemaName},$signature:46},t.QueryRequest_fromJson_closure.prototype={call$1(r){return t.QueryRequestDimension_fromJson(r)},$signature:17},t.QueryRequest_fromJson_closure0.prototype={call$1(r){return t.QueryRequestMetric_fromJson(r)},$signature:23},t.QueryRequest_fromJson_closure1.prototype={call$1(r){return t.EnumByName_byName(_.List_W7J,r)},$signature:24},t.QueryRequest_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:19},t.QueryRequest_fromJson_closure3.prototype={call$1(r){return t.QueryRequestSort_fromJson(r)},$signature:25},t.QueryRequest_fromJson_closure4.prototype={call$1(r){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(r)},$signature:51},t.QueryRequest_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:44},t.QueryRequest_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:27},t.QueryRequest_toJson_closure1.prototype={call$1(r){return r._name},$signature:13},t.QueryRequest_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:20},t.QueryRequest_toJson_closure3.prototype={call$1(r){return r.toJson$0()},$signature:29},t.QueryRequest_toJson_closure4.prototype={call$1(r){return r.toJson$0()},$signature:30},t.QueryRequest_getColumns_closure.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:57},t.QueryRequest_getColumns_closure0.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:58},t.QueryRequest__getPlainSqlColumns_closure.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),i=t.uniqueAlias(r.get$alias()),n=r.dataFormula;return new t._PlainSqlColumn(e,i,r.get$alias(),n)},$signature:59},t.QueryRequest__getPlainSqlColumns_closure0.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),i=t.uniqueAlias(r.get$alias()),n=r.dataFormula;return new t._PlainSqlColumn(e,i,r.get$alias(),n)},$signature:60},t.QueryRequest__getPlainSqlColumns_closure1.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),i=r.get$id(r),n=r.dataFormula;return new t._PlainSqlColumn(e,i,r.get$id(r),n)},$signature:61},t.QueryRequest__getPlainSqlColumns_closure2.prototype={call$2(r,e){var i,n=e.aggregation;return _.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],$.JSArray_AGGREGATION_TYPE),n)&&(n=this.schemaLibrary,i=t.IterableExtension_firstWhereOrNull(n.getSchema$1(e.schemaName).fields,new t.QueryRequest__getPlainSqlColumns__closure),i!=null&&u.add$1$ax(r,new t._PlainSqlColumn(i.getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,null,n,this.$this.timezone),t.uniqueAlias(e.get$alias())+"_sort",t.uniqueAlias(e.get$alias())+"_sort",null))),r},$signature:62},t.QueryRequest__getPlainSqlColumns__closure.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getPlainSqlSorts_closure.prototype={call$1(r){return r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone)+" "+r.type._name},$signature:8},t.QueryRequest__getSqlFilters_closure.prototype={call$1(r){var e=this.$this,i=r.field;return new t.QueryRequestFilter(_.COMPARISON_OPERATOR_0,null,null,new t.QueryRequest__getSqlFilters__closure(e,r).call$0(),e.schemaName,i)},$signature:64},t.QueryRequest__getSqlFilters__closure.prototype={call$0(){var r=this,e=$.JSArray_String,i=t._setArrayType([],e);switch(r.permission.type.index){case 0:i=r.$this.restaurantIds;break;case 1:i=r.$this.warehouseIds;break;case 2:i=r.$this.businessIds;break}return u.get$isEmpty$asx(i)?t._setArrayType(["_"],e):i},$signature:65},t.QueryRequest__getSqlFilters_closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone)},$signature:66},t.QueryRequest__getSqlFilters_closure1.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure2.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure3.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure4.prototype={call$1(r){return"("+r+")"},$signature:4},t.QueryRequest__getSqlJoins_closure.prototype={call$2(r,e){var i,n,a,s,o,l;return r!==""&&(r+=" "),i=this.schemaLibrary,n=i.getSchema$1(e.joinSchemaName),a=t._setArrayType([e.getConditionsSql$1(i)],$.JSArray_String),n.topLevelFilters.timeControl!=null&&(s=t.List_List$of(a,!0,$.String),o=this.$this,l=o._getTimeFilters$1(n),_.JSArray_methods.addAll$1(s,new t.MappedListIterable(l,new t.QueryRequest__getSqlJoins__closure(o,i),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),a=s),s=t.List_List$of(a,!0,$.String),o=n.filters,_.JSArray_methods.addAll$1(s,new t.MappedListIterable(o,new t.QueryRequest__getSqlJoins__closure0(this.$this,i),t._arrayInstanceType(o)._eval$1("MappedListIterable<1,String>")))," "+(r+"left join `"+n.get$fullMaterializedTableName()+"` as "+t.ReCase$(n.name._name)._getCamelCase$0()+" on "+_.JSArray_methods.join$1(s," and "))},$signature:68},t.QueryRequest__getSqlJoins__closure.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlJoins__closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getRollupSelect_closure.prototype={call$2(r,e){var i=this.rollupIndex;return!(i!=null&&r>=i)},$signature:69},t.QueryRequest__getRollupSelect_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure1.prototype={call$2(r,e){var i=this;return e.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(null,t.uniqueAlias(e.get$alias()),r,!1,i.partitions,i.rollupIndex,i.schemaLibrary,i.$this.sorts)},$signature:70},t.QueryRequest__getRollupSelect_closure2.prototype={call$3(r,e,i){var n=this,a=t.uniqueAlias(i.get$alias());return u.add$1$ax(e,i.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(i.aggregation,a,r,!1,n.partitions,n.rollupIndex,n.schemaLibrary,n.$this.sorts)),e},$signature:71},t.QueryRequest__getRollupSelect_closure3.prototype={call$1(r){var e=this,i=r.get$id(r);return r.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r.aggregation,i,9999,!0,e.partitions,e.rollupIndex,e.schemaLibrary,e.$this.sorts)},$signature:8},t.QueryRequest__getRollupSelect_closure4.prototype={call$1(r){var e;return this.useFormula?(e=r.displayFormula,e==null&&(e=t.uniqueAlias(r.get$alias()))):e=t.uniqueAlias(r.get$alias()),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure5.prototype={call$2(r,e){var i,n;return this.useFormula?(i=e.displayFormula,i==null&&(i=t.uniqueAlias(e.get$alias()))):i=t.uniqueAlias(e.get$alias()),n=u.getInterceptor$ax(r),n.add$1(r,"ANY_VALUE("+i+") "+t.uniqueAlias(e.get$alias())),i=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],$.JSArray_AGGREGATION_TYPE),i)&&!this.isRollup&&n.add$1(r,"ANY_VALUE("+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:14},t.QueryRequest__getRollupSelect_closure6.prototype={call$1(r){return r.aggregation!=null?"ANY_VALUE("+r.get$id(r)+") "+r.get$id(r):r.get$id(r)},$signature:8},t.QueryRequest__getRollupSelect_closure7.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure8.prototype={call$1(r){return r.aggregation==null},$signature:34},t.QueryRequest__getRollupSelect_closure9.prototype={call$1(r){return r.get$id(r)},$signature:8},t.QueryRequest__hasFillGap_closure.prototype={call$1(r){return r.fillGap},$signature:9},t.QueryRequest__getSqlSelectSorts_closure.prototype={call$1(r){var e=this.$this,i=t.IterableExtension_firstWhereOrNull(e.sorts,new t.QueryRequest__getSqlSelectSorts__closure(r)),n=r.schemaName,a=r.name,s=i==null?null:i.type;return s==null&&(s=_.SORT_TYPE_0),a=new t.QueryRequestSort(s,null,r.option,r.dataFormula,n,a).getSortSql$2$id$schemaLibrary(t.uniqueAlias(r.get$alias()),this.schemaLibrary),new t.MappedListIterable(a,new t.QueryRequest__getSqlSelectSorts__closure0(e),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>")).join$1(0,",")},$signature:5},t.QueryRequest__getSqlSelectSorts__closure.prototype={call$1(r){var e=this.dimension;return r.schemaName===e.schemaName&&r.name===e.name&&r.dimensionOption==e.option},$signature:34},t.QueryRequest__getSqlSelectSorts__closure0.prototype={call$1(r){var e=this.$this.rollupPosition==="BOTTOM"?"LAST":"FIRST";return r+" NULLS "+e},$signature:4},t.QueryRequest__getSqlSelectSorts_closure0.prototype={call$2(r,e){var i=t.List_List$of(r,!0,$.String);return _.JSArray_methods.addAll$1(i,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),i},$signature:36},t.QueryRequest__getSortedLimitTable_closure.prototype={call$2(r,e){var i=t.List_List$of(r,!0,$.String);return _.JSArray_methods.addAll$1(i,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),i},$signature:36},t.QueryRequest_getSqlSelect_closure.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_getSqlSelect_closure0.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:16},t.QueryRequest_getSqlSelect_closure1.prototype={call$1(r){return r.get$id(r)},$signature:8},t.QueryRequest__transformSqlAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.uniqueAlias(e)},$signature:15},t.QueryRequest__getSourceTable_closure.prototype={call$1(r){return r.field+" "+r.id},$signature:37},t.QueryRequest__getSourceTable_closure0.prototype={call$1(r){var e,i;return this.aliases.push(r.alias),e=r.formula,i=r.id,e!=null?e+" "+i:i},$signature:37},t.QueryRequest__getFillGapTable_closure.prototype={call$2(r,e){return r>0?"("+e+")":e},$signature:117},t.QueryRequest__getFillGapTable_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFillGapTable_closure1.prototype={call$2(r,e){var i,n,a,s=this.schemaLibrary,o=t.IterableExtension_firstWhereOrNull(s.getSchema$1(this.$this.schemaName).fields,new t.QueryRequest__getFillGapTable__closure1(e));return o!=null&&(i=u.getInterceptor$ax(r),i.add$1(r,t.DataTypeExtension_get_defaultSql(o.type)+" "+t.uniqueAlias(e.get$alias())),n=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],$.JSArray_AGGREGATION_TYPE),n)&&(a=t.IterableExtension_firstWhereOrNull(s.getSchema$1(e.schemaName).fields,new t.QueryRequest__getFillGapTable__closure2),a!=null&&i.add$1(r,t.DataTypeExtension_get_defaultSql(a.type)+" "+t.uniqueAlias(e.get$alias())+"_sort"))),r},$signature:14},t.QueryRequest__getFillGapTable__closure1.prototype={call$1(r){return r.name===this.metric.name},$signature:2},t.QueryRequest__getFillGapTable__closure2.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getFillGapTable_closure2.prototype={call$1(r){var e,i=t.IterableExtension_firstWhereOrNull(this.$this.dimensions,new t.QueryRequest__getFillGapTable__closure(r)),n=t.IterableExtension_firstWhereOrNull(this.schemaLibrary.getSchema$1(r.schemaName).fields,new t.QueryRequest__getFillGapTable__closure0(r));return i!=null?e=t.uniqueAlias(i.get$alias()):e=t.S(n==null?null:t.DataTypeExtension_get_defaultSql(n.type)),e+" "+r.get$id(r)},$signature:8},t.QueryRequest__getFillGapTable__closure.prototype={call$1(r){var e=this.sort;return r.schemaName===e.schemaName&&r.name===e.name&&r.option==e.dimensionOption},$signature:9},t.QueryRequest__getFillGapTable__closure0.prototype={call$1(r){return r.name===this.sort.name},$signature:2},t.QueryRequest__getFillGapTable_closure3.prototype={call$1(r){return!r.fillGap},$signature:9},t.QueryRequest__getFillGapTable_closure4.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure.prototype={call$1(r){var e=this.fillGapTableName;return r.fillGap?e+"."+t.uniqueAlias(r.get$alias()):"IFNULL("+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())+","+e+"."+t.uniqueAlias(r.get$alias())+") "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure0.prototype={call$2(r,e){var i,n="IFNULL("+this.sourceTableName+".",a=this.fillGapTableName,s=u.getInterceptor$ax(r);return s.add$1(r,n+t.uniqueAlias(e.get$alias())+","+a+"."+t.uniqueAlias(e.get$alias())+") "+t.uniqueAlias(e.get$alias())),i=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],$.JSArray_AGGREGATION_TYPE),i)&&s.add$1(r,n+t.uniqueAlias(e.get$alias())+"_sort,"+a+"."+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:14},t.QueryRequest__getFullTable_closure1.prototype={call$1(r){return"IFNULL("+this.sourceTableName+"."+r.get$id(r)+","+this.fillGapTableName+"."+r.get$id(r)+") "+r.get$id(r)},$signature:8},t.QueryRequest__getFullTable_closure2.prototype={call$1(r){return this.fillGapTableName+"."+t.uniqueAlias(r.get$alias())+"="+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequestSort.prototype={toJson$0(){var r,e=this,i=e.aggregation;return i=i==null?null:i._name,r=e.dimensionOption,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"type",e.type._name,"aggregation",i,"dimensionOption",r,"dataFormula",e.dataFormula],$.String,$.dynamic)},get$id(r){var e=this,i=e.name.toLowerCase(),n=e.dimensionOption;return n!=null?i=i+"_"+n._name.toLowerCase():(n=e.aggregation,n!=null&&(i=i+"_"+n._name.toLowerCase())),e.schemaName._name.toLowerCase()+"_"+i+"_"+e.type._name.toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){var i=this;return u.firstWhere$1$ax(r.getSchema$1(i.schemaName).fields,new t.QueryRequestSort_getPlainSql_closure(i)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(i.aggregation,i.dimensionOption,r,e)},getSortSql$2$id$schemaLibrary(r,e){var i,n=this,a=e.getSchema$1(n.schemaName),s=u.firstWhere$1$ax(a.fields,new t.QueryRequestSort_getSortSql_closure(n)),o=t._setArrayType([],$.JSArray_String),l=r??n.get$id(n);return _.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3],$.JSArray_AGGREGATION_TYPE),n.aggregation)||(i=s.type,i===_.DATA_TYPE_1?o.push("LENGTH("+l+") "+n.type._name):i===_.DATA_TYPE_0&&o.push(a._materializeTablePrefix+".stringToSortableNumber("+l+") "+n.type._name)),o.push(l+" "+n.type._name),o},getSortSql$1$schemaLibrary(r){return this.getSortSql$2$id$schemaLibrary(null,r)}},t.QueryRequestSort_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestSort_getSortSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestTimeDimension.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["start",r.start,"end",r.end,"timeStart",r.timeStart,"timeEnd",r.timeEnd],$.String,$.dynamic)}},t.FIELD_TYPE.prototype={_enumToString$0(){return"FIELD_TYPE."+this._name}},t.QueryResponseColumn.prototype={toJson$0(){var r,e,i,n=this,a=null,s=n.aggregationType;return s=s==null?a:s._name,r=n.optionType,r=r==null?a:r._name,e=n.timeFormatter,e=e==null?a:e._name,i=n.formatter,i=i==null?a:i._name,t.LinkedHashMap_LinkedHashMap$_literal(["id",n.id,"schema",n.schema._name,"label",n.label,"dataType",n.dataType._name,"fieldType",n.fieldType._name,"aggregationType",s,"optionType",r,"decimal",n.decimal,"timeFormatter",e,"formatter",i,"hide",n.hide,"dateComparison",n.dateComparison],$.String,$.dynamic)}},t.DateTimeRange.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["start",this.start,"end",this.end],$.String,$.dynamic)}},t.QueryResponse.prototype={QueryResponse$map$4$columns$dateRange$rows$timeRange(r,e,i,n){var a,s,o,l,D=t.LinkedHashMap_LinkedHashMap$_empty($.String,$.QueryResponseColumn);for(a=this.columns,s=a.length,o=0;o<a.length;a.length===s||(0,t.throwConcurrentModificationError)(a),++o)l=a[o],D.$indexSet(0,l.id,l);this.rows=u.map$1$1$ax(i,new t.QueryResponse$map_closure(D),$.QueryResponseRow).toList$0(0)},toJson$0(){var r,e=this,i=e.columns,n=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>");return n=t.List_List$of(new t.MappedListIterable(i,new t.QueryResponse_toJson_closure,n),!0,n._eval$1("ListIterable.E")),i=e.rows,r=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["columns",n,"rows",t.List_List$of(new t.MappedListIterable(i,new t.QueryResponse_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),"dateRange",e.dateRange.toJson$0(),"timeRange",e.timeRange.toJson$0()],$.String,$.dynamic)}},t.QueryResponse$map_closure.prototype={call$1(r){var e,i,n,a,s,o,l,D=r.$index(0,"_is_rollup");for(D==null&&(D=!1),e=t.LinkedHashMap_LinkedHashMap$_empty($.String,$.dynamic),i=r.get$entries(r),i=i.get$iterator(i),n=this.columnMap;i.moveNext$0();)a=i.get$current(),s=a.key,o=a.value,!_.JSString_methods.endsWith$1(s,"_GROUP")&&(l=n.$index(0,s),e.$indexSet(0,s,l!=null&&l.fieldType===_.FIELD_TYPE_1?t.DataTypeExtension_toData(l.dataType,o):o));return new t.QueryResponseRow(D,e)},$signature:78},t.QueryResponse_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:79},t.QueryResponse_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:80},t.QueryResponseRow.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["isRollup",this.isRollup,"value",this.value],$.String,$.dynamic)}},t.VisualizationSchema.prototype={VisualizationSchema$5$fields$isJoinOnly$joins$label$name(r,e,i,n,a){_.JSArray_methods.sort$1(this.fields,new t.VisualizationSchema_closure)},toJson$0(){var r=this,e=r.fields,i=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),n=r.joins,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>");return t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name._name,"label",r.label,"fields",t.List_List$of(new t.MappedListIterable(e,new t.VisualizationSchema_toJson_closure,i),!0,i._eval$1("ListIterable.E")),"joins",t.List_List$of(new t.MappedListIterable(n,new t.VisualizationSchema_toJson_closure0,a),!0,a._eval$1("ListIterable.E")),"isJoinOnly",r.isJoinOnly],$.String,$.dynamic)}},t.VisualizationSchema_closure.prototype={call$2(r,e){return _.JSInt_methods.compareTo$1(r.type.index,e.type.index)},$signature:81},t.VisualizationSchema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:82},t.VisualizationSchema_toJson_closure0.prototype={call$1(r){return r._name},$signature:13},t.VisualizationField.prototype={get$filterDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_filterDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$fillGapDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_fillGapDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$isNumericAggregations(){var r=this.aggregations,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_isNumericAggregations_closure,e),!0,e._eval$1("Iterable.E"))},get$joinConditionOperators(){switch(this.type.index){case 2:case 0:case 3:return t._setArrayType([_.COMPARISON_OPERATOR_0],$.JSArray_COMPARISON_OPERATOR);case 1:return t._setArrayType([_.COMPARISON_OPERATOR_0,_.COMPARISON_OPERATOR_6],$.JSArray_COMPARISON_OPERATOR)}},toJson$0(){var r,e,i,n,a,s,o,l,D,d=this,c=d.type,p=d.filterOperators,y=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>");return y=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure,y),!0,y._eval$1("ListIterable.E")),p=d.dimensionOptions,r=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),p=d.aggregations,e=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),p=d.get$filterDimensionOptions(),i=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure2,i),!0,i._eval$1("ListIterable.E")),p=d.get$fillGapDimensionOptions(),n=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),n=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure3,n),!0,n._eval$1("ListIterable.E")),p=d.get$isNumericAggregations(),a=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),a=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure4,a),!0,a._eval$1("ListIterable.E")),p=$.JSArray_DATA_TYPE,s=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c),o=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c)||d.get$isNumericAggregations().length!==0?_.List_cWd:t._setArrayType([],$.JSArray_TIME_FORMATTER),l=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,String>"),l=t.List_List$of(new t.MappedListIterable(o,new t.VisualizationField_toJson_closure5,l),!0,l._eval$1("ListIterable.E")),p=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c)||d.get$isNumericAggregations().length!==0?_.List_Jwp:t._setArrayType([],$.JSArray_FORMATTER_TYPE),o=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),o=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure6,o),!0,o._eval$1("ListIterable.E")),p=d.get$joinConditionOperators(),D=t.instanceType(p)._eval$1("MappedListIterable<1,String>"),t.LinkedHashMap_LinkedHashMap$_literal(["name",d.name,"type",c._name,"label",d.label,"schemaName",d.schemaName._name,"filterOperators",y,"dimensionOptions",r,"aggregations",e,"filterDimensionOptions",i,"fillGapDimensionOptions",n,"isNumericAggregations",a,"isNumericType",s,"timeFormatters",l,"formatters",o,"joinConditionOperators",t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure7,D),!0,D._eval$1("ListIterable.E"))],$.String,$.dynamic)},$eq(r,e){return e==null?!1:e instanceof t.VisualizationField&&this.name===e.name&&this.schemaName===e.schemaName},get$hashCode(r){return _.JSString_methods.get$hashCode(this.name)+t.Primitives_objectHashCode(this.schemaName)}},t.VisualizationField_filterDimensionOptions_closure.prototype={call$1(r){return _.JSArray_methods.contains$1(E.VisualizationField__filterDimensionOptions,r)},$signature:38},t.VisualizationField_fillGapDimensionOptions_closure.prototype={call$1(r){return _.JSArray_methods.contains$1(E.VisualizationField__fillGapDimensionOptions,r)},$signature:38},t.VisualizationField_isNumericAggregations_closure.prototype={call$1(r){return _.JSArray_methods.contains$1(E.VisualizationField__isNumericAggregations,r)},$signature:84},t.VisualizationField_toJson_closure.prototype={call$1(r){return r._name},$signature:39},t.VisualizationField_toJson_closure0.prototype={call$1(r){return r._name},$signature:18},t.VisualizationField_toJson_closure1.prototype={call$1(r){return r._name},$signature:40},t.VisualizationField_toJson_closure2.prototype={call$1(r){return r._name},$signature:18},t.VisualizationField_toJson_closure3.prototype={call$1(r){return r._name},$signature:18},t.VisualizationField_toJson_closure4.prototype={call$1(r){return r._name},$signature:40},t.VisualizationField_toJson_closure5.prototype={call$1(r){return r._name},$signature:88},t.VisualizationField_toJson_closure6.prototype={call$1(r){return r._name},$signature:89},t.VisualizationField_toJson_closure7.prototype={call$1(r){return r._name},$signature:39},t.addonFlattenItemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name",e,e,r),t.Field_Field$string(e,` IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), ' ', @categoryName)
|
|
83
83
|
`,!1,!1,!1,"Category","categoryName",e,` CASE WHEN @category_name IS NULL OR @produc_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN ' ' ELSE @category_name) END
|
|
84
|
-
`,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variantName",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent ID","parentId",e,e,r),t.Field_Field$string(e,"SPLIT(@addonId, '/')[OFFSET(0)]",!1,!1,!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",r)],$.JSArray_Field)},$signature:0},t.addonFlattenItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.adjustmentSchema_closure.prototype={call$1(r){var e=null,i="billCompletedAt",n="isRefund",a="quantity",s="returnId",o="referenceId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,e,"id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Bill time","adjustmentCreatedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",i,i,e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Item ID","itemId","itemId",e,r),t.Field_Field$string("discount amount or percentage. eg, -10%, -5.",e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string("discount type. eg, VOUCHER, MEMBERSHIP, COUNTER, PROMOTION.",e,!1,!1,!1,"Cause","cause","cause",e,r),t.Field_Field$string("discount name. eg, WEDNESDAY 15% OFF, Member Discount.",e,!1,!1,!1,"Reason","reason","reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount user","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount approver","approvedByName","createApprovedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"approvedById","createApprovedBy.id",e,r),t.Field_Field$numeric(e,"IFNULL(@quantity,0)*IF(@isRefund, -1, 1)",!1,!1,"Qty",a,a,"COALESCE(@quantity,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"IFNULL((@quantity*@total),0)*IF(@isRefund, -1, 1)",!1,!1,"Total","total","total","COALESCE((@quantity*@total),0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$string(e,e,!1,!1,!1,"Return ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref ID",o,o,e,r),t.Field_Field$string("Adjusted item name, or 'BILL' for bill-level discounts",e,!1,!1,!1,"Target","target",e,"coalesce((select name from flatten_items where flatten_items.id=@item_id and flatten_items.bill_id=@bill_id and flatten_items.restaurant_id=@restaurant_id), 'BILL')",r)],$.JSArray_Field)},$signature:0},t.adjustmentSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("refId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.billSchema_closure.prototype={call$1(r){var e=null,i="seqNumber",n="deliveryName",a="isRefund",s="isPickup",o="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",S="thirdPartyExtraCharge",T="deliveryFee",b="nettTotal",F="deliveryFeeWithTax",M="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string("Values: COMPLETED, DRAFT, VOIDED, REFUNDED",e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",i,i,e,r),t.Field_Field$string("Dine-in table name/identifier",e,!1,!1,!1,"Table","slot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Delivery",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID","refundFrom","refundedFrom",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundedById","refund.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user","refundedByName","refund.by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund reason","refundReason","refund.reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","membership.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member user ID","memberUserId","membership.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberUserName","membership.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Member birthday","memberBirthday","membership.birthday",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string("Order source. Values: FEEDME (POS), GRABFOOD, FOODPANDA, SHOPEEFOOD, etc.",e,!1,!1,!1,"Source","source","source",A.x28case_,r),t.Field_Field$string("Order type. Values: DINE IN, TAKEAWAY, PICKUP, DELIVERY, DRIVE THRU",e,!1,!1,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when upper(@type)='DRIVE THRU' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",r),t.Field_Field$bool(e,e,!0,!1,"Pickup",s,s,e,r),t.Field_Field$bool(e,e,!0,!1,"Is in house delivery",o,o,e,r),t.Field_Field$bool(e,e,!0,!1,"Is other delivery",l,l,e,r),t.Field_Field$bool(e,e,!0,!1,"Is takeaway","isTakeaway","is.takeaway",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Closed at",D,D,e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,r),t.Field_Field$numeric("Number of guests. Negated for refund, 0 for voided","IF(@status = 'VOIDED', 0, IFNULL(@pax,0)*IF(@isRefund, -1, 1))",!1,!1,"Pax","pax","person","(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",r),t.Field_Field$string(e,e,!1,!1,!1,"Integrated order ID",d,d,e,r),t.Field_Field$numeric(e,A.IFNULLi,!0,!1,"Item count",c,c,A.COALESi,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Tax",p,p,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLdiT,!1,!1,"Discount",y,y,A.COALESdit,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Item gross",g,g,A.COALESg,r),t.Field_Field$numeric(e,A.x28IFNULnI,!1,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,!1,"Rounding",m,m,A.COALESr,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,r),t.Field_Field$string(e,e,!0,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,r),t.Field_Field$numeric(e,A.IFNULLs,!1,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,r),t.Field_Field$string(e,e,!0,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,r),t.Field_Field$numeric(e,A.x28IFNULo,!1,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,r),t.Field_Field$numeric(e,A.x28IFNULgx2d,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,r),t.Field_Field$numeric(e,A.IFNULLta,!1,!1,"Takeaway",h,h,A.COALEStak,r),t.Field_Field$numeric(e,A.IFNULLth,!1,!1,"Extra charge",S,S,A.COALESth,r),t.Field_Field$numeric(e,A.IFNULLde_,!1,!1,"Delivery fee",T,T,A.COALESdex2c,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",b,b,A.COALESn,r),t.Field_Field$numeric(e,A.x28IFNULgx2bd,!1,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,r),t.Field_Field$numeric(e,A.x28IFNULn_,!1,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,r),t.Field_Field$numeric(e,e,!1,!1,"Member Recency","recency",e,A.MIN_EX,r),t.Field_Field$numeric(e,e,!1,!1,"Member frequency","frequency",e,A.COUNT_,r),t.Field_Field$numeric(e,e,!1,!1,"Member monetary","monetary",e,A.SUM__n,r),t.Field_Field$numeric(e,A.IFNULLdeWT,!1,!1,"Delivery fee with tax",F,F,A.COALESdex5f_,r),t.Field_Field$numeric(e,A.IFNULLdeWo,!1,!1,"Delivery fee without tax",M,M,A.COALESdex5fo,r),t.Field_Field$numeric(e,A.IFNULLoT,!1,!1,"Other charge with tax",I,I,A.COALESo_,r),t.Field_Field$numeric(e,A.IFNULLoo,!1,!1,"Other charge without tax",x,x,A.COALESoo,r),t.Field_Field$numeric("Bill duration in seconds from creation to completion",e,!1,!1,"Duration","duration",e,A.EXTRAC,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant","restaurantName",e,A.x28selecn,r),t.Field_Field$numeric(e,e,!1,!1,"Labour hour","labourHour",e,A.x28selecS,r),t.Field_Field$string(e,e,!1,!1,!1,"Payments","payments",e,A.x28selecstdn,r),t.Field_Field$string(e,e,!1,!1,!1,"Items","items",e,A.x28selecstC,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount reasons","discountReasons",e,A.x28selecstda,r),t.Field_Field$numeric(e,A.IFNULLdiI,!1,!1,"Discount inc tax",R,R,A.COALESdii,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,r),t.Field_Field$numeric(e,e,!1,!1,"Is new member","isNewMember",e,"(CASE WHEN EXISTS (SELECT 1 FROM members WHERE members.id=@member_id AND members.created_at::date = @created_at::date) THEN 1 ELSE 0 END)",r),t.Field_Field$numeric(e,e,!1,!1,"Is 30 days recency","is30DaysRecency",e,"(CASE WHEN EXISTS (SELECT 1 FROM bills WHERE bills.member_id = @member_id AND bills.status != 'VOIDED' AND bills.restaurant_id = @restaurant_id AND bills.created_at >= @created_at - INTERVAL '30 days' AND bills.created_at < @created_at) THEN 1 ELSE 0 END)",r),t.Field_Field$numeric("Bill count flag: 1 normal, -1 refund, 0 voided. Use SUM to count bills","IF(@status = 'VOIDED', 0, IF(@isRefund, -1, 1))",!1,!1,"Table count","tableCount",e,"(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",r)],$.JSArray_Field)},$signature:0},t.billSchema_closure0.prototype={call$1(r){var e="id",i="restaurantId",n=null,a="billId",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n)],$.JSArray_Join)},$signature:1},t.businessSchema_closure.prototype={call$1(r){var e=null,i="expiredAt",n="restaurantQuota",a="warehouseQuota",s="internal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Agent ID","agentId","agentId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Owner ID","ownerId","ownerId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired at",i,i,e,r),t.Field_Field$numeric(e,e,!0,!1,e,n,n,e,r),t.Field_Field$numeric(e,e,!0,!1,e,a,a,e,r),t.Field_Field$bool(e,e,!0,!1,e,s,s,e,r)],$.JSArray_Field)},$signature:0},t.businessSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.campaignSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="restaurantId",a="description",s="collectibleId",o="templateId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Description",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Started at","startedAt","start",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Ended at","endedAt","end",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Template ID",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Group ID","groupId","groupId",e,r),t.Field_Field$bool(e,e,!1,!1,"Active","active",e,"((@ended_at is null or @ended_at >= !end) and (@started_at is null or @started_at <= !start))",r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Event type","eventType","event.type",e,r)],$.JSArray_Field)},$signature:0},t.campaignSchema_closure0.prototype={call$1(r){var e="businessId",i=null,n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType(["collectibleId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("campaignId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i)],$.JSArray_Join)},$signature:1},t.campaignTierSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="campaignId",a="memberCount";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Campaign ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$numeric(e,e,!1,!1,"From","fromPoint","from",e,r),t.Field_Field$numeric(e,e,!1,!1,"To","toPoint","to",e,r),t.Field_Field$numeric(e,e,!1,!1,"Member count",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Rank","rank","no",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Range","range",e,"concat(@from_point,' - ',@to_point)",r)],$.JSArray_Field)},$signature:0},t.campaignTierSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("docId",t._setArrayType(["campaignId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.chargeSchema_closure.prototype={call$1(r){var e=null,i="parentId",n="isRefund",a="beforeDiscount",s="inclusive",o="percentage";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variant","variant",e,r),t.Field_Field$string("Charge type, e.g. SERVICE_CHARGE, SST, VAT, OTHER_CHARGE",e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",n,n,e,r),t.Field_Field$bool(e,e,!1,!1,"Before Discount",a,a,e,r),t.Field_Field$bool("Whether the charge is already included in item prices",e,!1,!1,"Inclusive",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Percentage",o,o,e,r),t.Field_Field$numeric(e,"@total*IF(@isRefund, -1, 1)",!1,!1,"Total","total","total","@total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r)],$.JSArray_Field)},$signature:0},t.chargeSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("id",t._setArrayType(["parentId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.closingDraftSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingId",a="closingAdjustmentId",s="approveRemark",o="effectiveAt",l="approvedAt",D="updatedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approved remark",s,s,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user ID","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approve user","approvedByName","approvedBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approve user ID","approvedById","approvedBy.id",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Approve time",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Update user","updatedByName","updatedBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Update user ID","updatedById","updatedBy.id",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Update time",D,D,e,r)],$.JSArray_Field)},$signature:0},t.closingDraftSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.closingDraftSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingDraftId",a="closingAdjustmentId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing draft ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment ID",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r)],$.JSArray_Field)},$signature:0},t.closingDraftSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.closingSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingId",a="weightedAverage";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r),t.Field_Field$numeric(e,e,!1,!1,"Balance","balance","balance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r),t.Field_Field$numeric(e,e,!1,!1,"Weighted average",a,a,e,r)],$.JSArray_Field)},$signature:0},t.closingSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.collectibleCollectionSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="collectibleId",a="expiredAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max use","maxUse","options.maxUse",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired time",a,a,"(case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Applied time","appliedAt",e,"(select created_at from collectible_transactions where (collectible_transactions.source!='CYCLE' AND collectible_transactions.amount<0 AND collectible_transactions.refunded is not true) AND collectible_transactions.collection_id=@id order by collectible_transactions.created_at desc limit 1)",r),t.Field_Field$bool(e,e,!1,!1,"Is expired","isExpired",e,"CASE WHEN (case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end) < CURRENT_TIMESTAMP THEN true ELSE false END",r),t.Field_Field$numeric(e,e,!1,!1,"Applied count","appliedCount",e,"(select -sum(collectible_transactions.amount) from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.refunded is not true and collectible_transactions.amount<0 and collectible_transactions.source!='CYCLE')",r)],$.JSArray_Field)},$signature:0},t.collectibleCollectionSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["collectibleId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("collectionId",t._setArrayType(["id"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.collectibleConfigSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="description";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Description",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max distribution","maxDistribution","options.maxReceive",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max distribution per user","maxDistributePerUser","options.maxPerUser",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max use per collectible","maxUsePerCollectible","options.maxUse",e,r)],$.JSArray_Field)},$signature:0},t.collectibleConfigSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("collectibleId",t._setArrayType(["id"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.collectibleTransactionSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="collectionId",a="collectibleId",s="fromBalance",o="toBalance",l="expiredAt",D="refundedFrom",d="refunded";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collection ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref ID","refId","refId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"From balance",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"To balance",o,o,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired at",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ref ID",D,D,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Campaign ID","campaignId","metadata.campaign","(case when @campaign_id is not null then @campaign_id else (select min(child.id) from campaigns child where child.collectible_id=@collectible_id) end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$numeric(e,e,!1,!1,"Quantity distributed","qtyDistributed",e,"case when @amount>=0 and @refunded is not true and @refunded_from is null then @amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Quantity usage","qtyUsage",e,"case when @amount<0 and @source!='CYCLE' and @refunded is not true then -@amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Quantity expired","qtyExpired",e,"case when @amount<0 and @source='CYCLE' and @refunded is not true then -@amount else 0 end",r),t.Field_Field$string(e,e,!1,!1,!1,"Transaction ID","transactionId",e,"@doc_id",r),t.Field_Field$string(e,e,!1,!1,!1,"Transformed source","transformedSource",e,"(case when @source='PORTAL' then 'ADMIN' when @source='BENEFIT' then 'MEMBERSHIP' when @source='CYCLE' then 'EXPIRED' when @source='BILL' then (case when @amount<0 then 'USAGE' when @refunded_from is not null then 'RETURN' else 'DISTRIBUTE' end) else @source end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Credit type","creditType",e,"case when @expired_at is null then 'NORMAL' else 'FREE' end",r),t.Field_Field$bool(e,e,!0,!1,"Refunded",d,d,e,r)],$.JSArray_Field)},$signature:0},t.collectibleTransactionSchema_closure0.prototype={call$1(r){var e="id",i="businessId",n=null,a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["refId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectibleId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_67,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectionId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["campaignId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["userId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n)],$.JSArray_Join)},$signature:1},t.completeTimeBillSchema_closure.prototype={call$1(r){var e=null,i="seqNumber",n="deliveryName",a="isRefund",s="isPickup",o="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",S="thirdPartyExtraCharge",T="deliveryFee",b="nettTotal",F="deliveryFeeWithTax",M="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Table","slot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Delivery",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID","refundFrom","refundedFrom",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundedById","refund.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user","refundedByName","refund.by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund reason","refundReason","refund.reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","membership.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member user ID","memberUserId","membership.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberUserName","membership.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Member birthday","memberBirthday","membership.birthday",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",A.x28case_,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",r),t.Field_Field$bool(e,e,!0,!1,"Pickup",s,s,e,r),t.Field_Field$bool(e,e,!0,!1,"Is in house delivery",o,o,e,r),t.Field_Field$bool(e,e,!0,!1,"Is other delivery",l,l,e,r),t.Field_Field$bool(e,e,!0,!1,"Is takeaway","isTakeaway","is.takeaway",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Closed at",D,D,e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,r),t.Field_Field$numeric(e,"IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,!1,"Pax","pax","person",A.COALESp,r),t.Field_Field$string(e,e,!1,!1,!1,"Integrated order ID",d,d,e,r),t.Field_Field$numeric(e,A.IFNULLi,!0,!1,"Item count",c,c,A.COALESi,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Tax",p,p,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLdiT,!1,!1,"Discount",y,y,A.COALESdit,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Item gross",g,g,A.COALESg,r),t.Field_Field$numeric(e,A.x28IFNULnI,!1,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,!1,"Rounding",m,m,A.COALESr,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,r),t.Field_Field$string(e,e,!0,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,r),t.Field_Field$numeric(e,A.IFNULLs,!1,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,r),t.Field_Field$string(e,e,!0,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,r),t.Field_Field$numeric(e,A.x28IFNULo,!1,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,r),t.Field_Field$numeric(e,A.x28IFNULgx2d,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,r),t.Field_Field$numeric(e,A.IFNULLta,!1,!1,"Takeaway",h,h,A.COALEStak,r),t.Field_Field$numeric(e,A.IFNULLth,!1,!1,"Extra charge",S,S,A.COALESth,r),t.Field_Field$numeric(e,A.IFNULLde_,!1,!1,"Delivery fee",T,T,A.COALESdex2c,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",b,b,A.COALESn,r),t.Field_Field$numeric(e,A.x28IFNULgx2bd,!1,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,r),t.Field_Field$numeric(e,A.x28IFNULn_,!1,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,r),t.Field_Field$numeric(e,e,!1,!1,"Member Recency","recency",e,A.MIN_EX,r),t.Field_Field$numeric(e,e,!1,!1,"Member frequency","frequency",e,A.COUNT_,r),t.Field_Field$numeric(e,e,!1,!1,"Member monetary","monetary",e,A.SUM__n,r),t.Field_Field$numeric(e,A.IFNULLdeWT,!1,!1,"Delivery fee with tax",F,F,A.COALESdex5f_,r),t.Field_Field$numeric(e,A.IFNULLdeWo,!1,!1,"Delivery fee without tax",M,M,A.COALESdex5fo,r),t.Field_Field$numeric(e,A.IFNULLoT,!1,!1,"Other charge with tax",I,I,A.COALESo_,r),t.Field_Field$numeric(e,A.IFNULLoo,!1,!1,"Other charge without tax",x,x,A.COALESoo,r),t.Field_Field$numeric(e,e,!1,!1,"Duration","duration",e,A.EXTRAC,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant","restaurantName",e,A.x28selecn,r),t.Field_Field$numeric(e,e,!1,!1,"Labour hour","labourHour",e,A.x28selecS,r),t.Field_Field$string(e,e,!1,!1,!1,"Payments","payments",e,A.x28selecstdn,r),t.Field_Field$string(e,e,!1,!1,!1,"Items","items",e,A.x28selecstC,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount reasons","discountReasons",e,A.x28selecstda,r),t.Field_Field$numeric(e,A.IFNULLdiI,!1,!1,"Discount inc tax",R,R,A.COALESdii,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,r)],$.JSArray_Field)},$signature:0},t.completeTimeBillSchema_closure0.prototype={call$1(r){var e="id",i="restaurantId",n=null,a="billId",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n)],$.JSArray_Join)},$signature:1},t.counterSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.counterSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.creditTransactionSchema_closure.prototype={call$1(r){var e=null,i="refunded",n="freeAmount",a="normalAmount",s="totalAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","restaurant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","member",e,r),t.Field_Field$bool(e,e,!1,!1,"Is refund",i,i,e,r),t.Field_Field$string("Transaction source, e.g. POS, ADMIN, REWARD",e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$numeric("Bonus/complimentary credit amount",e,!1,!1,"Free",n,n,e,r),t.Field_Field$numeric("Earned/paid credit amount",e,!1,!1,"Normal",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Total",s,s,e,r)],$.JSArray_Field)},$signature:0},t.creditTransactionSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.drawerSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"userId","user.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","userName","user.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reason","reason","reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter ID","counterId","counter.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter","counterName","counter.name",e,r),t.Field_Field$numeric("Cash in/out amount. Positive = in, negative = out",e,!1,!1,"Total","amount","amount",e,r),t.Field_Field$string("Values: IN or OUT. Derived from amount sign","IF(@amount>=0, 'IN', 'OUT')",!1,!1,!1,"Type","type",e,"CASE WHEN @amount>=0 THEN 'IN' ELSE 'OUT' END",r),t.Field_Field$numeric(e,"IF(@amount>=0, @amount, 0)",!1,!1,"In","in",e,A.CASE_Wax3e,r),t.Field_Field$numeric(e,"IF(@amount<0, @amount, 0)",!1,!1,"Out","out",e,A.CASE_Wax3c,r)],$.JSArray_Field)},$signature:0},t.drawerSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.flattenItemSchema_closure.prototype={call$1(r){var e=null,i="itemCreatedAt",n="billCompletedAt",a="perXUnit",s="takeawayId",o="takeawayName",l="productId",D="isRefund",d="servedAt",c="isTakeaway",p="quantity",y="unitQuantity",g="billAdjustmentTotal",m="itemAdjustmentTotal",h="grossTotal",S="takeawayPrice",T="nettTotal",b="layerNettTotal",F="layerBillAdjustmentTotal",M="layerItemAdjustmentTotal",I="layerGrossTotal",x="layerTakeawayPrice",R="layerTaxTotal",L="layerScTotal",O="layerOtherChargeTotal",v="customAttributes",z="layerZeroParentId",c0="collectedAt",p0="subCategories",f0="billAdjustmentInclusiveTaxTotal",$0="itemAdjustmentInclusiveTaxTotal",y0="layerBillAdjustmentInclusiveTaxTotal",g0="layerItemAdjustmentInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Item time",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string("Values: DRAFT, VOIDED, SENT. DRAFT and SENT both considered valid sales.",e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!0,"Name","name","name",e,r),t.Field_Field$numeric(e,e,!1,!1,"Per unit",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit","unit","unit",e,r),t.Field_Field$string(e,`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), 'Other', @categoryName)
|
|
84
|
+
`,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variantName",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent ID","parentId",e,e,r),t.Field_Field$string(e,"SPLIT(@addonId, '/')[OFFSET(0)]",!1,!1,!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",r)],$.JSArray_Field)},$signature:0},t.addonFlattenItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.adjustmentSchema_closure.prototype={call$1(r){var e=null,i="billCompletedAt",n="isRefund",a="quantity",s="returnId",o="referenceId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,e,"id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Bill time","adjustmentCreatedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",i,i,e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Item ID","itemId","itemId",e,r),t.Field_Field$string("discount amount or percentage. eg, -10%, -5.",e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string("discount type. eg, VOUCHER, MEMBERSHIP, COUNTER, PROMOTION.",e,!1,!1,!1,"Cause","cause","cause",e,r),t.Field_Field$string("discount name. eg, WEDNESDAY 15% OFF, Member Discount.",e,!1,!1,!1,"Reason","reason","reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount user","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount approver","approvedByName","createApprovedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"approvedById","createApprovedBy.id",e,r),t.Field_Field$numeric(e,"IFNULL(@quantity,0)*IF(@isRefund, -1, 1)",!1,!1,"Qty",a,a,"COALESCE(@quantity,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"IFNULL((@quantity*@total),0)*IF(@isRefund, -1, 1)",!1,!1,"Total","total","total","COALESCE((@quantity*@total),0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$string(e,e,!1,!1,!1,"Return ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref ID",o,o,e,r),t.Field_Field$string("Adjusted item name, or 'BILL' for bill-level discounts",e,!1,!1,!1,"Target","target",e,"coalesce((select name from flatten_items where flatten_items.id=@item_id and flatten_items.bill_id=@bill_id and flatten_items.restaurant_id=@restaurant_id), 'BILL')",r)],$.JSArray_Field)},$signature:0},t.adjustmentSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("refId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.billSchema_closure.prototype={call$1(r){var e=null,i="seqNumber",n="deliveryName",a="isRefund",s="isPickup",o="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",S="thirdPartyExtraCharge",T="deliveryFee",b="nettTotal",F="deliveryFeeWithTax",M="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string("Values: COMPLETED, DRAFT, VOIDED, REFUNDED",e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",i,i,e,r),t.Field_Field$string("Dine-in table name/identifier",e,!1,!1,!1,"Table","slot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Delivery",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID","refundFrom","refundedFrom",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundedById","refund.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user","refundedByName","refund.by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund reason","refundReason","refund.reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","membership.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member user ID","memberUserId","membership.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberUserName","membership.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Member birthday","memberBirthday","membership.birthday",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string("Order source. Values: FEEDME (POS), GRABFOOD, FOODPANDA, SHOPEEFOOD, etc.",e,!1,!1,!1,"Source","source","source",A.x28case_,r),t.Field_Field$string("Order type. Values: DINE IN, TAKEAWAY, PICKUP, DELIVERY, DRIVE THRU",e,!1,!1,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when upper(@type)='DRIVE THRU' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",r),t.Field_Field$bool(e,e,!0,!1,"Pickup",s,s,e,r),t.Field_Field$bool(e,e,!0,!1,"Is in house delivery",o,o,e,r),t.Field_Field$bool(e,e,!0,!1,"Is other delivery",l,l,e,r),t.Field_Field$bool(e,e,!0,!1,"Is takeaway","isTakeaway","is.takeaway",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Closed at",D,D,e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,r),t.Field_Field$numeric("Number of guests. Negated for refund, 0 for voided","IF(@status = 'VOIDED', 0, IFNULL(@pax,0)*IF(@isRefund, -1, 1))",!1,!1,"Pax","pax","person","(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",r),t.Field_Field$string(e,e,!1,!1,!1,"Integrated order ID",d,d,e,r),t.Field_Field$numeric(e,A.IFNULLi,!0,!1,"Item count",c,c,A.COALESi,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Tax",p,p,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLdiT,!1,!1,"Discount",y,y,A.COALESdit,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Item gross",g,g,A.COALESg,r),t.Field_Field$numeric(e,A.x28IFNULnI,!1,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,!1,"Rounding",m,m,A.COALESr,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,r),t.Field_Field$string(e,e,!0,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,r),t.Field_Field$numeric(e,A.IFNULLs,!1,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,r),t.Field_Field$string(e,e,!0,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,r),t.Field_Field$numeric(e,A.x28IFNULo,!1,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,r),t.Field_Field$numeric(e,A.x28IFNULgx2d,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,r),t.Field_Field$numeric(e,A.IFNULLta,!1,!1,"Takeaway",h,h,A.COALEStak,r),t.Field_Field$numeric(e,A.IFNULLth,!1,!1,"Extra charge",S,S,A.COALESth,r),t.Field_Field$numeric(e,A.IFNULLde_,!1,!1,"Delivery fee",T,T,A.COALESdex2c,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",b,b,A.COALESn,r),t.Field_Field$numeric(e,A.x28IFNULgx2bd,!1,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,r),t.Field_Field$numeric(e,A.x28IFNULn_,!1,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,r),t.Field_Field$numeric(e,e,!1,!1,"Member Recency","recency",e,A.MIN_EX,r),t.Field_Field$numeric(e,e,!1,!1,"Member frequency","frequency",e,A.COUNT_,r),t.Field_Field$numeric(e,e,!1,!1,"Member monetary","monetary",e,A.SUM__n,r),t.Field_Field$numeric(e,A.IFNULLdeWT,!1,!1,"Delivery fee with tax",F,F,A.COALESdex5f_,r),t.Field_Field$numeric(e,A.IFNULLdeWo,!1,!1,"Delivery fee without tax",M,M,A.COALESdex5fo,r),t.Field_Field$numeric(e,A.IFNULLoT,!1,!1,"Other charge with tax",I,I,A.COALESo_,r),t.Field_Field$numeric(e,A.IFNULLoo,!1,!1,"Other charge without tax",x,x,A.COALESoo,r),t.Field_Field$numeric("Bill duration in seconds from creation to completion",e,!1,!1,"Duration","duration",e,A.EXTRAC,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant","restaurantName",e,A.x28selecn,r),t.Field_Field$numeric(e,e,!1,!1,"Labour hour","labourHour",e,A.x28selecS,r),t.Field_Field$string(e,e,!1,!1,!1,"Payments","payments",e,A.x28selecstdn,r),t.Field_Field$string(e,e,!1,!1,!1,"Items","items",e,A.x28selecstC,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount reasons","discountReasons",e,A.x28selecstda,r),t.Field_Field$numeric(e,A.IFNULLdiI,!1,!1,"Discount inc tax",R,R,A.COALESdii,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,r),t.Field_Field$numeric(e,e,!1,!1,"Is new member","isNewMember",e,"(CASE WHEN EXISTS (SELECT 1 FROM members WHERE members.id=@member_id AND members.created_at::date = @created_at::date) THEN 1 ELSE 0 END)",r),t.Field_Field$numeric(e,e,!1,!1,"Is 30 days recency","is30DaysRecency",e,"(CASE WHEN EXISTS (SELECT 1 FROM bills WHERE bills.member_id = @member_id AND bills.status != 'VOIDED' AND bills.restaurant_id = @restaurant_id AND bills.created_at >= @created_at - INTERVAL '30 days' AND bills.created_at < @created_at) THEN 1 ELSE 0 END)",r),t.Field_Field$numeric("Bill count flag: 1 normal, -1 refund, 0 voided. Use SUM to count bills","IF(@status = 'VOIDED', 0, IF(@isRefund, -1, 1))",!1,!1,"Table count","tableCount",e,"(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",r)],$.JSArray_Field)},$signature:0},t.billSchema_closure0.prototype={call$1(r){var e="id",i="restaurantId",n=null,a="billId",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n)],$.JSArray_Join)},$signature:1},t.businessSchema_closure.prototype={call$1(r){var e=null,i="expiredAt",n="restaurantQuota",a="warehouseQuota",s="internal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Agent ID","agentId","agentId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Owner ID","ownerId","ownerId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired at",i,i,e,r),t.Field_Field$numeric(e,e,!0,!1,e,n,n,e,r),t.Field_Field$numeric(e,e,!0,!1,e,a,a,e,r),t.Field_Field$bool(e,e,!0,!1,e,s,s,e,r)],$.JSArray_Field)},$signature:0},t.businessSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.campaignSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="restaurantId",a="description",s="collectibleId",o="templateId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Description",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Started at","startedAt","start",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Ended at","endedAt","end",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Template ID",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Group ID","groupId","groupId",e,r),t.Field_Field$bool(e,e,!1,!1,"Active","active",e,"((@ended_at is null or @ended_at >= !end) and (@started_at is null or @started_at <= !start))",r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Event type","eventType","event.type",e,r)],$.JSArray_Field)},$signature:0},t.campaignSchema_closure0.prototype={call$1(r){var e="businessId",i=null,n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType(["collectibleId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("campaignId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i)],$.JSArray_Join)},$signature:1},t.campaignTierSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="campaignId",a="memberCount";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Campaign ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$numeric(e,e,!1,!1,"From","fromPoint","from",e,r),t.Field_Field$numeric(e,e,!1,!1,"To","toPoint","to",e,r),t.Field_Field$numeric(e,e,!1,!1,"Member count",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Rank","rank","no",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Range","range",e,"concat(@from_point,' - ',@to_point)",r)],$.JSArray_Field)},$signature:0},t.campaignTierSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("docId",t._setArrayType(["campaignId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.chargeSchema_closure.prototype={call$1(r){var e=null,i="parentId",n="isRefund",a="beforeDiscount",s="inclusive",o="percentage";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variant","variant",e,r),t.Field_Field$string("Charge type, e.g. SERVICE_CHARGE, SST, VAT, OTHER_CHARGE",e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",n,n,e,r),t.Field_Field$bool(e,e,!1,!1,"Before Discount",a,a,e,r),t.Field_Field$bool("Whether the charge is already included in item prices",e,!1,!1,"Inclusive",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Percentage",o,o,e,r),t.Field_Field$numeric(e,"@total*IF(@isRefund, -1, 1)",!1,!1,"Total","total","total","@total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r)],$.JSArray_Field)},$signature:0},t.chargeSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("id",t._setArrayType(["parentId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.closingDraftSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingId",a="closingAdjustmentId",s="approveRemark",o="effectiveAt",l="approvedAt",D="updatedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approved remark",s,s,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user ID","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approve user","approvedByName","approvedBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Approve user ID","approvedById","approvedBy.id",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Approve time",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Update user","updatedByName","updatedBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Update user ID","updatedById","updatedBy.id",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Update time",D,D,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Formatted ID","formattedId",e,e,r)],$.JSArray_Field)},$signature:0},t.closingDraftSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.closingDraftSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingDraftId",a="closingAdjustmentId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing draft ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment ID",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r)],$.JSArray_Field)},$signature:0},t.closingDraftSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.closingSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="closingId",a="weightedAverage";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Closing ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r),t.Field_Field$numeric(e,e,!1,!1,"Balance","balance","balance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r),t.Field_Field$numeric(e,e,!1,!1,"Weighted average",a,a,e,r)],$.JSArray_Field)},$signature:0},t.closingSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.collectibleCollectionSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="collectibleId",a="expiredAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max use","maxUse","options.maxUse",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired time",a,a,"(case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Applied time","appliedAt",e,"(select created_at from collectible_transactions where (collectible_transactions.source!='CYCLE' AND collectible_transactions.amount<0 AND collectible_transactions.refunded is not true) AND collectible_transactions.collection_id=@id order by collectible_transactions.created_at desc limit 1)",r),t.Field_Field$bool(e,e,!1,!1,"Is expired","isExpired",e,"CASE WHEN (case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end) < CURRENT_TIMESTAMP THEN true ELSE false END",r),t.Field_Field$numeric(e,e,!1,!1,"Applied count","appliedCount",e,"(select -sum(collectible_transactions.amount) from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.refunded is not true and collectible_transactions.amount<0 and collectible_transactions.source!='CYCLE')",r)],$.JSArray_Field)},$signature:0},t.collectibleCollectionSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["collectibleId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("collectionId",t._setArrayType(["id"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.collectibleConfigSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="description";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Description",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max distribution","maxDistribution","options.maxReceive",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max distribution per user","maxDistributePerUser","options.maxPerUser",e,r),t.Field_Field$numeric(e,e,!1,!1,"Max use per collectible","maxUsePerCollectible","options.maxUse",e,r)],$.JSArray_Field)},$signature:0},t.collectibleConfigSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("collectibleId",t._setArrayType(["id"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.collectibleTransactionSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="collectionId",a="collectibleId",s="fromBalance",o="toBalance",l="expiredAt",D="refundedFrom",d="refunded";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collection ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Collectible ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref ID","refId","refId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"From balance",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"To balance",o,o,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired at",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ref ID",D,D,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Campaign ID","campaignId","metadata.campaign","(case when @campaign_id is not null then @campaign_id else (select min(child.id) from campaigns child where child.collectible_id=@collectible_id) end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$numeric(e,e,!1,!1,"Quantity distributed","qtyDistributed",e,"case when @amount>=0 and @refunded is not true and @refunded_from is null then @amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Quantity usage","qtyUsage",e,"case when @amount<0 and @source!='CYCLE' and @refunded is not true then -@amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Quantity expired","qtyExpired",e,"case when @amount<0 and @source='CYCLE' and @refunded is not true then -@amount else 0 end",r),t.Field_Field$string(e,e,!1,!1,!1,"Transaction ID","transactionId",e,"@doc_id",r),t.Field_Field$string(e,e,!1,!1,!1,"Transformed source","transformedSource",e,"(case when @source='PORTAL' then 'ADMIN' when @source='BENEFIT' then 'MEMBERSHIP' when @source='CYCLE' then 'EXPIRED' when @source='BILL' then (case when @amount<0 then 'USAGE' when @refunded_from is not null then 'RETURN' else 'DISTRIBUTE' end) else @source end)",r),t.Field_Field$string(e,e,!1,!1,!1,"Credit type","creditType",e,"case when @expired_at is null then 'NORMAL' else 'FREE' end",r),t.Field_Field$bool(e,e,!0,!1,"Refunded",d,d,e,r)],$.JSArray_Field)},$signature:0},t.collectibleTransactionSchema_closure0.prototype={call$1(r){var e="id",i="businessId",n=null,a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["refId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectibleId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_67,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectionId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["campaignId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["userId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n)],$.JSArray_Join)},$signature:1},t.completeTimeBillSchema_closure.prototype={call$1(r){var e=null,i="seqNumber",n="deliveryName",a="isRefund",s="isPickup",o="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",S="thirdPartyExtraCharge",T="deliveryFee",b="nettTotal",F="deliveryFeeWithTax",M="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Table","slot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Delivery",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID","refundFrom","refundedFrom",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundedById","refund.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user","refundedByName","refund.by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund reason","refundReason","refund.reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","membership.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member user ID","memberUserId","membership.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberUserName","membership.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Member birthday","memberBirthday","membership.birthday",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",A.x28case_,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",r),t.Field_Field$bool(e,e,!0,!1,"Pickup",s,s,e,r),t.Field_Field$bool(e,e,!0,!1,"Is in house delivery",o,o,e,r),t.Field_Field$bool(e,e,!0,!1,"Is other delivery",l,l,e,r),t.Field_Field$bool(e,e,!0,!1,"Is takeaway","isTakeaway","is.takeaway",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Closed at",D,D,e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,r),t.Field_Field$numeric(e,"IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,!1,"Pax","pax","person",A.COALESp,r),t.Field_Field$string(e,e,!1,!1,!1,"Integrated order ID",d,d,e,r),t.Field_Field$numeric(e,A.IFNULLi,!0,!1,"Item count",c,c,A.COALESi,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Tax",p,p,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLdiT,!1,!1,"Discount",y,y,A.COALESdit,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Item gross",g,g,A.COALESg,r),t.Field_Field$numeric(e,A.x28IFNULnI,!1,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,!1,"Rounding",m,m,A.COALESr,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,r),t.Field_Field$string(e,e,!0,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,r),t.Field_Field$numeric(e,A.IFNULLs,!1,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,r),t.Field_Field$string(e,e,!0,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,r),t.Field_Field$numeric(e,A.x28IFNULo,!1,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,r),t.Field_Field$numeric(e,A.x28IFNULgx2d,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,r),t.Field_Field$numeric(e,A.IFNULLta,!1,!1,"Takeaway",h,h,A.COALEStak,r),t.Field_Field$numeric(e,A.IFNULLth,!1,!1,"Extra charge",S,S,A.COALESth,r),t.Field_Field$numeric(e,A.IFNULLde_,!1,!1,"Delivery fee",T,T,A.COALESdex2c,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",b,b,A.COALESn,r),t.Field_Field$numeric(e,A.x28IFNULgx2bd,!1,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,r),t.Field_Field$numeric(e,A.x28IFNULn_,!1,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,r),t.Field_Field$numeric(e,e,!1,!1,"Member Recency","recency",e,A.MIN_EX,r),t.Field_Field$numeric(e,e,!1,!1,"Member frequency","frequency",e,A.COUNT_,r),t.Field_Field$numeric(e,e,!1,!1,"Member monetary","monetary",e,A.SUM__n,r),t.Field_Field$numeric(e,A.IFNULLdeWT,!1,!1,"Delivery fee with tax",F,F,A.COALESdex5f_,r),t.Field_Field$numeric(e,A.IFNULLdeWo,!1,!1,"Delivery fee without tax",M,M,A.COALESdex5fo,r),t.Field_Field$numeric(e,A.IFNULLoT,!1,!1,"Other charge with tax",I,I,A.COALESo_,r),t.Field_Field$numeric(e,A.IFNULLoo,!1,!1,"Other charge without tax",x,x,A.COALESoo,r),t.Field_Field$numeric(e,e,!1,!1,"Duration","duration",e,A.EXTRAC,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant","restaurantName",e,A.x28selecn,r),t.Field_Field$numeric(e,e,!1,!1,"Labour hour","labourHour",e,A.x28selecS,r),t.Field_Field$string(e,e,!1,!1,!1,"Payments","payments",e,A.x28selecstdn,r),t.Field_Field$string(e,e,!1,!1,!1,"Items","items",e,A.x28selecstC,r),t.Field_Field$string(e,e,!1,!1,!1,"Discount reasons","discountReasons",e,A.x28selecstda,r),t.Field_Field$numeric(e,A.IFNULLdiI,!1,!1,"Discount inc tax",R,R,A.COALESdii,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,r)],$.JSArray_Field)},$signature:0},t.completeTimeBillSchema_closure0.prototype={call$1(r){var e="id",i="restaurantId",n=null,a="billId",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,n)],o),!1,r,n)],$.JSArray_Join)},$signature:1},t.counterSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.counterSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.creditTransactionSchema_closure.prototype={call$1(r){var e=null,i="refunded",n="freeAmount",a="normalAmount",s="totalAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","restaurant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","member",e,r),t.Field_Field$bool(e,e,!1,!1,"Is refund",i,i,e,r),t.Field_Field$string("Transaction source, e.g. POS, ADMIN, REWARD",e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$numeric("Bonus/complimentary credit amount",e,!1,!1,"Free",n,n,e,r),t.Field_Field$numeric("Earned/paid credit amount",e,!1,!1,"Normal",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Total",s,s,e,r)],$.JSArray_Field)},$signature:0},t.creditTransactionSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.drawerSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"userId","user.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","userName","user.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reason","reason","reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter ID","counterId","counter.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter","counterName","counter.name",e,r),t.Field_Field$numeric("Cash in/out amount. Positive = in, negative = out",e,!1,!1,"Total","amount","amount",e,r),t.Field_Field$string("Values: IN or OUT. Derived from amount sign","IF(@amount>=0, 'IN', 'OUT')",!1,!1,!1,"Type","type",e,"CASE WHEN @amount>=0 THEN 'IN' ELSE 'OUT' END",r),t.Field_Field$numeric(e,"IF(@amount>=0, @amount, 0)",!1,!1,"In","in",e,A.CASE_Wax3e,r),t.Field_Field$numeric(e,"IF(@amount<0, @amount, 0)",!1,!1,"Out","out",e,A.CASE_Wax3c,r)],$.JSArray_Field)},$signature:0},t.drawerSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.flattenItemSchema_closure.prototype={call$1(r){var e=null,i="itemCreatedAt",n="billCompletedAt",a="perXUnit",s="takeawayId",o="takeawayName",l="productId",D="isRefund",d="servedAt",c="isTakeaway",p="quantity",y="unitQuantity",g="billAdjustmentTotal",m="itemAdjustmentTotal",h="grossTotal",S="takeawayPrice",T="nettTotal",b="layerNettTotal",F="layerBillAdjustmentTotal",M="layerItemAdjustmentTotal",I="layerGrossTotal",x="layerTakeawayPrice",R="layerTaxTotal",L="layerScTotal",O="layerOtherChargeTotal",v="customAttributes",z="layerZeroParentId",c0="collectedAt",p0="subCategories",f0="billAdjustmentInclusiveTaxTotal",$0="itemAdjustmentInclusiveTaxTotal",y0="layerBillAdjustmentInclusiveTaxTotal",g0="layerItemAdjustmentInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Item time",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string("Values: DRAFT, VOIDED, SENT. DRAFT and SENT both considered valid sales.",e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!0,"Name","name","name",e,r),t.Field_Field$numeric(e,e,!1,!1,"Per unit",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit","unit","unit",e,r),t.Field_Field$string(e,`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), 'Other', @categoryName)
|
|
85
85
|
`,!1,!1,!0,"Category","categoryName","category",`CASE WHEN @category_name IS NULL OR @product_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN 'Other' ELSE @category_name END
|
|
86
86
|
`,r),t.Field_Field$string(e,e,!1,!1,!1,"Takeaway ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Takeaway name",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant ID","variantId","variant.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variantName","variant.name",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",D,D,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User id","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","createdByName","createdBy.name",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Sent time","sentAt","sentAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Served time",d,d,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Printed time","printedAt","printBy.printAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Void time","voidAt","void.voidAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void reason","voidReason","void.reason",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"voidedById","void.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void user","voidedByName","void.by.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"voidApprovedById","void.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void approver","voidApprovedByName","void.approvedBy.name",e,r),t.Field_Field$bool(e,e,!0,!1,"SST before discount","sstBeforeDiscount","sst.beforeDiscount",e,r),t.Field_Field$bool(e,e,!0,!1,"SC before discount","serviceChargeBeforeDiscount","sc.beforeDiscount",e,r),t.Field_Field$bool(e,e,!1,!1,"Takeaway",c,c,e,r),t.Field_Field$numeric(e,"@quantity*IF(@isRefund, -1, 1)",!1,!1,"Qty",p,p,A.x40quant,r),t.Field_Field$numeric(e,"@unitQuantity*IF(@isRefund, -1, 1)",!1,!1,"Unit qty",y,y,A.x40unit_,r),t.Field_Field$numeric(e,"@sstTotal*IF(@isRefund, -1, 1)",!1,!1,"SST","sstTotal","sst.total",A.x40sst_t,r),t.Field_Field$numeric(e,e,!0,!1,"SST %","sstPercentage","sst.percentage",e,r),t.Field_Field$numeric(e,e,!0,!1,"SC %","serviceChargePercentage","sc.percentage",e,r),t.Field_Field$numeric(e,"@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"SC","serviceChargeTotal","sc.total",A.x40servi,r),t.Field_Field$numeric(e,"@otherChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"Other charge","otherChargeTotal","otherCharge.total",A.x40other,r),t.Field_Field$numeric(e,A.x40billA,!1,!1,"Bill discount",g,g,A.x40bill_,r),t.Field_Field$numeric(e,A.x40itemA,!1,!1,"Item discount",m,m,A.x40item_,r),t.Field_Field$numeric(e,"@grossTotal*IF(@isRefund, -1, 1)",!1,!1,"Gross",h,h,A.x40gross,r),t.Field_Field$numeric(e,A.x28_grosT,!1,!1,"Gross w/ takeaway","grossTotalWithoutTakeaway",e,A.x28_gros_,r),t.Field_Field$numeric(e,"@takeawayPrice*IF(@isRefund, -1, 1)",!1,!1,"Takeaway price",S,S,A.x40takea,r),t.Field_Field$numeric(e,"@nettTotal*IF(@isRefund, -1, 1)",!1,!1,"Nett",T,T,A.x40nett_,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent ID","parentId","parent.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Parent name","parentName","parent.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Addon type","addonType","addon.type",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Addon ID","addonId","addon.selectionId",e,r),t.Field_Field$string(e,"SPLIT(@addonId, '/')[OFFSET(0)]",!1,!1,!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",r),t.Field_Field$numeric("Item depth: 0 = main item. 1+ = addon/modifier level. -1 = bill level modifier, usually not consider item sales.",e,!1,!1,"Layer","layer","layer",e,r),t.Field_Field$numeric(e,"@addonPrice*IF(@isRefund, -1, 1)",!1,!1,"Addon price","addonPrice","addon.price",A.x40addon,r),t.Field_Field$numeric(e,"@taxTotal*IF(@isRefund, -1, 1)",!1,!1,"Tax","taxTotal","tax.total","@tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,A.x28IFNULb,!1,!1,"Discount","discountTotal",e,A.x28COALEb,r),t.Field_Field$numeric(e,A.x28IFNULgx2bb,!1,!1,"Gross before charges","grossBeforeCharges",e,A.x28COALEgx2bb,r),t.Field_Field$string(e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING([IF(@code='', NULL, @code), @name], ' '))",!1,!1,!1,"Summary","summary",e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN @code='' THEN NULL ELSE @code END, @name], ' '))",r),t.Field_Field$numeric(e,"@layerNettTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer nett",b,b,"@layer_nett_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerBillAdjustmentTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer bill discount",F,F,"@layer_bill_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerItemAdjustmentTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer item discount",M,M,"@layer_item_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerGrossTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer gross total",I,I,"@layer_gross_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerTakeawayPrice*IF(@isRefund, -1, 1)",!1,!1,"Layer takeaway price",x,x,"@layer_takeaway_price*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerTaxTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer tax total",R,R,"@layer_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerScTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer sc",L,L,"@layer_sc_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerOtherChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer other charge",O,O,"@layer_other_charge_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"(IFNULL(@layerGrossTotal,0)+IFNULL(@layerBillAdjustmentTotal,0)+IFNULL(@layerItemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",!1,!1,"Layer gross before charges","layerGrossBeforeCharges",e,"(COALESCE(@layer_gross_total,0)+COALESCE(@layer_bill_adjustment_total,0)+COALESCE(@layer_item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",v,v,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Layer 0 parent ID",z,z,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Charge variant","chargeVariant",e,"(select variant from charges where charges.parent_id=@layer_zero_parent_id and charges.restaurant_id=@restaurant_id and charges.bill_id=@bill_id and charges.code != 'SERVICE_CHARGE')",r),t.Field_Field$timestamp(e,e,!1,!1,"Collected time",c0,c0,e,r),t.Field_Field$numeric(e,e,!1,!1,"Costing","costing","costing",e,r),t.Field_Field$numeric(e,"ROUND(TIMESTAMP_DIFF(IFNULL(@servedAt, CURRENT_TIMESTAMP), @sentAt, SECOND),0)",!1,!1,"Preparation seconds","preparationSeconds",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@served_at, CURRENT_TIMESTAMP),@sent_at)),0)",r),t.Field_Field$numeric("Computed: nett total minus costing","(@nettTotal-coalesce(@costing, 0))",!1,!1,"Profit","profit",e,"(@nett_total-coalesce(@costing, 0))",r),t.Field_Field$string(e,e,!1,!1,!1,"Layer 0 parent name","layerZeroParentName",e,"(select name from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",r),t.Field_Field$string(e,e,!1,!1,!1,"Layer 0 parent code","layerZeroParentCode",e,"(select code from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",r),t.Field_Field$string(e,e,!1,!1,!1,"Layer 0 parent category","layerZeroParentCategory",e,"(select category_name from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",r),t.Field_Field$string(e,e,!1,!1,!1,"Sub categories",p0,p0,e,r),t.Field_Field$numeric(e,"@billAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,!1,"Bill discount inc tax",f0,f0,"@bill_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@itemAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,!1,"Item discount inc tax",$0,$0,"@item_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerBillAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer bill discount inc tax",y0,y0,"@layer_bill_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,"@layerItemAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,!1,"Layer item discount inc tax",g0,g0,"@layer_item_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",r)],$.JSArray_Field)},$signature:0},t.flattenItemSchema_closure0.prototype={call$1(r){var e="id",i=null,n="restaurantId",a="parentId",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["billId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition("itemId",t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("billId",t._setArrayType(["billId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_7,t._setArrayType([new t.JoinCondition(a,t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_6,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["parentId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!0,r,i),new t.Join(_.SCHEMA_NAME_52,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["groupId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition("ref",t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("locationId",t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="seqNumber",a="generatedAt",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier ID","supplierId","supplier.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","supplierInternal","supplier.internal",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier","supplierName","supplier.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier contact name","supplierContactName","supplier.contactName",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier phone number","supplierPhoneNumber","supplier.phoneNumber",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier reg no.","supplierRegistrationNumber","supplier.registrationNumber",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier email","supplierEmail","supplier.email",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address line 1","supplierAddressLine1","supplier.address.line1",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address line 2","supplierAddressLine2","supplier.address.line2",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address state","supplierAddressState","supplier.address.state",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address city","supplierAddressCity","supplier.address.city",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address postcode","supplierAddressPostcode","supplier.address.postcode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address country","supplierAddressCountry","supplier.address.country",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Generated time",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Transaction Number","netSuiteTransactionNumber",A.netSui,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier Code","supplierCode",e,A.x28selecc,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderSchema_closure0.prototype={call$1(r){var e="purchaseOrderId",i=null,n="locationId",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_28,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!0,r,i),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryFulfillmentSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="adjustment",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="purchaseOrderDeliveryFulfillmentId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase delivery fulfillment ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!1,!1,"Qty","quantity","amount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryFulfillmentId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryOrderSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="adjustment",s="deliveryOrderNumber",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",s,s,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryOrderSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryOrderSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="purchaseOrderDeliveryOrderId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase delivery order ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!1,!1,"Qty","quantity","amount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.internalPurchaseOrderItemSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="quantity",s="receivedQuantity",o="requestedQuantity",l="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!0,!1,"Qty",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Received qty",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Requested qty",o,o,e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","totalCost",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r)],$.JSArray_Field)},$signature:0},t.internalPurchaseOrderItemSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.inventoryAdjustmentSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="generatedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Generated time",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reason","reason","reason",e,r)],$.JSArray_Field)},$signature:0},t.inventoryAdjustmentSchema_closure0.prototype={call$1(r){var e="locationId",i=null,n="inventoryAdjustmentId",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("restaurantId",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType(["ref"],a),_.COMPARISON_OPERATOR_0,i)],s),!0,r,i),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_23,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_25,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("closingAdjustmentId",t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i)],$.JSArray_Join)},$signature:1},t.inventoryAdjustmentPhysicalSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="inventoryAdjustmentId",a="inventoryAdjustmentSkuId",s="unitName",o="unitAbbrev",l="trackingAmount",D="trackingUnitName",d="trackingUnitAbbrev",c="conversion";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inventory Adjustment ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inventory Adjustment SKU ID",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev.",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Qty x Unit","qtyXUnit",e,"concat(@tracking_amount,'x ',@tracking_unit_name)",r),t.Field_Field$numeric(e,e,!1,!1,"Tracking amount",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tracking unit",D,D,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tracking unit abbrev.",d,d,e,r),t.Field_Field$numeric(e,e,!1,!1,"Conversion",c,c,e,r)],$.JSArray_Field)},$signature:0},t.inventoryAdjustmentPhysicalSkuSchema_closure0.prototype={call$1(r){var e="locationId",i=null,n="inventoryAdjustmentId",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType([n],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType([n],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType(["inventoryAdjustmentSkuId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i)],$.JSArray_Join)},$signature:1},t.inventoryAdjustmentSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="inventoryAdjustmentId",a="fromBalance",s="toBalance",o="unitPrecision",l="unitName",D="unitAbbrev",d="amountCost",c="fromBalanceCost",p="toBalanceCost",y="trackingAmount",g="trackingUnitName",m="trackingUnitAbbrev",h="conversion",S="customAttributes",T="defaultCostPerUnit";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inventory Adjustment ID",n,n,e,r),t.Field_Field$numeric("Stock quantity change. Positive = in, negative = out",e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$numeric(e,"IF(@amount>=0, @amount, 0)",!1,!1,"In","in",e,A.CASE_Wax3e,r),t.Field_Field$numeric(e,"IF(@amount<0, @amount, 0)",!1,!1,"Out","out",e,A.CASE_Wax3c,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string("Values: SALES, DAMAGE, PURCHASE, TRANSFER, ADJUSTMENT, OPENING, PRODUCTION",e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"From balance",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"To balance",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","unitId","unitId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit Precision",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev.",D,D,e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount cost",d,d,"case when @amount<0 then -@amount_cost else @amount_cost end",r),t.Field_Field$numeric(e,e,!1,!1,"From balance cost",c,c,e,r),t.Field_Field$numeric(e,e,!1,!1,"To balance cost",p,p,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name (unit)","nameUnit",e,"concat(@name,' (',@unit_abbrev,')')",r),t.Field_Field$numeric(e,e,!1,!1,"Daily consumption","dailyConsumption",e,"(sum(@amount) filter (where type in ('SALES','DAMAGE')) over (partition by @name)/(EXTRACT(DAY FROM (!end - !start))+1))",r),t.Field_Field$numeric(e,e,!1,!1,"Days outstanding","daysOutstanding",e,"-(last_value(@to_balance) over (partition by @name order by @created_at asc ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)/(sum(@amount) filter (where type in ('SALES','DAMAGE')) over (partition by @name)/(EXTRACT(DAY FROM (!end - !start))+1)))",r),t.Field_Field$numeric(e,e,!1,!1,"Tracking amount",y,y,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tracking unit",g,g,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tracking unit abbrev.",m,m,e,r),t.Field_Field$numeric(e,e,!1,!1,"Conversion",h,h,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",S,S,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$numeric(e,e,!1,!1,"Default unit cost",T,T,e,r),t.Field_Field$bool(e,e,!1,!1,"From closing template","fromClosingTemplate",e,"((select 1 from closing_draft_skus where closing_adjustment_id = @inventory_adjustment_id and sku_id = @sku_id limit 1) is not null)",r),t.Field_Field$numeric(e,e,!1,!1,"Default cost","defaultCost",e,"@default_cost_per_unit*@amount",r)],$.JSArray_Field)},$signature:0},t.inventoryAdjustmentSkuSchema_closure0.prototype={call$1(r){var e="locationId",i=null,n="inventoryAdjustmentId",a="snapshottedAt",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("id",t._setArrayType([n],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_23,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType([n],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("inventoryAdjustmentSkuId",t._setArrayType(["id"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_25,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("closingAdjustmentId",t._setArrayType([n],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("skuId",t._setArrayType(["skuId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(a,t._setArrayType(["createdAt"],s),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],o),!1,r,new t.JoinLateral(t._setArrayType(["mechanism"],s),t._setArrayType([new t.JoinLateralSort(a,_.SORT_TYPE_1)],$.JSArray_JoinLateralSort)))],$.JSArray_Join)},$signature:1},t.inventoryV1FlattenInventorySchema_closure.prototype={call$1(r){var e=null,i="locationId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Link ID","linkId","linkId",e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","unitId","unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit name","unitName","unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev","unitAbbrev","unit.abbrev",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",n,n,e,r)],$.JSArray_Field)},$signature:0},t.inventoryV1FlattenInventorySchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.itemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id",e,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt",e,e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Item time","itemCreatedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time","billCompletedAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name",e,e,r),t.Field_Field$numeric(e,e,!1,!1,"Per unit","perXUnit",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit","unit",e,e,r),t.Field_Field$string(e,A.IF__ca,!1,!1,!1,"Category","categoryName",e,A.CASE_Wc,r),t.Field_Field$string(e,e,!1,!1,!1,"Takeaway ID","takeawayId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Takeaway name","takeawayName",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID","productId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant ID","variantId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variantName",e,e,r),t.Field_Field$bool(e,e,!1,!1,"Refund","isRefund",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User id","createdById",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","createdByName",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Sent time","sentAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Served time","servedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Printed time","printedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Void time","voidAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void reason","voidReason",e,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"voidedById",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void user","voidedByName",e,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"voidApprovedById",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Void approver","voidApprovedByName",e,e,r),t.Field_Field$bool(e,e,!1,!1,"SST before discount","sstBeforeDiscount",e,e,r),t.Field_Field$bool(e,e,!1,!1,"SC before discount","serviceChargeBeforeDiscount",e,e,r),t.Field_Field$bool(e,e,!1,!1,"Takeaway","isTakeaway",e,e,r),t.Field_Field$numeric(e,"@quantity*IF(@isRefund, -1, 1)",!1,!1,"Qty","quantity",e,A.x40quant,r),t.Field_Field$numeric(e,"@unitQuantity*IF(@isRefund, -1, 1)",!1,!1,"Unit qty","unitQuantity",e,A.x40unit_,r),t.Field_Field$numeric(e,"@sstTotal*IF(@isRefund, -1, 1)",!1,!1,"SST","sstTotal",e,A.x40sst_t,r),t.Field_Field$numeric(e,e,!0,!1,"SST %","sstPercentage",e,e,r),t.Field_Field$numeric(e,e,!0,!1,"SC %","serviceChargePercentage",e,e,r),t.Field_Field$numeric(e,"@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"SC","serviceChargeTotal",e,A.x40servi,r),t.Field_Field$numeric(e,"@otherChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"Other charge","otherChargeTotal",e,A.x40other,r),t.Field_Field$numeric(e,A.x40billA,!1,!1,"Bill discount","billAdjustmentTotal",e,A.x40bill_,r),t.Field_Field$numeric(e,A.x40itemA,!1,!1,"Item discount","itemAdjustmentTotal",e,A.x40item_,r),t.Field_Field$numeric(e,"@grossTotal*IF(@isRefund, -1, 1)",!1,!1,"Gross","grossTotal",e,A.x40gross,r),t.Field_Field$numeric(e,A.x28_grosT,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28_gros_,r),t.Field_Field$numeric(e,"@takeawayPrice*IF(@isRefund, -1, 1)",!1,!1,"Takeaway price","takeawayPrice",e,A.x40takea,r),t.Field_Field$numeric(e,"@nettTotal*IF(@isRefund, -1, 1)",!1,!1,"Nett","nettTotal",e,A.x40nett_,r),t.Field_Field$numeric(e,A.x28IFNULb,!1,!1,"Discount","discountTotal",e,A.x28COALEb,r),t.Field_Field$numeric(e,A.x28IFNULgx2bb,!1,!1,"Gross before charges","grossBeforeCharges",e,A.x28COALEgx2bb,r),t.Field_Field$numeric(e,"TIMESTAMP_DIFF(TIMESTAMP(@servedAt), TIMESTAMP(@sentAt), SECOND)",!1,!1,"Preparation seconds","preparationSeconds",e,"EXTRACT(EPOCH FROM AGE(@served_at,@sent_at))",r),t.Field_Field$string(e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING([IF(code='', NULL, code), name], ' '))",!1,!1,!1,"Summary","summary",e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN code='' THEN NULL ELSE code END, name], ' '))",r),t.Field_Field$numeric(e,e,!1,!1,"Layer","layer",e,e,r)],$.JSArray_Field)},$signature:0},t.itemSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.itemMovementSchema_closure.prototype={call$1(r){var e=null,i="userName",n="moveFromBillId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Move Time","movedAt","movedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User Name",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Item ID","itemId","itemId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Move From Table","moveFromSlot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Move From Bill ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Move From Bill No.","moveFromBillSeqNumber",e,"(select seq_number from bills where bills.id=@move_from_bill_id)",r)],$.JSArray_Field)},$signature:0},t.itemMovementSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.kitchenStationSchema_closure.prototype={call$1(r){var e=null,i="completedAt",n="productId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Item ID","itemId","itemId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Start time","startedAt","startAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Finish time","finishedAt","finishAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Complete time",i,i,e,r),t.Field_Field$numeric(e,"ROUND(TIMESTAMP_DIFF(IFNULL(@finishedAt, CURRENT_TIMESTAMP), @startedAt, SECOND),0)",!1,!1,"Seconds","seconds",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@finished_at, CURRENT_TIMESTAMP),@started_at)),0)",r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",n,n,e,r)],$.JSArray_Field)},$signature:0},t.kitchenStationSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.memberSchema_closure.prototype={call$1(r){var e=null,i="experience",n="normalBalance",a="freeBalance";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","user",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Level","level","level",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Experience",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tier","tier","tier",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Card No.","cardNo","cardNo",e,r),t.Field_Field$numeric(e,e,!1,!1,"Balance","balance","balance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Normal Balance",n,n,e,r),t.Field_Field$numeric(e,e,!1,!1,"Free balance",a,a,e,r),t.Field_Field$numeric(e,e,!0,!1,"Visit","visit","stat.visitCount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Last visit","lastVisit","stat.lastVisit",e,r),t.Field_Field$numeric(e,e,!0,!1,"Visit frequency","visitFrequency","stat.avgVisitFrequency",e,r),t.Field_Field$numeric(e,e,!0,!1,"Avg bill size","avgBillSize","stat.avgBillSize",e,r),t.Field_Field$numeric(e,e,!1,!1,"Version","version","version",e,r),t.Field_Field$numeric(e,e,!1,!1,"Points","point","point",e,r),t.Field_Field$numeric(e,e,!1,!1,"Sales","sales",e,A.x28selecsum,r),t.Field_Field$numeric(e,e,!1,!1,"Tier number","tierNumber",e,"case when @tier is null then null else @tier::numeric end",r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name",e,"(select name from users where users.id=@user_id)",r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID","locationId","location",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Phone number","phoneNumber",e,"(select phone_number from users where users.id=@user_id)",r)],$.JSArray_Field)},$signature:0},t.memberSchema_closure0.prototype={call$1(r){var e="businessId",i=null,n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_49,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_48,t._setArrayType([new t.JoinCondition("memberId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("userId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_64,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition("rank",t._setArrayType(["tierNumber"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i)],$.JSArray_Join)},$signature:1},t.memberStorePurchaseSchema_closure.prototype={call$1(r){var e=null,i="isRefund",n="refundedReason",a="refundedFrom",s="refundedAt",o="status",l="grossTotal",D="taxTotal",d="nettTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bundle name","bundleName","bundle.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bundle ID","bundleId","bundle.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user ID","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Create user name","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user ID","refundedById","refundedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user name","refundedName","refunded.name",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",i,i,e,r),t.Field_Field$bool(e,e,!1,!1,"Refund reason",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Refund time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","member.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","memberUserId","member.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberName","member.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,o,o,o,e,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Gross",l,l,A.COALESg,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Tax",D,D,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",d,d,A.COALESn,r),t.Field_Field$string(e,e,!1,!1,!1,"Transaction ID","transactionId","transaction.id",e,r),t.Field_Field$numeric(e,e,!1,!1,"Normal credit","normalCredit","bundle.credit.normal",e,r),t.Field_Field$numeric(e,e,!1,!1,"Free credit","freeCredit","bundle.credit.free.amount",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tax code","taxCode","taxCode",e,r)],$.JSArray_Field)},$signature:0},t.memberStorePurchaseSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_47,t._setArrayType([new t.JoinCondition("memberStorePurchaseId",t._setArrayType(["id"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberUserId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.memberStorePurchasePaymentSchema_closure.prototype={call$1(r){var e=null,i="memberStorePurchaseId",n="isRefund",a="reference";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase ID",i,i,e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","payment.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter ID","counterId","counter.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter","counterName","counter.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reference",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Total","total","receivedAmount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Paid","paid","paid",e,r),t.Field_Field$numeric(e,e,!1,!1,"Change","change","change",e,r)],$.JSArray_Field)},$signature:0},t.memberStorePurchasePaymentSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_46,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberStorePurchaseId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.memberTitleSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="memberId",a="acquiredAt",s="expiredAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID",n,n,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Acquired time",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired time",s,s,e,r)],$.JSArray_Field)},$signature:0},t.memberTitleSchema_closure0.prototype={call$1(r){var e=$.JSArray_String;return t._setArrayType([new t.Join(_.SCHEMA_NAME_50,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],e),_.COMPARISON_OPERATOR_0,null),new t.JoinCondition("id",t._setArrayType(["id"],e),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.memberV2Schema_closure.prototype={call$1(r){var e=null,i="experience";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","joinAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","externalMemberId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Level","level","level",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Experience",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tier","tier","tier.balance",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Card No.","cardNo","cardNo",e,r),t.Field_Field$numeric(e,e,!1,!1,"Balance","balance","credit.balance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Normal Balance","normalBalance","credit.normalBalance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Free balance","freeBalance","credit.freeBalance",e,r),t.Field_Field$numeric(e,e,!0,!1,"Visit","visit","stats.visitCount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Last visit","lastVisit","stats.lastVisit",e,r),t.Field_Field$numeric(e,e,!0,!1,"Visit frequency","visitFrequency","stats.avgVisitFrequency",e,r),t.Field_Field$numeric(e,e,!0,!1,"Avg bill size","avgBillSize","stats.avgBillSize",e,r),t.Field_Field$numeric(e,e,!1,!1,"Version","version","version",e,r),t.Field_Field$numeric(e,e,!1,!1,"Points","point","point.balance",e,r),t.Field_Field$numeric(e,e,!1,!1,"Sales","sales",e,A.x28selecsum,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID","locationId","location",e,r)],$.JSArray_Field)},$signature:0},t.memberV2Schema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.membershipSchema_closure.prototype={call$1(r){var e=null,i="businessId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.membershipSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.membershipTitleSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="internal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$bool(e,e,!1,!1,"Is internal",n,n,e,r)],$.JSArray_Field)},$signature:0},t.membershipTitleSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.menuV3GroupSchema_closure.prototype={call$1(r){var e=null,i="locationId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.menuV3GroupSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.menuV3ItemSchema_closure.prototype={call$1(r){var e=null,i="productId",n="locationId",a="category",s="customAttributes",o="thumbnail",l="orderFrom",D="additionalCategories";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variant","variant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Category",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Costing","costing","costing",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Thumbnail",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tax code","taxCode","taxCode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Order from",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Additional categories",D,D,e,r)],$.JSArray_Field)},$signature:0},t.menuV3ItemSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.menuV3SkuSchema_closure.prototype={call$1(r){var e=null,i="locationId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","unitId","unit._id",e,r),t.Field_Field$numeric(e,e,!1,!1,"Unit Precision","unitPrecision","unit.precision",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit","unitName","unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev.","unitAbbrev","unit.abbrev",e,r)],$.JSArray_Field)},$signature:0},t.menuV3SkuSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.menuV4CatalogItemSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="catalogId",a="catalogName",s="productId",o="orderFrom";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Menu ID","menuId","menuId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Catalog ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Catalog name",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Order from",o,o,e,r)],$.JSArray_Field)},$signature:0},t.menuV4CatalogItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.menuV4GroupSchema_closure.prototype={call$1(r){var e=null,i="locationId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.menuV4GroupSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.menuV4ItemSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="productId",a="category",s="customAttributes",o="thumbnail",l="orderFrom",D="additionalCategories";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variant","variant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Category",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Costing","costing","costing",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Thumbnail",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tax code","taxCode","taxCode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Order from",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Additional categories",D,D,e,r)],$.JSArray_Field)},$signature:0},t.menuV4ItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.menuV4ItemInventoryBindingSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="productId",a="inventoryId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Product ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inventory ID",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r)],$.JSArray_Field)},$signature:0},t.menuV4ItemInventoryBindingSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.menuV4SkuSchema_closure.prototype={call$1(r){var e=null,i="locationId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","unitId","unit._id",e,r),t.Field_Field$numeric(e,e,!1,!1,"Unit Precision","unitPrecision","unit.precision",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit","unitName","unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev.","unitAbbrev","unit.abbrev",e,r)],$.JSArray_Field)},$signature:0},t.menuV4SkuSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.parentFlattenItemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name",e,e,r),t.Field_Field$string(e,A.IF__ca,!1,!1,!1,"Category","categoryName",e,A.CASE_Wc,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","variantName",e,e,r)],$.JSArray_Field)},$signature:0},t.parentFlattenItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.paymentSchema_closure.prototype={call$1(r){var e=null,i="paymentCreatedAt",n="billCompletedAt",a="isRefund",s="reference";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Payment time",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string("Payment method name, e.g. Cash, Visa, GrabPay, Boost",e,!1,!1,!1,"Name","name","payment.name",e,r),t.Field_Field$string(e,A.case_wI,!1,!1,!1,"Counter ID","counterId","counter.id",A.case_w_i,r),t.Field_Field$string(e,A.case_wN,!1,!1,!1,"Counter","counterName","counter.name",A.case_w_n,r),t.Field_Field$string(e,e,!1,!1,!1,"User","byName","by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","byId","by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reference",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Total","total","receivedAmount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Paid","paid","paid",e,r),t.Field_Field$numeric(e,e,!1,!1,"Change","change","change",e,r),t.Field_Field$numeric(e,"@otherChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"Other charge","otherChargeTotal","OTHER_CHARGE.total",A.x40other,r),t.Field_Field$numeric(e,"@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"SC","serviceChargeTotal","SERVICE_CHARGE.total",A.x40servi,r),t.Field_Field$numeric(e,"@sstTotal*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","SST.total",A.x40sst_t,r),t.Field_Field$numeric(e,"@vatTotal*IF(@isRefund, -1, 1)",!0,!1,"VAT","vatTotal","VAT.total",A.x40vat_t,r),t.Field_Field$string(e,e,!1,!1,!1,"Issuer","paymentGatewayIssuer","paymentGateway.method.issuer",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","paymentGatewayVariant","paymentGateway.method.variant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Gateway key","paymentGatewayKey","paymentGateway.key",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Gateway","gateway","paymentGateway.gateway",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Card type","cardType","paymentGateway.cardType",e,r),t.Field_Field$string(e,A.CONCATC,!1,!1,!1,"Summary","summary",e,A.CONCAT_,r),t.Field_Field$string(e,e,!1,!1,!1,"Card no","cardNo","paymentGateway.cardNo",e,r)],$.JSArray_Field)},$signature:0},t.paymentSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("parentId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["reference"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.paymentTimePaymentSchema_closure.prototype={call$1(r){var e=null,i="paymentCreatedAt",n="billCompletedAt",a="isRefund",s="reference";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Payment time",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","payment.name",e,r),t.Field_Field$string(e,A.case_wI,!1,!1,!1,"Counter ID","counterId","counter.id",A.case_w_i,r),t.Field_Field$string(e,A.case_wN,!1,!1,!1,"Counter","counterName","counter.name",A.case_w_n,r),t.Field_Field$string(e,e,!1,!1,!1,"User","byName","by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","byId","by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Reference",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Total","total","receivedAmount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Paid","paid","paid",e,r),t.Field_Field$numeric(e,e,!1,!1,"Change","change","change",e,r),t.Field_Field$numeric(e,"@otherChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"Other charge","otherChargeTotal","OTHER_CHARGE.total",A.x40other,r),t.Field_Field$numeric(e,"@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,!1,"SC","serviceChargeTotal","SERVICE_CHARGE.total",A.x40servi,r),t.Field_Field$numeric(e,"@sstTotal*IF(@isRefund, -1, 1)",!0,!1,"SST","sstTotal","SST.total",A.x40sst_t,r),t.Field_Field$numeric(e,"@vatTotal*IF(@isRefund, -1, 1)",!0,!1,"VAT","vatTotal","VAT.total",A.x40vat_t,r),t.Field_Field$string(e,e,!1,!1,!1,"Issuer","paymentGatewayIssuer","paymentGateway.method.issuer",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Variant","paymentGatewayVariant","paymentGateway.method.variant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Gateway key","paymentGatewayKey","paymentGateway.key",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Gateway","gateway","paymentGateway.gateway",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Card type","cardType","paymentGateway.cardType",e,r),t.Field_Field$string(e,A.CONCATC,!1,!1,!1,"Summary","summary",e,A.CONCAT_,r),t.Field_Field$string(e,e,!1,!1,!1,"Card no","cardNo","paymentGateway.cardNo",e,r)],$.JSArray_Field)},$signature:0},t.paymentTimePaymentSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("parentId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["reference"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.purchaseOrderSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="seqNumber",a="generatedAt",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref","ref","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string("Values: PROCESSING, RECEIVING, CLOSE, CANCELLED",e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier ID","supplierId","supplier.id",e,r),t.Field_Field$string("Whether supplier is internal (true) or external (false)",e,!1,!1,!1,"Type","supplierInternal","supplier.internal",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier","supplierName","supplier.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier contact name","supplierContactName","supplier.contactName",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier phone number","supplierPhoneNumber","supplier.phoneNumber",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier reg no.","supplierRegistrationNumber","supplier.registrationNumber",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier email","supplierEmail","supplier.email",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address line 1","supplierAddressLine1","supplier.address.line1",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address line 2","supplierAddressLine2","supplier.address.line2",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address state","supplierAddressState","supplier.address.state",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address city","supplierAddressCity","supplier.address.city",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address postcode","supplierAddressPostcode","supplier.address.postcode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier address country","supplierAddressCountry","supplier.address.country",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Generated time",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Transaction Number","netSuiteTransactionNumber",A.netSui,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier Code","supplierCode",e,A.x28selecc,r),t.Field_Field$string(e,e,!1,!1,!1,"Transformed status","transformedStatus",e,"(case when (@status in ('RECEIVING','PROCESSING') and (select count(*) from purchase_order_delivery_orders dos where dos.location_id=@location_id and dos.purchase_order_id=@id) > 0) then 'PARTIAL RECEIVED' when @status = 'CLOSE' then 'COMPLETE' else @status end)",r)],$.JSArray_Field)},$signature:0},t.purchaseOrderSchema_closure0.prototype={call$1(r){var e="purchaseOrderId",i=null,n="locationId",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_28,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],a),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(n,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,i)],s),!1,r,i)],$.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryFulfillmentSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="adjustment",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment",a,a,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r)],$.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryFulfillmentSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryFulfillmentSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="purchaseOrderDeliveryFulfillmentId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase delivery fulfillment ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!1,!1,"Qty","quantity","amount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier ID","supplierId",e,A.x28selecsup,r)],$.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryFulfillmentSkuSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n="snapshottedAt",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryFulfillmentId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!0,r,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["supplierId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],a),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],s),!1,r,new t.JoinLateral(t._setArrayType(["mechanism"],a),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],$.JSArray_JoinLateralSort)))],$.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryOrderSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="adjustment",s="deliveryOrderNumber",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","createdById","createdBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","createdByName","createdBy.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Adjustment",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",s,s,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite ID","netSuiteId","netSuite.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,r)],$.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryOrderSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_31,t._setArrayType([new t.JoinCondition("purchaseOrderDeliveryOrderId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("purchaseOrderId",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryOrderSkuSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="purchaseOrderDeliveryOrderId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase delivery order ID",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!1,!1,"Qty","quantity","amount",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",s,s,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier ID","supplierId",e,A.x28selecsup,r)],$.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryOrderSkuSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n="snapshottedAt",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryOrderId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("purchaseOrderId",t._setArrayType(["purchaseOrderId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["supplierId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],a),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],s),!1,r,new t.JoinLateral(t._setArrayType(["mechanism"],a),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],$.JSArray_JoinLateralSort)))],$.JSArray_Join)},$signature:1},t.purchaseOrderItemSchema_closure.prototype={call$1(r){var e=null,i="locationId",n="purchaseOrderId",a="quantity",s="receivedQuantity",o="requestedQuantity",l="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Purchase order ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","sku._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU code","skuCode","sku.code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU name","skuName","sku.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit ID","skuUnitId","sku.unit._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit name","skuUnitName","sku.unit.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,r),t.Field_Field$numeric(e,e,!0,!1,"Qty",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Received qty",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Requested qty",o,o,e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","totalCost",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Effective time",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes","customAttributes","sku.customAttributes",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Supplier ID","supplierId",e,A.x28selecsup,r)],$.JSArray_Field)},$signature:0},t.purchaseOrderItemSchema_closure0.prototype={call$1(r){var e=null,i="locationId",n="snapshottedAt",a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!0,r,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],a),_.COMPARISON_OPERATOR_0,e)],s),!1,r,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["supplierId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],a),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],a),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],s),!1,r,new t.JoinLateral(t._setArrayType(["mechanism"],a),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],$.JSArray_JoinLateralSort)))],$.JSArray_Join)},$signature:1},t.recommendationCallSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Path","path","path",e,r)],$.JSArray_Field)},$signature:0},t.recommendationCallSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.recordSchema_closure.prototype={call$1(r){var e=null,i="openedAt",n="closedAt",a="openAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter ID","counterId","counter.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Counter","counterName","counter.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"openById","openedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Open user","openByName","openedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"closedById","closedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Close user","closedByName","closedBy.name",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Open time",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Close time",n,n,e,r),t.Field_Field$numeric("Cash float amount when counter session was opened",e,!1,!1,"Open amount",a,a,e,r),t.Field_Field$numeric("Expected closing cash balance for the counter session",e,!1,!1,"Close amount","amount","amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cash sale","cashSale",e,"(select sum(payments.total) from payments where payments.restaurant_id=@restaurant_id and payments.payment_created_at between @opened_at and @closed_at and @counter_id=payments.counter_id and payments.name='CASH' and payments.total>=0)",r),t.Field_Field$numeric(e,e,!1,!1,"Cash refund","cashRefund",e,"(select sum(payments.total) from payments where payments.restaurant_id=@restaurant_id and payments.payment_created_at between @opened_at and @closed_at and @counter_id=payments.counter_id and payments.name='CASH' and payments.total<0)",r),t.Field_Field$numeric(e,e,!1,!1,"Member store cash sale","memberStoreCashSale",e,"(select sum(member_store_purchase_payments.total) from member_store_purchase_payments where member_store_purchase_payments.restaurant_id=@restaurant_id and member_store_purchase_payments.created_at between @opened_at and @closed_at and @counter_id=member_store_purchase_payments.counter_id and member_store_purchase_payments.name='CASH' and member_store_purchase_payments.total>=0)",r),t.Field_Field$numeric(e,e,!1,!1,"Member store cash refund","memberStoreCashRefund",e,"(select sum(member_store_purchase_payments.total) from member_store_purchase_payments where member_store_purchase_payments.restaurant_id=@restaurant_id and member_store_purchase_payments.created_at between @opened_at and @closed_at and @counter_id=member_store_purchase_payments.counter_id and member_store_purchase_payments.name='CASH' and member_store_purchase_payments.total<0)",r),t.Field_Field$numeric(e,e,!1,!1,"Cash in","cashIn",e,"(select sum(drawers.amount) from drawers where drawers.restaurant_id=@restaurant_id and drawers.created_at between @opened_at and @closed_at and @counter_id=drawers.counter_id and drawers.amount>=0)",r),t.Field_Field$numeric(e,e,!1,!1,"Cash out","cashOut",e,"(select sum(drawers.amount) from drawers where drawers.restaurant_id=@restaurant_id and drawers.created_at between @opened_at and @closed_at and @counter_id=drawers.counter_id and drawers.amount<0)",r)],$.JSArray_Field)},$signature:0},t.recordSchema_closure0.prototype={call$1(r){var e="restaurantId",i=null,n="counterId",a="createdAt",s=$.JSArray_String,o=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["counterId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(a,t._setArrayType(["openedAt","closedAt"],s),_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0)],o),!1,r,i),new t.Join(_.SCHEMA_NAME_4,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["counterId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(a,t._setArrayType(["openedAt","closedAt"],s),_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0)],o),!1,r,i)],$.JSArray_Join)},$signature:1},t.refundBillSchema_closure.prototype={call$1(r){var e=null,i="seqNumber",n="deliveryName",a="isRefund",s="isPickup",o="isInHouseDelivery",l="isDelivery",D="Takeaway",d="completedAt",c="integratedOrderId",p="itemCount",y="taxTotal",g="discountTotal",m="grossTotal",h="rounding",S="takeawayPrice",T="thirdPartyExtraCharge",b="deliveryFee",F="nettTotal";return t._setArrayType([t.Field_Field$string(e,"_",!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"No.",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Table","slot","slot",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Delivery",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund ID","refundFrom","refundedFrom",e,r),t.Field_Field$bool(e,e,!1,!1,"Refund",a,a,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"refundedById","refund.by.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund user","refundedByName","refund.by.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Refund reason","refundReason","refund.reason",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","membership.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member user ID","memberUserId","membership.userId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member name","memberUserName","membership.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Member birthday","memberBirthday","membership.birthday",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Remark","remark","remark",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$bool(e,e,!1,!1,"Pickup",s,s,e,r),t.Field_Field$bool(e,e,!1,!1,"Is in house delivery",o,o,e,r),t.Field_Field$bool(e,e,!1,!1,"Is other delivery",l,l,e,r),t.Field_Field$bool(e,e,!1,!1,D,"isTakeaway","is.takeaway",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Closed at",d,d,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,r),t.Field_Field$string(e,e,!1,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,r),t.Field_Field$numeric(e,"IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,!1,"Pax","pax","person",A.COALESp,r),t.Field_Field$string(e,e,!1,!1,!1,"Integrated order ID",c,c,e,r),t.Field_Field$numeric(e,A.IFNULLi,!0,!1,"Item count",p,p,A.COALESi,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!0,!1,e,y,y,A.COALEStax,r),t.Field_Field$numeric(e,A.IFNULLdiT,!1,!1,"Discount",g,g,A.COALESdit,r),t.Field_Field$numeric(e,A.IFNULLg,!1,!1,"Gross",m,m,A.COALESg,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,!1,"Rounding",h,h,A.COALESr,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,r),t.Field_Field$string(e,e,!1,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,r),t.Field_Field$numeric(e,A.IFNULLs,!1,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,r),t.Field_Field$string(e,e,!1,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,r),t.Field_Field$numeric(e,A.x28IFNULo,!1,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,r),t.Field_Field$numeric(e,A.x28IFNULgx2d,!1,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,r),t.Field_Field$numeric(e,A.IFNULLta,!1,!1,D,S,S,A.COALEStak,r),t.Field_Field$numeric(e,A.IFNULLth,!1,!1,"Extra charge",T,T,A.COALESth,r),t.Field_Field$numeric(e,A.IFNULLde_,!1,!1,"Delivery fee",b,b,A.COALESdex2c,r),t.Field_Field$numeric(e,A.IFNULLn,!1,!1,"Nett",F,F,A.COALESn,r),t.Field_Field$numeric(e,"IFNULL(@grossTotal,0)*IF(@isRefund, -1, 1)+IFNULL(@deliveryFee,0)*IF(@isRefund, -1, 1)+IFNULL(@discountTotal,0)*IF(@isRefund, -1, 1)",!1,!1,"Gross before charges","grossBeforeCharges",e,"COALESCE(@gross_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END+COALESCE(@delivery_fee,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END+COALESCE(@discount_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",r),t.Field_Field$numeric(e,e,!1,!1,"Member Recency","recency",e,A.MIN_EX,r),t.Field_Field$numeric(e,e,!1,!1,"Member frequency","frequency",e,A.COUNT_,r),t.Field_Field$numeric(e,e,!1,!1,"Member monetary","monetary",e,A.SUM__n,r)],$.JSArray_Field)},$signature:0},t.refundBillSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.restaurantSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="expiredAt",a="customAttributes";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","profile.name",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Reg no","regNo","profile.regNo",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Legal name","legalName","profile.legalName",e,r),t.Field_Field$string(e,e,!0,!1,!1,"SST reg no","sstRegNo","profile.sstRegNo",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Email","email","profile.email",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Phone","phoneNo","profile.phoneNo",e,r),t.Field_Field$string(e,e,!1,!1,!1,"State","state","profile.address.state",e,r),t.Field_Field$string(e,e,!1,!1,!1,"City","city","profile.address.city",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Postcode","postcode","profile.address.postcode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Country","country","profile.address.country",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"License Expire",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","profile.code",e,r),t.Field_Field$numeric(e,e,!1,!1,"Longitude","longitude","profile.address.longitude",e,r),t.Field_Field$numeric(e,e,!1,!1,"Latitude","latitude","profile.address.latitude",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Table count","tableCount",e,"(select count(distinct name) from slots where slots.restaurant_id=@id)",r)],$.JSArray_Field)},$signature:0},t.restaurantSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.restaurantFeatureSchema_closure.prototype={call$1(r){var e=null,i="restaurantId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Feature","name","name",e,r)],$.JSArray_Field)},$signature:0},t.restaurantFeatureSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.restaurantLocationSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","profile.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"State","state","profile.address.state",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Postcode","postcode","profile.address.postcode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Country","country","profile.address.country",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","profile.code",e,r)],$.JSArray_Field)},$signature:0},t.restaurantLocationSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.reviewSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","restaurant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","user",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Message","message","reviews",e,r),t.Field_Field$numeric(e,e,!1,!1,"rating","rating","rating.overall",e,r)],$.JSArray_Field)},$signature:0},t.reviewSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e)],$.JSArray_Join)},$signature:1},t.slotSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!0,!1,"Created at","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Table","name","name",e,r)],$.JSArray_Field)},$signature:0},t.slotSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("slot",t._setArrayType(["name"],i),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!0,r,e)],$.JSArray_Join)},$signature:1},t.staffSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Created at","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r)],$.JSArray_Field)},$signature:0},t.staffSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.stockSchema_closure.prototype={call$1(r){var e=null,i="locationId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Type","type","type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Balance","balance","balance",e,r)],$.JSArray_Field)},$signature:0},t.stockSchema_closure0.prototype={call$1(r){var e="locationId",i=null,n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_56,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(e,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,i)],a),!0,r,i),new t.Join(_.SCHEMA_NAME_54,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i),new t.JoinCondition(e,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,i)],a),!0,r,i)],$.JSArray_Join)},$signature:1},t.storeBundleSchema_closure.prototype={call$1(r){var e=null,i="bundleId",n="category",a="coinPrice";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bundle ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Category",n,n,e,r),t.Field_Field$numeric(e,e,!1,!1,"Price","price","price",e,r),t.Field_Field$numeric(e,e,!1,!1,"Coin price",a,a,e,r)],$.JSArray_Field)},$signature:0},t.storeBundleSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.storeTransactionSchema_closure.prototype={call$1(r){var e=null,i="grossTotal",n="taxTotal",a="nettTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","location",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Member ID","memberId","member",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bundle ID","bundleId","bundle._id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bundle name","bundleName","bundle.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Status","status","status",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","source",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Ref ID","refId","ref",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment ref ID","paymentRefId","paymentRef",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment type","paymentType","payment.type",e,r),t.Field_Field$numeric(e,e,!1,!1,"Payment amount","paymentAmount","payment.amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Voucher count","voucherCount","bundle.voucherCount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Title count","titleCount","bundle.titleCount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Free credit","freeCredit","bundle.freeCredit",e,r),t.Field_Field$numeric(e,e,!1,!1,"Normal credit","normalCredit","bundle.normalCredit",e,r),t.Field_Field$numeric(e,e,!1,!1,"Cash amount","cashAmount",e,"case when @payment_type='OFFLINE' or @payment_type='ONLINE' then @payment_amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Coin amount","coinAmount",e,"case when @payment_type='COIN' then @payment_amount else 0 end",r),t.Field_Field$numeric(e,e,!1,!1,"Gross",i,i,e,r),t.Field_Field$numeric(e,e,!1,!1,"Tax",n,n,e,r),t.Field_Field$numeric(e,e,!1,!1,"Nett",a,a,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Payment Extra","paymentExtra","payment.extra",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Tax code","taxCode","taxCode",e,r)],$.JSArray_Field)},$signature:0},t.storeTransactionSchema_closure0.prototype={call$1(r){var e="id",i="businessId",n=null,a=$.JSArray_String,s=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["businessId"],a),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["memberId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],a),_.COMPARISON_OPERATOR_0,n)],s),!1,r,n)],$.JSArray_Join)},$signature:1},t.subItemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId",e,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt",e,e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt",e,e,r),t.Field_Field$timestamp(e,"@itemCreatedAt",!1,!1,"Bill time","subItemCreatedAt",e,"@item_created_at",r),t.Field_Field$timestamp(e,e,!1,!1,"Bill close time","billCompletedAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId",e,e,r),t.Field_Field$string(e,"@parentId",!1,!1,!1,"Item ID","itemId",e,"@parent_id",r),t.Field_Field$bool(e,e,!1,!1,"Refund","isRefund",e,e,r),t.Field_Field$string(e,"@addonType",!1,!1,!1,"type","type",e,"@addon_type",r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name",e,e,r),t.Field_Field$string(e,"@addonId",!1,!1,!1,"Selection ID","selectionId",e,"@addon_id",r),t.Field_Field$numeric(e,"@quantity*IF(@isRefund, -1, 1)",!1,!1,"Qty","quantity",e,A.x40quant,r),t.Field_Field$numeric(e,"@addonPrice*IF(@isRefund, -1, 1)",!1,!1,"Nett","price",e,A.x40addon,r),t.Field_Field$numeric(e,e,!1,!1,"Layer","layer",e,e,r)],$.JSArray_Field)},$signature:0},t.subItemSchema_closure0.prototype={call$1(r){var e=null,i="restaurantId",n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(i,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!0,r,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],$.JSArray_Join)},$signature:1},t.timesheetSchema_closure.prototype={call$1(r){var e=null,i="startedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","user.id",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","userName","user.name",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Clock in",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Clock out","endedAt","endedAt",e,r),t.Field_Field$numeric(e,"TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)",!1,!1,"Seconds","seconds",e,"EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))",r),t.Field_Field$numeric(e,"ROUND(TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)/60, 2)",!1,!1,"Minutes","minutes",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))/60,2)",r),t.Field_Field$numeric(e,"ROUND(TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)/60/60, 2)",!1,!1,"Hours","hours",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))/60/60,2)",r)],$.JSArray_Field)},$signature:0},t.timesheetSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.timesheetRecordSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id",e,e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId",e,e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"createdAt",e,e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId",e,e,r),t.Field_Field$string(e,e,!1,!1,!1,"User","userName",e,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Timestamp","timestamp",e,e,r)],$.JSArray_Field)},$signature:0},t.timesheetRecordSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.unitCostHistorySchema_closure.prototype={call$1(r){var e=null,i="locationId",n="locationType",a="mechanism",s="previousCost",o="transactionId",l="transactionLineId",D="documentNumber",d="quantity";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location ID",i,i,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Snapshot time","snapshottedAt","snapshotAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Location type",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"SKU ID","skuId","skuId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Mechanism",a,a,e,r),t.Field_Field$numeric(e,e,!1,!1,"Previous cost",s,s,e,r),t.Field_Field$numeric(e,e,!1,!1,"Cost","cost","cost",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Transaction ID",o,o,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Transaction line ID",l,l,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Document No",D,D,e,r),t.Field_Field$numeric(e,e,!1,!1,"Amount","amount","amount",e,r),t.Field_Field$numeric(e,e,!1,!1,"Quantity",d,d,e,r)],$.JSArray_Field)},$signature:0},t.unitCostHistorySchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.userSchema_closure.prototype={call$1(r){var e=null,i="birthday",n="phoneNumber";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Birthday",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","displayName",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Gender","gender","gender",e,r),t.Field_Field$string(e,e,!0,!1,!1,"Phone no.",n,n,e,r),t.Field_Field$string(e,e,!0,!1,!1,"Email","email","email",e,r),t.Field_Field$numeric(e,e,!1,!1,"Age","age",e,"case when @birthday is not null then EXTRACT(YEAR FROM age(@birthday)) else null end",r)],$.JSArray_Field)},$signature:0},t.userSchema_closure0.prototype={call$1(r){return t._setArrayType([],$.JSArray_Join)},$signature:1},t.voucherClaimSchema_closure.prototype={call$1(r){var e=null,i="expiredAt",n="redeemedAt",a="appliedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Expired time",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID","businessId","voucher.business",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","restaurant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r),t.Field_Field$string(e,e,!1,!1,!1,"User ID","userId","user",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","code",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","voucher.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Description","description","voucher.description",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Source","source","voucher.options.type",e,r),t.Field_Field$bool(e,"IF(@appliedAt IS NULL AND @expiredAt < CURRENT_TIMESTAMP(), true, false)",!1,!1,"Is expired","isExpired",e,"CASE WHEN @applied_at IS NULL AND @expired_at < CURRENT_TIMESTAMP THEN true ELSE false END",r),t.Field_Field$numeric(e,"IF(@appliedAt IS NULL AND @expiredAt < CURRENT_TIMESTAMP(), 1, 0)",!1,!1,"Expired count","expiredCount",e,"CASE WHEN @applied_at IS NULL AND @expired_at < CURRENT_TIMESTAMP THEN 1 ELSE 0 END",r),t.Field_Field$timestamp(e,e,!1,!1,"Redeemed time",n,n,e,r),t.Field_Field$timestamp(e,e,!1,!1,"Applied time",a,a,e,r),t.Field_Field$bool(e,"IF(@appliedAt IS NOT NULL, true, false)",!1,!1,"Is applied","isApplied",e,"CASE WHEN @applied_at IS NOT NULL THEN true ELSE false END",r),t.Field_Field$bool(e,"IF(@redeemedAt IS NOT NULL, true, false)",!1,!1,"Is redeemed","isRedeemed",e,"CASE WHEN @redeemed_at IS NOT NULL THEN true ELSE false END",r),t.Field_Field$numeric(e,"IF(@appliedAt IS NOT NULL, 1, 0)",!0,!1,"Applied count","appliedCount",e,"CASE WHEN @applied_at IS NOT NULL THEN 1 ELSE 0 END",r),t.Field_Field$numeric(e,e,!1,!1,"redeemed count","redeemedCount",e,"(select count(*) from voucher_claim_redemptions where voucher_claim_id=@id)",r)],$.JSArray_Field)},$signature:0},t.voucherClaimSchema_closure0.prototype={call$1(r){var e="id",i=null,n=$.JSArray_String,a=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["userId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i),new t.Join(_.SCHEMA_NAME_40,t._setArrayType([new t.JoinCondition("voucherClaimId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,i)],a),!1,r,i)],$.JSArray_Join)},$signature:1},t.voucherClaimRedemptionSchema_closure.prototype={call$1(r){var e=null,i="voucherClaimId",n="businessId";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Voucher claim ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Restaurant ID","restaurantId","restaurant",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Bill ID","billId","billId",e,r)],$.JSArray_Field)},$signature:0},t.voucherClaimRedemptionSchema_closure0.prototype={call$1(r){var e=null,i=$.JSArray_String,n=$.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["voucherClaimId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],i),_.COMPARISON_OPERATOR_0,e)],n),!1,r,e)],$.JSArray_Join)},$signature:1},t.warehouseLocationSchema_closure.prototype={call$1(r){var e=null,i="businessId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,e,!1,!1,!1,"ID","id","_id",e,r),t.Field_Field$string(e,e,!0,!1,!1,e,"docId","_docId",e,r),t.Field_Field$timestamp(e,e,!1,!1,"Time","createdAt","_createdAt",e,r),t.Field_Field$timestamp(e,e,!0,!1,e,"publishedAt","_publishedAt",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Name","name","profile.name",e,r),t.Field_Field$string(e,e,!1,!1,!1,"State","state","profile.address.state",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Postcode","postcode","profile.address.postcode",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Country","country","profile.address.country",e,r),t.Field_Field$string(e,e,!1,!1,!1,"Business ID",i,i,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Custom attributes",n,n,e,r),t.Field_Field$string(e,e,!1,!1,!1,"Code","code","profile.code",e,r)],$.JSArray_Field)},$signature:0},t.warehouseLocationSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],$.JSArray_String),_.COMPARISON_OPERATOR_0,null)],$.JSArray_JoinCondition),!1,r,null)],$.JSArray_Join)},$signature:1},t.QueryEngine.prototype={getSql$1(r){var e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(r,new t.QueryEngine_getSql_closure(this),e),!0,e._eval$1("ListIterable.E"))}},t.QueryEngine_getSql_closure.prototype={call$1(r){return r.getSqlSelect$1(this.$this.context.schemaLibrary)},$signature:92},t.ChartType.prototype={_enumToString$0(){return"ChartType."+this._name}},t.BaseDatasourceConfigModel.prototype={get$drilledDimensions(){return this.dimensions},get$drilledDimensionIds(){var r=this.get$drilledDimensions(),e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(r,new t.BaseDatasourceConfigModel_drilledDimensionIds_closure,e),!0,e._eval$1("ListIterable.E"))},get$metricIds(){var r=this.metrics,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(r,new t.BaseDatasourceConfigModel_metricIds_closure,e),!0,e._eval$1("ListIterable.E"))},get$drillDimension(){var r,e=this;return e instanceof t.BaseXYDatasourceConfigModel||e instanceof t.CircularDatasourceConfigModel?r=e.get$drillDimension():r=e instanceof t.TableDatasourceConfigModel?e.get$drillDimension():null,r!=null?t.uniqueAlias(r):r},get$startTimeDimensionUnit(){switch(this.periodType){case _.PERIOD_TYPE_0:return _.Units_6;default:return _.Units_4}},toRequests$1(r){var e,i,n,a,s,o,l,D,d=this,c=null,p=d.schemaNames;return p.length===0?t._setArrayType([],$.JSArray_QueryRequest):(e=r.isCompare?c:d.limit,i=_.JSArray_methods.get$first(p),n=d.get$drilledDimensions(),p=_.JSArray_methods.sublist$1(p,1),a=r.timezone,s=r.dateRange,o=t.IterableExtension_get_firstOrNull(s),o.toString,l=d.get$startTimeDimensionUnit(),D=t.IterableExtension_get_firstOrNull(s),D.toString,D=t.DateTimeExtension_startOfUtc(o,l,D,a)._toString$1$iso8601(!0),l=t.ListExtension_elementAtOrNull(s,1),l.toString,o=d.get$startTimeDimensionUnit(),s=t.ListExtension_elementAtOrNull(s,1),s.toString,s=t.DateTimeExtension_endOfUtc(l,o,s,a)._toString$1$iso8601(!0),o=r.timeRange,l=t.IterableExtension_get_firstOrNull(o),l=l==null?c:t.DateTimeExtension_copyWith(l,0,0,0).toUtc$0().toIso8601String$0(),o=t.ListExtension_elementAtOrNull(o,1),o=o==null?c:t.DateTimeExtension_copyWith(o,0,999,59).toUtc$0().toIso8601String$0(),t._setArrayType([t.QueryRequest$(c,r.businessIds,n,d.filters,p,e,d.metrics,r.restaurantIds,c,c,i,d.sorts,new t.QueryRequestTimeDimension(D,s,l,o),a,r.warehouseIds)],$.JSArray_QueryRequest))},toJson$0(){var r,e,i,n=this,a=n.schemaNames,s=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"),o=s._eval$1("ListIterable.E"),l=t.List_List$of(new t.MappedListIterable(a,new t.BaseDatasourceConfigModel_toJson_closure,s),!0,o);return o=t.List_List$of(new t.MappedListIterable(a,new t.BaseDatasourceConfigModel_toJson_closure0,s),!0,o),s=n.dimensions,a=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(s,new t.BaseDatasourceConfigModel_toJson_closure1,a),!0,a._eval$1("ListIterable.E")),s=n.metrics,r=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,Map<String,@>>"),r=t.List_List$of(new t.MappedListIterable(s,new t.BaseDatasourceConfigModel_toJson_closure2,r),!0,r._eval$1("ListIterable.E")),s=n.filters,e=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,Map<String,@>>"),e=t.List_List$of(new t.MappedListIterable(s,new t.BaseDatasourceConfigModel_toJson_closure3,e),!0,e._eval$1("ListIterable.E")),s=n.sorts,i=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(s,new t.BaseDatasourceConfigModel_toJson_closure4,i),!0,i._eval$1("ListIterable.E")),s=n.periodType,s=s==null?null:s._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaNames",l,"schemas",o,"dimensions",a,"metrics",r,"filters",e,"sorts",i,"limit",n.limit,"isComparable",n.isComparable,"periodType",s,"timezone",n.timezone],$.String,$.dynamic)},get$dimensions(){return this.dimensions},get$metrics(){return this.metrics}},t.BaseDatasourceConfigModel_drilledDimensionIds_closure.prototype={call$1(r){return r.get$alias()},$signature:5},t.BaseDatasourceConfigModel_metricIds_closure.prototype={call$1(r){return r.get$alias()},$signature:16},t.BaseDatasourceConfigModel_toJson_closure.prototype={call$1(r){return r._name},$signature:13},t.BaseDatasourceConfigModel_toJson_closure0.prototype={call$1(r){return r._name},$signature:13},t.BaseDatasourceConfigModel_toJson_closure1.prototype={call$1(r){return r.toJson$0()},$signature:44},t.BaseDatasourceConfigModel_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:27},t.BaseDatasourceConfigModel_toJson_closure3.prototype={call$1(r){return r.toJson$0()},$signature:20},t.BaseDatasourceConfigModel_toJson_closure4.prototype={call$1(r){return r.toJson$0()},$signature:29},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure.prototype={call$1(r){return t.EnumByName_byName(_.List_W7J,r)},$signature:24},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure0.prototype={call$1(r){return t.QueryRequestDimension_fromJson($.Map_String_dynamic._as(r))},$signature:17},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure1.prototype={call$1(r){return t.QueryRequestMetric_fromJson($.Map_String_dynamic._as(r))},$signature:23},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson($.Map_String_dynamic._as(r))},$signature:19},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure3.prototype={call$1(r){return t.QueryRequestSort_fromJson($.Map_String_dynamic._as(r))},$signature:25},t.CircularDatasourceConfigModel.prototype={get$drillDimension(){if(this.get$dimensions().length<=1)return null;var r=this._drillDimension;return r!=null?t.uniqueAlias(r):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},toJson$0(){var r=this,e=t.LinkedHashMap_LinkedHashMap$of(r.super$BaseDatasourceConfigModel$toJson(),$.String,$.dynamic);return e.$indexSet(0,"showLabel",r.showLabel),e.$indexSet(0,"drillDimension",r.get$drillDimension()),e.$indexSet(0,"timezone",r.timezone),e}},t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig.prototype={},t.DataSourceDrillConfig.prototype={get$_availableIds(){var r=$.String;return _.JSArray_methods.fold$2(this.get$dimensions(),t.LinkedHashMap_LinkedHashMap$_empty(r,r),new t.DataSourceDrillConfig__availableIds_closure)},get$validatedDrillDimension(){var r=this.get$_availableIds().$index(0,this.get$drillDimension());return r??this.get$drillDimension()},get$drilledDimensions(){var r,e,i=this;return i.get$validatedDrillDimension()!=null?(r=i.get$dimensions(),e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>"),t.List_List$of(new t.WhereIterable(r,new t.DataSourceDrillConfig_drilledDimensions_closure(i),e),!0,e._eval$1("Iterable.E"))):i.get$dimensions()}},t.DataSourceDrillConfig__availableIds_closure.prototype={call$2(r,e){return r.$indexSet(0,e.get$idV1(),t.uniqueAlias(e.get$alias())),r},$signature:41},t.DataSourceDrillConfig_drilledDimensions_closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())===this.$this.get$validatedDrillDimension()},$signature:9},t.ScorecardDatasourceConfigModel.prototype={toRequests$1(r){var e=this.super$BaseDatasourceConfigModel$toRequests(r)[0],i=t._setArrayType([e],$.JSArray_QueryRequest),n=this.sparklineDimension;return n!=null&&!r.isCompare&&(n.toString,i.push(e.copyWith$2$dimensions$sorts(t._setArrayType([n],$.JSArray_QueryRequestDimension),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,null,n.option,n.dataFormula,n.schemaName,n.name)],$.JSArray_QueryRequestSort)))),i},toJson$0(){var r,e=this,i=t.LinkedHashMap_LinkedHashMap$of(e.super$BaseDatasourceConfigModel$toJson(),$.String,$.dynamic);return i.$indexSet(0,"isCumulative",e.isCumulative),r=e.sparklineDimension,i.$indexSet(0,"sparklineDimension",r==null?null:r.toJson$0()),i.$indexSet(0,"timezone",e.timezone),i}},t.DataSourceRowColumnConfig.prototype={get$_positionFieldIds(){var r=t.List_List$of(this.get$drilledDimensionIds(),!0,$.String);return _.JSArray_methods.addAll$1(r,this.get$metricIds()),this.get$metrics().length!==0&&r.push("_metric_name"),r},get$_table_datasource_config_model$_availableIds(){var r=$.String,e=t.LinkedHashMap_LinkedHashMap$of(_.JSArray_methods.fold$2(this.get$dimensions(),t.LinkedHashMap_LinkedHashMap$_empty(r,r),new t.DataSourceRowColumnConfig__availableIds_closure),r,r);return e.addAll$1(0,_.JSArray_methods.fold$2(this.get$metrics(),t.LinkedHashMap_LinkedHashMap$_empty(r,r),new t.DataSourceRowColumnConfig__availableIds_closure0)),e},get$rowIds(){var r,e=this,i=e.get$_rowIds(),n=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>"),a=t.List_List$of(new t.MappedListIterable(i,new t.DataSourceRowColumnConfig_rowIds_closure(e),n),!0,n._eval$1("ListIterable.E"));return n=e.get$_columnIds(),i=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(n,new t.DataSourceRowColumnConfig_rowIds_closure0(e),i),!0,i._eval$1("ListIterable.E")),i=e.get$drilledDimensionIds(),n=t.List_List$of(new t.WhereIterable(a,new t.DataSourceRowColumnConfig_rowIds_closure1(e),t._arrayInstanceType(a)._eval$1("WhereIterable<1>")),!0,$.String),_.JSArray_methods.addAll$1(n,new t.WhereIterable(i,new t.DataSourceRowColumnConfig_rowIds_closure2(a,r),t._arrayInstanceType(i)._eval$1("WhereIterable<1>"))),n},get$columnIds(){var r,e,i=this,n="_metric_name",a=i.get$_rowIds(),s=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"),o=t.List_List$of(new t.MappedListIterable(a,new t.DataSourceRowColumnConfig_columnIds_closure(i),s),!0,s._eval$1("ListIterable.E"));return s=i.get$_columnIds(),a=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(s,new t.DataSourceRowColumnConfig_columnIds_closure0(i),a),!0,a._eval$1("ListIterable.E")),e=t._setArrayType([],$.JSArray_String),i.get$metrics().length!==0?(a=t.List_List$of(o,!0,$.String),_.JSArray_methods.addAll$1(a,r),a=!_.JSArray_methods.contains$1(a,n)):a=!1,a&&e.push(n),a=t.List_List$of(new t.WhereIterable(r,new t.DataSourceRowColumnConfig_columnIds_closure1(i),t._arrayInstanceType(r)._eval$1("WhereIterable<1>")),!0,$.String),_.JSArray_methods.addAll$1(a,e),a}},t.DataSourceRowColumnConfig__availableIds_closure.prototype={call$2(r,e){return r.$indexSet(0,e.get$idV1(),e.get$alias()),r},$signature:41},t.DataSourceRowColumnConfig__availableIds_closure0.prototype={call$2(r,e){return r.$indexSet(0,(e.schemaName._name+"_"+e.name+"_"+e.aggregation._name).toLowerCase(),e.get$alias()),r},$signature:94},t.DataSourceRowColumnConfig_rowIds_closure.prototype={call$1(r){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,r);return e??r},$signature:4},t.DataSourceRowColumnConfig_rowIds_closure0.prototype={call$1(r){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,r);return e??r},$signature:4},t.DataSourceRowColumnConfig_rowIds_closure2.prototype={call$1(r){var e=t.List_List$of(this.validatedRowIds,!0,$.String);return _.JSArray_methods.addAll$1(e,this.validatedColumnIds),!_.JSArray_methods.contains$1(e,r)},$signature:21},t.DataSourceRowColumnConfig_rowIds_closure1.prototype={call$1(r){return _.JSArray_methods.contains$1(this.$this.get$_positionFieldIds(),r)},$signature:21},t.DataSourceRowColumnConfig_columnIds_closure.prototype={call$1(r){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,r);return e??r},$signature:4},t.DataSourceRowColumnConfig_columnIds_closure0.prototype={call$1(r){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,r);return e??r},$signature:4},t.DataSourceRowColumnConfig_columnIds_closure1.prototype={call$1(r){return _.JSArray_methods.contains$1(this.$this.get$_positionFieldIds(),r)},$signature:21},t.TableDatasourceConfigModel.prototype={get$drillDimension(){if(!this.isDrillable)return null;var r=this._table_datasource_config_model$_drillDimension;return r!=null?t.uniqueAlias(r):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},get$drilledDimensions(){var r=t.List_List$of(t.DataSourceDrillConfig.prototype.get$drilledDimensions.call(this),!0,$.QueryRequestDimension);return _.JSArray_methods.sort$1(r,new t.TableDatasourceConfigModel_drilledDimensions_closure(this)),r},get$joinDatasources(){var r=this._joinDatasources,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,JoinDatasourceConfig>");return t.List_List$of(new t.MappedListIterable(r,new t.TableDatasourceConfigModel_joinDatasources_closure(this),e),!0,e._eval$1("ListIterable.E"))},toRequests$1(r){var e=this,i=e.super$BaseDatasourceConfigModel$toRequests(r)[0],n=t._setArrayType([i.copyWith$3$dimensions$rollup$rollupPosition(_.JSArray_methods.fold$2(e.get$joinDatasources(),i.dimensions,new t.TableDatasourceConfigModel_toRequests_closure),e.rollup,e.rollupPosition)],$.JSArray_QueryRequest),a=e.get$joinDatasources();return _.JSArray_methods.addAll$1(n,new t.MappedListIterable(a,new t.TableDatasourceConfigModel_toRequests_closure0(e,r),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,QueryRequest>"))),n},toJson$0(){var r,e,i,n=this,a=n.super$BaseDatasourceConfigModel$toJson(),s=n.rollup;return s==null&&n.showGrandTotal&&(s=0),r=t.LinkedHashMap_LinkedHashMap$of(a,$.String,$.dynamic),e=n.get$joinDatasources(),i=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),r.$indexSet(0,"joinDatasources",t.List_List$of(new t.MappedListIterable(e,new t.TableDatasourceConfigModel_toJson_closure,i),!0,i._eval$1("ListIterable.E"))),r.$indexSet(0,"columnIds",n.get$columnIds()),r.$indexSet(0,"rowIds",n.get$rowIds()),r.$indexSet(0,"columnsWidth",n.columnsWidth),r.$indexSet(0,"isDrillable",n.isDrillable),r.$indexSet(0,"showGrandTotal",n.showGrandTotal),r.$indexSet(0,"rowsPerPage",n.rowsPerPage),r.$indexSet(0,"drillDimension",n.get$drillDimension()),r.$indexSet(0,"rollup",s),r.$indexSet(0,"rollupPosition",n.rollupPosition),r.$indexSet(0,"timezone",n.timezone),r},get$_rowIds(){return this._rowIds},get$_columnIds(){return this._columnIds}},t.TableDatasourceConfigModel_drilledDimensions_closure.prototype={call$2(r,e){var i,n=this.$this._rowIds,a=_.JSArray_methods.indexOf$1(n,t.uniqueAlias(r.get$alias()));return a<0&&(a=999),i=_.JSArray_methods.indexOf$1(n,t.uniqueAlias(e.get$alias())),a-(i<0?999:i)},$signature:96},t.TableDatasourceConfigModel_joinDatasources_closure.prototype={call$1(r){return r.copyWith$1$mainDimensions(this.$this.get$dimensions())},$signature:97},t.TableDatasourceConfigModel_toRequests_closure.prototype={call$2(r,e){return _.JSArray_methods.fold$2(e.conditions,r,new t.TableDatasourceConfigModel_toRequests__closure0)},$signature:98},t.TableDatasourceConfigModel_toRequests__closure0.prototype={call$2(r,e){var i,n,a={};return a.conditionDimensions=r,i=$.QueryRequestDimension,n=t.List_List$of(r,!0,i),i=t.IterableNullableExtension_whereNotNull(e.mainDimensions,i),_.JSArray_methods.addAll$1(n,new t.WhereIterable(i,new t.TableDatasourceConfigModel_toRequests___closure(a),i.$ti._eval$1("WhereIterable<Iterable.E>"))),a.conditionDimensions=n},$signature:42},t.TableDatasourceConfigModel_toRequests___closure.prototype={call$1(r){return!u.contains$1$asx(this._box_0.conditionDimensions,r)},$signature:9},t.TableDatasourceConfigModel_toRequests_closure0.prototype={call$1(r){var e=this.$this,i=e.isBlend?r.conditions:null,n=r.toRequests$1(this.globalFilter)[0],a=_.JSArray_methods.fold$2(r.conditions,n.dimensions,new t.TableDatasourceConfigModel_toRequests__closure);return n.copyWith$3$blendConditions$dimensions$rollup(i,a,e.rollup!=null&&u.get$isNotEmpty$asx(a)?u.get$length$asx(a)-1:null)},$signature:100},t.TableDatasourceConfigModel_toRequests__closure.prototype={call$2(r,e){var i,n,a,s,o,l,D,d,c,p,y,g=e.joinDimension;return g!=null&&!u.contains$1$asx(r,g)&&(i=t.List_List$of(r,!0,$.QueryRequestDimension),n=g.option,a=g.schemaName,s=g.name,o=g.label,l=g.decimal,D=g.timeFormatter,d=g.formatter,c=g.fillGap,p=g.dataFormula,y=g.displayFormula,g=g.dateComparison,i.push(new t.QueryRequestDimension(n,o,l,D,d,c,p,y,!0,g,a,s)),r=i),r},$signature:42},t.TableDatasourceConfigModel_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:101},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson_closure.prototype={call$1(r){var e={},i=e.joinDatasourceConfig=t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson(r),n=$.JoinDatasourceCondition;return n=t.ListExtensions_mapIndexed(i.conditions,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure(e,r,this.baseConfig),n,n),e.joinDatasourceConfig=i.copyWith$1$conditions(t.List_List$of(n,!0,n.$ti._eval$1("Iterable.E")))},$signature:102},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure.prototype={call$2(r,e){var i,n,a,s=e.joinDimension;return s==null&&(i=this.json,n=t.IterableExtension_firstWhereOrNull(this._box_0.joinDatasourceConfig.get$dimensions(),new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure(i,r)),i=t.List_List$from(u.$index$asx(u.$index$asx(i.$index(0,"conditions"),r),"mainFields"),$.String),a=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,QueryRequestDimension?>"),a=t.List_List$of(new t.MappedListIterable(i,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0(this.baseConfig),a),!0,a._eval$1("ListIterable.E")),i=e.operator,e=new t.JoinDatasourceCondition(a,n??s,i)),e},$signature:103},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())===u.$index$asx(u.$index$asx(this.json.$index(0,"conditions"),this.index),"joinField")},$signature:9},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0.prototype={call$1(r){return t.IterableExtension_firstWhereOrNull(this.baseConfig.dimensions,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure(r))},$signature:104},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())===this.mainField},$signature:9},t.JoinDatasourceConfig.prototype={toJson$0(){var r=this,e=t.LinkedHashMap_LinkedHashMap$of(r.super$BaseDatasourceConfigModel$toJson(),$.String,$.dynamic),i=r.conditions,n=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>");return e.$indexSet(0,"conditions",t.List_List$of(new t.MappedListIterable(i,new t.JoinDatasourceConfig_toJson_closure,n),!0,n._eval$1("ListIterable.E"))),e.$indexSet(0,"rowIds",r.get$rowIds()),e.$indexSet(0,"columnIds",r.get$columnIds()),e},copyWith$2$conditions$mainDimensions(r,e){var i=this,n=i.get$dimensions(),a=i.get$metrics(),s=r??i.conditions,o=e??i.mainDimensions,l=i.get$rowIds(),D=i.get$columnIds();return t.JoinDatasourceConfig$(D,s,n,i.filters,i.isComparable,i.limit,o,a,i.periodType,l,i.schemaNames,i.sorts,i.timezone)},copyWith$1$mainDimensions(r){return this.copyWith$2$conditions$mainDimensions(null,r)},copyWith$1$conditions(r){return this.copyWith$2$conditions$mainDimensions(r,null)},get$_rowIds(){return this._rowIds},get$_columnIds(){return this._columnIds}},t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson_closure.prototype={call$1(r){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(r)},$signature:105},t.JoinDatasourceConfig_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:30},t.JoinDatasourceCondition.prototype={toJson$0(){var r,e,i=this.joinDimension;return i=i==null?null:i.toJson$0(),r=this.mainDimensions,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>?>"),e=t.List_List$of(new t.MappedListIterable(r,new t.JoinDatasourceCondition_toJson_closure,e),!0,e._eval$1("ListIterable.E")),t.LinkedHashMap_LinkedHashMap$_literal(["joinDimension",i,"mainDimensions",e,"operator",this.operator._name],$.String,$.dynamic)}},t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson_closure.prototype={call$1(r){return t.QueryRequestDimension_fromJson($.Map_String_dynamic._as(r))},$signature:17},t.JoinDatasourceCondition_toJson_closure.prototype={call$1(r){return r==null?null:r.toJson$0()},$signature:106},t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig.prototype={},t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig.prototype={},t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig.prototype={},t.BaseXYDatasourceConfigModel.prototype={get$drillDimension(){if(this.get$dimensions().length<=1)return null;var r=this._xy_datasource_config_model$_drillDimension;return r!=null?t.uniqueAlias(r):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},toRequests$1(r){var e=this.super$BaseDatasourceConfigModel$toRequests(r)[0],i=t.List_List$of(e.dimensions,!0,$.QueryRequestDimension),n=this.get$dimensions().length!==0?_.JSArray_methods.sublist$2(i,0,1):i;return i=this.breakdownDimension,i!=null&&n.push(i),t._setArrayType([e.copyWith$1$dimensions(n)],$.JSArray_QueryRequest)},toJson$0(){var r,e=this,i=t.LinkedHashMap_LinkedHashMap$of(e.super$BaseDatasourceConfigModel$toJson(),$.String,$.dynamic);return i.$indexSet(0,"isTransposed",e.isTransposed),r=e.breakdownDimension,i.$indexSet(0,"breakdownDimension",r==null?null:r.toJson$0()),i.$indexSet(0,"showLabel",e.showLabel),i.$indexSet(0,"isCumulative",e.isCumulative),i.$indexSet(0,"drillDimension",e.get$drillDimension()),i}},t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig.prototype={},t.GlobalFilterModel.prototype={},t.ReportWidgetModel.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["title",this.title,"type",this.type._name,"config",this.config.toJson$0()],$.String,$.dynamic)}},t.ReCase.prototype={_groupIntoWords$1(r){var e,i,n,a,s,o,l,D,d,c=new t.StringBuffer(""),p=t._setArrayType([],$.JSArray_String);for(e=r.length,i=this.symbolSet,n=this._upperAlphaRegex._nativeRegExp,a=r.toUpperCase()!==r,s=0;s<e;)o=r[s],++s,l=s===e?null:r[s],!i.contains$1(0,o)&&(D=c._contents+=o,l!=null?d=n.test(l)&&a||i.contains$1(0,l):d=!0,d&&(p.push((D.charCodeAt(0)==0,D)),c._contents=""));return p},_getCamelCase$0(){var r,e,i=this.__ReCase__words_A;return i===E&&t.throwUnnamedLateFieldNI(),r=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(i,this.get$_upperCaseFirstLetter(),r),!0,r._eval$1("ListIterable.E")),this.__ReCase__words_A.length!==0&&(e[0]=e[0].toLowerCase()),_.JSArray_methods.join$1(e,"")},_upperCaseFirstLetter$1(r){return _.JSString_methods.substring$2(r,0,1).toUpperCase()+_.JSString_methods.substring$1(r,1).toLowerCase()}},t.TZDateTime.prototype={get$millisecondsSinceEpoch(){return this._native.get$millisecondsSinceEpoch()},get$isUtc(){return this.location===E.$get$_UTC()},toUtc$0(){var r=E.$get$_UTC();return this.location===r?this:t.TZDateTime$from(this._native,r)},toLocal$0(){return this.location===E.___local._readField$0()?this:t.TZDateTime$from(this._native,E.___local._readField$0())},toString$0(r){return this._toString$1$iso8601(!1)},toIso8601String$0(){return this._toString$1$iso8601(!0)},_toString$1$iso8601(r){var e,i=this.timeZone.offset,n=this._localDateTime,a=t.TZDateTime__fourDigits(n.get$year()),s=t.TZDateTime__twoDigits(n.get$month()),o=t.TZDateTime__twoDigits(n.get$day()),l=r?"T":" ",D=t.TZDateTime__twoDigits(n.get$hour()),d=t.TZDateTime__twoDigits(n.get$minute()),c=t.TZDateTime__twoDigits(n.get$second()),p=t.TZDateTime__threeDigits(n.get$millisecond()),y=n.get$microsecond()===0?"":t.TZDateTime__threeDigits(n.get$microsecond());return this.location===E.$get$_UTC()?a+"-"+s+"-"+o+l+D+":"+d+":"+c+"."+p+y+"Z":(i>0?n=1:n=i<0?-1:i,e=n>=0?"+":"-",i=_.JSInt_methods._tdivFast$1(Math.abs(i),1e3),a+"-"+s+"-"+o+l+D+":"+d+":"+c+"."+p+y+e+t.TZDateTime__twoDigits(_.JSInt_methods._tdivFast$1(i,3600))+t.TZDateTime__twoDigits(_.JSInt_methods._tdivFast$1(_.JSInt_methods.$mod(i,3600),60)))},add$1(r,e){return t.TZDateTime$from(this._native.add$1(0,e),this.location)},subtract$1(r){return t.TZDateTime$from(this._native.subtract$1(r),this.location)},$eq(r,e){var i;return e==null?!1:(this!==e?i=e instanceof t.TZDateTime&&this._native.isAtSameMomentAs$1(e._native)&&this.location===e.location:i=!0,i)},isAfter$1(r){var e=r instanceof t.TZDateTime?r._native:r;return this._native.isAfter$1(e)},isAtSameMomentAs$1(r){var e=r instanceof t.TZDateTime?r._native:r;return this._native.isAtSameMomentAs$1(e)},compareTo$1(r,e){var i=e instanceof t.TZDateTime?e._native:e;return this._native.compareTo$1(0,i)},get$hashCode(r){var e=this._native;return e.get$hashCode(e)},get$year(){return this._localDateTime.get$year()},get$month(){return this._localDateTime.get$month()},get$day(){return this._localDateTime.get$day()},get$hour(){return this._localDateTime.get$hour()},get$minute(){return this._localDateTime.get$minute()},get$second(){return this._localDateTime.get$second()},get$millisecond(){return this._localDateTime.get$millisecond()},get$microsecond(){return this._localDateTime.get$microsecond()},get$weekday(){return this._localDateTime.get$weekday()},$isDateTime:1},t.TimeZoneInitException.prototype={toString$0(r){return this.msg}},t.LocationNotFoundException.prototype={toString$0(r){return this.msg}},t.Location.prototype={Location$4(r,e,i,n){var a,s,o,l,D,d,c,p,y=this;for(a=y.transitionAt,s=y.zones,o=y.transitionZone,l=0;D=a.length,l<D;++l)d=a[l],c=E.$get$Location__cacheNow(),d<=c?(p=l+1,c=p===D||c<a[p]):c=!1,c&&(y._cacheStart=d,y._cacheEnd=864e13,c=l+1,c<D&&(y._cacheEnd=a[c]),y.__Location__cacheZone_A=s[o[l]])},lookupTimeZone$1(r){var e,i,n,a,s,o,l,D,d=this,c=864e13,p=d.zones;if(p.length===0)return _.TzInstant_ww8;if(e=d._cacheStart,r>=e&&r<d._cacheEnd)return p=d.__Location__cacheZone_A,p===E&&t.throwUnnamedLateFieldNI(),new t.TzInstant(p,e,d._cacheEnd);if(e=d.transitionAt,i=e.length,i===0||r<e[0])return n=d._firstZone$0(),new t.TzInstant(n,-864e13,e.length===0?c:_.JSArray_methods.get$first(e));for(a=c,s=0;o=i-s,o>1;)l=s+_.JSInt_methods._tdivFast$1(o,2),D=e[l],r<D?(a=D,i=l):s=l;return new t.TzInstant(p[d.transitionZone[s]],e[s],a)},_firstZone$0(){var r,e,i,n,a,s,o=this;if(!o._firstZoneIsUsed$0())return _.JSArray_methods.get$first(o.zones);if(r=o.transitionZone,r.length!==0&&o.zones[_.JSArray_methods.get$first(r)].isDst){for(e=_.JSArray_methods.get$first(r)-1,i=o.zones;e>=0;--e)if(n=i[e],!n.isDst)return n}for(i=r.length,a=o.zones,s=0;s<i;++s)if(n=a[r[s]],!n.isDst)return n;return _.JSArray_methods.get$first(a)},_firstZoneIsUsed$0(){var r,e,i;for(r=this.transitionZone,e=r.length,i=0;i<e;++i)if(r[i]===0)return!0;return!1},toString$0(r){return this.name}},t.TimeZone.prototype={$eq(r,e){var i,n=this;return e==null?!1:(n!==e?i=e instanceof t.TimeZone&&n.offset===e.offset&&n.isDst===e.isDst&&n.abbreviation===e.abbreviation:i=!0,i)},get$hashCode(r){var e=_.JSInt_methods.get$hashCode(this.offset),i=this.isDst?519018:218159;return 37*(37*(629+e)+i)+_.JSString_methods.get$hashCode(this.abbreviation)},toString$0(r){return"["+this.abbreviation+" offset="+this.offset+" dst="+this.isDst+"]"}},t.TzInstant.prototype={},t.LocationDatabase.prototype={$get$1(r){var e,i=this._locations;if(i.__js_helper$_length===0)throw t.wrapException(t.LocationNotFoundException$("Tried to get location before initializing timezone database"));if(e=i.$index(0,r),e==null)throw t.wrapException(t.LocationNotFoundException$('Location with the name "'+r+`" doesn't exist`));return e}},t.TypedDataBuffer.prototype={get$length(r){return this._typed_buffer$_length},$index(r,e){if(e>=this._typed_buffer$_length)throw t.wrapException(t.IndexError$(e,this));return this._buffer[e]},$indexSet(r,e,i){if(e>=this._typed_buffer$_length)throw t.wrapException(t.IndexError$(e,this));this._buffer[e]=i},set$length(r,e){var i,n,a,s=this,o=s._typed_buffer$_length;if(e<o)for(i=s._buffer,n=e;n<o;++n)i[n]=0;else o=s._buffer.length,e>o&&(o===0?a=new Uint8Array(e):a=s._createBiggerBuffer$1(e),_.NativeUint8List_methods.setRange$3(a,0,s._typed_buffer$_length,s._buffer),s._buffer=a);s._typed_buffer$_length=e},_add$1(r){var e=this,i=e._typed_buffer$_length,n=e._buffer;i===n.length&&(n=e._createBiggerBuffer$1(null),_.NativeUint8List_methods.setRange$3(n,0,i,e._buffer),e._buffer=n),i=n,i[e._typed_buffer$_length++]=r},add$1(r,e){var i=this,n=i._typed_buffer$_length,a=i._buffer;n===a.length&&(a=i._createBiggerBuffer$1(null),_.NativeUint8List_methods.setRange$3(a,0,n,i._buffer),i._buffer=a),n=a,n[i._typed_buffer$_length++]=e},addAll$1(r,e){t.RangeError_checkNotNegative(0,"start"),this._addAll$3(e,0,null)},_addAll$3(r,e,i){var n,a,s,o,l,D=this,d="Too few elements",c=$.List_dynamic._is(r);if(c&&(i=r.length),i!=null){n=D._typed_buffer$_length,c&&(c=r.length,(e>c||i>c)&&t.throwExpression(t.StateError$(d))),a=i-e,s=n+a,D._ensureCapacity$1(s),c=D._buffer,_.NativeUint8List_methods.setRange$4(c,s,D._typed_buffer$_length+a,c,n),_.NativeUint8List_methods.setRange$4(D._buffer,n,s,r,e),D._typed_buffer$_length=s;return}for(c=u.get$iterator$ax(r),o=0;c.moveNext$0();)l=c.get$current(),o>=e&&D._add$1(l),++o;if(o<e)throw t.wrapException(t.StateError$(d))},_ensureCapacity$1(r){var e,i=this;r<=i._buffer.length||(e=i._createBiggerBuffer$1(r),_.NativeUint8List_methods.setRange$3(e,0,i._typed_buffer$_length,i._buffer),i._buffer=e)},_createBiggerBuffer$1(r){var e=this._buffer.length*2;return r!=null&&e<r?e=r:e<8&&(e=8),new Uint8Array(e)}},t._IntBuffer.prototype={},t.Uint8Buffer.prototype={},t.getSchemas_closure.prototype={call$1(r){return r.toJson$0()},$signature:107},t.getVisualizationSchemas_closure.prototype={call$1(r){return r.toJson$0()},$signature:108},t.sqlResponsesToQueryResponses_closure.prototype={call$1(r){return t.QueryRequest_fromJson(r)},$signature:109},t.sqlResponsesToQueryResponses_closure0.prototype={call$2(r,e){var i,n,a=null,s=u.$index$asx(this.sqlResponses,r),o=e.getColumns$1(this.engine.context.schemaLibrary),l=e.timeDimension,D=l==null,d=D?a:l.start;return d==null&&(d=""),i=D?a:l.end,i==null&&(i=""),n=D?a:l.timeStart,n==null&&(n=""),l=D?a:l.timeEnd,l==null&&(l=""),t.QueryResponse$map(o,new t.DateTimeRange(d,i),s,new t.DateTimeRange(n,l))},$signature:110},t.sqlResponsesToQueryResponses_closure1.prototype={call$1(r){return r.toJson$0()},$signature:111},t.getQueryRequests_closure.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure0.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure1.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure2.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure3.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure4.prototype={call$1(r){return u.toString$0$(r)},$signature:7},t.getQueryRequests_closure5.prototype={call$1(r){var e=t.Jiffy$(r).__Jiffy__dateTime_A;return e===E&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure6.prototype={call$1(r){var e=t.Jiffy$(r).__Jiffy__dateTime_A;return e===E&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure7.prototype={call$1(r){var e=t.Jiffy$(r).__Jiffy__dateTime_A;return e===E&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure8.prototype={call$1(r){var e=t.Jiffy$(r).__Jiffy__dateTime_A;return e===E&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure9.prototype={call$1(r){return r.toJson$0()},$signature:113},t.Exports.prototype={},t._Exports.prototype={},function(){var e=u.LegacyJavaScriptObject.prototype;e.super$LegacyJavaScriptObject$toString=e.toString$0,e=t.JsLinkedHashMap.prototype,e.super$JsLinkedHashMap$internalContainsKey=e.internalContainsKey$1,e.super$JsLinkedHashMap$internalGet=e.internalGet$1,e.super$JsLinkedHashMap$internalSet=e.internalSet$2,e=t.ListMixin.prototype,e.super$ListMixin$setRange=e.setRange$4,e=t.Field.prototype,e.super$Field$getSql=e.getSql$3$option$schema$value,e=t.BaseDatasourceConfigModel.prototype,e.super$BaseDatasourceConfigModel$toRequests=e.toRequests$1,e.super$BaseDatasourceConfigModel$toJson=e.toJson$0}(),function(){var e=X._static_2,i=X._static_1,n=X._instance_1u,a=X._instance_0u;e(u,"_interceptors_JSArray__compareAny$closure","JSArray__compareAny",114),e(t,"collection___defaultEquals$closure","_defaultEquals",33),i(t,"collection___defaultHashCode$closure","_defaultHashCode",22),i(t,"convert___defaultToEncodable$closure","_defaultToEncodable",3),i(t,"core__identityHashCode$closure","identityHashCode",22),i(t,"core_RegExp_escape$closure","RegExp_escape",4),e(t,"core__identical$closure","identical",33);var s;n(s=t.DateBuilder.prototype,"get$setYear","setYear$1",6),n(s,"get$setMonth","setMonth$1",6),n(s,"get$setDay","setDay$1",6),n(s,"get$setDayOfYear","setDayOfYear$1",6),n(s,"get$setHour","setHour$1",6),n(s,"get$setMinute","setMinute$1",6),n(s,"get$setSecond","setSecond$1",6),n(s,"get$setFractionalSecond","setFractionalSecond$1",6),i(t,"date_format_DateFormat_localeExists$closure","DateFormat_localeExists",77),a(t.DateFormat.prototype,"get$_initDigitMatcher","_initDigitMatcher$0",49),n(t.ReCase.prototype,"get$_upperCaseFirstLetter","_upperCaseFirstLetter$1",4),i(t,"js_compiler__getMergeInfoSql$closure","getMergeInfoSql",3),i(t,"js_compiler__getClearTableSql$closure","getClearTableSql",3),i(t,"js_compiler__getMergeSql$closure","getMergeSql",3),i(t,"js_compiler__getSchemas$closure","getSchemas",3),i(t,"js_compiler__getVisualizationSchemas$closure","getVisualizationSchemas",3),i(t,"js_compiler__requestJsonToSql$closure","requestJsonToSql",3),i(t,"js_compiler__sqlResponsesToQueryResponses$closure","sqlResponsesToQueryResponses",3),i(t,"js_compiler__getQueryRequests$closure","getQueryRequests",3),i(t,"js_compiler__getCreateMaterializedTableSql$closure","getCreateMaterializedTableSql",3)}(),function(){var e=X.mixin,i=X.inherit,n=X.inheritMany;i(t.Object,null),n(t.Object,[t.JS_CONST,u.Interceptor,u.ArrayIterator,t.Iterable,t.CastIterator,t.Error,t._ListBase_Object_ListMixin,t.ListIterator,t.Iterator,t.EmptyIterator,t.FixedLengthListMixin,t.UnmodifiableListMixin,t.Symbol,t.MapView,t.ConstantMap,t.Closure,t.JSInvocationMirror,t.TypeErrorDecoder,t.NullThrownFromJavaScriptException,t._Required,t.MapMixin,t.LinkedHashMapCell,t.LinkedHashMapKeyIterator,t.JSSyntaxRegExp,t._MatchImplementation,t._AllMatchesIterator,t.StringMatch,t._StringAllMatchesIterator,t._Cell,t.Rti,t._FunctionParameters,t._Type,t._IterationMarker,t._SyncStarIterator,t.StreamTransformerBase,t.__SetBase_Object_SetMixin,t._LinkedHashSetCell,t._LinkedHashSetIterator,t.ListMixin,t._UnmodifiableMapMixin,t.SetMixin,t.Codec,t._JsonStringifier,t._Utf8Encoder,t.DateTime,t.Duration,t._Enum,t.OutOfMemoryError,t.StackOverflowError,t._Exception,t.FormatException,t.MapEntry,t.Null,t.Sink,t.StringBuffer,t.Endian,t.Digest,t.HashSink,t.DateSymbols,t.DateBuilder,t.DateFormat,t._DateFormatField,t.StringStack,t.UninitializedLocaleData,t.LocaleDataException,t.Jiffy,t.Locale,t.JiffyException,t.Connection,t.SchemaLibrary,t.QueryEngineContext,t.Permission,t.TopLevelFilters,t.Source,t.Index,t.Schema,t.Field,t.Join,t.JoinLateralSort,t.JoinLateral,t.JoinCondition,t.QueryRequestComparisonTarget,t.QueryRequestComparison,t.QueryRequestCommonField,t._GetSourceTableResponse,t._PlainSqlColumn,t.QueryRequest,t.QueryRequestTimeDimension,t.QueryResponseColumn,t.DateTimeRange,t.QueryResponse,t.QueryResponseRow,t.VisualizationSchema,t.VisualizationField,t.QueryEngine,t.BaseDatasourceConfigModel,t.DataSourceDrillConfig,t.DataSourceRowColumnConfig,t.JoinDatasourceCondition,t.GlobalFilterModel,t.ReportWidgetModel,t.ReCase,t.TZDateTime,t.TimeZoneInitException,t.LocationNotFoundException,t.Location,t.TimeZone,t.TzInstant,t.LocationDatabase]),n(u.Interceptor,[u.JSBool,u.JSNull,u.JavaScriptObject,u.JSArray,u.JSNumber,u.JSString,t.NativeTypedData]),i(u.LegacyJavaScriptObject,u.JavaScriptObject),n(u.LegacyJavaScriptObject,[u.PlainJavaScriptObject,u.UnknownJavaScriptObject,u.JavaScriptFunction,t.BufferModule,t.BufferConstants,t.Buffer,t.ConsoleModule,t.Console,t.EventEmitter,t.Promise,t.Date,t.JsError,t.Atomics,t.Modules,t.Module,t.Net,t.Socket,t.NetAddress,t.NetServer,t.NodeJsError,t.Process,t.CPUUsage,t.Release,t.StreamModule,t.Readable,t.Writable,t.Duplex,t.Transform,t.WritableOptions,t.ReadableOptions,t.Immediate,t.Timeout,t.TTY,t.Util,t.Exports,t._Exports]),i(u.JSUnmodifiableArray,u.JSArray),n(u.JSNumber,[u.JSInt,u.JSNumNotInt]),n(t.Iterable,[t._CastIterableBase,t.EfficientLengthIterable,t.MappedIterable,t.WhereIterable,t.SkipIterable,t._ConstantMapKeyIterable,t.IterableBase,t._StringAllMatchesIterable]),n(t._CastIterableBase,[t.CastIterable,t.__CastListBase__CastIterableBase_ListMixin]),i(t._EfficientLengthCastIterable,t.CastIterable),i(t._CastListBase,t.__CastListBase__CastIterableBase_ListMixin),i(t.CastList,t._CastListBase),n(t.Error,[t.LateError,t.TypeError,t.JsNoSuchMethodError,t.UnknownJsTypeError,t.RuntimeError,t._Error,t.JsonUnsupportedObjectError,t.AssertionError,t.NullThrownError,t.ArgumentError,t.NoSuchMethodError,t.UnsupportedError,t.UnimplementedError,t.StateError,t.ConcurrentModificationError,t.CyclicInitializationError]),i(t.ListBase,t._ListBase_Object_ListMixin),n(t.ListBase,[t.UnmodifiableListBase,t.TypedDataBuffer]),i(t.CodeUnits,t.UnmodifiableListBase),n(t.EfficientLengthIterable,[t.ListIterable,t.EmptyIterable,t.LinkedHashMapKeyIterable]),n(t.ListIterable,[t.SubListIterable,t.MappedListIterable,t.ReversedListIterable,t._JsonMapKeyIterable,t._GeneratorIterable]),i(t.EfficientLengthMappedIterable,t.MappedIterable),n(t.Iterator,[t.MappedIterator,t.WhereIterator,t.SkipIterator]),i(t.EfficientLengthSkipIterable,t.SkipIterable),i(t._UnmodifiableMapView_MapView__UnmodifiableMapMixin,t.MapView),i(t.UnmodifiableMapView,t._UnmodifiableMapView_MapView__UnmodifiableMapMixin),i(t.ConstantMapView,t.UnmodifiableMapView),n(t.Closure,[t.Closure2Args,t.Closure0Args,t.TearOffClosure,t.initHooks_closure,t.initHooks_closure1,t._LinkedCustomHashMap_closure,t.MapMixin_entries_closure,t.DateTime_parse_parseIntOrZero,t.DateTime_parse_parseMilliAndMicroseconds,t.DateFormat_dateTimeConstructor_closure,t.DateFormat__checkDateOnly_closure,t.DateFormat__initDigitMatcher_closure,t.DateFormat__initDigitMatcher_closure0,t._DateFormatPatternField_parseStandaloneDay_closure,t.Jiffy__parseString_closure,t.SchemaLibrary_getSchema_closure,t.SchemaLibrary_visualizationSchemas_closure,t.SchemaLibrary_visualizationSchemas_closure0,t.Materialize_get_createMaterializedTableSql_closure,t.Materialize_get_createMaterializedTableSql_closure0,t.Materialize_get_createMaterializedTableSql_closure1,t.Materialize_get_createMaterializedTableSql_closure2,t.Materialize_getMergeSql_closure,t.Materialize_getMergeSql_closure0,t.Materialize_getMergeSql_closure1,t.Materialize_getMergeSql_closure2,t.Materialize_getMergeSql_closure3,t.Materialize_getMergeSql_closure4,t.TopLevelFilters_fromJson_closure,t.TopLevelFilters_toJson_closure,t.Schema_visualizationSchema_closure,t.Schema_visualizationSchema_closure0,t.Schema_visualizationSchema_closure1,t.Schema_fromJson_closure,t.Schema_fromJson_closure0,t.Schema_fromJson_closure1,t.Schema_fromJson_closure2,t.Schema_toJson_closure,t.Schema_toJson_closure0,t.Schema_toJson_closure1,t.Schema_toJson_closure2,t.Field_getQueryPlainSql_closure,t.Join_fromJson_closure,t.Join_toJson_closure,t.JoinLateral_toJson_closure,t.QueryRequestComparison_QueryRequestComparison$nested_closure,t.QueryRequestComparison_getToValues_closure,t.QueryRequestComparison_getToValues__closure0,t.QueryRequestComparison_getToValues_closure0,t.QueryRequestComparison_getToValues__closure,t.QueryRequestComparison_getFromValue_closure,t.QueryRequestComparison_getSql_closure,t.QueryRequestComparison_getSql_closure0,t.uniqueAlias_closure,t.QueryRequestCommonField_getAggregatedSql_closure,t.QueryRequestDimension_getPlainSql_closure,t.QueryRequestDimension_getColumn_closure,t.QueryRequestMetric_getColumn_closure,t.QueryRequestMetric_getPlainSql_closure,t.QueryRequest__closure0,t.QueryRequest__closure,t.QueryRequest__getJoins_closure,t.QueryRequest__getJoins__closure,t.QueryRequest_fromJson_closure,t.QueryRequest_fromJson_closure0,t.QueryRequest_fromJson_closure1,t.QueryRequest_fromJson_closure2,t.QueryRequest_fromJson_closure3,t.QueryRequest_fromJson_closure4,t.QueryRequest_toJson_closure,t.QueryRequest_toJson_closure0,t.QueryRequest_toJson_closure1,t.QueryRequest_toJson_closure2,t.QueryRequest_toJson_closure3,t.QueryRequest_toJson_closure4,t.QueryRequest_getColumns_closure,t.QueryRequest_getColumns_closure0,t.QueryRequest__getPlainSqlColumns_closure,t.QueryRequest__getPlainSqlColumns_closure0,t.QueryRequest__getPlainSqlColumns_closure1,t.QueryRequest__getPlainSqlColumns__closure,t.QueryRequest__getPlainSqlSorts_closure,t.QueryRequest__getSqlFilters_closure,t.QueryRequest__getSqlFilters_closure0,t.QueryRequest__getSqlFilters_closure1,t.QueryRequest__getSqlFilters_closure2,t.QueryRequest__getSqlFilters_closure3,t.QueryRequest__getSqlFilters_closure4,t.QueryRequest__getSqlJoins__closure,t.QueryRequest__getSqlJoins__closure0,t.QueryRequest__getRollupSelect_closure0,t.QueryRequest__getRollupSelect_closure2,t.QueryRequest__getRollupSelect_closure3,t.QueryRequest__getRollupSelect_closure4,t.QueryRequest__getRollupSelect_closure6,t.QueryRequest__getRollupSelect_closure7,t.QueryRequest__getRollupSelect_closure8,t.QueryRequest__getRollupSelect_closure9,t.QueryRequest__hasFillGap_closure,t.QueryRequest__getSqlSelectSorts_closure,t.QueryRequest__getSqlSelectSorts__closure,t.QueryRequest__getSqlSelectSorts__closure0,t.QueryRequest_getSqlSelect_closure,t.QueryRequest_getSqlSelect_closure0,t.QueryRequest_getSqlSelect_closure1,t.QueryRequest__transformSqlAlias_closure,t.QueryRequest__getSourceTable_closure,t.QueryRequest__getSourceTable_closure0,t.QueryRequest__getFillGapTable_closure0,t.QueryRequest__getFillGapTable__closure1,t.QueryRequest__getFillGapTable__closure2,t.QueryRequest__getFillGapTable_closure2,t.QueryRequest__getFillGapTable__closure,t.QueryRequest__getFillGapTable__closure0,t.QueryRequest__getFillGapTable_closure3,t.QueryRequest__getFillGapTable_closure4,t.QueryRequest__getFullTable_closure,t.QueryRequest__getFullTable_closure1,t.QueryRequest__getFullTable_closure2,t.QueryRequestSort_getPlainSql_closure,t.QueryRequestSort_getSortSql_closure,t.QueryResponse$map_closure,t.QueryResponse_toJson_closure,t.QueryResponse_toJson_closure0,t.VisualizationSchema_toJson_closure,t.VisualizationSchema_toJson_closure0,t.VisualizationField_filterDimensionOptions_closure,t.VisualizationField_fillGapDimensionOptions_closure,t.VisualizationField_isNumericAggregations_closure,t.VisualizationField_toJson_closure,t.VisualizationField_toJson_closure0,t.VisualizationField_toJson_closure1,t.VisualizationField_toJson_closure2,t.VisualizationField_toJson_closure3,t.VisualizationField_toJson_closure4,t.VisualizationField_toJson_closure5,t.VisualizationField_toJson_closure6,t.VisualizationField_toJson_closure7,t.addonFlattenItemSchema_closure,t.addonFlattenItemSchema_closure0,t.adjustmentSchema_closure,t.adjustmentSchema_closure0,t.billSchema_closure,t.billSchema_closure0,t.businessSchema_closure,t.businessSchema_closure0,t.campaignSchema_closure,t.campaignSchema_closure0,t.campaignTierSchema_closure,t.campaignTierSchema_closure0,t.chargeSchema_closure,t.chargeSchema_closure0,t.closingDraftSchema_closure,t.closingDraftSchema_closure0,t.closingDraftSkuSchema_closure,t.closingDraftSkuSchema_closure0,t.closingSkuSchema_closure,t.closingSkuSchema_closure0,t.collectibleCollectionSchema_closure,t.collectibleCollectionSchema_closure0,t.collectibleConfigSchema_closure,t.collectibleConfigSchema_closure0,t.collectibleTransactionSchema_closure,t.collectibleTransactionSchema_closure0,t.completeTimeBillSchema_closure,t.completeTimeBillSchema_closure0,t.counterSchema_closure,t.counterSchema_closure0,t.creditTransactionSchema_closure,t.creditTransactionSchema_closure0,t.drawerSchema_closure,t.drawerSchema_closure0,t.flattenItemSchema_closure,t.flattenItemSchema_closure0,t.internalPurchaseOrderSchema_closure,t.internalPurchaseOrderSchema_closure0,t.internalPurchaseOrderDeliveryFulfillmentSchema_closure,t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0,t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure,t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0,t.internalPurchaseOrderDeliveryOrderSchema_closure,t.internalPurchaseOrderDeliveryOrderSchema_closure0,t.internalPurchaseOrderDeliveryOrderSkuSchema_closure,t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0,t.internalPurchaseOrderItemSchema_closure,t.internalPurchaseOrderItemSchema_closure0,t.inventoryAdjustmentSchema_closure,t.inventoryAdjustmentSchema_closure0,t.inventoryAdjustmentPhysicalSkuSchema_closure,t.inventoryAdjustmentPhysicalSkuSchema_closure0,t.inventoryAdjustmentSkuSchema_closure,t.inventoryAdjustmentSkuSchema_closure0,t.inventoryV1FlattenInventorySchema_closure,t.inventoryV1FlattenInventorySchema_closure0,t.itemSchema_closure,t.itemSchema_closure0,t.itemMovementSchema_closure,t.itemMovementSchema_closure0,t.kitchenStationSchema_closure,t.kitchenStationSchema_closure0,t.memberSchema_closure,t.memberSchema_closure0,t.memberStorePurchaseSchema_closure,t.memberStorePurchaseSchema_closure0,t.memberStorePurchasePaymentSchema_closure,t.memberStorePurchasePaymentSchema_closure0,t.memberTitleSchema_closure,t.memberTitleSchema_closure0,t.memberV2Schema_closure,t.memberV2Schema_closure0,t.membershipSchema_closure,t.membershipSchema_closure0,t.membershipTitleSchema_closure,t.membershipTitleSchema_closure0,t.menuV3GroupSchema_closure,t.menuV3GroupSchema_closure0,t.menuV3ItemSchema_closure,t.menuV3ItemSchema_closure0,t.menuV3SkuSchema_closure,t.menuV3SkuSchema_closure0,t.menuV4CatalogItemSchema_closure,t.menuV4CatalogItemSchema_closure0,t.menuV4GroupSchema_closure,t.menuV4GroupSchema_closure0,t.menuV4ItemSchema_closure,t.menuV4ItemSchema_closure0,t.menuV4ItemInventoryBindingSchema_closure,t.menuV4ItemInventoryBindingSchema_closure0,t.menuV4SkuSchema_closure,t.menuV4SkuSchema_closure0,t.parentFlattenItemSchema_closure,t.parentFlattenItemSchema_closure0,t.paymentSchema_closure,t.paymentSchema_closure0,t.paymentTimePaymentSchema_closure,t.paymentTimePaymentSchema_closure0,t.purchaseOrderSchema_closure,t.purchaseOrderSchema_closure0,t.purchaseOrderDeliveryFulfillmentSchema_closure,t.purchaseOrderDeliveryFulfillmentSchema_closure0,t.purchaseOrderDeliveryFulfillmentSkuSchema_closure,t.purchaseOrderDeliveryFulfillmentSkuSchema_closure0,t.purchaseOrderDeliveryOrderSchema_closure,t.purchaseOrderDeliveryOrderSchema_closure0,t.purchaseOrderDeliveryOrderSkuSchema_closure,t.purchaseOrderDeliveryOrderSkuSchema_closure0,t.purchaseOrderItemSchema_closure,t.purchaseOrderItemSchema_closure0,t.recommendationCallSchema_closure,t.recommendationCallSchema_closure0,t.recordSchema_closure,t.recordSchema_closure0,t.refundBillSchema_closure,t.refundBillSchema_closure0,t.restaurantSchema_closure,t.restaurantSchema_closure0,t.restaurantFeatureSchema_closure,t.restaurantFeatureSchema_closure0,t.restaurantLocationSchema_closure,t.restaurantLocationSchema_closure0,t.reviewSchema_closure,t.reviewSchema_closure0,t.slotSchema_closure,t.slotSchema_closure0,t.staffSchema_closure,t.staffSchema_closure0,t.stockSchema_closure,t.stockSchema_closure0,t.storeBundleSchema_closure,t.storeBundleSchema_closure0,t.storeTransactionSchema_closure,t.storeTransactionSchema_closure0,t.subItemSchema_closure,t.subItemSchema_closure0,t.timesheetSchema_closure,t.timesheetSchema_closure0,t.timesheetRecordSchema_closure,t.timesheetRecordSchema_closure0,t.unitCostHistorySchema_closure,t.unitCostHistorySchema_closure0,t.userSchema_closure,t.userSchema_closure0,t.voucherClaimSchema_closure,t.voucherClaimSchema_closure0,t.voucherClaimRedemptionSchema_closure,t.voucherClaimRedemptionSchema_closure0,t.warehouseLocationSchema_closure,t.warehouseLocationSchema_closure0,t.QueryEngine_getSql_closure,t.BaseDatasourceConfigModel_drilledDimensionIds_closure,t.BaseDatasourceConfigModel_metricIds_closure,t.BaseDatasourceConfigModel_toJson_closure,t.BaseDatasourceConfigModel_toJson_closure0,t.BaseDatasourceConfigModel_toJson_closure1,t.BaseDatasourceConfigModel_toJson_closure2,t.BaseDatasourceConfigModel_toJson_closure3,t.BaseDatasourceConfigModel_toJson_closure4,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure0,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure1,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure2,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure3,t.DataSourceDrillConfig_drilledDimensions_closure,t.DataSourceRowColumnConfig_rowIds_closure,t.DataSourceRowColumnConfig_rowIds_closure0,t.DataSourceRowColumnConfig_rowIds_closure2,t.DataSourceRowColumnConfig_rowIds_closure1,t.DataSourceRowColumnConfig_columnIds_closure,t.DataSourceRowColumnConfig_columnIds_closure0,t.DataSourceRowColumnConfig_columnIds_closure1,t.TableDatasourceConfigModel_joinDatasources_closure,t.TableDatasourceConfigModel_toRequests___closure,t.TableDatasourceConfigModel_toRequests_closure0,t.TableDatasourceConfigModel_toJson_closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson_closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure,t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson_closure,t.JoinDatasourceConfig_toJson_closure,t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson_closure,t.JoinDatasourceCondition_toJson_closure,t.getSchemas_closure,t.getVisualizationSchemas_closure,t.sqlResponsesToQueryResponses_closure,t.sqlResponsesToQueryResponses_closure1,t.getQueryRequests_closure,t.getQueryRequests_closure0,t.getQueryRequests_closure1,t.getQueryRequests_closure2,t.getQueryRequests_closure3,t.getQueryRequests_closure4,t.getQueryRequests_closure5,t.getQueryRequests_closure6,t.getQueryRequests_closure7,t.getQueryRequests_closure8,t.getQueryRequests_closure9]),n(t.Closure2Args,[t.ConstantMap_map_closure,t.Primitives_functionNoSuchMethod_closure,t.JsLinkedHashMap_addAll_closure,t.initHooks_closure0,t.LinkedHashMap_LinkedHashMap$from_closure,t.MapBase_mapToString_closure,t._JsonStringifier_writeMap_closure,t.NoSuchMethodError_toString_closure,t.DateFormat__fieldConstructors_closure,t.DateFormat__fieldConstructors_closure0,t.DateFormat__fieldConstructors_closure1,t.Jiffy__parseMap_closure,t.Join_getConditionsSql_closure,t.QueryRequest_closure,t.QueryRequest_closure0,t.QueryRequest__getPlainSqlColumns_closure2,t.QueryRequest__getSqlJoins_closure,t.QueryRequest__getRollupSelect_closure,t.QueryRequest__getRollupSelect_closure1,t.QueryRequest__getRollupSelect_closure5,t.QueryRequest__getSqlSelectSorts_closure0,t.QueryRequest__getSortedLimitTable_closure,t.QueryRequest__getFillGapTable_closure,t.QueryRequest__getFillGapTable_closure1,t.QueryRequest__getFullTable_closure0,t.VisualizationSchema_closure,t.DataSourceDrillConfig__availableIds_closure,t.DataSourceRowColumnConfig__availableIds_closure,t.DataSourceRowColumnConfig__availableIds_closure0,t.TableDatasourceConfigModel_drilledDimensions_closure,t.TableDatasourceConfigModel_toRequests_closure,t.TableDatasourceConfigModel_toRequests__closure0,t.TableDatasourceConfigModel_toRequests__closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure,t.sqlResponsesToQueryResponses_closure0]),i(t.ConstantStringMap,t.ConstantMap),i(t.NullError,t.TypeError),n(t.TearOffClosure,[t.StaticClosure,t.BoundClosure]),i(t.MapBase,t.MapMixin),n(t.MapBase,[t.JsLinkedHashMap,t._JsonMap]),n(t.IterableBase,[t._AllMatchesIterable,t._SyncStarIterable]),i(t.NativeTypedArray,t.NativeTypedData),i(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin,t.NativeTypedArray),i(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin,t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin),i(t.NativeTypedArrayOfInt,t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin),n(t.NativeTypedArrayOfInt,[t.NativeUint16List,t.NativeUint32List,t.NativeUint8List]),i(t._TypeError,t._Error),n(t.JsLinkedHashMap,[t._LinkedIdentityHashMap,t._LinkedCustomHashMap]),i(t._SetBase,t.__SetBase_Object_SetMixin),i(t._LinkedHashSet,t._SetBase),n(t.Codec,[t.Encoding,t.JsonCodec]),n(t.Encoding,[t.AsciiCodec,t.Utf8Codec]),i(t.Converter,t.StreamTransformerBase),n(t.Converter,[t._UnicodeSubsetDecoder,t.JsonEncoder,t.JsonDecoder,t.Utf8Encoder]),i(t.AsciiDecoder,t._UnicodeSubsetDecoder),i(t.JsonCyclicError,t.JsonUnsupportedObjectError),i(t._JsonStringStringifier,t._JsonStringifier),n(t.ArgumentError,[t.RangeError,t.IndexError]),i(t.DigestSink,t.Sink),i(t._Sha1Sink,t.HashSink),n(t._DateFormatField,[t._DateFormatLiteralField,t._DateFormatQuotedField,t._DateFormatPatternField]),n(t._Enum,[t.StartOfWeek,t.Units,t.SOURCE_TYPE,t.SCHEMA_NAME,t.DATA_TYPE,t.AGGREGATION_TYPE,t.COMPARISON_OPERATOR,t.DIMENSION_OPTION,t.TIME_FORMATTER,t.FORMATTER_TYPE,t.PERIOD_TYPE,t.SORT_TYPE,t.PermissionType,t.INDEX_METHOD,t.FIELD_TYPE,t.ChartType]),n(t.Locale,[t.ArLyLocale,t.ArSaMaDzKwTnLocale,t.AzLocale,t.BnLocale,t.DeLocale,t.EnLocale,t.EsLocale,t.FaLocale,t.FrLocale,t.HiLocale,t.IdLocale,t.ItLocale,t.JaLocale,t.KoLocale,t.NbLocale,t.NlLocale,t.PlLocale,t.PtLocale,t.RuLocale,t.SvLocale,t.ThLocale,t.TrLocale,t.UkLocale,t.ZhCnLocale,t.ZhLocale]),n(t.NodeJsError,[t.JsAssertionError,t.JsRangeError,t.JsReferenceError,t.JsSyntaxError,t.JsTypeError,t.JsSystemError]),n(t.Socket,[t.TTYReadStream,t.TTYWriteStream]),n(t.Field,[t._NumericField,t._TimestampField,t._BoolField,t._StringField]),n(t.QueryRequestComparisonTarget,[t._QueryRequestComparisonTargetValue,t._QueryRequestComparisonTargetVariable]),n(t.QueryRequestCommonField,[t.QueryRequestDimension,t.QueryRequestMetric,t.QueryRequestFilter,t.QueryRequestSort]),n(t.Closure0Args,[t.QueryRequestDimension_generateTimestampArraySql_closure,t.QueryRequestDimension_generateTimestampArraySql_closure0,t.QueryRequest__getSqlFilters__closure]),n(t.BaseDatasourceConfigModel,[t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.ScorecardDatasourceConfigModel,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig]),i(t.CircularDatasourceConfigModel,t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig),i(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig),i(t.TableDatasourceConfigModel,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig),i(t.JoinDatasourceConfig,t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig),i(t.BaseXYDatasourceConfigModel,t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig),i(t._IntBuffer,t.TypedDataBuffer),i(t.Uint8Buffer,t._IntBuffer),e(t.UnmodifiableListBase,t.UnmodifiableListMixin),e(t.__CastListBase__CastIterableBase_ListMixin,t.ListMixin),e(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin,t.ListMixin),e(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin,t.FixedLengthListMixin),e(t._ListBase_Object_ListMixin,t.ListMixin),e(t._UnmodifiableMapView_MapView__UnmodifiableMapMixin,t._UnmodifiableMapMixin),e(t.__SetBase_Object_SetMixin,t.SetMixin),e(t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.DataSourceDrillConfig),e(t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t.DataSourceRowColumnConfig),e(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t.DataSourceRowColumnConfig),e(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig,t.DataSourceDrillConfig),e(t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.DataSourceDrillConfig)}();var C={typeUniverse:{eC:new Map,tR:{},eT:{},tPV:{},sEA:[]},mangledGlobalNames:{int:"int",double:"double",num:"num",String:"String",bool:"bool",Null:"Null",List:"List"},mangledNames:{},types:["List<Field>(SCHEMA_NAME)","List<Join>(SCHEMA_NAME)","bool(Field)","@(@)","String(String)","String(QueryRequestDimension)","~(int)","String(@)","String(QueryRequestSort)","bool(QueryRequestDimension)","String(Field)","String(QueryRequestFilter)","DateTime(@)","String(SCHEMA_NAME)","List<String>(List<String>,QueryRequestMetric)","String(Match)","String(QueryRequestMetric)","QueryRequestDimension(@)","String(DIMENSION_OPTION)","QueryRequestFilter(@)","Map<String,@>(QueryRequestFilter)","bool(String)","int(Object?)","QueryRequestMetric(@)","SCHEMA_NAME(@)","QueryRequestSort(@)","DateTime()","Map<String,@>(QueryRequestMetric)","bool(Schema)","Map<String,@>(QueryRequestSort)","Map<String,@>(JoinDatasourceCondition)","~(Object?,Object?)","int(String?)","bool(Object?,Object?)","bool(QueryRequestSort)","~(@,@)","List<String>(List<String>,QueryRequestSort)","String(_PlainSqlColumn)","bool(DIMENSION_OPTION)","String(COMPARISON_OPERATOR)","String(AGGREGATION_TYPE)","Map<String,String>(Map<String,String>,QueryRequestDimension)","List<QueryRequestDimension>(List<QueryRequestDimension>,JoinDatasourceCondition)","int(int)","Map<String,@>(QueryRequestDimension)","VisualizationSchema(Schema)","bool(Join)","bool(@)","@(@,String)","RegExp()","DateTime(int,int,int,int,int,int,int,bool)","JoinDatasourceCondition(@)","Permission(@)","Map<String,@>(Permission)","VisualizationField(Field)","SCHEMA_NAME(Join)","Join(@)","QueryResponseColumn(QueryRequestDimension)","QueryResponseColumn(QueryRequestMetric)","_PlainSqlColumn(QueryRequestDimension)","_PlainSqlColumn(QueryRequestMetric)","_PlainSqlColumn(QueryRequestSort)","List<_PlainSqlColumn>(List<_PlainSqlColumn>,QueryRequestMetric)","Index(@)","QueryRequestFilter(Permission)","List<String>()","QueryRequestComparison(QueryRequestFilter)","bool(_DateFormatField)","String(String,Join)","bool(int,QueryRequestDimension)","String(int,QueryRequestDimension)","List<String>(int,List<String>,QueryRequestMetric)","Map<String,@>(Field)","Map<String,@>(Join)","@(String)","Map<String,@>(Index)","String(String,JoinCondition)","bool(String?)","QueryResponseRow(Map<String,@>)","Map<String,@>(QueryResponseColumn)","Map<String,@>(QueryResponseRow)","int(VisualizationField,VisualizationField)","Map<String,@>(VisualizationField)","JoinCondition(@)","bool(AGGREGATION_TYPE)","Map<String,@>(JoinCondition)","Map<String,@>(JoinLateralSort)","String(QueryRequestComparison)","String(TIME_FORMATTER)","String(FORMATTER_TYPE)","_DateFormatQuotedField(String,DateFormat)","~(String,@)","String(QueryRequest)","_DateFormatPatternField(String,DateFormat)","Map<String,String>(Map<String,String>,QueryRequestMetric)","List<QueryRequestDimension>(List<QueryRequestDimension>,QueryRequestDimension)","int(QueryRequestDimension,QueryRequestDimension)","JoinDatasourceConfig(JoinDatasourceConfig)","List<QueryRequestDimension>(List<QueryRequestDimension>,JoinDatasourceConfig)","_DateFormatLiteralField(String,DateFormat)","QueryRequest(JoinDatasourceConfig)","Map<String,@>(JoinDatasourceConfig)","JoinDatasourceConfig(Map<String,@>)","JoinDatasourceCondition(int,JoinDatasourceCondition)","QueryRequestDimension?(String)","JoinDatasourceCondition(Map<String,@>)","Map<String,@>?(QueryRequestDimension?)","Map<String,@>(Schema)","Map<String,@>(VisualizationSchema)","QueryRequest(@)","QueryResponse(int,QueryRequest)","Map<String,@>(QueryResponse)","List<QueryRequestMetric>(List<QueryRequestMetric>,QueryRequestMetric)","Map<String,@>(QueryRequest)","int(@,@)","~(Symbol0,@)","Join(SCHEMA_NAME)","String(int,String)"],interceptorsByTag:null,leafTags:null,arrayRti:Symbol("$ti")};t._Universe_addRules(C.typeUniverse,JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","BufferModule":"LegacyJavaScriptObject","BufferConstants":"LegacyJavaScriptObject","Buffer":"LegacyJavaScriptObject","ConsoleModule":"LegacyJavaScriptObject","Console":"LegacyJavaScriptObject","EventEmitter":"LegacyJavaScriptObject","Promise":"LegacyJavaScriptObject","Date":"LegacyJavaScriptObject","JsError":"LegacyJavaScriptObject","Atomics":"LegacyJavaScriptObject","Modules":"LegacyJavaScriptObject","Module":"LegacyJavaScriptObject","Net":"LegacyJavaScriptObject","Socket":"LegacyJavaScriptObject","NetAddress":"LegacyJavaScriptObject","NetServer":"LegacyJavaScriptObject","NodeJsError":"LegacyJavaScriptObject","JsAssertionError":"LegacyJavaScriptObject","JsRangeError":"LegacyJavaScriptObject","JsReferenceError":"LegacyJavaScriptObject","JsSyntaxError":"LegacyJavaScriptObject","JsTypeError":"LegacyJavaScriptObject","JsSystemError":"LegacyJavaScriptObject","Process":"LegacyJavaScriptObject","CPUUsage":"LegacyJavaScriptObject","Release":"LegacyJavaScriptObject","StreamModule":"LegacyJavaScriptObject","Readable":"LegacyJavaScriptObject","Writable":"LegacyJavaScriptObject","Duplex":"LegacyJavaScriptObject","Transform":"LegacyJavaScriptObject","WritableOptions":"LegacyJavaScriptObject","ReadableOptions":"LegacyJavaScriptObject","Immediate":"LegacyJavaScriptObject","Timeout":"LegacyJavaScriptObject","TTY":"LegacyJavaScriptObject","TTYReadStream":"LegacyJavaScriptObject","TTYWriteStream":"LegacyJavaScriptObject","Util":"LegacyJavaScriptObject","Exports":"LegacyJavaScriptObject","_Exports":"LegacyJavaScriptObject","JSBool":{"bool":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSIndexable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSIndexable":["1"]},"JSNumber":{"double":[]},"JSInt":{"double":[],"int":[]},"JSNumNotInt":{"double":[]},"JSString":{"String":[],"JSIndexable":["@"]},"_CastIterableBase":{"Iterable":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListMixin":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListMixin":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListMixin.E":"2"},"LateError":{"Error":[]},"CodeUnits":{"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"ListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"UnmodifiableListBase":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"Symbol":{"Symbol0":[]},"ConstantMapView":{"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_ConstantMapKeyIterable":{"Iterable":["1"],"Iterable.E":"1"},"NullError":{"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"RuntimeError":{"Error":[]},"JsLinkedHashMap":{"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"JSSyntaxRegExp":{"RegExp":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSIndexable":["1"]},"NativeTypedArrayOfInt":{"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"]},"NativeUint16List":{"NativeTypedArrayOfInt":[],"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"_Error":{"Error":[]},"_TypeError":{"Error":[]},"_SyncStarIterable":{"Iterable":["1"],"Iterable.E":"1"},"_LinkedIdentityHashMap":{"JsLinkedHashMap":["1","2"],"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"_LinkedCustomHashMap":{"JsLinkedHashMap":["1","2"],"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"_LinkedHashSet":{"SetMixin":["1"],"EfficientLengthIterable":["1"]},"IterableBase":{"Iterable":["1"]},"ListBase":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"MapBase":{"MapMixin":["1","2"],"Map":["1","2"]},"MapMixin":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"Map":["1","2"]},"_SetBase":{"SetMixin":["1"],"EfficientLengthIterable":["1"]},"_JsonMap":{"MapMixin":["String","@"],"Map":["String","@"],"MapMixin.V":"@","MapMixin.K":"String"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"Iterable.E":"String","ListIterable.E":"String"},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"List":{"EfficientLengthIterable":["1"]},"RegExpMatch":{"Match":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"NullThrownError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"CyclicInitializationError":{"Error":[]},"_GeneratorIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"_DateFormatLiteralField":{"_DateFormatField":[]},"_DateFormatQuotedField":{"_DateFormatField":[]},"_DateFormatPatternField":{"_DateFormatField":[]},"ArLyLocale":{"Locale":[]},"ArSaMaDzKwTnLocale":{"Locale":[]},"AzLocale":{"Locale":[]},"BnLocale":{"Locale":[]},"DeLocale":{"Locale":[]},"EnLocale":{"Locale":[]},"EsLocale":{"Locale":[]},"FaLocale":{"Locale":[]},"FrLocale":{"Locale":[]},"HiLocale":{"Locale":[]},"IdLocale":{"Locale":[]},"ItLocale":{"Locale":[]},"JaLocale":{"Locale":[]},"KoLocale":{"Locale":[]},"NbLocale":{"Locale":[]},"NlLocale":{"Locale":[]},"PlLocale":{"Locale":[]},"PtLocale":{"Locale":[]},"RuLocale":{"Locale":[]},"SvLocale":{"Locale":[]},"ThLocale":{"Locale":[]},"TrLocale":{"Locale":[]},"UkLocale":{"Locale":[]},"ZhCnLocale":{"Locale":[]},"ZhLocale":{"Locale":[]},"_NumericField":{"Field":[]},"_TimestampField":{"Field":[]},"_BoolField":{"Field":[]},"_StringField":{"Field":[]},"TZDateTime":{"DateTime":[]},"TypedDataBuffer":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"_IntBuffer":{"TypedDataBuffer":["int"],"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"]},"Uint8Buffer":{"TypedDataBuffer":["int"],"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"ListMixin.E":"int"}}')),t._Universe_addErasedTypes(C.typeUniverse,JSON.parse('{"ArrayIterator":1,"ListIterator":1,"MappedIterator":2,"WhereIterator":1,"SkipIterator":1,"EmptyIterator":1,"FixedLengthListMixin":1,"UnmodifiableListMixin":1,"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"LinkedHashMapKeyIterator":1,"NativeTypedArray":1,"_SyncStarIterator":1,"StreamTransformerBase":2,"_LinkedHashSetIterator":1,"IterableBase":1,"ListBase":1,"MapBase":2,"_UnmodifiableMapMixin":2,"MapView":2,"UnmodifiableMapView":2,"_SetBase":1,"_ListBase_Object_ListMixin":1,"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":2,"__SetBase_Object_SetMixin":1,"Codec":2,"Converter":2,"Iterator":1,"Sink":1,"UninitializedLocaleData":1,"ReportWidgetModel":1}'));var A={x28_grosT:"(@grossTotal-IFNULL(@takeawayPrice,0))*IF(@isRefund, -1, 1)",x28_gros_:"(@gross_total-COALESCE(@takeaway_price,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEb:"(COALESCE(@bill_adjustment_total,0)+COALESCE(@item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2bb:"(COALESCE(@gross_total,0)+COALESCE(@bill_adjustment_total,0)+COALESCE(@item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2bd:"(COALESCE(@gross_total,0)+COALESCE(@delivery_fee_with_tax,0)+COALESCE(@other_charge_with_tax,0)+COALESCE(@discount_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2d:"(COALESCE(@gross_total,0)-COALESCE(@takeaway_price,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEn_:"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-(case when @other_charge_with_tax>0 then 0 else COALESCE(@third_party_extra_charge,0) end)-(case when @delivery_fee_with_tax>0 then 0 else COALESCE(@delivery_fee,0) end)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEnC:"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-COALESCE(@discount_total,0)-COALESCE(@third_party_extra_charge,0)-COALESCE(@delivery_fee,0)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEo:"(COALESCE(@other_charge_total,0)+COALESCE(@third_party_extra_charge,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28IFNULb:"(IFNULL(@billAdjustmentTotal,0)+IFNULL(@itemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2bb:"(IFNULL(@grossTotal,0)+IFNULL(@billAdjustmentTotal,0)+IFNULL(@itemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2bd:"(IFNULL(@grossTotal,0)+IFNULL(@deliveryFeeWithTax,0)+IFNULL(@otherChargeWithTax,0)+IFNULL(@discountTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2d:"(IFNULL(@grossTotal,0)-IFNULL(@takeawayPrice,0))*IF(@isRefund, -1, 1)",x28IFNULn_:"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-(case when @otherChargeWithTax>0 then 0 else IFNULL(@thirdPartyExtraCharge,0) end)-(case when @deliveryFeeWithTax>0 then 0 else IFNULL(@deliveryFee,0) end)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",x28IFNULnI:"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-IFNULL(@discountTotal,0)-IFNULL(@thirdPartyExtraCharge,0)-IFNULL(@deliveryFee,0)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",x28IFNULo:"(IFNULL(@otherChargeTotal,0)+IFNULL(@thirdPartyExtraCharge,0))*IF(@isRefund, -1, 1)",x28case_:"(case when (@source='' or @source='POS') then 'FEEDME' else @source end)",x28selecS:`(select SUM(ROUND(
|
|
87
87
|
(case when EXTRACT(EPOCH FROM COALESCE(timesheets.ended_at,!end)-(timesheets.created_at))<86400
|
|
88
88
|
then EXTRACT(EPOCH FROM COALESCE(timesheets.ended_at,!end)-(timesheets.created_at)) else 86400 end)/3600,2)) from timesheets where restaurant_id=@restaurant_id and timesheets.created_at < !end and coalesce(timesheets.ended_at,!end) > !start and DATE_TRUNC('day',@created_at AT TIME ZONE 'Asia/Kuala_Lumpur') between DATE_TRUNC('day',timesheets.created_at AT TIME ZONE 'Asia/Kuala_Lumpur') and DATE_TRUNC('day',COALESCE(timesheets.ended_at,!end) AT TIME ZONE 'Asia/Kuala_Lumpur')+INTERVAL '1 day'-INTERVAL '1 second')`,x28selecc:"(select code from locations where locations.id=@supplier_id)",x28selecn:"(select name from restaurants where restaurants.id=@restaurant_id)",x28selecstC:"(select string_agg(CONCAT(flatten_items.quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN flatten_items.code='' THEN NULL ELSE flatten_items.code END, flatten_items.name], ' ')), ',') from flatten_items where flatten_items.bill_id=@id and flatten_items.restaurant_id=@restaurant_id and flatten_items.layer=0)",x28selecstdC:"(select string_agg(distinct CONCAT(name, CASE WHEN card_type is not null THEN CONCAT(' (',card_type, ')') WHEN payment_gateway_issuer is not null THEN CONCAT(' (',payment_gateway_issuer, ')') ELSE '' END), ',') from payments where payments.bill_id=@id and payments.restaurant_id=@restaurant_id)",x28selecstda:"(select string_agg(distinct adjustments.reason, ',') from adjustments where adjustments.bill_id=@id and adjustments.restaurant_id=@restaurant_id)",x28selecstdn:"(select string_agg(distinct name, ',') from payments where payments.bill_id=@id and payments.restaurant_id=@restaurant_id)",x28selecsum:"(select sum(nett_total) from bills left join restaurants on restaurants.id=bills.restaurant_id where restaurants.business_id=@business_id and bills.member_id=@id)",x28selecsup:"(select supplier_id from purchase_orders where id=@purchase_order_id limit 1)",x40addon:"@addon_price*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40billA:"@billAdjustmentTotal*IF(@isRefund, -1, 1)",x40bill_:"@bill_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40gross:"@gross_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40itemA:"@itemAdjustmentTotal*IF(@isRefund, -1, 1)",x40item_:"@item_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40nett_:"@nett_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40other:"@other_charge_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40quant:"@quantity*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40servi:"@service_charge_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40sst_t:"@sst_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40takea:"@takeaway_price*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40unit_:"@unit_quantity*CASE WHEN @is_refund THEN -1 ELSE 1 END",x40vat_t:"@vat_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",CASE_Wax3c:"CASE WHEN @amount<0 THEN @amount ELSE 0 END",CASE_Wax3e:"CASE WHEN @amount>=0 THEN @amount ELSE 0 END",CASE_Wc:`CASE WHEN @category_name IS NULL OR @product_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN ' ' ELSE @category_name END
|
|
89
89
|
`,COALESdex2c:"COALESCE(@delivery_fee,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESdex5f_:"COALESCE(@delivery_fee_with_tax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESdex5fo:"COALESCE(@delivery_fee_without_tax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESdii:"COALESCE(@discount_inclusive_tax_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESdit:"COALESCE(@discount_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESg:"COALESCE(@gross_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESi:"COALESCE(@item_count,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESn:"COALESCE(@nett_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESo_:"COALESCE(@other_charge_with_tax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESoo:"COALESCE(@other_charge_without_tax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESp:"COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESr:"COALESCE(@rounding,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESse:"COALESCE(@service_charge_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESss:"COALESCE(@sst_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALEStak:"COALESCE(@takeaway_price,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALEStax:"COALESCE(@tax_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",COALESth:"COALESCE(@third_party_extra_charge,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",CONCAT_:"CONCAT(@name, CASE WHEN @card_type is not null THEN CONCAT(' (',@card_type, ')') WHEN @payment_gateway_issuer is not null THEN CONCAT(' (',@payment_gateway_issuer, ')') ELSE '' END)",CONCATC:"CONCAT(@name,COALESCE(CONCAT(' (', @cardType, ')'),CONCAT(' (', @paymentGatewayIssuer, ')'),''))",COUNT_:"COUNT(@id) OVER (PARTITION BY @restaurant_id,@member_user_id)",EXTRAC:"EXTRACT(EPOCH FROM (@completed_at-@created_at))",FORMAT:'FORMAT_TIMESTAMP("%E4Y-%m-%dT%H:%M:%E3SZ", ',IF__ca:`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), ' ', @categoryName)
|
|
90
|
-
`,IFNULLde_:"IFNULL(@deliveryFee,0)*IF(@isRefund, -1, 1)",IFNULLdeWT:"IFNULL(@deliveryFeeWithTax,0)*IF(@isRefund, -1, 1)",IFNULLdeWo:"IFNULL(@deliveryFeeWithoutTax,0)*IF(@isRefund, -1, 1)",IFNULLdiI:"IFNULL(@discountInclusiveTaxTotal,0)*IF(@isRefund, -1, 1)",IFNULLdiT:"IFNULL(@discountTotal,0)*IF(@isRefund, -1, 1)",IFNULLg:"IFNULL(@grossTotal,0)*IF(@isRefund, -1, 1)",IFNULLi:"IFNULL(@itemCount,0)*IF(@isRefund, -1, 1)",IFNULLn:"IFNULL(@nettTotal,0)*IF(@isRefund, -1, 1)",IFNULLoT:"IFNULL(@otherChargeWithTax,0)*IF(@isRefund, -1, 1)",IFNULLoo:"IFNULL(@otherChargeWithoutTax,0)*IF(@isRefund, -1, 1)",IFNULLs:"IFNULL(@serviceChargeTotal,0)*IF(@isRefund, -1, 1)",IFNULLta:"IFNULL(@takeawayPrice,0)*IF(@isRefund, -1, 1)",IFNULLth:"IFNULL(@thirdPartyExtraCharge,0)*IF(@isRefund, -1, 1)",MIN_EX:"MIN(EXTRACT(DAY FROM (!end-@created_at))) OVER (PARTITION BY @restaurant_id,@member_user_id)",SUM__n:"SUM(@nett_total) OVER (PARTITION BY @restaurant_id,@member_user_id)",case_wI:"case when @counterId='' or @counterId='system' or @counterId is null then 'counter_default_main' else @counterId end",case_wN:"case when @counterName='' or @counterName='System' or @counterName is null then 'Main' else @counterName end",case_w_i:"case when @counter_id='' or @counter_id='system' or @counter_id is null then 'counter_default_main' else @counter_id end",case_w_n:"case when @counter_name='' or @counter_name='System' or @counter_name is null then 'Main' else @counter_name end",idx_pof:"idx_podfss_purchase_order_delivery_fulfillment_id",idx_poo:"idx_podoss_purchase_order_delivery_order_id",netSui:"netSuite.additionalInfo.transactionnumber"},$=function(){var e=t.findType;return{ConstantMapView_Symbol_dynamic:e("ConstantMapView<Symbol0,@>"),DateTime:e("DateTime"),EfficientLengthIterable_dynamic:e("EfficientLengthIterable<@>"),Error:e("Error"),Function:e("Function"),JSArray_AGGREGATION_TYPE:e("JSArray<AGGREGATION_TYPE>"),JSArray_COMPARISON_OPERATOR:e("JSArray<COMPARISON_OPERATOR>"),JSArray_DATA_TYPE:e("JSArray<DATA_TYPE>"),JSArray_DIMENSION_OPTION:e("JSArray<DIMENSION_OPTION>"),JSArray_FORMATTER_TYPE:e("JSArray<FORMATTER_TYPE>"),JSArray_Field:e("JSArray<Field>"),JSArray_Index:e("JSArray<Index>"),JSArray_Join:e("JSArray<Join>"),JSArray_JoinCondition:e("JSArray<JoinCondition>"),JSArray_JoinDatasourceCondition:e("JSArray<JoinDatasourceCondition>"),JSArray_JoinLateralSort:e("JSArray<JoinLateralSort>"),JSArray_Permission:e("JSArray<Permission>"),JSArray_QueryRequest:e("JSArray<QueryRequest>"),JSArray_QueryRequestComparison:e("JSArray<QueryRequestComparison>"),JSArray_QueryRequestDimension:e("JSArray<QueryRequestDimension>"),JSArray_QueryRequestFilter:e("JSArray<QueryRequestFilter>"),JSArray_QueryRequestMetric:e("JSArray<QueryRequestMetric>"),JSArray_QueryRequestSort:e("JSArray<QueryRequestSort>"),JSArray_QueryResponseRow:e("JSArray<QueryResponseRow>"),JSArray_String:e("JSArray<String>"),JSArray_TIME_FORMATTER:e("JSArray<TIME_FORMATTER>"),JSArray_TimeZone:e("JSArray<TimeZone>"),JSArray__DateFormatField:e("JSArray<_DateFormatField>"),JSArray__PlainSqlColumn:e("JSArray<_PlainSqlColumn>"),JSArray_dynamic:e("JSArray<@>"),JSArray_int:e("JSArray<int>"),JSArray_of__DateFormatField_Function_String_DateFormat:e("JSArray<_DateFormatField(String,DateFormat)>"),JSIndexable_dynamic:e("JSIndexable<@>"),JSNull:e("JSNull"),JavaScriptFunction:e("JavaScriptFunction"),JavaScriptIndexingBehavior_dynamic:e("JavaScriptIndexingBehavior<@>"),JoinDatasourceCondition:e("JoinDatasourceCondition"),JsLinkedHashMap_Symbol_dynamic:e("JsLinkedHashMap<Symbol0,@>"),List_dynamic:e("List<@>"),Location:e("Location"),Map_String_dynamic:e("Map<String,@>"),Map_dynamic_dynamic:e("Map<@,@>"),MappedListIterable_String_String:e("MappedListIterable<String,String>"),NativeTypedArrayOfInt:e("NativeTypedArrayOfInt"),NativeUint8List:e("NativeUint8List"),Null:e("Null"),Object:e("Object"),QueryRequest:e("QueryRequest"),QueryRequestDimension:e("QueryRequestDimension"),QueryRequestFilter:e("QueryRequestFilter"),QueryRequestMetric:e("QueryRequestMetric"),QueryRequestSort:e("QueryRequestSort"),QueryResponse:e("QueryResponse"),QueryResponseColumn:e("QueryResponseColumn"),QueryResponseRow:e("QueryResponseRow"),Record:e("Record"),RegExpMatch:e("RegExpMatch"),SCHEMA_NAME:e("SCHEMA_NAME"),String:e("String"),UnknownJavaScriptObject:e("UnknownJavaScriptObject"),_PlainSqlColumn:e("_PlainSqlColumn"),bool:e("bool"),double:e("double"),dynamic:e("@"),int:e("int"),legacy_Never:e("0&*"),legacy_Object:e("Object*"),nullable_Future_Null:e("Future<Null>?"),nullable_List_dynamic:e("List<@>?"),nullable_Object:e("Object?"),nullable_QueryRequestDimension:e("QueryRequestDimension?"),num:e("num")}}();(function(){var e=X.makeConstList;_.Interceptor_methods=u.Interceptor.prototype,_.JSArray_methods=u.JSArray.prototype,_.JSInt_methods=u.JSInt.prototype,_.JSNumber_methods=u.JSNumber.prototype,_.JSString_methods=u.JSString.prototype,_.JavaScriptFunction_methods=u.JavaScriptFunction.prototype,_.JavaScriptObject_methods=u.JavaScriptObject.prototype,_.NativeUint8List_methods=t.NativeUint8List.prototype,_.PlainJavaScriptObject_methods=u.PlainJavaScriptObject.prototype,_.UnknownJavaScriptObject_methods=u.UnknownJavaScriptObject.prototype,_.AGGREGATION_TYPE_0=new t.AGGREGATION_TYPE(0,"SUM"),_.AGGREGATION_TYPE_1=new t.AGGREGATION_TYPE(1,"AVERAGE"),_.AGGREGATION_TYPE_10=new t.AGGREGATION_TYPE(10,"CUMULATIVE_SUM"),_.AGGREGATION_TYPE_11=new t.AGGREGATION_TYPE(11,"CUMULATIVE_AVERAGE"),_.AGGREGATION_TYPE_12=new t.AGGREGATION_TYPE(12,"CUMULATIVE_COUNT"),_.AGGREGATION_TYPE_2=new t.AGGREGATION_TYPE(2,"COUNT"),_.AGGREGATION_TYPE_3=new t.AGGREGATION_TYPE(3,"COUNT_DISTINCT"),_.AGGREGATION_TYPE_4=new t.AGGREGATION_TYPE(4,"FIRST"),_.AGGREGATION_TYPE_5=new t.AGGREGATION_TYPE(5,"LAST"),_.AGGREGATION_TYPE_6=new t.AGGREGATION_TYPE(6,"ANY"),_.AGGREGATION_TYPE_7=new t.AGGREGATION_TYPE(7,"MERGE"),_.AGGREGATION_TYPE_8=new t.AGGREGATION_TYPE(8,"MIN"),_.AGGREGATION_TYPE_9=new t.AGGREGATION_TYPE(9,"MAX"),_.AsciiDecoder_false=new t.AsciiDecoder(!1),_.COMPARISON_OPERATOR_0=new t.COMPARISON_OPERATOR(0,"EQUAL"),_.COMPARISON_OPERATOR_1=new t.COMPARISON_OPERATOR(1,"NOT_EQUAL"),_.COMPARISON_OPERATOR_10=new t.COMPARISON_OPERATOR(10,"OR"),_.COMPARISON_OPERATOR_2=new t.COMPARISON_OPERATOR(2,"GREATER_THAN"),_.COMPARISON_OPERATOR_3=new t.COMPARISON_OPERATOR(3,"LESS_THAN"),_.COMPARISON_OPERATOR_4=new t.COMPARISON_OPERATOR(4,"GREATER_THAN_OR_EQUAL"),_.COMPARISON_OPERATOR_5=new t.COMPARISON_OPERATOR(5,"LESS_THAN_OR_EQUAL"),_.COMPARISON_OPERATOR_6=new t.COMPARISON_OPERATOR(6,"BETWEEN"),_.COMPARISON_OPERATOR_7=new t.COMPARISON_OPERATOR(7,"LIKE"),_.COMPARISON_OPERATOR_8=new t.COMPARISON_OPERATOR(8,"NOT_LIKE"),_.C_AsciiCodec=new t.AsciiCodec,_.C_EmptyIterator=new t.EmptyIterator,_.C_Endian=new t.Endian,_.C_Endian0=new t.Endian,_.C_JS_CONST=function(n){var a=Object.prototype.toString.call(n);return a.substring(8,a.length-1)},_.C_JS_CONST0=function(){var i=Object.prototype.toString;function n(d){var c=i.call(d);return c.substring(8,c.length-1)}function a(d,c){if(/^HTML[A-Z].*Element$/.test(c)){var p=i.call(d);return p=="[object Object]"?null:"HTMLElement"}}function s(d,c){return w.HTMLElement&&d instanceof HTMLElement?"HTMLElement":a(d,c)}function o(d){if(typeof window>"u"||typeof window[d]>"u")return null;var c=window[d];return typeof c!="function"?null:c.prototype}function l(d){return null}var D=typeof navigator=="object";return{getTag:n,getUnknownTag:D?s:a,prototypeForTag:o,discriminator:l}},_.C_JS_CONST6=function(i){return function(n){if(typeof navigator!="object")return n;var a=navigator.userAgent;if(a.indexOf("DumpRenderTree")>=0)return n;if(a.indexOf("Chrome")>=0){let s=function(o){return typeof window=="object"&&window[o]&&window[o].name==o};if(s("Window")&&s("HTMLElement"))return n}n.getTag=i}},_.C_JS_CONST1=function(i){if(typeof dartExperimentalFixupGetTag!="function")return i;i.getTag=dartExperimentalFixupGetTag(i.getTag)},_.C_JS_CONST2=function(i){var n=i.getTag,a=i.prototypeForTag;function s(l){var D=n(l);return D=="Document"?l.xmlVersion?"!Document":"!HTMLDocument":D}function o(l){return l=="Document"?null:a(l)}i.getTag=s,i.prototypeForTag=o},_.C_JS_CONST5=function(i){var n=typeof navigator=="object"?navigator.userAgent:"";if(n.indexOf("Firefox")==-1)return i;var a=i.getTag,s={BeforeUnloadEvent:"Event",DataTransfer:"Clipboard",GeoGeolocation:"Geolocation",Location:"!Location",WorkerMessageEvent:"MessageEvent",XMLDocument:"!Document"};function o(l){var D=a(l);return s[D]||D}i.getTag=o},_.C_JS_CONST4=function(i){var n=typeof navigator=="object"?navigator.userAgent:"";if(n.indexOf("Trident/")==-1)return i;var a=i.getTag,s={BeforeUnloadEvent:"Event",DataTransfer:"Clipboard",HTMLDDElement:"HTMLElement",HTMLDTElement:"HTMLElement",HTMLPhraseElement:"HTMLElement",Position:"Geoposition"};function o(D){var d=a(D),c=s[d];return c||(d=="Object"&&window.DataView&&D instanceof window.DataView?"DataView":d)}function l(D){var d=window[D];return d==null?null:d.prototype}i.getTag=o,i.prototypeForTag=l},_.C_JS_CONST3=function(i){return i},_.C_JsonCodec=new t.JsonCodec,_.C_OutOfMemoryError=new t.OutOfMemoryError,_.C_Utf8Codec=new t.Utf8Codec,_.C_Utf8Encoder=new t.Utf8Encoder,_.C__Required=new t._Required,_.DATA_TYPE_0=new t.DATA_TYPE(0,"STRING"),_.DATA_TYPE_1=new t.DATA_TYPE(1,"TIMESTAMP"),_.DATA_TYPE_2=new t.DATA_TYPE(2,"BOOL"),_.DATA_TYPE_3=new t.DATA_TYPE(3,"NUMERIC"),_.DIMENSION_OPTION_0=new t.DIMENSION_OPTION(0,"DATE_TIME"),_.DIMENSION_OPTION_1=new t.DIMENSION_OPTION(1,"HOUR"),_.DIMENSION_OPTION_10=new t.DIMENSION_OPTION(10,"YEAR"),_.DIMENSION_OPTION_11=new t.DIMENSION_OPTION(11,"YEAR_MONTH_DAY"),_.DIMENSION_OPTION_2=new t.DIMENSION_OPTION(2,"DAY"),_.DIMENSION_OPTION_3=new t.DIMENSION_OPTION(3,"WEEK"),_.DIMENSION_OPTION_4=new t.DIMENSION_OPTION(4,"MONTH"),_.DIMENSION_OPTION_5=new t.DIMENSION_OPTION(5,"TIME_OF_DAY"),_.DIMENSION_OPTION_6=new t.DIMENSION_OPTION(6,"HOUR_OF_DAY"),_.DIMENSION_OPTION_7=new t.DIMENSION_OPTION(7,"DAY_OF_WEEK"),_.DIMENSION_OPTION_8=new t.DIMENSION_OPTION(8,"DAY_OF_MONTH"),_.DIMENSION_OPTION_9=new t.DIMENSION_OPTION(9,"MONTH_OF_YEAR"),_.Duration_0=new t.Duration(0),_.Duration_1000=new t.Duration(1e3),_.FIELD_TYPE_0=new t.FIELD_TYPE(0,"DIMENSION"),_.FIELD_TYPE_1=new t.FIELD_TYPE(1,"METRIC"),_.JsonDecoder_null=new t.JsonDecoder(null),_.JsonEncoder_null=new t.JsonEncoder(null),_.List_3US=t._setArrayType(e(["S","M","T","W","T","F","S"]),$.JSArray_String),_.List_6xs=t._setArrayType(e(["Before Christ","Anno Domini"]),$.JSArray_String),_.INDEX_METHOD_0=new t.INDEX_METHOD(0,"BTREE"),_.INDEX_METHOD_1=new t.INDEX_METHOD(1,"HASH"),_.INDEX_METHOD_2=new t.INDEX_METHOD(2,"GIST"),_.INDEX_METHOD_3=new t.INDEX_METHOD(3,"SPGIST"),_.INDEX_METHOD_4=new t.INDEX_METHOD(4,"BRIN"),_.INDEX_METHOD_5=new t.INDEX_METHOD(5,"GIN"),_.List_88s=t._setArrayType(e([_.INDEX_METHOD_0,_.INDEX_METHOD_1,_.INDEX_METHOD_2,_.INDEX_METHOD_3,_.INDEX_METHOD_4,_.INDEX_METHOD_5]),t.findType("JSArray<INDEX_METHOD>")),_.List_AM_PM=t._setArrayType(e(["AM","PM"]),$.JSArray_String),_.List_BC_AD=t._setArrayType(e(["BC","AD"]),$.JSArray_String),_.FORMATTER_TYPE_0=new t.FORMATTER_TYPE(0,"HOUR"),_.FORMATTER_TYPE_1=new t.FORMATTER_TYPE(1,"MINUTE"),_.FORMATTER_TYPE_2=new t.FORMATTER_TYPE(2,"SECOND"),_.FORMATTER_TYPE_3=new t.FORMATTER_TYPE(3,"HOUR_NO_DAY"),_.FORMATTER_TYPE_4=new t.FORMATTER_TYPE(4,"MINUTE_NO_DAY"),_.FORMATTER_TYPE_5=new t.FORMATTER_TYPE(5,"SECOND_NO_DAY"),_.FORMATTER_TYPE_6=new t.FORMATTER_TYPE(6,"PERCENT"),_.List_Jwp=t._setArrayType(e([_.FORMATTER_TYPE_0,_.FORMATTER_TYPE_1,_.FORMATTER_TYPE_2,_.FORMATTER_TYPE_3,_.FORMATTER_TYPE_4,_.FORMATTER_TYPE_5,_.FORMATTER_TYPE_6]),$.JSArray_FORMATTER_TYPE),_.COMPARISON_OPERATOR_9=new t.COMPARISON_OPERATOR(9,"AND"),_.List_LO4=t._setArrayType(e([_.COMPARISON_OPERATOR_0,_.COMPARISON_OPERATOR_1,_.COMPARISON_OPERATOR_2,_.COMPARISON_OPERATOR_3,_.COMPARISON_OPERATOR_4,_.COMPARISON_OPERATOR_5,_.COMPARISON_OPERATOR_6,_.COMPARISON_OPERATOR_7,_.COMPARISON_OPERATOR_8,_.COMPARISON_OPERATOR_9,_.COMPARISON_OPERATOR_10]),$.JSArray_COMPARISON_OPERATOR),_.PERIOD_TYPE_0=new t.PERIOD_TYPE(0,"MTD"),_.List_PERIOD_TYPE_0=t._setArrayType(e([_.PERIOD_TYPE_0]),t.findType("JSArray<PERIOD_TYPE>")),_.SORT_TYPE_0=new t.SORT_TYPE(0,"ASC"),_.SORT_TYPE_1=new t.SORT_TYPE(1,"DESC"),_.List_SORT_TYPE_0_SORT_TYPE_1=t._setArrayType(e([_.SORT_TYPE_0,_.SORT_TYPE_1]),t.findType("JSArray<SORT_TYPE>")),_.SOURCE_TYPE_0=new t.SOURCE_TYPE(0,"MONGODB"),_.SOURCE_TYPE_1=new t.SOURCE_TYPE(1,"COUCHDB"),_.List_SOURCE_TYPE_0_SOURCE_TYPE_1=t._setArrayType(e([_.SOURCE_TYPE_0,_.SOURCE_TYPE_1]),t.findType("JSArray<SOURCE_TYPE>")),_.SCHEMA_NAME_0=new t.SCHEMA_NAME(0,"BILL"),_.SCHEMA_NAME_1=new t.SCHEMA_NAME(1,"COMPLETE_TIME_BILL"),_.SCHEMA_NAME_2=new t.SCHEMA_NAME(2,"BUSINESS"),_.SCHEMA_NAME_3=new t.SCHEMA_NAME(3,"COUNTER"),_.SCHEMA_NAME_4=new t.SCHEMA_NAME(4,"DRAWER"),_.SCHEMA_NAME_5=new t.SCHEMA_NAME(5,"FLATTEN_ITEM"),_.SCHEMA_NAME_6=new t.SCHEMA_NAME(6,"PARENT_FLATTEN_ITEM"),_.SCHEMA_NAME_7=new t.SCHEMA_NAME(7,"ADDON_FLATTEN_ITEM"),_.SCHEMA_NAME_8=new t.SCHEMA_NAME(8,"ITEM"),_.SCHEMA_NAME_9=new t.SCHEMA_NAME(9,"SUB_ITEM"),_.SCHEMA_NAME_10=new t.SCHEMA_NAME(10,"PAYMENT"),_.SCHEMA_NAME_11=new t.SCHEMA_NAME(11,"PAYMENT_TIME_PAYMENT"),_.SCHEMA_NAME_12=new t.SCHEMA_NAME(12,"CHARGE"),_.SCHEMA_NAME_13=new t.SCHEMA_NAME(13,"RECORD"),_.SCHEMA_NAME_14=new t.SCHEMA_NAME(14,"RESTAURANT"),_.SCHEMA_NAME_15=new t.SCHEMA_NAME(15,"RESTAURANT_FEATURE"),_.SCHEMA_NAME_16=new t.SCHEMA_NAME(16,"SLOT"),_.SCHEMA_NAME_17=new t.SCHEMA_NAME(17,"STAFF"),_.SCHEMA_NAME_18=new t.SCHEMA_NAME(18,"TIMESHEET"),_.SCHEMA_NAME_19=new t.SCHEMA_NAME(19,"TIMESHEET_RECORD"),_.SCHEMA_NAME_20=new t.SCHEMA_NAME(20,"ADJUSTMENT"),_.SCHEMA_NAME_21=new t.SCHEMA_NAME(21,"INVENTORY_ADJUSTMENT"),_.SCHEMA_NAME_22=new t.SCHEMA_NAME(22,"INVENTORY_ADJUSTMENT_SKU"),_.SCHEMA_NAME_23=new t.SCHEMA_NAME(23,"INVENTORY_ADJUSTMENT_PHYSICAL_SKU"),_.SCHEMA_NAME_24=new t.SCHEMA_NAME(24,"CLOSING_SKU"),_.SCHEMA_NAME_25=new t.SCHEMA_NAME(25,"CLOSING_DRAFT"),_.SCHEMA_NAME_26=new t.SCHEMA_NAME(26,"CLOSING_DRAFT_SKU"),_.SCHEMA_NAME_27=new t.SCHEMA_NAME(27,"PURCHASE_ORDER"),_.SCHEMA_NAME_28=new t.SCHEMA_NAME(28,"PURCHASE_ORDER_ITEM"),_.SCHEMA_NAME_29=new t.SCHEMA_NAME(29,"PURCHASE_ORDER_DELIVERY_ORDER"),_.SCHEMA_NAME_30=new t.SCHEMA_NAME(30,"PURCHASE_ORDER_DELIVERY_FULFILLMENT"),_.SCHEMA_NAME_31=new t.SCHEMA_NAME(31,"PURCHASE_ORDER_DELIVERY_ORDER_SKU"),_.SCHEMA_NAME_32=new t.SCHEMA_NAME(32,"PURCHASE_ORDER_DELIVERY_FULFILLMENT_SKU"),_.SCHEMA_NAME_33=new t.SCHEMA_NAME(33,"INTERNAL_PURCHASE_ORDER"),_.SCHEMA_NAME_34=new t.SCHEMA_NAME(34,"INTERNAL_PURCHASE_ORDER_ITEM"),_.SCHEMA_NAME_35=new t.SCHEMA_NAME(35,"INTERNAL_PURCHASE_ORDER_DELIVERY_ORDER"),_.SCHEMA_NAME_36=new t.SCHEMA_NAME(36,"INTERNAL_PURCHASE_ORDER_DELIVERY_FULFILLMENT"),_.SCHEMA_NAME_37=new t.SCHEMA_NAME(37,"INTERNAL_PURCHASE_ORDER_DELIVERY_ORDER_SKU"),_.SCHEMA_NAME_38=new t.SCHEMA_NAME(38,"INTERNAL_PURCHASE_ORDER_DELIVERY_FULFILLMENT_SKU"),_.SCHEMA_NAME_39=new t.SCHEMA_NAME(39,"VOUCHER_CLAIM"),_.SCHEMA_NAME_40=new t.SCHEMA_NAME(40,"VOUCHER_CLAIM_REDEMPTION"),_.SCHEMA_NAME_41=new t.SCHEMA_NAME(41,"USER"),_.SCHEMA_NAME_42=new t.SCHEMA_NAME(42,"MEMBER"),_.SCHEMA_NAME_43=new t.SCHEMA_NAME(43,"MEMBER_V2"),_.SCHEMA_NAME_44=new t.SCHEMA_NAME(44,"INVENTORY_WAREHOUSE_LOCATION"),_.SCHEMA_NAME_45=new t.SCHEMA_NAME(45,"INVENTORY_RESTAURANT_LOCATION"),_.SCHEMA_NAME_46=new t.SCHEMA_NAME(46,"MEMBER_STORE_PURCHASE"),_.SCHEMA_NAME_47=new t.SCHEMA_NAME(47,"MEMBER_STORE_PURCHASE_PAYMENT"),_.SCHEMA_NAME_48=new t.SCHEMA_NAME(48,"MEMBER_TITLE"),_.SCHEMA_NAME_49=new t.SCHEMA_NAME(49,"MEMBERSHIP"),_.SCHEMA_NAME_50=new t.SCHEMA_NAME(50,"MEMBERSHIP_TITLE"),_.SCHEMA_NAME_51=new t.SCHEMA_NAME(51,"CREDIT_TRANSACTION"),_.SCHEMA_NAME_52=new t.SCHEMA_NAME(52,"MENU_V3_GROUP"),_.SCHEMA_NAME_53=new t.SCHEMA_NAME(53,"MENU_V4_GROUP"),_.SCHEMA_NAME_54=new t.SCHEMA_NAME(54,"MENU_V3_SKU"),_.SCHEMA_NAME_55=new t.SCHEMA_NAME(55,"MENU_V4_SKU"),_.SCHEMA_NAME_56=new t.SCHEMA_NAME(56,"MENU_V3_ITEM"),_.SCHEMA_NAME_57=new t.SCHEMA_NAME(57,"MENU_V4_ITEM"),_.SCHEMA_NAME_58=new t.SCHEMA_NAME(58,"MENU_V4_CATALOG_ITEM"),_.SCHEMA_NAME_59=new t.SCHEMA_NAME(59,"STOCK"),_.SCHEMA_NAME_60=new t.SCHEMA_NAME(60,"REVIEW"),_.SCHEMA_NAME_61=new t.SCHEMA_NAME(61,"CAMPAIGN"),_.SCHEMA_NAME_62=new t.SCHEMA_NAME(62,"COLLECTIBLE_CONFIG"),_.SCHEMA_NAME_63=new t.SCHEMA_NAME(63,"COLLECTIBLE_TRANSACTION"),_.SCHEMA_NAME_64=new t.SCHEMA_NAME(64,"CAMPAIGN_TIER"),_.SCHEMA_NAME_65=new t.SCHEMA_NAME(65,"STORE_TRANSACTION"),_.SCHEMA_NAME_66=new t.SCHEMA_NAME(66,"STORE_BUNDLE"),_.SCHEMA_NAME_67=new t.SCHEMA_NAME(67,"COLLECTIBLE_COLLECTION"),_.SCHEMA_NAME_68=new t.SCHEMA_NAME(68,"KITCHEN_STATION"),_.SCHEMA_NAME_69=new t.SCHEMA_NAME(69,"REFUND_BILL"),_.SCHEMA_NAME_70=new t.SCHEMA_NAME(70,"MENU_V4_ITEM_INVENTORY_BINDING"),_.SCHEMA_NAME_71=new t.SCHEMA_NAME(71,"INVENTORY_V1_FLATTEN_INVENTORY"),_.SCHEMA_NAME_72=new t.SCHEMA_NAME(72,"ITEM_MOVEMENT"),_.SCHEMA_NAME_73=new t.SCHEMA_NAME(73,"UNIT_COST_HISTORY"),_.SCHEMA_NAME_74=new t.SCHEMA_NAME(74,"DS_BILL_ITEM"),_.SCHEMA_NAME_75=new t.SCHEMA_NAME(75,"DS_MENU_PRODUCT"),_.SCHEMA_NAME_76=new t.SCHEMA_NAME(76,"DS_MENU_PRODUCT_2"),_.SCHEMA_NAME_77=new t.SCHEMA_NAME(77,"DS_BILL_ITEM_PRODUCT"),_.SCHEMA_NAME_78=new t.SCHEMA_NAME(78,"RECOMMENDATION_CALL"),_.List_W7J=t._setArrayType(e([_.SCHEMA_NAME_0,_.SCHEMA_NAME_1,_.SCHEMA_NAME_2,_.SCHEMA_NAME_3,_.SCHEMA_NAME_4,_.SCHEMA_NAME_5,_.SCHEMA_NAME_6,_.SCHEMA_NAME_7,_.SCHEMA_NAME_8,_.SCHEMA_NAME_9,_.SCHEMA_NAME_10,_.SCHEMA_NAME_11,_.SCHEMA_NAME_12,_.SCHEMA_NAME_13,_.SCHEMA_NAME_14,_.SCHEMA_NAME_15,_.SCHEMA_NAME_16,_.SCHEMA_NAME_17,_.SCHEMA_NAME_18,_.SCHEMA_NAME_19,_.SCHEMA_NAME_20,_.SCHEMA_NAME_21,_.SCHEMA_NAME_22,_.SCHEMA_NAME_23,_.SCHEMA_NAME_24,_.SCHEMA_NAME_25,_.SCHEMA_NAME_26,_.SCHEMA_NAME_27,_.SCHEMA_NAME_28,_.SCHEMA_NAME_29,_.SCHEMA_NAME_30,_.SCHEMA_NAME_31,_.SCHEMA_NAME_32,_.SCHEMA_NAME_33,_.SCHEMA_NAME_34,_.SCHEMA_NAME_35,_.SCHEMA_NAME_36,_.SCHEMA_NAME_37,_.SCHEMA_NAME_38,_.SCHEMA_NAME_39,_.SCHEMA_NAME_40,_.SCHEMA_NAME_41,_.SCHEMA_NAME_42,_.SCHEMA_NAME_43,_.SCHEMA_NAME_44,_.SCHEMA_NAME_45,_.SCHEMA_NAME_46,_.SCHEMA_NAME_47,_.SCHEMA_NAME_48,_.SCHEMA_NAME_49,_.SCHEMA_NAME_50,_.SCHEMA_NAME_51,_.SCHEMA_NAME_52,_.SCHEMA_NAME_53,_.SCHEMA_NAME_54,_.SCHEMA_NAME_55,_.SCHEMA_NAME_56,_.SCHEMA_NAME_57,_.SCHEMA_NAME_58,_.SCHEMA_NAME_59,_.SCHEMA_NAME_60,_.SCHEMA_NAME_61,_.SCHEMA_NAME_62,_.SCHEMA_NAME_63,_.SCHEMA_NAME_64,_.SCHEMA_NAME_65,_.SCHEMA_NAME_66,_.SCHEMA_NAME_67,_.SCHEMA_NAME_68,_.SCHEMA_NAME_69,_.SCHEMA_NAME_70,_.SCHEMA_NAME_71,_.SCHEMA_NAME_72,_.SCHEMA_NAME_73,_.SCHEMA_NAME_74,_.SCHEMA_NAME_75,_.SCHEMA_NAME_76,_.SCHEMA_NAME_77,_.SCHEMA_NAME_78]),t.findType("JSArray<SCHEMA_NAME>")),_.ChartType_0=new t.ChartType(0,"CIRCULAR"),_.ChartType_1=new t.ChartType(1,"TABLE"),_.ChartType_2=new t.ChartType(2,"LIST"),_.ChartType_3=new t.ChartType(3,"SCORECARD"),_.ChartType_4=new t.ChartType(4,"LINECHART"),_.ChartType_5=new t.ChartType(5,"BARCHART"),_.ChartType_6=new t.ChartType(6,"COLUMNCHART"),_.ChartType_7=new t.ChartType(7,"STACKLINECHART"),_.ChartType_8=new t.ChartType(8,"STACKBARCHART"),_.ChartType_9=new t.ChartType(9,"STACKCOLUMNCHART"),_.ChartType_10=new t.ChartType(10,"SPACER"),_.List_Y9v=t._setArrayType(e([_.ChartType_0,_.ChartType_1,_.ChartType_2,_.ChartType_3,_.ChartType_4,_.ChartType_5,_.ChartType_6,_.ChartType_7,_.ChartType_8,_.ChartType_9,_.ChartType_10]),t.findType("JSArray<ChartType>")),_.List_cIc=t._setArrayType(e(["January","February","March","April","May","June","July","August","September","October","November","December"]),$.JSArray_String),_.TIME_FORMATTER_0=new t.TIME_FORMATTER(0,"HOUR"),_.TIME_FORMATTER_1=new t.TIME_FORMATTER(1,"MINUTE"),_.TIME_FORMATTER_2=new t.TIME_FORMATTER(2,"SECOND"),_.TIME_FORMATTER_3=new t.TIME_FORMATTER(3,"HOUR_NO_DAY"),_.TIME_FORMATTER_4=new t.TIME_FORMATTER(4,"MINUTE_NO_DAY"),_.TIME_FORMATTER_5=new t.TIME_FORMATTER(5,"SECOND_NO_DAY"),_.List_cWd=t._setArrayType(e([_.TIME_FORMATTER_0,_.TIME_FORMATTER_1,_.TIME_FORMATTER_2,_.TIME_FORMATTER_3,_.TIME_FORMATTER_4,_.TIME_FORMATTER_5]),$.JSArray_TIME_FORMATTER),_.List_empty1=t._setArrayType(e([]),$.JSArray_QueryRequestDimension),_.List_empty0=t._setArrayType(e([]),$.JSArray_QueryRequestFilter),_.List_empty=t._setArrayType(e([]),$.JSArray_String),_.List_empty2=t._setArrayType(e([]),$.JSArray_dynamic),_.List_gc6=t._setArrayType(e(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),$.JSArray_String),_.List_h8w=t._setArrayType(e(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),$.JSArray_String),_.List_jvJ=t._setArrayType(e([_.AGGREGATION_TYPE_0,_.AGGREGATION_TYPE_1,_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3,_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5,_.AGGREGATION_TYPE_6,_.AGGREGATION_TYPE_7,_.AGGREGATION_TYPE_8,_.AGGREGATION_TYPE_9,_.AGGREGATION_TYPE_10,_.AGGREGATION_TYPE_11,_.AGGREGATION_TYPE_12]),$.JSArray_AGGREGATION_TYPE),_.List_k6a=t._setArrayType(e([_.DATA_TYPE_0,_.DATA_TYPE_1,_.DATA_TYPE_2,_.DATA_TYPE_3]),$.JSArray_DATA_TYPE),_.List_mC8=t._setArrayType(e([0,31,28,31,30,31,30,31,31,30,31,30,31]),$.JSArray_int),_.List_qpm=t._setArrayType(e(["J","F","M","A","M","J","J","A","S","O","N","D"]),$.JSArray_String),_.List_wMy=t._setArrayType(e(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]),$.JSArray_String),_.PermissionType_0=new t.PermissionType(0,"restaurant"),_.PermissionType_1=new t.PermissionType(1,"warehouse"),_.PermissionType_2=new t.PermissionType(2,"business"),_.List_wsa=t._setArrayType(e([_.PermissionType_0,_.PermissionType_1,_.PermissionType_2]),t.findType("JSArray<PermissionType>")),_.List_yRY=t._setArrayType(e([_.DIMENSION_OPTION_0,_.DIMENSION_OPTION_1,_.DIMENSION_OPTION_2,_.DIMENSION_OPTION_3,_.DIMENSION_OPTION_4,_.DIMENSION_OPTION_5,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9,_.DIMENSION_OPTION_10,_.DIMENSION_OPTION_11]),$.JSArray_DIMENSION_OPTION),_.List_EQM=t._setArrayType(e(["d","E","EEEE","LLL","LLLL","M","Md","MEd","MMM","MMMd","MMMEd","MMMM","MMMMd","MMMMEEEEd","QQQ","QQQQ","y","yM","yMd","yMEd","yMMM","yMMMd","yMMMEd","yMMMM","yMMMMd","yMMMMEEEEd","yQQQ","yQQQQ","H","Hm","Hms","j","jm","jms","jmv","jmz","jz","m","ms","s","v","z","zzzz","ZZZZ"]),$.JSArray_String),_.Map_EQ6TW=new t.ConstantStringMap(44,{d:"d",E:"ccc",EEEE:"cccc",LLL:"LLL",LLLL:"LLLL",M:"L",Md:"M/d",MEd:"EEE, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"EEE, MMM d",MMMM:"LLLL",MMMMd:"MMMM d",MMMMEEEEd:"EEEE, MMMM d",QQQ:"QQQ",QQQQ:"QQQQ",y:"y",yM:"M/y",yMd:"M/d/y",yMEd:"EEE, M/d/y",yMMM:"MMM y",yMMMd:"MMM d, y",yMMMEd:"EEE, MMM d, y",yMMMM:"MMMM y",yMMMMd:"MMMM d, y",yMMMMEEEEd:"EEEE, MMMM d, y",yQQQ:"QQQ y",yQQQQ:"QQQQ y",H:"HH",Hm:"HH:mm",Hms:"HH:mm:ss",j:"h a",jm:"h:mm a",jms:"h:mm:ss a",jmv:"h:mm a v",jmz:"h:mm a z",jz:"h a z",m:"m",ms:"mm:ss",s:"s",v:"v",z:"z",zzzz:"zzzz",ZZZZ:"ZZZZ"},_.List_EQM,t.findType("ConstantStringMap<String,String>")),_.List_empty3=t._setArrayType(e([]),t.findType("JSArray<Symbol0>")),_.Map_empty=new t.ConstantStringMap(0,{},_.List_empty3,t.findType("ConstantStringMap<Symbol0,@>")),_.StartOfWeek_0=new t.StartOfWeek(0,"SATURDAY"),_.StartOfWeek_1=new t.StartOfWeek(1,"SUNDAY"),_.StartOfWeek_2=new t.StartOfWeek(2,"MONDAY"),_.Symbol_call=new t.Symbol("call"),_.TimeZone_0_false_UTC=new t.TimeZone(0,!1,"UTC"),_.Type_Object_xQ6=t.typeLiteral("Object"),_.TzInstant_ww8=new t.TzInstant(_.TimeZone_0_false_UTC,-864e13,864e13),_.Units_3=new t.Units(3,"HOUR"),_.Units_4=new t.Units(4,"DAY"),_.Units_5=new t.Units(5,"WEEK"),_.Units_6=new t.Units(6,"MONTH"),_.Units_7=new t.Units(7,"YEAR"),_._IterationMarker_null_2=new t._IterationMarker(null,2)})(),function(){E._JS_INTEROP_INTERCEPTOR_TAG=null,E.Primitives__identityHashCodeProperty=null,E.BoundClosure__receiverFieldNameCache=null,E.BoundClosure__interceptorFieldNameCache=null,E.getTagFunction=null,E.alternateTagFunction=null,E.prototypeForTagFunction=null,E.dispatchRecordsForInstanceTags=null,E.interceptorsForUncacheableTags=null,E.initNativeDispatchFlag=null,E._toStringVisiting=t._setArrayType([],t.findType("JSArray<Object>")),E.cachedDateSymbols=null,E.lastDateSymbolLocale=null,E._defaultLocale=null,E.DateFormat__useNativeDigitsByDefault=t.LinkedHashMap_LinkedHashMap$_empty($.String,$.bool),E.DateFormat__digitMatchers=t.LinkedHashMap_LinkedHashMap$_empty($.String,t.findType("RegExp")),E.Jiffy____defaultLocale=t._Cell$(),E.VisualizationField__filterDimensionOptions=t._setArrayType([_.DIMENSION_OPTION_5,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9],$.JSArray_DIMENSION_OPTION),E.VisualizationField__fillGapDimensionOptions=t._setArrayType([_.DIMENSION_OPTION_1,_.DIMENSION_OPTION_2,_.DIMENSION_OPTION_3,_.DIMENSION_OPTION_4,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9,_.DIMENSION_OPTION_10,_.DIMENSION_OPTION_11],$.JSArray_DIMENSION_OPTION),E.VisualizationField__isNumericAggregations=t._setArrayType([_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3],$.JSArray_AGGREGATION_TYPE),E.___local=t._Cell$()}(),function(){var e=X.lazyFinal,i=X.lazy;e(E,"DART_CLOSURE_PROPERTY_NAME","$get$DART_CLOSURE_PROPERTY_NAME",()=>t.getIsolateAffinityTag("_$dart_dartClosure")),e(E,"TypeErrorDecoder_noSuchMethodPattern","$get$TypeErrorDecoder_noSuchMethodPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn({toString:function(){return"$receiver$"}}))),e(E,"TypeErrorDecoder_notClosurePattern","$get$TypeErrorDecoder_notClosurePattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn({$method$:null,toString:function(){return"$receiver$"}}))),e(E,"TypeErrorDecoder_nullCallPattern","$get$TypeErrorDecoder_nullCallPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn(null))),e(E,"TypeErrorDecoder_nullLiteralCallPattern","$get$TypeErrorDecoder_nullLiteralCallPattern",()=>t.TypeErrorDecoder_extractPattern(function(){var n="$arguments$";try{null.$method$(n)}catch(a){return a.message}}())),e(E,"TypeErrorDecoder_undefinedCallPattern","$get$TypeErrorDecoder_undefinedCallPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn(void 0))),e(E,"TypeErrorDecoder_undefinedLiteralCallPattern","$get$TypeErrorDecoder_undefinedLiteralCallPattern",()=>t.TypeErrorDecoder_extractPattern(function(){var n="$arguments$";try{(void 0).$method$(n)}catch(a){return a.message}}())),e(E,"TypeErrorDecoder_nullPropertyPattern","$get$TypeErrorDecoder_nullPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokePropertyErrorOn(null))),e(E,"TypeErrorDecoder_nullLiteralPropertyPattern","$get$TypeErrorDecoder_nullLiteralPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(function(){try{null.$method$}catch(n){return n.message}}())),e(E,"TypeErrorDecoder_undefinedPropertyPattern","$get$TypeErrorDecoder_undefinedPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokePropertyErrorOn(void 0))),e(E,"TypeErrorDecoder_undefinedLiteralPropertyPattern","$get$TypeErrorDecoder_undefinedLiteralPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(function(){try{(void 0).$method$}catch(n){return n.message}}())),e(E,"DateTime__parseFormat","$get$DateTime__parseFormat",()=>t.RegExp_RegExp("^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d+))?)?)?( ?[zZ]| ?([-+])(\\d\\d)(?::?(\\d\\d))?)?)?$",!1)),e(E,"_hashSeed","$get$_hashSeed",()=>t.objectHashCode(_.Type_Object_xQ6)),e(E,"Endian_host","$get$Endian_host",()=>t.NativeByteData_NativeByteData$view(t.NativeUint16List_NativeUint16List$fromList(t._setArrayType([1],$.JSArray_int)).buffer,0,null).getInt8(0)===1?_.C_Endian0:_.C_Endian),e(E,"_clockKey","$get$_clockKey",()=>new t.Object),e(E,"en_USSymbols","$get$en_USSymbols",()=>new t.DateSymbols("en_US",_.List_BC_AD,_.List_6xs,_.List_qpm,_.List_qpm,_.List_cIc,_.List_cIc,_.List_h8w,_.List_h8w,_.List_wMy,_.List_wMy,_.List_gc6,_.List_gc6,_.List_3US,_.List_AM_PM)),i(E,"_dateTimeSymbols","$get$_dateTimeSymbols",()=>t.UninitializedLocaleData$("initializeDateFormatting(<locale>)",E.$get$en_USSymbols())),i(E,"dateTimePatterns","$get$dateTimePatterns",()=>t.UninitializedLocaleData$("initializeDateFormatting(<locale>)",_.Map_EQ6TW)),e(E,"asciiZeroCodeUnit","$get$asciiZeroCodeUnit",()=>48),e(E,"DateFormat__matchers","$get$DateFormat__matchers",()=>t._setArrayType([t.RegExp_RegExp("^'(?:[^']|'')*'",!1),t.RegExp_RegExp("^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|D+|m+|s+|v+|z+|Z+)",!1),t.RegExp_RegExp("^[^'GyMkSEahKHcLQdDmsvzZ]+",!1)],t.findType("JSArray<RegExp>"))),e(E,"_DateFormatQuotedField__twoEscapedQuotes","$get$_DateFormatQuotedField__twoEscapedQuotes",()=>t.RegExp_RegExp("''",!1)),e(E,"asciiDigitMatcher","$get$asciiDigitMatcher",()=>t.RegExp_RegExp("^\\d+",!1)),i(E,"_availableLocales","$get$_availableLocales",()=>{var n,a,s=t.EnLocale$(_.StartOfWeek_1),o=t.EnLocale$(_.StartOfWeek_1),l=t.EnLocale$(_.StartOfWeek_1),D=t.EnLocale$(_.StartOfWeek_1),d=t.EnLocale$(_.StartOfWeek_1),c=t.EnLocale$(_.StartOfWeek_2),p=t.EnLocale$(_.StartOfWeek_2),y=t.EnLocale$(_.StartOfWeek_1),g=t.EnLocale$(_.StartOfWeek_1),m=t.EsLocale$(_.StartOfWeek_2),h=t.EsLocale$(_.StartOfWeek_2),S=t.EsLocale$(_.StartOfWeek_1),T=t.FrLocale$(_.StartOfWeek_2),b=t.FrLocale$(_.StartOfWeek_2),F=t.FrLocale$(_.StartOfWeek_1),M=t.ZhCnLocale$(_.StartOfWeek_1),I=t.ZhCnLocale$(_.StartOfWeek_1),x=t.ZhLocale$(_.StartOfWeek_1),R=t.ZhLocale$(_.StartOfWeek_1),L=t.DeLocale$(_.StartOfWeek_2),O=t.DeLocale$(_.StartOfWeek_2),v=t.DeLocale$(_.StartOfWeek_2),z=t.DeLocale$(_.StartOfWeek_2),c0=t.ItLocale$(_.StartOfWeek_2),p0=t.ItLocale$(_.StartOfWeek_2),f0=t.ArLyLocale$(!0,_.StartOfWeek_0),$0=t.ArLyLocale$(!1,_.StartOfWeek_0),y0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_1),g0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_1),h0=t.ArSaMaDzKwTnLocale$(!0,_.StartOfWeek_1),E0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_0),S0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_0);return t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),n=t.PtLocale$(_.StartOfWeek_2),a=t.PtLocale$(_.StartOfWeek_1),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.LinkedHashMap_LinkedHashMap$_literal(["en",s,"en_us",o,"en_sg",l,"en_au",D,"en_ca",d,"en_gb",c,"en_ie",p,"en_il",y,"en_nz",g,"es",m,"es_do",h,"es_us",S,"fr",T,"fr_ch",b,"fr_ca",F,"zh",M,"zh_cn",I,"zh_hk",x,"zh_tw",R,"de",L,"de_de",O,"de_at",v,"de_ch",z,"it",c0,"it_ch",p0,"ar",f0,"ar_ly",$0,"ar_dz",y0,"ar_kw",g0,"ar_sa",h0,"ar_ma",E0,"ar_tn",S0,"az",new t.AzLocale,"id",new t.IdLocale,"ja",new t.JaLocale,"ko",new t.KoLocale,"ru",new t.RuLocale,"uk",new t.UkLocale,"hi",new t.HiLocale,"pt",n,"pt_br",a,"pl",new t.PlLocale,"tr",new t.TrLocale,"sv",new t.SvLocale,"nb",new t.NbLocale,"fa",new t.FaLocale,"bn",new t.BnLocale,"nl",new t.NlLocale,"th",new t.ThLocale],$.String,t.findType("Locale"))}),e(E,"addonFlattenItemSchema","$get$addonFlattenItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("",""),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),a,new t.addonFlattenItemSchema_closure,_.List_empty0,a,a,!0,!1,!1,!0,!1,new t.addonFlattenItemSchema_closure0,"Addon","flatten_items","flatten_item",_.SCHEMA_NAME_7,n,"",s,o)}),e(E,"adjustmentSchema","$get$adjustmentSchema",()=>{var n="adjustment",a="adjustments",s="createdAt",o=null,l=t.Source_Source$couchdb(a,n),D=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),s),d=$.JSArray_String,c=t._setArrayType([t.Index$(t._setArrayType(["id"],d),o,o),t.Index$(t._setArrayType(["doc_id"],d),o,o),t.Index$(t._setArrayType(["restaurant_id","created_at"],d),"idx_adjustments_select_index",o),t.Index$(t._setArrayType(["item_id"],d),o,o),t.Index$(t._setArrayType(["bill_id"],d),o,o),t.Index$(t._setArrayType(["published_at"],d),o,o)],$.JSArray_Index),p=t._setArrayType(["restaurantId"],d);return t.Schema_Schema$build("sales",t._setArrayType(["discount","adjustment","promo","promotion","offer"],d),2,p,o,new t.adjustmentSchema_closure,_.List_empty0,c,o,!1,!0,!1,!1,!1,new t.adjustmentSchema_closure0,"Discount",a,n,_.SCHEMA_NAME_20,s,"couchdb_bill",l,D)}),e(E,"billSchema","$get$billSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_bills_select_index",n),t.Index$(t._setArrayType(["member_id"],l),n,n),t.Index$(t._setArrayType(["member_user_id"],l),n,n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id","completed_at"],l),"idx_complete_time_bills_select_index",n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["bill","order","transaction","receipt","customer","table","dine in","takeaway","total amount"],l),1,d,n,new t.billSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.billSchema_closure0,"Bill","bills","bill",_.SCHEMA_NAME_0,a,"couchdb_bill",s,o)}),e(E,"businessSchema","$get$businessSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Businesses"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("id")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.businessSchema_closure,_.List_empty0,l,n,!1,!0,!1,!1,!1,new t.businessSchema_closure0,"Business","businesses","business",_.SCHEMA_NAME_2,n,"mongodb_businesses",a,s)}),e(E,"campaignSchema","$get$campaignSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Campaigns"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n),t.Index$(t._setArrayType(["collectible_id"],o),n,n)],$.JSArray_Index),D=t._setArrayType([],o);return t.Schema_Schema$build("loyalty",t._setArrayType(["campaign","promotion campaign","marketing"],o),2,D,n,new t.campaignSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.campaignSchema_closure0,"Campaign","campaigns","campaign",_.SCHEMA_NAME_61,n,"mongodb_marketing_db_campaigns",a,s)}),e(E,"campaignTierSchema","$get$campaignTierSchema",()=>{var n=null,a=t.Source_Source$mongodb("tiers","Campaigns"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.campaignTierSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.campaignTierSchema_closure0,"Campaign tier","campaign_tiers","campaign_tier",_.SCHEMA_NAME_64,n,"mongodb_marketing_db_campaigns",a,s)}),e(E,"chargeSchema","$get$chargeSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("charges","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_charges_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["parent_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["charge","service charge","tax","gst","sst","fee"],l),2,d,a,new t.chargeSchema_closure,_.List_empty0,D,900,!1,!0,!1,!1,!1,new t.chargeSchema_closure0,"Charge","charges","charge",_.SCHEMA_NAME_12,n,"couchdb_bill",s,o)}),e(E,"closingDraftSchema","$get$closingDraftSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"closingDraft"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_closing_draft_select_index",n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["closing_adjustment_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),n,new t.closingDraftSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.closingDraftSchema_closure0,"Closing draft","closing_drafts","closing_draft",_.SCHEMA_NAME_25,a,"couchdb_closing_draft",s,o)}),e(E,"closingDraftSkuSchema","$get$closingDraftSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","closingDraft"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_cds_select_index",a),t.Index$(t._setArrayType(["closing_adjustment_id","sku_id"],l),"idx_cds_closing_sku_index",a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.closingDraftSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!0,!0,new t.closingDraftSkuSchema_closure0,"Closing draft sku","closing_draft_skus","closing_draft_sku",_.SCHEMA_NAME_26,n,"couchdb_closing_draft",s,o)}),e(E,"closingSkuSchema","$get$closingSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","closing"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["closing","stock take","physical count","stocktake"],l),2,d,a,new t.closingSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.closingSkuSchema_closure0,"Closing sku","closing_skus","closing_sku",_.SCHEMA_NAME_24,n,"couchdb_closing",s,o)}),e(E,"collectibleCollectionSchema","$get$collectibleCollectionSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$mongodb(n,"Collections"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["business_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],l),n,new t.collectibleCollectionSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.collectibleCollectionSchema_closure0,"Collectible collection","collectible_collections","collectible_collection",_.SCHEMA_NAME_67,a,"mongodb_marketing_db_collections",s,o)}),e(E,"collectibleConfigSchema","$get$collectibleConfigSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"CollectibleConfigs"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.collectibleConfigSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.collectibleConfigSchema_closure0,"Collectible config","collectible_configs","collectible_config",_.SCHEMA_NAME_62,n,"mongodb_marketing_db_collectible_configs",a,s)}),e(E,"collectibleTransactionSchema","$get$collectibleTransactionSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$mongodb("amounts","Transactions"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["business_id"],l),a,a),t.Index$(t._setArrayType(["collection_id"],l),a,a),t.Index$(t._setArrayType(["business_id","created_at"],l),"idx_collectible_transactions_select_index",a),t.Index$(t._setArrayType(["ref_id"],l),a,a),t.Index$(t._setArrayType(["user_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType([],l),a,new t.collectibleTransactionSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.collectibleTransactionSchema_closure0,"Collectible transaction","collectible_transactions","collectible_transaction",_.SCHEMA_NAME_63,n,"mongodb_marketing_db_transactions",s,o)}),e(E,"completeTimeBillSchema","$get$completeTimeBillSchema",()=>{var n=null,a=t.Source_Source$couchdb(n,""),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),"completedAt");return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),n,new t.completeTimeBillSchema_closure,_.List_empty0,n,n,!0,!1,!1,!1,!1,new t.completeTimeBillSchema_closure0,"Bill (Complete time)","bills","bill",_.SCHEMA_NAME_1,"createdAt","",a,s)}),e(E,"counterSchema","$get$counterSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"counter"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("operations",t._setArrayType(["counter","pos","terminal","register"],l),2,d,n,new t.counterSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.counterSchema_closure0,"Counter","counters","counter",_.SCHEMA_NAME_3,a,"couchdb_counter",s,o)}),e(E,"creditTransactionSchema","$get$creditTransactionSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$mongodb(n,"CreditTransactions"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId"),t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n),t.Index$(t._setArrayType(["business_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("loyalty",t._setArrayType(["credit","point","reward point","loyalty point"],l),2,d,n,new t.creditTransactionSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.creditTransactionSchema_closure0,"Credit transaction","credit_transactions","credit_transaction",_.SCHEMA_NAME_51,a,"mongodb_credit_transactions",s,o)}),e(E,"drawerSchema","$get$drawerSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"drawer"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("operations",t._setArrayType(["drawer","cash drawer","float","petty cash","cash management"],l),2,d,n,new t.drawerSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.drawerSchema_closure0,"Drawer","drawers","drawer",_.SCHEMA_NAME_4,a,"couchdb_drawer",s,o)}),e(E,"flattenItemSchema","$get$flattenItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("flattenItems","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_flatten_items_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["parent_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["sales","revenue","sold","item sold","product sold","quantity","grabfood","foodpanda","delivery","online order","platform","channel","order type"],l),1,d,a,new t.flattenItemSchema_closure,_.List_empty0,D,a,!1,!0,!1,!1,!1,new t.flattenItemSchema_closure0,"Product","flatten_items","flatten_item",_.SCHEMA_NAME_5,n,"couchdb_bill",s,o)}),e(E,"defaultSchemas","$get$defaultSchemas",()=>t._setArrayType([E.$get$billSchema(),E.$get$completeTimeBillSchema(),E.$get$counterSchema(),E.$get$drawerSchema(),E.$get$flattenItemSchema(),E.$get$addonFlattenItemSchema(),E.$get$parentFlattenItemSchema(),E.$get$itemSchema(),E.$get$subItemSchema(),E.$get$paymentSchema(),E.$get$chargeSchema(),E.$get$paymentTimePaymentSchema(),E.$get$recordSchema(),E.$get$slotSchema(),E.$get$staffSchema(),E.$get$timesheetSchema(),E.$get$adjustmentSchema(),E.$get$inventoryAdjustmentSchema(),E.$get$inventoryAdjustmentSkuSchema(),E.$get$internalPurchaseOrderSchema(),E.$get$internalPurchaseOrderItemSchema(),E.$get$internalPurchaseOrderDeliveryOrderSchema(),E.$get$internalPurchaseOrderDeliveryOrderSkuSchema(),E.$get$internalPurchaseOrderDeliveryFulfillmentSchema(),E.$get$internalPurchaseOrderDeliveryFulfillmentSkuSchema(),E.$get$purchaseOrderSchema(),E.$get$purchaseOrderItemSchema(),E.$get$purchaseOrderDeliveryOrderSchema(),E.$get$purchaseOrderDeliveryOrderSkuSchema(),E.$get$purchaseOrderDeliveryFulfillmentSchema(),E.$get$purchaseOrderDeliveryFulfillmentSkuSchema(),E.$get$restaurantSchema(),E.$get$restaurantFeatureSchema(),E.$get$businessSchema(),E.$get$userSchema(),E.$get$voucherClaimSchema(),E.$get$voucherClaimRedemptionSchema(),E.$get$restaurantLocationSchema(),E.$get$warehouseLocationSchema(),E.$get$memberSchema(),E.$get$memberV2Schema(),E.$get$memberStorePurchaseSchema(),E.$get$memberStorePurchasePaymentSchema(),E.$get$membershipSchema(),E.$get$membershipTitleSchema(),E.$get$memberTitleSchema(),E.$get$menuV3GroupSchema(),E.$get$menuV4GroupSchema(),E.$get$menuV3SkuSchema(),E.$get$menuV4SkuSchema(),E.$get$menuV3ItemSchema(),E.$get$menuV4ItemSchema(),E.$get$menuV4CatalogItemSchema(),E.$get$creditTransactionSchema(),E.$get$stockSchema(),E.$get$recommendationCallSchema(),E.$get$reviewSchema(),E.$get$campaignSchema(),E.$get$collectibleConfigSchema(),E.$get$collectibleTransactionSchema(),E.$get$campaignTierSchema(),E.$get$storeTransactionSchema(),E.$get$storeBundleSchema(),E.$get$collectibleCollectionSchema(),E.$get$kitchenStationSchema(),E.$get$refundBillSchema(),E.$get$timesheetRecordSchema(),E.$get$inventoryAdjustmentPhysicalSkuSchema(),E.$get$menuV4ItemInventoryBindingSchema(),E.$get$inventoryV1FlattenInventorySchema(),E.$get$itemMovementSchema(),E.$get$closingSkuSchema(),E.$get$closingDraftSchema(),E.$get$closingDraftSkuSchema(),E.$get$unitCostHistorySchema()],t.findType("JSArray<Schema>"))),e(E,"internalPurchaseOrderSchema","$get$internalPurchaseOrderSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["effective_at"],l),n,n),t.Index$(t._setArrayType(["location_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),n,new t.internalPurchaseOrderSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!0,new t.internalPurchaseOrderSchema_closure0,"Purchase order","purchase_orders","purchase_order",_.SCHEMA_NAME_33,a,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryFulfillmentSchema","$get$internalPurchaseOrderDeliveryFulfillmentSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryFulfillments","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryFulfillmentSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0,"Purchase order delivery fulfillment","purchase_order_delivery_fulfillments","purchase_order_delivery_fulfillment",_.SCHEMA_NAME_36,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryFulfillmentSkuSchema","$get$internalPurchaseOrderDeliveryFulfillmentSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryFulfillmentSkus","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_delivery_fulfillment_id"],l),A.idx_pof,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0,"Purchase order delivery fulfillment sku","purchase_order_delivery_fulfillment_skus","purchase_order_delivery_fulfillment_sku",_.SCHEMA_NAME_38,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryOrderSchema","$get$internalPurchaseOrderDeliveryOrderSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryOrders","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryOrderSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryOrderSchema_closure0,"Purchase order delivery order","purchase_order_delivery_orders","purchase_order_delivery_order",_.SCHEMA_NAME_35,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryOrderSkuSchema","$get$internalPurchaseOrderDeliveryOrderSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryOrderSkus","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_delivery_order_id"],l),A.idx_poo,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryOrderSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0,"Purchase order delivery order sku","purchase_order_delivery_order_skus","purchase_order_delivery_order_sku",_.SCHEMA_NAME_37,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderItemSchema","$get$internalPurchaseOrderItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("items","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderItemSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderItemSchema_closure0,"Purchase order item","purchase_order_items","purchase_order_item",_.SCHEMA_NAME_34,n,"couchdb_purchase_order",s,o)}),e(E,"inventoryAdjustmentSchema","$get$inventoryAdjustmentSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_ias_select_index",n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["ref"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build(n,t._setArrayType(["stock","inventory","stock adjustment","available stock","stock balance"],l),2,d,n,new t.inventoryAdjustmentSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.inventoryAdjustmentSchema_closure0,"Inventory","inventory_adjustments","inventory_adjustment",_.SCHEMA_NAME_21,a,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryAdjustmentPhysicalSkuSchema","$get$inventoryAdjustmentPhysicalSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("physicalSkus","inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["inventory_adjustment_id"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_iapss_select_index",a),t.Index$(t._setArrayType(["inventory_adjustment_sku_id"],l),"idx_iapss_inventory_adjustment_sku_id",a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.inventoryAdjustmentPhysicalSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.inventoryAdjustmentPhysicalSkuSchema_closure0,"Inventory physical sku","inventory_adjustment_physical_skus","inventory_adjustment_physical_sku",_.SCHEMA_NAME_23,n,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryAdjustmentSkuSchema","$get$inventoryAdjustmentSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_iass_select_index",a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["inventory_adjustment_id"],l),a,a),t.Index$(t._setArrayType(["ref"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["stock","inventory","stock adjustment","available stock","stock balance"],l),2,d,a,new t.inventoryAdjustmentSkuSchema_closure,_.List_empty0,D,a,!1,!0,!1,!1,!1,new t.inventoryAdjustmentSkuSchema_closure0,"Inventory sku","inventory_adjustment_skus","inventory_adjustment_sku",_.SCHEMA_NAME_22,n,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryV1FlattenInventorySchema","$get$inventoryV1FlattenInventorySchema",()=>{var n=null,a=t.Source_Source$couchdb("flattenInventories","mInventoryV1"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["published_at"],o),n,n),t.Index$(t._setArrayType(["location_id"],o),n,n),t.Index$(t._setArrayType(["link_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],o),n,new t.inventoryV1FlattenInventorySchema_closure,_.List_empty0,l,3600,!0,!0,!1,!1,!0,new t.inventoryV1FlattenInventorySchema_closure0,"Inventory","inventory_flatten_inventories","inventory_flatten_inventory",_.SCHEMA_NAME_71,n,"couchdb_m_inventory_v1",a,s)}),e(E,"itemSchema","$get$itemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("",""),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),a,new t.itemSchema_closure,t._setArrayType([t.QueryRequestFilter$(a,"layer",_.COMPARISON_OPERATOR_0,a,_.SCHEMA_NAME_8,["0"])],$.JSArray_QueryRequestFilter),a,a,!0,!1,!1,!0,!1,new t.itemSchema_closure0,"Product (Deprecated)","flatten_items","flatten_item",_.SCHEMA_NAME_8,n,"",s,o)}),e(E,"itemMovementSchema","$get$itemMovementSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("itemMovements","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_item_movement_select_index",a),t.Index$(t._setArrayType(["item_id"],l),a,a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["move_from_bill_id"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["item movement","stock movement","transfer","stock transfer"],l),2,d,a,new t.itemMovementSchema_closure,_.List_empty0,D,600,!0,!0,!1,!1,!1,new t.itemMovementSchema_closure0,"Item Movement","item_movements","item_movement",_.SCHEMA_NAME_72,n,"couchdb_bill",s,o)}),e(E,"kitchenStationSchema","$get$kitchenStationSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("kitchenStations","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_kitchen_stations_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("specialized",t._setArrayType(["kitchen","kitchen station","prep time","cook time"],l),3,d,a,new t.kitchenStationSchema_closure,_.List_empty0,D,600,!0,!0,!1,!1,!1,new t.kitchenStationSchema_closure0,"Kitchen station","kitchen_stations","kitchen_station",_.SCHEMA_NAME_68,n,"couchdb_bill",s,o)}),e(E,"memberSchema","$get$memberSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Members"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["user_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index),D=t._setArrayType([],o);return t.Schema_Schema$build("loyalty",t._setArrayType(["member","customer","loyalty","membership","registered customer"],o),2,D,n,new t.memberSchema_closure,_.List_empty0,l,n,!1,!0,!1,!1,!1,new t.memberSchema_closure0,"Member","members","member",_.SCHEMA_NAME_42,n,"mongodb_members",a,s)}),e(E,"memberStorePurchaseSchema","$get$memberStorePurchaseSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"memberStorePurchase"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n),t.Index$(t._setArrayType(["member_id"],l),n,n),t.Index$(t._setArrayType(["member_user_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),n,new t.memberStorePurchaseSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.memberStorePurchaseSchema_closure0,"Member store purchase","member_store_purchases","member_store_purchase",_.SCHEMA_NAME_46,a,"couchdb_member_store_purchase",s,o)}),e(E,"memberStorePurchasePaymentSchema","$get$memberStorePurchasePaymentSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("payments","memberStorePurchase"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["restaurant_id"],l),a,a),t.Index$(t._setArrayType(["member_store_purchase_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.memberStorePurchasePaymentSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.memberStorePurchasePaymentSchema_closure0,"Member store purchase payment","member_store_purchase_payments","member_store_purchase_payment",_.SCHEMA_NAME_47,n,"couchdb_member_store_purchase",s,o)}),e(E,"memberTitleSchema","$get$memberTitleSchema",()=>{var n=null,a=t.Source_Source$mongodb("titles","Members"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n),t.Index$(t._setArrayType(["member_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.memberTitleSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.memberTitleSchema_closure0,"Member title","member_titles","member_title",_.SCHEMA_NAME_48,"createdAt","mongodb_members",a,s)}),e(E,"memberV2Schema","$get$memberV2Schema",()=>{var n=null,a=t.Source_Source$mongodb("members","UsersV2"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["user_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.memberV2Schema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!0,new t.memberV2Schema_closure0,"Member","members","member",_.SCHEMA_NAME_43,n,"mongodb_marketing_db_users_v2",a,s)}),e(E,"membershipSchema","$get$membershipSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Memberships"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.membershipSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.membershipSchema_closure0,"Membership","memberships","membership",_.SCHEMA_NAME_49,n,"mongodb_memberships",a,s)}),e(E,"membershipTitleSchema","$get$membershipTitleSchema",()=>{var n=null,a=t.Source_Source$mongodb("titles","Memberships"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.membershipTitleSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.membershipTitleSchema_closure0,"Membership title","membership_titles","membership_title",_.SCHEMA_NAME_50,n,"mongodb_memberships",a,s)}),e(E,"menuV3GroupSchema","$get$menuV3GroupSchema",()=>{var n=null,a=t.Source_Source$couchdb("addonGroups","mMenuV3"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["restaurant_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],o),`SELECT *
|
|
90
|
+
`,IFNULLde_:"IFNULL(@deliveryFee,0)*IF(@isRefund, -1, 1)",IFNULLdeWT:"IFNULL(@deliveryFeeWithTax,0)*IF(@isRefund, -1, 1)",IFNULLdeWo:"IFNULL(@deliveryFeeWithoutTax,0)*IF(@isRefund, -1, 1)",IFNULLdiI:"IFNULL(@discountInclusiveTaxTotal,0)*IF(@isRefund, -1, 1)",IFNULLdiT:"IFNULL(@discountTotal,0)*IF(@isRefund, -1, 1)",IFNULLg:"IFNULL(@grossTotal,0)*IF(@isRefund, -1, 1)",IFNULLi:"IFNULL(@itemCount,0)*IF(@isRefund, -1, 1)",IFNULLn:"IFNULL(@nettTotal,0)*IF(@isRefund, -1, 1)",IFNULLoT:"IFNULL(@otherChargeWithTax,0)*IF(@isRefund, -1, 1)",IFNULLoo:"IFNULL(@otherChargeWithoutTax,0)*IF(@isRefund, -1, 1)",IFNULLs:"IFNULL(@serviceChargeTotal,0)*IF(@isRefund, -1, 1)",IFNULLta:"IFNULL(@takeawayPrice,0)*IF(@isRefund, -1, 1)",IFNULLth:"IFNULL(@thirdPartyExtraCharge,0)*IF(@isRefund, -1, 1)",MIN_EX:"MIN(EXTRACT(DAY FROM (!end-@created_at))) OVER (PARTITION BY @restaurant_id,@member_user_id)",SUM__n:"SUM(@nett_total) OVER (PARTITION BY @restaurant_id,@member_user_id)",case_wI:"case when @counterId='' or @counterId='system' or @counterId is null then 'counter_default_main' else @counterId end",case_wN:"case when @counterName='' or @counterName='System' or @counterName is null then 'Main' else @counterName end",case_w_i:"case when @counter_id='' or @counter_id='system' or @counter_id is null then 'counter_default_main' else @counter_id end",case_w_n:"case when @counter_name='' or @counter_name='System' or @counter_name is null then 'Main' else @counter_name end",idx_pof:"idx_podfss_purchase_order_delivery_fulfillment_id",idx_poo:"idx_podoss_purchase_order_delivery_order_id",netSui:"netSuite.additionalInfo.transactionnumber"},$=function(){var e=t.findType;return{ConstantMapView_Symbol_dynamic:e("ConstantMapView<Symbol0,@>"),DateTime:e("DateTime"),EfficientLengthIterable_dynamic:e("EfficientLengthIterable<@>"),Error:e("Error"),Function:e("Function"),JSArray_AGGREGATION_TYPE:e("JSArray<AGGREGATION_TYPE>"),JSArray_COMPARISON_OPERATOR:e("JSArray<COMPARISON_OPERATOR>"),JSArray_DATA_TYPE:e("JSArray<DATA_TYPE>"),JSArray_DIMENSION_OPTION:e("JSArray<DIMENSION_OPTION>"),JSArray_FORMATTER_TYPE:e("JSArray<FORMATTER_TYPE>"),JSArray_Field:e("JSArray<Field>"),JSArray_Index:e("JSArray<Index>"),JSArray_Join:e("JSArray<Join>"),JSArray_JoinCondition:e("JSArray<JoinCondition>"),JSArray_JoinDatasourceCondition:e("JSArray<JoinDatasourceCondition>"),JSArray_JoinLateralSort:e("JSArray<JoinLateralSort>"),JSArray_Permission:e("JSArray<Permission>"),JSArray_QueryRequest:e("JSArray<QueryRequest>"),JSArray_QueryRequestComparison:e("JSArray<QueryRequestComparison>"),JSArray_QueryRequestDimension:e("JSArray<QueryRequestDimension>"),JSArray_QueryRequestFilter:e("JSArray<QueryRequestFilter>"),JSArray_QueryRequestMetric:e("JSArray<QueryRequestMetric>"),JSArray_QueryRequestSort:e("JSArray<QueryRequestSort>"),JSArray_QueryResponseRow:e("JSArray<QueryResponseRow>"),JSArray_String:e("JSArray<String>"),JSArray_TIME_FORMATTER:e("JSArray<TIME_FORMATTER>"),JSArray_TimeZone:e("JSArray<TimeZone>"),JSArray__DateFormatField:e("JSArray<_DateFormatField>"),JSArray__PlainSqlColumn:e("JSArray<_PlainSqlColumn>"),JSArray_dynamic:e("JSArray<@>"),JSArray_int:e("JSArray<int>"),JSArray_of__DateFormatField_Function_String_DateFormat:e("JSArray<_DateFormatField(String,DateFormat)>"),JSIndexable_dynamic:e("JSIndexable<@>"),JSNull:e("JSNull"),JavaScriptFunction:e("JavaScriptFunction"),JavaScriptIndexingBehavior_dynamic:e("JavaScriptIndexingBehavior<@>"),JoinDatasourceCondition:e("JoinDatasourceCondition"),JsLinkedHashMap_Symbol_dynamic:e("JsLinkedHashMap<Symbol0,@>"),List_dynamic:e("List<@>"),Location:e("Location"),Map_String_dynamic:e("Map<String,@>"),Map_dynamic_dynamic:e("Map<@,@>"),MappedListIterable_String_String:e("MappedListIterable<String,String>"),NativeTypedArrayOfInt:e("NativeTypedArrayOfInt"),NativeUint8List:e("NativeUint8List"),Null:e("Null"),Object:e("Object"),QueryRequest:e("QueryRequest"),QueryRequestDimension:e("QueryRequestDimension"),QueryRequestFilter:e("QueryRequestFilter"),QueryRequestMetric:e("QueryRequestMetric"),QueryRequestSort:e("QueryRequestSort"),QueryResponse:e("QueryResponse"),QueryResponseColumn:e("QueryResponseColumn"),QueryResponseRow:e("QueryResponseRow"),Record:e("Record"),RegExpMatch:e("RegExpMatch"),SCHEMA_NAME:e("SCHEMA_NAME"),String:e("String"),UnknownJavaScriptObject:e("UnknownJavaScriptObject"),_PlainSqlColumn:e("_PlainSqlColumn"),bool:e("bool"),double:e("double"),dynamic:e("@"),int:e("int"),legacy_Never:e("0&*"),legacy_Object:e("Object*"),nullable_Future_Null:e("Future<Null>?"),nullable_List_dynamic:e("List<@>?"),nullable_Object:e("Object?"),nullable_QueryRequestDimension:e("QueryRequestDimension?"),num:e("num")}}();(function(){var e=X.makeConstList;_.Interceptor_methods=u.Interceptor.prototype,_.JSArray_methods=u.JSArray.prototype,_.JSInt_methods=u.JSInt.prototype,_.JSNumber_methods=u.JSNumber.prototype,_.JSString_methods=u.JSString.prototype,_.JavaScriptFunction_methods=u.JavaScriptFunction.prototype,_.JavaScriptObject_methods=u.JavaScriptObject.prototype,_.NativeUint8List_methods=t.NativeUint8List.prototype,_.PlainJavaScriptObject_methods=u.PlainJavaScriptObject.prototype,_.UnknownJavaScriptObject_methods=u.UnknownJavaScriptObject.prototype,_.AGGREGATION_TYPE_0=new t.AGGREGATION_TYPE(0,"SUM"),_.AGGREGATION_TYPE_1=new t.AGGREGATION_TYPE(1,"AVERAGE"),_.AGGREGATION_TYPE_10=new t.AGGREGATION_TYPE(10,"CUMULATIVE_SUM"),_.AGGREGATION_TYPE_11=new t.AGGREGATION_TYPE(11,"CUMULATIVE_AVERAGE"),_.AGGREGATION_TYPE_12=new t.AGGREGATION_TYPE(12,"CUMULATIVE_COUNT"),_.AGGREGATION_TYPE_2=new t.AGGREGATION_TYPE(2,"COUNT"),_.AGGREGATION_TYPE_3=new t.AGGREGATION_TYPE(3,"COUNT_DISTINCT"),_.AGGREGATION_TYPE_4=new t.AGGREGATION_TYPE(4,"FIRST"),_.AGGREGATION_TYPE_5=new t.AGGREGATION_TYPE(5,"LAST"),_.AGGREGATION_TYPE_6=new t.AGGREGATION_TYPE(6,"ANY"),_.AGGREGATION_TYPE_7=new t.AGGREGATION_TYPE(7,"MERGE"),_.AGGREGATION_TYPE_8=new t.AGGREGATION_TYPE(8,"MIN"),_.AGGREGATION_TYPE_9=new t.AGGREGATION_TYPE(9,"MAX"),_.AsciiDecoder_false=new t.AsciiDecoder(!1),_.COMPARISON_OPERATOR_0=new t.COMPARISON_OPERATOR(0,"EQUAL"),_.COMPARISON_OPERATOR_1=new t.COMPARISON_OPERATOR(1,"NOT_EQUAL"),_.COMPARISON_OPERATOR_10=new t.COMPARISON_OPERATOR(10,"OR"),_.COMPARISON_OPERATOR_2=new t.COMPARISON_OPERATOR(2,"GREATER_THAN"),_.COMPARISON_OPERATOR_3=new t.COMPARISON_OPERATOR(3,"LESS_THAN"),_.COMPARISON_OPERATOR_4=new t.COMPARISON_OPERATOR(4,"GREATER_THAN_OR_EQUAL"),_.COMPARISON_OPERATOR_5=new t.COMPARISON_OPERATOR(5,"LESS_THAN_OR_EQUAL"),_.COMPARISON_OPERATOR_6=new t.COMPARISON_OPERATOR(6,"BETWEEN"),_.COMPARISON_OPERATOR_7=new t.COMPARISON_OPERATOR(7,"LIKE"),_.COMPARISON_OPERATOR_8=new t.COMPARISON_OPERATOR(8,"NOT_LIKE"),_.C_AsciiCodec=new t.AsciiCodec,_.C_EmptyIterator=new t.EmptyIterator,_.C_Endian=new t.Endian,_.C_Endian0=new t.Endian,_.C_JS_CONST=function(n){var a=Object.prototype.toString.call(n);return a.substring(8,a.length-1)},_.C_JS_CONST0=function(){var i=Object.prototype.toString;function n(d){var c=i.call(d);return c.substring(8,c.length-1)}function a(d,c){if(/^HTML[A-Z].*Element$/.test(c)){var p=i.call(d);return p=="[object Object]"?null:"HTMLElement"}}function s(d,c){return w.HTMLElement&&d instanceof HTMLElement?"HTMLElement":a(d,c)}function o(d){if(typeof window>"u"||typeof window[d]>"u")return null;var c=window[d];return typeof c!="function"?null:c.prototype}function l(d){return null}var D=typeof navigator=="object";return{getTag:n,getUnknownTag:D?s:a,prototypeForTag:o,discriminator:l}},_.C_JS_CONST6=function(i){return function(n){if(typeof navigator!="object")return n;var a=navigator.userAgent;if(a.indexOf("DumpRenderTree")>=0)return n;if(a.indexOf("Chrome")>=0){let s=function(o){return typeof window=="object"&&window[o]&&window[o].name==o};if(s("Window")&&s("HTMLElement"))return n}n.getTag=i}},_.C_JS_CONST1=function(i){if(typeof dartExperimentalFixupGetTag!="function")return i;i.getTag=dartExperimentalFixupGetTag(i.getTag)},_.C_JS_CONST2=function(i){var n=i.getTag,a=i.prototypeForTag;function s(l){var D=n(l);return D=="Document"?l.xmlVersion?"!Document":"!HTMLDocument":D}function o(l){return l=="Document"?null:a(l)}i.getTag=s,i.prototypeForTag=o},_.C_JS_CONST5=function(i){var n=typeof navigator=="object"?navigator.userAgent:"";if(n.indexOf("Firefox")==-1)return i;var a=i.getTag,s={BeforeUnloadEvent:"Event",DataTransfer:"Clipboard",GeoGeolocation:"Geolocation",Location:"!Location",WorkerMessageEvent:"MessageEvent",XMLDocument:"!Document"};function o(l){var D=a(l);return s[D]||D}i.getTag=o},_.C_JS_CONST4=function(i){var n=typeof navigator=="object"?navigator.userAgent:"";if(n.indexOf("Trident/")==-1)return i;var a=i.getTag,s={BeforeUnloadEvent:"Event",DataTransfer:"Clipboard",HTMLDDElement:"HTMLElement",HTMLDTElement:"HTMLElement",HTMLPhraseElement:"HTMLElement",Position:"Geoposition"};function o(D){var d=a(D),c=s[d];return c||(d=="Object"&&window.DataView&&D instanceof window.DataView?"DataView":d)}function l(D){var d=window[D];return d==null?null:d.prototype}i.getTag=o,i.prototypeForTag=l},_.C_JS_CONST3=function(i){return i},_.C_JsonCodec=new t.JsonCodec,_.C_OutOfMemoryError=new t.OutOfMemoryError,_.C_Utf8Codec=new t.Utf8Codec,_.C_Utf8Encoder=new t.Utf8Encoder,_.C__Required=new t._Required,_.DATA_TYPE_0=new t.DATA_TYPE(0,"STRING"),_.DATA_TYPE_1=new t.DATA_TYPE(1,"TIMESTAMP"),_.DATA_TYPE_2=new t.DATA_TYPE(2,"BOOL"),_.DATA_TYPE_3=new t.DATA_TYPE(3,"NUMERIC"),_.DIMENSION_OPTION_0=new t.DIMENSION_OPTION(0,"DATE_TIME"),_.DIMENSION_OPTION_1=new t.DIMENSION_OPTION(1,"HOUR"),_.DIMENSION_OPTION_10=new t.DIMENSION_OPTION(10,"YEAR"),_.DIMENSION_OPTION_11=new t.DIMENSION_OPTION(11,"YEAR_MONTH_DAY"),_.DIMENSION_OPTION_2=new t.DIMENSION_OPTION(2,"DAY"),_.DIMENSION_OPTION_3=new t.DIMENSION_OPTION(3,"WEEK"),_.DIMENSION_OPTION_4=new t.DIMENSION_OPTION(4,"MONTH"),_.DIMENSION_OPTION_5=new t.DIMENSION_OPTION(5,"TIME_OF_DAY"),_.DIMENSION_OPTION_6=new t.DIMENSION_OPTION(6,"HOUR_OF_DAY"),_.DIMENSION_OPTION_7=new t.DIMENSION_OPTION(7,"DAY_OF_WEEK"),_.DIMENSION_OPTION_8=new t.DIMENSION_OPTION(8,"DAY_OF_MONTH"),_.DIMENSION_OPTION_9=new t.DIMENSION_OPTION(9,"MONTH_OF_YEAR"),_.Duration_0=new t.Duration(0),_.Duration_1000=new t.Duration(1e3),_.FIELD_TYPE_0=new t.FIELD_TYPE(0,"DIMENSION"),_.FIELD_TYPE_1=new t.FIELD_TYPE(1,"METRIC"),_.JsonDecoder_null=new t.JsonDecoder(null),_.JsonEncoder_null=new t.JsonEncoder(null),_.List_3US=t._setArrayType(e(["S","M","T","W","T","F","S"]),$.JSArray_String),_.List_6xs=t._setArrayType(e(["Before Christ","Anno Domini"]),$.JSArray_String),_.INDEX_METHOD_0=new t.INDEX_METHOD(0,"BTREE"),_.INDEX_METHOD_1=new t.INDEX_METHOD(1,"HASH"),_.INDEX_METHOD_2=new t.INDEX_METHOD(2,"GIST"),_.INDEX_METHOD_3=new t.INDEX_METHOD(3,"SPGIST"),_.INDEX_METHOD_4=new t.INDEX_METHOD(4,"BRIN"),_.INDEX_METHOD_5=new t.INDEX_METHOD(5,"GIN"),_.List_88s=t._setArrayType(e([_.INDEX_METHOD_0,_.INDEX_METHOD_1,_.INDEX_METHOD_2,_.INDEX_METHOD_3,_.INDEX_METHOD_4,_.INDEX_METHOD_5]),t.findType("JSArray<INDEX_METHOD>")),_.List_AM_PM=t._setArrayType(e(["AM","PM"]),$.JSArray_String),_.List_BC_AD=t._setArrayType(e(["BC","AD"]),$.JSArray_String),_.FORMATTER_TYPE_0=new t.FORMATTER_TYPE(0,"HOUR"),_.FORMATTER_TYPE_1=new t.FORMATTER_TYPE(1,"MINUTE"),_.FORMATTER_TYPE_2=new t.FORMATTER_TYPE(2,"SECOND"),_.FORMATTER_TYPE_3=new t.FORMATTER_TYPE(3,"HOUR_NO_DAY"),_.FORMATTER_TYPE_4=new t.FORMATTER_TYPE(4,"MINUTE_NO_DAY"),_.FORMATTER_TYPE_5=new t.FORMATTER_TYPE(5,"SECOND_NO_DAY"),_.FORMATTER_TYPE_6=new t.FORMATTER_TYPE(6,"PERCENT"),_.List_Jwp=t._setArrayType(e([_.FORMATTER_TYPE_0,_.FORMATTER_TYPE_1,_.FORMATTER_TYPE_2,_.FORMATTER_TYPE_3,_.FORMATTER_TYPE_4,_.FORMATTER_TYPE_5,_.FORMATTER_TYPE_6]),$.JSArray_FORMATTER_TYPE),_.COMPARISON_OPERATOR_9=new t.COMPARISON_OPERATOR(9,"AND"),_.List_LO4=t._setArrayType(e([_.COMPARISON_OPERATOR_0,_.COMPARISON_OPERATOR_1,_.COMPARISON_OPERATOR_2,_.COMPARISON_OPERATOR_3,_.COMPARISON_OPERATOR_4,_.COMPARISON_OPERATOR_5,_.COMPARISON_OPERATOR_6,_.COMPARISON_OPERATOR_7,_.COMPARISON_OPERATOR_8,_.COMPARISON_OPERATOR_9,_.COMPARISON_OPERATOR_10]),$.JSArray_COMPARISON_OPERATOR),_.PERIOD_TYPE_0=new t.PERIOD_TYPE(0,"MTD"),_.List_PERIOD_TYPE_0=t._setArrayType(e([_.PERIOD_TYPE_0]),t.findType("JSArray<PERIOD_TYPE>")),_.SORT_TYPE_0=new t.SORT_TYPE(0,"ASC"),_.SORT_TYPE_1=new t.SORT_TYPE(1,"DESC"),_.List_SORT_TYPE_0_SORT_TYPE_1=t._setArrayType(e([_.SORT_TYPE_0,_.SORT_TYPE_1]),t.findType("JSArray<SORT_TYPE>")),_.SOURCE_TYPE_0=new t.SOURCE_TYPE(0,"MONGODB"),_.SOURCE_TYPE_1=new t.SOURCE_TYPE(1,"COUCHDB"),_.List_SOURCE_TYPE_0_SOURCE_TYPE_1=t._setArrayType(e([_.SOURCE_TYPE_0,_.SOURCE_TYPE_1]),t.findType("JSArray<SOURCE_TYPE>")),_.SCHEMA_NAME_0=new t.SCHEMA_NAME(0,"BILL"),_.SCHEMA_NAME_1=new t.SCHEMA_NAME(1,"COMPLETE_TIME_BILL"),_.SCHEMA_NAME_2=new t.SCHEMA_NAME(2,"BUSINESS"),_.SCHEMA_NAME_3=new t.SCHEMA_NAME(3,"COUNTER"),_.SCHEMA_NAME_4=new t.SCHEMA_NAME(4,"DRAWER"),_.SCHEMA_NAME_5=new t.SCHEMA_NAME(5,"FLATTEN_ITEM"),_.SCHEMA_NAME_6=new t.SCHEMA_NAME(6,"PARENT_FLATTEN_ITEM"),_.SCHEMA_NAME_7=new t.SCHEMA_NAME(7,"ADDON_FLATTEN_ITEM"),_.SCHEMA_NAME_8=new t.SCHEMA_NAME(8,"ITEM"),_.SCHEMA_NAME_9=new t.SCHEMA_NAME(9,"SUB_ITEM"),_.SCHEMA_NAME_10=new t.SCHEMA_NAME(10,"PAYMENT"),_.SCHEMA_NAME_11=new t.SCHEMA_NAME(11,"PAYMENT_TIME_PAYMENT"),_.SCHEMA_NAME_12=new t.SCHEMA_NAME(12,"CHARGE"),_.SCHEMA_NAME_13=new t.SCHEMA_NAME(13,"RECORD"),_.SCHEMA_NAME_14=new t.SCHEMA_NAME(14,"RESTAURANT"),_.SCHEMA_NAME_15=new t.SCHEMA_NAME(15,"RESTAURANT_FEATURE"),_.SCHEMA_NAME_16=new t.SCHEMA_NAME(16,"SLOT"),_.SCHEMA_NAME_17=new t.SCHEMA_NAME(17,"STAFF"),_.SCHEMA_NAME_18=new t.SCHEMA_NAME(18,"TIMESHEET"),_.SCHEMA_NAME_19=new t.SCHEMA_NAME(19,"TIMESHEET_RECORD"),_.SCHEMA_NAME_20=new t.SCHEMA_NAME(20,"ADJUSTMENT"),_.SCHEMA_NAME_21=new t.SCHEMA_NAME(21,"INVENTORY_ADJUSTMENT"),_.SCHEMA_NAME_22=new t.SCHEMA_NAME(22,"INVENTORY_ADJUSTMENT_SKU"),_.SCHEMA_NAME_23=new t.SCHEMA_NAME(23,"INVENTORY_ADJUSTMENT_PHYSICAL_SKU"),_.SCHEMA_NAME_24=new t.SCHEMA_NAME(24,"CLOSING_SKU"),_.SCHEMA_NAME_25=new t.SCHEMA_NAME(25,"CLOSING_DRAFT"),_.SCHEMA_NAME_26=new t.SCHEMA_NAME(26,"CLOSING_DRAFT_SKU"),_.SCHEMA_NAME_27=new t.SCHEMA_NAME(27,"PURCHASE_ORDER"),_.SCHEMA_NAME_28=new t.SCHEMA_NAME(28,"PURCHASE_ORDER_ITEM"),_.SCHEMA_NAME_29=new t.SCHEMA_NAME(29,"PURCHASE_ORDER_DELIVERY_ORDER"),_.SCHEMA_NAME_30=new t.SCHEMA_NAME(30,"PURCHASE_ORDER_DELIVERY_FULFILLMENT"),_.SCHEMA_NAME_31=new t.SCHEMA_NAME(31,"PURCHASE_ORDER_DELIVERY_ORDER_SKU"),_.SCHEMA_NAME_32=new t.SCHEMA_NAME(32,"PURCHASE_ORDER_DELIVERY_FULFILLMENT_SKU"),_.SCHEMA_NAME_33=new t.SCHEMA_NAME(33,"INTERNAL_PURCHASE_ORDER"),_.SCHEMA_NAME_34=new t.SCHEMA_NAME(34,"INTERNAL_PURCHASE_ORDER_ITEM"),_.SCHEMA_NAME_35=new t.SCHEMA_NAME(35,"INTERNAL_PURCHASE_ORDER_DELIVERY_ORDER"),_.SCHEMA_NAME_36=new t.SCHEMA_NAME(36,"INTERNAL_PURCHASE_ORDER_DELIVERY_FULFILLMENT"),_.SCHEMA_NAME_37=new t.SCHEMA_NAME(37,"INTERNAL_PURCHASE_ORDER_DELIVERY_ORDER_SKU"),_.SCHEMA_NAME_38=new t.SCHEMA_NAME(38,"INTERNAL_PURCHASE_ORDER_DELIVERY_FULFILLMENT_SKU"),_.SCHEMA_NAME_39=new t.SCHEMA_NAME(39,"VOUCHER_CLAIM"),_.SCHEMA_NAME_40=new t.SCHEMA_NAME(40,"VOUCHER_CLAIM_REDEMPTION"),_.SCHEMA_NAME_41=new t.SCHEMA_NAME(41,"USER"),_.SCHEMA_NAME_42=new t.SCHEMA_NAME(42,"MEMBER"),_.SCHEMA_NAME_43=new t.SCHEMA_NAME(43,"MEMBER_V2"),_.SCHEMA_NAME_44=new t.SCHEMA_NAME(44,"INVENTORY_WAREHOUSE_LOCATION"),_.SCHEMA_NAME_45=new t.SCHEMA_NAME(45,"INVENTORY_RESTAURANT_LOCATION"),_.SCHEMA_NAME_46=new t.SCHEMA_NAME(46,"MEMBER_STORE_PURCHASE"),_.SCHEMA_NAME_47=new t.SCHEMA_NAME(47,"MEMBER_STORE_PURCHASE_PAYMENT"),_.SCHEMA_NAME_48=new t.SCHEMA_NAME(48,"MEMBER_TITLE"),_.SCHEMA_NAME_49=new t.SCHEMA_NAME(49,"MEMBERSHIP"),_.SCHEMA_NAME_50=new t.SCHEMA_NAME(50,"MEMBERSHIP_TITLE"),_.SCHEMA_NAME_51=new t.SCHEMA_NAME(51,"CREDIT_TRANSACTION"),_.SCHEMA_NAME_52=new t.SCHEMA_NAME(52,"MENU_V3_GROUP"),_.SCHEMA_NAME_53=new t.SCHEMA_NAME(53,"MENU_V4_GROUP"),_.SCHEMA_NAME_54=new t.SCHEMA_NAME(54,"MENU_V3_SKU"),_.SCHEMA_NAME_55=new t.SCHEMA_NAME(55,"MENU_V4_SKU"),_.SCHEMA_NAME_56=new t.SCHEMA_NAME(56,"MENU_V3_ITEM"),_.SCHEMA_NAME_57=new t.SCHEMA_NAME(57,"MENU_V4_ITEM"),_.SCHEMA_NAME_58=new t.SCHEMA_NAME(58,"MENU_V4_CATALOG_ITEM"),_.SCHEMA_NAME_59=new t.SCHEMA_NAME(59,"STOCK"),_.SCHEMA_NAME_60=new t.SCHEMA_NAME(60,"REVIEW"),_.SCHEMA_NAME_61=new t.SCHEMA_NAME(61,"CAMPAIGN"),_.SCHEMA_NAME_62=new t.SCHEMA_NAME(62,"COLLECTIBLE_CONFIG"),_.SCHEMA_NAME_63=new t.SCHEMA_NAME(63,"COLLECTIBLE_TRANSACTION"),_.SCHEMA_NAME_64=new t.SCHEMA_NAME(64,"CAMPAIGN_TIER"),_.SCHEMA_NAME_65=new t.SCHEMA_NAME(65,"STORE_TRANSACTION"),_.SCHEMA_NAME_66=new t.SCHEMA_NAME(66,"STORE_BUNDLE"),_.SCHEMA_NAME_67=new t.SCHEMA_NAME(67,"COLLECTIBLE_COLLECTION"),_.SCHEMA_NAME_68=new t.SCHEMA_NAME(68,"KITCHEN_STATION"),_.SCHEMA_NAME_69=new t.SCHEMA_NAME(69,"REFUND_BILL"),_.SCHEMA_NAME_70=new t.SCHEMA_NAME(70,"MENU_V4_ITEM_INVENTORY_BINDING"),_.SCHEMA_NAME_71=new t.SCHEMA_NAME(71,"INVENTORY_V1_FLATTEN_INVENTORY"),_.SCHEMA_NAME_72=new t.SCHEMA_NAME(72,"ITEM_MOVEMENT"),_.SCHEMA_NAME_73=new t.SCHEMA_NAME(73,"UNIT_COST_HISTORY"),_.SCHEMA_NAME_74=new t.SCHEMA_NAME(74,"DS_BILL_ITEM"),_.SCHEMA_NAME_75=new t.SCHEMA_NAME(75,"DS_MENU_PRODUCT"),_.SCHEMA_NAME_76=new t.SCHEMA_NAME(76,"DS_MENU_PRODUCT_2"),_.SCHEMA_NAME_77=new t.SCHEMA_NAME(77,"DS_BILL_ITEM_PRODUCT"),_.SCHEMA_NAME_78=new t.SCHEMA_NAME(78,"RECOMMENDATION_CALL"),_.List_W7J=t._setArrayType(e([_.SCHEMA_NAME_0,_.SCHEMA_NAME_1,_.SCHEMA_NAME_2,_.SCHEMA_NAME_3,_.SCHEMA_NAME_4,_.SCHEMA_NAME_5,_.SCHEMA_NAME_6,_.SCHEMA_NAME_7,_.SCHEMA_NAME_8,_.SCHEMA_NAME_9,_.SCHEMA_NAME_10,_.SCHEMA_NAME_11,_.SCHEMA_NAME_12,_.SCHEMA_NAME_13,_.SCHEMA_NAME_14,_.SCHEMA_NAME_15,_.SCHEMA_NAME_16,_.SCHEMA_NAME_17,_.SCHEMA_NAME_18,_.SCHEMA_NAME_19,_.SCHEMA_NAME_20,_.SCHEMA_NAME_21,_.SCHEMA_NAME_22,_.SCHEMA_NAME_23,_.SCHEMA_NAME_24,_.SCHEMA_NAME_25,_.SCHEMA_NAME_26,_.SCHEMA_NAME_27,_.SCHEMA_NAME_28,_.SCHEMA_NAME_29,_.SCHEMA_NAME_30,_.SCHEMA_NAME_31,_.SCHEMA_NAME_32,_.SCHEMA_NAME_33,_.SCHEMA_NAME_34,_.SCHEMA_NAME_35,_.SCHEMA_NAME_36,_.SCHEMA_NAME_37,_.SCHEMA_NAME_38,_.SCHEMA_NAME_39,_.SCHEMA_NAME_40,_.SCHEMA_NAME_41,_.SCHEMA_NAME_42,_.SCHEMA_NAME_43,_.SCHEMA_NAME_44,_.SCHEMA_NAME_45,_.SCHEMA_NAME_46,_.SCHEMA_NAME_47,_.SCHEMA_NAME_48,_.SCHEMA_NAME_49,_.SCHEMA_NAME_50,_.SCHEMA_NAME_51,_.SCHEMA_NAME_52,_.SCHEMA_NAME_53,_.SCHEMA_NAME_54,_.SCHEMA_NAME_55,_.SCHEMA_NAME_56,_.SCHEMA_NAME_57,_.SCHEMA_NAME_58,_.SCHEMA_NAME_59,_.SCHEMA_NAME_60,_.SCHEMA_NAME_61,_.SCHEMA_NAME_62,_.SCHEMA_NAME_63,_.SCHEMA_NAME_64,_.SCHEMA_NAME_65,_.SCHEMA_NAME_66,_.SCHEMA_NAME_67,_.SCHEMA_NAME_68,_.SCHEMA_NAME_69,_.SCHEMA_NAME_70,_.SCHEMA_NAME_71,_.SCHEMA_NAME_72,_.SCHEMA_NAME_73,_.SCHEMA_NAME_74,_.SCHEMA_NAME_75,_.SCHEMA_NAME_76,_.SCHEMA_NAME_77,_.SCHEMA_NAME_78]),t.findType("JSArray<SCHEMA_NAME>")),_.ChartType_0=new t.ChartType(0,"CIRCULAR"),_.ChartType_1=new t.ChartType(1,"TABLE"),_.ChartType_2=new t.ChartType(2,"LIST"),_.ChartType_3=new t.ChartType(3,"SCORECARD"),_.ChartType_4=new t.ChartType(4,"LINECHART"),_.ChartType_5=new t.ChartType(5,"BARCHART"),_.ChartType_6=new t.ChartType(6,"COLUMNCHART"),_.ChartType_7=new t.ChartType(7,"STACKLINECHART"),_.ChartType_8=new t.ChartType(8,"STACKBARCHART"),_.ChartType_9=new t.ChartType(9,"STACKCOLUMNCHART"),_.ChartType_10=new t.ChartType(10,"SPACER"),_.List_Y9v=t._setArrayType(e([_.ChartType_0,_.ChartType_1,_.ChartType_2,_.ChartType_3,_.ChartType_4,_.ChartType_5,_.ChartType_6,_.ChartType_7,_.ChartType_8,_.ChartType_9,_.ChartType_10]),t.findType("JSArray<ChartType>")),_.List_cIc=t._setArrayType(e(["January","February","March","April","May","June","July","August","September","October","November","December"]),$.JSArray_String),_.TIME_FORMATTER_0=new t.TIME_FORMATTER(0,"HOUR"),_.TIME_FORMATTER_1=new t.TIME_FORMATTER(1,"MINUTE"),_.TIME_FORMATTER_2=new t.TIME_FORMATTER(2,"SECOND"),_.TIME_FORMATTER_3=new t.TIME_FORMATTER(3,"HOUR_NO_DAY"),_.TIME_FORMATTER_4=new t.TIME_FORMATTER(4,"MINUTE_NO_DAY"),_.TIME_FORMATTER_5=new t.TIME_FORMATTER(5,"SECOND_NO_DAY"),_.List_cWd=t._setArrayType(e([_.TIME_FORMATTER_0,_.TIME_FORMATTER_1,_.TIME_FORMATTER_2,_.TIME_FORMATTER_3,_.TIME_FORMATTER_4,_.TIME_FORMATTER_5]),$.JSArray_TIME_FORMATTER),_.List_empty1=t._setArrayType(e([]),$.JSArray_QueryRequestDimension),_.List_empty0=t._setArrayType(e([]),$.JSArray_QueryRequestFilter),_.List_empty=t._setArrayType(e([]),$.JSArray_String),_.List_empty2=t._setArrayType(e([]),$.JSArray_dynamic),_.List_gc6=t._setArrayType(e(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),$.JSArray_String),_.List_h8w=t._setArrayType(e(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),$.JSArray_String),_.List_jvJ=t._setArrayType(e([_.AGGREGATION_TYPE_0,_.AGGREGATION_TYPE_1,_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3,_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5,_.AGGREGATION_TYPE_6,_.AGGREGATION_TYPE_7,_.AGGREGATION_TYPE_8,_.AGGREGATION_TYPE_9,_.AGGREGATION_TYPE_10,_.AGGREGATION_TYPE_11,_.AGGREGATION_TYPE_12]),$.JSArray_AGGREGATION_TYPE),_.List_k6a=t._setArrayType(e([_.DATA_TYPE_0,_.DATA_TYPE_1,_.DATA_TYPE_2,_.DATA_TYPE_3]),$.JSArray_DATA_TYPE),_.List_mC8=t._setArrayType(e([0,31,28,31,30,31,30,31,31,30,31,30,31]),$.JSArray_int),_.List_qpm=t._setArrayType(e(["J","F","M","A","M","J","J","A","S","O","N","D"]),$.JSArray_String),_.List_wMy=t._setArrayType(e(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]),$.JSArray_String),_.PermissionType_0=new t.PermissionType(0,"restaurant"),_.PermissionType_1=new t.PermissionType(1,"warehouse"),_.PermissionType_2=new t.PermissionType(2,"business"),_.List_wsa=t._setArrayType(e([_.PermissionType_0,_.PermissionType_1,_.PermissionType_2]),t.findType("JSArray<PermissionType>")),_.List_yRY=t._setArrayType(e([_.DIMENSION_OPTION_0,_.DIMENSION_OPTION_1,_.DIMENSION_OPTION_2,_.DIMENSION_OPTION_3,_.DIMENSION_OPTION_4,_.DIMENSION_OPTION_5,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9,_.DIMENSION_OPTION_10,_.DIMENSION_OPTION_11]),$.JSArray_DIMENSION_OPTION),_.List_EQM=t._setArrayType(e(["d","E","EEEE","LLL","LLLL","M","Md","MEd","MMM","MMMd","MMMEd","MMMM","MMMMd","MMMMEEEEd","QQQ","QQQQ","y","yM","yMd","yMEd","yMMM","yMMMd","yMMMEd","yMMMM","yMMMMd","yMMMMEEEEd","yQQQ","yQQQQ","H","Hm","Hms","j","jm","jms","jmv","jmz","jz","m","ms","s","v","z","zzzz","ZZZZ"]),$.JSArray_String),_.Map_EQ6TW=new t.ConstantStringMap(44,{d:"d",E:"ccc",EEEE:"cccc",LLL:"LLL",LLLL:"LLLL",M:"L",Md:"M/d",MEd:"EEE, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"EEE, MMM d",MMMM:"LLLL",MMMMd:"MMMM d",MMMMEEEEd:"EEEE, MMMM d",QQQ:"QQQ",QQQQ:"QQQQ",y:"y",yM:"M/y",yMd:"M/d/y",yMEd:"EEE, M/d/y",yMMM:"MMM y",yMMMd:"MMM d, y",yMMMEd:"EEE, MMM d, y",yMMMM:"MMMM y",yMMMMd:"MMMM d, y",yMMMMEEEEd:"EEEE, MMMM d, y",yQQQ:"QQQ y",yQQQQ:"QQQQ y",H:"HH",Hm:"HH:mm",Hms:"HH:mm:ss",j:"h a",jm:"h:mm a",jms:"h:mm:ss a",jmv:"h:mm a v",jmz:"h:mm a z",jz:"h a z",m:"m",ms:"mm:ss",s:"s",v:"v",z:"z",zzzz:"zzzz",ZZZZ:"ZZZZ"},_.List_EQM,t.findType("ConstantStringMap<String,String>")),_.List_empty3=t._setArrayType(e([]),t.findType("JSArray<Symbol0>")),_.Map_empty=new t.ConstantStringMap(0,{},_.List_empty3,t.findType("ConstantStringMap<Symbol0,@>")),_.StartOfWeek_0=new t.StartOfWeek(0,"SATURDAY"),_.StartOfWeek_1=new t.StartOfWeek(1,"SUNDAY"),_.StartOfWeek_2=new t.StartOfWeek(2,"MONDAY"),_.Symbol_call=new t.Symbol("call"),_.TimeZone_0_false_UTC=new t.TimeZone(0,!1,"UTC"),_.Type_Object_xQ6=t.typeLiteral("Object"),_.TzInstant_ww8=new t.TzInstant(_.TimeZone_0_false_UTC,-864e13,864e13),_.Units_3=new t.Units(3,"HOUR"),_.Units_4=new t.Units(4,"DAY"),_.Units_5=new t.Units(5,"WEEK"),_.Units_6=new t.Units(6,"MONTH"),_.Units_7=new t.Units(7,"YEAR"),_._IterationMarker_null_2=new t._IterationMarker(null,2)})(),function(){E._JS_INTEROP_INTERCEPTOR_TAG=null,E.Primitives__identityHashCodeProperty=null,E.BoundClosure__receiverFieldNameCache=null,E.BoundClosure__interceptorFieldNameCache=null,E.getTagFunction=null,E.alternateTagFunction=null,E.prototypeForTagFunction=null,E.dispatchRecordsForInstanceTags=null,E.interceptorsForUncacheableTags=null,E.initNativeDispatchFlag=null,E._toStringVisiting=t._setArrayType([],t.findType("JSArray<Object>")),E.cachedDateSymbols=null,E.lastDateSymbolLocale=null,E._defaultLocale=null,E.DateFormat__useNativeDigitsByDefault=t.LinkedHashMap_LinkedHashMap$_empty($.String,$.bool),E.DateFormat__digitMatchers=t.LinkedHashMap_LinkedHashMap$_empty($.String,t.findType("RegExp")),E.Jiffy____defaultLocale=t._Cell$(),E.VisualizationField__filterDimensionOptions=t._setArrayType([_.DIMENSION_OPTION_5,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9],$.JSArray_DIMENSION_OPTION),E.VisualizationField__fillGapDimensionOptions=t._setArrayType([_.DIMENSION_OPTION_1,_.DIMENSION_OPTION_2,_.DIMENSION_OPTION_3,_.DIMENSION_OPTION_4,_.DIMENSION_OPTION_6,_.DIMENSION_OPTION_7,_.DIMENSION_OPTION_8,_.DIMENSION_OPTION_9,_.DIMENSION_OPTION_10,_.DIMENSION_OPTION_11],$.JSArray_DIMENSION_OPTION),E.VisualizationField__isNumericAggregations=t._setArrayType([_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3],$.JSArray_AGGREGATION_TYPE),E.___local=t._Cell$()}(),function(){var e=X.lazyFinal,i=X.lazy;e(E,"DART_CLOSURE_PROPERTY_NAME","$get$DART_CLOSURE_PROPERTY_NAME",()=>t.getIsolateAffinityTag("_$dart_dartClosure")),e(E,"TypeErrorDecoder_noSuchMethodPattern","$get$TypeErrorDecoder_noSuchMethodPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn({toString:function(){return"$receiver$"}}))),e(E,"TypeErrorDecoder_notClosurePattern","$get$TypeErrorDecoder_notClosurePattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn({$method$:null,toString:function(){return"$receiver$"}}))),e(E,"TypeErrorDecoder_nullCallPattern","$get$TypeErrorDecoder_nullCallPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn(null))),e(E,"TypeErrorDecoder_nullLiteralCallPattern","$get$TypeErrorDecoder_nullLiteralCallPattern",()=>t.TypeErrorDecoder_extractPattern(function(){var n="$arguments$";try{null.$method$(n)}catch(a){return a.message}}())),e(E,"TypeErrorDecoder_undefinedCallPattern","$get$TypeErrorDecoder_undefinedCallPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokeCallErrorOn(void 0))),e(E,"TypeErrorDecoder_undefinedLiteralCallPattern","$get$TypeErrorDecoder_undefinedLiteralCallPattern",()=>t.TypeErrorDecoder_extractPattern(function(){var n="$arguments$";try{(void 0).$method$(n)}catch(a){return a.message}}())),e(E,"TypeErrorDecoder_nullPropertyPattern","$get$TypeErrorDecoder_nullPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokePropertyErrorOn(null))),e(E,"TypeErrorDecoder_nullLiteralPropertyPattern","$get$TypeErrorDecoder_nullLiteralPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(function(){try{null.$method$}catch(n){return n.message}}())),e(E,"TypeErrorDecoder_undefinedPropertyPattern","$get$TypeErrorDecoder_undefinedPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(t.TypeErrorDecoder_provokePropertyErrorOn(void 0))),e(E,"TypeErrorDecoder_undefinedLiteralPropertyPattern","$get$TypeErrorDecoder_undefinedLiteralPropertyPattern",()=>t.TypeErrorDecoder_extractPattern(function(){try{(void 0).$method$}catch(n){return n.message}}())),e(E,"DateTime__parseFormat","$get$DateTime__parseFormat",()=>t.RegExp_RegExp("^([+-]?\\d{4,6})-?(\\d\\d)-?(\\d\\d)(?:[ T](\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d+))?)?)?( ?[zZ]| ?([-+])(\\d\\d)(?::?(\\d\\d))?)?)?$",!1)),e(E,"_hashSeed","$get$_hashSeed",()=>t.objectHashCode(_.Type_Object_xQ6)),e(E,"Endian_host","$get$Endian_host",()=>t.NativeByteData_NativeByteData$view(t.NativeUint16List_NativeUint16List$fromList(t._setArrayType([1],$.JSArray_int)).buffer,0,null).getInt8(0)===1?_.C_Endian0:_.C_Endian),e(E,"_clockKey","$get$_clockKey",()=>new t.Object),e(E,"en_USSymbols","$get$en_USSymbols",()=>new t.DateSymbols("en_US",_.List_BC_AD,_.List_6xs,_.List_qpm,_.List_qpm,_.List_cIc,_.List_cIc,_.List_h8w,_.List_h8w,_.List_wMy,_.List_wMy,_.List_gc6,_.List_gc6,_.List_3US,_.List_AM_PM)),i(E,"_dateTimeSymbols","$get$_dateTimeSymbols",()=>t.UninitializedLocaleData$("initializeDateFormatting(<locale>)",E.$get$en_USSymbols())),i(E,"dateTimePatterns","$get$dateTimePatterns",()=>t.UninitializedLocaleData$("initializeDateFormatting(<locale>)",_.Map_EQ6TW)),e(E,"asciiZeroCodeUnit","$get$asciiZeroCodeUnit",()=>48),e(E,"DateFormat__matchers","$get$DateFormat__matchers",()=>t._setArrayType([t.RegExp_RegExp("^'(?:[^']|'')*'",!1),t.RegExp_RegExp("^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|D+|m+|s+|v+|z+|Z+)",!1),t.RegExp_RegExp("^[^'GyMkSEahKHcLQdDmsvzZ]+",!1)],t.findType("JSArray<RegExp>"))),e(E,"_DateFormatQuotedField__twoEscapedQuotes","$get$_DateFormatQuotedField__twoEscapedQuotes",()=>t.RegExp_RegExp("''",!1)),e(E,"asciiDigitMatcher","$get$asciiDigitMatcher",()=>t.RegExp_RegExp("^\\d+",!1)),i(E,"_availableLocales","$get$_availableLocales",()=>{var n,a,s=t.EnLocale$(_.StartOfWeek_1),o=t.EnLocale$(_.StartOfWeek_1),l=t.EnLocale$(_.StartOfWeek_1),D=t.EnLocale$(_.StartOfWeek_1),d=t.EnLocale$(_.StartOfWeek_1),c=t.EnLocale$(_.StartOfWeek_2),p=t.EnLocale$(_.StartOfWeek_2),y=t.EnLocale$(_.StartOfWeek_1),g=t.EnLocale$(_.StartOfWeek_1),m=t.EsLocale$(_.StartOfWeek_2),h=t.EsLocale$(_.StartOfWeek_2),S=t.EsLocale$(_.StartOfWeek_1),T=t.FrLocale$(_.StartOfWeek_2),b=t.FrLocale$(_.StartOfWeek_2),F=t.FrLocale$(_.StartOfWeek_1),M=t.ZhCnLocale$(_.StartOfWeek_1),I=t.ZhCnLocale$(_.StartOfWeek_1),x=t.ZhLocale$(_.StartOfWeek_1),R=t.ZhLocale$(_.StartOfWeek_1),L=t.DeLocale$(_.StartOfWeek_2),O=t.DeLocale$(_.StartOfWeek_2),v=t.DeLocale$(_.StartOfWeek_2),z=t.DeLocale$(_.StartOfWeek_2),c0=t.ItLocale$(_.StartOfWeek_2),p0=t.ItLocale$(_.StartOfWeek_2),f0=t.ArLyLocale$(!0,_.StartOfWeek_0),$0=t.ArLyLocale$(!1,_.StartOfWeek_0),y0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_1),g0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_1),h0=t.ArSaMaDzKwTnLocale$(!0,_.StartOfWeek_1),E0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_0),S0=t.ArSaMaDzKwTnLocale$(!1,_.StartOfWeek_0);return t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),n=t.PtLocale$(_.StartOfWeek_2),a=t.PtLocale$(_.StartOfWeek_1),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.createSentinel(),t.LinkedHashMap_LinkedHashMap$_literal(["en",s,"en_us",o,"en_sg",l,"en_au",D,"en_ca",d,"en_gb",c,"en_ie",p,"en_il",y,"en_nz",g,"es",m,"es_do",h,"es_us",S,"fr",T,"fr_ch",b,"fr_ca",F,"zh",M,"zh_cn",I,"zh_hk",x,"zh_tw",R,"de",L,"de_de",O,"de_at",v,"de_ch",z,"it",c0,"it_ch",p0,"ar",f0,"ar_ly",$0,"ar_dz",y0,"ar_kw",g0,"ar_sa",h0,"ar_ma",E0,"ar_tn",S0,"az",new t.AzLocale,"id",new t.IdLocale,"ja",new t.JaLocale,"ko",new t.KoLocale,"ru",new t.RuLocale,"uk",new t.UkLocale,"hi",new t.HiLocale,"pt",n,"pt_br",a,"pl",new t.PlLocale,"tr",new t.TrLocale,"sv",new t.SvLocale,"nb",new t.NbLocale,"fa",new t.FaLocale,"bn",new t.BnLocale,"nl",new t.NlLocale,"th",new t.ThLocale],$.String,t.findType("Locale"))}),e(E,"addonFlattenItemSchema","$get$addonFlattenItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("",""),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),a,new t.addonFlattenItemSchema_closure,_.List_empty0,a,a,!0,!1,!1,!0,!1,new t.addonFlattenItemSchema_closure0,"Addon","flatten_items","flatten_item",_.SCHEMA_NAME_7,n,"",s,o)}),e(E,"adjustmentSchema","$get$adjustmentSchema",()=>{var n="adjustment",a="adjustments",s="createdAt",o=null,l=t.Source_Source$couchdb(a,n),D=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),s),d=$.JSArray_String,c=t._setArrayType([t.Index$(t._setArrayType(["id"],d),o,o),t.Index$(t._setArrayType(["doc_id"],d),o,o),t.Index$(t._setArrayType(["restaurant_id","created_at"],d),"idx_adjustments_select_index",o),t.Index$(t._setArrayType(["item_id"],d),o,o),t.Index$(t._setArrayType(["bill_id"],d),o,o),t.Index$(t._setArrayType(["published_at"],d),o,o)],$.JSArray_Index),p=t._setArrayType(["restaurantId"],d);return t.Schema_Schema$build("sales",t._setArrayType(["discount","adjustment","promo","promotion","offer"],d),2,p,o,new t.adjustmentSchema_closure,_.List_empty0,c,o,!1,!0,!1,!1,!1,new t.adjustmentSchema_closure0,"Discount",a,n,_.SCHEMA_NAME_20,s,"couchdb_bill",l,D)}),e(E,"billSchema","$get$billSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_bills_select_index",n),t.Index$(t._setArrayType(["member_id"],l),n,n),t.Index$(t._setArrayType(["member_user_id"],l),n,n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id","completed_at"],l),"idx_complete_time_bills_select_index",n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["bill","order","transaction","receipt","customer","table","dine in","takeaway","total amount"],l),1,d,n,new t.billSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.billSchema_closure0,"Bill","bills","bill",_.SCHEMA_NAME_0,a,"couchdb_bill",s,o)}),e(E,"businessSchema","$get$businessSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Businesses"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("id")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.businessSchema_closure,_.List_empty0,l,n,!1,!0,!1,!1,!1,new t.businessSchema_closure0,"Business","businesses","business",_.SCHEMA_NAME_2,n,"mongodb_businesses",a,s)}),e(E,"campaignSchema","$get$campaignSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Campaigns"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n),t.Index$(t._setArrayType(["collectible_id"],o),n,n)],$.JSArray_Index),D=t._setArrayType([],o);return t.Schema_Schema$build("loyalty",t._setArrayType(["campaign","promotion campaign","marketing"],o),2,D,n,new t.campaignSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.campaignSchema_closure0,"Campaign","campaigns","campaign",_.SCHEMA_NAME_61,n,"mongodb_marketing_db_campaigns",a,s)}),e(E,"campaignTierSchema","$get$campaignTierSchema",()=>{var n=null,a=t.Source_Source$mongodb("tiers","Campaigns"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.campaignTierSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.campaignTierSchema_closure0,"Campaign tier","campaign_tiers","campaign_tier",_.SCHEMA_NAME_64,n,"mongodb_marketing_db_campaigns",a,s)}),e(E,"chargeSchema","$get$chargeSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("charges","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_charges_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["parent_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["charge","service charge","tax","gst","sst","fee"],l),2,d,a,new t.chargeSchema_closure,_.List_empty0,D,900,!1,!0,!1,!1,!1,new t.chargeSchema_closure0,"Charge","charges","charge",_.SCHEMA_NAME_12,n,"couchdb_bill",s,o)}),e(E,"closingDraftSchema","$get$closingDraftSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"closingDraft"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_closing_draft_select_index",n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["closing_adjustment_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),`select *
|
|
91
|
+
from (
|
|
92
|
+
select
|
|
93
|
+
*,
|
|
94
|
+
to_char(
|
|
95
|
+
(
|
|
96
|
+
substring(id from 'closingDraft_([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:.]+Z)')::timestamptz
|
|
97
|
+
at time zone @TIMEZONE
|
|
98
|
+
)::date,
|
|
99
|
+
'YYYYMMDD'
|
|
100
|
+
)
|
|
101
|
+
|| '-'
|
|
102
|
+
|| lpad(
|
|
103
|
+
row_number() over (
|
|
104
|
+
partition by
|
|
105
|
+
location_id,
|
|
106
|
+
(
|
|
107
|
+
substring(id from 'closingDraft_([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:.]+Z)')::timestamptz
|
|
108
|
+
at time zone @TIMEZONE
|
|
109
|
+
)::date
|
|
110
|
+
order by
|
|
111
|
+
substring(id from 'closingDraft_([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:.]+Z)')::timestamptz,
|
|
112
|
+
id
|
|
113
|
+
)::text,
|
|
114
|
+
4,
|
|
115
|
+
'0'
|
|
116
|
+
) as formatted_id
|
|
117
|
+
from closing_drafts
|
|
118
|
+
) t
|
|
119
|
+
`,new t.closingDraftSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.closingDraftSchema_closure0,"Closing draft","closing_drafts","closing_draft",_.SCHEMA_NAME_25,a,"couchdb_closing_draft",s,o)}),e(E,"closingDraftSkuSchema","$get$closingDraftSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","closingDraft"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_cds_select_index",a),t.Index$(t._setArrayType(["closing_adjustment_id","sku_id"],l),"idx_cds_closing_sku_index",a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.closingDraftSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!0,!0,new t.closingDraftSkuSchema_closure0,"Closing draft sku","closing_draft_skus","closing_draft_sku",_.SCHEMA_NAME_26,n,"couchdb_closing_draft",s,o)}),e(E,"closingSkuSchema","$get$closingSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","closing"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["closing","stock take","physical count","stocktake"],l),2,d,a,new t.closingSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.closingSkuSchema_closure0,"Closing sku","closing_skus","closing_sku",_.SCHEMA_NAME_24,n,"couchdb_closing",s,o)}),e(E,"collectibleCollectionSchema","$get$collectibleCollectionSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$mongodb(n,"Collections"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["business_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],l),n,new t.collectibleCollectionSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.collectibleCollectionSchema_closure0,"Collectible collection","collectible_collections","collectible_collection",_.SCHEMA_NAME_67,a,"mongodb_marketing_db_collections",s,o)}),e(E,"collectibleConfigSchema","$get$collectibleConfigSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"CollectibleConfigs"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["created_at"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.collectibleConfigSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.collectibleConfigSchema_closure0,"Collectible config","collectible_configs","collectible_config",_.SCHEMA_NAME_62,n,"mongodb_marketing_db_collectible_configs",a,s)}),e(E,"collectibleTransactionSchema","$get$collectibleTransactionSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$mongodb("amounts","Transactions"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["business_id"],l),a,a),t.Index$(t._setArrayType(["collection_id"],l),a,a),t.Index$(t._setArrayType(["business_id","created_at"],l),"idx_collectible_transactions_select_index",a),t.Index$(t._setArrayType(["ref_id"],l),a,a),t.Index$(t._setArrayType(["user_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType([],l),a,new t.collectibleTransactionSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.collectibleTransactionSchema_closure0,"Collectible transaction","collectible_transactions","collectible_transaction",_.SCHEMA_NAME_63,n,"mongodb_marketing_db_transactions",s,o)}),e(E,"completeTimeBillSchema","$get$completeTimeBillSchema",()=>{var n=null,a=t.Source_Source$couchdb(n,""),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),"completedAt");return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),n,new t.completeTimeBillSchema_closure,_.List_empty0,n,n,!0,!1,!1,!1,!1,new t.completeTimeBillSchema_closure0,"Bill (Complete time)","bills","bill",_.SCHEMA_NAME_1,"createdAt","",a,s)}),e(E,"counterSchema","$get$counterSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"counter"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("operations",t._setArrayType(["counter","pos","terminal","register"],l),2,d,n,new t.counterSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.counterSchema_closure0,"Counter","counters","counter",_.SCHEMA_NAME_3,a,"couchdb_counter",s,o)}),e(E,"creditTransactionSchema","$get$creditTransactionSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$mongodb(n,"CreditTransactions"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId"),t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n),t.Index$(t._setArrayType(["business_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("loyalty",t._setArrayType(["credit","point","reward point","loyalty point"],l),2,d,n,new t.creditTransactionSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.creditTransactionSchema_closure0,"Credit transaction","credit_transactions","credit_transaction",_.SCHEMA_NAME_51,a,"mongodb_credit_transactions",s,o)}),e(E,"drawerSchema","$get$drawerSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"drawer"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("operations",t._setArrayType(["drawer","cash drawer","float","petty cash","cash management"],l),2,d,n,new t.drawerSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.drawerSchema_closure0,"Drawer","drawers","drawer",_.SCHEMA_NAME_4,a,"couchdb_drawer",s,o)}),e(E,"flattenItemSchema","$get$flattenItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("flattenItems","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_flatten_items_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["parent_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("sales",t._setArrayType(["sales","revenue","sold","item sold","product sold","quantity","grabfood","foodpanda","delivery","online order","platform","channel","order type"],l),1,d,a,new t.flattenItemSchema_closure,_.List_empty0,D,a,!1,!0,!1,!1,!1,new t.flattenItemSchema_closure0,"Product","flatten_items","flatten_item",_.SCHEMA_NAME_5,n,"couchdb_bill",s,o)}),e(E,"defaultSchemas","$get$defaultSchemas",()=>t._setArrayType([E.$get$billSchema(),E.$get$completeTimeBillSchema(),E.$get$counterSchema(),E.$get$drawerSchema(),E.$get$flattenItemSchema(),E.$get$addonFlattenItemSchema(),E.$get$parentFlattenItemSchema(),E.$get$itemSchema(),E.$get$subItemSchema(),E.$get$paymentSchema(),E.$get$chargeSchema(),E.$get$paymentTimePaymentSchema(),E.$get$recordSchema(),E.$get$slotSchema(),E.$get$staffSchema(),E.$get$timesheetSchema(),E.$get$adjustmentSchema(),E.$get$inventoryAdjustmentSchema(),E.$get$inventoryAdjustmentSkuSchema(),E.$get$internalPurchaseOrderSchema(),E.$get$internalPurchaseOrderItemSchema(),E.$get$internalPurchaseOrderDeliveryOrderSchema(),E.$get$internalPurchaseOrderDeliveryOrderSkuSchema(),E.$get$internalPurchaseOrderDeliveryFulfillmentSchema(),E.$get$internalPurchaseOrderDeliveryFulfillmentSkuSchema(),E.$get$purchaseOrderSchema(),E.$get$purchaseOrderItemSchema(),E.$get$purchaseOrderDeliveryOrderSchema(),E.$get$purchaseOrderDeliveryOrderSkuSchema(),E.$get$purchaseOrderDeliveryFulfillmentSchema(),E.$get$purchaseOrderDeliveryFulfillmentSkuSchema(),E.$get$restaurantSchema(),E.$get$restaurantFeatureSchema(),E.$get$businessSchema(),E.$get$userSchema(),E.$get$voucherClaimSchema(),E.$get$voucherClaimRedemptionSchema(),E.$get$restaurantLocationSchema(),E.$get$warehouseLocationSchema(),E.$get$memberSchema(),E.$get$memberV2Schema(),E.$get$memberStorePurchaseSchema(),E.$get$memberStorePurchasePaymentSchema(),E.$get$membershipSchema(),E.$get$membershipTitleSchema(),E.$get$memberTitleSchema(),E.$get$menuV3GroupSchema(),E.$get$menuV4GroupSchema(),E.$get$menuV3SkuSchema(),E.$get$menuV4SkuSchema(),E.$get$menuV3ItemSchema(),E.$get$menuV4ItemSchema(),E.$get$menuV4CatalogItemSchema(),E.$get$creditTransactionSchema(),E.$get$stockSchema(),E.$get$recommendationCallSchema(),E.$get$reviewSchema(),E.$get$campaignSchema(),E.$get$collectibleConfigSchema(),E.$get$collectibleTransactionSchema(),E.$get$campaignTierSchema(),E.$get$storeTransactionSchema(),E.$get$storeBundleSchema(),E.$get$collectibleCollectionSchema(),E.$get$kitchenStationSchema(),E.$get$refundBillSchema(),E.$get$timesheetRecordSchema(),E.$get$inventoryAdjustmentPhysicalSkuSchema(),E.$get$menuV4ItemInventoryBindingSchema(),E.$get$inventoryV1FlattenInventorySchema(),E.$get$itemMovementSchema(),E.$get$closingSkuSchema(),E.$get$closingDraftSchema(),E.$get$closingDraftSkuSchema(),E.$get$unitCostHistorySchema()],t.findType("JSArray<Schema>"))),e(E,"internalPurchaseOrderSchema","$get$internalPurchaseOrderSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["effective_at"],l),n,n),t.Index$(t._setArrayType(["location_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),n,new t.internalPurchaseOrderSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!0,new t.internalPurchaseOrderSchema_closure0,"Purchase order","purchase_orders","purchase_order",_.SCHEMA_NAME_33,a,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryFulfillmentSchema","$get$internalPurchaseOrderDeliveryFulfillmentSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryFulfillments","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryFulfillmentSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0,"Purchase order delivery fulfillment","purchase_order_delivery_fulfillments","purchase_order_delivery_fulfillment",_.SCHEMA_NAME_36,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryFulfillmentSkuSchema","$get$internalPurchaseOrderDeliveryFulfillmentSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryFulfillmentSkus","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_delivery_fulfillment_id"],l),A.idx_pof,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0,"Purchase order delivery fulfillment sku","purchase_order_delivery_fulfillment_skus","purchase_order_delivery_fulfillment_sku",_.SCHEMA_NAME_38,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryOrderSchema","$get$internalPurchaseOrderDeliveryOrderSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryOrders","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryOrderSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryOrderSchema_closure0,"Purchase order delivery order","purchase_order_delivery_orders","purchase_order_delivery_order",_.SCHEMA_NAME_35,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderDeliveryOrderSkuSchema","$get$internalPurchaseOrderDeliveryOrderSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("deliveryOrderSkus","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["purchase_order_delivery_order_id"],l),A.idx_poo,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderDeliveryOrderSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0,"Purchase order delivery order sku","purchase_order_delivery_order_skus","purchase_order_delivery_order_sku",_.SCHEMA_NAME_37,n,"couchdb_purchase_order",s,o)}),e(E,"internalPurchaseOrderItemSchema","$get$internalPurchaseOrderItemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("items","purchaseOrder"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["effective_at"],l),a,a),t.Index$(t._setArrayType(["purchase_order_id"],l),a,a),t.Index$(t._setArrayType(["location_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.internalPurchaseOrderItemSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!0,new t.internalPurchaseOrderItemSchema_closure0,"Purchase order item","purchase_order_items","purchase_order_item",_.SCHEMA_NAME_34,n,"couchdb_purchase_order",s,o)}),e(E,"inventoryAdjustmentSchema","$get$inventoryAdjustmentSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_ias_select_index",n),t.Index$(t._setArrayType(["published_at"],l),n,n),t.Index$(t._setArrayType(["ref"],l),n,n)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build(n,t._setArrayType(["stock","inventory","stock adjustment","available stock","stock balance"],l),2,d,n,new t.inventoryAdjustmentSchema_closure,_.List_empty0,D,n,!1,!0,!1,!1,!1,new t.inventoryAdjustmentSchema_closure0,"Inventory","inventory_adjustments","inventory_adjustment",_.SCHEMA_NAME_21,a,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryAdjustmentPhysicalSkuSchema","$get$inventoryAdjustmentPhysicalSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("physicalSkus","inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["inventory_adjustment_id"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_iapss_select_index",a),t.Index$(t._setArrayType(["inventory_adjustment_sku_id"],l),"idx_iapss_inventory_adjustment_sku_id",a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.inventoryAdjustmentPhysicalSkuSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.inventoryAdjustmentPhysicalSkuSchema_closure0,"Inventory physical sku","inventory_adjustment_physical_skus","inventory_adjustment_physical_sku",_.SCHEMA_NAME_23,n,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryAdjustmentSkuSchema","$get$inventoryAdjustmentSkuSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("skus","inventoryAdjustment"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["location_id","created_at"],l),"idx_iass_select_index",a),t.Index$(t._setArrayType(["published_at"],l),a,a),t.Index$(t._setArrayType(["inventory_adjustment_id"],l),a,a),t.Index$(t._setArrayType(["ref"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["stock","inventory","stock adjustment","available stock","stock balance"],l),2,d,a,new t.inventoryAdjustmentSkuSchema_closure,_.List_empty0,D,a,!1,!0,!1,!1,!1,new t.inventoryAdjustmentSkuSchema_closure0,"Inventory sku","inventory_adjustment_skus","inventory_adjustment_sku",_.SCHEMA_NAME_22,n,"couchdb_inventory_adjustment",s,o)}),e(E,"inventoryV1FlattenInventorySchema","$get$inventoryV1FlattenInventorySchema",()=>{var n=null,a=t.Source_Source$couchdb("flattenInventories","mInventoryV1"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId"),t.Permission_Permission$warehouse("warehouseId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["published_at"],o),n,n),t.Index$(t._setArrayType(["location_id"],o),n,n),t.Index$(t._setArrayType(["link_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],o),n,new t.inventoryV1FlattenInventorySchema_closure,_.List_empty0,l,3600,!0,!0,!1,!1,!0,new t.inventoryV1FlattenInventorySchema_closure0,"Inventory","inventory_flatten_inventories","inventory_flatten_inventory",_.SCHEMA_NAME_71,n,"couchdb_m_inventory_v1",a,s)}),e(E,"itemSchema","$get$itemSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("",""),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],$.JSArray_String),a,new t.itemSchema_closure,t._setArrayType([t.QueryRequestFilter$(a,"layer",_.COMPARISON_OPERATOR_0,a,_.SCHEMA_NAME_8,["0"])],$.JSArray_QueryRequestFilter),a,a,!0,!1,!1,!0,!1,new t.itemSchema_closure0,"Product (Deprecated)","flatten_items","flatten_item",_.SCHEMA_NAME_8,n,"",s,o)}),e(E,"itemMovementSchema","$get$itemMovementSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("itemMovements","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_item_movement_select_index",a),t.Index$(t._setArrayType(["item_id"],l),a,a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["move_from_bill_id"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("inventory",t._setArrayType(["item movement","stock movement","transfer","stock transfer"],l),2,d,a,new t.itemMovementSchema_closure,_.List_empty0,D,600,!0,!0,!1,!1,!1,new t.itemMovementSchema_closure0,"Item Movement","item_movements","item_movement",_.SCHEMA_NAME_72,n,"couchdb_bill",s,o)}),e(E,"kitchenStationSchema","$get$kitchenStationSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("kitchenStations","bill"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["restaurant_id","created_at"],l),"idx_kitchen_stations_select_index",a),t.Index$(t._setArrayType(["bill_id"],l),a,a),t.Index$(t._setArrayType(["published_at"],l),a,a)],$.JSArray_Index),d=t._setArrayType(["restaurantId"],l);return t.Schema_Schema$build("specialized",t._setArrayType(["kitchen","kitchen station","prep time","cook time"],l),3,d,a,new t.kitchenStationSchema_closure,_.List_empty0,D,600,!0,!0,!1,!1,!1,new t.kitchenStationSchema_closure0,"Kitchen station","kitchen_stations","kitchen_station",_.SCHEMA_NAME_68,n,"couchdb_bill",s,o)}),e(E,"memberSchema","$get$memberSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Members"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["user_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index),D=t._setArrayType([],o);return t.Schema_Schema$build("loyalty",t._setArrayType(["member","customer","loyalty","membership","registered customer"],o),2,D,n,new t.memberSchema_closure,_.List_empty0,l,n,!1,!0,!1,!1,!1,new t.memberSchema_closure0,"Member","members","member",_.SCHEMA_NAME_42,n,"mongodb_members",a,s)}),e(E,"memberStorePurchaseSchema","$get$memberStorePurchaseSchema",()=>{var n=null,a="createdAt",s=t.Source_Source$couchdb(n,"memberStorePurchase"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),a),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),n,n),t.Index$(t._setArrayType(["doc_id"],l),n,n),t.Index$(t._setArrayType(["created_at"],l),n,n),t.Index$(t._setArrayType(["restaurant_id"],l),n,n),t.Index$(t._setArrayType(["member_id"],l),n,n),t.Index$(t._setArrayType(["member_user_id"],l),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],l),n,new t.memberStorePurchaseSchema_closure,_.List_empty0,D,n,!0,!0,!1,!1,!1,new t.memberStorePurchaseSchema_closure0,"Member store purchase","member_store_purchases","member_store_purchase",_.SCHEMA_NAME_46,a,"couchdb_member_store_purchase",s,o)}),e(E,"memberStorePurchasePaymentSchema","$get$memberStorePurchasePaymentSchema",()=>{var n="createdAt",a=null,s=t.Source_Source$couchdb("payments","memberStorePurchase"),o=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),l=$.JSArray_String,D=t._setArrayType([t.Index$(t._setArrayType(["id"],l),a,a),t.Index$(t._setArrayType(["doc_id"],l),a,a),t.Index$(t._setArrayType(["created_at"],l),a,a),t.Index$(t._setArrayType(["restaurant_id"],l),a,a),t.Index$(t._setArrayType(["member_store_purchase_id"],l),a,a)],$.JSArray_Index);return t.Schema_Schema$build(a,_.List_empty,3,t._setArrayType(["restaurantId"],l),a,new t.memberStorePurchasePaymentSchema_closure,_.List_empty0,D,a,!0,!0,!1,!1,!1,new t.memberStorePurchasePaymentSchema_closure0,"Member store purchase payment","member_store_purchase_payments","member_store_purchase_payment",_.SCHEMA_NAME_47,n,"couchdb_member_store_purchase",s,o)}),e(E,"memberTitleSchema","$get$memberTitleSchema",()=>{var n=null,a=t.Source_Source$mongodb("titles","Members"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n),t.Index$(t._setArrayType(["member_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.memberTitleSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.memberTitleSchema_closure0,"Member title","member_titles","member_title",_.SCHEMA_NAME_48,"createdAt","mongodb_members",a,s)}),e(E,"memberV2Schema","$get$memberV2Schema",()=>{var n=null,a=t.Source_Source$mongodb("members","UsersV2"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["user_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.memberV2Schema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!0,new t.memberV2Schema_closure0,"Member","members","member",_.SCHEMA_NAME_43,n,"mongodb_marketing_db_users_v2",a,s)}),e(E,"membershipSchema","$get$membershipSchema",()=>{var n=null,a=t.Source_Source$mongodb(n,"Memberships"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["business_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.membershipSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.membershipSchema_closure0,"Membership","memberships","membership",_.SCHEMA_NAME_49,n,"mongodb_memberships",a,s)}),e(E,"membershipTitleSchema","$get$membershipTitleSchema",()=>{var n=null,a=t.Source_Source$mongodb("titles","Memberships"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$business("businessId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType([],o),n,new t.membershipTitleSchema_closure,_.List_empty0,l,n,!0,!0,!1,!1,!1,new t.membershipTitleSchema_closure0,"Membership title","membership_titles","membership_title",_.SCHEMA_NAME_50,n,"mongodb_memberships",a,s)}),e(E,"menuV3GroupSchema","$get$menuV3GroupSchema",()=>{var n=null,a=t.Source_Source$couchdb("addonGroups","mMenuV3"),s=t.TopLevelFilters$(t._setArrayType([t.Permission_Permission$restaurant("restaurantId")],$.JSArray_Permission),n),o=$.JSArray_String,l=t._setArrayType([t.Index$(t._setArrayType(["id"],o),n,n),t.Index$(t._setArrayType(["doc_id"],o),n,n),t.Index$(t._setArrayType(["restaurant_id"],o),n,n)],$.JSArray_Index);return t.Schema_Schema$build(n,_.List_empty,3,t._setArrayType(["restaurantId"],o),`SELECT *
|
|
91
120
|
FROM menu_groups
|
|
92
121
|
WHERE (
|
|
93
122
|
doc_id LIKE (
|