@aglyn/plugins-commerce 1.0.0-beta.289 → 1.0.0-beta.291

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 (140) hide show
  1. package/README.md +4 -2
  2. package/package.json +13 -13
  3. package/src/lib/components/commerce-console-page.js +2 -1
  4. package/src/lib/components/commerce-console-page.js.map +1 -1
  5. package/src/lib/components/console/commerce-pdf-download.d.ts +30 -0
  6. package/src/lib/components/console/commerce-pdf-download.js +53 -0
  7. package/src/lib/components/console/commerce-pdf-download.js.map +1 -0
  8. package/src/lib/components/console/host-orders-card.component.d.ts +6 -0
  9. package/src/lib/components/console/host-orders-card.component.js +3 -2
  10. package/src/lib/components/console/host-orders-card.component.js.map +1 -1
  11. package/src/lib/components/console/host-quotes-card.component.js +20 -4
  12. package/src/lib/components/console/host-quotes-card.component.js.map +1 -1
  13. package/src/lib/components/console/invoice-send.component.d.ts +44 -0
  14. package/src/lib/components/console/invoice-send.component.js +237 -0
  15. package/src/lib/components/console/invoice-send.component.js.map +1 -0
  16. package/src/lib/components/console/order-detail-dialog.component.d.ts +5 -0
  17. package/src/lib/components/console/order-detail-dialog.component.js +9 -2
  18. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
  19. package/src/lib/components/console/order-invoice.component.d.ts +15 -4
  20. package/src/lib/components/console/order-invoice.component.js +93 -12
  21. package/src/lib/components/console/order-invoice.component.js.map +1 -1
  22. package/src/lib/components/console/quote-editor-dialog.component.d.ts +29 -0
  23. package/src/lib/components/console/quote-editor-dialog.component.js +154 -5
  24. package/src/lib/components/console/quote-editor-dialog.component.js.map +1 -1
  25. package/src/lib/components/console/quote-proofs.component.d.ts +48 -0
  26. package/src/lib/components/console/quote-proofs.component.js +694 -0
  27. package/src/lib/components/console/quote-proofs.component.js.map +1 -0
  28. package/src/lib/components/console/quote-send.component.d.ts +42 -0
  29. package/src/lib/components/console/quote-send.component.js +307 -0
  30. package/src/lib/components/console/quote-send.component.js.map +1 -0
  31. package/src/lib/components/console/quote-start.component.d.ts +45 -0
  32. package/src/lib/components/console/quote-start.component.js +182 -0
  33. package/src/lib/components/console/quote-start.component.js.map +1 -0
  34. package/src/lib/components/product-options-field-body.d.ts +44 -0
  35. package/src/lib/components/product-options-field-body.js +260 -0
  36. package/src/lib/components/product-options-field-body.js.map +1 -0
  37. package/src/lib/components/product-options-field.d.ts +32 -0
  38. package/src/lib/components/product-options-field.js +128 -0
  39. package/src/lib/components/product-options-field.js.map +1 -0
  40. package/src/lib/components/quote-page-body.js +67 -20
  41. package/src/lib/components/quote-page-body.js.map +1 -1
  42. package/src/lib/components/quote-proof-panel.d.ts +42 -0
  43. package/src/lib/components/quote-proof-panel.js +436 -0
  44. package/src/lib/components/quote-proof-panel.js.map +1 -0
  45. package/src/lib/model/commerce-invoices.d.ts +132 -0
  46. package/src/lib/model/commerce-invoices.js +332 -0
  47. package/src/lib/model/commerce-invoices.js.map +1 -0
  48. package/src/lib/model/commerce-orders.d.ts +29 -2
  49. package/src/lib/model/commerce-orders.js.map +1 -1
  50. package/src/lib/model/commerce-product-field.d.ts +23 -0
  51. package/src/lib/model/commerce-product-field.js +26 -0
  52. package/src/lib/model/commerce-product-field.js.map +1 -0
  53. package/src/lib/model/commerce-quote-email.d.ts +67 -0
  54. package/src/lib/model/commerce-quote-email.js +154 -0
  55. package/src/lib/model/commerce-quote-email.js.map +1 -0
  56. package/src/lib/model/commerce-quote-pay.d.ts +76 -6
  57. package/src/lib/model/commerce-quote-pay.js +105 -39
  58. package/src/lib/model/commerce-quote-pay.js.map +1 -1
  59. package/src/lib/model/commerce-quote-proofs.d.ts +159 -0
  60. package/src/lib/model/commerce-quote-proofs.js +348 -0
  61. package/src/lib/model/commerce-quote-proofs.js.map +1 -0
  62. package/src/lib/model/commerce-quote-request.d.ts +93 -0
  63. package/src/lib/model/commerce-quote-request.js +207 -0
  64. package/src/lib/model/commerce-quote-request.js.map +1 -0
  65. package/src/lib/model/commerce-quotes.d.ts +140 -3
  66. package/src/lib/model/commerce-quotes.js.map +1 -1
  67. package/src/lib/model/index.d.ts +4 -0
  68. package/src/lib/model/index.js +4 -0
  69. package/src/lib/model/index.js.map +1 -1
  70. package/src/lib/plugin.js +19 -0
  71. package/src/lib/plugin.js.map +1 -1
  72. package/src/lib/server/billing-webhook.js +115 -70
  73. package/src/lib/server/billing-webhook.js.map +1 -1
  74. package/src/lib/server/commerce-pdf.d.ts +104 -0
  75. package/src/lib/server/commerce-pdf.js +310 -0
  76. package/src/lib/server/commerce-pdf.js.map +1 -0
  77. package/src/lib/server/draft-order.js +23 -3
  78. package/src/lib/server/draft-order.js.map +1 -1
  79. package/src/lib/server/invoice-email.d.ts +76 -0
  80. package/src/lib/server/invoice-email.js +183 -0
  81. package/src/lib/server/invoice-email.js.map +1 -0
  82. package/src/lib/server/order-invoice-send.d.ts +43 -0
  83. package/src/lib/server/order-invoice-send.js +218 -0
  84. package/src/lib/server/order-invoice-send.js.map +1 -0
  85. package/src/lib/server/order-print.d.ts +6 -0
  86. package/src/lib/server/order-print.js +22 -5
  87. package/src/lib/server/order-print.js.map +1 -1
  88. package/src/lib/server/order-status.d.ts +11 -0
  89. package/src/lib/server/order-status.js +44 -8
  90. package/src/lib/server/order-status.js.map +1 -1
  91. package/src/lib/server/pdf-response.d.ts +31 -0
  92. package/src/lib/server/pdf-response.js +30 -0
  93. package/src/lib/server/pdf-response.js.map +1 -0
  94. package/src/lib/server/person-eraser.d.ts +3 -2
  95. package/src/lib/server/person-eraser.js +25 -6
  96. package/src/lib/server/person-eraser.js.map +1 -1
  97. package/src/lib/server/pos-reader-splash.d.ts +2 -18
  98. package/src/lib/server/pos-reader-splash.js +8 -93
  99. package/src/lib/server/pos-reader-splash.js.map +1 -1
  100. package/src/lib/server/quote-email.d.ts +85 -0
  101. package/src/lib/server/quote-email.js +211 -0
  102. package/src/lib/server/quote-email.js.map +1 -0
  103. package/src/lib/server/quote-link-token.d.ts +11 -0
  104. package/src/lib/server/quote-link-token.js +21 -0
  105. package/src/lib/server/quote-link-token.js.map +1 -1
  106. package/src/lib/server/quote-pay.d.ts +38 -6
  107. package/src/lib/server/quote-pay.js +115 -53
  108. package/src/lib/server/quote-pay.js.map +1 -1
  109. package/src/lib/server/quote-proofs.d.ts +51 -0
  110. package/src/lib/server/quote-proofs.js +500 -0
  111. package/src/lib/server/quote-proofs.js.map +1 -0
  112. package/src/lib/server/quote-uploads.d.ts +33 -0
  113. package/src/lib/server/quote-uploads.js +29 -0
  114. package/src/lib/server/quote-uploads.js.map +1 -0
  115. package/src/lib/server/quote.d.ts +25 -0
  116. package/src/lib/server/quote.js +638 -8
  117. package/src/lib/server/quote.js.map +1 -1
  118. package/src/lib/server/site-image-source.d.ts +38 -0
  119. package/src/lib/server/site-image-source.js +130 -0
  120. package/src/lib/server/site-image-source.js.map +1 -0
  121. package/src/lib/server/site-page-resolver.js +2 -1
  122. package/src/lib/server/site-page-resolver.js.map +1 -1
  123. package/src/lib/server.js +24 -1
  124. package/src/lib/server.js.map +1 -1
  125. package/src/lib/site.js +8 -0
  126. package/src/lib/site.js.map +1 -1
  127. package/src/lib/tenant-emails.js +243 -0
  128. package/src/lib/tenant-emails.js.map +1 -1
  129. package/src/lib/utils/commerce-document-pdf.d.ts +82 -0
  130. package/src/lib/utils/commerce-document-pdf.js +613 -0
  131. package/src/lib/utils/commerce-document-pdf.js.map +1 -0
  132. package/src/lib/utils/invoice-email-content.d.ts +45 -0
  133. package/src/lib/utils/invoice-email-content.js +126 -0
  134. package/src/lib/utils/invoice-email-content.js.map +1 -0
  135. package/src/lib/utils/order-invoice.d.ts +52 -3
  136. package/src/lib/utils/order-invoice.js +124 -64
  137. package/src/lib/utils/order-invoice.js.map +1 -1
  138. package/src/lib/utils/quote-email-content.d.ts +62 -0
  139. package/src/lib/utils/quote-email-content.js +154 -0
  140. package/src/lib/utils/quote-email-content.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/tenant-emails.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TenantEmailEntry } from '@aglyn/shared-util-email'\n\n/** The human order number every buyer order email names (AGL-3610). */\nconst ORDER_NUMBER_TOKEN = {\n name: 'order.number',\n description: 'The order number, as the store shows it',\n sample: '#1042',\n} as const\n\n/**\n * The buyer's private order-status page (AGL-3610): a signed link, so it\n * opens without an account and only for this order.\n */\nconst ORDER_STATUS_URL_TOKEN = {\n name: 'order.statusUrl',\n description:\n 'Link to the order status page: status, shipments and tracking. Private ' +\n 'to the buyer; it needs no account',\n sample: 'https://shop.example.com/order-status?o=ord_123&t=…',\n} as const\n\n/** Where a pickup order is collected (AGL-3624). */\nconst PICKUP_LOCATION_TOKEN = {\n name: 'pickup.location',\n description: 'The pickup location’s name and address',\n sample: 'Main Street shop, 12 Main St, Springfield',\n} as const\n\nconst ORDER_FOOTER_REASON =\n 'You’re receiving this because you placed an order with {{host.businessName}}.'\n\n/**\n * The emails a site sends its own customers through Commerce (AGL-769/770).\n *\n * Declared here, by the plugin that sends them, and compiled into the\n * platform's tenant email catalog (`TENANT_EMAILS` in\n * `@aglyn/shared-util-email`) by `tools/scripts/generate-plugin-manifests.mjs`\n * (AGL-3080): the catalog's readers include the send path, which loads no\n * plugin code, so a runtime registry it had not filled would quietly send\n * the text card in place of the site's designed email. Regenerate after\n * changing an entry; `--check` refuses a stale catalog.\n *\n * Most commerce sends are designable in the email besigner; a `fixed` entry\n * flips to `besigner` when its send site is wired to `renderHostEmail`\n * (AGL-770).\n */\nexport function commerceTenantEmails(): readonly TenantEmailEntry[] {\n return [\n {\n key: 'order-receipt',\n name: 'Order receipt',\n description: 'Sent to the buyer after a successful order or checkout.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Receipt for your order',\n mergeTokens: [\n {\n name: 'order.summary',\n description: 'The ordered items, one per line (with any license/download links)',\n sample: 'House Blend × 2 — $24.00',\n },\n {\n name: 'order.total',\n description: 'Order total',\n sample: '$24.00',\n },\n {\n name: 'order.ref',\n description: 'Order reference id',\n sample: 'cs_test_123',\n },\n {\n name: 'store.receiptFooter',\n description:\n 'The Receipt footer from the store settings; empty when none is set',\n sample: 'Returns are accepted within 30 days.',\n },\n ORDER_NUMBER_TOKEN,\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Thanks for your order', variant: 'heading' },\n { block: 'text', text: 'Here is the receipt for your order from {{host.businessName}}. We will email you again as your order moves along, and the order page always shows where it is.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nTotal charged: {{order.total}}', variant: 'details' },\n { block: 'text', text: '{{store.receiptFooter}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Order {{order.number}} · payment reference {{order.ref}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-shipped',\n name: 'Order shipped',\n description:\n 'Tells the buyer part or all of their order is on its way, with the ' +\n 'carrier and a tracking link when the shipment has one. Sent once per ' +\n 'shipment.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} has shipped',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'shipment.summary',\n description: 'The items in this shipment, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'shipment.carrier',\n description: 'The carrier; empty when none was recorded',\n sample: 'UPS',\n },\n {\n name: 'shipment.trackingNumber',\n description: 'The tracking number; empty when none was recorded',\n sample: '1Z999AA10123456784',\n },\n {\n name: 'shipment.tracking',\n description:\n 'A sentence with the carrier, tracking number and tracking link; ' +\n 'empty when the shipment has no tracking number',\n sample:\n 'Tracking: UPS 1Z999AA10123456784 — https://www.ups.com/track?tracknum=1Z999AA10123456784',\n },\n {\n name: 'shipment.remaining',\n description:\n 'A sentence saying how many items are still to ship; empty when ' +\n 'this shipment completes the order',\n sample: '1 more item will ship separately.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is on its way', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} shipped these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{shipment.summary}}', variant: 'details' },\n { block: 'text', text: '{{shipment.tracking}}', variant: 'body' },\n { block: 'text', text: '{{shipment.remaining}}', variant: 'body' },\n { block: 'button', label: 'Track your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'The order page shows every shipment and its tracking as it moves. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-delivered',\n name: 'Order delivered',\n description: 'Tells the buyer their order was marked delivered.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} was delivered',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order was delivered', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} marked order {{order.number}} as delivered. We hope you enjoy it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-refunded',\n name: 'Order refunded',\n description:\n 'Tells the buyer a refund was issued, for how much and, when the ' +\n 'store refunded named items, which ones. Sent once per refund.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Refund for your order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'refund.amount',\n description: 'The amount of this refund',\n sample: '$12.00',\n },\n {\n name: 'refund.summary',\n description:\n 'The refunded items, one per line; empty when the refund was by ' +\n 'amount only',\n sample: '1× House Blend',\n },\n {\n name: 'refund.note',\n description:\n 'Whether the order is now fully refunded, as a sentence',\n sample: 'Your order has been refunded in full.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your refund is on its way', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} refunded {{refund.amount}} on order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{refund.summary}}\\nTotal refunded: {{refund.amount}}', variant: 'details' },\n { block: 'text', text: '{{refund.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Refunds go back to the original payment method and usually appear within 5 to 10 business days, depending on your bank.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-cancelled',\n name: 'Order canceled',\n description: 'Tells the buyer their order was canceled.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} was canceled',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'cancel.note',\n description:\n 'What happens to the payment, as a sentence; empty when nothing ' +\n 'was paid',\n sample:\n 'Any payment you made will be refunded, and you will get a ' +\n 'separate email when it is.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order was canceled', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} canceled order {{order.number}}. These items will not be sent.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}', variant: 'details' },\n { block: 'text', text: '{{cancel.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n // Pickup and the store's own delivery (AGL-3624).\n {\n key: 'order-ready-for-pickup',\n name: 'Order ready for pickup',\n description:\n 'Tells the buyer their pickup order is ready, where to collect it, ' +\n 'the pickup hours and any arrival instructions.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} is ready for pickup',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n PICKUP_LOCATION_TOKEN,\n {\n name: 'pickup.hours',\n description: 'The location’s pickup hours; empty when it lists none',\n sample: 'Pickup hours:\\nMo-Fr 09:00-17:00',\n },\n {\n name: 'pickup.instructions',\n description: 'What to do on arrival, as the store wrote it; empty when it wrote none',\n sample: 'Ring the bell at the side door.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is ready for pickup', variant: 'heading' },\n { block: 'text', text: 'Order {{order.number}} is packed and waiting for you at {{pickup.location}}.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nPick up at: {{pickup.location}}', variant: 'details' },\n { block: 'text', text: '{{pickup.hours}}', variant: 'body' },\n { block: 'text', text: '{{pickup.instructions}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Bring your order number, {{order.number}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-picked-up',\n name: 'Order picked up',\n description: 'Confirms to the buyer that their pickup order was collected.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'You picked up order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n PICKUP_LOCATION_TOKEN,\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Thanks for picking up your order', variant: 'heading' },\n { block: 'text', text: 'Order {{order.number}} was picked up from {{pickup.location}}. Enjoy it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nPicked up at: {{pickup.location}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-out-for-delivery',\n name: 'Order out for delivery',\n description:\n 'Tells the buyer the store’s own driver is on the way with their ' +\n 'local delivery, in the window they booked.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} is out for delivery',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'delivery.window',\n description: 'The delivery window the buyer booked',\n sample: 'Tue, Oct 14, 9:00 AM – 12:00 PM',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is out for delivery', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} is on the way with order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nDelivery window: {{delivery.window}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'sale-notification',\n name: 'New sale',\n description: 'Notifies the seller when an order is placed.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'New order on {{site.name}}',\n mergeTokens: [\n {\n name: 'site.name',\n description: 'The site the sale happened on',\n sample: 'Northwind Coffee',\n },\n {\n name: 'order.summary',\n description: 'The ordered items',\n sample: 'House Blend — $12.00',\n },\n { name: 'order.total', description: 'Order total', sample: '$12.00' },\n {\n name: 'buyer.email',\n description: \"The buyer's email\",\n sample: 'buyer@example.com',\n },\n {\n name: 'order.ref',\n description: 'Order reference id',\n sample: 'cs_test_123',\n },\n { name: 'orders.url', description: 'The site’s Orders page in the console', sample: 'https://app.example.com/northwind/hosts/northwind/products/orders' },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · New order', variant: 'eyebrow' },\n { block: 'text', text: 'You made a sale', variant: 'heading' },\n { block: 'text', text: 'A new paid order came in on {{site.name}}. Here is what was bought and who bought it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nTotal: {{order.total}}\\nBuyer: {{buyer.email}}\\nPayment reference: {{order.ref}}', variant: 'details' },\n { block: 'button', label: 'Open orders', href: '{{orders.url}}' },\n { block: 'text', text: 'Fulfill it from Orders: as you mark it shipped, ready for pickup or delivered, the buyer is emailed at each step.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you manage {{host.businessName}}.',\n },\n {\n key: 'reservation-confirmed',\n name: 'Reservation confirmed',\n description: 'Confirms a paid reservation to the customer.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Reservation confirmed',\n mergeTokens: [\n {\n name: 'reservation.checkIn',\n description: 'Check-in date',\n sample: 'Mon, 01 Jun 2026',\n },\n {\n name: 'reservation.nights',\n description: 'Number of nights',\n sample: '2',\n },\n {\n name: 'reservation.paid',\n description:\n 'What the guest was charged today, lodging tax included; a ' +\n 'charge that carried lodging tax names it, as in “$254.40, ' +\n 'including $14.40 lodging tax”',\n sample: '$240.00',\n },\n {\n name: 'reservation.balance',\n description:\n 'What is still owed for the stay and where it is paid, as a ' +\n 'sentence; empty when the stay is paid in full',\n sample: 'Still to pay: $360.00, at the property. It has not been charged.',\n },\n {\n name: 'reservation.ref',\n description: 'Reservation reference id',\n sample: 'resv_123',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Reservation', variant: 'eyebrow' },\n { block: 'text', text: 'Your stay is confirmed', variant: 'heading' },\n { block: 'text', text: 'Your reservation at {{host.businessName}} is booked. Here are the details to keep.', variant: 'body' },\n { block: 'text', text: 'Check-in: {{reservation.checkIn}}\\nNights: {{reservation.nights}}\\nPaid today: {{reservation.paid}}\\nReference: {{reservation.ref}}', variant: 'details' },\n { block: 'text', text: '{{reservation.balance}}', variant: 'body' },\n { block: 'text', text: 'Questions before you arrive? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you made a reservation with {{host.businessName}}.',\n },\n {\n key: 'gift-card',\n name: 'Gift card delivery',\n description: 'Delivers a purchased gift card to its recipient.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your gift card for {{host.businessName}}',\n mergeTokens: [\n {\n name: 'giftcard.code',\n description: 'The gift card code',\n sample: 'GC-ABC123DEF456',\n },\n {\n name: 'giftcard.value',\n description: 'The gift card value',\n sample: '$25.00',\n },\n {\n name: 'giftcard.note',\n description:\n 'The note written when the card was issued by hand; empty for a ' +\n 'card bought at checkout',\n sample: 'Happy birthday, Sam!',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Gift card', variant: 'eyebrow' },\n { block: 'text', text: 'Your {{giftcard.value}} gift card', variant: 'heading' },\n { block: 'text', text: 'You have a {{giftcard.value}} gift card for {{host.businessName}}.', variant: 'body' },\n { block: 'text', text: '{{giftcard.note}}', variant: 'body' },\n { block: 'text', text: 'Value: {{giftcard.value}}\\nGift card code: {{giftcard.code}}', variant: 'details' },\n { block: 'text', text: 'Enter the code at checkout on {{host.url}} to use its balance.', variant: 'body' },\n { block: 'button', label: 'Shop {{host.businessName}}', href: '{{host.url}}' },\n { block: 'text', text: 'Keep this email: the code is what you spend the card with.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because a gift card from {{host.businessName}} was sent to this address.',\n },\n {\n key: 'supplier-fulfillment',\n name: 'Supplier fulfillment',\n description: 'Tells a dropship supplier there is a new order to fulfill.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'fixed',\n },\n {\n key: 'back-in-stock',\n name: 'Back in stock',\n description: 'Tells a customer a product they watched is available again.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Back in stock: {{product.name}}',\n mergeTokens: [\n {\n name: 'product.name',\n description: 'The product that restocked',\n sample: 'House Blend',\n },\n {\n name: 'product.url',\n description: 'Link to the product page',\n sample: 'https://shop.example.com/products/house-blend',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: '{{product.name}} is back in stock', variant: 'heading' },\n { block: 'text', text: 'You asked to hear when {{product.name}} was back at {{host.businessName}}. It is, and you can order it now.', variant: 'body' },\n { block: 'button', label: 'Shop {{product.name}}', href: '{{product.url}}' },\n { block: 'text', text: 'You asked {{host.businessName}} to tell you when it was back. Nothing is held for you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you asked {{host.businessName}} to tell you when this was back.',\n },\n {\n key: 'abandoned-cart',\n name: 'Abandoned cart',\n description: 'Reminds a shopper of items left in their cart.',\n // The cron refuses to send this without the entitlement\n // (`process-abandoned.ts:92`), so the console has to say so (AGL-2081).\n requiresFeature: 'abandonedCart',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'You left something in your cart',\n mergeTokens: [\n {\n name: 'cart.url',\n description: 'Link back to the shopper cart',\n sample: 'https://shop.example.com/cart',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: 'You left something in your cart', variant: 'heading' },\n { block: 'text', text: 'Your cart at {{host.businessName}} still has your items in it. Pick up where you left off whenever you are ready.', variant: 'body' },\n { block: 'button', label: 'Return to your cart', href: '{{cart.url}}' },\n { block: 'text', text: 'Nothing in your cart is held for you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you started a checkout with {{host.businessName}}.',\n },\n {\n // AGL-3736: days after fulfilment, one per order, with a single-use\n // link per product that opens its review form pre-verified.\n key: 'review-request',\n name: 'Review request',\n description:\n 'Asks a buyer to review what they bought, a set number of days after ' +\n 'the order is fulfilled. One per order; each product has its own ' +\n 'single-use link. Turn it off or change the delay in Settings → Reviews.',\n requiresFeature: 'productReviews',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'How was your order from {{host.businessName}}?',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'review.products',\n description:\n 'Each product to review, one per line, with its own review link',\n sample: 'House Blend: https://shop.example.com/products/house-blend?review=…',\n },\n {\n name: 'review.url',\n description: 'The review link for the first product',\n sample: 'https://shop.example.com/products/house-blend?review=…',\n },\n {\n name: 'review.productName',\n description: 'The first product’s name',\n sample: 'House Blend',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'How did we do?', variant: 'heading' },\n { block: 'text', text: 'Thanks again for your order {{order.number}} from {{host.businessName}}. Would you tell other shoppers what you think? Each link opens the product with a review form ready.', variant: 'body' },\n { block: 'text', text: '{{review.products}}', variant: 'links' },\n { block: 'button', label: 'Write a review', href: '{{review.url}}' },\n { block: 'text', text: 'Each link works once, for 60 days.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'member-post',\n name: 'New member post',\n description: 'Notifies members when new members-only content is posted.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: '{{post.title}}',\n mergeTokens: [\n { name: 'post.title', description: 'The post’s title', sample: 'This month in the studio' },\n {\n name: 'post.body',\n description: 'The post, as its author wrote it',\n sample: 'Three new pieces are up for members first.',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Members', variant: 'eyebrow' },\n { block: 'text', text: '{{post.title}}', variant: 'heading' },\n { block: 'text', text: '{{post.body}}', variant: 'body' },\n { block: 'button', label: 'Visit {{host.businessName}}', href: '{{host.url}}' },\n ],\n footerReason: 'You’re receiving this because you’re a member of {{host.businessName}}.',\n },\n {\n key: 'member-password-reset',\n name: 'Member password reset',\n description:\n \"Resets a site member's password — a store-member account, separate \" +\n 'from a console login. Sent when the member asks, and when a site ' +\n 'administrator starts a reset for them.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Reset your {{site.name}} password',\n mergeTokens: [\n { name: 'site.name', description: 'The site’s name', sample: 'Northwind Coffee' },\n {\n name: 'reset.intro',\n description: 'Who started the reset',\n sample: 'Someone asked to reset the password for your Northwind Coffee account.',\n },\n {\n name: 'resetUrl',\n description: 'The one-time reset link',\n sample: 'https://shop.example.com/recover?token=…',\n },\n {\n name: 'reset.note',\n description: 'How long the link lasts, and what to do if unexpected',\n sample:\n 'The link works once and expires in 1 hour. If you did not ask for ' +\n 'this, you can safely ignore this email — your password is unchanged.',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · Account security', variant: 'eyebrow' },\n { block: 'text', text: 'Reset your password', variant: 'heading' },\n { block: 'text', text: '{{reset.intro}}', variant: 'body' },\n { block: 'button', label: 'Set a new password', href: '{{resetUrl}}' },\n { block: 'text', text: '{{reset.note}}', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because a password reset was started for your ' +\n '{{host.businessName}} account.',\n },\n {\n key: 'member-password-changed',\n name: 'Member password changed',\n description:\n 'Tells a site member that a site administrator set a new password on ' +\n 'their account.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your {{site.name}} password was changed',\n mergeTokens: [\n { name: 'site.name', description: 'The site’s name', sample: 'Northwind Coffee' },\n {\n name: 'signInUrl',\n description: 'Where the member signs back in',\n sample: 'https://shop.example.com',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · Account security', variant: 'eyebrow' },\n { block: 'text', text: 'Your password was changed', variant: 'heading' },\n { block: 'text', text: 'An administrator of {{site.name}} set a new password on your account and signed you out on every device. To sign back in, get the new password from them, or choose \"Forgot password?\" on the sign-in page to set your own.', variant: 'body' },\n { block: 'button', label: 'Sign in', href: '{{signInUrl}}' },\n { block: 'text', text: 'If you did not expect this, contact the site owner straight away.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because the password on your ' +\n '{{host.businessName}} account was changed.',\n },\n {\n key: 'newsletter-confirmation',\n name: 'Subscription confirmation',\n description:\n 'Asks someone who signed up for a site’s emails to confirm the address ' +\n 'before anything is sent to it.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Confirm your subscription',\n mergeTokens: [\n {\n name: 'stream.name',\n description: 'What they signed up for',\n sample: 'Newsletter',\n },\n {\n name: 'confirmUrl',\n description: 'The confirmation link',\n sample: 'https://shop.example.com/subscribe/confirm?token=…',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: 'Confirm your subscription', variant: 'heading' },\n { block: 'text', text: 'Please confirm that you want {{stream.name}} emails from {{host.businessName}} at this address. Nothing is sent until you do.', variant: 'body' },\n { block: 'text', text: 'List: {{stream.name}}\\nFrom: {{host.businessName}}', variant: 'details' },\n { block: 'button', label: 'Confirm my subscription', href: '{{confirmUrl}}' },\n { block: 'text', text: 'The link works for three days. If you did not sign up, ignore this message and nothing will be sent.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because this address was entered on ' +\n '{{host.businessName}}’s signup form.',\n },\n ...returnTenantEmails(),\n ]\n}\n\n/** The items a return covers, one per line. */\nconst RETURN_ITEMS_TOKEN = {\n name: 'return.items',\n description: 'The items being returned, one per line, with the reason',\n sample: '1× House Blend — Arrived damaged',\n} as const\n\n/** The merchant's note on a return; empty when they left none. */\nconst RETURN_NOTE_TOKEN = {\n name: 'return.note',\n description: 'The store’s note to the buyer on this return; empty when none',\n sample: 'Please include the original packaging.',\n} as const\n\n/**\n * The return emails (AGL-3611): one to the store when a buyer asks, and one\n * to the buyer at each answer. Their own block, beside the order emails\n * rather than among them, because those belong to the order notifications.\n */\nfunction returnTenantEmails(): readonly TenantEmailEntry[] {\n return [\n {\n key: 'return-requested',\n name: 'Return requested',\n description:\n 'Tells the store a buyer asked to return items, with what and why, so ' +\n 'someone can approve or decline it.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Return requested for order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n {\n name: 'buyer.email',\n description: 'The buyer’s email',\n sample: 'buyer@example.com',\n },\n {\n name: 'return.customerNote',\n description: 'What the buyer wrote; empty when they wrote nothing',\n sample: 'The lid was cracked.',\n },\n { name: 'return.url', description: 'The return in the console, to approve or decline', sample: 'https://app.example.com/northwind/hosts/northwind/products/returns?return=ret_123' },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'A buyer asked for a return', variant: 'heading' },\n { block: 'text', text: '{{buyer.email}} wants to return items from order {{order.number}}. Approve or decline it, and the buyer is emailed your answer.', variant: 'body' },\n { block: 'text', text: '{{return.items}}\\nBuyer: {{buyer.email}}', variant: 'details' },\n { block: 'text', text: '{{return.customerNote}}', variant: 'body' },\n { block: 'button', label: 'Review the return', href: '{{return.url}}' },\n { block: 'text', text: 'Returns are under Products → Returns, beside the order they are for.', variant: 'caption' },\n ],\n footerReason: 'You’re receiving this because you manage {{host.businessName}}.',\n },\n {\n key: 'return-approved',\n name: 'Return approved',\n description:\n 'Tells the buyer their return was approved and how to send the items ' +\n 'back, with the return label when the store attached one.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your return for order {{order.number}} is approved',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n RETURN_NOTE_TOKEN,\n {\n name: 'return.label',\n description:\n 'A sentence with the return label link and its tracking; empty ' +\n 'when the store attached no label',\n sample: 'Print your return label: https://labels.example.com/r/123',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your return is approved', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} approved the return of these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{return.items}}', variant: 'details' },\n { block: 'text', text: 'What to do next', variant: 'subheading' },\n { block: 'text', text: '{{return.note}}', variant: 'body' },\n { block: 'text', text: '{{return.label}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Your refund is sent once {{host.businessName}} receives the items, and you will get an email when it is.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'return-declined',\n name: 'Return declined',\n description: 'Tells the buyer their return was declined, with the store’s note.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'About your return for order {{order.number}}',\n mergeTokens: [ORDER_NUMBER_TOKEN, RETURN_ITEMS_TOKEN, RETURN_NOTE_TOKEN, ORDER_STATUS_URL_TOKEN],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'We could not accept this return', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} declined the return of these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{return.items}}', variant: 'details' },\n { block: 'text', text: '{{return.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about it? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'return-refunded',\n name: 'Return refunded',\n description: 'Tells the buyer their return was received and refunded, and how much.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your refund for order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n {\n name: 'return.refundTotal',\n description: 'The amount refunded for this return',\n sample: '$24.00',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your return is refunded', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} received your return and refunded {{return.refundTotal}} to your original payment method.', variant: 'body' },\n { block: 'text', text: '{{return.items}}\\nTotal refunded: {{return.refundTotal}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Refunds usually appear within 5 to 10 business days, depending on your bank.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n ]\n}\n"],"names":["ORDER_NUMBER_TOKEN","name","description","sample","ORDER_STATUS_URL_TOKEN","PICKUP_LOCATION_TOKEN","ORDER_FOOTER_REASON","commerceTenantEmails","key","pluginId","plugin","control","defaultSubject","mergeTokens","defaultBody","block","text","variant","label","href","footerReason","requiresFeature","returnTenantEmails","RETURN_ITEMS_TOKEN","RETURN_NOTE_TOKEN"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID,qEAAqE,GACrE,MAAMA,qBAAqB;IACzBC,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA;;;CAGC,GACD,MAAMC,yBAAyB;IAC7BH,MAAM;IACNC,aACE,4EACA;IACFC,QAAQ;AACV;AAEA,kDAAkD,GAClD,MAAME,wBAAwB;IAC5BJ,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA,MAAMG,sBACJ;AAEF;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC;IACd,OAAO;QACL;YACEC,KAAK;YACLP,MAAM;YACNC,aAAa;YACbO,UAAU;YACVC,QAAQ;YACRC,SAAS;YACTC,gBAAgB;YAChBC,aAAa;gBACX;oBACEZ,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aACE;oBACFC,QAAQ;gBACV;gBACAH;gBACAI;aACD;YACDU,aAAa;gBACX;oBAAEC,OAAO;oBAAQC,MAAM;oBAAkDC,SAAS;gBAAU;gBAC5F;oBAAEF,OAAO;oBAAQC,MAAM;oBAAyBC,SAAS;gBAAU;gBACnE;oBAAEF,OAAO;oBAAQC,MAAM;oBAAkKC,SAAS;gBAAO;gBACzM;oBAAEF,OAAO;oBAAQC,MAAM;oBAAqDC,SAAS;gBAAU;gBAC/F;oBAAEF,OAAO;oBAAQC,MAAM;oBAA2BC,SAAS;gBAAO;g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}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/tenant-emails.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TenantEmailEntry } from '@aglyn/shared-util-email'\n\n/** The human order number every buyer order email names (AGL-3610). */\nconst ORDER_NUMBER_TOKEN = {\n name: 'order.number',\n description: 'The order number, as the store shows it',\n sample: '#1042',\n} as const\n\n/**\n * The buyer's private order-status page (AGL-3610): a signed link, so it\n * opens without an account and only for this order.\n */\nconst ORDER_STATUS_URL_TOKEN = {\n name: 'order.statusUrl',\n description:\n 'Link to the order status page: status, shipments and tracking. Private ' +\n 'to the buyer; it needs no account',\n sample: 'https://shop.example.com/order-status?o=ord_123&t=…',\n} as const\n\n/** Where a pickup order is collected (AGL-3624). */\nconst PICKUP_LOCATION_TOKEN = {\n name: 'pickup.location',\n description: 'The pickup location’s name and address',\n sample: 'Main Street shop, 12 Main St, Springfield',\n} as const\n\nconst ORDER_FOOTER_REASON =\n 'You’re receiving this because you placed an order with {{host.businessName}}.'\n\n/**\n * The emails a site sends its own customers through Commerce (AGL-769/770).\n *\n * Declared here, by the plugin that sends them, and compiled into the\n * platform's tenant email catalog (`TENANT_EMAILS` in\n * `@aglyn/shared-util-email`) by `tools/scripts/generate-plugin-manifests.mjs`\n * (AGL-3080): the catalog's readers include the send path, which loads no\n * plugin code, so a runtime registry it had not filled would quietly send\n * the text card in place of the site's designed email. Regenerate after\n * changing an entry; `--check` refuses a stale catalog.\n *\n * Most commerce sends are designable in the email besigner; a `fixed` entry\n * flips to `besigner` when its send site is wired to `renderHostEmail`\n * (AGL-770).\n */\nexport function commerceTenantEmails(): readonly TenantEmailEntry[] {\n return [\n {\n key: 'order-receipt',\n name: 'Order receipt',\n description: 'Sent to the buyer after a successful order or checkout.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Receipt for your order',\n mergeTokens: [\n {\n name: 'order.summary',\n description: 'The ordered items, one per line (with any license/download links)',\n sample: 'House Blend × 2 — $24.00',\n },\n {\n name: 'order.total',\n description: 'Order total',\n sample: '$24.00',\n },\n {\n name: 'order.ref',\n description: 'Order reference id',\n sample: 'cs_test_123',\n },\n {\n name: 'store.receiptFooter',\n description:\n 'The Receipt footer from the store settings; empty when none is set',\n sample: 'Returns are accepted within 30 days.',\n },\n ORDER_NUMBER_TOKEN,\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Thanks for your order', variant: 'heading' },\n { block: 'text', text: 'Here is the receipt for your order from {{host.businessName}}. We will email you again as your order moves along, and the order page always shows where it is.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nTotal charged: {{order.total}}', variant: 'details' },\n { block: 'text', text: '{{store.receiptFooter}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Order {{order.number}} · payment reference {{order.ref}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-shipped',\n name: 'Order shipped',\n description:\n 'Tells the buyer part or all of their order is on its way, with the ' +\n 'carrier and a tracking link when the shipment has one. Sent once per ' +\n 'shipment.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} has shipped',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'shipment.summary',\n description: 'The items in this shipment, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'shipment.carrier',\n description: 'The carrier; empty when none was recorded',\n sample: 'UPS',\n },\n {\n name: 'shipment.trackingNumber',\n description: 'The tracking number; empty when none was recorded',\n sample: '1Z999AA10123456784',\n },\n {\n name: 'shipment.tracking',\n description:\n 'A sentence with the carrier, tracking number and tracking link; ' +\n 'empty when the shipment has no tracking number',\n sample:\n 'Tracking: UPS 1Z999AA10123456784 — https://www.ups.com/track?tracknum=1Z999AA10123456784',\n },\n {\n name: 'shipment.remaining',\n description:\n 'A sentence saying how many items are still to ship; empty when ' +\n 'this shipment completes the order',\n sample: '1 more item will ship separately.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is on its way', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} shipped these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{shipment.summary}}', variant: 'details' },\n { block: 'text', text: '{{shipment.tracking}}', variant: 'body' },\n { block: 'text', text: '{{shipment.remaining}}', variant: 'body' },\n { block: 'button', label: 'Track your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'The order page shows every shipment and its tracking as it moves. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-delivered',\n name: 'Order delivered',\n description: 'Tells the buyer their order was marked delivered.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} was delivered',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order was delivered', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} marked order {{order.number}} as delivered. We hope you enjoy it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-refunded',\n name: 'Order refunded',\n description:\n 'Tells the buyer a refund was issued, for how much and, when the ' +\n 'store refunded named items, which ones. Sent once per refund.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Refund for your order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'refund.amount',\n description: 'The amount of this refund',\n sample: '$12.00',\n },\n {\n name: 'refund.summary',\n description:\n 'The refunded items, one per line; empty when the refund was by ' +\n 'amount only',\n sample: '1× House Blend',\n },\n {\n name: 'refund.note',\n description:\n 'Whether the order is now fully refunded, as a sentence',\n sample: 'Your order has been refunded in full.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your refund is on its way', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} refunded {{refund.amount}} on order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{refund.summary}}\\nTotal refunded: {{refund.amount}}', variant: 'details' },\n { block: 'text', text: '{{refund.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Refunds go back to the original payment method and usually appear within 5 to 10 business days, depending on your bank.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-cancelled',\n name: 'Order canceled',\n description: 'Tells the buyer their order was canceled.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} was canceled',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'cancel.note',\n description:\n 'What happens to the payment, as a sentence; empty when nothing ' +\n 'was paid',\n sample:\n 'Any payment you made will be refunded, and you will get a ' +\n 'separate email when it is.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order was canceled', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} canceled order {{order.number}}. These items will not be sent.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}', variant: 'details' },\n { block: 'text', text: '{{cancel.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n // Pickup and the store's own delivery (AGL-3624).\n {\n key: 'order-ready-for-pickup',\n name: 'Order ready for pickup',\n description:\n 'Tells the buyer their pickup order is ready, where to collect it, ' +\n 'the pickup hours and any arrival instructions.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} is ready for pickup',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n PICKUP_LOCATION_TOKEN,\n {\n name: 'pickup.hours',\n description: 'The location’s pickup hours; empty when it lists none',\n sample: 'Pickup hours:\\nMo-Fr 09:00-17:00',\n },\n {\n name: 'pickup.instructions',\n description: 'What to do on arrival, as the store wrote it; empty when it wrote none',\n sample: 'Ring the bell at the side door.',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is ready for pickup', variant: 'heading' },\n { block: 'text', text: 'Order {{order.number}} is packed and waiting for you at {{pickup.location}}.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nPick up at: {{pickup.location}}', variant: 'details' },\n { block: 'text', text: '{{pickup.hours}}', variant: 'body' },\n { block: 'text', text: '{{pickup.instructions}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Bring your order number, {{order.number}}. Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-picked-up',\n name: 'Order picked up',\n description: 'Confirms to the buyer that their pickup order was collected.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'You picked up order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n PICKUP_LOCATION_TOKEN,\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Thanks for picking up your order', variant: 'heading' },\n { block: 'text', text: 'Order {{order.number}} was picked up from {{pickup.location}}. Enjoy it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nPicked up at: {{pickup.location}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Something missing or not right? Reply to this email and {{host.businessName}} will sort it out.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'order-out-for-delivery',\n name: 'Order out for delivery',\n description:\n 'Tells the buyer the store’s own driver is on the way with their ' +\n 'local delivery, in the window they booked.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your order {{order.number}} is out for delivery',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'order.summary',\n description: 'The ordered items, one per line',\n sample: '2× House Blend',\n },\n {\n name: 'delivery.window',\n description: 'The delivery window the buyer booked',\n sample: 'Tue, Oct 14, 9:00 AM – 12:00 PM',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your order is out for delivery', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} is on the way with order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nDelivery window: {{delivery.window}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about your order? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n // AGL-4097. Sent from the console's Send quote, never on its own; the\n // quote's PDF is attached, and each send replies into the customer's\n // conversation with the business (`quote.emailThread`). Every token is\n // composed per send by `utils/quote-email-content.ts`; the prices it\n // carries are the ones named here (`quote.total`, `quote.buttonLabel`),\n // and `quote.proofImages` carries pictures and file names only.\n key: 'quote-sent',\n name: 'Quote',\n description:\n 'Sends a quote to the customer when you choose Send quote: your ' +\n 'message, the proof, the quote as a PDF and a button to approve or ' +\n 'pay it on your site. Later sends, such as a new revision, arrive in ' +\n 'the same conversation.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: '{{quote.subject}}',\n mergeTokens: [\n {\n name: 'quote.subject',\n description: 'The subject typed when sending; it stays the same for every email about the quote',\n sample: 'Quote #1042 from Northwind Signs',\n },\n { name: 'quote.number', description: 'The quote number', sample: '#1042' },\n { name: 'quote.revision', description: 'Which revision of the quote this is', sample: '2' },\n {\n name: 'quote.total',\n description: 'The quote total; “before tax” when tax is added at payment',\n sample: '$1,250.00',\n },\n {\n name: 'quote.heading',\n description: '“Your quote from …”, or “Your updated quote” from the second revision on',\n sample: 'Your quote from Northwind Signs',\n },\n {\n name: 'quote.intro',\n description: 'One sentence on what this email is: a new quote, or an updated revision',\n sample: 'Here is your quote from Northwind Signs. The quote is attached as a PDF too.',\n },\n {\n name: 'quote.message',\n description: 'The message typed when sending; empty when none was typed',\n sample: 'Thanks for stopping by the shop. Here is the banner we talked about.',\n },\n {\n name: 'quote.proofImages',\n description: 'Up to three proof images, each linked to the quote page; empty when the revision has none',\n sample: '<table role=\"presentation\"><tr><td><img src=\"https://shop.example.com/api/commerce/quote-proof?file=p1\" alt=\"Proof: banner.png\" width=\"552\" /></td></tr></table>',\n },\n {\n name: 'quote.proofFiles',\n description: 'The other proof files by name, to see on the quote page; empty when there are none',\n sample: 'Also with this revision: banner.ai. See it on your quote page.',\n },\n {\n name: 'quote.nextStep',\n description: 'What to do next: approve the proof first, or pay when ready',\n sample: 'Look over the proof, then approve it on your quote page. Once you approve it, you can pay there.',\n },\n {\n name: 'quote.buttonLabel',\n description: '“Review and approve” while an approval is needed first, else “View and pay” with the total',\n sample: 'View and pay $1,250.00',\n },\n {\n name: 'quote.url',\n description: 'The quote’s pay link on your site. Private to the customer; it needs no account',\n sample: 'https://shop.example.com/pay-quote?q=quote_123&t=…',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Quote {{quote.number}}', variant: 'eyebrow' },\n { block: 'text', text: '{{quote.heading}}', variant: 'heading' },\n { block: 'text', text: '{{quote.intro}}', variant: 'body' },\n { block: 'text', text: '{{quote.message}}', variant: 'body' },\n { block: 'text', text: 'Quote: {{quote.number}}\\nRevision: {{quote.revision}}\\nTotal: {{quote.total}}', variant: 'details' },\n { block: 'html', html: '{{quote.proofImages}}' },\n { block: 'text', text: '{{quote.proofFiles}}', variant: 'caption' },\n { block: 'text', text: '{{quote.nextStep}}', variant: 'body' },\n { block: 'button', label: '{{quote.buttonLabel}}', href: '{{quote.url}}' },\n { block: 'text', text: 'Reply to this email to reach {{host.businessName}}.', variant: 'caption' },\n ],\n footerReason: 'You’re receiving this because {{host.businessName}} prepared a quote for you.',\n },\n {\n // The invoice email (AGL-4099), sent when the business chooses Send\n // invoice on an order or a quote. Its tokens are composed per send by\n // `utils/invoice-email-content.ts`: unpaid, it asks for payment through\n // the order's lasting pay link; paid, it is the record and draws no\n // button (an empty `invoice.url` leaves the button out).\n key: 'order-invoice',\n name: 'Invoice',\n description:\n 'Sends an invoice for an order or a quote when you choose Send ' +\n 'invoice: your message, the invoice as a PDF and, while it is ' +\n 'unpaid, a button to pay it on your site. A paid invoice is the ' +\n 'customer’s record. It arrives in the same conversation as the ' +\n 'quote’s emails.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: '{{invoice.subject}}',\n mergeTokens: [\n {\n name: 'invoice.subject',\n description: 'The subject typed when sending; it stays the same as the conversation it joins',\n sample: 'Invoice #1042 from Northwind Signs',\n },\n { name: 'invoice.number', description: 'The invoice number, which is the order number', sample: '#1042' },\n { name: 'invoice.date', description: 'The date of the order or quote', sample: 'October 28, 2026' },\n {\n name: 'invoice.total',\n description: 'The invoice total; “before tax” or “before shipping” when those are added at payment',\n sample: '$1,250.00',\n },\n {\n name: 'invoice.status',\n description: '“Paid on …”, or what is still due',\n sample: 'Unpaid, $1,250.00 due',\n },\n {\n name: 'invoice.heading',\n description: '“Invoice #… from …”',\n sample: 'Invoice #1042 from Northwind Signs',\n },\n {\n name: 'invoice.intro',\n description: 'One sentence on what this email is: an invoice to pay, or a paid one for the customer’s records',\n sample: 'Northwind Signs sent you an invoice for your order. The details are below, and the invoice is attached as a PDF.',\n },\n {\n name: 'invoice.message',\n description: 'The message typed when sending; empty when none was typed',\n sample: 'Thanks again for your order. Here is the invoice we talked about.',\n },\n {\n name: 'invoice.nextStep',\n description: 'What to do next: pay with the button, or keep a paid invoice for the records',\n sample: 'Use the button below to pay it securely by card. The button keeps working until the invoice is paid.',\n },\n {\n name: 'invoice.buttonLabel',\n description: '“Pay” with the amount; empty on a paid invoice, which leaves the button out',\n sample: 'Pay $1,250.00',\n },\n {\n name: 'invoice.url',\n description: 'The invoice’s pay link on your site. Private to the customer; it needs no account. Empty once paid',\n sample: 'https://shop.example.com/pay-quote?q=order_123&t=…',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Invoice {{invoice.number}}', variant: 'eyebrow' },\n { block: 'text', text: '{{invoice.heading}}', variant: 'heading' },\n { block: 'text', text: '{{invoice.intro}}', variant: 'body' },\n { block: 'text', text: '{{invoice.message}}', variant: 'body' },\n { block: 'text', text: 'Invoice: {{invoice.number}}\\nDate: {{invoice.date}}\\nTotal: {{invoice.total}}\\nStatus: {{invoice.status}}', variant: 'details' },\n { block: 'text', text: '{{invoice.nextStep}}', variant: 'body' },\n { block: 'button', label: '{{invoice.buttonLabel}}', href: '{{invoice.url}}' },\n { block: 'text', text: 'Reply to this email to reach {{host.businessName}}.', variant: 'caption' },\n ],\n footerReason: 'You’re receiving this because {{host.businessName}} sent you an invoice.',\n },\n {\n key: 'sale-notification',\n name: 'New sale',\n description: 'Notifies the seller when an order is placed.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'New order on {{site.name}}',\n mergeTokens: [\n {\n name: 'site.name',\n description: 'The site the sale happened on',\n sample: 'Northwind Coffee',\n },\n {\n name: 'order.summary',\n description: 'The ordered items',\n sample: 'House Blend — $12.00',\n },\n { name: 'order.total', description: 'Order total', sample: '$12.00' },\n {\n name: 'buyer.email',\n description: \"The buyer's email\",\n sample: 'buyer@example.com',\n },\n {\n name: 'order.ref',\n description: 'Order reference id',\n sample: 'cs_test_123',\n },\n { name: 'orders.url', description: 'The site’s Orders page in the console', sample: 'https://app.example.com/northwind/hosts/northwind/products/orders' },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · New order', variant: 'eyebrow' },\n { block: 'text', text: 'You made a sale', variant: 'heading' },\n { block: 'text', text: 'A new paid order came in on {{site.name}}. Here is what was bought and who bought it.', variant: 'body' },\n { block: 'text', text: '{{order.summary}}\\nTotal: {{order.total}}\\nBuyer: {{buyer.email}}\\nPayment reference: {{order.ref}}', variant: 'details' },\n { block: 'button', label: 'Open orders', href: '{{orders.url}}' },\n { block: 'text', text: 'Fulfill it from Orders: as you mark it shipped, ready for pickup or delivered, the buyer is emailed at each step.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you manage {{host.businessName}}.',\n },\n {\n key: 'reservation-confirmed',\n name: 'Reservation confirmed',\n description: 'Confirms a paid reservation to the customer.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Reservation confirmed',\n mergeTokens: [\n {\n name: 'reservation.checkIn',\n description: 'Check-in date',\n sample: 'Mon, 01 Jun 2026',\n },\n {\n name: 'reservation.nights',\n description: 'Number of nights',\n sample: '2',\n },\n {\n name: 'reservation.paid',\n description:\n 'What the guest was charged today, lodging tax included; a ' +\n 'charge that carried lodging tax names it, as in “$254.40, ' +\n 'including $14.40 lodging tax”',\n sample: '$240.00',\n },\n {\n name: 'reservation.balance',\n description:\n 'What is still owed for the stay and where it is paid, as a ' +\n 'sentence; empty when the stay is paid in full',\n sample: 'Still to pay: $360.00, at the property. It has not been charged.',\n },\n {\n name: 'reservation.ref',\n description: 'Reservation reference id',\n sample: 'resv_123',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Reservation', variant: 'eyebrow' },\n { block: 'text', text: 'Your stay is confirmed', variant: 'heading' },\n { block: 'text', text: 'Your reservation at {{host.businessName}} is booked. Here are the details to keep.', variant: 'body' },\n { block: 'text', text: 'Check-in: {{reservation.checkIn}}\\nNights: {{reservation.nights}}\\nPaid today: {{reservation.paid}}\\nReference: {{reservation.ref}}', variant: 'details' },\n { block: 'text', text: '{{reservation.balance}}', variant: 'body' },\n { block: 'text', text: 'Questions before you arrive? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you made a reservation with {{host.businessName}}.',\n },\n {\n key: 'gift-card',\n name: 'Gift card delivery',\n description: 'Delivers a purchased gift card to its recipient.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your gift card for {{host.businessName}}',\n mergeTokens: [\n {\n name: 'giftcard.code',\n description: 'The gift card code',\n sample: 'GC-ABC123DEF456',\n },\n {\n name: 'giftcard.value',\n description: 'The gift card value',\n sample: '$25.00',\n },\n {\n name: 'giftcard.note',\n description:\n 'The note written when the card was issued by hand; empty for a ' +\n 'card bought at checkout',\n sample: 'Happy birthday, Sam!',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Gift card', variant: 'eyebrow' },\n { block: 'text', text: 'Your {{giftcard.value}} gift card', variant: 'heading' },\n { block: 'text', text: 'You have a {{giftcard.value}} gift card for {{host.businessName}}.', variant: 'body' },\n { block: 'text', text: '{{giftcard.note}}', variant: 'body' },\n { block: 'text', text: 'Value: {{giftcard.value}}\\nGift card code: {{giftcard.code}}', variant: 'details' },\n { block: 'text', text: 'Enter the code at checkout on {{host.url}} to use its balance.', variant: 'body' },\n { block: 'button', label: 'Shop {{host.businessName}}', href: '{{host.url}}' },\n { block: 'text', text: 'Keep this email: the code is what you spend the card with.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because a gift card from {{host.businessName}} was sent to this address.',\n },\n {\n key: 'supplier-fulfillment',\n name: 'Supplier fulfillment',\n description: 'Tells a dropship supplier there is a new order to fulfill.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'fixed',\n },\n {\n key: 'back-in-stock',\n name: 'Back in stock',\n description: 'Tells a customer a product they watched is available again.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Back in stock: {{product.name}}',\n mergeTokens: [\n {\n name: 'product.name',\n description: 'The product that restocked',\n sample: 'House Blend',\n },\n {\n name: 'product.url',\n description: 'Link to the product page',\n sample: 'https://shop.example.com/products/house-blend',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: '{{product.name}} is back in stock', variant: 'heading' },\n { block: 'text', text: 'You asked to hear when {{product.name}} was back at {{host.businessName}}. It is, and you can order it now.', variant: 'body' },\n { block: 'button', label: 'Shop {{product.name}}', href: '{{product.url}}' },\n { block: 'text', text: 'You asked {{host.businessName}} to tell you when it was back. Nothing is held for you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you asked {{host.businessName}} to tell you when this was back.',\n },\n {\n key: 'abandoned-cart',\n name: 'Abandoned cart',\n description: 'Reminds a shopper of items left in their cart.',\n // The cron refuses to send this without the entitlement\n // (`process-abandoned.ts:92`), so the console has to say so (AGL-2081).\n requiresFeature: 'abandonedCart',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'You left something in your cart',\n mergeTokens: [\n {\n name: 'cart.url',\n description: 'Link back to the shopper cart',\n sample: 'https://shop.example.com/cart',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: 'You left something in your cart', variant: 'heading' },\n { block: 'text', text: 'Your cart at {{host.businessName}} still has your items in it. Pick up where you left off whenever you are ready.', variant: 'body' },\n { block: 'button', label: 'Return to your cart', href: '{{cart.url}}' },\n { block: 'text', text: 'Nothing in your cart is held for you.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because you started a checkout with {{host.businessName}}.',\n },\n {\n // AGL-3736: days after fulfilment, one per order, with a single-use\n // link per product that opens its review form pre-verified.\n key: 'review-request',\n name: 'Review request',\n description:\n 'Asks a buyer to review what they bought, a set number of days after ' +\n 'the order is fulfilled. One per order; each product has its own ' +\n 'single-use link. Turn it off or change the delay in Settings → Reviews.',\n requiresFeature: 'productReviews',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'How was your order from {{host.businessName}}?',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n {\n name: 'review.products',\n description:\n 'Each product to review, one per line, with its own review link',\n sample: 'House Blend: https://shop.example.com/products/house-blend?review=…',\n },\n {\n name: 'review.url',\n description: 'The review link for the first product',\n sample: 'https://shop.example.com/products/house-blend?review=…',\n },\n {\n name: 'review.productName',\n description: 'The first product’s name',\n sample: 'House Blend',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'How did we do?', variant: 'heading' },\n { block: 'text', text: 'Thanks again for your order {{order.number}} from {{host.businessName}}. Would you tell other shoppers what you think? Each link opens the product with a review form ready.', variant: 'body' },\n { block: 'text', text: '{{review.products}}', variant: 'links' },\n { block: 'button', label: 'Write a review', href: '{{review.url}}' },\n { block: 'text', text: 'Each link works once, for 60 days.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'member-post',\n name: 'New member post',\n description: 'Notifies members when new members-only content is posted.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: '{{post.title}}',\n mergeTokens: [\n { name: 'post.title', description: 'The post’s title', sample: 'This month in the studio' },\n {\n name: 'post.body',\n description: 'The post, as its author wrote it',\n sample: 'Three new pieces are up for members first.',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Members', variant: 'eyebrow' },\n { block: 'text', text: '{{post.title}}', variant: 'heading' },\n { block: 'text', text: '{{post.body}}', variant: 'body' },\n { block: 'button', label: 'Visit {{host.businessName}}', href: '{{host.url}}' },\n ],\n footerReason: 'You’re receiving this because you’re a member of {{host.businessName}}.',\n },\n {\n key: 'member-password-reset',\n name: 'Member password reset',\n description:\n \"Resets a site member's password — a store-member account, separate \" +\n 'from a console login. Sent when the member asks, and when a site ' +\n 'administrator starts a reset for them.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Reset your {{site.name}} password',\n mergeTokens: [\n { name: 'site.name', description: 'The site’s name', sample: 'Northwind Coffee' },\n {\n name: 'reset.intro',\n description: 'Who started the reset',\n sample: 'Someone asked to reset the password for your Northwind Coffee account.',\n },\n {\n name: 'resetUrl',\n description: 'The one-time reset link',\n sample: 'https://shop.example.com/recover?token=…',\n },\n {\n name: 'reset.note',\n description: 'How long the link lasts, and what to do if unexpected',\n sample:\n 'The link works once and expires in 1 hour. If you did not ask for ' +\n 'this, you can safely ignore this email — your password is unchanged.',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · Account security', variant: 'eyebrow' },\n { block: 'text', text: 'Reset your password', variant: 'heading' },\n { block: 'text', text: '{{reset.intro}}', variant: 'body' },\n { block: 'button', label: 'Set a new password', href: '{{resetUrl}}' },\n { block: 'text', text: '{{reset.note}}', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because a password reset was started for your ' +\n '{{host.businessName}} account.',\n },\n {\n key: 'member-password-changed',\n name: 'Member password changed',\n description:\n 'Tells a site member that a site administrator set a new password on ' +\n 'their account.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your {{site.name}} password was changed',\n mergeTokens: [\n { name: 'site.name', description: 'The site’s name', sample: 'Northwind Coffee' },\n {\n name: 'signInUrl',\n description: 'Where the member signs back in',\n sample: 'https://shop.example.com',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{site.name}} · Account security', variant: 'eyebrow' },\n { block: 'text', text: 'Your password was changed', variant: 'heading' },\n { block: 'text', text: 'An administrator of {{site.name}} set a new password on your account and signed you out on every device. To sign back in, get the new password from them, or choose \"Forgot password?\" on the sign-in page to set your own.', variant: 'body' },\n { block: 'button', label: 'Sign in', href: '{{signInUrl}}' },\n { block: 'text', text: 'If you did not expect this, contact the site owner straight away.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because the password on your ' +\n '{{host.businessName}} account was changed.',\n },\n {\n key: 'newsletter-confirmation',\n name: 'Subscription confirmation',\n description:\n 'Asks someone who signed up for a site’s emails to confirm the address ' +\n 'before anything is sent to it.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Confirm your subscription',\n mergeTokens: [\n {\n name: 'stream.name',\n description: 'What they signed up for',\n sample: 'Newsletter',\n },\n {\n name: 'confirmUrl',\n description: 'The confirmation link',\n sample: 'https://shop.example.com/subscribe/confirm?token=…',\n },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}}', variant: 'eyebrow' },\n { block: 'text', text: 'Confirm your subscription', variant: 'heading' },\n { block: 'text', text: 'Please confirm that you want {{stream.name}} emails from {{host.businessName}} at this address. Nothing is sent until you do.', variant: 'body' },\n { block: 'text', text: 'List: {{stream.name}}\\nFrom: {{host.businessName}}', variant: 'details' },\n { block: 'button', label: 'Confirm my subscription', href: '{{confirmUrl}}' },\n { block: 'text', text: 'The link works for three days. If you did not sign up, ignore this message and nothing will be sent.', variant: 'caption' },\n ],\n footerReason:\n 'You’re receiving this because this address was entered on ' +\n '{{host.businessName}}’s signup form.',\n },\n ...returnTenantEmails(),\n ]\n}\n\n/** The items a return covers, one per line. */\nconst RETURN_ITEMS_TOKEN = {\n name: 'return.items',\n description: 'The items being returned, one per line, with the reason',\n sample: '1× House Blend — Arrived damaged',\n} as const\n\n/** The merchant's note on a return; empty when they left none. */\nconst RETURN_NOTE_TOKEN = {\n name: 'return.note',\n description: 'The store’s note to the buyer on this return; empty when none',\n sample: 'Please include the original packaging.',\n} as const\n\n/**\n * The return emails (AGL-3611): one to the store when a buyer asks, and one\n * to the buyer at each answer. Their own block, beside the order emails\n * rather than among them, because those belong to the order notifications.\n */\nfunction returnTenantEmails(): readonly TenantEmailEntry[] {\n return [\n {\n key: 'return-requested',\n name: 'Return requested',\n description:\n 'Tells the store a buyer asked to return items, with what and why, so ' +\n 'someone can approve or decline it.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Return requested for order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n {\n name: 'buyer.email',\n description: 'The buyer’s email',\n sample: 'buyer@example.com',\n },\n {\n name: 'return.customerNote',\n description: 'What the buyer wrote; empty when they wrote nothing',\n sample: 'The lid was cracked.',\n },\n { name: 'return.url', description: 'The return in the console, to approve or decline', sample: 'https://app.example.com/northwind/hosts/northwind/products/returns?return=ret_123' },\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'A buyer asked for a return', variant: 'heading' },\n { block: 'text', text: '{{buyer.email}} wants to return items from order {{order.number}}. Approve or decline it, and the buyer is emailed your answer.', variant: 'body' },\n { block: 'text', text: '{{return.items}}\\nBuyer: {{buyer.email}}', variant: 'details' },\n { block: 'text', text: '{{return.customerNote}}', variant: 'body' },\n { block: 'button', label: 'Review the return', href: '{{return.url}}' },\n { block: 'text', text: 'Returns are under Products → Returns, beside the order they are for.', variant: 'caption' },\n ],\n footerReason: 'You’re receiving this because you manage {{host.businessName}}.',\n },\n {\n key: 'return-approved',\n name: 'Return approved',\n description:\n 'Tells the buyer their return was approved and how to send the items ' +\n 'back, with the return label when the store attached one.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your return for order {{order.number}} is approved',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n RETURN_NOTE_TOKEN,\n {\n name: 'return.label',\n description:\n 'A sentence with the return label link and its tracking; empty ' +\n 'when the store attached no label',\n sample: 'Print your return label: https://labels.example.com/r/123',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your return is approved', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} approved the return of these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{return.items}}', variant: 'details' },\n { block: 'text', text: 'What to do next', variant: 'subheading' },\n { block: 'text', text: '{{return.note}}', variant: 'body' },\n { block: 'text', text: '{{return.label}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Your refund is sent once {{host.businessName}} receives the items, and you will get an email when it is.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'return-declined',\n name: 'Return declined',\n description: 'Tells the buyer their return was declined, with the store’s note.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'About your return for order {{order.number}}',\n mergeTokens: [ORDER_NUMBER_TOKEN, RETURN_ITEMS_TOKEN, RETURN_NOTE_TOKEN, ORDER_STATUS_URL_TOKEN],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'We could not accept this return', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} declined the return of these items from order {{order.number}}.', variant: 'body' },\n { block: 'text', text: '{{return.items}}', variant: 'details' },\n { block: 'text', text: '{{return.note}}', variant: 'body' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Questions about it? Reply to this email and {{host.businessName}} will get back to you.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n {\n key: 'return-refunded',\n name: 'Return refunded',\n description: 'Tells the buyer their return was received and refunded, and how much.',\n pluginId: 'commerce',\n plugin: 'Commerce',\n control: 'besigner',\n defaultSubject: 'Your refund for order {{order.number}}',\n mergeTokens: [\n ORDER_NUMBER_TOKEN,\n RETURN_ITEMS_TOKEN,\n {\n name: 'return.refundTotal',\n description: 'The amount refunded for this return',\n sample: '$24.00',\n },\n ORDER_STATUS_URL_TOKEN,\n ],\n defaultBody: [\n { block: 'text', text: '{{host.businessName}} · Order {{order.number}}', variant: 'eyebrow' },\n { block: 'text', text: 'Your return is refunded', variant: 'heading' },\n { block: 'text', text: '{{host.businessName}} received your return and refunded {{return.refundTotal}} to your original payment method.', variant: 'body' },\n { block: 'text', text: '{{return.items}}\\nTotal refunded: {{return.refundTotal}}', variant: 'details' },\n { block: 'button', label: 'View your order', href: '{{order.statusUrl}}' },\n { block: 'text', text: 'Refunds usually appear within 5 to 10 business days, depending on your bank.', variant: 'caption' },\n ],\n footerReason: ORDER_FOOTER_REASON,\n },\n ]\n}\n"],"names":["ORDER_NUMBER_TOKEN","name","description","sample","ORDER_STATUS_URL_TOKEN","PICKUP_LOCATION_TOKEN","ORDER_FOOTER_REASON","commerceTenantEmails","key","pluginId","plugin","control","defaultSubject","mergeTokens","defaultBody","block","text","variant","label","href","footerReason","html","requiresFeature","returnTenantEmails","RETURN_ITEMS_TOKEN","RETURN_NOTE_TOKEN"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID,qEAAqE,GACrE,MAAMA,qBAAqB;IACzBC,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA;;;CAGC,GACD,MAAMC,yBAAyB;IAC7BH,MAAM;IACNC,aACE,4EACA;IACFC,QAAQ;AACV;AAEA,kDAAkD,GAClD,MAAME,wBAAwB;IAC5BJ,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA,MAAMG,sBACJ;AAEF;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC;IACd,OAAO;QACL;YACEC,KAAK;YACLP,MAAM;YACNC,aAAa;YACbO,UAAU;YACVC,QAAQ;YACRC,SAAS;YACTC,gBAAgB;YAChBC,aAAa;gBACX;oBACEZ,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACA;oBACEF,MAAM;oBACNC,aACE;oBACFC,QAAQ;gBACV;gBACAH;gBACAI;aACD;YACDU,aAAa;gBACX;oBAAEC,OAAO;oBAAQC,MAAM;oBAAkDC,SAAS;gBAAU;gBAC5F;oBAAEF,OAAO;oBAAQC,MAAM;oBAAyBC,SAAS;gBAAU;gBACnE;oBAAEF,OAAO;oBAAQC,MAAM;oBAAkKC,SAAS;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AwB;gBACA;oBACEvB,MAAM;oBACNC,aAAa;oBACbC,QAAQ;gBACV;gBACAC;aACD;YACDU,aAAa;gBACX;oBAAEC,OAAO;oBAAQC,MAAM;oBAAkDC,SAAS;gBAAU;gBAC5F;oBAAEF,OAAO;oBAAQC,MAAM;oBAA2BC,SAAS;gBAAU;gBACrE;oBAAEF,OAAO;oBAAQC,MAAM;oBAAmHC,SAAS;gBAAO;gBAC1J;oBAAEF,OAAO;oBAAQC,MAAM;oBAA4DC,SAAS;gBAAU;gBACtG;oBAAEF,OAAO;oBAAUG,OAAO;oBAAmBC,MAAM;gBAAsB;gBACzE;oBAAEJ,OAAO;oBAAQC,MAAM;oBAAgFC,SAAS;gBAAU;aAC3H;YACDG,cAAcd;QAChB;KACD;AACH"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type EmailPalette } from '@aglyn/shared-util-email';
18
+ import type { PdfJpegImage } from '@aglyn/shared-util-tools/pdf/pdf-file';
19
+ import type { QuotePageView } from '../model/commerce-quote-pay';
20
+ import { type InvoiceOrder, type OrderInvoiceStore } from './order-invoice';
21
+ /** The colors a document is drawn in, as `#rrggbb`. */
22
+ export interface CommercePdfColors {
23
+ /** The band, the table's header and the pay button: the site's primary color. */
24
+ accent: string;
25
+ /** Text set on the accent. */
26
+ onAccent: string;
27
+ /** The accent as text on white: the document's name, links. */
28
+ accentText: string;
29
+ /** A wash of the accent, behind the total. */
30
+ tint: string;
31
+ ink: string;
32
+ muted: string;
33
+ rule: string;
34
+ }
35
+ /** Who the document is from. */
36
+ export interface CommercePdfBrand {
37
+ businessName: string;
38
+ /** Address lines, email, phone and web address, in that order. */
39
+ contactLines: readonly string[];
40
+ /** The site's logo as a JPEG; the business name stands alone without one. */
41
+ logo?: PdfJpegImage | null;
42
+ /** The site theme's colors; any left out are the neutral ones. */
43
+ colors?: Partial<CommercePdfColors> | null;
44
+ /** The site's time zone, which dates are given in. */
45
+ timeZone?: string | null;
46
+ }
47
+ /** The colors a document wears where its site's theme gives none: the default site theme's greys. */
48
+ export declare const COMMERCE_PDF_NEUTRAL_COLORS: Readonly<CommercePdfColors>;
49
+ /**
50
+ * A document's colors from a site's resolved palette: the primary color for
51
+ * the accent, the theme's own text and divider colors, and text on the
52
+ * accent that reads at 4.5:1 (the theme's contrast text when it does, else
53
+ * the theme's dark ink or white, whichever reads better).
54
+ */
55
+ export declare function commercePdfColorsFromPalette(palette: EmailPalette): CommercePdfColors;
56
+ /** A date the American way, in the site's time zone: `October 28, 2026`. */
57
+ export declare function formatPdfDate(ms: number | null | undefined, timeZone?: string | null): string;
58
+ export interface QuotePdfInput {
59
+ brand: CommercePdfBrand;
60
+ /** The quote as its customer may see it: `buildQuotePageView`. */
61
+ view: QuotePageView;
62
+ /** The quote's revision, printed beside its date. */
63
+ revision?: number | null;
64
+ /** The pay link, printed on a quote still to be paid; left off when the reader may not have it. */
65
+ payUrl?: string | null;
66
+ }
67
+ /** The quote as a PDF. */
68
+ export declare function renderQuotePdf(input: QuotePdfInput): Uint8Array;
69
+ export interface OrderInvoicePdfInput {
70
+ brand: CommercePdfBrand;
71
+ order: InvoiceOrder;
72
+ orderId: string;
73
+ /** The store's currency, receipt footer and terms address (`invoiceStoreFrom`). */
74
+ store: OrderInvoiceStore;
75
+ /**
76
+ * The order's pay link (AGL-4099), printed on an invoice still to be paid
77
+ * as Pay online with a button and the address; left off when absent.
78
+ */
79
+ payUrl?: string | null;
80
+ }
81
+ /** Any order's invoice as a PDF, a paid quote's included. */
82
+ export declare function renderOrderInvoicePdf(input: OrderInvoicePdfInput): Uint8Array;