@isaiahiroko/tilmart-ngx-apps-buyer 0.2.2 → 0.2.4

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 (51) hide show
  1. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-account.module-DkScEdS0.mjs → isaiahiroko-tilmart-ngx-apps-buyer-account.module-BTRypX8P.mjs} +28 -6
  2. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-account.module-BTRypX8P.mjs.map +1 -0
  3. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs → isaiahiroko-tilmart-ngx-apps-buyer-brand.module-DQLAKTdh.mjs} +2 -2
  4. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-brand.module-DQLAKTdh.mjs.map} +1 -1
  5. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-cart-add.service-D2Xwziad.mjs +66 -0
  6. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-cart-add.service-D2Xwziad.mjs.map +1 -0
  7. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs → isaiahiroko-tilmart-ngx-apps-buyer-category.module-Gf9LE-CW.mjs} +2 -2
  8. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-category.module-Gf9LE-CW.mjs.map} +1 -1
  9. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-checkout.module-C3Ncr5fc.mjs +453 -0
  10. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-checkout.module-C3Ncr5fc.mjs.map +1 -0
  11. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs → isaiahiroko-tilmart-ngx-apps-buyer-compare.module-DAXDFqGl.mjs} +71 -49
  12. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-compare.module-DAXDFqGl.mjs.map +1 -0
  13. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs → isaiahiroko-tilmart-ngx-apps-buyer-home.module-DxjFpedA.mjs} +15 -7
  14. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-home.module-DxjFpedA.mjs.map +1 -0
  15. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs → isaiahiroko-tilmart-ngx-apps-buyer-index-DlZbEVtx.mjs} +15 -9
  16. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-index-DlZbEVtx.mjs.map +1 -0
  17. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-invoice.module-Dq0enyYE.mjs +105 -0
  18. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-invoice.module-Dq0enyYE.mjs.map +1 -0
  19. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-kits.module-BjHZeUdK.mjs → isaiahiroko-tilmart-ngx-apps-buyer-kits.module-CMTgfTt_.mjs} +9 -3
  20. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-kits.module-CMTgfTt_.mjs.map +1 -0
  21. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-learn.module-BogfPwVF.mjs → isaiahiroko-tilmart-ngx-apps-buyer-learn.module-DWCV3rlw.mjs} +2 -2
  22. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-learn.module-BogfPwVF.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-learn.module-DWCV3rlw.mjs.map} +1 -1
  23. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-DP0SdGVm.mjs +34 -0
  24. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-DP0SdGVm.mjs.map +1 -0
  25. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-product.module-3yM9Eiwy.mjs → isaiahiroko-tilmart-ngx-apps-buyer-product.module-BvWmbiHx.mjs} +173 -59
  26. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-product.module-BvWmbiHx.mjs.map +1 -0
  27. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs → isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-CrXlbRUD.mjs} +4 -2
  28. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-CrXlbRUD.mjs.map +1 -0
  29. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search.module-cb-hifei.mjs → isaiahiroko-tilmart-ngx-apps-buyer-search.module-CVz-fc7z.mjs} +2 -2
  30. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search.module-cb-hifei.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-search.module-CVz-fc7z.mjs.map} +1 -1
  31. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer.mjs +210 -25
  32. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/types/isaiahiroko-tilmart-ngx-apps-buyer.d.ts +48 -2
  35. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-account.module-DkScEdS0.mjs.map +0 -1
  36. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-checkout.module-ByHqfQJJ.mjs +0 -423
  37. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-checkout.module-ByHqfQJJ.mjs.map +0 -1
  38. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-compare-tray.service-DITbKdyD.mjs +0 -82
  39. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-compare-tray.service-DITbKdyD.mjs.map +0 -1
  40. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs.map +0 -1
  41. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs.map +0 -1
  42. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs.map +0 -1
  43. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-invoice.module-CXjjs2Y4.mjs +0 -81
  44. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-invoice.module-CXjjs2Y4.mjs.map +0 -1
  45. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-kits.module-BjHZeUdK.mjs.map +0 -1
  46. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs +0 -23
  47. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs.map +0 -1
  48. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-nigeria-xVatCeYL.mjs +0 -12
  49. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-nigeria-xVatCeYL.mjs.map +0 -1
  50. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-product.module-3yM9Eiwy.mjs.map +0 -1
  51. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs.map +0 -1
@@ -4,10 +4,9 @@ import * as i1 from '@angular/router';
4
4
  import { ActivatedRoute, RouterModule } from '@angular/router';
5
5
  import { ApiService, ControlService, BaseDirective, using, notify, SharedModule } from '@thescaffold/ngx-core';
6
6
  import { ReplaySubject, firstValueFrom, map, catchError, of, takeUntil, switchMap, forkJoin } from 'rxjs';
7
- import { N as NIGERIAN_STATES } from './isaiahiroko-tilmart-ngx-apps-buyer-nigeria-xVatCeYL.mjs';
7
+ import { StaticListService, CartStoreService } from './isaiahiroko-tilmart-ngx-apps-buyer.mjs';
8
8
  import * as i1$1 from '@angular/forms';
9
9
  import * as i2 from '@angular/common';
10
- import { CartStoreService } from './isaiahiroko-tilmart-ngx-apps-buyer.mjs';
11
10
  import { ThemeService } from '@thescaffold/ngx-common';
12
11
 
13
12
  // P5.3 — resolves the signed-in visitor's commerce `Customer` once and
@@ -129,7 +128,10 @@ class AccountAddressesComponent extends BaseDirective {
129
128
  constructor() {
130
129
  super(...arguments);
131
130
  this.store = inject(AccountStoreService);
132
- this.states = NIGERIAN_STATES;
131
+ this.staticList = inject(StaticListService);
132
+ this.states = [];
133
+ this.lgas = [];
134
+ this.lgasLoading = false;
133
135
  this.loading = true;
134
136
  this.customerId = '';
135
137
  this.addresses = [];
@@ -138,6 +140,7 @@ class AccountAddressesComponent extends BaseDirective {
138
140
  this.form = blankForm();
139
141
  this.formError = '';
140
142
  this.init = () => {
143
+ void this.staticList.getStates().then((states) => (this.states = states));
141
144
  this.store
142
145
  .customer()
143
146
  .pipe(takeUntil(this.$))
@@ -151,6 +154,23 @@ class AccountAddressesComponent extends BaseDirective {
151
154
  }));
152
155
  };
153
156
  }
157
+ async onFormStateChange() {
158
+ this.form.lga = '';
159
+ await this.loadLgas(this.form.state);
160
+ }
161
+ async loadLgas(state) {
162
+ if (!state) {
163
+ this.lgas = [];
164
+ return;
165
+ }
166
+ this.lgasLoading = true;
167
+ try {
168
+ this.lgas = await this.staticList.getLgas(state).catch(() => []);
169
+ }
170
+ finally {
171
+ this.lgasLoading = false;
172
+ }
173
+ }
154
174
  async load() {
155
175
  const res = await firstValueFrom(this.apiService
156
176
  .on('apps/commerce/address')
@@ -175,11 +195,13 @@ class AccountAddressesComponent extends BaseDirective {
175
195
  this.form = blankForm();
176
196
  this.formError = '';
177
197
  this.editing = true;
198
+ this.lgas = [];
178
199
  }
179
200
  startEdit(a) {
180
201
  this.form = { ...a };
181
202
  this.formError = '';
182
203
  this.editing = true;
204
+ void this.loadLgas(this.form.state);
183
205
  }
184
206
  cancel() {
185
207
  this.editing = false;
@@ -252,11 +274,11 @@ class AccountAddressesComponent extends BaseDirective {
252
274
  }
253
275
  }
254
276
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: AccountAddressesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
255
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: AccountAddressesComponent, isStandalone: false, selector: "x-account-addresses", usesInheritance: true, ngImport: i0, template: "<h2 class=\"x-acct-h2\">Addresses</h2>\n<p class=\"x-acct-sub\">Used for delivery and, later, installation visits.</p>\n\n@if (loading) {\n <div class=\"x-acct-empty\">Loading\u2026</div>\n} @else {\n @if (editing) {\n <div class=\"x-acct-card\">\n <strong>{{ form.id ? 'Edit address' : 'New address' }}</strong>\n <div style=\"margin-top: 14px\">\n <div class=\"x-acct-field\">\n <label>Label</label>\n <input [(ngModel)]=\"form.label\" placeholder=\"Home, Office, Site\u2026\" />\n </div>\n <div class=\"x-acct-field\">\n <label>State</label>\n <select aria-label=\"State\" [(ngModel)]=\"form.state\">\n <option value=\"\">Select a state</option>\n @for (s of states; track s) {\n <option [value]=\"s\">{{ s }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>LGA / area</label>\n <input [(ngModel)]=\"form.lga\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Street</label>\n <input [(ngModel)]=\"form.street\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Nearest landmark</label>\n <input [(ngModel)]=\"form.landmark\" placeholder=\"e.g. opposite Zenith Bank\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Building / flat info</label>\n <input [(ngModel)]=\"form.buildingInfo\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Delivery notes</label>\n <input [(ngModel)]=\"form.notes\" />\n </div>\n @if (formError) {\n <div class=\"x-acct-err\">{{ formError }}</div>\n }\n <button type=\"button\" class=\"x-acct-btn\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save address' }}\n </button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"cancel()\" style=\"margin-left: 8px\">\n Cancel\n </button>\n </div>\n </div>\n } @else {\n <button type=\"button\" class=\"x-acct-btn\" (click)=\"startAdd()\">Add an address</button>\n }\n\n @for (a of addresses; track a.id) {\n <div class=\"x-acct-card\">\n <div class=\"x-acct-row\" style=\"border-bottom: 0; padding-top: 0\">\n <strong>\n {{ a.label }}\n @if (a.isDefault) {\n <span class=\"x-acct-pill x-acct-pill-ok\" style=\"margin-left: 6px\">Default</span>\n }\n </strong>\n <span>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"startEdit(a)\">Edit</button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"remove(a)\" style=\"margin-left: 6px\">\n Delete\n </button>\n </span>\n </div>\n <p class=\"x-acct-sub\" style=\"margin: 0\">\n {{ a.street }}@if (a.landmark) {, near {{ a.landmark }}}<br />\n {{ a.lga ? a.lga + ', ' : '' }}{{ a.state }}\n </p>\n @if (!a.isDefault) {\n <button\n type=\"button\"\n class=\"x-acct-btn-ghost\"\n style=\"margin-top: 10px\"\n (click)=\"makeDefault(a)\"\n >\n Make default\n </button>\n }\n </div>\n } @empty {\n @if (!editing) {\n <div class=\"x-acct-empty\">No saved addresses yet.</div>\n }\n }\n}\n", dependencies: [{ kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
277
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: AccountAddressesComponent, isStandalone: false, selector: "x-account-addresses", usesInheritance: true, ngImport: i0, template: "<h2 class=\"x-acct-h2\">Addresses</h2>\n<p class=\"x-acct-sub\">Used for delivery and, later, installation visits.</p>\n\n@if (loading) {\n <div class=\"x-acct-empty\">Loading\u2026</div>\n} @else {\n @if (editing) {\n <div class=\"x-acct-card\">\n <strong>{{ form.id ? 'Edit address' : 'New address' }}</strong>\n <div style=\"margin-top: 14px\">\n <div class=\"x-acct-field\">\n <label>Label</label>\n <input [(ngModel)]=\"form.label\" placeholder=\"Home, Office, Site\u2026\" />\n </div>\n <div class=\"x-acct-field\">\n <label>State</label>\n <select aria-label=\"State\" data-testid=\"address-state\" [(ngModel)]=\"form.state\" (ngModelChange)=\"onFormStateChange()\">\n <option value=\"\">Select a state</option>\n @for (s of states; track s.value) {\n <option [value]=\"s.value\">{{ s.label }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>LGA / area</label>\n <select aria-label=\"LGA\" data-testid=\"address-lga\" [(ngModel)]=\"form.lga\" [disabled]=\"!form.state || lgasLoading\">\n <option value=\"\">{{ form.state ? 'Select an LGA' : 'Select a state first' }}</option>\n @for (l of lgas; track l.value) {\n <option [value]=\"l.value\">{{ l.label }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>Street</label>\n <input [(ngModel)]=\"form.street\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Nearest landmark</label>\n <input [(ngModel)]=\"form.landmark\" placeholder=\"e.g. opposite Zenith Bank\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Building / flat info</label>\n <input [(ngModel)]=\"form.buildingInfo\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Delivery notes</label>\n <input [(ngModel)]=\"form.notes\" />\n </div>\n @if (formError) {\n <div class=\"x-acct-err\">{{ formError }}</div>\n }\n <button type=\"button\" class=\"x-acct-btn\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save address' }}\n </button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"cancel()\" style=\"margin-left: 8px\">\n Cancel\n </button>\n </div>\n </div>\n } @else {\n <button type=\"button\" class=\"x-acct-btn\" (click)=\"startAdd()\">Add an address</button>\n }\n\n @for (a of addresses; track a.id) {\n <div class=\"x-acct-card\">\n <div class=\"x-acct-row\" style=\"border-bottom: 0; padding-top: 0\">\n <strong>\n {{ a.label }}\n @if (a.isDefault) {\n <span class=\"x-acct-pill x-acct-pill-ok\" style=\"margin-left: 6px\">Default</span>\n }\n </strong>\n <span>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"startEdit(a)\">Edit</button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"remove(a)\" style=\"margin-left: 6px\">\n Delete\n </button>\n </span>\n </div>\n <p class=\"x-acct-sub\" style=\"margin: 0\">\n {{ a.street }}@if (a.landmark) {, near {{ a.landmark }}}<br />\n {{ a.lga ? a.lga + ', ' : '' }}{{ a.state }}\n </p>\n @if (!a.isDefault) {\n <button\n type=\"button\"\n class=\"x-acct-btn-ghost\"\n style=\"margin-top: 10px\"\n (click)=\"makeDefault(a)\"\n >\n Make default\n </button>\n }\n </div>\n } @empty {\n @if (!editing) {\n <div class=\"x-acct-empty\">No saved addresses yet.</div>\n }\n }\n}\n", dependencies: [{ kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
256
278
  }
257
279
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: AccountAddressesComponent, decorators: [{
258
280
  type: Component,
259
- args: [{ standalone: false, selector: 'x-account-addresses', template: "<h2 class=\"x-acct-h2\">Addresses</h2>\n<p class=\"x-acct-sub\">Used for delivery and, later, installation visits.</p>\n\n@if (loading) {\n <div class=\"x-acct-empty\">Loading\u2026</div>\n} @else {\n @if (editing) {\n <div class=\"x-acct-card\">\n <strong>{{ form.id ? 'Edit address' : 'New address' }}</strong>\n <div style=\"margin-top: 14px\">\n <div class=\"x-acct-field\">\n <label>Label</label>\n <input [(ngModel)]=\"form.label\" placeholder=\"Home, Office, Site\u2026\" />\n </div>\n <div class=\"x-acct-field\">\n <label>State</label>\n <select aria-label=\"State\" [(ngModel)]=\"form.state\">\n <option value=\"\">Select a state</option>\n @for (s of states; track s) {\n <option [value]=\"s\">{{ s }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>LGA / area</label>\n <input [(ngModel)]=\"form.lga\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Street</label>\n <input [(ngModel)]=\"form.street\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Nearest landmark</label>\n <input [(ngModel)]=\"form.landmark\" placeholder=\"e.g. opposite Zenith Bank\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Building / flat info</label>\n <input [(ngModel)]=\"form.buildingInfo\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Delivery notes</label>\n <input [(ngModel)]=\"form.notes\" />\n </div>\n @if (formError) {\n <div class=\"x-acct-err\">{{ formError }}</div>\n }\n <button type=\"button\" class=\"x-acct-btn\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save address' }}\n </button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"cancel()\" style=\"margin-left: 8px\">\n Cancel\n </button>\n </div>\n </div>\n } @else {\n <button type=\"button\" class=\"x-acct-btn\" (click)=\"startAdd()\">Add an address</button>\n }\n\n @for (a of addresses; track a.id) {\n <div class=\"x-acct-card\">\n <div class=\"x-acct-row\" style=\"border-bottom: 0; padding-top: 0\">\n <strong>\n {{ a.label }}\n @if (a.isDefault) {\n <span class=\"x-acct-pill x-acct-pill-ok\" style=\"margin-left: 6px\">Default</span>\n }\n </strong>\n <span>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"startEdit(a)\">Edit</button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"remove(a)\" style=\"margin-left: 6px\">\n Delete\n </button>\n </span>\n </div>\n <p class=\"x-acct-sub\" style=\"margin: 0\">\n {{ a.street }}@if (a.landmark) {, near {{ a.landmark }}}<br />\n {{ a.lga ? a.lga + ', ' : '' }}{{ a.state }}\n </p>\n @if (!a.isDefault) {\n <button\n type=\"button\"\n class=\"x-acct-btn-ghost\"\n style=\"margin-top: 10px\"\n (click)=\"makeDefault(a)\"\n >\n Make default\n </button>\n }\n </div>\n } @empty {\n @if (!editing) {\n <div class=\"x-acct-empty\">No saved addresses yet.</div>\n }\n }\n}\n" }]
281
+ args: [{ standalone: false, selector: 'x-account-addresses', template: "<h2 class=\"x-acct-h2\">Addresses</h2>\n<p class=\"x-acct-sub\">Used for delivery and, later, installation visits.</p>\n\n@if (loading) {\n <div class=\"x-acct-empty\">Loading\u2026</div>\n} @else {\n @if (editing) {\n <div class=\"x-acct-card\">\n <strong>{{ form.id ? 'Edit address' : 'New address' }}</strong>\n <div style=\"margin-top: 14px\">\n <div class=\"x-acct-field\">\n <label>Label</label>\n <input [(ngModel)]=\"form.label\" placeholder=\"Home, Office, Site\u2026\" />\n </div>\n <div class=\"x-acct-field\">\n <label>State</label>\n <select aria-label=\"State\" data-testid=\"address-state\" [(ngModel)]=\"form.state\" (ngModelChange)=\"onFormStateChange()\">\n <option value=\"\">Select a state</option>\n @for (s of states; track s.value) {\n <option [value]=\"s.value\">{{ s.label }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>LGA / area</label>\n <select aria-label=\"LGA\" data-testid=\"address-lga\" [(ngModel)]=\"form.lga\" [disabled]=\"!form.state || lgasLoading\">\n <option value=\"\">{{ form.state ? 'Select an LGA' : 'Select a state first' }}</option>\n @for (l of lgas; track l.value) {\n <option [value]=\"l.value\">{{ l.label }}</option>\n }\n </select>\n </div>\n <div class=\"x-acct-field\">\n <label>Street</label>\n <input [(ngModel)]=\"form.street\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Nearest landmark</label>\n <input [(ngModel)]=\"form.landmark\" placeholder=\"e.g. opposite Zenith Bank\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Building / flat info</label>\n <input [(ngModel)]=\"form.buildingInfo\" />\n </div>\n <div class=\"x-acct-field\">\n <label>Delivery notes</label>\n <input [(ngModel)]=\"form.notes\" />\n </div>\n @if (formError) {\n <div class=\"x-acct-err\">{{ formError }}</div>\n }\n <button type=\"button\" class=\"x-acct-btn\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save address' }}\n </button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"cancel()\" style=\"margin-left: 8px\">\n Cancel\n </button>\n </div>\n </div>\n } @else {\n <button type=\"button\" class=\"x-acct-btn\" (click)=\"startAdd()\">Add an address</button>\n }\n\n @for (a of addresses; track a.id) {\n <div class=\"x-acct-card\">\n <div class=\"x-acct-row\" style=\"border-bottom: 0; padding-top: 0\">\n <strong>\n {{ a.label }}\n @if (a.isDefault) {\n <span class=\"x-acct-pill x-acct-pill-ok\" style=\"margin-left: 6px\">Default</span>\n }\n </strong>\n <span>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"startEdit(a)\">Edit</button>\n <button type=\"button\" class=\"x-acct-btn-ghost\" (click)=\"remove(a)\" style=\"margin-left: 6px\">\n Delete\n </button>\n </span>\n </div>\n <p class=\"x-acct-sub\" style=\"margin: 0\">\n {{ a.street }}@if (a.landmark) {, near {{ a.landmark }}}<br />\n {{ a.lga ? a.lga + ', ' : '' }}{{ a.state }}\n </p>\n @if (!a.isDefault) {\n <button\n type=\"button\"\n class=\"x-acct-btn-ghost\"\n style=\"margin-top: 10px\"\n (click)=\"makeDefault(a)\"\n >\n Make default\n </button>\n }\n </div>\n } @empty {\n @if (!editing) {\n <div class=\"x-acct-empty\">No saved addresses yet.</div>\n }\n }\n}\n" }]
260
282
  }] });
261
283
 
262
284
  // PRD Appendix B — the 17 order states, buyer-friendly labels. Shared by
@@ -1750,4 +1772,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
1750
1772
  }] });
1751
1773
 
1752
1774
  export { AccountModule };
1753
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-account.module-DkScEdS0.mjs.map
1775
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-account.module-BTRypX8P.mjs.map