@ikas/storefront 2.0.50 → 2.0.51-alpha.2

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.
@@ -197,7 +197,8 @@ export declare enum OrderPackageFulfillStatusEnum {
197
197
  REFUNDED = "REFUNDED",
198
198
  REFUND_REJECTED = "REFUND_REJECTED",
199
199
  REFUND_REQUESTED = "REFUND_REQUESTED",
200
- REFUND_REQUEST_ACCEPTED = "REFUND_REQUEST_ACCEPTED"
200
+ REFUND_REQUEST_ACCEPTED = "REFUND_REQUEST_ACCEPTED",
201
+ UNABLE_TO_DELIVER = "UNABLE_TO_DELIVER"
201
202
  }
202
203
  /**
203
204
  * Order Package Status Enum
@@ -275,6 +276,7 @@ export declare enum ProductAttributeTypeEnum {
275
276
  CHOICE = "CHOICE",
276
277
  DATETIME = "DATETIME",
277
278
  HTML = "HTML",
279
+ IMAGE = "IMAGE",
278
280
  MULTIPLE_CHOICE = "MULTIPLE_CHOICE",
279
281
  NUMERIC = "NUMERIC",
280
282
  PRODUCT = "PRODUCT",
@@ -427,6 +429,8 @@ export interface AppliedProductInput {
427
429
  export interface BlogMetadataTargetTypeEnumFilter {
428
430
  eq?: BlogMetadataTargetTypeEnum | null;
429
431
  in?: BlogMetadataTargetTypeEnum[] | null;
432
+ ne?: BlogMetadataTargetTypeEnum | null;
433
+ nin?: BlogMetadataTargetTypeEnum | null;
430
434
  }
431
435
  export interface CartCampaignOfferInput {
432
436
  accepted: boolean;
@@ -463,7 +467,9 @@ export interface CreateCustomerEmailSubscriptionInput {
463
467
  createdAt?: any | null;
464
468
  deleted?: boolean | null;
465
469
  email: string;
470
+ firstName?: string | null;
466
471
  id?: string | null;
472
+ lastName?: string | null;
467
473
  updatedAt?: any | null;
468
474
  }
469
475
  export interface CreateCustomerReviewInput {
@@ -519,6 +525,8 @@ export interface DateFilterInput {
519
525
  in?: any[] | null;
520
526
  lt?: any | null;
521
527
  lte?: any | null;
528
+ ne?: any | null;
529
+ nin?: any | null;
522
530
  }
523
531
  export interface GetOrderLineFile {
524
532
  url: string;
@@ -531,6 +539,8 @@ export interface GetProductCampaignsInput {
531
539
  export interface HTMLMetaDataTargetTypeEnumFilter {
532
540
  eq?: HTMLMetaDataTargetTypeEnum | null;
533
541
  in?: HTMLMetaDataTargetTypeEnum[] | null;
542
+ ne?: HTMLMetaDataTargetTypeEnum | null;
543
+ nin?: HTMLMetaDataTargetTypeEnum | null;
534
544
  }
535
545
  export interface ListCustomerReviewInput {
536
546
  salesChannelId: string;
@@ -630,6 +640,8 @@ export interface ProductLastViewedInput {
630
640
  export interface RaffleMetadataTargetTypeEnumFilter {
631
641
  eq?: RaffleMetadataTargetTypeEnum | null;
632
642
  in?: RaffleMetadataTargetTypeEnum[] | null;
643
+ ne?: RaffleMetadataTargetTypeEnum | null;
644
+ nin?: RaffleMetadataTargetTypeEnum | null;
633
645
  }
634
646
  export interface RaffleParticipantsInput {
635
647
  appliedProduct: AppliedProductInput;
@@ -650,7 +662,6 @@ export interface RetrieveInstallmentInfoInput {
650
662
  price: number;
651
663
  }
652
664
  export interface SaveCheckoutInput {
653
- adjustments?: OrderAdjustmentInput[] | null;
654
665
  billingAddress?: OrderAddressInput | null;
655
666
  cartId: string;
656
667
  couponCode?: string | null;
@@ -661,6 +672,7 @@ export interface SaveCheckoutInput {
661
672
  id?: string | null;
662
673
  isGiftPackage?: boolean | null;
663
674
  note?: string | null;
675
+ orderAdjustments?: OrderAdjustmentInput[] | null;
664
676
  shippingAddress?: OrderAddressInput | null;
665
677
  shippingMethod: ShippingMethodEnum;
666
678
  shippingSettingsId?: string | null;
@@ -708,6 +720,7 @@ export interface SaveMyCustomerInput {
708
720
  firstName: string;
709
721
  lastName: string;
710
722
  phone?: string | null;
723
+ subscriptionStatus?: CustomerEmailSubscriptionStatusesEnum | null;
711
724
  }
712
725
  export interface SearchDynamicCurrencySettings {
713
726
  roundingFormat?: string | null;
@@ -754,4 +767,6 @@ export interface StringFilterInput {
754
767
  eq?: string | null;
755
768
  in?: string[] | null;
756
769
  like?: string | null;
770
+ ne?: string | null;
771
+ nin?: string[] | null;
757
772
  }
@@ -1 +1 @@
1
- var E,T,R,A,D,C,I,N,_,L,O,U,S,P,F,n,M,Y,H,B,V,o,t,c,f,i,u,G,W,K,X,Q,J,Z,r,a,e,p,v,x,b,d,g,h,j,k,l,m;!function(E){E.DECREMENT="DECREMENT",E.INCREMENT="INCREMENT"}(E||(E={})),function(E){E.AMOUNT="AMOUNT",E.RATIO="RATIO"}(T||(T={})),function(E){E.BLOG="BLOG",E.BLOG_CATEGORY="BLOG_CATEGORY"}(R||(R={})),function(E){E.DISCOUNT_PRICE="DISCOUNT_PRICE",E.SELL_PRICE="SELL_PRICE"}(A||(A={})),function(E){E.ABANDONED_CHECKOUT="ABANDONED_CHECKOUT",E.CART="CART",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW"}(D||(D={})),function(E){E.CATEGORY="CATEGORY",E.PRODUCT="PRODUCT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG",E.VARIANT="VARIANT"}(C||(C={})),function(E){E.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(I||(I={})),function(E){E.CUSTOMER="CUSTOMER",E.DECLINED="DECLINED",E.INVENTORY="INVENTORY",E.OTHER="OTHER"}(N||(N={})),function(E){E.ACTIVE="ACTIVE",E.FREEZE="FREEZE",E.PASSIVE="PASSIVE"}(_||(_={})),function(E){E.BEST_SELLER="BEST_SELLER",E.HIGHEST_DISCOUNT_RATIO="HIGHEST_DISCOUNT_RATIO",E.HIGHEST_PRICE="HIGHEST_PRICE",E.LOWEST_DISCOUNT_RATIO="LOWEST_DISCOUNT_RATIO",E.LOWEST_PRICE="LOWEST_PRICE",E.MANUALLY="MANUALLY",E.NEWEST="NEWEST",E.OLDEST="OLDEST"}(L||(L={})),function(E){E.NOT_SENT="NOT_SENT",E.SENT="SENT"}(O||(O={})),function(E){E.NOT_RECOVERED="NOT_RECOVERED",E.RECOVERED="RECOVERED"}(U||(U={})),function(E){E.INVISIBLE="INVISIBLE",E.MANDATORY="MANDATORY",E.OPTIONAL="OPTIONAL"}(S||(S={})),function(E){E.COMPLETED="COMPLETED",E.FREEZE="FREEZE",E.KILLED="KILLED",E.OPEN="OPEN"}(P||(P={})),function(E){E.ACTIVE_ACCOUNT="ACTIVE_ACCOUNT",E.DECLINED_ACCOUNT_INVITATION="DECLINED_ACCOUNT_INVITATION",E.DISABLED_ACCOUNT="DISABLED_ACCOUNT",E.INVITED_TO_CREATE_ACCOUNT="INVITED_TO_CREATE_ACCOUNT"}(F||(F={})),function(E){E.INVISIBLE="INVISIBLE",E.READ="READ",E.WRITE="WRITE"}(n||(n={})),function(E){E.INVISIBLE="INVISIBLE",E.MANDATORY="MANDATORY",E.OPTIONAL="OPTIONAL"}(M||(M={})),function(E){E.BOOLEAN="BOOLEAN",E.CHOICE="CHOICE",E.DATETIME="DATETIME",E.MULTIPLE_CHOICE="MULTIPLE_CHOICE",E.NUMERIC="NUMERIC",E.TEXT="TEXT"}(Y||(Y={})),function(E){E.NOT_SUBSCRIBED="NOT_SUBSCRIBED",E.PENDING_CONFIRMATION="PENDING_CONFIRMATION",E.SUBSCRIBED="SUBSCRIBED"}(H||(H={})),function(E){E.BRAND="BRAND",E.CATEGORY="CATEGORY",E.PAGE="PAGE",E.PRODUCT="PRODUCT"}(B||(B={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.FULFILLED="FULFILLED",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED",E.UNFULFILLED="UNFULFILLED"}(V||(V={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.ERROR="ERROR",E.FULFILLED="FULFILLED",E.READY_FOR_PICK_UP="READY_FOR_PICK_UP",E.READY_FOR_SHIPMENT="READY_FOR_SHIPMENT",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED"}(o||(o={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.FULFILLED="FULFILLED",E.PARTIALLY_CANCELLED="PARTIALLY_CANCELLED",E.PARTIALLY_DELIVERED="PARTIALLY_DELIVERED",E.PARTIALLY_FULFILLED="PARTIALLY_FULFILLED",E.PARTIALLY_REFUNDED="PARTIALLY_REFUNDED",E.READY_FOR_PICK_UP="READY_FOR_PICK_UP",E.READY_FOR_SHIPMENT="READY_FOR_SHIPMENT",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED",E.UNABLE_TO_DELIVER="UNABLE_TO_DELIVER",E.UNFULFILLED="UNFULFILLED"}(t||(t={})),function(E){E.PAID="PAID",E.PARTIALLY_PAID="PARTIALLY_PAID",E.WAITING="WAITING"}(c||(c={})),function(E){E.CANCELLED="CANCELLED",E.CREATED="CREATED",E.DRAFT="DRAFT",E.PARTIALLY_CANCELLED="PARTIALLY_CANCELLED",E.PARTIALLY_REFUNDED="PARTIALLY_REFUNDED",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED"}(f||(f={})),function(E){E.DECREMENT="DECREMENT",E.INCREMENT="INCREMENT"}(i||(i={})),function(E){E.AMOUNT="AMOUNT",E.RATIO="RATIO"}(u||(u={})),function(E){E.EXTERNAL="EXTERNAL",E.INTERNAL="INTERNAL",E.THIRD_PARTY="THIRD_PARTY"}(G||(G={})),function(E){E.APP_PAYMENT="APP_PAYMENT",E.BUY_ONLINE_PAY_AT_STORE="BUY_ONLINE_PAY_AT_STORE",E.CASH="CASH",E.CASH_ON_DELIVERY="CASH_ON_DELIVERY",E.CREDIT_CARD="CREDIT_CARD",E.CREDIT_CARD_ON_DELIVERY="CREDIT_CARD_ON_DELIVERY",E.GIFT_CARD="GIFT_CARD",E.MONEY_ORDER="MONEY_ORDER",E.OTHER="OTHER",E.WALLET="WALLET"}(W||(W={})),function(E){E.BOOLEAN="BOOLEAN",E.CHOICE="CHOICE",E.DATETIME="DATETIME",E.HTML="HTML",E.MULTIPLE_CHOICE="MULTIPLE_CHOICE",E.NUMERIC="NUMERIC",E.PRODUCT="PRODUCT",E.TABLE="TABLE",E.TEXT="TEXT"}(K||(K={})),function(E){E.BOX="BOX",E.DATE_RANGE="DATE_RANGE",E.LIST="LIST",E.NUMBER_RANGE="NUMBER_RANGE",E.NUMBER_RANGE_LIST="NUMBER_RANGE_LIST",E.SWATCH="SWATCH"}(X||(X={})),function(E){E.ALPHABETICAL_ASC="ALPHABETICAL_ASC",E.ALPHABETICAL_DESC="ALPHABETICAL_DESC",E.CUSTOM_SORT="CUSTOM_SORT",E.PRODUCT_COUNT_ASC="PRODUCT_COUNT_ASC",E.PRODUCT_COUNT_DESC="PRODUCT_COUNT_DESC"}(Q||(Q={})),function(E){E.ATTRIBUTE="ATTRIBUTE",E.AVAILABLE_VARIANT_VALUE="AVAILABLE_VARIANT_VALUE",E.BRAND="BRAND",E.DISCOUNT_RATIO="DISCOUNT_RATIO",E.PRICE="PRICE",E.STOCK_STATUS="STOCK_STATUS",E.TAG="TAG",E.VARIANT_TYPE="VARIANT_TYPE"}(J||(J={})),function(E){E.BOX="BOX",E.SELECT="SELECT",E.SWATCH="SWATCH"}(Z||(Z={})),function(E){E.CHECKBOX="CHECKBOX",E.CHOICE="CHOICE",E.COLOR_PICKER="COLOR_PICKER",E.DATE_PICKER="DATE_PICKER",E.FILE="FILE",E.IMAGE="IMAGE",E.TEXT="TEXT",E.TEXT_AREA="TEXT_AREA"}(r||(r={})),function(E){E.HIDE_OUT_OF_STOCK="HIDE_OUT_OF_STOCK",E.SHOW_ALL="SHOW_ALL",E.SHOW_OUT_OF_STOCK_AT_END="SHOW_OUT_OF_STOCK_AT_END"}(a||(a={})),function(E){E.RAFFLE="RAFFLE"}(e||(e={})),function(E){E.CLICK_AND_COLLECT="CLICK_AND_COLLECT",E.NO_SHIPMENT="NO_SHIPMENT",E.SHIPMENT="SHIPMENT"}(p||(p={})),function(E){E.ASC="ASC",E.DESC="DESC"}(v||(v={})),function(E){E.CREATED_AT="CREATED_AT",E.DISCOUNT_RATIO="DISCOUNT_RATIO",E.MANUAL_SORT="MANUAL_SORT",E.NAME="NAME",E.PRICE="PRICE"}(x||(x={})),function(E){E.FAILED="FAILED",E.NOT_DEPLOYED="NOT_DEPLOYED",E.READY="READY",E.WAITING="WAITING"}(b||(b={})),function(E){E.FAILED="FAILED",E.NOT_DEPLOYED="NOT_DEPLOYED",E.READY="READY",E.WAITING="WAITING"}(d||(d={})),function(E){E.AMERICAN_EXPRESS="AMERICAN_EXPRESS",E.MASTER_CARD="MASTER_CARD",E.TROY="TROY",E.VISA="VISA"}(g||(g={})),function(E){E.CREDIT="CREDIT",E.DEBIT="DEBIT",E.PREPAID="PREPAID"}(h||(h={})),function(E){E.AUTHORIZED="AUTHORIZED",E.FAILED="FAILED",E.PENDING="PENDING",E.SUCCESS="SUCCESS"}(j||(j={})),function(E){E.REFUND="REFUND",E.SALE="SALE",E.VOID="VOID"}(k||(k={})),function(E){E.CHOICE="CHOICE",E.COLOR="COLOR"}(l||(l={})),function(E){E.EMAIL="EMAIL",E.MERSIS="MERSIS"}(m||(m={}));export{E as AdjustmentEnum,T as AmountTypeEnum,R as BlogMetadataTargetTypeEnum,A as CampaignApplicablePriceEnum,D as CampaignCreatedForEnum,C as CampaignFilterTypeEnum,I as CampaignTypeEnum,N as CancelledReasonEnum,_ as CartStatusEnum,L as CategoryProductsOrderTypeEnum,O as CheckoutRecoveryEmailStatusEnum,U as CheckoutRecoveryStatusEnum,S as CheckoutRequirementEnum,P as CheckoutStatusEnum,F as CustomerAccountStatusEnum,n as CustomerAttributePermissionEnum,M as CustomerAttributeRegisterPageRequirementEnum,Y as CustomerAttributeTypeEnum,H as CustomerEmailSubscriptionStatusesEnum,B as HTMLMetaDataTargetTypeEnum,V as OrderLineItemStatusEnum,o as OrderPackageFulfillStatusEnum,t as OrderPackageStatusEnum,c as OrderPaymentStatusEnum,f as OrderStatusEnum,i as PaymentGatewayAdditionalPriceTypeEnum,u as PaymentGatewayTransactionFeeTypeEnum,G as PaymentGatewayTypeEnum,W as PaymentMethodEnum,K as ProductAttributeTypeEnum,X as ProductFilterDisplayTypeEnum,Q as ProductFilterSortTypeEnum,J as ProductFilterTypeEnum,Z as ProductOptionSelectTypeEnum,r as ProductOptionTypeEnum,a as ProductSearchShowStockOptionEnum,e as RaffleMetadataTargetTypeEnum,p as ShippingMethodEnum,v as SortByDirectionEnum,x as SortByTypeEnum,b as StorefrontStatusTypes,d as StorefrontThemeStatus,g as TransactionCardAssociationEnum,h as TransactionCardTypeEnum,j as TransactionStatusEnum,k as TransactionTypeEnum,l as VariantSelectionTypeEnum,m as VerificationTypeEnum};
1
+ var E,T,R,A,D,C,I,_,N,L,O,U,S,P,F,n,M,Y,B,H,V,o,t,c,f,i,u,G,W,K,X,Q,J,Z,r,a,e,p,v,x,b,d,g,h,j,k,l,m;!function(E){E.DECREMENT="DECREMENT",E.INCREMENT="INCREMENT"}(E||(E={})),function(E){E.AMOUNT="AMOUNT",E.RATIO="RATIO"}(T||(T={})),function(E){E.BLOG="BLOG",E.BLOG_CATEGORY="BLOG_CATEGORY"}(R||(R={})),function(E){E.DISCOUNT_PRICE="DISCOUNT_PRICE",E.SELL_PRICE="SELL_PRICE"}(A||(A={})),function(E){E.ABANDONED_CHECKOUT="ABANDONED_CHECKOUT",E.CART="CART",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW"}(D||(D={})),function(E){E.CATEGORY="CATEGORY",E.PRODUCT="PRODUCT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG",E.VARIANT="VARIANT"}(C||(C={})),function(E){E.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(I||(I={})),function(E){E.CUSTOMER="CUSTOMER",E.DECLINED="DECLINED",E.INVENTORY="INVENTORY",E.OTHER="OTHER"}(_||(_={})),function(E){E.ACTIVE="ACTIVE",E.FREEZE="FREEZE",E.PASSIVE="PASSIVE"}(N||(N={})),function(E){E.BEST_SELLER="BEST_SELLER",E.HIGHEST_DISCOUNT_RATIO="HIGHEST_DISCOUNT_RATIO",E.HIGHEST_PRICE="HIGHEST_PRICE",E.LOWEST_DISCOUNT_RATIO="LOWEST_DISCOUNT_RATIO",E.LOWEST_PRICE="LOWEST_PRICE",E.MANUALLY="MANUALLY",E.NEWEST="NEWEST",E.OLDEST="OLDEST"}(L||(L={})),function(E){E.NOT_SENT="NOT_SENT",E.SENT="SENT"}(O||(O={})),function(E){E.NOT_RECOVERED="NOT_RECOVERED",E.RECOVERED="RECOVERED"}(U||(U={})),function(E){E.INVISIBLE="INVISIBLE",E.MANDATORY="MANDATORY",E.OPTIONAL="OPTIONAL"}(S||(S={})),function(E){E.COMPLETED="COMPLETED",E.FREEZE="FREEZE",E.KILLED="KILLED",E.OPEN="OPEN"}(P||(P={})),function(E){E.ACTIVE_ACCOUNT="ACTIVE_ACCOUNT",E.DECLINED_ACCOUNT_INVITATION="DECLINED_ACCOUNT_INVITATION",E.DISABLED_ACCOUNT="DISABLED_ACCOUNT",E.INVITED_TO_CREATE_ACCOUNT="INVITED_TO_CREATE_ACCOUNT"}(F||(F={})),function(E){E.INVISIBLE="INVISIBLE",E.READ="READ",E.WRITE="WRITE"}(n||(n={})),function(E){E.INVISIBLE="INVISIBLE",E.MANDATORY="MANDATORY",E.OPTIONAL="OPTIONAL"}(M||(M={})),function(E){E.BOOLEAN="BOOLEAN",E.CHOICE="CHOICE",E.DATETIME="DATETIME",E.MULTIPLE_CHOICE="MULTIPLE_CHOICE",E.NUMERIC="NUMERIC",E.TEXT="TEXT"}(Y||(Y={})),function(E){E.NOT_SUBSCRIBED="NOT_SUBSCRIBED",E.PENDING_CONFIRMATION="PENDING_CONFIRMATION",E.SUBSCRIBED="SUBSCRIBED"}(B||(B={})),function(E){E.BRAND="BRAND",E.CATEGORY="CATEGORY",E.PAGE="PAGE",E.PRODUCT="PRODUCT"}(H||(H={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.FULFILLED="FULFILLED",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED",E.UNFULFILLED="UNFULFILLED"}(V||(V={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.ERROR="ERROR",E.FULFILLED="FULFILLED",E.READY_FOR_PICK_UP="READY_FOR_PICK_UP",E.READY_FOR_SHIPMENT="READY_FOR_SHIPMENT",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED",E.UNABLE_TO_DELIVER="UNABLE_TO_DELIVER"}(o||(o={})),function(E){E.CANCELLED="CANCELLED",E.CANCEL_REJECTED="CANCEL_REJECTED",E.CANCEL_REQUESTED="CANCEL_REQUESTED",E.DELIVERED="DELIVERED",E.FULFILLED="FULFILLED",E.PARTIALLY_CANCELLED="PARTIALLY_CANCELLED",E.PARTIALLY_DELIVERED="PARTIALLY_DELIVERED",E.PARTIALLY_FULFILLED="PARTIALLY_FULFILLED",E.PARTIALLY_REFUNDED="PARTIALLY_REFUNDED",E.READY_FOR_PICK_UP="READY_FOR_PICK_UP",E.READY_FOR_SHIPMENT="READY_FOR_SHIPMENT",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED",E.REFUND_REQUEST_ACCEPTED="REFUND_REQUEST_ACCEPTED",E.UNABLE_TO_DELIVER="UNABLE_TO_DELIVER",E.UNFULFILLED="UNFULFILLED"}(t||(t={})),function(E){E.PAID="PAID",E.PARTIALLY_PAID="PARTIALLY_PAID",E.WAITING="WAITING"}(c||(c={})),function(E){E.CANCELLED="CANCELLED",E.CREATED="CREATED",E.DRAFT="DRAFT",E.PARTIALLY_CANCELLED="PARTIALLY_CANCELLED",E.PARTIALLY_REFUNDED="PARTIALLY_REFUNDED",E.REFUNDED="REFUNDED",E.REFUND_REJECTED="REFUND_REJECTED",E.REFUND_REQUESTED="REFUND_REQUESTED"}(f||(f={})),function(E){E.DECREMENT="DECREMENT",E.INCREMENT="INCREMENT"}(i||(i={})),function(E){E.AMOUNT="AMOUNT",E.RATIO="RATIO"}(u||(u={})),function(E){E.EXTERNAL="EXTERNAL",E.INTERNAL="INTERNAL",E.THIRD_PARTY="THIRD_PARTY"}(G||(G={})),function(E){E.APP_PAYMENT="APP_PAYMENT",E.BUY_ONLINE_PAY_AT_STORE="BUY_ONLINE_PAY_AT_STORE",E.CASH="CASH",E.CASH_ON_DELIVERY="CASH_ON_DELIVERY",E.CREDIT_CARD="CREDIT_CARD",E.CREDIT_CARD_ON_DELIVERY="CREDIT_CARD_ON_DELIVERY",E.GIFT_CARD="GIFT_CARD",E.MONEY_ORDER="MONEY_ORDER",E.OTHER="OTHER",E.WALLET="WALLET"}(W||(W={})),function(E){E.BOOLEAN="BOOLEAN",E.CHOICE="CHOICE",E.DATETIME="DATETIME",E.HTML="HTML",E.IMAGE="IMAGE",E.MULTIPLE_CHOICE="MULTIPLE_CHOICE",E.NUMERIC="NUMERIC",E.PRODUCT="PRODUCT",E.TABLE="TABLE",E.TEXT="TEXT"}(K||(K={})),function(E){E.BOX="BOX",E.DATE_RANGE="DATE_RANGE",E.LIST="LIST",E.NUMBER_RANGE="NUMBER_RANGE",E.NUMBER_RANGE_LIST="NUMBER_RANGE_LIST",E.SWATCH="SWATCH"}(X||(X={})),function(E){E.ALPHABETICAL_ASC="ALPHABETICAL_ASC",E.ALPHABETICAL_DESC="ALPHABETICAL_DESC",E.CUSTOM_SORT="CUSTOM_SORT",E.PRODUCT_COUNT_ASC="PRODUCT_COUNT_ASC",E.PRODUCT_COUNT_DESC="PRODUCT_COUNT_DESC"}(Q||(Q={})),function(E){E.ATTRIBUTE="ATTRIBUTE",E.AVAILABLE_VARIANT_VALUE="AVAILABLE_VARIANT_VALUE",E.BRAND="BRAND",E.DISCOUNT_RATIO="DISCOUNT_RATIO",E.PRICE="PRICE",E.STOCK_STATUS="STOCK_STATUS",E.TAG="TAG",E.VARIANT_TYPE="VARIANT_TYPE"}(J||(J={})),function(E){E.BOX="BOX",E.SELECT="SELECT",E.SWATCH="SWATCH"}(Z||(Z={})),function(E){E.CHECKBOX="CHECKBOX",E.CHOICE="CHOICE",E.COLOR_PICKER="COLOR_PICKER",E.DATE_PICKER="DATE_PICKER",E.FILE="FILE",E.IMAGE="IMAGE",E.TEXT="TEXT",E.TEXT_AREA="TEXT_AREA"}(r||(r={})),function(E){E.HIDE_OUT_OF_STOCK="HIDE_OUT_OF_STOCK",E.SHOW_ALL="SHOW_ALL",E.SHOW_OUT_OF_STOCK_AT_END="SHOW_OUT_OF_STOCK_AT_END"}(a||(a={})),function(E){E.RAFFLE="RAFFLE"}(e||(e={})),function(E){E.CLICK_AND_COLLECT="CLICK_AND_COLLECT",E.NO_SHIPMENT="NO_SHIPMENT",E.SHIPMENT="SHIPMENT"}(p||(p={})),function(E){E.ASC="ASC",E.DESC="DESC"}(v||(v={})),function(E){E.CREATED_AT="CREATED_AT",E.DISCOUNT_RATIO="DISCOUNT_RATIO",E.MANUAL_SORT="MANUAL_SORT",E.NAME="NAME",E.PRICE="PRICE"}(x||(x={})),function(E){E.FAILED="FAILED",E.NOT_DEPLOYED="NOT_DEPLOYED",E.READY="READY",E.WAITING="WAITING"}(b||(b={})),function(E){E.FAILED="FAILED",E.NOT_DEPLOYED="NOT_DEPLOYED",E.READY="READY",E.WAITING="WAITING"}(d||(d={})),function(E){E.AMERICAN_EXPRESS="AMERICAN_EXPRESS",E.MASTER_CARD="MASTER_CARD",E.TROY="TROY",E.VISA="VISA"}(g||(g={})),function(E){E.CREDIT="CREDIT",E.DEBIT="DEBIT",E.PREPAID="PREPAID"}(h||(h={})),function(E){E.AUTHORIZED="AUTHORIZED",E.FAILED="FAILED",E.PENDING="PENDING",E.SUCCESS="SUCCESS"}(j||(j={})),function(E){E.REFUND="REFUND",E.SALE="SALE",E.VOID="VOID"}(k||(k={})),function(E){E.CHOICE="CHOICE",E.COLOR="COLOR"}(l||(l={})),function(E){E.EMAIL="EMAIL",E.MERSIS="MERSIS"}(m||(m={}));export{E as AdjustmentEnum,T as AmountTypeEnum,R as BlogMetadataTargetTypeEnum,A as CampaignApplicablePriceEnum,D as CampaignCreatedForEnum,C as CampaignFilterTypeEnum,I as CampaignTypeEnum,_ as CancelledReasonEnum,N as CartStatusEnum,L as CategoryProductsOrderTypeEnum,O as CheckoutRecoveryEmailStatusEnum,U as CheckoutRecoveryStatusEnum,S as CheckoutRequirementEnum,P as CheckoutStatusEnum,F as CustomerAccountStatusEnum,n as CustomerAttributePermissionEnum,M as CustomerAttributeRegisterPageRequirementEnum,Y as CustomerAttributeTypeEnum,B as CustomerEmailSubscriptionStatusesEnum,H as HTMLMetaDataTargetTypeEnum,V as OrderLineItemStatusEnum,o as OrderPackageFulfillStatusEnum,t as OrderPackageStatusEnum,c as OrderPaymentStatusEnum,f as OrderStatusEnum,i as PaymentGatewayAdditionalPriceTypeEnum,u as PaymentGatewayTransactionFeeTypeEnum,G as PaymentGatewayTypeEnum,W as PaymentMethodEnum,K as ProductAttributeTypeEnum,X as ProductFilterDisplayTypeEnum,Q as ProductFilterSortTypeEnum,J as ProductFilterTypeEnum,Z as ProductOptionSelectTypeEnum,r as ProductOptionTypeEnum,a as ProductSearchShowStockOptionEnum,e as RaffleMetadataTargetTypeEnum,p as ShippingMethodEnum,v as SortByDirectionEnum,x as SortByTypeEnum,b as StorefrontStatusTypes,d as StorefrontThemeStatus,g as TransactionCardAssociationEnum,h as TransactionCardTypeEnum,j as TransactionStatusEnum,k as TransactionTypeEnum,l as VariantSelectionTypeEnum,m as VerificationTypeEnum};
@@ -511,7 +511,7 @@ export interface getOrder_getOrder_taxLines {
511
511
  price: number;
512
512
  }
513
513
  export interface getOrder_getOrder {
514
- __typename: "Order";
514
+ __typename: "StorefrontOrder";
515
515
  /**
516
516
  * It is the billing address of the order.
517
517
  */
@@ -481,7 +481,7 @@ export interface createOrderRefundRequest_createOrderRefundRequest_taxLines {
481
481
  price: number;
482
482
  }
483
483
  export interface createOrderRefundRequest_createOrderRefundRequest {
484
- __typename: "Order";
484
+ __typename: "StorefrontOrder";
485
485
  /**
486
486
  * It is the billing address of the order.
487
487
  */
@@ -511,7 +511,7 @@ export interface getCustomerOrders_getCustomerOrders_taxLines {
511
511
  price: number;
512
512
  }
513
513
  export interface getCustomerOrders_getCustomerOrders {
514
- __typename: "Order";
514
+ __typename: "StorefrontOrder";
515
515
  /**
516
516
  * It is the billing address of the order.
517
517
  */
@@ -511,7 +511,7 @@ export interface getOrderByEmail_getOrderByEmail_taxLines {
511
511
  price: number;
512
512
  }
513
513
  export interface getOrderByEmail_getOrderByEmail {
514
- __typename: "Order";
514
+ __typename: "StorefrontOrder";
515
515
  /**
516
516
  * It is the billing address of the order.
517
517
  */
@@ -1,4 +1,4 @@
1
- import { SaveMyCustomerInput, CustomerAccountStatusEnum } from "./../../../__generated__/global-types";
1
+ import { SaveMyCustomerInput, CustomerEmailSubscriptionStatusesEnum, CustomerAccountStatusEnum } from "./../../../__generated__/global-types";
2
2
  export interface saveMyCustomer_saveMyCustomer_addresses_city {
3
3
  __typename: "CustomerAddressCity";
4
4
  /**
@@ -140,6 +140,10 @@ export interface saveMyCustomer_saveMyCustomer {
140
140
  * The customer's phone number
141
141
  */
142
142
  phone: string | null;
143
+ /**
144
+ * CustomerEmailSubscriptionStatusesEnum
145
+ */
146
+ subscriptionStatus: CustomerEmailSubscriptionStatusesEnum | null;
143
147
  /**
144
148
  * CustomerAccountStatusEnum
145
149
  */
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,N,v,k,L,A,x,S,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),(o=s.errors)&&o.length?(console.log(o),[2,!1]):[3,4];case 3:return d=e.sent(),console.log(d),[3,4];case 4:return[2,!0]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
1
+ import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,N,v,k,L,A,x,S,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),(o=s.errors)&&o.length?(console.log(o),[2,!1]):[3,4];case 3:return d=e.sent(),console.log(d),[3,4];case 4:return[2,!0]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,subscriptionStatus:t.subscriptionStatus,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as j}from"../../models/data/product-filter/index.js";import{IkasVariantType as h}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new j(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new h({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
1
+ import{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as j}from"../../models/data/product-filter/index.js";import{IkasVariantType as h}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new j(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new h({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id,t.isVideo)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as n}from"mobx-react-lite";import o from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as s}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=n((function(e){var t,n,o,c=e.vm,d=e.allowExpand,p=c.cart,E=c.checkout,C=u().t,h=a.useState(!d),k=h[0],x=h[1],j=a.useState(!1),w=j[0],A=j[1],P=a.useState(0),L=P[0],R=P[1],I=a.useState(null),D=I[0],_=I[1],B=a.useState(!1),U=B[0],V=B[1],F=a.useState(!1),G=F[0],M=F[1];a.useEffect((function(){d&&(k?D&&R(D.getBoundingClientRect().height):R(0))}),[k,D,d,U,G,w]);var z=[f.CartSummary,k?f.Visible:"",d?f.AllowExpand:""].join(" "),O=d?{height:L+"px"}:{},H=[f.ArrowDown,k?f.Rotated:""].join(" ");return p?a.createElement("div",{className:z},!!d&&a.createElement("div",{className:f.ExpandHeader,onClick:function(){return x(!k)}},a.createElement("div",{className:f.Left},C("checkout-page:summary")),a.createElement("div",{className:f.Price},a.createElement("span",{className:f.PriceText},"".concat(s(c.finalPrice||0,p.currencyCode)," (").concat(null===(t=c.cart)||void 0===t?void 0:t.items.length," ").concat(C("checkout-page:cartItemProduct"),")")),a.createElement("span",{className:H},a.createElement(v,null)))),a.createElement("div",{className:f.DetailsContainer,style:O},a.createElement("div",{className:f.Details,ref:_},null==p?void 0:p.items.map((function(e,t){return a.createElement("div",{key:t},a.createElement(m,{vm:c,cartItem:e,currencyCode:p.currencyCode}))})),a.createElement("div",{className:f.Divider}),a.createElement("div",{className:f.SubTotalInfo},w&&a.createElement("div",{className:f.NotificationContainer},a.createElement(l,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:C("checkout-page:giftCodeErrorDescription"),onClose:function(){return A(!1)}})),a.createElement(N,{label:C("checkout-page:subtotal"),value:s(p.totalPrice,p.currencyCode),tooltipText:C("checkout-page:subtotalTooltip")}),!!(null===(n=E.shippingLines)||void 0===n?void 0:n.length)&&a.createElement(N,{label:C("checkout-page:cartShippingTitle"),value:E.shippingTotal?s(E.shippingTotal,p.currencyCode):C("checkout-page:free")}),!!c.checkout.totalTax&&!!(null===(o=c.customizationProps)||void 0===o?void 0:o.showTax)&&a.createElement(N,{label:C("checkout-page:cartTaxTitle"),value:s(c.checkout.totalTax,p.currencyCode)}),!!c.installmentExtraPrice&&a.createElement(N,{label:C("checkout-page:cartInterest"),value:s(c.installmentExtraPrice,p.currencyCode)}),a.createElement(y,{vm:c}),a.createElement(S,{vm:c}),(c.step===r.SUCCESS&&(!!c.checkout.note||!!c.checkout.appliedCouponCode)||c.step!==r.SUCCESS)&&a.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),a.createElement(T,{vm:c,isAddingCoupon:G,setAddingCoupon:M,setCouponError:A}),a.createElement(b,{vm:c,isAddingNote:U,setAddingNote:V})),a.createElement("div",{className:f.TotalContainer},a.createElement("div",{className:f.TitleContainer},a.createElement("div",{className:f.Title},C("checkout-page:total"))),a.createElement("div",{className:f.TotalPrice},s(c.finalPrice||0,p.currencyCode))),a.createElement("div",{className:f.PoweredBy},a.createElement("span",null,"powered by"),a.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},a.createElement(g,null)))))):null})),N=n((function(e){var t=e.label,n=e.value,o=e.tooltipText;return a.createElement("div",{className:f.InfoRow},a.createElement("div",{className:f.Label},a.createElement("span",null,t),!!o&&a.createElement(E,{text:o,style:{marginLeft:"8px"}})),a.createElement("div",{className:f.Value},n))})),y=n((function(e){var t=e.vm,n=u().t;return t.cart?a.createElement(a.Fragment,null,o(t.checkout.nonCouponAdjustments||[],"order").map((function(e,o){return a.createElement("div",{className:f.InfoRow,key:o},a.createElement("div",{className:f.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,t.cart.currencyCode))))}))):null})),S=n((function(e){var t,n,o=e.vm,c=u().t;return o.cart?a.createElement(a.Fragment,null,o.step!==r.SUCCESS&&((null===(t=o.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(o.checkout.totalFinalPrice||0,o.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,o.cart.currencyCode))))})),null===(n=o.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},a.createElement("div",{className:f.GiftLabel},a.createElement(h,{style:{position:"relative",top:"-1px"}}),a.createElement("span",null,c("checkout-page:giftPackage")))),a.createElement("div",{className:f.Value},a.createElement("span",null,s(e.price,o.cart.currencyCode))))}))):null})),T=n((function(n){var o=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,d=u().t,p=a.useState(""),E=p[0],v=p[1],h=a.useState(!1),g=h[0],k=h[1];if(o.step===r.SUCCESS&&!o.checkout.appliedCouponCode)return null;var N=o.checkout.couponAdjustment;return a.createElement("div",{className:f.InfoRow},!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&a.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=E,k(!0),[4,o.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),o.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),o.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),a.createElement("span",{className:f.AppliedCoupon},a.createElement("span",{className:f.CouponCode},o.checkout.appliedCouponCode),o.step!==r.SUCCESS&&a.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=null,k(!0),[4,o.onCouponCodeDelete()];case 1:return e.sent(),k(!1),[2]}}))}))}},a.createElement(C,null)))),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",a.createElement("span",null,s((null==N?void 0:N.amount)||0,o.cart.currencyCode))))})),b=n((function(e){var t=e.vm,n=e.isAddingNote,o=e.setAddingNote,c=u().t,l=a.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=a.useCallback((function(){o(!0)}),[]),s=a.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:a.createElement("div",{className:f.InfoRow},!n&&!m&&a.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(n||m)&&a.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},a.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?a.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):a.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};
1
+ import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as a}from"mobx-react-lite";import n from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as s}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=a((function(e){var t,a,n,c=e.vm,d=e.allowExpand,p=c.cart,E=c.checkout,C=u().t,h=o.useState(!d),k=h[0],x=h[1],j=o.useState(!1),w=j[0],A=j[1],P=o.useState(0),I=P[0],L=P[1],R=o.useState(null),D=R[0],B=R[1],_=o.useState(!1),U=_[0],F=_[1],V=o.useState(!1),G=V[0],M=V[1];o.useEffect((function(){d&&(k?D&&L(D.getBoundingClientRect().height):L(0))}),[k,D,d,U,G,w]);var O=[f.CartSummary,d?f.HideOnDesktop:""].join(" "),z=d?{height:I+"px"}:void 0,H=[f.ArrowDown,k?f.Rotated:""].join(" ");return p?o.createElement(o.Fragment,null,!!d&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:f.ExpandHeader,onClick:function(){if(!k){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}x(!k)}},o.createElement("div",{className:f.Left},C("checkout-page:summary")),o.createElement("div",{className:f.Price},o.createElement("span",{className:f.PriceText},"".concat(s(c.finalPrice||0,p.currencyCode)," (").concat(null===(t=c.cart)||void 0===t?void 0:t.items.length," ").concat(C("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:H},o.createElement(v,null))))),o.createElement("div",{className:O},o.createElement("div",{className:f.DetailsContainer,style:z},o.createElement("div",{className:f.Details,ref:B},null==p?void 0:p.items.map((function(e,t){return o.createElement("div",{key:t},o.createElement(m,{vm:c,cartItem:e,currencyCode:p.currencyCode}))})),o.createElement("div",{className:f.Divider}),o.createElement("div",{className:f.SubTotalInfo},w&&o.createElement("div",{className:f.NotificationContainer},o.createElement(l,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:C("checkout-page:giftCodeErrorDescription"),onClose:function(){return A(!1)}})),o.createElement(N,{label:C("checkout-page:subtotal"),value:s(p.totalPrice,p.currencyCode),tooltipText:C("checkout-page:subtotalTooltip")}),!!(null===(a=E.shippingLines)||void 0===a?void 0:a.length)&&o.createElement(N,{label:C("checkout-page:cartShippingTitle"),value:E.shippingTotal?s(E.shippingTotal,p.currencyCode):C("checkout-page:free")}),!!c.checkout.totalTax&&!!(null===(n=c.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement(N,{label:C("checkout-page:cartTaxTitle"),value:s(c.checkout.totalTax,p.currencyCode)}),!!c.installmentExtraPrice&&o.createElement(N,{label:C("checkout-page:cartInterest"),value:s(c.installmentExtraPrice,p.currencyCode)}),o.createElement(y,{vm:c}),o.createElement(T,{vm:c}),(c.step===r.SUCCESS&&(!!c.checkout.note||!!c.checkout.appliedCouponCode)||c.step!==r.SUCCESS)&&o.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(S,{vm:c,isAddingCoupon:G,setAddingCoupon:M,setCouponError:A}),o.createElement(b,{vm:c,isAddingNote:U,setAddingNote:F})),o.createElement("div",{className:f.TotalContainer},o.createElement("div",{className:f.TitleContainer},o.createElement("div",{className:f.Title},C("checkout-page:total"))),o.createElement("div",{className:f.TotalPrice},s(c.finalPrice||0,p.currencyCode))),o.createElement("div",{className:f.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(g,null))))))):null})),N=a((function(e){var t=e.label,a=e.value,n=e.tooltipText;return o.createElement("div",{className:f.InfoRow},o.createElement("div",{className:f.Label},o.createElement("span",null,t),!!n&&o.createElement(E,{text:n,style:{marginLeft:"8px"}})),o.createElement("div",{className:f.Value},a))})),y=a((function(e){var t=e.vm,a=u().t;return t.cart?o.createElement(o.Fragment,null,n(t.checkout.nonCouponAdjustments||[],"order").map((function(e,n){return o.createElement("div",{className:f.InfoRow,key:n},o.createElement("div",{className:f.Label},"INTEREST"===e.name?a("checkout-page:cartInterest"):e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,t.cart.currencyCode))))}))):null})),T=a((function(e){var t,a,n=e.vm,c=u().t;return n.cart?o.createElement(o.Fragment,null,n.step!==r.SUCCESS&&((null===(t=n.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(n.checkout.totalFinalPrice||0,n.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,n.cart.currencyCode))))})),null===(a=n.checkout.giftPackageLines)||void 0===a?void 0:a.map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},o.createElement("div",{className:f.GiftLabel},o.createElement(h,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:f.Value},o.createElement("span",null,s(e.price,n.cart.currencyCode))))}))):null})),S=a((function(a){var n=a.vm,l=a.isAddingCoupon,i=a.setAddingCoupon,m=a.setCouponError,d=u().t,p=o.useState(""),E=p[0],v=p[1],h=o.useState(!1),g=h[0],k=h[1];if(n.step===r.SUCCESS&&!n.checkout.appliedCouponCode)return null;var N=n.checkout.couponAdjustment;return o.createElement("div",{className:f.InfoRow},!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&o.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=E,k(!0),[4,n.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),n.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),n.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),o.createElement("span",{className:f.AppliedCoupon},o.createElement("span",{className:f.CouponCode},n.checkout.appliedCouponCode),n.step!==r.SUCCESS&&o.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=null,k(!0),[4,n.onCouponCodeDelete()];case 1:return e.sent(),k(!1),[2]}}))}))}},o.createElement(C,null)))),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",o.createElement("span",null,s((null==N?void 0:N.amount)||0,n.cart.currencyCode))))})),b=a((function(e){var t=e.vm,a=e.isAddingNote,n=e.setAddingNote,c=u().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){n(!0)}),[]),s=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:f.InfoRow},!a&&!m&&o.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(a||m)&&o.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},o.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):o.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};