@tabres/react 1.0.39 → 1.0.41

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.
Files changed (106) hide show
  1. package/dist/components/PublicMenu/OrderDrawer/OrderTip/OrderTip.d.ts +2 -0
  2. package/dist/components/PublicMenu/OrderDrawer/OrderTip/OrderTip.test.d.ts +1 -0
  3. package/dist/components/PublicMenu/OrderDrawer/OrderTip/index.d.ts +1 -0
  4. package/dist/components/PublicMenu/OrderPaymentSummary/OrderPaymentSummary.d.ts +7 -1
  5. package/dist/components/PublicMenu/OrderPaymentSummary/OrderPaymentSummary.test.d.ts +1 -0
  6. package/dist/constants/constants/index.d.ts +2 -0
  7. package/dist/constants/index.d.ts +2 -0
  8. package/dist/constants/index.esm.js +1 -1
  9. package/dist/constants/index.esm.js.map +1 -1
  10. package/dist/constants/index.js +1 -1
  11. package/dist/constants/index.js.map +1 -1
  12. package/dist/constants/modules/pos/constants/countries.d.ts +6 -0
  13. package/dist/constants/modules/pos/constants/posCompliance.d.ts +22 -0
  14. package/dist/constants/modules/pos/models/compliance.d.ts +9 -0
  15. package/dist/index.esm.js +1 -1
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/models/index.esm.js.map +1 -1
  20. package/dist/models/index.js.map +1 -1
  21. package/dist/models/modules/order/constants.d.ts +1 -0
  22. package/dist/models/modules/order/models.d.ts +9 -0
  23. package/dist/models/modules/order/utils.d.ts +2 -0
  24. package/dist/models/services/translation/locales/az/index.d.ts +6 -0
  25. package/dist/models/services/translation/locales/az/order.d.ts +6 -0
  26. package/dist/models/services/translation/locales/es/index.d.ts +6 -0
  27. package/dist/models/services/translation/locales/es/order.d.ts +6 -0
  28. package/dist/models/services/translation/locales/et/index.d.ts +6 -0
  29. package/dist/models/services/translation/locales/et/order.d.ts +6 -0
  30. package/dist/models/services/translation/locales/hr/index.d.ts +6 -0
  31. package/dist/models/services/translation/locales/hr/order.d.ts +6 -0
  32. package/dist/models/services/translation/locales/index.d.ts +54 -0
  33. package/dist/models/services/translation/locales/nl/index.d.ts +6 -0
  34. package/dist/models/services/translation/locales/nl/order.d.ts +6 -0
  35. package/dist/models/services/translation/locales/pl/index.d.ts +6 -0
  36. package/dist/models/services/translation/locales/pl/order.d.ts +6 -0
  37. package/dist/models/services/translation/locales/pt/index.d.ts +6 -0
  38. package/dist/models/services/translation/locales/pt/order.d.ts +6 -0
  39. package/dist/models/services/translation/locales/ru/index.d.ts +6 -0
  40. package/dist/models/services/translation/locales/ru/order.d.ts +6 -0
  41. package/dist/models/services/translation/locales/tr/index.d.ts +6 -0
  42. package/dist/models/services/translation/locales/tr/order.d.ts +6 -0
  43. package/dist/modules/order/constants.d.ts +1 -0
  44. package/dist/modules/order/models.d.ts +9 -0
  45. package/dist/modules/order/utils.d.ts +2 -0
  46. package/dist/modules/pos/constants/countries.d.ts +6 -0
  47. package/dist/modules/pos/constants/posCompliance.d.ts +22 -0
  48. package/dist/modules/pos/models/compliance.d.ts +9 -0
  49. package/dist/modules/pos/utils/index.d.ts +1 -0
  50. package/dist/modules/pos/utils/posCompliance.d.ts +10 -0
  51. package/dist/modules/pos/utils/posCompliance.test.d.ts +1 -0
  52. package/dist/services/translation/locales/az/index.d.ts +6 -0
  53. package/dist/services/translation/locales/az/order.d.ts +6 -0
  54. package/dist/services/translation/locales/es/index.d.ts +6 -0
  55. package/dist/services/translation/locales/es/order.d.ts +6 -0
  56. package/dist/services/translation/locales/et/index.d.ts +6 -0
  57. package/dist/services/translation/locales/et/order.d.ts +6 -0
  58. package/dist/services/translation/locales/hr/index.d.ts +6 -0
  59. package/dist/services/translation/locales/hr/order.d.ts +6 -0
  60. package/dist/services/translation/locales/index.d.ts +54 -0
  61. package/dist/services/translation/locales/nl/index.d.ts +6 -0
  62. package/dist/services/translation/locales/nl/order.d.ts +6 -0
  63. package/dist/services/translation/locales/pl/index.d.ts +6 -0
  64. package/dist/services/translation/locales/pl/order.d.ts +6 -0
  65. package/dist/services/translation/locales/pt/index.d.ts +6 -0
  66. package/dist/services/translation/locales/pt/order.d.ts +6 -0
  67. package/dist/services/translation/locales/ru/index.d.ts +6 -0
  68. package/dist/services/translation/locales/ru/order.d.ts +6 -0
  69. package/dist/services/translation/locales/tr/index.d.ts +6 -0
  70. package/dist/services/translation/locales/tr/order.d.ts +6 -0
  71. package/dist/styles/ui.css +1 -1
  72. package/dist/styles/ui.css.map +1 -1
  73. package/dist/utils/index.d.ts +1 -0
  74. package/dist/utils/index.esm.js +1 -1
  75. package/dist/utils/index.esm.js.map +1 -1
  76. package/dist/utils/index.js +1 -1
  77. package/dist/utils/index.js.map +1 -1
  78. package/dist/utils/modules/order/constants.d.ts +1 -0
  79. package/dist/utils/modules/order/models.d.ts +9 -0
  80. package/dist/utils/modules/order/utils.d.ts +2 -0
  81. package/dist/utils/modules/pos/constants/countries.d.ts +6 -0
  82. package/dist/utils/modules/pos/constants/posCompliance.d.ts +22 -0
  83. package/dist/utils/modules/pos/models/compliance.d.ts +9 -0
  84. package/dist/utils/modules/pos/utils/index.d.ts +1 -0
  85. package/dist/utils/modules/pos/utils/posCompliance.d.ts +10 -0
  86. package/dist/utils/services/translation/locales/az/index.d.ts +6 -0
  87. package/dist/utils/services/translation/locales/az/order.d.ts +6 -0
  88. package/dist/utils/services/translation/locales/es/index.d.ts +6 -0
  89. package/dist/utils/services/translation/locales/es/order.d.ts +6 -0
  90. package/dist/utils/services/translation/locales/et/index.d.ts +6 -0
  91. package/dist/utils/services/translation/locales/et/order.d.ts +6 -0
  92. package/dist/utils/services/translation/locales/hr/index.d.ts +6 -0
  93. package/dist/utils/services/translation/locales/hr/order.d.ts +6 -0
  94. package/dist/utils/services/translation/locales/index.d.ts +54 -0
  95. package/dist/utils/services/translation/locales/nl/index.d.ts +6 -0
  96. package/dist/utils/services/translation/locales/nl/order.d.ts +6 -0
  97. package/dist/utils/services/translation/locales/pl/index.d.ts +6 -0
  98. package/dist/utils/services/translation/locales/pl/order.d.ts +6 -0
  99. package/dist/utils/services/translation/locales/pt/index.d.ts +6 -0
  100. package/dist/utils/services/translation/locales/pt/order.d.ts +6 -0
  101. package/dist/utils/services/translation/locales/ru/index.d.ts +6 -0
  102. package/dist/utils/services/translation/locales/ru/order.d.ts +6 -0
  103. package/dist/utils/services/translation/locales/tr/index.d.ts +6 -0
  104. package/dist/utils/services/translation/locales/tr/order.d.ts +6 -0
  105. package/dist/utils/utils/index.d.ts +1 -0
  106. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/modules/product/models.ts","../../../src/modules/product/utils/listing-price.ts","../../../src/modules/addon/models.ts","../../../src/modules/product/utils/order-price.ts","../../../src/modules/order/models.ts","../../../src/modules/order/constants.ts","../../node_modules/tslib/tslib.es6.js","../../../src/modules/order/utils/item-price.ts","../../../src/modules/customer/models.ts","../../../src/modules/feature/models.ts","../../../src/modules/feature/constants.ts","../../../src/modules/view/constants.ts","../../../src/modules/view/utils.ts","../../../src/modules/category/utils.ts","../../../src/modules/user/models.ts","../../../src/modules/order/utils.ts","../../../src/modules/customer/utils.ts","../../../src/modules/addon/utils.ts","../../../src/modules/user/utils.ts","../../../src/modules/feature/utils.ts","../../../src/modules/product/utils.ts","../../../src/modules/menu/utils.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface LocalizedContent {\n\tname: string;\n\tdescription: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied.\n\t */\n\tlistingPrice: number;\n\t/** Title keyed by language code, e.g. { en: \"Large\", az: \"Böyük\" }. */\n\ttitle: Record<string, string>;\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\t/** Net price (tax-exclusive). Nullable when the product has no own price (variant-only). */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied,\n\t * and is null when `price` itself is null.\n\t */\n\tlistingPrice?: number | null;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: Record<string, LocalizedContent>;\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n\tvideoUrl?: string;\n\tsellUnitType?: SellUnitType;\n\ttaxClassId?: number | null;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n\nexport interface DashboardProduct extends Omit<Product, \"addons\"> {\n\taddons: number[];\n}\n\nexport enum SellUnitType {\n\tPIECE = \"PIECE\",\n\tWEIGHT = \"WEIGHT\",\n\tVOLUME = \"VOLUME\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { Product, ProductVariant } from \"../models\";\nimport { MenuAddonOption } from \"src/models\";\n\nexport const getUnitListingPrice = (item: {\n\tprice?: number | null;\n\tlistingPrice?: number | null;\n}) => item?.listingPrice ?? item?.price ?? 0;\n\nexport const getProductListingPrice = (product: Product, currency: string, language: string) => {\n\tconst listingPrice = getUnitListingPrice(product);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getVariantListingPrice = (\n\tvariant: ProductVariant,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(variant);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getOptionListingPrice = (\n\toption: MenuAddonOption,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(option);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n","export enum MenuAddonSelectType {\n\tSINGLE = \"SINGLE\",\n\tMULTIPLE = \"MULTIPLE\",\n}\n\nexport interface MenuAddonOption {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus the parent product's\n\t * `addToListingPrice` taxes. Equals `price` when no branch context is\n\t * supplied (e.g. addon detached from a branch tax setup).\n\t */\n\tlistingPrice: number;\n\ttitle: Record<string, string>;\n\tremove?: boolean;\n}\n\nexport interface MenuAddon {\n\tid?: number;\n\tselectType: MenuAddonSelectType;\n\toptions: MenuAddonOption[];\n\tbusinessId?: number;\n\ttitle: Record<string, string>;\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport { MenuAddonSelectType } from \"src/modules/addon/models\";\nimport * as orderModels from \"src/modules/order/models\";\n\nimport { Product } from \"../models\";\nimport { getUnitListingPrice } from \"./listing-price\";\n\nexport const getAllSelectedOptionsListingPrice = (\n\tproduct: Pick<Product, \"addons\">,\n\tselectedAddons: orderModels.SelectedAddons = {},\n): number => {\n\tlet total = 0;\n\n\tfor (const addon of product?.addons || []) {\n\t\tconst { id: addonId, selectType, options } = addon;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(selectedAddons, addonId)) continue;\n\n\t\tconst selection = selectedAddons[addonId];\n\t\tconst selectedOptionIds =\n\t\t\tselectType === MenuAddonSelectType.SINGLE\n\t\t\t\t? [selection as number]\n\t\t\t\t: ((selection || []) as number[]);\n\n\t\tfor (const optionId of selectedOptionIds) {\n\t\t\tconst option = (options || []).find(({ id }) => id === optionId);\n\t\t\tif (option) total += getUnitListingPrice(option);\n\t\t}\n\t}\n\n\treturn total;\n};\n\nexport const getProductOrderPrice = ({\n\tproduct,\n\tquantity,\n\tlanguage,\n\tcurrency,\n\tvariantId,\n\tselectedAddons,\n}: {\n\tproduct: Product;\n\tquantity: number;\n\tlanguage: string;\n\tcurrency: string;\n\tvariantId?: number;\n\tselectedAddons?: Record<number, number | number[]>;\n}) => {\n\tif (!product || Object.keys(product).length === 0) {\n\t\treturn priceFormatter(0, currency, language);\n\t}\n\n\tconst variant = variantId\n\t\t? (product.variants || []).find(({ id }) => id === variantId)\n\t\t: undefined;\n\n\tconst baseUnitPrice = variantId ? getUnitListingPrice(variant) : getUnitListingPrice(product);\n\tconst optionsUnitPrice = getAllSelectedOptionsListingPrice(product, selectedAddons);\n\n\tconst totalPrice = (baseUnitPrice + optionsUnitPrice) * quantity;\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","import * as customerModels from \"../customer/models\";\nimport * as productModels from \"../product/models\";\n\nexport enum OrderType {\n\tDINE_IN = \"DINE_IN\",\n\tPICK_UP = \"PICK_UP\",\n\tDELIVERY = \"DELIVERY\",\n}\n\nexport enum OrderStatus {\n\tDRAFT = \"DRAFT\",\n\tPENDING = \"PENDING\",\n\tCONFIRMED = \"CONFIRMED\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tOUT_FOR_DELIVERY = \"OUT_FOR_DELIVERY\",\n\tDELIVERED = \"DELIVERED\",\n\tCOMPLETED = \"COMPLETED\",\n\tCANCELLED = \"CANCELLED\",\n\tFAILED = \"FAILED\",\n}\n\nexport enum OrderItemStatus {\n\tPENDING = \"PENDING\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tSERVED = \"SERVED\",\n}\n\nexport enum PaymentMethod {\n\tCASH = \"CASH\",\n\tCARD = \"CARD\",\n\tWALLET = \"WALLET\",\n\tTERMINAL = \"TERMINAL\",\n}\n\nexport interface OrderAddonOption {\n\toptionId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderAddon {\n\tid?: number;\n\taddonId: number;\n\toptions: OrderAddonOption[];\n}\n\nexport interface SelectedAddons {\n\t[key: number]: number | number[];\n}\n\nexport interface OrderItemVariant {\n\tid?: number;\n\tvariantId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderItem {\n\tid?: number;\n\tproductId: number;\n\torderId?: number;\n\tquantity: number;\n\t/**\n\t * Gross unit price (listingPrice) at the moment the line was added. The\n\t * server recomputes authoritative totals on create/preview; this value is\n\t * what the cart UI displays.\n\t */\n\tprice?: number;\n\tvariant?: OrderItemVariant;\n\taddons: OrderAddon[];\n\tnote?: string;\n\tstatus?: OrderItemStatus;\n\tisPaid?: boolean;\n\tsellUnitType: productModels.SellUnitType;\n}\n\nexport interface Order {\n\tid?: number;\n\tbusinessId?: number;\n\tbranchId?: number;\n\tworkingDayId?: number;\n\ttableId?: number;\n\temployeeId?: number;\n\torderType: OrderType;\n\titems: OrderItem[];\n\tstatus?: OrderStatus;\n\tpreferredPaymentMethod?: PaymentMethod;\n\tnote?: string;\n\tcreatedAt?: number;\n\tupdatedAt?: number;\n\tcustomer?: customerModels.Customer;\n\tcurrency?: string;\n\ttrackingId?: string;\n}\n\nexport interface OrderItems {\n\t[key: string]: OrderItem;\n}\n\nexport enum OrderStep {\n\tCART = \"CART\",\n\tDETAILS = \"DETAILS\",\n\tCOMPLETED = \"COMPLETED\",\n}\n\nexport interface OrderPayload extends Order {\n\tcustomerAddressId: number;\n\tcustomerId: number;\n\tlanguage?: string;\n}\n\n/**\n * Contact + delivery snapshot an unregistered (\"guest\") visitor enters at\n * checkout. Mirrors the backend GuestContact: every field is optional, and an\n * address is only meaningful for DELIVERY orders. latitude/longitude are kept\n * as numbers here for the UI (they come from the address autocomplete); they're\n * serialized to strings in the wire payload — see GuestContactRequest.\n */\nexport interface GuestContact {\n\tfullName?: string;\n\tphoneNumber?: string;\n\temail?: string;\n\tstreet?: string;\n\thouseNumber?: string;\n\tadditionalNumber?: string;\n\tfloor?: number;\n\tlatitude?: number;\n\tlongitude?: number;\n\tcityName?: string;\n\tcountryCode?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n}\n\n/**\n * Wire shape of the contact sent to POST /order/public. Matches the backend\n * GuestContact, where latitude/longitude are strings.\n */\nexport interface GuestContactRequest\n\textends Omit<GuestContact, \"latitude\" | \"longitude\"> {\n\tlatitude?: string;\n\tlongitude?: string;\n}\n\n/**\n * Payload for the public, non-authenticated create path (POST /order/public).\n * Unlike OrderPayload it carries no customerId/customerAddressId — an\n * unregistered visitor has no account or stored address book; the delivery\n * address (when given) travels inside the contact snapshot.\n */\nexport interface GuestOrderPayload extends Order {\n\tlanguage?: string;\n\tcontact?: GuestContactRequest;\n}\n\nexport interface CalculatePreviewItemRequest {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tvariant?: { variantId: number };\n\taddons?: Array<{\n\t\taddonId: number;\n\t\toptions: Array<{ optionId: number }>;\n\t}>;\n}\n\nexport interface CalculatePreviewRequest {\n\tbusinessId?: number;\n\tbranchId: number;\n\torderType: OrderType;\n\titems: CalculatePreviewItemRequest[];\n}\n\nexport interface CalculatePreviewTax {\n\tbranchTaxId: number;\n\tname: Record<string, string>;\n\trate: number;\n\ttype: \"percentage\" | \"fixed\";\n\taddToListingPrice: boolean;\n\tamount: number;\n}\n\nexport interface CalculatePreviewLine {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tprice: number;\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface CalculatePreviewResponse {\n\ttotalPriceWithoutTax: number;\n\ttotalPriceWithTax: number;\n\ttotalPriceWithTaxAndFees: number;\n\ttotalTax: number;\n\tdeliveryFee: number;\n\tserviceFee: number;\n\titems: CalculatePreviewLine[];\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface OrderPreviewState {\n\tdata: CalculatePreviewResponse | null;\n\tisLoading: boolean;\n\terror: string | null;\n}\n","import { OrderPreviewState, OrderStep, PaymentMethod } from \"./models\";\n\nexport const initialOrder = {\n\torderType: null,\n\tpreferredPaymentMethod: PaymentMethod.CASH,\n};\n\nexport const ORDER_STEPS = [OrderStep.CART, OrderStep.DETAILS, OrderStep.COMPLETED];\n\nexport const initialPreviewState: OrderPreviewState = {\n\tdata: null,\n\tisLoading: false,\n\terror: null,\n};\n\nexport enum OrderErrors {\n\tFIELD_REQUIRED_ERROR = \"This field is required\",\n\tTABLE_NOT_SELECTED = \"Please select a table\",\n\tADDRESS_IS_EMPTY = \"Please enter an address\",\n\tEMPTY_ITEMS = \"Please choose product\",\n\tBRANCH_NOT_SELECTED = \"Please select a branch\",\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { OrderItem } from \"../models\";\n\nexport const getOrderItemListingRawPrice = (orderItem: OrderItem) => {\n\tconst { price, variant, addons, quantity } = orderItem || {};\n\n\tconst baseUnitPrice = variant?.price ?? price ?? 0;\n\n\tconst addonsUnitPrice = (addons || []).reduce(\n\t\t(addonSum, addon) =>\n\t\t\taddonSum +\n\t\t\t(addon?.options || []).reduce((optionSum, option) => optionSum + (option?.price ?? 0), 0),\n\t\t0,\n\t);\n\n\tconst unitPrice = baseUnitPrice + addonsUnitPrice;\n\treturn unitPrice * (quantity ?? 1);\n};\n\nexport const getOrderItemListingPrice = (\n\torderItem: OrderItem,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst totalPrice = getOrderItemListingRawPrice(orderItem);\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","export enum CustomerAuthStep {\n\tPHONE = \"PHONE\",\n\tOTP = \"OTP\",\n\tEMAIL = \"EMAIL\",\n}\n\nexport enum CustomerAddressType {\n\tHOME = \"HOME\",\n\tWORK = \"WORK\",\n\tTRAVEL = \"TRAVEL\",\n}\n\nexport interface CustomerAddress {\n\tid?: number;\n\taddressId?: number; // Update address temporary\n\tcountryCode: string;\n\tcityName: string;\n\tstreet: string;\n\thouseNumber: string;\n\tadditionalNumber?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n\tfloor?: number;\n\tlongitude?: number;\n\tlatitude?: number;\n\ttitle?: string;\n\ttype?: CustomerAddressType;\n}\n\nexport interface CustomerAuthForm {\n\totp: string;\n\temail: string;\n}\n\nexport interface CustomerAuthPhoneForm {\n\tcountryCode: string;\n\tphoneNumber: string;\n}\n\nexport interface AuthResponse {\n\taccessToken: string;\n\trefreshToken: string;\n}\n\nexport interface Customer {\n\tid?: number;\n\temail: string;\n\tphoneNumber: string;\n\tfullName: string;\n\tsmsVerified?: boolean;\n\temailVerified?: boolean;\n\taddress?: CustomerAddress;\n\taddresses?: CustomerAddress[];\n}\n\nexport type CustomerUpdatePayload = Partial<Customer>;\n","export enum Feature {\n\tUPLOAD_VIDEO = \"UPLOAD_VIDEO\",\n}\nexport enum FeatureSegment {\n\tALPHA = \"ALPHA\",\n\tBETA = \"BETA\",\n\tALL = \"ALL\",\n}\n","import { Feature, FeatureSegment } from \"./models\";\n\nexport const FEATURES_LIST: { [key in FeatureSegment]: Feature[] } = {\n\t[FeatureSegment.ALPHA]: [Feature.UPLOAD_VIDEO],\n\t[FeatureSegment.BETA]: [],\n\t[FeatureSegment.ALL]: [],\n};\n","export const MODALS = {\n\tADD_UPDATE_NOTES: \"ADD_UPDATE_NOTES\",\n\tAUTH: \"AUTH\",\n\tADD_UPDATE_ADDRESS: \"ADD_UPDATE_ADDRESS\",\n\tBRANCH_BUSINESS_HOURS: \"BRANCH_BUSINESS_HOURS\",\n\tPRODUCT_DETAILS: \"PRODUCT_DETAILS\",\n};\n\nexport const SUPPORTED_LOCALES = [\"en\", \"az\", \"nl\", \"et\", \"tr\", \"ru\", \"pl\", \"pt\", \"hr\"];\nexport const SUPPORTED_COUNTRIES = [\n\t{\n\t\tname: \"Azerbaijan\",\n\t\tcode: \"AZ\",\n\t\tphoneCode: \"+994\",\n\t},\n];\n\nexport const DOMAIN = \"tabres.com\";\n\nexport const DEFAULT_HOSTNAME = DOMAIN;\n\nexport const IMAGE_BASE_URL = \"https://images.tabres.com\";\n","import { DOMAIN, IMAGE_BASE_URL } from \"./constants\";\n\ninterface ValidationResult {\n\tisValid: boolean;\n\terror?: string;\n}\n\ntype Validator = (cleanedNumber: string) => ValidationResult;\n\nconst validators: Record<string, Validator> = {\n\t\"994\": (number) => {\n\t\tconst AZERBAIJANI_PREFIXES = [\"50\", \"51\", \"10\", \"55\", \"99\", \"70\", \"77\", \"60\"];\n\t\tconst pattern = new RegExp(`^(${AZERBAIJANI_PREFIXES.join(\"|\")})\\\\d{7}$`);\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: `Azerbaijani numbers must be 9 digits and start with ${AZERBAIJANI_PREFIXES.join(\n\t\t\t\t\t\", \"\n\t\t\t\t)}`,\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n\n\t\"31\": (number) => {\n\t\tconst pattern = /^\\d{9}$/;\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: \"Dutch numbers must be exactly 9 digits\",\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n};\n\nexport function validatePhoneNumber(phoneNumber: string): ValidationResult {\n\tif (!phoneNumber) {\n\t\treturn { isValid: false, error: \"FIELD_REQUIRED\" };\n\t}\n\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\n\tconst countryCode = cleaned.startsWith(\"994\") ? \"994\" : cleaned.startsWith(\"31\") ? \"31\" : null;\n\n\tif (!countryCode) {\n\t\treturn { isValid: false, error: \"Unsupported country code\" };\n\t}\n\n\tconst nationalNumber = cleaned.slice(countryCode.length);\n\tconst validator = validators[countryCode];\n\n\treturn validator(nationalNumber);\n}\n\nexport const getBaseUrl = (hostname: string, language: string) => {\n\tconst locale = language || \"en\";\n\t// Local env\n\tif (hostname === \"localhost:3000\") {\n\t\treturn { url: `http://localhost:3000/${locale}`, domain: DOMAIN };\n\t}\n\t// Prod env\n\treturn { url: `https://${DOMAIN}/${locale}`, domain: DOMAIN };\n};\n\nexport const getRegisterUrl = (language: string, source: string) => {\n\treturn `https://app.tabres.com/auth/register?lang=${language}&utm_source=${source}`;\n};\n\nexport const getImageSource = (image?: string) => {\n\tif (!image) return \"\";\n\n\tif (image.includes(\"base64\") || image.startsWith(\"https://\")) return image;\n\n\treturn `${IMAGE_BASE_URL}/${image}`;\n};\n\nexport const getLogoImageSource = (logoImage?: string) => {\n\tif (!logoImage) return \"https://images.tabres.com/no-photo-128.webp\";\n\n\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n};\n\nexport const getCoverPhotoSource = (coverPhoto?: string) => {\n\tif (!coverPhoto) return \"https://images.tabres.com/tabres-doodle.webp\";\n\n\tif (coverPhoto.includes(\"base64\") || coverPhoto.startsWith(\"https://\")) return coverPhoto;\n\n\treturn `${IMAGE_BASE_URL}/${coverPhoto}`;\n};\n\nconst keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\nconst triplet = (e1: number, e2: number, e3: number) =>\n\tkeyStr.charAt(e1 >> 2) +\n\tkeyStr.charAt(((e1 & 3) << 4) | (e2 >> 4)) +\n\tkeyStr.charAt(((e2 & 15) << 2) | (e3 >> 6)) +\n\tkeyStr.charAt(e3 & 63);\n\nexport const rgbDataURL = (r: number, g: number, b: number) =>\n\t`data:image/gif;base64,R0lGODlhAQABAPAA${\n\t\ttriplet(0, r, g) + triplet(b, 255, 255)\n\t}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`;\n\nexport const getVideoSource = (video?: string) => {\n\tif (!video) return \"\";\n\n\tif (video.includes(\"base64\") || video.startsWith(\"https://\")) return video;\n\n\treturn `${IMAGE_BASE_URL}/${video}`;\n};\n\nexport const adjustLightness = (hex: string, deltaPct: number) => {\n\tconst n = parseInt(hex.replace(\"#\", \"\"), 16);\n\tconst r = ((n >> 16) & 0xff) / 255;\n\tconst g = ((n >> 8) & 0xff) / 255;\n\tconst b = (n & 0xff) / 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\tconst l = (max + min) / 2;\n\tlet h = 0;\n\tlet s = 0;\n\tif (max !== min) {\n\t\tconst d = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / d + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / d + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / d + 4;\n\t\t\t\tbreak;\n\t\t}\n\t\th /= 6;\n\t}\n\n\tconst newL = Math.max(0, Math.min(1, l + deltaPct / 100));\n\n\tconst hueToRgb = (p: number, q: number, t: number) => {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n\t\treturn p;\n\t};\n\n\tlet r2 = newL;\n\tlet g2 = newL;\n\tlet b2 = newL;\n\tif (s !== 0) {\n\t\tconst q = newL < 0.5 ? newL * (1 + s) : newL + s - newL * s;\n\t\tconst p = 2 * newL - q;\n\t\tr2 = hueToRgb(p, q, h + 1 / 3);\n\t\tg2 = hueToRgb(p, q, h);\n\t\tb2 = hueToRgb(p, q, h - 1 / 3);\n\t}\n\n\tconst toHex = (x: number) =>\n\t\tMath.round(x * 255)\n\t\t\t.toString(16)\n\t\t\t.padStart(2, \"0\");\n\treturn `#${toHex(r2)}${toHex(g2)}${toHex(b2)}`;\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\nimport { Category, CategoryTranslation } from \"./models\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n\nexport const getCategoryNameById = (\n\tcategoryId: number,\n\tcategories: Category[],\n\tlanguage: string\n): string => {\n\tconst category = categories?.find?.(({ id }) => id === categoryId);\n\n\tif (isEmpty(category)) return \"\";\n\n\tconst { name } = getCategoryTranslation(category, language);\n\n\treturn name || \"\";\n};\n","export enum EmployeePermission {\n\tVIEW_BUSINESS = \"VIEW_BUSINESS\",\n\tUPDATE_BUSINESS = \"UPDATE_BUSINESS\",\n\tVIEW_BUSINESS_FINANCIALS = \"VIEW_BUSINESS_FINANCIALS\",\n\tVIEW_ORDERS = \"VIEW_ORDERS\",\n\tUPDATE_ORDER = \"UPDATE_ORDER\",\n\tCREATE_ORDER = \"CREATE_ORDER\",\n\tAPPLY_DISCOUNT = \"APPLY_DISCOUNT\",\n\tVIEW_QR_MENU = \"VIEW_QR_MENU\",\n\tUPDATE_QR_MENU = \"UPDATE_QR_MENU\",\n\tVIEW_MENU = \"VIEW_MENU\",\n\tVIEW_MENU_ITEMS = \"VIEW_MENU_ITEMS\",\n\tCREATE_MENU_ITEM = \"CREATE_MENU_ITEM\",\n\tUPDATE_MENU_ITEM = \"UPDATE_MENU_ITEM\",\n\tDELETE_MENU_ITEM = \"DELETE_MENU_ITEM\",\n\tVIEW_CATEGORIES = \"VIEW_CATEGORIES\",\n\tUPDATE_CATEGORY = \"UPDATE_CATEGORY\",\n\tCREATE_CATEGORY = \"CREATE_CATEGORY\",\n\tDELETE_CATEGORY = \"DELETE_CATEGORY\",\n\tVIEW_ADDONS = \"VIEW_ADDONS\",\n\tUPDATE_ADDON = \"UPDATE_ADDON\",\n\tCREATE_ADDON = \"CREATE_ADDON\",\n\tDELETE_ADDON = \"DELETE_ADDON\",\n\tVIEW_TABLES = \"VIEW_TABLES\",\n\tUPDATE_TABLE = \"UPDATE_TABLE\",\n\tUPDATE_TABLE_STATUS = \"UPDATE_TABLE_STATUS\",\n\tCREATE_TABLE = \"CREATE_TABLE\",\n\tDELETE_TABLE = \"DELETE_TABLE\",\n\tVIEW_BRANCHES = \"VIEW_BRANCHES\",\n\tUPDATE_BRANCH = \"UPDATE_BRANCH\",\n\tCREATE_BRANCH = \"CREATE_BRANCH\",\n\tDELETE_BRANCH = \"DELETE_BRANCH\",\n\tVIEW_EMPLOYEES = \"VIEW_EMPLOYEES\",\n\tUPDATE_EMPLOYEE = \"UPDATE_EMPLOYEE\",\n\tCREATE_EMPLOYEE = \"CREATE_EMPLOYEE\",\n\tDELETE_EMPLOYEE = \"DELETE_EMPLOYEE\",\n\tVIEW_ANALYTICS = \"VIEW_ANALYTICS\",\n\tVIEW_SALES_REPORTS = \"VIEW_SALES_REPORTS\",\n\tVIEW_SUBSCRIPTION = \"VIEW_SUBSCRIPTION\",\n\tUPDATE_SUBSCRIPTION = \"UPDATE_SUBSCRIPTION\",\n\tVIEW_QR_CODES = \"VIEW_QR_CODES\",\n\tCREATE_QR_CODE = \"CREATE_QR_CODE\",\n\tDELETE_QR_CODE = \"DELETE_QR_CODE\",\n\tALL = \"ALL\",\n\t// Inventory\n\tVIEW_INVENTORY = \"VIEW_INVENTORY\",\n\tVIEW_PURCHASES = \"VIEW_PURCHASES\",\n\tVIEW_PURCHASE_DETAIL = \"VIEW_PURCHASE_DETAIL\",\n\tCREATE_PURCHASE = \"CREATE_PURCHASE\",\n\tUPDATE_PURCHASE = \"UPDATE_PURCHASE\",\n\tDELETE_PURCHASE = \"DELETE_PURCHASE\",\n\tVIEW_INVENTORY_PRODUCTS = \"VIEW_INVENTORY_PRODUCTS\",\n\tCREATE_INVENTORY_PRODUCT = \"CREATE_INVENTORY_PRODUCT\",\n\tUPDATE_INVENTORY_PRODUCT = \"UPDATE_INVENTORY_PRODUCT\",\n\tDELETE_INVENTORY_PRODUCT = \"DELETE_INVENTORY_PRODUCT\",\n\tVIEW_BUSINESS_BALANCE = \"VIEW_BUSINESS_BALANCE\",\n\tVIEW_BRANCH_BALANCE = \"VIEW_BRANCH_BALANCE\",\n\tUPDATE_PRODUCT_INGREDIENTS = \"UPDATE_PRODUCT_INGREDIENTS\",\n\tDELETE_PRODUCT_INGREDIENTS = \"DELETE_PRODUCT_INGREDIENTS\",\n\tAI_ASSISTANT = \"AI_ASSISTANT\",\n\tVIEW_PAYMENTS = \"VIEW_PAYMENTS\",\n\tTAKE_PAYMENT = \"TAKE_PAYMENT\",\n\tREFUND_PAYMENT = \"REFUND_PAYMENT\",\n\tPAYMENT_COMP = \"COMP\",\n}\n\nexport enum UserRole {\n\tOWNER = \"OWNER\",\n\tBRANCH_MANAGER = \"BRANCH_MANAGER\",\n\tGENERAL_MANAGER = \"GENERAL_MANAGER\",\n\tCHEF = \"CHEF\",\n\tSOUS_CHEF = \"SOUS_CHEF\",\n\tPASTRY_CHEF = \"PASTRY_CHEF\",\n\tLINE_COOK = \"LINE_COOK\",\n\tPREP_COOK = \"PREP_COOK\",\n\tKITCHEN_ASSISTANT = \"KITCHEN_ASSISTANT\",\n\tDISHWASHER = \"DISHWASHER\",\n\tHEAD_WAITER = \"HEAD_WAITER\",\n\tWAITER = \"WAITER\",\n\tRUNNER = \"RUNNER\",\n\tBARISTA = \"BARISTA\",\n\tBARTENDER = \"BARTENDER\",\n\tSOMMELIER = \"SOMMELIER\",\n\tACCOUNTANT = \"ACCOUNTANT\",\n\tROOM_SERVICE_STAFF = \"ROOM_SERVICE_STAFF\",\n\tDELIVERY_DRIVER = \"DELIVERY_DRIVER\",\n\tINVENTORY_MANAGER = \"INVENTORY_MANAGER\",\n\tPURCHASING_MANAGER = \"PURCHASING_MANAGER\",\n\tWAREHOUSE_STAFF = \"WAREHOUSE_STAFF\",\n\tCASHIER = \"CASHIER\"\n}\n\nexport interface User {\n\tid?: number;\n\temail: string;\n\tfullName: string;\n\trole?: UserRole;\n\tavatar64?: string | null;\n\tavatar128?: string | null;\n\tavatar256?: string | null;\n\tbusinessId?: number;\n\tbranchId?: number | null;\n\tcreatedAt: string;\n\temailVerified?: boolean;\n\tpermissions?: EmployeePermission[];\n}\n","import { isEmpty, sortNumbers } from \"@sorocraft/js-utils\";\nimport { IconType } from \"@sorocraft/ui\";\nimport { Check, BagCheck, Delivery, Chef, FileCheck, HourglassHalf } from \"@sorocraft/ui/icons\";\n\nimport {\n\tCalculatePreviewResponse,\n\tGuestContact,\n\tGuestContactRequest,\n\tOrder,\n\tOrderAddon,\n\tOrderAddonOption,\n\tOrderItem,\n\tOrderStatus,\n\tOrderType,\n\tSelectedAddons,\n} from \"./models\";\n\nimport * as addonModels from \"../addon/models\";\nimport * as branchModels from \"../branch/models\";\nimport { OrderErrors } from \"./constants\";\n\nexport const generateOrderItemsId = (\n\tproductId: number,\n\tvariantId: number | null,\n\tselectedAddons?: SelectedAddons,\n): string => {\n\tif (!productId) throw new Error(\"Product ID is required\");\n\n\t// Build the order items ID base with productId and variantId\n\tlet orderItemsId = `${productId}`;\n\tif (variantId) {\n\t\torderItemsId += `-${variantId}`;\n\t}\n\n\t// Build the addon part of the ID\n\tconst addonIdsPart = Object.entries(selectedAddons || {})\n\t\t.map(([addonId, option]) => {\n\t\t\tif (!addonId || !option) return null; // Skip invalid entries\n\t\t\tconst optionIds = Array.isArray(option)\n\t\t\t\t? sortNumbers(option).filter(Boolean).join(\"-\")\n\t\t\t\t: `${option}`;\n\t\t\tif (!optionIds) return null;\n\t\t\treturn `${addonId}-${optionIds}`;\n\t\t})\n\t\t.filter(Boolean) // Remove null/undefined values\n\t\t.join(\"-\");\n\n\t// Append addonIdsPart if it's not empty\n\tif (addonIdsPart) {\n\t\torderItemsId += `-${addonIdsPart}`;\n\t}\n\n\treturn orderItemsId;\n};\n\nexport const getSelectedAddonsFromOrderItems = (item: OrderItem): SelectedAddons => {\n\tconst selectedAddons: SelectedAddons = {};\n\n\tfor (const { addonId, options = [] } of item.addons || []) {\n\t\tconst optionIds = options.map(({ optionId }) => optionId);\n\t\tselectedAddons[addonId] = optionIds.length === 1 ? optionIds[0] : optionIds;\n\t}\n\n\treturn selectedAddons;\n};\n\nexport const getStatusIcon = (status: OrderStatus): IconType => {\n\tswitch (status) {\n\t\tcase OrderStatus.COMPLETED:\n\t\t\treturn Check;\n\t\tcase OrderStatus.DELIVERED:\n\t\t\treturn BagCheck;\n\t\tcase OrderStatus.OUT_FOR_DELIVERY:\n\t\t\treturn Delivery;\n\t\tcase OrderStatus.PREPARING:\n\t\t\treturn Chef;\n\t\tcase OrderStatus.CONFIRMED:\n\t\t\treturn FileCheck;\n\t\tcase OrderStatus.PENDING:\n\t\t\treturn HourglassHalf;\n\n\t\tdefault:\n\t\t\treturn HourglassHalf;\n\t}\n};\n\nexport const buildSelectedAddonsPayload = (\n\tproductAddons: addonModels.MenuAddon[] = [],\n\tselectedAddons: SelectedAddons = {},\n): OrderAddon[] => {\n\treturn Object.entries(selectedAddons).map(([addonIdStr, selected]) => {\n\t\tconst addonId = Number(addonIdStr);\n\t\tconst selectedOptionIds = Array.isArray(selected) ? selected : [selected];\n\n\t\tconst addon = productAddons.find((addon) => addon.id === addonId);\n\t\tif (isEmpty(addon)) {\n\t\t\treturn {\n\t\t\t\taddonId,\n\t\t\t\toptions: [],\n\t\t\t};\n\t\t}\n\n\t\tconst options: OrderAddonOption[] = (addon.options || [])\n\t\t\t.filter((option) => selectedOptionIds.includes(option.id))\n\t\t\t.map((option) => ({\n\t\t\t\toptionId: option.id,\n\t\t\t\tprice: option.listingPrice ?? option.price,\n\t\t\t}));\n\n\t\treturn {\n\t\t\taddonId,\n\t\t\toptions,\n\t\t};\n\t});\n};\n\nexport const getDefaultOrderType = (\n\tsettings: branchModels.BranchSettings,\n\tisOpen: boolean,\n\tisDelivering: boolean,\n): OrderType | null => {\n\tif (!settings) return null;\n\n\tconst { deliveryOrderEnabled, dineInOrderEnabled, pickupOrderEnabled } = settings;\n\n\tif (deliveryOrderEnabled && isDelivering) {\n\t\treturn OrderType.DELIVERY;\n\t}\n\n\tif (dineInOrderEnabled && isOpen) {\n\t\treturn OrderType.DINE_IN;\n\t}\n\n\tif (pickupOrderEnabled && isOpen) {\n\t\treturn OrderType.PICK_UP;\n\t}\n\n\treturn null;\n};\n\n// Defensive shape check for the /order/calculate response. The service is\n// typed as CalculatePreviewResponse, but the network can return malformed\n// payloads (empty body, HTML error page) that would corrupt preview state\n// and break price-line lookups downstream.\nexport const isValidPreviewResponse = (data: unknown): data is CalculatePreviewResponse => {\n\tif (!data || typeof data !== \"object\") return false;\n\tconst d = data as Partial<CalculatePreviewResponse>;\n\treturn (\n\t\ttypeof d.totalPriceWithoutTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTaxAndFees === \"number\" &&\n\t\ttypeof d.totalTax === \"number\" &&\n\t\ttypeof d.deliveryFee === \"number\" &&\n\t\ttypeof d.serviceFee === \"number\" &&\n\t\tArray.isArray(d.items) &&\n\t\tArray.isArray(d.taxes)\n\t);\n};\n\n// Build the contact snapshot sent to POST /order/public from the in-memory\n// guest contact. Drops empty/blank fields so a guest who entered nothing\n// produces no contact at all, and serializes lat/long to strings (and floor to\n// a number) to match the backend GuestContact shape.\nexport const buildGuestContactRequest = (\n\tcontact?: GuestContact,\n): GuestContactRequest | undefined => {\n\tif (isEmpty(contact)) return undefined;\n\n\tconst populated = Object.entries(contact).filter(\n\t\t([, value]) => value !== undefined && value !== null && value !== \"\",\n\t);\n\tif (populated.length === 0) return undefined;\n\n\tconst { latitude, longitude, floor, ...rest } = Object.fromEntries(\n\t\tpopulated,\n\t) as GuestContact;\n\n\treturn {\n\t\t...rest,\n\t\t...(floor != null ? { floor: Number(floor) } : {}),\n\t\t...(latitude != null ? { latitude: `${latitude}` } : {}),\n\t\t...(longitude != null ? { longitude: `${longitude}` } : {}),\n\t};\n};\n\nexport const getOrderErrorMessages = (field: keyof Order) => {\n\tswitch (field) {\n\t\tcase \"customer\":\n\t\t\treturn OrderErrors.ADDRESS_IS_EMPTY;\n\n\t\tcase \"tableId\":\n\t\t\treturn OrderErrors.TABLE_NOT_SELECTED;\n\n\t\tcase \"items\":\n\t\t\treturn OrderErrors.EMPTY_ITEMS;\n\n\t\tcase \"branchId\":\n\t\t\treturn OrderErrors.BRANCH_NOT_SELECTED;\n\n\t\tdefault:\n\t\t\treturn OrderErrors.FIELD_REQUIRED_ERROR;\n\t}\n};\n\nexport * from \"./utils/item-price\";\n","import { FormErrors } from \"@sorocraft/ui\";\nimport { checkIsValidEmail } from \"@sorocraft/js-utils\";\n\nimport {\n\tCustomerAddress,\n\tCustomerAuthForm,\n\tCustomerAuthPhoneForm,\n\tCustomerAuthStep,\n} from \"./models\";\n\nexport const preparePhoneNumber = (form: CustomerAuthPhoneForm) => {\n\tconst phoneNumber = `${form.countryCode}${form.phoneNumber}`.replaceAll(\"+\", \"\");\n\n\treturn phoneNumber;\n};\n\nexport const validateForm = (form: CustomerAuthForm, step: CustomerAuthStep): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { email, otp } = form || {};\n\n\tswitch (step) {\n\t\tcase CustomerAuthStep.OTP: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\n\t\t\tif (!otp || otp.length !== 6) {\n\t\t\t\terrors.otp = \"Invalid OTP\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase CustomerAuthStep.EMAIL: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn errors;\n};\n\nexport const validateAddressForm = (form: CustomerAddress): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { countryCode, cityName, street, houseNumber } = form || {};\n\n\tif (!countryCode) errors.countryCode = \"COUNTRY_REQUIRED\";\n\tif (!cityName) errors.cityName = \"CITY_REQUIRED\";\n\tif (!street) errors.street = \"STREET_REQUIRED\";\n\tif (!houseNumber) errors.houseNumber = \"STREET_NUMBER_REQUIRED\";\n\n\treturn errors;\n};\n\nexport const formatCityLine = (fields: (string | undefined)[]) => {\n\treturn (fields || []).filter(Boolean).join(\", \");\n};\n\nexport const formatAddressLine = (\n\tstreet: string,\n\thouseNumber: string,\n\tadditionalNumber: string,\n) => {\n\tconst house = [houseNumber, additionalNumber].filter(Boolean).join(\"/\");\n\tconst fullAddress = [street, house].filter(Boolean).join(\" \");\n\n\treturn fullAddress;\n};\n","import { MenuAddon, MenuAddonOption } from \"./models\";\n\nexport const getAddonTranslation = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n\nexport const getAddonOptionTranslation = (option: MenuAddonOption, language: string): string => {\n\treturn option?.title?.[language] || \"\";\n};\n\nexport const getOptionTitles = (\n\toptions: MenuAddonOption[],\n\toptionIds: number | number[],\n\tlanguage: string,\n): string => {\n\tif (Array.isArray(optionIds)) {\n\t\treturn (options || [])\n\t\t\t.filter(({ id }) => optionIds.includes(id))\n\t\t\t.map(({ title }) => title?.[language] || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\", \");\n\t} else {\n\t\tconst option = (options || []).find(({ id }) => id === optionIds);\n\t\treturn option?.title?.[language] || \"\";\n\t}\n};\n\nexport const getAddonTitle = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\n\nimport { EmployeePermission, UserRole } from \"./models\";\n\nexport const getPermissionsByRole = (role?: UserRole) => {\n\tswitch (role) {\n\t\t/** Owner - Has every permission */\n\t\tcase UserRole.OWNER:\n\t\t\treturn [EmployeePermission.ALL];\n\n\t\t/** General Manager - All except subscription updates */\n\t\tcase UserRole.GENERAL_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.UPDATE_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_BRANCHES,\n\t\t\t\tEmployeePermission.UPDATE_BRANCH,\n\t\t\t\tEmployeePermission.CREATE_BRANCH,\n\t\t\t\tEmployeePermission.DELETE_BRANCH,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.CREATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.DELETE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Branch Manager - Controls operations within one branch */\n\t\tcase UserRole.BRANCH_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Chef - Manages menu and kitchen orders */\n\t\tcase UserRole.CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Sous Chef - Assists chef with orders and menu */\n\t\tcase UserRole.SOUS_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Pastry Chef - Limited to dessert menu items */\n\t\tcase UserRole.PASTRY_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Line Cook / Prep Cook / Kitchen Assistant - Read-only menu & order updates */\n\t\tcase UserRole.LINE_COOK:\n\t\tcase UserRole.PREP_COOK:\n\t\tcase UserRole.KITCHEN_ASSISTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Head Waiter - Full service control */\n\t\tcase UserRole.HEAD_WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t];\n\n\t\t/** Waiter - Handles orders and table service */\n\t\tcase UserRole.WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t];\n\n\t\t/** Runner - Sees and updates order delivery progress */\n\t\tcase UserRole.RUNNER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** ☕ Barista / Bartender / Sommelier / Room Service */\n\t\tcase UserRole.BARISTA:\n\t\tcase UserRole.BARTENDER:\n\t\tcase UserRole.SOMMELIER:\n\t\tcase UserRole.ROOM_SERVICE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Accountant - Analytics, reports, subscriptions */\n\t\tcase UserRole.ACCOUNTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t];\n\n\t\t/** Delivery Driver - Delivery orders only */\n\t\tcase UserRole.DELIVERY_DRIVER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** Inventory Manager - Controls menu stock-related items */\n\t\tcase UserRole.INVENTORY_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_PURCHASES,\n\t\t\t\tEmployeePermission.CREATE_PURCHASE,\n\t\t\t\tEmployeePermission.UPDATE_PURCHASE,\n\t\t\t\tEmployeePermission.DELETE_PURCHASE,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY_PRODUCTS,\n\t\t\t\tEmployeePermission.CREATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.UPDATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.DELETE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.VIEW_PURCHASE_DETAIL,\n\t\t\t\tEmployeePermission.VIEW_BRANCH_BALANCE,\n\t\t\t\tEmployeePermission.UPDATE_PRODUCT_INGREDIENTS,\n\t\t\t\tEmployeePermission.DELETE_PRODUCT_INGREDIENTS,\n\t\t\t];\n\n\t\t/** Purchasing Manager - Similar to inventory but more on creation/deletion */\n\t\tcase UserRole.PURCHASING_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t];\n\n\t\t/** Warehouse Staff - View only */\n\t\tcase UserRole.WAREHOUSE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t];\n\n\t\tdefault:\n\t\t\treturn [];\n\t}\n};\n\nexport const getHasUserPermission = (\n\trequiredPermissions: EmployeePermission[],\n\tuserPermissions: EmployeePermission[],\n) => {\n\tif (isEmpty(requiredPermissions)) return true;\n\tif (isEmpty(userPermissions)) return false;\n\tif (userPermissions.includes(EmployeePermission.ALL)) return true;\n\n\treturn requiredPermissions.some((permission) => userPermissions.includes(permission));\n};\n","import { getQueryParam } from \"@sorocraft/js-utils\";\n\nimport { FeatureSegment, type Feature } from \"./models\";\n\nimport { FEATURES_LIST } from \"./constants\";\n\nexport const getIsFeatureActive = (feature: Feature, businessSegment: FeatureSegment): boolean => {\n\t// Feature is force-enabled via query param\n\tif (getQueryParam(feature) === \"1\") return true;\n\n\t// Build the list of enabled segments for the current businessSegment\n\tconst enabledSegments: FeatureSegment[] =\n\t\tbusinessSegment === FeatureSegment.ALPHA\n\t\t\t? [FeatureSegment.ALPHA, FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: businessSegment === FeatureSegment.BETA\n\t\t\t? [FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: [FeatureSegment.ALL];\n\n\t// Check if feature exists in any of the enabled segments\n\treturn enabledSegments.some((segment) => FEATURES_LIST[segment]?.includes(feature));\n};\n","import { LocalizedContent, Product, ProductVariant, SellUnitType } from \"./models\";\n\nimport { MenuAddon } from \"src/modules/addon/models\";\n\nexport const getProductTranslation = (\n\tproduct: Pick<Product, \"translations\">,\n\tlanguage: string,\n): LocalizedContent => {\n\treturn product?.translations?.[language] || ({} as LocalizedContent);\n};\n\nexport const getProductVariant = (\n\tproduct: Pick<Product, \"variants\">,\n\tvariantId: number,\n): ProductVariant => {\n\treturn product?.variants?.find?.((item) => item.id === variantId) || ({} as ProductVariant);\n};\n\nexport const getProductVariantTranslation = (variant: ProductVariant, language: string): string => {\n\treturn variant?.title?.[language] || \"\";\n};\n\nexport const getProductAddon = (product: Product, addonId: number): MenuAddon => {\n\treturn (product?.addons || []).find(({ id }) => id === addonId) || ({} as MenuAddon);\n};\n\nexport const getPriceSuffix = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn \" / kg\";\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn \" / l\";\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n};\n\nexport const getProductSellUnitShortCuts = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn {\n\t\t\t\t\"50gr\": 0.05,\n\t\t\t\t\"100gr\": 0.1,\n\t\t\t\t\"150gr\": 0.15,\n\t\t\t\t\"200gr\": 0.2,\n\t\t\t\t\"250gr\": 0.25,\n\t\t\t\t\"300gr\": 0.3,\n\t\t\t\t\"350gr\": 0.35,\n\t\t\t\t\"400gr\": 0.4,\n\t\t\t\t\"450gr\": 0.45,\n\t\t\t\t\"500gr\": 0.5,\n\t\t\t\t\"600gr\": 0.6,\n\t\t\t\t\"700gr\": 0.7,\n\t\t\t\t\"750gr\": 0.75,\n\t\t\t\t\"800gr\": 0.8,\n\t\t\t\t\"850gr\": 0.85,\n\t\t\t\t\"900gr\": 0.9,\n\t\t\t\t\"950gr\": 0.95,\n\t\t\t\t\"1kg\": 1,\n\t\t\t\t\"2kg\": 2,\n\t\t\t\t\"5kg\": 5,\n\t\t\t\t\"10kg\": 10,\n\t\t\t\t\"20kg\": 20,\n\t\t\t};\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn {\n\t\t\t\t\"50ml\": 0.05,\n\t\t\t\t\"100ml\": 0.1,\n\t\t\t\t\"150ml\": 0.15,\n\t\t\t\t\"200ml\": 0.2,\n\t\t\t\t\"250ml\": 0.25,\n\t\t\t\t\"300ml\": 0.3,\n\t\t\t\t\"350ml\": 0.35,\n\t\t\t\t\"400ml\": 0.4,\n\t\t\t\t\"450ml\": 0.45,\n\t\t\t\t\"500ml\": 0.5,\n\t\t\t\t\"600ml\": 0.6,\n\t\t\t\t\"700ml\": 0.7,\n\t\t\t\t\"750ml\": 0.75,\n\t\t\t\t\"800ml\": 0.8,\n\t\t\t\t\"850ml\": 0.85,\n\t\t\t\t\"900ml\": 0.9,\n\t\t\t\t\"950ml\": 0.95,\n\t\t\t\t\"1l\": 1,\n\t\t\t\t\"2l\": 2,\n\t\t\t\t\"5l\": 5,\n\t\t\t\t\"10l\": 10,\n\t\t\t\t\"20l\": 20,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {};\n\t}\n};\n\nexport * from \"./utils/listing-price\";\nexport * from \"./utils/order-price\";\n","import * as categoryModels from \"src/modules/category/models\";\nimport * as productModels from \"src/modules/product/models\";\n\nimport { CategoryProductMap } from \"./models\";\n\nexport const prepareCategoryAndProductMap = (\n\tcategories: categoryModels.Category[],\n\tproducts: productModels.Product[]\n): CategoryProductMap[] => {\n\tconst productMap = products.reduce<Record<number, productModels.Product[]>>((map, product) => {\n\t\tif (!product.visible) return map;\n\n\t\tconst categoryId = Number(product.categoryId);\n\t\tif (!map[categoryId]) {\n\t\t\tmap[categoryId] = [];\n\t\t}\n\t\tmap[categoryId].push(product);\n\t\treturn map;\n\t}, {});\n\n\treturn categories\n\t\t.map((category) => ({\n\t\t\t...category,\n\t\t\tproducts: (productMap[Number(category.id)] || []) as productModels.Product[],\n\t\t}))\n\t\t.filter((category) => category?.products?.length > 0);\n};\n"],"names":["ProductView","SellUnitType","getUnitListingPrice","item","_a","_b","listingPrice","price","MenuAddonSelectType","getAllSelectedOptionsListingPrice","product","selectedAddons","total","addon","addons","id","addonId","selectType","options","Object","prototype","hasOwnProperty","call","selection","selectedOptionIds","SINGLE","optionId","option","find","OrderType","OrderStatus","OrderItemStatus","PaymentMethod","OrderStep","OrderErrors","SuppressedError","CASH","CART","DETAILS","COMPLETED","getOrderItemListingRawPrice","orderItem","variant","quantity","baseUnitPrice","addonsUnitPrice","reduce","addonSum","optionSum","CustomerAuthStep","CustomerAddressType","Feature","FeatureSegment","FEATURES_LIST","ALPHA","UPLOAD_VIDEO","BETA","ALL","DOMAIN","IMAGE_BASE_URL","validators","number","AZERBAIJANI_PREFIXES","RegExp","join","test","isValid","error","keyStr","triplet","e1","e2","e3","charAt","getCategoryTranslation","category","language","translations","EmployeePermission","UserRole","hex","deltaPct","n","parseInt","replace","r","g","b","max","Math","min","l","h","s","d","newL","hueToRgb","p","q","t","r2","g2","b2","toHex","x","round","toString","padStart","contact","isEmpty","populated","entries","filter","value","length","fromEntries","latitude","longitude","floor","rest","e","indexOf","getOwnPropertySymbols","i","propertyIsEnumerable","__rest","assign","Number","productAddons","map","addonIdStr","selected","Array","isArray","includes","street","houseNumber","additionalNumber","Boolean","fields","productId","variantId","Error","orderItemsId","addonIdsPart","optionIds","sortNumbers","title","hostname","locale","url","domain","categoryId","categories","name","coverPhoto","startsWith","settings","isOpen","isDelivering","deliveryOrderEnabled","dineInOrderEnabled","pickupOrderEnabled","DELIVERY","DINE_IN","PICK_UP","requiredPermissions","userPermissions","some","permission","image","feature","businessSegment","getQueryParam","segment","logoImage","currency","priceFormatter","field","ADDRESS_IS_EMPTY","TABLE_NOT_SELECTED","EMPTY_ITEMS","BRANCH_NOT_SELECTED","FIELD_REQUIRED_ERROR","totalPrice","role","OWNER","GENERAL_MANAGER","VIEW_BUSINESS","UPDATE_BUSINESS","VIEW_ORDERS","UPDATE_ORDER","CREATE_ORDER","VIEW_QR_MENU","VIEW_QR_CODES","VIEW_MENU","VIEW_MENU_ITEMS","UPDATE_MENU_ITEM","CREATE_MENU_ITEM","DELETE_MENU_ITEM","VIEW_CATEGORIES","UPDATE_CATEGORY","CREATE_CATEGORY","DELETE_CATEGORY","VIEW_ADDONS","UPDATE_ADDON","CREATE_ADDON","DELETE_ADDON","VIEW_TABLES","UPDATE_TABLE","CREATE_TABLE","DELETE_TABLE","VIEW_BRANCHES","UPDATE_BRANCH","CREATE_BRANCH","DELETE_BRANCH","VIEW_EMPLOYEES","UPDATE_EMPLOYEE","CREATE_EMPLOYEE","DELETE_EMPLOYEE","VIEW_ANALYTICS","VIEW_SALES_REPORTS","VIEW_SUBSCRIPTION","CREATE_QR_CODE","DELETE_QR_CODE","AI_ASSISTANT","BRANCH_MANAGER","CHEF","SOUS_CHEF","PASTRY_CHEF","LINE_COOK","PREP_COOK","KITCHEN_ASSISTANT","HEAD_WAITER","UPDATE_TABLE_STATUS","WAITER","RUNNER","BARISTA","BARTENDER","SOMMELIER","ROOM_SERVICE_STAFF","ACCOUNTANT","DELIVERY_DRIVER","INVENTORY_MANAGER","VIEW_PURCHASES","CREATE_PURCHASE","UPDATE_PURCHASE","DELETE_PURCHASE","VIEW_INVENTORY","VIEW_INVENTORY_PRODUCTS","CREATE_INVENTORY_PRODUCT","UPDATE_INVENTORY_PRODUCT","DELETE_INVENTORY_PRODUCT","VIEW_PURCHASE_DETAIL","VIEW_BRANCH_BALANCE","UPDATE_PRODUCT_INGREDIENTS","DELETE_PRODUCT_INGREDIENTS","PURCHASING_MANAGER","WAREHOUSE_STAFF","sellUnitType","WEIGHT","VOLUME","keys","variants","undefined","source","status","Check","DELIVERED","BagCheck","OUT_FOR_DELIVERY","Delivery","PREPARING","Chef","CONFIRMED","FileCheck","PENDING","HourglassHalf","video","data","totalPriceWithoutTax","totalPriceWithTax","totalPriceWithTaxAndFees","totalTax","deliveryFee","serviceFee","items","taxes","products","productMap","visible","push","form","countryCode","phoneNumber","replaceAll","errors","cityName","step","email","otp","OTP","checkIsValidEmail","EMAIL","cleaned","nationalNumber","slice","validator"],"mappings":"mFAgDA,IAAYA,EASAC,GATZ,SAAYD,GACXA,EAAA,KAAA,OACAA,EAAA,KAAA,MACA,CAHD,CAAYA,IAAAA,EAAW,CAAA,IASvB,SAAYC,GACXA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,OAAA,QACA,CAJD,CAAYA,IAAAA,EAAY,CAAA,ICrDjB,MAAMC,EAAuBC,IAG/B,IAAAC,EAAAC,EAAC,OAAiC,QAAjCA,EAAkB,QAAlBD,EAAAD,aAAI,EAAJA,EAAMG,oBAAY,IAAAF,EAAAA,EAAID,aAAI,EAAJA,EAAMI,aAAK,IAAAF,EAAAA,EAAI,GCP3C,IAAYG,GAAZ,SAAYA,GACXA,EAAA,OAAA,SACAA,EAAA,SAAA,UACA,CAHD,CAAYA,IAAAA,EAAmB,CAAA,ICQxB,MAAMC,EAAoC,CAChDC,EACAC,EAA6C,MAE7C,IAAIC,EAAQ,EAEZ,IAAK,MAAMC,KAASH,aAAO,EAAPA,EAASI,SAAU,GAAI,CAC1C,MAAQC,GAAIC,EAAOC,WAAEA,EAAUC,QAAEA,GAAYL,EAE7C,IAAKM,OAAOC,UAAUC,eAAeC,KAAKX,EAAgBK,GAAU,SAEpE,MAAMO,EAAYZ,EAAeK,GAC3BQ,EACLP,IAAeT,EAAoBiB,OAChC,CAACF,GACCA,GAAa,GAEnB,IAAK,MAAMG,KAAYF,EAAmB,CACzC,MAAMG,GAAUT,GAAW,IAAIU,KAAK,EAAGb,QAASA,IAAOW,GACnDC,IAAQf,GAASV,EAAoByB,GAC1C,CACD,CAEA,OAAOf,GC5BR,IAAYiB,EAMAC,EAaAC,EAOAC,EAwEAC,ECtFAC,ECyTsC,mBAApBC,iBAAiCA,gBFrU/D,SAAYN,GACXA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J,GAAUG,EAAAA,kBAAkBH,KAChCH,EAAOG,MAAQ,yBASlB,OAAOH,+BJHF,SAA8BF,GACnC,IAAKA,EACJ,MAAO,CAAEpO,SAAS,EAAOC,MAAO,kBAGjC,MAAM6O,EAAUV,EAAYlN,QAAQ,MAAO,IAErCiN,EAAcW,EAAQpJ,WAAW,OAAS,MAAQoJ,EAAQpJ,WAAW,MAAQ,KAAO,KAE1F,IAAKyI,EACJ,MAAO,CAAEnO,SAAS,EAAOC,MAAO,4BAGjC,MAAM8O,EAAiBD,EAAQE,MAAMb,EAAYnL,QAGjD,OAAOiM,EAFWvP,EAAWyO,IAEZY,EAClB","x_google_ignoreList":[6]}
1
+ {"version":3,"file":"index.js","sources":["../../../src/modules/product/models.ts","../../../src/modules/product/utils/listing-price.ts","../../../src/modules/addon/models.ts","../../../src/modules/product/utils/order-price.ts","../../../src/modules/order/models.ts","../../../src/modules/order/constants.ts","../../node_modules/tslib/tslib.es6.js","../../../src/modules/order/utils/item-price.ts","../../../src/modules/customer/models.ts","../../../src/modules/feature/models.ts","../../../src/modules/feature/constants.ts","../../../src/modules/view/constants.ts","../../../src/modules/view/utils.ts","../../../src/modules/category/utils.ts","../../../src/modules/user/models.ts","../../../src/modules/user/utils.ts","../../../src/modules/pos/constants/posCompliance.ts","../../../src/modules/pos/constants/countries.ts","../../../src/modules/pos/utils/posCompliance.ts","../../../src/modules/order/utils.ts","../../../src/modules/customer/utils.ts","../../../src/modules/addon/utils.ts","../../../src/modules/feature/utils.ts","../../../src/modules/product/utils.ts","../../../src/modules/menu/utils.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface LocalizedContent {\n\tname: string;\n\tdescription: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied.\n\t */\n\tlistingPrice: number;\n\t/** Title keyed by language code, e.g. { en: \"Large\", az: \"Böyük\" }. */\n\ttitle: Record<string, string>;\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\t/** Net price (tax-exclusive). Nullable when the product has no own price (variant-only). */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied,\n\t * and is null when `price` itself is null.\n\t */\n\tlistingPrice?: number | null;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: Record<string, LocalizedContent>;\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n\tvideoUrl?: string;\n\tsellUnitType?: SellUnitType;\n\ttaxClassId?: number | null;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n\nexport interface DashboardProduct extends Omit<Product, \"addons\"> {\n\taddons: number[];\n}\n\nexport enum SellUnitType {\n\tPIECE = \"PIECE\",\n\tWEIGHT = \"WEIGHT\",\n\tVOLUME = \"VOLUME\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { Product, ProductVariant } from \"../models\";\nimport { MenuAddonOption } from \"src/models\";\n\nexport const getUnitListingPrice = (item: {\n\tprice?: number | null;\n\tlistingPrice?: number | null;\n}) => item?.listingPrice ?? item?.price ?? 0;\n\nexport const getProductListingPrice = (product: Product, currency: string, language: string) => {\n\tconst listingPrice = getUnitListingPrice(product);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getVariantListingPrice = (\n\tvariant: ProductVariant,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(variant);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getOptionListingPrice = (\n\toption: MenuAddonOption,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(option);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n","export enum MenuAddonSelectType {\n\tSINGLE = \"SINGLE\",\n\tMULTIPLE = \"MULTIPLE\",\n}\n\nexport interface MenuAddonOption {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus the parent product's\n\t * `addToListingPrice` taxes. Equals `price` when no branch context is\n\t * supplied (e.g. addon detached from a branch tax setup).\n\t */\n\tlistingPrice: number;\n\ttitle: Record<string, string>;\n\tremove?: boolean;\n}\n\nexport interface MenuAddon {\n\tid?: number;\n\tselectType: MenuAddonSelectType;\n\toptions: MenuAddonOption[];\n\tbusinessId?: number;\n\ttitle: Record<string, string>;\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport { MenuAddonSelectType } from \"src/modules/addon/models\";\nimport * as orderModels from \"src/modules/order/models\";\n\nimport { Product } from \"../models\";\nimport { getUnitListingPrice } from \"./listing-price\";\n\nexport const getAllSelectedOptionsListingPrice = (\n\tproduct: Pick<Product, \"addons\">,\n\tselectedAddons: orderModels.SelectedAddons = {},\n): number => {\n\tlet total = 0;\n\n\tfor (const addon of product?.addons || []) {\n\t\tconst { id: addonId, selectType, options } = addon;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(selectedAddons, addonId)) continue;\n\n\t\tconst selection = selectedAddons[addonId];\n\t\tconst selectedOptionIds =\n\t\t\tselectType === MenuAddonSelectType.SINGLE\n\t\t\t\t? [selection as number]\n\t\t\t\t: ((selection || []) as number[]);\n\n\t\tfor (const optionId of selectedOptionIds) {\n\t\t\tconst option = (options || []).find(({ id }) => id === optionId);\n\t\t\tif (option) total += getUnitListingPrice(option);\n\t\t}\n\t}\n\n\treturn total;\n};\n\nexport const getProductOrderPrice = ({\n\tproduct,\n\tquantity,\n\tlanguage,\n\tcurrency,\n\tvariantId,\n\tselectedAddons,\n}: {\n\tproduct: Product;\n\tquantity: number;\n\tlanguage: string;\n\tcurrency: string;\n\tvariantId?: number;\n\tselectedAddons?: Record<number, number | number[]>;\n}) => {\n\tif (!product || Object.keys(product).length === 0) {\n\t\treturn priceFormatter(0, currency, language);\n\t}\n\n\tconst variant = variantId\n\t\t? (product.variants || []).find(({ id }) => id === variantId)\n\t\t: undefined;\n\n\tconst baseUnitPrice = variantId ? getUnitListingPrice(variant) : getUnitListingPrice(product);\n\tconst optionsUnitPrice = getAllSelectedOptionsListingPrice(product, selectedAddons);\n\n\tconst totalPrice = (baseUnitPrice + optionsUnitPrice) * quantity;\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","import * as customerModels from \"../customer/models\";\nimport * as productModels from \"../product/models\";\n\nexport enum OrderType {\n\tDINE_IN = \"DINE_IN\",\n\tPICK_UP = \"PICK_UP\",\n\tDELIVERY = \"DELIVERY\",\n}\n\nexport enum OrderStatus {\n\tDRAFT = \"DRAFT\",\n\tPENDING = \"PENDING\",\n\tCONFIRMED = \"CONFIRMED\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tOUT_FOR_DELIVERY = \"OUT_FOR_DELIVERY\",\n\tDELIVERED = \"DELIVERED\",\n\tCOMPLETED = \"COMPLETED\",\n\tCANCELLED = \"CANCELLED\",\n\tFAILED = \"FAILED\",\n}\n\nexport enum OrderItemStatus {\n\tPENDING = \"PENDING\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tSERVED = \"SERVED\",\n}\n\nexport enum PaymentMethod {\n\tCASH = \"CASH\",\n\tCARD = \"CARD\",\n\tWALLET = \"WALLET\",\n\tTERMINAL = \"TERMINAL\",\n}\n\nexport interface OrderAddonOption {\n\toptionId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderAddon {\n\tid?: number;\n\taddonId: number;\n\toptions: OrderAddonOption[];\n}\n\nexport interface SelectedAddons {\n\t[key: number]: number | number[];\n}\n\nexport interface OrderItemVariant {\n\tid?: number;\n\tvariantId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderItem {\n\tid?: number;\n\tproductId: number;\n\torderId?: number;\n\tquantity: number;\n\t/**\n\t * Gross unit price (listingPrice) at the moment the line was added. The\n\t * server recomputes authoritative totals on create/preview; this value is\n\t * what the cart UI displays.\n\t */\n\tprice?: number;\n\tvariant?: OrderItemVariant;\n\taddons: OrderAddon[];\n\tnote?: string;\n\tstatus?: OrderItemStatus;\n\tisPaid?: boolean;\n\tsellUnitType: productModels.SellUnitType;\n}\n\nexport interface Order {\n\tid?: number;\n\tbusinessId?: number;\n\tbranchId?: number;\n\tworkingDayId?: number;\n\ttableId?: number;\n\temployeeId?: number;\n\torderType: OrderType;\n\titems: OrderItem[];\n\tstatus?: OrderStatus;\n\tpreferredPaymentMethod?: PaymentMethod;\n\t/**\n\t * Customer's optional voluntary gratuity as a NUMERIC money string in the\n\t * branch currency (e.g. \"5.00\"). Honoured only on the customer and guest\n\t * create paths — POS ignores it. It is an unfinalized intent: the server\n\t * stores it but never adds it to the order total nor taxes it, so the\n\t * tip-inclusive total shown at checkout is computed client-side. Absent (or\n\t * zero) means no tip.\n\t */\n\tpreferredTipAmount?: string;\n\tnote?: string;\n\tcreatedAt?: number;\n\tupdatedAt?: number;\n\tcustomer?: customerModels.Customer;\n\tcurrency?: string;\n\ttrackingId?: string;\n}\n\nexport interface OrderItems {\n\t[key: string]: OrderItem;\n}\n\nexport enum OrderStep {\n\tCART = \"CART\",\n\tDETAILS = \"DETAILS\",\n\tCOMPLETED = \"COMPLETED\",\n}\n\nexport interface OrderPayload extends Order {\n\tcustomerAddressId: number;\n\tcustomerId: number;\n\tlanguage?: string;\n}\n\n/**\n * Contact + delivery snapshot an unregistered (\"guest\") visitor enters at\n * checkout. Mirrors the backend GuestContact: every field is optional, and an\n * address is only meaningful for DELIVERY orders. latitude/longitude are kept\n * as numbers here for the UI (they come from the address autocomplete); they're\n * serialized to strings in the wire payload — see GuestContactRequest.\n */\nexport interface GuestContact {\n\tfullName?: string;\n\tphoneNumber?: string;\n\temail?: string;\n\tstreet?: string;\n\thouseNumber?: string;\n\tadditionalNumber?: string;\n\tfloor?: number;\n\tlatitude?: number;\n\tlongitude?: number;\n\tcityName?: string;\n\tcountryCode?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n}\n\n/**\n * Wire shape of the contact sent to POST /order/public. Matches the backend\n * GuestContact, where latitude/longitude are strings.\n */\nexport interface GuestContactRequest\n\textends Omit<GuestContact, \"latitude\" | \"longitude\"> {\n\tlatitude?: string;\n\tlongitude?: string;\n}\n\n/**\n * Payload for the public, non-authenticated create path (POST /order/public).\n * Unlike OrderPayload it carries no customerId/customerAddressId — an\n * unregistered visitor has no account or stored address book; the delivery\n * address (when given) travels inside the contact snapshot.\n */\nexport interface GuestOrderPayload extends Order {\n\tlanguage?: string;\n\tcontact?: GuestContactRequest;\n}\n\nexport interface CalculatePreviewItemRequest {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tvariant?: { variantId: number };\n\taddons?: Array<{\n\t\taddonId: number;\n\t\toptions: Array<{ optionId: number }>;\n\t}>;\n}\n\nexport interface CalculatePreviewRequest {\n\tbusinessId?: number;\n\tbranchId: number;\n\torderType: OrderType;\n\titems: CalculatePreviewItemRequest[];\n}\n\nexport interface CalculatePreviewTax {\n\tbranchTaxId: number;\n\tname: Record<string, string>;\n\trate: number;\n\ttype: \"percentage\" | \"fixed\";\n\taddToListingPrice: boolean;\n\tamount: number;\n}\n\nexport interface CalculatePreviewLine {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tprice: number;\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface CalculatePreviewResponse {\n\ttotalPriceWithoutTax: number;\n\ttotalPriceWithTax: number;\n\ttotalPriceWithTaxAndFees: number;\n\ttotalTax: number;\n\tdeliveryFee: number;\n\tserviceFee: number;\n\titems: CalculatePreviewLine[];\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface OrderPreviewState {\n\tdata: CalculatePreviewResponse | null;\n\tisLoading: boolean;\n\terror: string | null;\n}\n","import { OrderPreviewState, OrderStep, PaymentMethod } from \"./models\";\n\nexport const initialOrder = {\n\torderType: null,\n\tpreferredPaymentMethod: PaymentMethod.CASH,\n};\n\nexport const ORDER_STEPS = [OrderStep.CART, OrderStep.DETAILS, OrderStep.COMPLETED];\n\n// Preset gratuity percentages offered at checkout. Following hospitality\n// (HORECA) convention the tip is applied to the pre-tax food & beverage\n// subtotal — tax and service/delivery fees are excluded from the base.\nexport const TIP_PERCENTAGES = [10, 15, 20];\n\nexport const initialPreviewState: OrderPreviewState = {\n\tdata: null,\n\tisLoading: false,\n\terror: null,\n};\n\nexport enum OrderErrors {\n\tFIELD_REQUIRED_ERROR = \"This field is required\",\n\tTABLE_NOT_SELECTED = \"Please select a table\",\n\tADDRESS_IS_EMPTY = \"Please enter an address\",\n\tEMPTY_ITEMS = \"Please choose product\",\n\tBRANCH_NOT_SELECTED = \"Please select a branch\",\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { OrderItem } from \"../models\";\n\nexport const getOrderItemListingRawPrice = (orderItem: OrderItem) => {\n\tconst { price, variant, addons, quantity } = orderItem || {};\n\n\tconst baseUnitPrice = variant?.price ?? price ?? 0;\n\n\tconst addonsUnitPrice = (addons || []).reduce(\n\t\t(addonSum, addon) =>\n\t\t\taddonSum +\n\t\t\t(addon?.options || []).reduce((optionSum, option) => optionSum + (option?.price ?? 0), 0),\n\t\t0,\n\t);\n\n\tconst unitPrice = baseUnitPrice + addonsUnitPrice;\n\treturn unitPrice * (quantity ?? 1);\n};\n\nexport const getOrderItemListingPrice = (\n\torderItem: OrderItem,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst totalPrice = getOrderItemListingRawPrice(orderItem);\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","export enum CustomerAuthStep {\n\tPHONE = \"PHONE\",\n\tOTP = \"OTP\",\n\tEMAIL = \"EMAIL\",\n}\n\nexport enum CustomerAddressType {\n\tHOME = \"HOME\",\n\tWORK = \"WORK\",\n\tTRAVEL = \"TRAVEL\",\n}\n\nexport interface CustomerAddress {\n\tid?: number;\n\taddressId?: number; // Update address temporary\n\tcountryCode: string;\n\tcityName: string;\n\tstreet: string;\n\thouseNumber: string;\n\tadditionalNumber?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n\tfloor?: number;\n\tlongitude?: number;\n\tlatitude?: number;\n\ttitle?: string;\n\ttype?: CustomerAddressType;\n}\n\nexport interface CustomerAuthForm {\n\totp: string;\n\temail: string;\n}\n\nexport interface CustomerAuthPhoneForm {\n\tcountryCode: string;\n\tphoneNumber: string;\n}\n\nexport interface AuthResponse {\n\taccessToken: string;\n\trefreshToken: string;\n}\n\nexport interface Customer {\n\tid?: number;\n\temail: string;\n\tphoneNumber: string;\n\tfullName: string;\n\tsmsVerified?: boolean;\n\temailVerified?: boolean;\n\taddress?: CustomerAddress;\n\taddresses?: CustomerAddress[];\n}\n\nexport type CustomerUpdatePayload = Partial<Customer>;\n","export enum Feature {\n\tUPLOAD_VIDEO = \"UPLOAD_VIDEO\",\n}\nexport enum FeatureSegment {\n\tALPHA = \"ALPHA\",\n\tBETA = \"BETA\",\n\tALL = \"ALL\",\n}\n","import { Feature, FeatureSegment } from \"./models\";\n\nexport const FEATURES_LIST: { [key in FeatureSegment]: Feature[] } = {\n\t[FeatureSegment.ALPHA]: [Feature.UPLOAD_VIDEO],\n\t[FeatureSegment.BETA]: [],\n\t[FeatureSegment.ALL]: [],\n};\n","export const MODALS = {\n\tADD_UPDATE_NOTES: \"ADD_UPDATE_NOTES\",\n\tAUTH: \"AUTH\",\n\tADD_UPDATE_ADDRESS: \"ADD_UPDATE_ADDRESS\",\n\tBRANCH_BUSINESS_HOURS: \"BRANCH_BUSINESS_HOURS\",\n\tPRODUCT_DETAILS: \"PRODUCT_DETAILS\",\n};\n\nexport const SUPPORTED_LOCALES = [\"en\", \"az\", \"nl\", \"et\", \"tr\", \"ru\", \"pl\", \"pt\", \"hr\"];\nexport const SUPPORTED_COUNTRIES = [\n\t{\n\t\tname: \"Azerbaijan\",\n\t\tcode: \"AZ\",\n\t\tphoneCode: \"+994\",\n\t},\n];\n\nexport const DOMAIN = \"tabres.com\";\n\nexport const DEFAULT_HOSTNAME = DOMAIN;\n\nexport const IMAGE_BASE_URL = \"https://images.tabres.com\";\n","import { DOMAIN, IMAGE_BASE_URL } from \"./constants\";\n\ninterface ValidationResult {\n\tisValid: boolean;\n\terror?: string;\n}\n\ntype Validator = (cleanedNumber: string) => ValidationResult;\n\nconst validators: Record<string, Validator> = {\n\t\"994\": (number) => {\n\t\tconst AZERBAIJANI_PREFIXES = [\"50\", \"51\", \"10\", \"55\", \"99\", \"70\", \"77\", \"60\"];\n\t\tconst pattern = new RegExp(`^(${AZERBAIJANI_PREFIXES.join(\"|\")})\\\\d{7}$`);\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: `Azerbaijani numbers must be 9 digits and start with ${AZERBAIJANI_PREFIXES.join(\n\t\t\t\t\t\", \"\n\t\t\t\t)}`,\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n\n\t\"31\": (number) => {\n\t\tconst pattern = /^\\d{9}$/;\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: \"Dutch numbers must be exactly 9 digits\",\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n};\n\nexport function validatePhoneNumber(phoneNumber: string): ValidationResult {\n\tif (!phoneNumber) {\n\t\treturn { isValid: false, error: \"FIELD_REQUIRED\" };\n\t}\n\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\n\tconst countryCode = cleaned.startsWith(\"994\") ? \"994\" : cleaned.startsWith(\"31\") ? \"31\" : null;\n\n\tif (!countryCode) {\n\t\treturn { isValid: false, error: \"Unsupported country code\" };\n\t}\n\n\tconst nationalNumber = cleaned.slice(countryCode.length);\n\tconst validator = validators[countryCode];\n\n\treturn validator(nationalNumber);\n}\n\nexport const getBaseUrl = (hostname: string, language: string) => {\n\tconst locale = language || \"en\";\n\t// Local env\n\tif (hostname === \"localhost:3000\") {\n\t\treturn { url: `http://localhost:3000/${locale}`, domain: DOMAIN };\n\t}\n\t// Prod env\n\treturn { url: `https://${DOMAIN}/${locale}`, domain: DOMAIN };\n};\n\nexport const getRegisterUrl = (language: string, source: string) => {\n\treturn `https://app.tabres.com/auth/register?lang=${language}&utm_source=${source}`;\n};\n\nexport const getImageSource = (image?: string) => {\n\tif (!image) return \"\";\n\n\tif (image.includes(\"base64\") || image.startsWith(\"https://\")) return image;\n\n\treturn `${IMAGE_BASE_URL}/${image}`;\n};\n\nexport const getLogoImageSource = (logoImage?: string) => {\n\tif (!logoImage) return \"https://images.tabres.com/no-photo-128.webp\";\n\n\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n};\n\nexport const getCoverPhotoSource = (coverPhoto?: string) => {\n\tif (!coverPhoto) return \"https://images.tabres.com/tabres-doodle.webp\";\n\n\tif (coverPhoto.includes(\"base64\") || coverPhoto.startsWith(\"https://\")) return coverPhoto;\n\n\treturn `${IMAGE_BASE_URL}/${coverPhoto}`;\n};\n\nconst keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\nconst triplet = (e1: number, e2: number, e3: number) =>\n\tkeyStr.charAt(e1 >> 2) +\n\tkeyStr.charAt(((e1 & 3) << 4) | (e2 >> 4)) +\n\tkeyStr.charAt(((e2 & 15) << 2) | (e3 >> 6)) +\n\tkeyStr.charAt(e3 & 63);\n\nexport const rgbDataURL = (r: number, g: number, b: number) =>\n\t`data:image/gif;base64,R0lGODlhAQABAPAA${\n\t\ttriplet(0, r, g) + triplet(b, 255, 255)\n\t}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`;\n\nexport const getVideoSource = (video?: string) => {\n\tif (!video) return \"\";\n\n\tif (video.includes(\"base64\") || video.startsWith(\"https://\")) return video;\n\n\treturn `${IMAGE_BASE_URL}/${video}`;\n};\n\nexport const adjustLightness = (hex: string, deltaPct: number) => {\n\tconst n = parseInt(hex.replace(\"#\", \"\"), 16);\n\tconst r = ((n >> 16) & 0xff) / 255;\n\tconst g = ((n >> 8) & 0xff) / 255;\n\tconst b = (n & 0xff) / 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\tconst l = (max + min) / 2;\n\tlet h = 0;\n\tlet s = 0;\n\tif (max !== min) {\n\t\tconst d = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / d + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / d + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / d + 4;\n\t\t\t\tbreak;\n\t\t}\n\t\th /= 6;\n\t}\n\n\tconst newL = Math.max(0, Math.min(1, l + deltaPct / 100));\n\n\tconst hueToRgb = (p: number, q: number, t: number) => {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n\t\treturn p;\n\t};\n\n\tlet r2 = newL;\n\tlet g2 = newL;\n\tlet b2 = newL;\n\tif (s !== 0) {\n\t\tconst q = newL < 0.5 ? newL * (1 + s) : newL + s - newL * s;\n\t\tconst p = 2 * newL - q;\n\t\tr2 = hueToRgb(p, q, h + 1 / 3);\n\t\tg2 = hueToRgb(p, q, h);\n\t\tb2 = hueToRgb(p, q, h - 1 / 3);\n\t}\n\n\tconst toHex = (x: number) =>\n\t\tMath.round(x * 255)\n\t\t\t.toString(16)\n\t\t\t.padStart(2, \"0\");\n\treturn `#${toHex(r2)}${toHex(g2)}${toHex(b2)}`;\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\nimport { Category, CategoryTranslation } from \"./models\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n\nexport const getCategoryNameById = (\n\tcategoryId: number,\n\tcategories: Category[],\n\tlanguage: string\n): string => {\n\tconst category = categories?.find?.(({ id }) => id === categoryId);\n\n\tif (isEmpty(category)) return \"\";\n\n\tconst { name } = getCategoryTranslation(category, language);\n\n\treturn name || \"\";\n};\n","export enum EmployeePermission {\n\tVIEW_BUSINESS = \"VIEW_BUSINESS\",\n\tUPDATE_BUSINESS = \"UPDATE_BUSINESS\",\n\tVIEW_BUSINESS_FINANCIALS = \"VIEW_BUSINESS_FINANCIALS\",\n\tVIEW_ORDERS = \"VIEW_ORDERS\",\n\tUPDATE_ORDER = \"UPDATE_ORDER\",\n\tCREATE_ORDER = \"CREATE_ORDER\",\n\tAPPLY_DISCOUNT = \"APPLY_DISCOUNT\",\n\tVIEW_QR_MENU = \"VIEW_QR_MENU\",\n\tUPDATE_QR_MENU = \"UPDATE_QR_MENU\",\n\tVIEW_MENU = \"VIEW_MENU\",\n\tVIEW_MENU_ITEMS = \"VIEW_MENU_ITEMS\",\n\tCREATE_MENU_ITEM = \"CREATE_MENU_ITEM\",\n\tUPDATE_MENU_ITEM = \"UPDATE_MENU_ITEM\",\n\tDELETE_MENU_ITEM = \"DELETE_MENU_ITEM\",\n\tVIEW_CATEGORIES = \"VIEW_CATEGORIES\",\n\tUPDATE_CATEGORY = \"UPDATE_CATEGORY\",\n\tCREATE_CATEGORY = \"CREATE_CATEGORY\",\n\tDELETE_CATEGORY = \"DELETE_CATEGORY\",\n\tVIEW_ADDONS = \"VIEW_ADDONS\",\n\tUPDATE_ADDON = \"UPDATE_ADDON\",\n\tCREATE_ADDON = \"CREATE_ADDON\",\n\tDELETE_ADDON = \"DELETE_ADDON\",\n\tVIEW_TABLES = \"VIEW_TABLES\",\n\tUPDATE_TABLE = \"UPDATE_TABLE\",\n\tUPDATE_TABLE_STATUS = \"UPDATE_TABLE_STATUS\",\n\tCREATE_TABLE = \"CREATE_TABLE\",\n\tDELETE_TABLE = \"DELETE_TABLE\",\n\tVIEW_BRANCHES = \"VIEW_BRANCHES\",\n\tUPDATE_BRANCH = \"UPDATE_BRANCH\",\n\tCREATE_BRANCH = \"CREATE_BRANCH\",\n\tDELETE_BRANCH = \"DELETE_BRANCH\",\n\tVIEW_EMPLOYEES = \"VIEW_EMPLOYEES\",\n\tUPDATE_EMPLOYEE = \"UPDATE_EMPLOYEE\",\n\tCREATE_EMPLOYEE = \"CREATE_EMPLOYEE\",\n\tDELETE_EMPLOYEE = \"DELETE_EMPLOYEE\",\n\tVIEW_ANALYTICS = \"VIEW_ANALYTICS\",\n\tVIEW_SALES_REPORTS = \"VIEW_SALES_REPORTS\",\n\tVIEW_SUBSCRIPTION = \"VIEW_SUBSCRIPTION\",\n\tUPDATE_SUBSCRIPTION = \"UPDATE_SUBSCRIPTION\",\n\tVIEW_QR_CODES = \"VIEW_QR_CODES\",\n\tCREATE_QR_CODE = \"CREATE_QR_CODE\",\n\tDELETE_QR_CODE = \"DELETE_QR_CODE\",\n\tALL = \"ALL\",\n\t// Inventory\n\tVIEW_INVENTORY = \"VIEW_INVENTORY\",\n\tVIEW_PURCHASES = \"VIEW_PURCHASES\",\n\tVIEW_PURCHASE_DETAIL = \"VIEW_PURCHASE_DETAIL\",\n\tCREATE_PURCHASE = \"CREATE_PURCHASE\",\n\tUPDATE_PURCHASE = \"UPDATE_PURCHASE\",\n\tDELETE_PURCHASE = \"DELETE_PURCHASE\",\n\tVIEW_INVENTORY_PRODUCTS = \"VIEW_INVENTORY_PRODUCTS\",\n\tCREATE_INVENTORY_PRODUCT = \"CREATE_INVENTORY_PRODUCT\",\n\tUPDATE_INVENTORY_PRODUCT = \"UPDATE_INVENTORY_PRODUCT\",\n\tDELETE_INVENTORY_PRODUCT = \"DELETE_INVENTORY_PRODUCT\",\n\tVIEW_BUSINESS_BALANCE = \"VIEW_BUSINESS_BALANCE\",\n\tVIEW_BRANCH_BALANCE = \"VIEW_BRANCH_BALANCE\",\n\tUPDATE_PRODUCT_INGREDIENTS = \"UPDATE_PRODUCT_INGREDIENTS\",\n\tDELETE_PRODUCT_INGREDIENTS = \"DELETE_PRODUCT_INGREDIENTS\",\n\tAI_ASSISTANT = \"AI_ASSISTANT\",\n\tVIEW_PAYMENTS = \"VIEW_PAYMENTS\",\n\tTAKE_PAYMENT = \"TAKE_PAYMENT\",\n\tREFUND_PAYMENT = \"REFUND_PAYMENT\",\n\tPAYMENT_COMP = \"COMP\",\n}\n\nexport enum UserRole {\n\tOWNER = \"OWNER\",\n\tBRANCH_MANAGER = \"BRANCH_MANAGER\",\n\tGENERAL_MANAGER = \"GENERAL_MANAGER\",\n\tCHEF = \"CHEF\",\n\tSOUS_CHEF = \"SOUS_CHEF\",\n\tPASTRY_CHEF = \"PASTRY_CHEF\",\n\tLINE_COOK = \"LINE_COOK\",\n\tPREP_COOK = \"PREP_COOK\",\n\tKITCHEN_ASSISTANT = \"KITCHEN_ASSISTANT\",\n\tDISHWASHER = \"DISHWASHER\",\n\tHEAD_WAITER = \"HEAD_WAITER\",\n\tWAITER = \"WAITER\",\n\tRUNNER = \"RUNNER\",\n\tBARISTA = \"BARISTA\",\n\tBARTENDER = \"BARTENDER\",\n\tSOMMELIER = \"SOMMELIER\",\n\tACCOUNTANT = \"ACCOUNTANT\",\n\tROOM_SERVICE_STAFF = \"ROOM_SERVICE_STAFF\",\n\tDELIVERY_DRIVER = \"DELIVERY_DRIVER\",\n\tINVENTORY_MANAGER = \"INVENTORY_MANAGER\",\n\tPURCHASING_MANAGER = \"PURCHASING_MANAGER\",\n\tWAREHOUSE_STAFF = \"WAREHOUSE_STAFF\",\n\tCASHIER = \"CASHIER\"\n}\n\nexport interface User {\n\tid?: number;\n\temail: string;\n\tfullName: string;\n\trole?: UserRole;\n\tavatar64?: string | null;\n\tavatar128?: string | null;\n\tavatar256?: string | null;\n\tbusinessId?: number;\n\tbranchId?: number | null;\n\tcreatedAt: string;\n\temailVerified?: boolean;\n\tpermissions?: EmployeePermission[];\n}\n","import { isEmpty } from \"@sorocraft/js-utils\";\n\nimport { EmployeePermission, UserRole } from \"./models\";\n\nexport const getPermissionsByRole = (role?: UserRole) => {\n\tswitch (role) {\n\t\t/** Owner - Has every permission */\n\t\tcase UserRole.OWNER:\n\t\t\treturn [EmployeePermission.ALL];\n\n\t\t/** General Manager - All except subscription updates */\n\t\tcase UserRole.GENERAL_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.UPDATE_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_BRANCHES,\n\t\t\t\tEmployeePermission.UPDATE_BRANCH,\n\t\t\t\tEmployeePermission.CREATE_BRANCH,\n\t\t\t\tEmployeePermission.DELETE_BRANCH,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.CREATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.DELETE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Branch Manager - Controls operations within one branch */\n\t\tcase UserRole.BRANCH_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Chef - Manages menu and kitchen orders */\n\t\tcase UserRole.CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Sous Chef - Assists chef with orders and menu */\n\t\tcase UserRole.SOUS_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Pastry Chef - Limited to dessert menu items */\n\t\tcase UserRole.PASTRY_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Line Cook / Prep Cook / Kitchen Assistant - Read-only menu & order updates */\n\t\tcase UserRole.LINE_COOK:\n\t\tcase UserRole.PREP_COOK:\n\t\tcase UserRole.KITCHEN_ASSISTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Head Waiter - Full service control */\n\t\tcase UserRole.HEAD_WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t];\n\n\t\t/** Waiter - Handles orders and table service */\n\t\tcase UserRole.WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t];\n\n\t\t/** Runner - Sees and updates order delivery progress */\n\t\tcase UserRole.RUNNER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** ☕ Barista / Bartender / Sommelier / Room Service */\n\t\tcase UserRole.BARISTA:\n\t\tcase UserRole.BARTENDER:\n\t\tcase UserRole.SOMMELIER:\n\t\tcase UserRole.ROOM_SERVICE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Accountant - Analytics, reports, subscriptions */\n\t\tcase UserRole.ACCOUNTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t];\n\n\t\t/** Delivery Driver - Delivery orders only */\n\t\tcase UserRole.DELIVERY_DRIVER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** Inventory Manager - Controls menu stock-related items */\n\t\tcase UserRole.INVENTORY_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_PURCHASES,\n\t\t\t\tEmployeePermission.CREATE_PURCHASE,\n\t\t\t\tEmployeePermission.UPDATE_PURCHASE,\n\t\t\t\tEmployeePermission.DELETE_PURCHASE,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY_PRODUCTS,\n\t\t\t\tEmployeePermission.CREATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.UPDATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.DELETE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.VIEW_PURCHASE_DETAIL,\n\t\t\t\tEmployeePermission.VIEW_BRANCH_BALANCE,\n\t\t\t\tEmployeePermission.UPDATE_PRODUCT_INGREDIENTS,\n\t\t\t\tEmployeePermission.DELETE_PRODUCT_INGREDIENTS,\n\t\t\t];\n\n\t\t/** Purchasing Manager - Similar to inventory but more on creation/deletion */\n\t\tcase UserRole.PURCHASING_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t];\n\n\t\t/** Warehouse Staff - View only */\n\t\tcase UserRole.WAREHOUSE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t];\n\n\t\tdefault:\n\t\t\treturn [];\n\t}\n};\n\nexport const getHasUserPermission = (\n\trequiredPermissions: EmployeePermission[],\n\tuserPermissions: EmployeePermission[],\n) => {\n\tif (isEmpty(requiredPermissions)) return true;\n\tif (isEmpty(userPermissions)) return false;\n\tif (userPermissions.includes(EmployeePermission.ALL)) return true;\n\n\treturn requiredPermissions.some((permission) => userPermissions.includes(permission));\n};\n","import { PosAllowance } from \"../models/compliance\";\nimport { COUNTRIES } from \"./countries\";\n\n/**\n * Severity of each POS-allowance value, low → high. When the signed-in user's\n * account country and the active branch's country disagree, the stricter\n * (higher-severity) outcome wins — we never under-restrict and expose the\n * merchant (or us) to fiscal penalties.\n */\nexport const POS_ALLOWANCE_SEVERITY: Record<PosAllowance, number> = {\n\tyes: 0,\n\town_risk: 1,\n\trequires_integration: 2,\n\tno: 3,\n\trestricted: 4,\n};\n\n// Allowance values that fully block the POS with a hard-stop, full-screen notice.\nexport const BLOCKING_ALLOWANCES: PosAllowance[] = [\"no\", \"restricted\"];\n\n// Allowance values that let the POS run but surface a one-time advisory modal.\nexport const WARNING_ALLOWANCES: PosAllowance[] = [\"requires_integration\", \"own_risk\"];\n\n// ISO-3166 alpha-2 code → POS allowance, derived once from the country table.\nexport const POS_ALLOWANCE_BY_CODE: Record<string, PosAllowance> = COUNTRIES.reduce(\n\t(map, country) => {\n\t\tmap[country.code] = country.allowsPOS;\n\t\treturn map;\n\t},\n\t{} as Record<string, PosAllowance>,\n);\n\nexport interface PosComplianceCopy {\n\theading: string;\n\tbody: string;\n\t// Optional advisory line rendered as an italic note beneath the body.\n\tnote?: string;\n}\n\nconst BLOCK_HEADING = \"Tabres POS is not available in your region\";\nconst BLOCK_BODY =\n\t\"Tabres is not certified or authorised to operate as a point-of-sale (POS) system under the fiscal regulations applicable to your country. To keep you compliant and to protect you from liability, POS functionality has been disabled for this location. You can continue to use our other products — such as the QR Menu, Link-in-bio, and online ordering — where these are available in your region. Your use of Tabres remains your own responsibility, and Tabres accepts no liability for any fines, penalties, or other regulatory action arising from the use of its POS in this jurisdiction.\";\n\nconst REQUIRES_INTEGRATION_HEADING = \"Your country requires certified fiscal integration\";\nconst REQUIRES_INTEGRATION_BODY =\n\t\"The tax authority in your country requires point-of-sale systems to report to a government fiscal or e-invoicing service. Tabres does not yet provide this integration. You may continue to use Tabres POS, but you must do so alongside a separately certified fiscal device or solution that satisfies this legal requirement. Ensuring compliance with your local fiscal regulations remains solely your responsibility, and Tabres accepts no liability for any fines, penalties, or other regulatory action resulting from the use of its POS without the required certified integration. Our other products — such as the QR Menu and Link-in-bio — remain available to you without restriction.\";\n\nconst OWN_RISK_HEADING = \"Please review your local POS obligations\";\nconst OWN_RISK_BODY =\n\t\"Tabres keeps your POS records as accurate, complete, and tamper-evident as reasonably possible. Your country may nonetheless place specific bookkeeping, retention, or reporting obligations on point-of-sale systems. Please make sure your use of Tabres POS meets those obligations. Compliance with your local tax and fiscal regulations remains solely your responsibility, and Tabres accepts no liability for any fines, penalties, or other regulatory action arising from your use of its POS. Our other products — such as the QR Menu and Link-in-bio — remain available to you without restriction.\";\nconst OWN_RISK_NOTE =\n\t\"If you need your data — such as sales or tax records — exported in a specific format, please reach out to us via WhatsApp or at contact@tabres.com, and we will do our best to provide you with the functionality to export your data for accounting or tax-reporting purposes.\";\n\n/**\n * Official, liability-protective copy per allowance. \"no\" and \"restricted\" share\n * the hard-block message; the two advisory states each have their own; \"yes\" has\n * none. The strings double as i18n keys (human-readable English fallback).\n */\nexport const POS_COMPLIANCE_COPY: Record<PosAllowance, PosComplianceCopy | null> = {\n\tyes: null,\n\town_risk: { heading: OWN_RISK_HEADING, body: OWN_RISK_BODY, note: OWN_RISK_NOTE },\n\trequires_integration: {\n\t\theading: REQUIRES_INTEGRATION_HEADING,\n\t\tbody: REQUIRES_INTEGRATION_BODY,\n\t},\n\tno: { heading: BLOCK_HEADING, body: BLOCK_BODY },\n\trestricted: { heading: BLOCK_HEADING, body: BLOCK_BODY },\n};\n","import { PosAllowance } from \"../models/compliance\";\n\nexport const COUNTRIES: {\n\tname: string;\n\tcode: string;\n\tallowsPOS: PosAllowance;\n}[] = [\n\t{\n\t\tname: \"Afghanistan\",\n\t\tcode: \"AF\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Albania\",\n\t\tcode: \"AL\",\n\t\tallowsPOS: \"requires_integration\", // Central real-time invoice fiscalization (NIVF/FIC) via the Tax Administration API.\n\t},\n\t{\n\t\tname: \"Algeria\",\n\t\tcode: \"DZ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Andorra\",\n\t\tcode: \"AD\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Angola\",\n\t\tcode: \"AO\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Antigua and Barbuda\",\n\t\tcode: \"AG\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Argentina\",\n\t\tcode: \"AR\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Armenia\",\n\t\tcode: \"AM\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Australia\",\n\t\tcode: \"AU\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Austria\",\n\t\tcode: \"AT\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Azerbaijan\",\n\t\tcode: \"AZ\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory new-generation online cash registers (NKA) reporting to the State Tax Service in real time.\n\t},\n\t{\n\t\tname: \"Bahamas\",\n\t\tcode: \"BS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Bahrain\",\n\t\tcode: \"BH\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Bangladesh\",\n\t\tcode: \"BD\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Barbados\",\n\t\tcode: \"BB\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Belarus\",\n\t\tcode: \"BY\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Belgium\",\n\t\tcode: \"BE\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Belize\",\n\t\tcode: \"BZ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Benin\",\n\t\tcode: \"BJ\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Bhutan\",\n\t\tcode: \"BT\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Bolivia\",\n\t\tcode: \"BO\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Bosnia and Herzegovina\",\n\t\tcode: \"BA\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Botswana\",\n\t\tcode: \"BW\",\n\t\tallowsPOS: \"requires_integration\", // BURS e-invoicing/EFD mandate (real-time reporting) effective March 2026.\n\t},\n\t{\n\t\tname: \"Brazil\",\n\t\tcode: \"BR\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Brunei\",\n\t\tcode: \"BN\",\n\t\tallowsPOS: \"yes\",\n\t},\n\t{\n\t\tname: \"Bulgaria\",\n\t\tcode: \"BG\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Burkina Faso\",\n\t\tcode: \"BF\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Burundi\",\n\t\tcode: \"BI\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Cabo Verde\",\n\t\tcode: \"CV\",\n\t\tallowsPOS: \"no\", // Billing software must be DNRE-approved and carry an ICP-CV digital certificate.\n\t},\n\t{\n\t\tname: \"Cambodia\",\n\t\tcode: \"KH\",\n\t\tallowsPOS: \"own_risk\", // CamInvoice live, but B2C (restaurant) sales are out of scope until ~2027.\n\t},\n\t{\n\t\tname: \"Cameroon\",\n\t\tcode: \"CM\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Canada\",\n\t\tcode: \"CA\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Central African Republic\",\n\t\tcode: \"CF\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Chad\",\n\t\tcode: \"TD\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Chile\",\n\t\tcode: \"CL\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"China\",\n\t\tcode: \"CN\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Colombia\",\n\t\tcode: \"CO\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Comoros\",\n\t\tcode: \"KM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Congo (Republic of the)\",\n\t\tcode: \"CG\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Congo (Democratic Republic of the)\",\n\t\tcode: \"CD\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Costa Rica\",\n\t\tcode: \"CR\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Côte d'Ivoire\",\n\t\tcode: \"CI\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Croatia\",\n\t\tcode: \"HR\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Cuba\",\n\t\tcode: \"CU\",\n\t\tallowsPOS: \"restricted\", // OFAC comprehensive embargo (CACR) — Visa/MC/SWIFT blocked; cannot operate.\n\t},\n\t{\n\t\tname: \"Cyprus\",\n\t\tcode: \"CY\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Czechia\",\n\t\tcode: \"CZ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Denmark\",\n\t\tcode: \"DK\",\n\t\tallowsPOS: \"own_risk\", // Digital Bookkeeping Act targets accounting software, not the POS; no POS fiscal mandate.\n\t},\n\t{\n\t\tname: \"Djibouti\",\n\t\tcode: \"DJ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Dominica\",\n\t\tcode: \"DM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Dominican Republic\",\n\t\tcode: \"DO\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Ecuador\",\n\t\tcode: \"EC\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Egypt\",\n\t\tcode: \"EG\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"El Salvador\",\n\t\tcode: \"SV\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Equatorial Guinea\",\n\t\tcode: \"GQ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Eritrea\",\n\t\tcode: \"ER\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Estonia\",\n\t\tcode: \"EE\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Eswatini\",\n\t\tcode: \"SZ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Ethiopia\",\n\t\tcode: \"ET\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Fiji\",\n\t\tcode: \"FJ\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Finland\",\n\t\tcode: \"FI\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"France\",\n\t\tcode: \"FR\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Gabon\",\n\t\tcode: \"GA\",\n\t\tallowsPOS: \"requires_integration\", // E-Fact (FEN) mandatory e-invoicing from Jan 2026 via DGI-approved systems.\n\t},\n\t{\n\t\tname: \"Gambia\",\n\t\tcode: \"GM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Georgia\",\n\t\tcode: \"GE\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Germany\",\n\t\tcode: \"DE\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Ghana\",\n\t\tcode: \"GH\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Greece\",\n\t\tcode: \"GR\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Grenada\",\n\t\tcode: \"GD\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Guatemala\",\n\t\tcode: \"GT\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Guinea\",\n\t\tcode: \"GN\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Guinea-Bissau\",\n\t\tcode: \"GW\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Guyana\",\n\t\tcode: \"GY\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Haiti\",\n\t\tcode: \"HT\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Honduras\",\n\t\tcode: \"HN\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Hungary\",\n\t\tcode: \"HU\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Iceland\",\n\t\tcode: \"IS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"India\",\n\t\tcode: \"IN\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Indonesia\",\n\t\tcode: \"ID\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Iran\",\n\t\tcode: \"IR\",\n\t\tallowsPOS: \"restricted\", // OFAC comprehensive embargo + EU snapback sanctions — cannot operate.\n\t},\n\t{\n\t\tname: \"Iraq\",\n\t\tcode: \"IQ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Ireland\",\n\t\tcode: \"IE\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Israel\",\n\t\tcode: \"IL\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Italy\",\n\t\tcode: \"IT\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Jamaica\",\n\t\tcode: \"JM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Japan\",\n\t\tcode: \"JP\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Jordan\",\n\t\tcode: \"JO\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Kazakhstan\",\n\t\tcode: \"KZ\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Kenya\",\n\t\tcode: \"KE\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Kiribati\",\n\t\tcode: \"KI\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Kosovo\",\n\t\tcode: \"XK\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Kuwait\",\n\t\tcode: \"KW\",\n\t\tallowsPOS: \"yes\",\n\t},\n\t{\n\t\tname: \"Kyrgyzstan\",\n\t\tcode: \"KG\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Laos\",\n\t\tcode: \"LA\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Latvia\",\n\t\tcode: \"LV\",\n\t\tallowsPOS: \"requires_integration\", // Requires registered/certified fiscal hardware devices reporting to the SRS.\n\t},\n\t{\n\t\tname: \"Lebanon\",\n\t\tcode: \"LB\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Lesotho\",\n\t\tcode: \"LS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Liberia\",\n\t\tcode: \"LR\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Libya\",\n\t\tcode: \"LY\",\n\t\tallowsPOS: \"yes\", // Libya does not have a Value Added Tax (VAT) or general sales tax system.\n\t},\n\t{\n\t\tname: \"Liechtenstein\",\n\t\tcode: \"LI\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Lithuania\",\n\t\tcode: \"LT\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory integration with the State Tax Inspectorate's i.EKA API.\n\t},\n\t{\n\t\tname: \"Luxembourg\",\n\t\tcode: \"LU\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Madagascar\",\n\t\tcode: \"MG\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Malawi\",\n\t\tcode: \"MW\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Malaysia\",\n\t\tcode: \"MY\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Maldives\",\n\t\tcode: \"MV\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Mali\",\n\t\tcode: \"ML\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Malta\",\n\t\tcode: \"MT\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Marshall Islands\",\n\t\tcode: \"MH\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Mauritania\",\n\t\tcode: \"MR\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Mauritius\",\n\t\tcode: \"MU\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Mexico\",\n\t\tcode: \"MX\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Micronesia\",\n\t\tcode: \"FM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Moldova\",\n\t\tcode: \"MD\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Monaco\",\n\t\tcode: \"MC\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Mongolia\",\n\t\tcode: \"MN\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Montenegro\",\n\t\tcode: \"ME\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Morocco\",\n\t\tcode: \"MA\",\n\t\tallowsPOS: \"requires_integration\", // DGI Simpl-TVA clearance e-invoicing, mandatory from 2026 (large taxpayers first).\n\t},\n\t{\n\t\tname: \"Mozambique\",\n\t\tcode: \"MZ\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Myanmar\",\n\t\tcode: \"MM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Namibia\",\n\t\tcode: \"NA\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Nauru\",\n\t\tcode: \"NR\",\n\t\tallowsPOS: \"yes\",\n\t},\n\t{\n\t\tname: \"Nepal\",\n\t\tcode: \"NP\",\n\t\tallowsPOS: \"no\", // IRD must certify/approve the billing software product before it can legally be used.\n\t},\n\t{\n\t\tname: \"Netherlands\",\n\t\tcode: \"NL\",\n\t\tallowsPOS: \"yes\",\n\t},\n\t{\n\t\tname: \"New Zealand\",\n\t\tcode: \"NZ\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Nicaragua\",\n\t\tcode: \"NI\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Niger\",\n\t\tcode: \"NE\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Nigeria\",\n\t\tcode: \"NG\",\n\t\tallowsPOS: \"requires_integration\", // FIRS e-invoicing (EFS) live from Nov 2025, phasing down to all taxpayers by 2027.\n\t},\n\t{\n\t\tname: \"Korea (North)\",\n\t\tcode: \"KP\",\n\t\tallowsPOS: \"restricted\", // Comprehensive UN/OFAC/EU embargo — no payment rails; cannot operate.\n\t},\n\t{\n\t\tname: \"North Macedonia\",\n\t\tcode: \"MK\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Norway\",\n\t\tcode: \"NO\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Oman\",\n\t\tcode: \"OM\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Pakistan\",\n\t\tcode: \"PK\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Palau\",\n\t\tcode: \"PW\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Palestine\",\n\t\tcode: \"PS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Panama\",\n\t\tcode: \"PA\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Papua New Guinea\",\n\t\tcode: \"PG\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Paraguay\",\n\t\tcode: \"PY\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Peru\",\n\t\tcode: \"PE\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Philippines\",\n\t\tcode: \"PH\",\n\t\tallowsPOS: \"no\", // BIR must accredit the POS software product (Permit to Use / Certificate of Accreditation) before use.\n\t},\n\t{\n\t\tname: \"Poland\",\n\t\tcode: \"PL\",\n\t\tallowsPOS: \"requires_integration\",\n\t},\n\t{\n\t\tname: \"Portugal\",\n\t\tcode: \"PT\",\n\t\tallowsPOS: \"no\",\n\t},\n\t{\n\t\tname: \"Qatar\",\n\t\tcode: \"QA\",\n\t\tallowsPOS: \"yes\", // Qatar has repeatedly delayed its 5% VAT implementation. Like Kuwait, there is currently no general sales tax or fiscal mandate.\n\t},\n\t{\n\t\tname: \"Romania\",\n\t\tcode: \"RO\",\n\t\tallowsPOS: \"requires_integration\", // Must connect to certified physical fiscal printers (AMEF) that report to ANAF.\n\t},\n\t{\n\t\tname: \"Russia\",\n\t\tcode: \"RU\",\n\t\tallowsPOS: \"restricted\", // OFAC SaaS/cloud-services ban + Visa/Mastercard suspension make operating unworkable (separate from 54-FZ fiscal law).\n\t},\n\t{\n\t\tname: \"Rwanda\",\n\t\tcode: \"RW\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory use of Electronic Billing Machines (EBM), requiring software integration with the Rwanda Revenue Authority.\n\t},\n\t{\n\t\tname: \"Saint Kitts and Nevis\",\n\t\tcode: \"KN\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Saint Lucia\",\n\t\tcode: \"LC\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Saint Vincent and the Grenadines\",\n\t\tcode: \"VC\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Samoa\",\n\t\tcode: \"WS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"San Marino\",\n\t\tcode: \"SM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Sao Tome and Principe\",\n\t\tcode: \"ST\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Saudi Arabia\",\n\t\tcode: \"SA\",\n\t\tallowsPOS: \"requires_integration\", // ZATCA's Fatoora (Phase 2) requires the POS system to integrate directly with their e-invoicing API.\n\t},\n\t{\n\t\tname: \"Senegal\",\n\t\tcode: \"SN\",\n\t\tallowsPOS: \"requires_integration\", // Currently rolling out mandatory real-time electronic invoicing requiring a Sales Data Controller (SDC) timestamp and QR code.\n\t},\n\t{\n\t\tname: \"Serbia\",\n\t\tcode: \"RS\",\n\t\tallowsPOS: \"no\", // Software MUST go through a formal government audit/certification by the Tax Administration to become an approved ESIR.\n\t},\n\t{\n\t\tname: \"Seychelles\",\n\t\tcode: \"SC\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Sierra Leone\",\n\t\tcode: \"SL\",\n\t\tallowsPOS: \"requires_integration\", // POS must integrate with the National Revenue Authority's (NRA) Electronic Cash Register (ECR) framework via a secure element.\n\t},\n\t{\n\t\tname: \"Singapore\",\n\t\tcode: \"SG\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Slovakia\",\n\t\tcode: \"SK\",\n\t\tallowsPOS: \"requires_integration\", // POS systems must connect online to the Financial Directorate via an eKasa client integration.\n\t},\n\t{\n\t\tname: \"Slovenia\",\n\t\tcode: \"SI\",\n\t\tallowsPOS: \"requires_integration\", // Certified online cash registers (Davčne blagajne) require real-time receipt signing and API transmission to the tax office.\n\t},\n\t{\n\t\tname: \"Solomon Islands\",\n\t\tcode: \"SB\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Somalia\",\n\t\tcode: \"SO\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"South Africa\",\n\t\tcode: \"ZA\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Korea (South)\",\n\t\tcode: \"KR\",\n\t\tallowsPOS: \"requires_integration\", // Cash receipt issuance must strictly integrate with approved VAN (Value Added Network) providers and the National Tax Service.\n\t},\n\t{\n\t\tname: \"South Sudan\",\n\t\tcode: \"SS\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Spain\",\n\t\tcode: \"ES\",\n\t\tallowsPOS: \"no\", // VeriFactu (national) and TicketBAI (Basque) require vendor-registered/certified-compliant software; vendor liable up to €150k per product.\n\t},\n\t{\n\t\tname: \"Sri Lanka\",\n\t\tcode: \"LK\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Sudan\",\n\t\tcode: \"SD\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Suriname\",\n\t\tcode: \"SR\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Sweden\",\n\t\tcode: \"SE\",\n\t\tallowsPOS: \"requires_integration\", // Must connect to a physical or cloud-based fiscal control unit (Kontrollenhet) certified by Skatteverket.\n\t},\n\t{\n\t\tname: \"Switzerland\",\n\t\tcode: \"CH\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Syria\",\n\t\tcode: \"SY\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Taiwan\",\n\t\tcode: \"TW\",\n\t\tallowsPOS: \"requires_integration\", // Requires integration with the Ministry of Finance's e-GUI (Electronic Government Uniform Invoice) platform.\n\t},\n\t{\n\t\tname: \"Tajikistan\",\n\t\tcode: \"TJ\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory use of online fiscal cash registers reporting to the Tax Committee.\n\t},\n\t{\n\t\tname: \"Tanzania\",\n\t\tcode: \"TZ\",\n\t\tallowsPOS: \"requires_integration\", // POS must connect via API to Virtual Fiscal Devices (VFD) or physical Electronic Fiscal Devices (EFD) certified by TRA.\n\t},\n\t{\n\t\tname: \"Thailand\",\n\t\tcode: \"TH\",\n\t\tallowsPOS: \"own_risk\", // E-tax-invoice system is voluntary; no B2C POS mandate for restaurants.\n\t},\n\t{\n\t\tname: \"Timor-Leste\",\n\t\tcode: \"TL\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Togo\",\n\t\tcode: \"TG\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory SECEF (Système Électronique de Certification des Factures) integration for all billing systems.\n\t},\n\t{\n\t\tname: \"Tonga\",\n\t\tcode: \"TO\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Trinidad and Tobago\",\n\t\tcode: \"TT\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Tunisia\",\n\t\tcode: \"TN\",\n\t\tallowsPOS: \"requires_integration\", // Requires connection to homologated fiscal hardware and reporting systems supervised by the Ministry of Finance.\n\t},\n\t{\n\t\tname: \"Turkey\",\n\t\tcode: \"TR\",\n\t\tallowsPOS: \"requires_integration\", // Extremely strict VUK laws requiring New Generation Payment Recording Devices (YN ÖKC) or e-Archive software integrators.\n\t},\n\t{\n\t\tname: \"Turkmenistan\",\n\t\tcode: \"TM\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Tuvalu\",\n\t\tcode: \"TV\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Uganda\",\n\t\tcode: \"UG\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory Electronic Fiscal Receipting and Invoicing System (EFRIS) API integration with URA.\n\t},\n\t{\n\t\tname: \"Ukraine\",\n\t\tcode: \"UA\",\n\t\tallowsPOS: \"requires_integration\", // POS must act as a PRRO (Software Registrar of Settlement Operations) communicating with the State Tax Service.\n\t},\n\t{\n\t\tname: \"United Arab Emirates\",\n\t\tcode: \"AE\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"United Kingdom\",\n\t\tcode: \"GB\",\n\t\tallowsPOS: \"own_risk\", // MTD (Making Tax Digital) requires digital tax keeping, but there is no real-time fiscal hardware or API mandate at the POS level.\n\t},\n\t{\n\t\tname: \"United States\",\n\t\tcode: \"US\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Uruguay\",\n\t\tcode: \"UY\",\n\t\tallowsPOS: \"requires_integration\", // Must integrate with the DGI's CFE (Comprobante Fiscal Electrónico) framework.\n\t},\n\t{\n\t\tname: \"Uzbekistan\",\n\t\tcode: \"UZ\",\n\t\tallowsPOS: \"requires_integration\", // Mandatory use of online cash registers integrated with the State Tax Committee (GNK) via API.\n\t},\n\t{\n\t\tname: \"Vanuatu\",\n\t\tcode: \"VU\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Vatican City\",\n\t\tcode: \"VA\",\n\t\tallowsPOS: \"yes\", // No VAT, no income tax, no fiscalization.\n\t},\n\t{\n\t\tname: \"Venezuela\",\n\t\tcode: \"VE\",\n\t\tallowsPOS: \"no\", // SENIAT (Providencia 121, 2025) requires the billing software itself to be on the government-homologated list.\n\t},\n\t{\n\t\tname: \"Vietnam\",\n\t\tcode: \"VN\",\n\t\tallowsPOS: \"requires_integration\", // Decree 123 mandates that POS systems generate electronic invoices (Hóa đơn điện tử) with codes from the General Department of Taxation.\n\t},\n\t{\n\t\tname: \"Yemen\",\n\t\tcode: \"YE\",\n\t\tallowsPOS: \"own_risk\",\n\t},\n\t{\n\t\tname: \"Zambia\",\n\t\tcode: \"ZM\",\n\t\tallowsPOS: \"requires_integration\", // The ZRA's new Smart Invoice system mandates API integration (VSDC) for transaction reporting.\n\t},\n\t{\n\t\tname: \"Zimbabwe\",\n\t\tcode: \"ZW\",\n\t\tallowsPOS: \"requires_integration\", // ZIMRA's Fiscalisation Device Management System (FDMS) requires API communication with fiscal servers.\n\t},\n];\n","import {\n\tBLOCKING_ALLOWANCES,\n\tPOS_ALLOWANCE_BY_CODE,\n\tPOS_ALLOWANCE_SEVERITY,\n\tWARNING_ALLOWANCES,\n} from \"../constants/posCompliance\";\nimport { PosAllowance } from \"../models/compliance\";\n\n// Resolve a single ISO-3166 alpha-2 code to its POS allowance. Unknown/missing\n// codes return null so they are ignored rather than treated as a restriction.\nexport const getPosAllowance = (code?: string | null): PosAllowance | null => {\n\tif (!code) return null;\n\treturn POS_ALLOWANCE_BY_CODE[code.trim().toUpperCase()] ?? null;\n};\n\n/**\n * Resolve the effective POS allowance from the user's account country and the\n * active branch's country, taking the stricter of the two (most-restrictive\n * wins). Returns null when neither country is known.\n */\nexport const resolvePosAllowance = (\n\tuserCountry?: string | null,\n\tbranchCountryCode?: string | null,\n): PosAllowance | null => {\n\tconst candidates = [getPosAllowance(userCountry), getPosAllowance(branchCountryCode)].filter(\n\t\t(value): value is PosAllowance => value !== null,\n\t);\n\n\tif (candidates.length === 0) return null;\n\n\treturn candidates.reduce((strictest, current) =>\n\t\tPOS_ALLOWANCE_SEVERITY[current] > POS_ALLOWANCE_SEVERITY[strictest] ? current : strictest,\n\t);\n};\n\nexport const isBlockingAllowance = (allowance: PosAllowance | null): boolean =>\n\tallowance !== null && BLOCKING_ALLOWANCES.includes(allowance);\n\nexport const isWarningAllowance = (allowance: PosAllowance | null): boolean =>\n\tallowance !== null && WARNING_ALLOWANCES.includes(allowance);\n","import { isEmpty, sortNumbers } from \"@sorocraft/js-utils\";\nimport { IconType } from \"@sorocraft/ui\";\nimport { Check, BagCheck, Delivery, Chef, FileCheck, HourglassHalf } from \"@sorocraft/ui/icons\";\n\nimport {\n\tCalculatePreviewResponse,\n\tGuestContact,\n\tGuestContactRequest,\n\tOrder,\n\tOrderAddon,\n\tOrderAddonOption,\n\tOrderItem,\n\tOrderStatus,\n\tOrderType,\n\tSelectedAddons,\n} from \"./models\";\n\nimport * as addonModels from \"../addon/models\";\nimport * as branchModels from \"../branch/models\";\nimport { OrderErrors } from \"./constants\";\n\nexport const generateOrderItemsId = (\n\tproductId: number,\n\tvariantId: number | null,\n\tselectedAddons?: SelectedAddons,\n): string => {\n\tif (!productId) throw new Error(\"Product ID is required\");\n\n\t// Build the order items ID base with productId and variantId\n\tlet orderItemsId = `${productId}`;\n\tif (variantId) {\n\t\torderItemsId += `-${variantId}`;\n\t}\n\n\t// Build the addon part of the ID\n\tconst addonIdsPart = Object.entries(selectedAddons || {})\n\t\t.map(([addonId, option]) => {\n\t\t\tif (!addonId || !option) return null; // Skip invalid entries\n\t\t\tconst optionIds = Array.isArray(option)\n\t\t\t\t? sortNumbers(option).filter(Boolean).join(\"-\")\n\t\t\t\t: `${option}`;\n\t\t\tif (!optionIds) return null;\n\t\t\treturn `${addonId}-${optionIds}`;\n\t\t})\n\t\t.filter(Boolean) // Remove null/undefined values\n\t\t.join(\"-\");\n\n\t// Append addonIdsPart if it's not empty\n\tif (addonIdsPart) {\n\t\torderItemsId += `-${addonIdsPart}`;\n\t}\n\n\treturn orderItemsId;\n};\n\nexport const getSelectedAddonsFromOrderItems = (item: OrderItem): SelectedAddons => {\n\tconst selectedAddons: SelectedAddons = {};\n\n\tfor (const { addonId, options = [] } of item.addons || []) {\n\t\tconst optionIds = options.map(({ optionId }) => optionId);\n\t\tselectedAddons[addonId] = optionIds.length === 1 ? optionIds[0] : optionIds;\n\t}\n\n\treturn selectedAddons;\n};\n\nexport const getStatusIcon = (status: OrderStatus): IconType => {\n\tswitch (status) {\n\t\tcase OrderStatus.COMPLETED:\n\t\t\treturn Check;\n\t\tcase OrderStatus.DELIVERED:\n\t\t\treturn BagCheck;\n\t\tcase OrderStatus.OUT_FOR_DELIVERY:\n\t\t\treturn Delivery;\n\t\tcase OrderStatus.PREPARING:\n\t\t\treturn Chef;\n\t\tcase OrderStatus.CONFIRMED:\n\t\t\treturn FileCheck;\n\t\tcase OrderStatus.PENDING:\n\t\t\treturn HourglassHalf;\n\n\t\tdefault:\n\t\t\treturn HourglassHalf;\n\t}\n};\n\nexport const buildSelectedAddonsPayload = (\n\tproductAddons: addonModels.MenuAddon[] = [],\n\tselectedAddons: SelectedAddons = {},\n): OrderAddon[] => {\n\treturn Object.entries(selectedAddons).map(([addonIdStr, selected]) => {\n\t\tconst addonId = Number(addonIdStr);\n\t\tconst selectedOptionIds = Array.isArray(selected) ? selected : [selected];\n\n\t\tconst addon = productAddons.find((addon) => addon.id === addonId);\n\t\tif (isEmpty(addon)) {\n\t\t\treturn {\n\t\t\t\taddonId,\n\t\t\t\toptions: [],\n\t\t\t};\n\t\t}\n\n\t\tconst options: OrderAddonOption[] = (addon.options || [])\n\t\t\t.filter((option) => selectedOptionIds.includes(option.id))\n\t\t\t.map((option) => ({\n\t\t\t\toptionId: option.id,\n\t\t\t\tprice: option.listingPrice ?? option.price,\n\t\t\t}));\n\n\t\treturn {\n\t\t\taddonId,\n\t\t\toptions,\n\t\t};\n\t});\n};\n\nexport const getDefaultOrderType = (\n\tsettings: branchModels.BranchSettings,\n\tisOpen: boolean,\n\tisDelivering: boolean,\n): OrderType | null => {\n\tif (!settings) return null;\n\n\tconst { deliveryOrderEnabled, dineInOrderEnabled, pickupOrderEnabled } = settings;\n\n\tif (deliveryOrderEnabled && isDelivering) {\n\t\treturn OrderType.DELIVERY;\n\t}\n\n\tif (dineInOrderEnabled && isOpen) {\n\t\treturn OrderType.DINE_IN;\n\t}\n\n\tif (pickupOrderEnabled && isOpen) {\n\t\treturn OrderType.PICK_UP;\n\t}\n\n\treturn null;\n};\n\n// Defensive shape check for the /order/calculate response. The service is\n// typed as CalculatePreviewResponse, but the network can return malformed\n// payloads (empty body, HTML error page) that would corrupt preview state\n// and break price-line lookups downstream.\nexport const isValidPreviewResponse = (data: unknown): data is CalculatePreviewResponse => {\n\tif (!data || typeof data !== \"object\") return false;\n\tconst d = data as Partial<CalculatePreviewResponse>;\n\treturn (\n\t\ttypeof d.totalPriceWithoutTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTaxAndFees === \"number\" &&\n\t\ttypeof d.totalTax === \"number\" &&\n\t\ttypeof d.deliveryFee === \"number\" &&\n\t\ttypeof d.serviceFee === \"number\" &&\n\t\tArray.isArray(d.items) &&\n\t\tArray.isArray(d.taxes)\n\t);\n};\n\n// Build the contact snapshot sent to POST /order/public from the in-memory\n// guest contact. Drops empty/blank fields so a guest who entered nothing\n// produces no contact at all, and serializes lat/long to strings (and floor to\n// a number) to match the backend GuestContact shape.\nexport const buildGuestContactRequest = (\n\tcontact?: GuestContact,\n): GuestContactRequest | undefined => {\n\tif (isEmpty(contact)) return undefined;\n\n\tconst populated = Object.entries(contact).filter(\n\t\t([, value]) => value !== undefined && value !== null && value !== \"\",\n\t);\n\tif (populated.length === 0) return undefined;\n\n\tconst { latitude, longitude, floor, ...rest } = Object.fromEntries(\n\t\tpopulated,\n\t) as GuestContact;\n\n\treturn {\n\t\t...rest,\n\t\t...(floor != null ? { floor: Number(floor) } : {}),\n\t\t...(latitude != null ? { latitude: `${latitude}` } : {}),\n\t\t...(longitude != null ? { longitude: `${longitude}` } : {}),\n\t};\n};\n\n// Resolve a percentage-based gratuity against the tip base (the pre-tax food &\n// beverage subtotal — totalPriceWithoutTax from the preview), rounded to the\n// nearest cent. Returns 0 for a non-positive base or percentage.\nexport const calculateTipAmount = (base: number, percentage: number): number => {\n\tif (!base || base <= 0 || !percentage || percentage <= 0) return 0;\n\treturn Math.round(base * percentage) / 100;\n};\n\n// Canonical wire format for a tip amount sent to the API: a NUMERIC string with\n// two decimals (e.g. \"5.00\"). The backend re-parses/canonicalizes it and treats\n// zero as \"no tip\", so callers should drop non-positive amounts before sending.\nexport const formatTipAmount = (amount: number): string => amount.toFixed(2);\n\nexport const getOrderErrorMessages = (field: keyof Order) => {\n\tswitch (field) {\n\t\tcase \"customer\":\n\t\t\treturn OrderErrors.ADDRESS_IS_EMPTY;\n\n\t\tcase \"tableId\":\n\t\t\treturn OrderErrors.TABLE_NOT_SELECTED;\n\n\t\tcase \"items\":\n\t\t\treturn OrderErrors.EMPTY_ITEMS;\n\n\t\tcase \"branchId\":\n\t\t\treturn OrderErrors.BRANCH_NOT_SELECTED;\n\n\t\tdefault:\n\t\t\treturn OrderErrors.FIELD_REQUIRED_ERROR;\n\t}\n};\n\nexport * from \"./utils/item-price\";\n","import { FormErrors } from \"@sorocraft/ui\";\nimport { checkIsValidEmail } from \"@sorocraft/js-utils\";\n\nimport {\n\tCustomerAddress,\n\tCustomerAuthForm,\n\tCustomerAuthPhoneForm,\n\tCustomerAuthStep,\n} from \"./models\";\n\nexport const preparePhoneNumber = (form: CustomerAuthPhoneForm) => {\n\tconst phoneNumber = `${form.countryCode}${form.phoneNumber}`.replaceAll(\"+\", \"\");\n\n\treturn phoneNumber;\n};\n\nexport const validateForm = (form: CustomerAuthForm, step: CustomerAuthStep): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { email, otp } = form || {};\n\n\tswitch (step) {\n\t\tcase CustomerAuthStep.OTP: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\n\t\t\tif (!otp || otp.length !== 6) {\n\t\t\t\terrors.otp = \"Invalid OTP\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase CustomerAuthStep.EMAIL: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn errors;\n};\n\nexport const validateAddressForm = (form: CustomerAddress): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { countryCode, cityName, street, houseNumber } = form || {};\n\n\tif (!countryCode) errors.countryCode = \"COUNTRY_REQUIRED\";\n\tif (!cityName) errors.cityName = \"CITY_REQUIRED\";\n\tif (!street) errors.street = \"STREET_REQUIRED\";\n\tif (!houseNumber) errors.houseNumber = \"STREET_NUMBER_REQUIRED\";\n\n\treturn errors;\n};\n\nexport const formatCityLine = (fields: (string | undefined)[]) => {\n\treturn (fields || []).filter(Boolean).join(\", \");\n};\n\nexport const formatAddressLine = (\n\tstreet: string,\n\thouseNumber: string,\n\tadditionalNumber: string,\n) => {\n\tconst house = [houseNumber, additionalNumber].filter(Boolean).join(\"/\");\n\tconst fullAddress = [street, house].filter(Boolean).join(\" \");\n\n\treturn fullAddress;\n};\n","import { MenuAddon, MenuAddonOption } from \"./models\";\n\nexport const getAddonTranslation = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n\nexport const getAddonOptionTranslation = (option: MenuAddonOption, language: string): string => {\n\treturn option?.title?.[language] || \"\";\n};\n\nexport const getOptionTitles = (\n\toptions: MenuAddonOption[],\n\toptionIds: number | number[],\n\tlanguage: string,\n): string => {\n\tif (Array.isArray(optionIds)) {\n\t\treturn (options || [])\n\t\t\t.filter(({ id }) => optionIds.includes(id))\n\t\t\t.map(({ title }) => title?.[language] || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\", \");\n\t} else {\n\t\tconst option = (options || []).find(({ id }) => id === optionIds);\n\t\treturn option?.title?.[language] || \"\";\n\t}\n};\n\nexport const getAddonTitle = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n","import { getQueryParam } from \"@sorocraft/js-utils\";\n\nimport { FeatureSegment, type Feature } from \"./models\";\n\nimport { FEATURES_LIST } from \"./constants\";\n\nexport const getIsFeatureActive = (feature: Feature, businessSegment: FeatureSegment): boolean => {\n\t// Feature is force-enabled via query param\n\tif (getQueryParam(feature) === \"1\") return true;\n\n\t// Build the list of enabled segments for the current businessSegment\n\tconst enabledSegments: FeatureSegment[] =\n\t\tbusinessSegment === FeatureSegment.ALPHA\n\t\t\t? [FeatureSegment.ALPHA, FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: businessSegment === FeatureSegment.BETA\n\t\t\t? [FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: [FeatureSegment.ALL];\n\n\t// Check if feature exists in any of the enabled segments\n\treturn enabledSegments.some((segment) => FEATURES_LIST[segment]?.includes(feature));\n};\n","import { LocalizedContent, Product, ProductVariant, SellUnitType } from \"./models\";\n\nimport { MenuAddon } from \"src/modules/addon/models\";\n\nexport const getProductTranslation = (\n\tproduct: Pick<Product, \"translations\">,\n\tlanguage: string,\n): LocalizedContent => {\n\treturn product?.translations?.[language] || ({} as LocalizedContent);\n};\n\nexport const getProductVariant = (\n\tproduct: Pick<Product, \"variants\">,\n\tvariantId: number,\n): ProductVariant => {\n\treturn product?.variants?.find?.((item) => item.id === variantId) || ({} as ProductVariant);\n};\n\nexport const getProductVariantTranslation = (variant: ProductVariant, language: string): string => {\n\treturn variant?.title?.[language] || \"\";\n};\n\nexport const getProductAddon = (product: Product, addonId: number): MenuAddon => {\n\treturn (product?.addons || []).find(({ id }) => id === addonId) || ({} as MenuAddon);\n};\n\nexport const getPriceSuffix = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn \" / kg\";\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn \" / l\";\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n};\n\nexport const getProductSellUnitShortCuts = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn {\n\t\t\t\t\"50gr\": 0.05,\n\t\t\t\t\"100gr\": 0.1,\n\t\t\t\t\"150gr\": 0.15,\n\t\t\t\t\"200gr\": 0.2,\n\t\t\t\t\"250gr\": 0.25,\n\t\t\t\t\"300gr\": 0.3,\n\t\t\t\t\"350gr\": 0.35,\n\t\t\t\t\"400gr\": 0.4,\n\t\t\t\t\"450gr\": 0.45,\n\t\t\t\t\"500gr\": 0.5,\n\t\t\t\t\"600gr\": 0.6,\n\t\t\t\t\"700gr\": 0.7,\n\t\t\t\t\"750gr\": 0.75,\n\t\t\t\t\"800gr\": 0.8,\n\t\t\t\t\"850gr\": 0.85,\n\t\t\t\t\"900gr\": 0.9,\n\t\t\t\t\"950gr\": 0.95,\n\t\t\t\t\"1kg\": 1,\n\t\t\t\t\"2kg\": 2,\n\t\t\t\t\"5kg\": 5,\n\t\t\t\t\"10kg\": 10,\n\t\t\t\t\"20kg\": 20,\n\t\t\t};\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn {\n\t\t\t\t\"50ml\": 0.05,\n\t\t\t\t\"100ml\": 0.1,\n\t\t\t\t\"150ml\": 0.15,\n\t\t\t\t\"200ml\": 0.2,\n\t\t\t\t\"250ml\": 0.25,\n\t\t\t\t\"300ml\": 0.3,\n\t\t\t\t\"350ml\": 0.35,\n\t\t\t\t\"400ml\": 0.4,\n\t\t\t\t\"450ml\": 0.45,\n\t\t\t\t\"500ml\": 0.5,\n\t\t\t\t\"600ml\": 0.6,\n\t\t\t\t\"700ml\": 0.7,\n\t\t\t\t\"750ml\": 0.75,\n\t\t\t\t\"800ml\": 0.8,\n\t\t\t\t\"850ml\": 0.85,\n\t\t\t\t\"900ml\": 0.9,\n\t\t\t\t\"950ml\": 0.95,\n\t\t\t\t\"1l\": 1,\n\t\t\t\t\"2l\": 2,\n\t\t\t\t\"5l\": 5,\n\t\t\t\t\"10l\": 10,\n\t\t\t\t\"20l\": 20,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {};\n\t}\n};\n\nexport * from \"./utils/listing-price\";\nexport * from \"./utils/order-price\";\n","import * as categoryModels from \"src/modules/category/models\";\nimport * as productModels from \"src/modules/product/models\";\n\nimport { CategoryProductMap } from \"./models\";\n\nexport const prepareCategoryAndProductMap = (\n\tcategories: categoryModels.Category[],\n\tproducts: productModels.Product[]\n): CategoryProductMap[] => {\n\tconst productMap = products.reduce<Record<number, productModels.Product[]>>((map, product) => {\n\t\tif (!product.visible) return map;\n\n\t\tconst categoryId = Number(product.categoryId);\n\t\tif (!map[categoryId]) {\n\t\t\tmap[categoryId] = [];\n\t\t}\n\t\tmap[categoryId].push(product);\n\t\treturn map;\n\t}, {});\n\n\treturn categories\n\t\t.map((category) => ({\n\t\t\t...category,\n\t\t\tproducts: (productMap[Number(category.id)] || []) as productModels.Product[],\n\t\t}))\n\t\t.filter((category) => category?.products?.length > 0);\n};\n"],"names":["ProductView","SellUnitType","getUnitListingPrice","item","_a","_b","listingPrice","price","MenuAddonSelectType","getAllSelectedOptionsListingPrice","product","selectedAddons","total","addon","addons","id","addonId","selectType","options","Object","prototype","hasOwnProperty","call","selection","selectedOptionIds","SINGLE","optionId","option","find","OrderType","OrderStatus","OrderItemStatus","PaymentMethod","OrderStep","OrderErrors","SuppressedError","CASH","CART","DETAILS","COMPLETED","getOrderItemListingRawPrice","orderItem","variant","quantity","baseUnitPrice","addonsUnitPrice","reduce","addonSum","optionSum","CustomerAuthStep","CustomerAddressType","Feature","FeatureSegment","FEATURES_LIST","ALPHA","UPLOAD_VIDEO","BETA","ALL","DOMAIN","IMAGE_BASE_URL","validators","number","AZERBAIJANI_PREFIXES","RegExp","join","test","isValid","error","keyStr","triplet","e1","e2","e3","charAt","getCategoryTranslation","category","language","translations","EmployeePermission","UserRole","POS_ALLOWANCE_SEVERITY","yes","own_risk","requires_integration","no","restricted","BLOCKING_ALLOWANCES","WARNING_ALLOWANCES","POS_ALLOWANCE_BY_CODE","name","code","allowsPOS","map","country","getPosAllowance","trim","toUpperCase","hex","deltaPct","n","parseInt","replace","r","g","b","max","Math","min","l","h","s","d","newL","hueToRgb","p","q","t","r2","g2","b2","toHex","x","round","toString","padStart","contact","isEmpty","populated","entries","filter","value","length","fromEntries","latitude","longitude","floor","rest","e","indexOf","getOwnPropertySymbols","i","propertyIsEnumerable","__rest","assign","Number","productAddons","addonIdStr","selected","Array","isArray","includes","base","percentage","street","houseNumber","additionalNumber","Boolean","fields","amount","toFixed","productId","variantId","Error","orderItemsId","addonIdsPart","optionIds","sortNumbers","title","hostname","locale","url","domain","categoryId","categories","coverPhoto","startsWith","settings","isOpen","isDelivering","deliveryOrderEnabled","dineInOrderEnabled","pickupOrderEnabled","DELIVERY","DINE_IN","PICK_UP","requiredPermissions","userPermissions","some","permission","image","feature","businessSegment","getQueryParam","segment","logoImage","currency","priceFormatter","field","ADDRESS_IS_EMPTY","TABLE_NOT_SELECTED","EMPTY_ITEMS","BRANCH_NOT_SELECTED","FIELD_REQUIRED_ERROR","totalPrice","role","OWNER","GENERAL_MANAGER","VIEW_BUSINESS","UPDATE_BUSINESS","VIEW_ORDERS","UPDATE_ORDER","CREATE_ORDER","VIEW_QR_MENU","VIEW_QR_CODES","VIEW_MENU","VIEW_MENU_ITEMS","UPDATE_MENU_ITEM","CREATE_MENU_ITEM","DELETE_MENU_ITEM","VIEW_CATEGORIES","UPDATE_CATEGORY","CREATE_CATEGORY","DELETE_CATEGORY","VIEW_ADDONS","UPDATE_ADDON","CREATE_ADDON","DELETE_ADDON","VIEW_TABLES","UPDATE_TABLE","CREATE_TABLE","DELETE_TABLE","VIEW_BRANCHES","UPDATE_BRANCH","CREATE_BRANCH","DELETE_BRANCH","VIEW_EMPLOYEES","UPDATE_EMPLOYEE","CREATE_EMPLOYEE","DELETE_EMPLOYEE","VIEW_ANALYTICS","VIEW_SALES_REPORTS","VIEW_SUBSCRIPTION","CREATE_QR_CODE","DELETE_QR_CODE","AI_ASSISTANT","BRANCH_MANAGER","CHEF","SOUS_CHEF","PASTRY_CHEF","LINE_COOK","PREP_COOK","KITCHEN_ASSISTANT","HEAD_WAITER","UPDATE_TABLE_STATUS","WAITER","RUNNER","BARISTA","BARTENDER","SOMMELIER","ROOM_SERVICE_STAFF","ACCOUNTANT","DELIVERY_DRIVER","INVENTORY_MANAGER","VIEW_PURCHASES","CREATE_PURCHASE","UPDATE_PURCHASE","DELETE_PURCHASE","VIEW_INVENTORY","VIEW_INVENTORY_PRODUCTS","CREATE_INVENTORY_PRODUCT","UPDATE_INVENTORY_PRODUCT","DELETE_INVENTORY_PRODUCT","VIEW_PURCHASE_DETAIL","VIEW_BRANCH_BALANCE","UPDATE_PRODUCT_INGREDIENTS","DELETE_PRODUCT_INGREDIENTS","PURCHASING_MANAGER","WAREHOUSE_STAFF","sellUnitType","WEIGHT","VOLUME","keys","variants","undefined","source","status","Check","DELIVERED","BagCheck","OUT_FOR_DELIVERY","Delivery","PREPARING","Chef","CONFIRMED","FileCheck","PENDING","HourglassHalf","video","allowance","data","totalPriceWithoutTax","totalPriceWithTax","totalPriceWithTaxAndFees","totalTax","deliveryFee","serviceFee","items","taxes","products","productMap","visible","push","form","countryCode","phoneNumber","replaceAll","userCountry","branchCountryCode","candidates","strictest","current","errors","cityName","step","email","otp","OTP","checkIsValidEmail","EMAIL","cleaned","nationalNumber","slice","validator"],"mappings":"mFAgDA,IAAYA,EASAC,GATZ,SAAYD,GACXA,EAAA,KAAA,OACAA,EAAA,KAAA,MACA,CAHD,CAAYA,IAAAA,EAAW,CAAA,IASvB,SAAYC,GACXA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,OAAA,QACA,CAJD,CAAYA,IAAAA,EAAY,CAAA,ICrDjB,MAAMC,EAAuBC,IAG/B,IAAAC,EAAAC,EAAC,OAAiC,QAAjCA,EAAkB,QAAlBD,EAAAD,aAAI,EAAJA,EAAMG,oBAAY,IAAAF,EAAAA,EAAID,aAAI,EAAJA,EAAMI,aAAK,IAAAF,EAAAA,EAAI,GCP3C,IAAYG,GAAZ,SAAYA,GACXA,EAAA,OAAA,SACAA,EAAA,SAAA,UACA,CAHD,CAAYA,IAAAA,EAAmB,CAAA,ICQxB,MAAMC,EAAoC,CAChDC,EACAC,EAA6C,MAE7C,IAAIC,EAAQ,EAEZ,IAAK,MAAMC,KAASH,aAAO,EAAPA,EAASI,SAAU,GAAI,CAC1C,MAAQC,GAAIC,EAAOC,WAAEA,EAA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BH,KAChCH,EAAOG,MAAQ,yBAGXC,GAAsB,IAAfA,EAAIlM,SACf8L,EAAOI,IAAM,eAEd,MAGD,KAAKpR,EAAiBuR,MAChBJ,GAAUG,EAAAA,kBAAkBH,KAChCH,EAAOG,MAAQ,yBASlB,OAAOH,+BRHF,SAA8BP,GACnC,IAAKA,EACJ,MAAO,CAAExP,SAAS,EAAOC,MAAO,kBAGjC,MAAMsQ,EAAUf,EAAYrN,QAAQ,MAAO,IAErCoN,EAAcgB,EAAQ1J,WAAW,OAAS,MAAQ0J,EAAQ1J,WAAW,MAAQ,KAAO,KAE1F,IAAK0I,EACJ,MAAO,CAAEvP,SAAS,EAAOC,MAAO,4BAGjC,MAAMuQ,EAAiBD,EAAQE,MAAMlB,EAAYtL,QAGjD,OAAOyM,EAFWhR,EAAW6P,IAEZiB,EAClB","x_google_ignoreList":[6]}
@@ -4,6 +4,7 @@ export declare const initialOrder: {
4
4
  preferredPaymentMethod: PaymentMethod;
5
5
  };
6
6
  export declare const ORDER_STEPS: OrderStep[];
7
+ export declare const TIP_PERCENTAGES: number[];
7
8
  export declare const initialPreviewState: OrderPreviewState;
8
9
  export declare enum OrderErrors {
9
10
  FIELD_REQUIRED_ERROR = "This field is required",
@@ -77,6 +77,15 @@ export interface Order {
77
77
  items: OrderItem[];
78
78
  status?: OrderStatus;
79
79
  preferredPaymentMethod?: PaymentMethod;
80
+ /**
81
+ * Customer's optional voluntary gratuity as a NUMERIC money string in the
82
+ * branch currency (e.g. "5.00"). Honoured only on the customer and guest
83
+ * create paths — POS ignores it. It is an unfinalized intent: the server
84
+ * stores it but never adds it to the order total nor taxes it, so the
85
+ * tip-inclusive total shown at checkout is computed client-side. Absent (or
86
+ * zero) means no tip.
87
+ */
88
+ preferredTipAmount?: string;
80
89
  note?: string;
81
90
  createdAt?: number;
82
91
  updatedAt?: number;