@dropins/storefront-quote-management 1.0.0-beta1 → 1.0.0-beta10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/LICENSE.md +25 -26
  2. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +1 -0
  3. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +1 -1
  4. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +1 -1
  5. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
  6. package/api/sendForReview/index.d.ts +1 -1
  7. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +10 -0
  8. package/api.js +10 -47
  9. package/api.js.map +1 -1
  10. package/chunks/AttachedFilesList.js +1 -1
  11. package/chunks/AttachedFilesList.js.map +1 -1
  12. package/chunks/ConfirmationModal.js +1 -1
  13. package/chunks/ConfirmationModal.js.map +1 -1
  14. package/chunks/ItemsQuoted.js +1 -1
  15. package/chunks/ItemsQuoted.js.map +1 -1
  16. package/chunks/ItemsQuotedTemplate.js +1 -1
  17. package/chunks/ItemsQuotedTemplate.js.map +1 -1
  18. package/chunks/LineItemNoteModal.js +4 -0
  19. package/chunks/LineItemNoteModal.js.map +1 -0
  20. package/chunks/NegotiableQuoteFragment.js +1 -0
  21. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  22. package/chunks/NegotiableQuoteTemplateFragment.js +154 -6
  23. package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -1
  24. package/chunks/OrderSummaryLine.js +1 -1
  25. package/chunks/OrderSummaryLine.js.map +1 -1
  26. package/chunks/QuoteTemplateCommentsList.js +1 -1
  27. package/chunks/QuoteTemplateCommentsList.js.map +1 -1
  28. package/chunks/RenameQuoteModal.js +4 -0
  29. package/chunks/RenameQuoteModal.js.map +1 -0
  30. package/chunks/ShippingAddressDisplay.js +1 -1
  31. package/chunks/ShippingAddressDisplay.js.map +1 -1
  32. package/chunks/addQuoteTemplateLineItemNote.js +23 -3
  33. package/chunks/addQuoteTemplateLineItemNote.js.map +1 -1
  34. package/chunks/duplicateNegotiableQuote.js +5 -5
  35. package/chunks/duplicateNegotiableQuote.js.map +1 -1
  36. package/chunks/getQuoteTemplates.js +13 -11
  37. package/chunks/getQuoteTemplates.js.map +1 -1
  38. package/chunks/negotiableQuotes.js +1 -1
  39. package/chunks/openQuoteTemplate.js +29 -8
  40. package/chunks/openQuoteTemplate.js.map +1 -1
  41. package/chunks/state.js +1 -1
  42. package/chunks/state.js.map +1 -1
  43. package/chunks/transform-quote-template.js +1 -1
  44. package/chunks/transform-quote-template.js.map +1 -1
  45. package/chunks/transform-quote.js +1 -1
  46. package/chunks/transform-quote.js.map +1 -1
  47. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +2 -2
  48. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +5 -2
  49. package/components/ProductListTable/ProductListTable.d.ts +5 -49
  50. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +30 -0
  51. package/components/ReferenceDocumentFormModal/index.d.ts +11 -0
  52. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +18 -0
  53. package/components/ReferenceDocumentsList/index.d.ts +11 -0
  54. package/components/index.d.ts +2 -0
  55. package/containers/ItemsQuoted/ItemsQuoted.d.ts +7 -7
  56. package/containers/ItemsQuoted.js +1 -1
  57. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +5 -1
  58. package/containers/ItemsQuotedTemplate.js +1 -1
  59. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +3 -0
  60. package/containers/ManageNegotiableQuote.js +1 -1
  61. package/containers/ManageNegotiableQuote.js.map +1 -1
  62. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +46 -5
  63. package/containers/ManageNegotiableQuoteTemplate.js +3 -1
  64. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
  65. package/containers/OrderSummary.js +1 -1
  66. package/containers/OrderSummary.js.map +1 -1
  67. package/containers/OrderSummaryLine.js +1 -1
  68. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +1 -1
  69. package/containers/QuoteSummaryList.js +1 -1
  70. package/containers/QuoteSummaryList.js.map +1 -1
  71. package/containers/QuoteTemplatesListTable.js +1 -1
  72. package/containers/QuoteTemplatesListTable.js.map +1 -1
  73. package/containers/QuotesListTable.js +1 -1
  74. package/containers/QuotesListTable.js.map +1 -1
  75. package/containers/RequestNegotiableQuoteForm.js +1 -1
  76. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  77. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +2 -2
  78. package/containers/ShippingAddressDisplay.js +1 -1
  79. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +5 -5
  80. package/data/models/negotiable-quote-model.d.ts +3 -2
  81. package/data/models/negotiable-quote-template-model.d.ts +4 -39
  82. package/data/models/store-config-model.d.ts +2 -0
  83. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +8 -0
  84. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +616 -75
  85. package/data/transforms/__fixtures__/storeConfigData.d.ts +4 -0
  86. package/data/transforms/transform-history.d.ts +15 -0
  87. package/data/transforms/transform-quote-items.d.ts +15 -0
  88. package/hooks/useItemsQuotedTemplate.d.ts +15 -0
  89. package/hooks/useReferenceDocumentLinks.d.ts +34 -0
  90. package/hooks/useRemoveTemplateItems.d.ts +25 -0
  91. package/hooks/useRenameTemplate.d.ts +71 -0
  92. package/hooks/useUpdateTemplateQuantities.d.ts +27 -0
  93. package/i18n/en_US.json.d.ts +93 -6
  94. package/lib/itemFormatters.d.ts +1 -1
  95. package/lib/priceCalculators.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/render.js +3 -3
  98. package/render.js.map +1 -1
  99. package/chunks/LineItemNoteModal2.js +0 -4
  100. package/chunks/LineItemNoteModal2.js.map +0 -1
  101. package/chunks/TabbedContent.js +0 -4
  102. package/chunks/TabbedContent.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NegotiableQuoteTemplateFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n # uid\n template_id\n name\n # created_at\n # updated_at\n status\n # sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n uid\n product {\n name\n sku\n uid\n stock_status\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n note_from_buyer {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n`;\n"],"names":["NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAmD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"NegotiableQuoteTemplateFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n uid\n template_id\n name\n created_at\n updated_at\n status\n sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n __typename\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n row_total_including_tax {\n value\n currency\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n is_available\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on SimpleCartItem {\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n configured_variant {\n uid\n sku\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n reference_document_links {\n link_id\n document_name\n document_identifier\n reference_document_url\n }\n }\n`;\n"],"names":["NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as p,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as n,VComponent as _}from"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */const V=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>p(y,{...a,label:o,price:e,classSuffixes:t,labelClassSuffix:r,testId:m,children:s}),y=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>{const i="quote-order-summary__label",c="quote-order-summary__price";return u("div",{...a,...m?{"data-testid":m}:{},className:n(["quote-order-summary__entry",...t.map(d=>`quote-order-summary__${d}`)]),children:[p("span",{className:n([i,...r?[`${i}--${r}`]:[]]),children:o}),p(_,{node:e,className:n([c,...r?[`${c}--${r}`]:[]])}),s]})};export{V as O};
3
+ import{jsx as p,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as n,VComponent as _}from"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */const V=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>p(y,{...a,label:o,price:e,classSuffixes:t,labelClassSuffix:r,testId:m,children:s}),y=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>{const i="quote-order-summary__label",c="quote-order-summary__price";return u("div",{...a,...m?{"data-testid":m}:{},className:n(["quote-order-summary__entry",...t.map(d=>`quote-order-summary__${d}`)]),children:[p("span",{className:n([i,...r?[`${i}--${r}`]:[]]),children:o}),p(_,{node:e,className:n([c,...r?[`${c}--${r}`]:[]])}),s]})};export{V as O};
4
4
  //# sourceMappingURL=OrderSummaryLine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrderSummaryLine.js","sources":["/@dropins/storefront-quote-management/src/containers/OrderSummaryLine/OrderSummaryLine.tsx","/@dropins/storefront-quote-management/src/components/OrderSummaryLine/OrderSummaryLine.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { VNode } from 'preact';\nimport { OrderSummaryLine as OrderSummaryLineComponent } from '@/quote-management/components';\n\nexport interface OrderSummaryLineProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: Container<OrderSummaryLineProps> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n return (\n <OrderSummaryLineComponent\n {...props}\n label={label}\n price={price}\n classSuffixes={classSuffixes}\n labelClassSuffix={labelClassSuffix}\n testId={testId}\n >\n {children}\n </OrderSummaryLineComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport '@/quote-management/components/OrderSummaryLine/OrderSummaryLine.css';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nexport interface OrderSummaryLineComponentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: FunctionComponent<\n OrderSummaryLineComponentProps\n> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n const labelClass = 'quote-order-summary__label';\n const priceClass = 'quote-order-summary__price';\n return (\n <div\n {...props}\n {...(testId ? { 'data-testid': testId } : {})}\n className={classes([\n 'quote-order-summary__entry',\n ...classSuffixes.map(\n (classSuffix) => `quote-order-summary__${classSuffix}`\n ),\n ])}\n >\n <span\n className={classes([\n labelClass,\n ...(labelClassSuffix ? [`${labelClass}--${labelClassSuffix}`] : []),\n ])}\n >\n {label}\n </span>\n\n <VComponent\n node={price}\n className={classes([\n priceClass,\n ...(labelClassSuffix ? [`${priceClass}--${labelClassSuffix}`] : []),\n ])}\n />\n\n {children}\n </div>\n );\n};\n"],"names":["OrderSummaryLine","label","price","classSuffixes","labelClassSuffix","testId","children","props","jsx","OrderSummaryLineComponent","labelClass","priceClass","jsxs","classes","classSuffix","VComponent"],"mappings":"uXAwBO,MAAMA,EAAqD,CAAC,CACjE,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAEIC,EAACC,EAAA,CACE,GAAGF,EACJ,MAAAN,EACA,MAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,OAAAC,EAEC,SAAAC,CAAA,CAAA,ECnBMN,EAET,CAAC,CACH,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMG,EAAa,6BACbC,EAAa,6BACnB,OACEC,EAAC,MAAA,CACE,GAAGL,EACH,GAAIF,EAAS,CAAE,cAAeA,CAAA,EAAW,CAAA,EAC1C,UAAWQ,EAAQ,CACjB,6BACA,GAAGV,EAAc,IACdW,GAAgB,wBAAwBA,CAAW,EAAA,CACtD,CACD,EAED,SAAA,CAAAN,EAAC,OAAA,CACC,UAAWK,EAAQ,CACjBH,EACA,GAAIN,EAAmB,CAAC,GAAGM,CAAU,KAAKN,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,EAEA,SAAAH,CAAA,CAAA,EAGHO,EAACO,EAAA,CACC,KAAMb,EACN,UAAWW,EAAQ,CACjBF,EACA,GAAIP,EAAmB,CAAC,GAAGO,CAAU,KAAKP,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,CAAA,CAAA,EAGFE,CAAA,CAAA,CAAA,CAGP"}
1
+ {"version":3,"file":"OrderSummaryLine.js","sources":["/@dropins/storefront-quote-management/src/containers/OrderSummaryLine/OrderSummaryLine.tsx","/@dropins/storefront-quote-management/src/components/OrderSummaryLine/OrderSummaryLine.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { VNode } from 'preact';\nimport { OrderSummaryLine as OrderSummaryLineComponent } from '@/quote-management/components';\n\nexport interface OrderSummaryLineProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: Container<OrderSummaryLineProps> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n return (\n <OrderSummaryLineComponent\n {...props}\n label={label}\n price={price}\n classSuffixes={classSuffixes}\n labelClassSuffix={labelClassSuffix}\n testId={testId}\n >\n {children}\n </OrderSummaryLineComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport '@/quote-management/components/OrderSummaryLine/OrderSummaryLine.css';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nexport interface OrderSummaryLineComponentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: FunctionComponent<\n OrderSummaryLineComponentProps\n> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n const labelClass = 'quote-order-summary__label';\n const priceClass = 'quote-order-summary__price';\n return (\n <div\n {...props}\n {...(testId ? { 'data-testid': testId } : {})}\n className={classes([\n 'quote-order-summary__entry',\n ...classSuffixes.map(\n (classSuffix) => `quote-order-summary__${classSuffix}`\n ),\n ])}\n >\n <span\n className={classes([\n labelClass,\n ...(labelClassSuffix ? [`${labelClass}--${labelClassSuffix}`] : []),\n ])}\n >\n {label}\n </span>\n\n <VComponent\n node={price}\n className={classes([\n priceClass,\n ...(labelClassSuffix ? [`${priceClass}--${labelClassSuffix}`] : []),\n ])}\n />\n\n {children}\n </div>\n );\n};\n"],"names":["OrderSummaryLine","label","price","classSuffixes","labelClassSuffix","testId","children","props","jsx","OrderSummaryLineComponent","labelClass","priceClass","jsxs","classes","classSuffix","VComponent"],"mappings":"4XAwBO,MAAMA,EAAqD,CAAC,CACjE,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAEIC,EAACC,EAAA,CACE,GAAGF,EACJ,MAAAN,EACA,MAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,OAAAC,EAEC,SAAAC,CAAA,CAAA,ECnBMN,EAET,CAAC,CACH,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMG,EAAa,6BACbC,EAAa,6BACnB,OACEC,EAAC,MAAA,CACE,GAAGL,EACH,GAAIF,EAAS,CAAE,cAAeA,CAAA,EAAW,CAAA,EAC1C,UAAWQ,EAAQ,CACjB,6BACA,GAAGV,EAAc,IACdW,GAAgB,wBAAwBA,CAAW,EAAA,CACtD,CACD,EAED,SAAA,CAAAN,EAAC,OAAA,CACC,UAAWK,EAAQ,CACjBH,EACA,GAAIN,EAAmB,CAAC,GAAGM,CAAU,KAAKN,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,EAEA,SAAAH,CAAA,CAAA,EAGHO,EAACO,EAAA,CACC,KAAMb,EACN,UAAWW,EAAQ,CACjBF,EACA,GAAIP,EAAmB,CAAC,GAAGO,CAAU,KAAKP,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,CAAA,CAAA,EAGFE,CAAA,CAAA,CAAA,CAGP"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as o,jsxs as i}from"@dropins/tools/preact-jsx-runtime.js";import{useState as f,useEffect as p}from"@dropins/tools/preact-compat.js";import{Q as d}from"./QuoteCommentsList.js";import{events as l}from"@dropins/tools/event-bus.js";import{f as c}from"./dateUtils.js";const C=({templateData:a,...s})=>{var r;const[e,m]=f(a);if(p(()=>{const t=l.on("quote-management/quote-template-data",u=>{m(u.quoteTemplate)},{eager:!0});return()=>t==null?void 0:t.off()},[]),!e)return null;const n=(r=e==null?void 0:e.comments)==null?void 0:r.map(t=>({uid:t.uid,createdAt:o("span",{children:c(t.createdAt,"long")}),author:i("span",{children:[t.author.firstname," ",t.author.lastname]}),text:o("p",{children:t.text})}));return o(d,{"data-testid":"quote-template-comments-list-container",...s,comments:n||[]})};export{C as Q};
3
+ import{jsx as a,jsxs as i}from"@dropins/tools/preact-jsx-runtime.js";import{useState as f,useEffect as p}from"@dropins/tools/preact-compat.js";import{Q as d}from"./QuoteCommentsList.js";import{events as l}from"@dropins/tools/event-bus.js";import{f as c}from"./dateUtils.js";const C=({templateData:r,...s})=>{var o;const[e,m]=f(r);if(p(()=>{const t=l.on("quote-management/quote-template-data",u=>{m(u.quoteTemplate)},{eager:!0});return()=>t==null?void 0:t.off()},[]),!e)return null;const n=(o=e==null?void 0:e.comments)==null?void 0:o.map(t=>({uid:t.uid,createdAt:a("span",{children:c(t.createdAt,"long")}),author:i("span",{children:[t.author.firstname," ",t.author.lastname]}),text:a("p",{children:t.text}),attachments:t.attachments}));return a(d,{"data-testid":"quote-template-comments-list-container",...s,comments:n||[]})};export{C as Q};
4
4
  //# sourceMappingURL=QuoteTemplateCommentsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteTemplateCommentsList.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { QuoteCommentsList as QuoteCommentsListComponent } from '@/quote-management/components/QuoteCommentsList';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\n\nexport interface QuoteTemplateCommentsListProps extends HTMLAttributes<HTMLUListElement> {\n templateData?: NegotiableQuoteTemplateModel;\n}\n\nexport const QuoteTemplateCommentsList: Container<QuoteTemplateCommentsListProps> = ({\n templateData: initialData,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<NegotiableQuoteTemplateModel | undefined>(initialData);\n\n useEffect(() => {\n const templateDataEvent = events.on('quote-management/quote-template-data', (data: { quoteTemplate: NegotiableQuoteTemplateModel }) => {\n setTemplateData(data.quoteTemplate);\n }, { eager: true });\n return () => templateDataEvent?.off();\n }, []);\n\n if (!templateData) {\n return null;\n }\n\n // Format comments data\n const formattedComments = templateData?.comments?.map((comment) => ({\n uid: comment.uid,\n createdAt: <span>{formattedDate(comment.createdAt, 'long')}</span>,\n author: (\n <span>\n {comment.author.firstname} {comment.author.lastname}\n </span>\n ),\n text: <p>{comment.text}</p>,\n }));\n\n return (\n <QuoteCommentsListComponent\n data-testid=\"quote-template-comments-list-container\"\n {...props}\n comments={formattedComments || []}\n />\n );\n};\n"],"names":["QuoteTemplateCommentsList","initialData","props","templateData","setTemplateData","useState","useEffect","templateDataEvent","events","data","formattedComments","_a","comment","jsx","QuoteCommentsListComponent"],"mappings":"kRAoBO,MAAMA,EAAuE,CAAC,CACnF,aAAcC,EACd,GAAGC,CACL,IAAM,OACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAmDJ,CAAW,EAStG,GAPAK,EAAU,IAAM,CACd,MAAMC,EAAoBC,EAAO,GAAG,uCAAyCC,GAA0D,CACrIL,EAAgBK,EAAK,aAAa,CACpC,EAAG,CAAE,MAAO,GAAM,EAClB,MAAO,IAAMF,GAAA,YAAAA,EAAmB,KAClC,EAAG,CAAA,CAAE,EAED,CAACJ,EACH,OAAO,KAIT,MAAMO,GAAoBC,EAAAR,GAAA,YAAAA,EAAc,WAAd,YAAAQ,EAAwB,IAAKC,IAAa,CAClE,IAAKA,EAAQ,IACb,UAAWC,EAAC,OAAA,CAAM,WAAcD,EAAQ,UAAW,MAAM,EAAE,EAC3D,SACG,OAAA,CACE,SAAA,CAAAA,EAAQ,OAAO,UAAU,IAAEA,EAAQ,OAAO,QAAA,EAC7C,EAEF,KAAMC,EAAC,IAAA,CAAG,SAAAD,EAAQ,IAAA,CAAK,CAAA,IAGzB,OACEC,EAACC,EAAA,CACC,cAAY,yCACX,GAAGZ,EACJ,SAAUQ,GAAqB,CAAA,CAAC,CAAA,CAGtC"}
1
+ {"version":3,"file":"QuoteTemplateCommentsList.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { QuoteCommentsList as QuoteCommentsListComponent } from '@/quote-management/components/QuoteCommentsList';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\n\nexport interface QuoteTemplateCommentsListProps extends HTMLAttributes<HTMLUListElement> {\n templateData?: NegotiableQuoteTemplateModel;\n}\n\nexport const QuoteTemplateCommentsList: Container<QuoteTemplateCommentsListProps> = ({\n templateData: initialData,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<NegotiableQuoteTemplateModel | undefined>(initialData);\n\n useEffect(() => {\n const templateDataEvent = events.on('quote-management/quote-template-data', (data: { quoteTemplate: NegotiableQuoteTemplateModel }) => {\n setTemplateData(data.quoteTemplate);\n }, { eager: true });\n return () => templateDataEvent?.off();\n }, []);\n\n if (!templateData) {\n return null;\n }\n\n // Format comments data\n const formattedComments = templateData?.comments?.map((comment) => ({\n uid: comment.uid,\n createdAt: <span>{formattedDate(comment.createdAt, 'long')}</span>,\n author: (\n <span>\n {comment.author.firstname} {comment.author.lastname}\n </span>\n ),\n text: <p>{comment.text}</p>,\n attachments: comment.attachments,\n }));\n\n return (\n <QuoteCommentsListComponent\n data-testid=\"quote-template-comments-list-container\"\n {...props}\n comments={formattedComments || []}\n />\n );\n};\n"],"names":["QuoteTemplateCommentsList","initialData","props","templateData","setTemplateData","useState","useEffect","templateDataEvent","events","data","formattedComments","_a","comment","jsx","QuoteCommentsListComponent"],"mappings":"kRAoBO,MAAMA,EAAuE,CAAC,CACnF,aAAcC,EACd,GAAGC,CACL,IAAM,OACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAmDJ,CAAW,EAStG,GAPAK,EAAU,IAAM,CACd,MAAMC,EAAoBC,EAAO,GAAG,uCAAyCC,GAA0D,CACrIL,EAAgBK,EAAK,aAAa,CACpC,EAAG,CAAE,MAAO,GAAM,EAClB,MAAO,IAAMF,GAAA,YAAAA,EAAmB,KAClC,EAAG,CAAA,CAAE,EAED,CAACJ,EACH,OAAO,KAIT,MAAMO,GAAoBC,EAAAR,GAAA,YAAAA,EAAc,WAAd,YAAAQ,EAAwB,IAAKC,IAAa,CAClE,IAAKA,EAAQ,IACb,UAAWC,EAAC,OAAA,CAAM,WAAcD,EAAQ,UAAW,MAAM,EAAE,EAC3D,SACG,OAAA,CACE,SAAA,CAAAA,EAAQ,OAAO,UAAU,IAAEA,EAAQ,OAAO,QAAA,EAC7C,EAEF,KAAMC,EAAC,IAAA,CAAG,SAAAD,EAAQ,KAAK,EACvB,YAAaA,EAAQ,WAAA,IAGvB,OACEC,EAACC,EAAA,CACC,cAAY,yCACX,GAAGZ,EACJ,SAAUQ,GAAqB,CAAA,CAAC,CAAA,CAGtC"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import*as v from"@dropins/tools/preact-compat.js";import{useState as p,useMemo as f}from"@dropins/tools/preact-compat.js";import{jsx as e,jsxs as d,Fragment as k}from"@dropins/tools/preact-jsx-runtime.js";import{classes as a,VComponent as N}from"@dropins/tools/lib.js";/* empty css */import{Picker as x,Modal as L,Input as T,TextArea as M,Button as _}from"@dropins/tools/components.js";import{useText as y}from"@dropins/tools/i18n.js";const S=i=>v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",...i},v.createElement("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})),j=({className:i,dropdownPlaceholder:m,dropdownOptions:n,dropdownValue:c,handleDropdownChange:s,buttons:t,...l})=>{const b=n&&n.length>0,u=t&&t.length>0,o=(n==null?void 0:n.map(r=>({text:r.label,value:r.value})))||[];return o.unshift({text:m||"",value:""}),e("div",{className:"quote-management-actions-bar__container","data-testid":"actions-bar-container",children:d("div",{className:a(["quote-management-actions-bar",i]),"data-testid":"actions-bar",...l,children:[b&&e(x,{name:"dropdown",id:"dropdown",handleSelect:s,className:"quote-management-actions-bar__dropdown","data-testid":"dropdown",options:o,value:c||""},`actions-bar-picker-${c||"empty"}`),u&&e("div",{className:"quote-management-actions-bar__buttons","data-testid":"buttons-container",children:t==null?void 0:t.map((r,q)=>e(N,{node:r,className:a(["quote-management-actions-bar__button"])},q))})]})})},D=({className:i,tabs:m,tabsContent:n,defaultActiveTab:c,...s})=>{const[t,l]=p(c||Array.from(m.keys())[0]),b=o=>{l(o)},u=f(()=>n.get(t),[t,n]);return d("div",{...s,className:a(["quote-management-tabbed-content",i]),children:[m&&e("div",{"data-testid":"tabbed-content-tabs",className:a(["quote-management-tabbed-content__tabs"]),children:Array.from(m.entries()).map(([o,r])=>e("button",{className:a(["quote-management-tabbed-content__tab",["quote-management-tabbed-content__tab--active",o===t]]),onClick:()=>b(o),children:r},o))}),u&&e("div",{className:a(["quote-management-tabbed-content__active-tab-content"]),children:e(N,{node:u})})]})},I=({className:i,open:m,quoteName:n,renameReason:c,quoteNameError:s,errorBanner:t,successBanner:l,showCloseButton:b=!0,onQuoteNameChange:u,onRenameReasonChange:o,onSave:r,onClose:q})=>{const g=y({title:"NegotiableQuote.Manage.rename.title",quoteNameLabel:"NegotiableQuote.Manage.rename.quoteNameLabel",reasonLabel:"NegotiableQuote.Manage.rename.reasonLabel",renameButton:"NegotiableQuote.Manage.rename.renameButton",cancelButton:"NegotiableQuote.Manage.rename.cancelButton"});return m?d(L,{open:m,size:"medium",title:e(k,{children:g.title}),onClose:q,clickToDismiss:!0,escapeToDismiss:!0,showCloseButton:b,className:a(["quote-management-rename-quote-modal",i]),"data-testid":"rename-quote-modal",children:[t&&e("div",{className:a(["quote-management-rename-quote-modal__error-banner"]),"data-testid":"rename-quote-modal-error-banner",children:t}),l&&e("div",{className:a(["quote-management-rename-quote-modal__success-banner"]),"data-testid":"rename-quote-modal-success-banner",children:l}),d("div",{className:a(["quote-management-rename-quote-modal__content"]),children:[d("div",{children:[e(T,{name:"quoteName",type:"text",value:n,onInput:h=>u(h.target.value),floatingLabel:g.quoteNameLabel,required:!0,error:!!s}),s&&e("span",{className:a(["quote-management-rename-quote-modal__error-text"]),children:s})]}),e(M,{name:"quoteComment",value:c,onInput:h=>o(h.target.value),label:g.reasonLabel,rows:3})]}),d("div",{className:a(["quote-management-rename-quote-modal__actions"]),children:[e(_,{variant:"secondary",size:"medium",onClick:q,className:a(["quote-management-rename-quote-modal__cancel-button"]),children:g.cancelButton}),e(_,{variant:"primary",size:"medium",onClick:r,className:a(["quote-management-rename-quote-modal__save-button"]),children:g.renameButton})]})]}):null};export{j as A,I as R,S,D as T};
4
+ //# sourceMappingURL=RenameQuoteModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenameQuoteModal.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Edit.svg","/@dropins/storefront-quote-management/src/components/ActionsBar/ActionsBar.tsx","/@dropins/storefront-quote-management/src/components/TabbedContent/TabbedContent.tsx","/@dropins/storefront-quote-management/src/components/RenameQuoteModal/RenameQuoteModal.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgEdit = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\", className: \"feather feather-edit-2\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\" }));\nexport default SvgEdit;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ActionsBar/ActionsBar.css';\nimport { Picker } from '@adobe-commerce/elsie/components';\n\nexport interface ActionsBarProps extends HTMLAttributes<HTMLDivElement> {\n dropdownPlaceholder?: string;\n dropdownOptions?: {\n label: string;\n value: string;\n }[];\n dropdownValue?: string;\n handleDropdownChange?: (event: Event) => void;\n buttons?: VNode[];\n}\n\nexport const ActionsBar: FunctionComponent<ActionsBarProps> = ({\n className,\n dropdownPlaceholder,\n dropdownOptions,\n dropdownValue,\n handleDropdownChange,\n buttons,\n ...props\n}) => {\n const hasDropdown = dropdownOptions && dropdownOptions.length > 0;\n const hasButtons = buttons && buttons.length > 0;\n\n const pickerOptions =\n dropdownOptions?.map((option) => ({\n text: option.label,\n value: option.value,\n })) || [];\n pickerOptions.unshift({\n text: dropdownPlaceholder || '',\n value: '',\n });\n\n return (\n <div\n className=\"quote-management-actions-bar__container\"\n data-testid=\"actions-bar-container\"\n >\n <div\n className={classes(['quote-management-actions-bar', className])}\n data-testid=\"actions-bar\"\n {...props}\n >\n {hasDropdown && (\n <Picker\n key={`actions-bar-picker-${dropdownValue || 'empty'}`}\n name=\"dropdown\"\n id=\"dropdown\"\n handleSelect={handleDropdownChange}\n className=\"quote-management-actions-bar__dropdown\"\n data-testid=\"dropdown\"\n options={pickerOptions}\n value={dropdownValue || ''}\n />\n )}\n {hasButtons && (\n <div\n className=\"quote-management-actions-bar__buttons\"\n data-testid=\"buttons-container\"\n >\n {buttons?.map((button, index) => (\n <VComponent\n node={button}\n className={classes(['quote-management-actions-bar__button'])}\n key={index}\n />\n ))}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useMemo, useState } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/TabbedContent/TabbedContent.css';\n\nexport interface TabbedContentProps extends HTMLAttributes<HTMLDivElement> {\n tabs: Map<string, string>;\n tabsContent: Map<string, VNode>;\n defaultActiveTab?: string;\n}\n\nexport const TabbedContent: FunctionComponent<TabbedContentProps> = ({\n className,\n tabs,\n tabsContent,\n defaultActiveTab,\n ...props\n}) => {\n const [activeTabId, setActiveTabId] = useState<string>(\n defaultActiveTab || Array.from(tabs.keys())[0]\n );\n\n const handleTabClick = (tabId: string) => {\n setActiveTabId(tabId);\n };\n\n const activeTabContent = useMemo(() => {\n return tabsContent.get(activeTabId);\n }, [activeTabId, tabsContent]);\n\n return (\n <div {...props} className={classes(['quote-management-tabbed-content', className])}>\n {tabs &&\n <div data-testid=\"tabbed-content-tabs\" className={classes(['quote-management-tabbed-content__tabs'])}>\n {Array.from(tabs.entries()).map(([tabId, tabLabel]) => (\n <button\n className={\n classes([\n 'quote-management-tabbed-content__tab',\n ['quote-management-tabbed-content__tab--active', tabId === activeTabId]\n ])}\n key={tabId}\n onClick={() => handleTabClick(tabId)}\n >\n {tabLabel}\n </button>\n ))}\n </div>\n }\n {\n activeTabContent &&\n <div className={classes(['quote-management-tabbed-content__active-tab-content'])}>\n <VComponent\n node={activeTabContent as VNode}\n />\n </div>\n }\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Button, Input, TextArea, Modal } from '@adobe-commerce/elsie/components';\nimport '@/quote-management/components/RenameQuoteModal/RenameQuoteModal.css';\n\nexport interface RenameQuoteModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open: boolean;\n quoteName: string;\n renameReason: string;\n quoteNameError?: string;\n errorBanner?: VNode;\n successBanner?: VNode;\n showCloseButton?: boolean;\n onQuoteNameChange: (value: string) => void;\n onRenameReasonChange: (value: string) => void;\n onSave: () => void;\n onClose?: () => void;\n}\n\nexport const RenameQuoteModal: FunctionComponent<RenameQuoteModalProps> = ({\n className,\n open,\n quoteName,\n renameReason,\n quoteNameError,\n errorBanner,\n successBanner,\n showCloseButton = true,\n onQuoteNameChange,\n onRenameReasonChange,\n onSave,\n onClose,\n}) => {\n const dictionary = useText({\n title: 'NegotiableQuote.Manage.rename.title',\n quoteNameLabel: 'NegotiableQuote.Manage.rename.quoteNameLabel',\n reasonLabel: 'NegotiableQuote.Manage.rename.reasonLabel',\n renameButton: 'NegotiableQuote.Manage.rename.renameButton',\n cancelButton: 'NegotiableQuote.Manage.rename.cancelButton',\n });\n\n if (!open) {\n return null;\n }\n\n return (\n <Modal\n open={open}\n size=\"medium\"\n title={<>{dictionary.title}</>}\n onClose={onClose}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n className={classes(['quote-management-rename-quote-modal', className])}\n data-testid=\"rename-quote-modal\"\n >\n {errorBanner && (\n <div className={classes(['quote-management-rename-quote-modal__error-banner'])} data-testid=\"rename-quote-modal-error-banner\">\n {errorBanner}\n </div>\n )}\n\n {successBanner && (\n <div className={classes(['quote-management-rename-quote-modal__success-banner'])} data-testid=\"rename-quote-modal-success-banner\">\n {successBanner}\n </div>\n )}\n\n <div className={classes(['quote-management-rename-quote-modal__content'])}>\n <div>\n <Input\n name=\"quoteName\"\n type=\"text\"\n value={quoteName}\n onInput={(e: any) => onQuoteNameChange(e.target.value)}\n floatingLabel={dictionary.quoteNameLabel}\n required\n error={!!quoteNameError}\n />\n {quoteNameError && (\n <span className={classes(['quote-management-rename-quote-modal__error-text'])}>\n {quoteNameError}\n </span>\n )}\n </div>\n\n <TextArea\n name=\"quoteComment\"\n value={renameReason}\n onInput={(e: any) => onRenameReasonChange(e.target.value)}\n label={dictionary.reasonLabel}\n rows={3}\n />\n </div>\n\n <div className={classes(['quote-management-rename-quote-modal__actions'])}>\n <Button \n variant=\"secondary\"\n size=\"medium\"\n onClick={onClose}\n className={classes(['quote-management-rename-quote-modal__cancel-button'])}\n >\n {dictionary.cancelButton}\n </Button>\n <Button \n variant=\"primary\"\n size=\"medium\"\n onClick={onSave}\n className={classes(['quote-management-rename-quote-modal__save-button'])}\n >\n {dictionary.renameButton}\n </Button>\n </div>\n </Modal>\n );\n};\n"],"names":["SvgEdit","props","React","ActionsBar","className","dropdownPlaceholder","dropdownOptions","dropdownValue","handleDropdownChange","buttons","hasDropdown","hasButtons","pickerOptions","option","jsx","jsxs","classes","Picker","button","index","VComponent","TabbedContent","tabs","tabsContent","defaultActiveTab","activeTabId","setActiveTabId","useState","handleTabClick","tabId","activeTabContent","useMemo","tabLabel","RenameQuoteModal","open","quoteName","renameReason","quoteNameError","errorBanner","successBanner","showCloseButton","onQuoteNameChange","onRenameReasonChange","onSave","onClose","dictionary","useText","Modal","Fragment","Input","e","TextArea","Button"],"mappings":"wcACK,MAACA,EAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,QAAS,UAAW,yBAA0B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,0DAA2D,CAAC,ECyBlZC,EAAiD,CAAC,CAC7D,UAAAC,EACA,oBAAAC,EACA,gBAAAC,EACA,cAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,GAAGR,CACL,IAAM,CACJ,MAAMS,EAAcJ,GAAmBA,EAAgB,OAAS,EAC1DK,EAAaF,GAAWA,EAAQ,OAAS,EAEzCG,GACJN,GAAA,YAAAA,EAAiB,IAAKO,IAAY,CAChC,KAAMA,EAA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,EAAkBS,EAAE,OAAO,KAAK,EACrD,cAAeL,EAAW,eAC1B,SAAQ,GACR,MAAO,CAAC,CAACR,CAAA,CAAA,EAEVA,KACE,OAAA,CAAK,UAAWrB,EAAQ,CAAC,iDAAiD,CAAC,EACzE,SAAAqB,CAAA,CACH,CAAA,EAEJ,EAEAvB,EAACqC,EAAA,CACC,KAAK,eACL,MAAOf,EACP,QAAUc,GAAWR,EAAqBQ,EAAE,OAAO,KAAK,EACxD,MAAOL,EAAW,YAClB,KAAM,CAAA,CAAA,CACR,EACF,IAEC,MAAA,CAAI,UAAW7B,EAAQ,CAAC,8CAA8C,CAAC,EACtE,SAAA,CAAAF,EAACsC,EAAA,CACC,QAAQ,YACR,KAAK,SACL,QAASR,EACT,UAAW5B,EAAQ,CAAC,oDAAoD,CAAC,EAExE,SAAA6B,EAAW,YAAA,CAAA,EAEd/B,EAACsC,EAAA,CACC,QAAQ,UACR,KAAK,SACL,QAAST,EACT,UAAW3B,EAAQ,CAAC,kDAAkD,CAAC,EAEtE,SAAA6B,EAAW,YAAA,CAAA,CACd,CAAA,CACF,CAAA,CAAA,CAAA,EAvEK,IA0EX","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as s,jsxs as p}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as c}from"@dropins/tools/preact-compat.js";import{classes as u}from"@dropins/tools/lib.js";import{Skeleton as h,SkeletonRow as f}from"@dropins/tools/components.js";import{useText as _}from"@dropins/tools/i18n.js";import{events as g}from"@dropins/tools/event-bus.js";const q=({className:t,shippingAddress:e,loading:r,noAddressMessage:n,...d})=>{const o=_({noAddress:"NegotiableQuote.Manage.shippingAddress.noAddress"});return r?s(N,{}):e?p("div",{className:u(["quote-management-shipping-address-display",t]),"data-testid":"shipping-address-display",...d,children:[s("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-name",children:p("span",{className:"quote-management-shipping-address-display__name",children:[e.firstname," ",e.lastname]})}),e.company&&s("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-company",children:e.company}),e.street.map((i,a)=>s("div",{className:"quote-management-shipping-address-display__field","data-testid":`address-street-${a}`,children:i},a)),p("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-city-region",children:[e.city,e.region&&`, ${e.region.label}`," ",e.postcode]}),s("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-country",children:e.country.label}),s("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-telephone",children:e.telephone})]}):s("div",{className:u(["quote-management-shipping-address-display","quote-management-shipping-address-display--empty",t]),"data-testid":"shipping-address-display-empty",...d,children:s("p",{className:"quote-management-shipping-address-display__no-address",children:n||o.noAddress})})},N=()=>s(h,{"data-testid":"shipping-address-display-skeleton",children:s(f,{variant:"row",fullWidth:!0,size:"small",lines:5,multilineGap:"xsmall"})}),j=({quoteData:t,loading:e,...r})=>{var i;const[n,d]=y(t);c(()=>{t!==void 0&&d(t)},[t]),c(()=>{const a=g.on("quote-management/quote-data",l=>{const{quote:m}=l;d(m)},{eager:!0});return()=>a==null?void 0:a.off()},[]),c(()=>{const a=g.on("quote-management/shipping-address-set",l=>{const{quote:m}=l;d(m)},{eager:!0});return()=>a==null?void 0:a.off()},[]);const o=(i=n==null?void 0:n.shippingAddresses)==null?void 0:i[0];return s(q,{shippingAddress:o,loading:e,...r})};export{j as S};
3
+ import{jsx as a,jsxs as c}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as l}from"@dropins/tools/preact-compat.js";import{classes as u}from"@dropins/tools/lib.js";import{InLineAlert as f,Skeleton as h,SkeletonRow as q}from"@dropins/tools/components.js";import{S as _}from"./WarningFilled.js";import{useText as v}from"@dropins/tools/i18n.js";import{events as g}from"@dropins/tools/event-bus.js";const N=({className:i,shippingAddress:e,loading:m,noAddressMessage:p,...r})=>{const s=v({noAddressHeading:"NegotiableQuote.Manage.shippingAddress.noAddressHeading",noAddressDescription:"NegotiableQuote.Manage.shippingAddress.noAddressDescription"});return m?a(S,{}):e?c("div",{className:u(["quote-management-shipping-address-display",i]),"data-testid":"shipping-address-display",...r,children:[a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-name",children:c("span",{className:"quote-management-shipping-address-display__name",children:[e.firstname," ",e.lastname]})}),e.company&&a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-company",children:e.company}),e.street.map((o,t)=>a("div",{className:"quote-management-shipping-address-display__field","data-testid":`address-street-${t}`,children:o},t)),c("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-city-region",children:[e.city,e.region&&`, ${e.region.label}`," ",e.postcode]}),a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-country",children:e.country.label}),a("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-telephone",children:e.telephone})]}):a("div",{className:u(["quote-management-shipping-address-display","quote-management-shipping-address-display--empty",i]),"data-testid":"shipping-address-display-empty",...r,children:a(f,{type:"warning",variant:"primary","data-testid":"shipping-address-display-empty-alert",icon:a(_,{}),heading:s.noAddressHeading,description:p||s.noAddressDescription})})},S=()=>a(h,{"data-testid":"shipping-address-display-skeleton",children:a(q,{variant:"row",fullWidth:!0,size:"small",lines:5,multilineGap:"xsmall"})}),$=({shippingAddress:i,loading:e,...m})=>{const[p,r]=y(i);return l(()=>{i!==void 0&&r(i)},[i]),l(()=>{const s=g.on("quote-management/quote-data",o=>{var d,n;const t=(n=(d=o.quote)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),l(()=>{const s=g.on("quote-management/shipping-address-set",o=>{var d,n;const t=(n=(d=o.quote)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),l(()=>{const s=g.on("quote-management/quote-template-data",o=>{var d,n;const t=(n=(d=o.quoteTemplate)==null?void 0:d.shippingAddresses)==null?void 0:n[0];r(t)},{eager:!0});return()=>s==null?void 0:s.off()},[]),a(N,{shippingAddress:p,loading:e,...m})};export{$ as S};
4
4
  //# sourceMappingURL=ShippingAddressDisplay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShippingAddressDisplay.js","sources":["/@dropins/storefront-quote-management/src/components/ShippingAddressDisplay/ShippingAddressDisplay.tsx","/@dropins/storefront-quote-management/src/containers/ShippingAddressDisplay/ShippingAddressDisplay.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/ShippingAddressDisplay/ShippingAddressDisplay.css';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n noAddressMessage?: string;\n}\n\nexport const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps> = ({\n className,\n shippingAddress,\n loading,\n noAddressMessage,\n ...props\n}) => {\n const dictionary = useText({\n noAddress: 'NegotiableQuote.Manage.shippingAddress.noAddress',\n });\n\n if (loading) {\n return <ShippingAddressDisplaySkeleton />;\n }\n\n if (!shippingAddress) {\n return (\n <div \n className={classes(['quote-management-shipping-address-display', 'quote-management-shipping-address-display--empty', className])}\n data-testid=\"shipping-address-display-empty\"\n {...props}\n >\n <p className=\"quote-management-shipping-address-display__no-address\">\n {noAddressMessage || dictionary.noAddress}\n </p>\n </div>\n );\n }\n\n return (\n <div \n className={classes(['quote-management-shipping-address-display', className])}\n data-testid=\"shipping-address-display\"\n {...props}\n >\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-name\">\n <span className=\"quote-management-shipping-address-display__name\">\n {shippingAddress.firstname} {shippingAddress.lastname}\n </span>\n </div>\n \n {shippingAddress.company && (\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-company\">\n {shippingAddress.company}\n </div>\n )}\n \n {shippingAddress.street.map((line, index) => (\n <div \n key={index} \n className=\"quote-management-shipping-address-display__field\" \n data-testid={`address-street-${index}`}\n >\n {line}\n </div>\n ))}\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-city-region\">\n {shippingAddress.city}\n {shippingAddress.region && `, ${shippingAddress.region.label}`}\n {' '}\n {shippingAddress.postcode}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-country\">\n {shippingAddress.country.label}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-telephone\">\n {shippingAddress.telephone}\n </div>\n </div>\n );\n};\n\nexport const ShippingAddressDisplaySkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-address-display-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"small\" lines={5} multilineGap='xsmall' />\n </Skeleton>\n );\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { ShippingAddressDisplay as ShippingAddressDisplayComponent } from '@/quote-management/components/ShippingAddressDisplay';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n quoteData?: NegotiableQuoteModel;\n loading?: boolean;\n}\n\nexport const ShippingAddressDisplay: Container<ShippingAddressDisplayProps> = ({\n quoteData: initialQuoteData,\n loading,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(initialQuoteData);\n\n // Sync prop changes to internal state\n useEffect(() => {\n if (initialQuoteData !== undefined) {\n setQuoteData(initialQuoteData);\n }\n }, [initialQuoteData]);\n\n // Listen for quote-data events\n useEffect(() => {\n const quoteDataEvent = events.on('quote-management/quote-data', (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n }, {\n eager: true,\n });\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping-address-set events\n useEffect(() => {\n const shippingAddressSetEvent = events.on('quote-management/shipping-address-set', (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n }, {\n eager: true,\n });\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n const primaryShippingAddress = quoteData?.shippingAddresses?.[0];\n\n return (\n <ShippingAddressDisplayComponent\n shippingAddress={primaryShippingAddress}\n loading={loading}\n {...props}\n />\n );\n};\n\n"],"names":["ShippingAddressDisplay","className","shippingAddress","loading","noAddressMessage","props","dictionary","useText","ShippingAddressDisplaySkeleton","jsxs","classes","jsx","line","index","Skeleton","SkeletonRow","initialQuoteData","quoteData","setQuoteData","useState","useEffect","quoteDataEvent","events","data","quote","shippingAddressSetEvent","primaryShippingAddress","_a","ShippingAddressDisplayComponent"],"mappings":"8WAuBO,MAAMA,EAAyE,CAAC,CACrF,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,UAAW,kDAAA,CACZ,EAED,OAAIJ,IACMK,EAAA,EAA+B,EAGpCN,EAeHO,EAAC,MAAA,CACC,UAAWC,EAAQ,CAAC,4CAA6CT,CAAS,CAAC,EAC3E,cAAY,2BACX,GAAGI,EAEJ,SAAA,CAAAM,EAAC,MAAA,CAAI,UAAU,mDAAmD,cAAY,eAC5E,SAAAF,EAAC,OAAA,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GAAG,8BAAgCC,GAA0C,CACzG,KAAM,CAAE,MAAAC,GAAUD,EAClBL,EAAaM,CAAK,CACpB,EAAG,CACD,MAAO,EAAA,CACR,EACD,MAAO,IAAMH,GAAA,YAAAA,EAAgB,KAC/B,EAAG,CAAA,CAAE,EAGLD,EAAU,IAAM,CACd,MAAMK,EAA0BH,EAAO,GAAG,wCAA0CC,GAA0C,CAC5H,KAAM,CAAE,MAAAC,GAAUD,EAClBL,EAAaM,CAAK,CACpB,EAAG,CACD,MAAO,EAAA,CACR,EACD,MAAO,IAAMC,GAAA,YAAAA,EAAyB,KACxC,EAAG,CAAA,CAAE,EAEL,MAAMC,GAAyBC,EAAAV,GAAA,YAAAA,EAAW,oBAAX,YAAAU,EAA+B,GAE9D,OACEhB,EAACiB,EAAA,CACC,gBAAiBF,EACjB,QAAAvB,EACC,GAAGE,CAAA,CAAA,CAGV"}
1
+ {"version":3,"file":"ShippingAddressDisplay.js","sources":["/@dropins/storefront-quote-management/src/components/ShippingAddressDisplay/ShippingAddressDisplay.tsx","/@dropins/storefront-quote-management/src/containers/ShippingAddressDisplay/ShippingAddressDisplay.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { InLineAlert, Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/ShippingAddressDisplay/ShippingAddressDisplay.css';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n noAddressMessage?: string;\n}\n\nexport const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps> = ({\n className,\n shippingAddress,\n loading,\n noAddressMessage,\n ...props\n}) => {\n const dictionary = useText({\n noAddressHeading: 'NegotiableQuote.Manage.shippingAddress.noAddressHeading',\n noAddressDescription: 'NegotiableQuote.Manage.shippingAddress.noAddressDescription',\n });\n\n if (loading) {\n return <ShippingAddressDisplaySkeleton />;\n }\n\n if (!shippingAddress) {\n return (\n <div \n className={classes(['quote-management-shipping-address-display', 'quote-management-shipping-address-display--empty', className])}\n data-testid=\"shipping-address-display-empty\"\n {...props}\n >\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n data-testid=\"shipping-address-display-empty-alert\"\n icon={<WarningFilled />}\n heading={dictionary.noAddressHeading}\n description={noAddressMessage || dictionary.noAddressDescription}\n />\n </div>\n );\n }\n\n return (\n <div \n className={classes(['quote-management-shipping-address-display', className])}\n data-testid=\"shipping-address-display\"\n {...props}\n >\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-name\">\n <span className=\"quote-management-shipping-address-display__name\">\n {shippingAddress.firstname} {shippingAddress.lastname}\n </span>\n </div>\n \n {shippingAddress.company && (\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-company\">\n {shippingAddress.company}\n </div>\n )}\n \n {shippingAddress.street.map((line, index) => (\n <div \n key={index} \n className=\"quote-management-shipping-address-display__field\" \n data-testid={`address-street-${index}`}\n >\n {line}\n </div>\n ))}\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-city-region\">\n {shippingAddress.city}\n {shippingAddress.region && `, ${shippingAddress.region.label}`}\n {' '}\n {shippingAddress.postcode}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-country\">\n {shippingAddress.country.label}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-telephone\">\n {shippingAddress.telephone}\n </div>\n </div>\n );\n};\n\nexport const ShippingAddressDisplaySkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-address-display-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"small\" lines={5} multilineGap='xsmall' />\n </Skeleton>\n );\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { ShippingAddressDisplay as ShippingAddressDisplayComponent } from '@/quote-management/components/ShippingAddressDisplay';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n}\n\nexport const ShippingAddressDisplay: Container<ShippingAddressDisplayProps> = ({\n shippingAddress: initialShippingAddress,\n loading,\n ...props\n}) => {\n const [shippingAddress, setShippingAddress] = useState<ShippingAddress | undefined>(initialShippingAddress);\n\n // Sync prop changes to internal state\n useEffect(() => {\n if (initialShippingAddress !== undefined) {\n setShippingAddress(initialShippingAddress);\n }\n }, [initialShippingAddress]);\n\n // Listen for quote-data events\n useEffect(() => {\n const quoteDataEvent = events.on('quote-management/quote-data', (data: { quote?: { shippingAddresses?: ShippingAddress[] } | null }) => {\n const address = data.quote?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping-address-set events\n useEffect(() => {\n const shippingAddressSetEvent = events.on('quote-management/shipping-address-set', (data: { quote?: { shippingAddresses?: ShippingAddress[] } | null }) => {\n const address = data.quote?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n // Listen for quote-template-data events\n useEffect(() => {\n const quoteTemplateDataEvent = events.on('quote-management/quote-template-data', (data: { quoteTemplate?: NegotiableQuoteTemplateModel | null }) => {\n const address = data.quoteTemplate?.shippingAddresses?.[0];\n setShippingAddress(address);\n }, {\n eager: true,\n });\n return () => quoteTemplateDataEvent?.off();\n }, []);\n\n return (\n <ShippingAddressDisplayComponent\n shippingAddress={shippingAddress}\n loading={loading}\n {...props}\n />\n );\n};\n\n"],"names":["ShippingAddressDisplay","className","shippingAddress","loading","noAddressMessage","props","dictionary","useText","ShippingAddressDisplaySkeleton","jsxs","classes","jsx","line","index","InLineAlert","WarningFilled","Skeleton","SkeletonRow","initialShippingAddress","setShippingAddress","useState","useEffect","quoteDataEvent","events","data","address","_b","_a","shippingAddressSetEvent","quoteTemplateDataEvent","ShippingAddressDisplayComponent"],"mappings":"saAwBO,MAAMA,EAAyE,CAAC,CACrF,UAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,iBAAkB,0DAClB,qBAAsB,6DAAA,CACvB,EAED,OAAIJ,IACMK,EAAA,EAA+B,EAGpCN,EAoBHO,EAAC,MAAA,CACC,UAAWC,EAAQ,CAAC,4CAA6CT,CAAS,CAAC,EAC3E,cAAY,2BACX,GAAGI,EAEJ,SAAA,CAAAM,EAAC,MAAA,CAAI,UAAU,mDAAmD,cAAY,eAC5E,SAAAF,EAAC,OAAA,CAAK,UAAU,kDACb,SAAA,CAAAP,EAAgB,UAAU,IAAEA,EAAgB,QAAA,CAAA,CAC/C,CAAA,CACF,EAECA,EAAgB,SACfS,EAAC,MAAA,CAAI,UAAU,mDAAmD,cAAY,kBAC3E,SAAAT,EAAgB,OAAA,CACnB,EAGDA,EAAgB,OAAO,IAAI,CAACU,EAAMC,IACjCF,EAAC,MAAA,CAEC,UAAU,mDACV,cAAa,kBAAkBE,C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,GAAA,YAAAA,EAAgB,KAC/B,EAAG,CAAA,CAAE,EAGLD,EAAU,IAAM,CACd,MAAMO,EAA0BL,EAAO,GAAG,wCAA0CC,GAAuE,SACzJ,MAAMC,GAAUC,GAAAC,EAAAH,EAAK,QAAL,YAAAG,EAAY,oBAAZ,YAAAD,EAAgC,GAChDP,EAAmBM,CAAO,CAC5B,EAAG,CACD,MAAO,EAAA,CACR,EACD,MAAO,IAAMG,GAAA,YAAAA,EAAyB,KACxC,EAAG,CAAA,CAAE,EAGLP,EAAU,IAAM,CACd,MAAMQ,EAAyBN,EAAO,GAAG,uCAAyCC,GAAkE,SAClJ,MAAMC,GAAUC,GAAAC,EAAAH,EAAK,gBAAL,YAAAG,EAAoB,oBAApB,YAAAD,EAAwC,GACxDP,EAAmBM,CAAO,CAC5B,EAAG,CACD,MAAO,EAAA,CACR,EACD,MAAO,IAAMI,GAAA,YAAAA,EAAwB,KACvC,EAAG,CAAA,CAAE,EAGHlB,EAACmB,EAAA,CACC,gBAAA5B,EACA,QAAAC,EACC,GAAGE,CAAA,CAAA,CAGV"}
@@ -1,6 +1,26 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{events as i}from"@dropins/tools/event-bus.js";import{a as m}from"./transform-quote-template.js";import{s as a}from"./state.js";import{N as n}from"./NegotiableQuoteTemplateFragment.js";import{f as T}from"./transform-quote.js";const p=`
3
+ import{events as n}from"@dropins/tools/event-bus.js";import{a as u}from"./transform-quote-template.js";import{s as r}from"./state.js";import{N as T}from"./NegotiableQuoteTemplateFragment.js";import{f as p}from"./transform-quote.js";const s=`
4
+ mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(
5
+ $input: UpdateNegotiableQuoteTemplateQuantitiesInput!
6
+ ) {
7
+ updateNegotiableQuoteTemplateQuantities(input: $input) {
8
+ quote_template {
9
+ ...NegotiableQuoteTemplateFragment
10
+ }
11
+ }
12
+ }
13
+ ${T}
14
+ `,w=async e=>{var o,t;if(!e.templateId)throw new Error("Template ID is required");if(!e.items||e.items.length===0)throw new Error("Items array is required and must not be empty");if(!r.authenticated)throw new Error("Unauthorized");try{const a=await p(s,{variables:{input:{template_id:e.templateId,items:e.items.map(i=>({item_id:i.itemId,quantity:i.quantity,min_qty:i.minQty,max_qty:i.maxQty}))}}});if(!((t=(o=a==null?void 0:a.data)==null?void 0:o.updateNegotiableQuoteTemplateQuantities)!=null&&t.quote_template))throw new Error("No quote template data received");const m=u(a.data.updateNegotiableQuoteTemplateQuantities.quote_template);if(!m)throw new Error("Failed to transform quote template data");return n.emit("quote-management/quote-template-data",{quoteTemplate:m,permissions:r.permissions}),m}catch(a){return Promise.reject(a)}},E=`
15
+ mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(
16
+ $input: RemoveNegotiableQuoteTemplateItemsInput!
17
+ ) {
18
+ removeNegotiableQuoteTemplateItems(input: $input) {
19
+ ...NegotiableQuoteTemplateFragment
20
+ }
21
+ }
22
+ ${T}
23
+ `,c=async e=>{var o;if(!e.templateId)throw new Error("Template ID is required");if(!e.itemUids||e.itemUids.length===0)throw new Error("Item UIDs array is required and must not be empty");if(!r.authenticated)throw new Error("Unauthorized");try{const t=await p(E,{variables:{input:{template_id:e.templateId,item_uids:e.itemUids}}});if(!((o=t==null?void 0:t.data)!=null&&o.removeNegotiableQuoteTemplateItems))throw new Error("No quote template data received");const a=u(t.data.removeNegotiableQuoteTemplateItems);if(!a)throw new Error("Failed to transform quote template data");return n.emit("quote-management/quote-template-data",{quoteTemplate:a,permissions:r.permissions}),a}catch(t){return Promise.reject(t)}},d=`
4
24
  mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(
5
25
  $input: QuoteTemplateLineItemNoteInput!
6
26
  ) {
@@ -8,6 +28,6 @@ import{events as i}from"@dropins/tools/event-bus.js";import{a as m}from"./transf
8
28
  ...NegotiableQuoteTemplateFragment
9
29
  }
10
30
  }
11
- ${n}
12
- `,l=async t=>{var r;if(!t.templateId)throw new Error("Template ID is required");if(!t.itemId)throw new Error("Item ID is required");if(!a.authenticated)throw new Error("Unauthorized");try{const e=await T(p,{variables:{input:{templateId:t.templateId,item_id:t.itemId,note:t.note}}});if(!((r=e==null?void 0:e.data)!=null&&r.setQuoteTemplateLineItemNote))throw new Error("No quote template data received");const o=m(e.data.setQuoteTemplateLineItemNote);if(!o)throw new Error("Failed to transform quote template data");return i.emit("quote-management/quote-template-data",{quoteTemplate:o,permissions:a.permissions}),o}catch(e){return Promise.reject(e)}};export{l as a};
31
+ ${T}
32
+ `,f=async e=>{var o;if(!e.templateId)throw new Error("Template ID is required");if(!e.itemId)throw new Error("Item ID is required");if(!r.authenticated)throw new Error("Unauthorized");try{const t=await p(d,{variables:{input:{templateId:e.templateId,item_uid:e.itemId,note:e.note}}});if(!((o=t==null?void 0:t.data)!=null&&o.setQuoteTemplateLineItemNote))throw new Error("No quote template data received");const a=u(t.data.setQuoteTemplateLineItemNote);if(!a)throw new Error("Failed to transform quote template data");return n.emit("quote-management/quote-template-data",{quoteTemplate:a,permissions:r.permissions}),a}catch(t){return Promise.reject(t)}};export{f as a,c as r,w as u};
13
33
  //# sourceMappingURL=addQuoteTemplateLineItemNote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addQuoteTemplateLineItemNote.js","sources":["/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_id: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","addQuoteTemplateLineItemNote","params","state","results","fetchGraphQl","_a","transformedData","transformQuoteTemplate","events","error"],"mappings":"wOAWO,MAAMA,EAA2D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQpEC,CAAkC;AAAA,ECEzBC,EAA+B,MAC1CC,GACG,OACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAACA,EAAO,OACV,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzBN,EACA,CACE,UAAW,CACT,MAAO,CACL,WAAYG,EAAO,WACnB,QAASA,EAAO,OAChB,KAAMA,EAAO,IAAA,CACf,CACF,CACF,EAGF,GAAI,GAACI,EAAAF,GAAA,YAAAA,EAAS,OAAT,MAAAE,EAAe,8BAClB,MAAM,IAAI,MAAM,iCAAiC,EAGnD,MAAMC,EAAkBC,EACtBJ,EAAQ,KAAK,4BAAA,EAGf,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaJ,EAAM,WAAA,CACpB,EAEMI,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
1
+ {"version":3,"file":"addQuoteTemplateLineItemNote.js","sources":["/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/removeQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION = /* GraphQL */ `\n mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(\n $input: UpdateNegotiableQuoteTemplateQuantitiesInput!\n ) {\n updateNegotiableQuoteTemplateQuantities(input: $input) {\n quote_template {\n ...NegotiableQuoteTemplateFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION } from './graphql/updateNegotiableQuoteTemplateQuantities';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteTemplateItemQuantityInput {\n itemId: string;\n quantity: number;\n minQty?: number;\n maxQty?: number;\n}\n\nexport interface UpdateQuoteTemplateItemQuantitiesParams {\n templateId: string;\n items: NegotiableQuoteTemplateItemQuantityInput[];\n}\n\nexport const updateQuoteTemplateItemQuantities = async (\n params: UpdateQuoteTemplateItemQuantitiesParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.items || params.items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n items: params.items.map((item) => ({\n item_id: item.itemId,\n quantity: item.quantity,\n min_qty: item.minQty,\n max_qty: item.maxQty,\n })),\n },\n },\n }\n );\n\n if (\n !results?.data?.updateNegotiableQuoteTemplateQuantities?.quote_template\n ) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.updateNegotiableQuoteTemplateQuantities.quote_template\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION = /* GraphQL */ `\n mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(\n $input: RemoveNegotiableQuoteTemplateItemsInput!\n ) {\n removeNegotiableQuoteTemplateItems(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION } from './graphql/removeNegotiableQuoteTemplateItems';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RemoveQuoteTemplateItemsParams {\n templateId: string;\n itemUids: string[];\n}\n\nexport const removeQuoteTemplateItems = async (\n params: RemoveQuoteTemplateItemsParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemUids || params.itemUids.length === 0) {\n throw new Error('Item UIDs array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n item_uids: params.itemUids,\n },\n },\n }\n );\n\n if (!results?.data?.removeNegotiableQuoteTemplateItems) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.removeNegotiableQuoteTemplateItems\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_uid: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","updateQuoteTemplateItemQuantities","params","state","results","fetchGraphQl","item","_b","_a","transformedData","transformQuoteTemplate","events","error","REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION","removeQuoteTemplateItems","SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","addQuoteTemplateLineItemNote"],"mappings":"wOAWO,MAAMA,EAAqE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9EC,CAAkC;AAAA,ECMzBC,EAAoC,MAC/CC,GACG,SACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAACA,EAAO,OAASA,EAAO,MAAM,SAAW,EAC3C,MAAM,IAAI,MAAM,+CAA+C,EAGjE,GAAI,CAACC,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzBN,EACA,CACE,UAAW,CACT,MAAO,CACL,YAAaG,EAAO,WACpB,MAAOA,EAAO,MAAM,IAAKI,IAAU,CACjC,QAASA,EAAK,OACd,SAAUA,EAAK,SACf,QAASA,EAAK,OACd,QAASA,EAAK,MAAA,EACd,CAAA,CACJ,CACF,CACF,EAGF,GACE,GAACC,GAAAC,EAAAJ,GAAA,YAAAA,EAAS,OAAT,YAAAI,EAAe,0CAAf,MAAAD,EAAwD,gBAEzD,MAAM,IAAI,MAAM,iCAAiC,EAGnD,MAAME,EAAkBC,EACtBN,EAAQ,KAAK,wCAAwC,cAAA,EAGvD,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaN,EAAM,WAAA,CACpB,EAEMM,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF,ECxEaC,EAAgE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQzEb,CAAkC;AAAA,ECCzBc,EAA2B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C,EACtBN,EAAQ,KAAK,4BAAA,EAGf,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAAE,EAAO,KAAK,uCAAwC,CAClD,cAAeF,EACf,YAAaN,EAAM,WAAA,CACpB,EAEMM,CACT,OAASG,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
@@ -44,7 +44,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
44
44
  }
45
45
  }
46
46
  }
47
- `,M=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const a=Array.isArray(s)?s:[s];try{const e=await E(T,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const r=c.map(t=>t==null?void 0:t.message).filter(Boolean).join("; ");throw new Error(r||"Failed to delete negotiable quotes")}const i=(o=e==null?void 0:e.data)==null?void 0:o.deleteNegotiableQuotes;if(!i)throw new Error("No delete result returned");const n={resultStatus:i.result_status,operationResults:(i.operation_results||[]).map(r=>(r==null?void 0:r.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:r==null?void 0:r.quote_uid}:{__typename:"DeleteNegotiableQuoteOperationFailure",quoteUid:r==null?void 0:r.quote_uid,errors:((r==null?void 0:r.errors)||[]).map(u=>({__typename:u==null?void 0:u.__typename,message:u==null?void 0:u.message,uid:u==null?void 0:u.uid}))})},m=n.operationResults.filter(r=>r.__typename==="NegotiableQuoteUidOperationSuccess").map(r=>r.quoteUid);return m.length>0&&p.emit("quote-management/negotiable-quote-deleted",{deletedQuoteUids:m,resultStatus:n.resultStatus}),n}catch(e){return p.emit("quote-management/negotiable-quote-delete-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},f=`
47
+ `,M=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const a=Array.isArray(s)?s:[s];try{const e=await E(T,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const r=c.map(t=>t==null?void 0:t.message).filter(Boolean).join("; ");throw new Error(r||"Failed to delete negotiable quotes")}const m=(o=e==null?void 0:e.data)==null?void 0:o.deleteNegotiableQuotes;if(!m)throw new Error("No delete result returned");const i={resultStatus:m.result_status,operationResults:(m.operation_results||[]).map(r=>(r==null?void 0:r.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:r==null?void 0:r.quote_uid}:{__typename:"DeleteNegotiableQuoteOperationFailure",quoteUid:r==null?void 0:r.quote_uid,errors:((r==null?void 0:r.errors)||[]).map(u=>({__typename:u==null?void 0:u.__typename,message:u==null?void 0:u.message,uid:u==null?void 0:u.uid}))})},d=i.operationResults.filter(r=>r.__typename==="NegotiableQuoteUidOperationSuccess").map(r=>r.quoteUid);return d.length>0&&p.emit("quote-management/negotiable-quote-deleted",{deletedQuoteUids:d,resultStatus:i.resultStatus}),i}catch(e){return p.emit("quote-management/negotiable-quote-delete-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},f=`
48
48
  mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(
49
49
  $quoteUid: ID!
50
50
  $comment: NegotiableQuoteCommentInput
@@ -61,7 +61,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
61
61
  }
62
62
  }
63
63
  ${g}
64
- `,R=async s=>{const{quoteUid:a,comment:o,attachments:e}=s;if(!a)throw new Error("Quote UID is required");const c=e!=null&&e.length?{comment:o||"",attachments:e}:o?{comment:o}:null;return E(f,{variables:{quoteUid:a,comment:c}}).then(i=>{var r,t;const{errors:n}=i;if(n){const d=n.map(u=>u.message).join("; ");throw new Error(`Failed to send quote for review: ${d}`)}const m=q((t=(r=i.data)==null?void 0:r.sendNegotiableQuoteForReview)==null?void 0:t.quote);if(!m)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-sent-for-review",{quote:m,input:{quoteUid:a,comment:o,attachments:e}}),m})},w=`
64
+ `,R=async s=>{const{quoteUid:a,comment:o,attachments:e}=s;if(!a)throw new Error("Quote UID is required");const c=e!=null&&e.length?{comment:o||"",attachments:e}:o?{comment:o}:null;return E(f,{variables:{quoteUid:a,comment:c}}).then(m=>{var r,t;const{errors:i}=m;if(i){const n=i.map(u=>u.message).join("; ");throw new Error(`Failed to send quote for review: ${n}`)}const d=q((t=(r=m.data)==null?void 0:r.sendNegotiableQuoteForReview)==null?void 0:t.quote);if(!d)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-sent-for-review",{quote:d,input:{quoteUid:a,comment:o,attachments:e}}),d})},w=`
65
65
  mutation CLOSE_NEGOTIABLE_QUOTE_MUTATION(
66
66
  $quoteUids: [ID!]!
67
67
  ) {
@@ -91,7 +91,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
91
91
  }
92
92
  }
93
93
  }
94
- `,v=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const{quoteUids:a}=s;if(!a||a.length===0)throw new Error("Quote UIDs are required");try{const e=await E(w,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const t=c.map(d=>d==null?void 0:d.message).filter(Boolean).join("; ");throw new Error(t||"Failed to close negotiable quotes")}const i=(o=e==null?void 0:e.data)==null?void 0:o.closeNegotiableQuotes;if(!i)throw new Error("No close result returned");const n={resultStatus:i.result_status,operationResults:(i.operation_results||[]).map(t=>(t==null?void 0:t.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:t==null?void 0:t.quote_uid}:{__typename:"CloseNegotiableQuoteOperationFailure",quoteUid:t==null?void 0:t.quote_uid,errors:((t==null?void 0:t.errors)||[]).map(l=>({__typename:l==null?void 0:l.__typename,message:l==null?void 0:l.message,uid:l==null?void 0:l.uid}))})},m=n.operationResults.filter(t=>t.__typename==="CloseNegotiableQuoteOperationFailure").map(t=>t);if(m.length>0){const t=m.map(d=>d.errors&&d.errors.length>0?d.errors.map(u=>u.message||`Failed to close quote ${d.quoteUid}`).join(", "):`Failed to close quote ${d.quoteUid}`).join("; ");throw new Error(t)}const r=n.operationResults.filter(t=>t.__typename==="NegotiableQuoteUidOperationSuccess").map(t=>t.quoteUid);return r.length>0&&p.emit("quote-management/negotiable-quote-closed",{closedQuoteUids:r,resultStatus:n.resultStatus}),n}catch(e){return p.emit("quote-management/negotiable-quote-close-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},b=`
94
+ `,v=async s=>{var o;if(!_.authenticated)return Promise.reject(new Error("Unauthorized"));const{quoteUids:a}=s;if(!a||a.length===0)throw new Error("Quote UIDs are required");try{const e=await E(w,{variables:{quoteUids:a}}),{errors:c}=e||{};if(c&&c.length){const t=c.map(n=>n==null?void 0:n.message).filter(Boolean).join("; ");throw new Error(t||"Failed to close negotiable quotes")}const m=(o=e==null?void 0:e.data)==null?void 0:o.closeNegotiableQuotes;if(!m)throw new Error("No close result returned");const i={resultStatus:m.result_status,operationResults:(m.operation_results||[]).map(t=>(t==null?void 0:t.__typename)==="NegotiableQuoteUidOperationSuccess"?{__typename:"NegotiableQuoteUidOperationSuccess",quoteUid:t==null?void 0:t.quote_uid}:{__typename:"CloseNegotiableQuoteOperationFailure",quoteUid:t==null?void 0:t.quote_uid,errors:((t==null?void 0:t.errors)||[]).map(l=>({__typename:l==null?void 0:l.__typename,message:l==null?void 0:l.message,uid:l==null?void 0:l.uid}))})},d=i.operationResults.filter(t=>t.__typename==="CloseNegotiableQuoteOperationFailure").map(t=>t);if(d.length>0){const t=d.map(n=>n.errors&&n.errors.length>0?n.errors.map(u=>u.message||`Failed to close quote ${n.quoteUid}`).join(", "):`Failed to close quote ${n.quoteUid}`).join("; ");throw new Error(t)}const r=i.operationResults.filter(t=>t.__typename==="NegotiableQuoteUidOperationSuccess").map(t=>t.quoteUid);return r.length>0&&p.emit("quote-management/negotiable-quote-closed",{closedQuoteUids:r,resultStatus:i.resultStatus}),i}catch(e){return p.emit("quote-management/negotiable-quote-close-error",{error:e instanceof Error?e:new Error(String(e)),attemptedQuoteUids:a}),Promise.reject(e)}},b=`
95
95
  mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {
96
96
  requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {
97
97
  ...NegotiableQuoteTemplateFragment
@@ -108,7 +108,7 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
108
108
  }
109
109
  }
110
110
  ${g}
111
- `,j=async s=>{const{quoteUid:a,quoteName:o,quoteComment:e}=s;if(!a)throw new Error("Quote UID is required");if(!o)throw new Error("Quote name is required");return E(I,{variables:{input:{quote_uid:a,quote_name:o,quote_comment:e||""}}}).then(i=>{var r,t;const{errors:n}=i;if(n){const d=n.map(u=>u.message).join("; ");throw new Error(`Failed to rename quote: ${d}`)}const m=q((t=(r=i.data)==null?void 0:r.renameNegotiableQuote)==null?void 0:t.quote);if(!m)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-renamed",{quote:m,input:{quoteUid:a,quoteName:o,quoteComment:e}}),m})},h=`
111
+ `,j=async s=>{const{quoteUid:a,quoteName:o,quoteComment:e}=s;if(!a)throw new Error("Quote UID is required");if(!o)throw new Error("Quote name is required");return E(I,{variables:{input:{quote_uid:a,quote_name:o,quote_comment:e||""}}}).then(m=>{var r,t;const{errors:i}=m;if(i){const n=i.map(u=>u.message).join("; ");throw new Error(`Failed to rename quote: ${n}`)}const d=q((t=(r=m.data)==null?void 0:r.renameNegotiableQuote)==null?void 0:t.quote);if(!d)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-renamed",{quote:d,input:{quoteUid:a,quoteName:o,quoteComment:e}}),d})},O=`
112
112
  mutation DUPLICATE_NEGOTIABLE_QUOTE_MUTATION($quoteUid: ID!, $duplicatedQuoteUid: ID!) {
113
113
  duplicateNegotiableQuote(input: { quote_uid: $quoteUid, duplicated_quote_uid: $duplicatedQuoteUid }) {
114
114
  quote {
@@ -117,5 +117,5 @@ import{events as p}from"@dropins/tools/event-bus.js";import{f as E,t as q}from".
117
117
  }
118
118
  }
119
119
  ${g}
120
- `,P=async s=>{if(!_.authenticated)throw new Error("Unauthorized");const{quoteUid:a,duplicatedQuoteUid:o}=s;if(!a||!a.trim())throw new Error("Quote UID is required");if(!o||!o.trim())throw new Error("Duplicated Quote UID is required");return E(h,{variables:{quoteUid:a,duplicatedQuoteUid:o}}).then(e=>{var n,m;const{errors:c}=e;if(c){const r=c.map(t=>t.message).join("; ");throw new Error(`Failed to duplicate quote: ${r}`)}const i=q((m=(n=e.data)==null?void 0:n.duplicateNegotiableQuote)==null?void 0:m.quote);if(!i)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-duplicated",{quote:i,input:{quoteUid:a,duplicatedQuoteUid:o}}),i})};export{L as a,P as b,v as c,M as d,S as g,j as r,R as s};
120
+ `,P=async s=>{if(!_.authenticated)throw new Error("Unauthorized");const{quoteUid:a,duplicatedQuoteUid:o,hasOutOfStockItems:e}=s;if(!a||!a.trim())throw new Error("Quote UID is required");if(!o||!o.trim())throw new Error("Duplicated Quote UID is required");return E(O,{variables:{quoteUid:a,duplicatedQuoteUid:o}}).then(c=>{var d,r;const{errors:m}=c;if(m){const t=m.map(n=>n.message).join("; ");throw new Error(`Failed to duplicate quote: ${t}`)}const i=q((r=(d=c.data)==null?void 0:d.duplicateNegotiableQuote)==null?void 0:r.quote);if(!i)throw new Error("Failed to transform quote data: Invalid response structure");return p.emit("quote-management/quote-duplicated",{quote:i,input:{quoteUid:a,duplicatedQuoteUid:o},hasOutOfStockItems:e}),i})};export{L as a,P as b,v as c,M as d,S as g,j as r,R as s};
121
121
  //# sourceMappingURL=duplicateNegotiableQuote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"duplicateNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/api/getQuoteData/graphql/QuoteDataQuery.ts","/@dropins/storefront-quote-management/src/api/getQuoteData/getQuoteData.ts","/@dropins/storefront-quote-management/src/api/deleteQuote/graphql/DeleteQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/deleteQuote/deleteQuote.ts","/@dropins/storefront-quote-management/src/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.ts","/@dropins/storefront-quote-management/src/api/sendForReview/sendForReview.ts","/@dropins/storefront-quote-management/src/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/closeNegotiableQuote/closeNegotiableQuote.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/graphql/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/renameNegotiableQuote/renameNegotiableQuote.ts","/@dropins/storefront-quote-management/src/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/duplicateNegotiableQuote/duplicateNegotiableQuote.ts"],"sourcesContent":["import { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const QUOTE_DATA_QUERY = `\n query QUOTE_DATA_QUERY(\n $quoteId: ID!\n ) {\n negotiableQuote(\n uid: $quoteId\n ) {\n ...NegotiableQuoteFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { QUOTE_DATA_QUERY } from './graphql/QuoteDataQuery';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getQuoteData = async (quoteId: string) => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n if (!state.permissions.editQuote) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(QUOTE_DATA_QUERY, {\n variables: {\n quoteId\n }\n });\n\n const transformedQuote = transformQuote(results?.data?.negotiableQuote);\n\n if (!transformedQuote) {\n throw new Error('Failed to transform quote data');\n }\n\n events.emit('quote-management/quote-data', {\n quote: transformedQuote,\n permissions: state.permissions,\n });\n \n return transformedQuote;\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const DELETE_QUOTE_MUTATION = `\n mutation DELETE_QUOTE_MUTATION($quoteUids: [ID!]!) {\n deleteNegotiableQuotes(\n input: {\n quote_uids: $quoteUids\n }\n ) {\n result_status\n operation_results {\n __typename\n ... on NegotiableQuoteUidOperationSuccess {\n quote_uid\n }\n ... on DeleteNegotiableQuoteOperationFailure {\n quote_uid\n errors {\n __typename\n ... on ErrorInterface {\n message\n }\n ... on NoSuchEntityUidError {\n uid\n message\n }\n ... on NegotiableQuoteInvalidStateError {\n message\n }\n }\n }\n }\n }\n }\n`;\n\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { fetchGraphQl } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\nimport { DELETE_QUOTE_MUTATION } from '@/quote-management/api/deleteQuote/graphql/DeleteQuoteMutation';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface DeleteQuoteSuccessResult {\n __typename: 'NegotiableQuoteUidOperationSuccess';\n quoteUid: string;\n}\n\nexport interface DeleteQuoteFailureError {\n __typename: string;\n message?: string;\n uid?: string;\n}\n\nexport interface DeleteQuoteFailureResult {\n __typename: 'DeleteNegotiableQuoteOperationFailure';\n quoteUid: string;\n errors: DeleteQuoteFailureError[];\n}\n\nexport interface DeleteQuoteOutput {\n resultStatus: string;\n operationResults: Array<DeleteQuoteSuccessResult | DeleteQuoteFailureResult>;\n}\n\nexport const deleteQuote = async ( quoteUids: string[] | string ): Promise<DeleteQuoteOutput> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const quoteUidsArray = Array.isArray(quoteUids) ? quoteUids : [quoteUids];\n\n try {\n const response: any = await fetchGraphQl(DELETE_QUOTE_MUTATION, {\n variables: {\n quoteUids: quoteUidsArray,\n },\n });\n\n const { errors } = response || {};\n if (errors && errors.length) {\n const errorMessages = errors.map((e: any) => e?.message).filter(Boolean).join('; ');\n throw new Error(errorMessages || 'Failed to delete negotiable quotes');\n }\n\n const raw = response?.data?.deleteNegotiableQuotes;\n if (!raw) {\n throw new Error('No delete result returned');\n }\n\n const transformed: DeleteQuoteOutput = {\n resultStatus: raw.result_status,\n operationResults: (raw.operation_results || []).map((result: any) => {\n const typename = result?.__typename;\n if (typename === 'NegotiableQuoteUidOperationSuccess') {\n const success: DeleteQuoteSuccessResult = {\n __typename: 'NegotiableQuoteUidOperationSuccess',\n quoteUid: result?.quote_uid,\n };\n return success;\n }\n const failure: DeleteQuoteFailureResult = {\n __typename: 'DeleteNegotiableQuoteOperationFailure',\n quoteUid: result?.quote_uid,\n errors: (result?.errors || []).map((err: any) => ({\n __typename: err?.__typename,\n message: err?.message,\n uid: err?.uid,\n })),\n };\n return failure;\n }),\n };\n\n // Emit event with successfully deleted quote UIDs\n const deletedUids = transformed.operationResults\n .filter((res) => res.__typename === 'NegotiableQuoteUidOperationSuccess')\n .map((res) => (res as DeleteQuoteSuccessResult).quoteUid);\n\n if (deletedUids.length > 0) {\n events.emit('quote-management/negotiable-quote-deleted', {\n deletedQuoteUids: deletedUids,\n resultStatus: transformed.resultStatus,\n });\n }\n\n return transformed;\n } catch (error) {\n // Emit error event for integration layer\n events.emit('quote-management/negotiable-quote-delete-error', {\n error: error instanceof Error ? error : new Error(String(error)),\n attemptedQuoteUids: quoteUidsArray,\n });\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION = `\n mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(\n $quoteUid: ID!\n $comment: NegotiableQuoteCommentInput\n ) {\n sendNegotiableQuoteForReview(\n input: {\n quote_uid: $quoteUid\n comment: $comment\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION } from './graphql/SendNegotiableQuoteForReviewMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface SendForReviewInput {\n quoteUid: string;\n comment?: string;\n attachments?: { key: string }[];\n}\n\nexport const sendForReview = async (\n input: SendForReviewInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, comment, attachments } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Build the comment object with attachments if provided\n const commentInput = attachments?.length \n ? { comment: comment || '', attachments } \n : comment \n ? { comment } \n : null;\n\n return fetchGraphQl(SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION, {\n variables: {\n quoteUid,\n comment: commentInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to send quote for review: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.sendNegotiableQuoteForReview?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quote-sent-for-review', {\n quote: quoteData,\n input: { quoteUid, comment, attachments },\n });\n\n return quoteData;\n });\n};\n\n","export const CLOSE_NEGOTIABLE_QUOTE_MUTATION = `\n mutation CLOSE_NEGOTIABLE_QUOTE_MUTATION(\n $quoteUids: [ID!]!\n ) {\n closeNegotiableQuotes(input: { quote_uids: $quoteUids }) {\n result_status\n operation_results {\n ... on NegotiableQuoteUidOperationSuccess {\n __typename\n quote_uid\n }\n ... on CloseNegotiableQuoteOperationFailure {\n __typename\n quote_uid\n errors {\n __typename\n ... on ErrorInterface {\n message\n }\n ... on NoSuchEntityUidError {\n uid\n }\n ... on NegotiableQuoteInvalidStateError {\n message\n }\n }\n }\n }\n }\n }\n`;","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\nimport { CLOSE_NEGOTIABLE_QUOTE_MUTATION } from './graphql/CloseNegotiableQuoteMutation';\n\nexport interface CloseNegotiableQuoteInput {\n quoteUids: string[];\n}\n\nexport interface CloseNegotiableQuoteSuccessResult {\n __typename: 'NegotiableQuoteUidOperationSuccess';\n quoteUid: string;\n}\n\nexport interface CloseNegotiableQuoteFailureError {\n __typename: string;\n message?: string;\n uid?: string;\n}\n\nexport interface CloseNegotiableQuoteFailureResult {\n __typename: 'CloseNegotiableQuoteOperationFailure';\n quoteUid: string;\n errors: CloseNegotiableQuoteFailureError[];\n}\n\nexport interface CloseNegotiableQuoteResult {\n resultStatus: string;\n operationResults: Array<CloseNegotiableQuoteSuccessResult | CloseNegotiableQuoteFailureResult>;\n}\n\nexport const closeNegotiableQuote = async (input: CloseNegotiableQuoteInput): Promise<CloseNegotiableQuoteResult> => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const { quoteUids } = input;\n\n if (!quoteUids || quoteUids.length === 0) {\n throw new Error('Quote UIDs are required');\n }\n\n try {\n const response: any = await fetchGraphQl(CLOSE_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n quoteUids,\n },\n });\n\n const { errors } = response || {};\n if (errors && errors.length) {\n const errorMessages = errors\n .map((e: any) => e?.message)\n .filter(Boolean)\n .join('; ');\n throw new Error(errorMessages || 'Failed to close negotiable quotes');\n }\n\n const raw = response?.data?.closeNegotiableQuotes;\n if (!raw) {\n throw new Error('No close result returned');\n }\n\n const transformed: CloseNegotiableQuoteResult = {\n resultStatus: raw.result_status,\n operationResults: (raw.operation_results || []).map((result: any) => {\n const typename = result?.__typename;\n if (typename === 'NegotiableQuoteUidOperationSuccess') {\n const success: CloseNegotiableQuoteSuccessResult = {\n __typename: 'NegotiableQuoteUidOperationSuccess',\n quoteUid: result?.quote_uid,\n };\n return success;\n }\n const failure: CloseNegotiableQuoteFailureResult = {\n __typename: 'CloseNegotiableQuoteOperationFailure',\n quoteUid: result?.quote_uid,\n errors: (result?.errors || []).map((err: any) => ({\n __typename: err?.__typename,\n message: err?.message,\n uid: err?.uid,\n })),\n };\n return failure;\n }),\n };\n\n // Check for operation failures\n const failures = transformed.operationResults\n .filter(\n (res) => res.__typename === 'CloseNegotiableQuoteOperationFailure'\n )\n .map((res) => res as CloseNegotiableQuoteFailureResult);\n\n if (failures.length > 0) {\n // Create error message from failures\n const failureMessages = failures\n .map((failure) => {\n if (failure.errors && failure.errors.length > 0) {\n return failure.errors\n .map(\n (err) =>\n err.message || `Failed to close quote ${failure.quoteUid}`\n )\n .join(', ');\n }\n return `Failed to close quote ${failure.quoteUid}`;\n })\n .join('; ');\n\n throw new Error(failureMessages);\n }\n\n // Emit success event with closed quote UIDs\n const closedUids = transformed.operationResults\n .filter((res) => res.__typename === 'NegotiableQuoteUidOperationSuccess')\n .map((res) => (res as CloseNegotiableQuoteSuccessResult).quoteUid);\n\n if (closedUids.length > 0) {\n events.emit('quote-management/negotiable-quote-closed', {\n closedQuoteUids: closedUids,\n resultStatus: transformed.resultStatus,\n });\n }\n\n return transformed;\n } catch (error) {\n // Emit error event for integration layer\n events.emit('quote-management/negotiable-quote-close-error', {\n error: error instanceof Error ? error : new Error(String(error)),\n attemptedQuoteUids: quoteUids,\n });\n return Promise.reject(error);\n }\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from \"../../graphql/NegotiableQuoteTemplateFragment\";\n\nexport const CREATE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {\n requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { CREATE_QUOTE_TEMPLATE_MUTATION } from './graphql/createQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\n\nexport const createQuoteTemplate = async (\n quoteId: string\n): Promise<NegotiableQuoteTemplateModel | null> => {\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!quoteId) {\n throw new Error('Cart ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(CREATE_QUOTE_TEMPLATE_MUTATION, {\n variables: {\n cartId: quoteId,\n },\n });\n\n if (!results?.data?.requestNegotiableQuoteTemplateFromQuote) {\n throw new Error('Failed to create quote template');\n }\n\n const transformedQuoteTemplate = transformQuoteTemplate(\n results.data.requestNegotiableQuoteTemplateFromQuote\n );\n\n if (!transformedQuoteTemplate) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedQuoteTemplate,\n permissions: state.permissions,\n });\n\n return transformedQuoteTemplate;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const RENAME_NEGOTIABLE_QUOTE_MUTATION = `\n mutation renameNegotiableQuote($input: RenameNegotiableQuoteInput!) {\n renameNegotiableQuote(input: $input) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { RENAME_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RenameNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RenameNegotiableQuoteInput {\n quoteUid: string;\n quoteName: string;\n quoteComment?: string;\n}\n\nexport const renameNegotiableQuote = async (\n input: RenameNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, quoteName, quoteComment } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n // Backend requires quote_comment to be present (even if empty string)\n const mutationInput = {\n quote_uid: quoteUid,\n quote_name: quoteName,\n quote_comment: quoteComment || '', // Always include, use empty string if not provided\n };\n\n return fetchGraphQl(RENAME_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n input: mutationInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to rename quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.renameNegotiableQuote?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quote-renamed', {\n quote: quoteData,\n input: { quoteUid, quoteName, quoteComment },\n });\n\n return quoteData;\n });\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const DUPLICATE_NEGOTIABLE_QUOTE_MUTATION = `\n mutation DUPLICATE_NEGOTIABLE_QUOTE_MUTATION($quoteUid: ID!, $duplicatedQuoteUid: ID!) {\n duplicateNegotiableQuote(input: { quote_uid: $quoteUid, duplicated_quote_uid: $duplicatedQuoteUid }) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { DUPLICATE_NEGOTIABLE_QUOTE_MUTATION } from './graphql/duplicateNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport interface DuplicateQuoteInput {\n quoteUid: string;\n duplicatedQuoteUid: string;\n}\n\nexport const duplicateQuote = async (\n input: DuplicateQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n const { quoteUid, duplicatedQuoteUid } = input;\n\n if (!quoteUid || !quoteUid.trim()) {\n throw new Error('Quote UID is required');\n }\n\n if (!duplicatedQuoteUid || !duplicatedQuoteUid.trim()) {\n throw new Error('Duplicated Quote UID is required');\n }\n\n return fetchGraphQl(DUPLICATE_NEGOTIABLE_QUOTE_MUTATION, {\n variables: { quoteUid, duplicatedQuoteUid },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to duplicate quote: ${errorMessages}`);\n }\n\n const quoteData = transformQuote(\n response.data?.duplicateNegotiableQuote?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n events.emit('quote-management/quote-duplicated', {\n quote: quoteData,\n input: { quoteUid, duplicatedQuoteUid },\n });\n\n return quoteData;\n });\n};\n"],"names":["QUOTE_DATA_QUERY","NEGOTIABLE_QUOTE_FRAGMENT","getQuoteData","quoteId","state","results","fetchGraphQl","transformedQuote","transformQuote","_a","events","error","DELETE_QUOTE_MUTATION","deleteQuote","quoteUids","quoteUidsArray","response","errors","errorMessages","e","raw","transformed","result","err","deletedUids","res","SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION","sendForReview","input","quoteUid","comment","attachments","commentInput","quoteData","_b","CLOSE_NEGOTIABLE_QUOTE_MUTATION","closeNegotiableQuote","failures","failureMessages","failure","closedUids","CREATE_QUOTE_TEMPLATE_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","createQuoteTemplate","transformedQuoteTemplate","transformQuoteTemplate","RENAME_NEGOTIABLE_QUOTE_MUTATION","renameNegotiableQuote","quoteName","quoteComment","DUPLICATE_NEGOTIABLE_QUOTE_MUTATION","duplicateQuote","duplicatedQuoteUid"],"mappings":"gSAEO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAW1BC,CAAyB;AAAA,ECElBC,EAAe,MAAOC,GAAoB,OACnD,GAAI,CAACC,EAAM,cACP,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,CAAC,EAGnD,GAAI,CAACA,EAAM,YAAY,UACnB,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,CAAC,EAGnD,GAAI,CACA,MAAMC,EAAe,MAAMC,EAAaN,EAAkB,CACtD,UAAW,CACP,QAAAG,CAAA,CACJ,CACH,EAEKI,EAAmBC,GAAeC,EAAAJ,GAAA,YAAAA,EAAS,OAAT,YAAAI,EAAe,eAAe,EAEtE,GAAI,CAACF,EACD,MAAM,IAAI,MAAM,gCAAgC,EAGpD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getQuoteData/graphql/QuoteDataQuery.ts","/@dropins/storefront-quote-management/src/api/getQuoteData/getQuoteData.ts","/@dropins/storefront-quote-management/src/api/deleteQuote/graphql/DeleteQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/deleteQuote/deleteQuote.ts","/@dropins/storefront-quote-management/src/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.ts","/@dropins/storefront-quote-management/src/api/sendForReview/sendForReview.ts","/@dropins/storefront-quote-management/src/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/closeNegotiableQuote/closeNegotiableQuote.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/graphql/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/renameNegotiableQuote/renameNegotiableQuote.ts","/@dropins/storefront-quote-management/src/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/duplicateNegotiableQuote/duplicateNegotiableQuote.ts"],"sourcesContent":["import { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const QUOTE_DATA_QUERY = `\n query QUOTE_DATA_QUERY(\n $quoteId: ID!\n ) {\n negotiableQuote(\n uid: $quoteId\n ) {\n ...NegotiableQuoteFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { QUOTE_DATA_QUERY } from './graphql/QuoteDataQuery';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getQuoteData = async (quoteId: string) => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n if (!state.permissions.editQuote) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(QUOTE_DATA_QUERY, {\n variables: {\n quoteId\n }\n });\n\n const transformedQuote = transformQuote(results?.data?.negotiableQuote);\n\n if (!transformedQuote) {\n throw new Error('Failed to transform quote data');\n }\n\n events.emit('quote-management/quote-data', {\n quote: transformedQuote,\n permissions: state.permissions,\n });\n \n return transformedQuote;\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const DELETE_QUOTE_MUTATION = `\n mutation DELETE_QUOTE_MUTATION($quoteUids: [ID!]!) {\n deleteNegotiableQuotes(\n input: {\n quote_uids: $quoteUids\n }\n ) {\n result_status\n operation_results {\n __typename\n ... on NegotiableQuoteUidOperationSuccess {\n quote_uid\n }\n ... on DeleteNegotiableQuoteOperationFailure {\n quote_uid\n errors {\n __typename\n ... on ErrorInterface {\n message\n }\n ... on NoSuchEntityUidError {\n uid\n message\n }\n ... on NegotiableQuoteInvalidStateError {\n message\n }\n }\n }\n }\n }\n }\n`;\n\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { fetchGraphQl } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\nimport { DELETE_QUOTE_MUTATION } from '@/quote-management/api/deleteQuote/graphql/DeleteQuoteMutation';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface DeleteQuoteSuccessResult {\n __typename: 'NegotiableQuoteUidOperationSuccess';\n quoteUid: string;\n}\n\nexport interface DeleteQuoteFailureError {\n __typename: string;\n message?: string;\n uid?: string;\n}\n\nexport interface DeleteQuoteFailureResult {\n __typename: 'DeleteNegotiableQuoteOperationFailure';\n quoteUid: string;\n errors: DeleteQuoteFailureError[];\n}\n\nexport interface DeleteQuoteOutput {\n resultStatus: string;\n operationResults: Array<DeleteQuoteSuccessResult | DeleteQuoteFailureResult>;\n}\n\nexport const deleteQuote = async ( quoteUids: string[] | string ): Promise<DeleteQuoteOutput> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const quoteUidsArray = Array.isArray(quoteUids) ? quoteUids : [quoteUids];\n\n try {\n const response: any = await fetchGraphQl(DELETE_QUOTE_MUTATION, {\n variables: {\n quoteUids: quoteUidsArray,\n },\n });\n\n const { errors } = response || {};\n if (errors && errors.length) {\n const errorMessages = errors.map((e: any) => e?.message).filter(Boolean).join('; ');\n throw new Error(errorMessages || 'Failed to delete negotiable quotes');\n }\n\n const raw = response?.data?.deleteNegotiableQuotes;\n if (!raw) {\n throw new Error('No delete result returned');\n }\n\n const transformed: DeleteQuoteOutput = {\n resultStatus: raw.result_status,\n operationResults: (raw.operation_results || []).map((result: any) => {\n const typename = result?.__typename;\n if (typename === 'NegotiableQuoteUidOperationSuccess') {\n const success: DeleteQuoteSuccessResult = {\n __typename: 'NegotiableQuoteUidOperationSuccess',\n quoteUid: result?.quote_uid,\n };\n return success;\n }\n const failure: DeleteQuoteFailureResult = {\n __typename: 'DeleteNegotiableQuoteOperationFailure',\n quoteUid: result?.quote_uid,\n errors: (result?.errors || []).map((err: any) => ({\n __typename: err?.__typename,\n message: err?.message,\n uid: err?.uid,\n })),\n };\n return failure;\n }),\n };\n\n // Emit event with successfully deleted quote UIDs\n const deletedUids = transformed.operationResults\n .filter((res) => res.__typename === 'NegotiableQuoteUidOperationSuccess')\n .map((res) => (res as DeleteQuoteSuccessResult).quoteUid);\n\n if (deletedUids.length > 0) {\n events.emit('quote-management/negotiable-quote-deleted', {\n deletedQuoteUids: deletedUids,\n resultStatus: transformed.resultStatus,\n });\n }\n\n return transformed;\n } catch (error) {\n // Emit error event for integration layer\n events.emit('quote-management/negotiable-quote-delete-error', {\n error: error instanceof Error ? error : new Error(String(error)),\n attemptedQuoteUids: quoteUidsArray,\n });\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION = `\n mutation SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION(\n $quoteUid: ID!\n $comment: NegotiableQuoteCommentInput\n ) {\n sendNegotiableQuoteForReview(\n input: {\n quote_uid: $quoteUid\n comment: $comment\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION } from './graphql/SendNegotiableQuoteForReviewMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface SendForReviewInput {\n quoteUid: string;\n comment?: string;\n attachments?: { key: string }[];\n}\n\nexport const sendForReview = async (\n input: SendForReviewInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, comment, attachments } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Build the comment object with attachments if provided\n const commentInput = attachments?.length \n ? { comment: comment || '', attachments } \n : comment \n ? { comment } \n : null;\n\n return fetchGraphQl(SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION, {\n variables: {\n quoteUid,\n comment: commentInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to send quote for review: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.sendNegotiableQuoteForReview?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quote-sent-for-review', {\n quote: quoteData,\n input: { quoteUid, comment, attachments },\n });\n\n return quoteData;\n });\n};\n\n","export const CLOSE_NEGOTIABLE_QUOTE_MUTATION = `\n mutation CLOSE_NEGOTIABLE_QUOTE_MUTATION(\n $quoteUids: [ID!]!\n ) {\n closeNegotiableQuotes(input: { quote_uids: $quoteUids }) {\n result_status\n operation_results {\n ... on NegotiableQuoteUidOperationSuccess {\n __typename\n quote_uid\n }\n ... on CloseNegotiableQuoteOperationFailure {\n __typename\n quote_uid\n errors {\n __typename\n ... on ErrorInterface {\n message\n }\n ... on NoSuchEntityUidError {\n uid\n }\n ... on NegotiableQuoteInvalidStateError {\n message\n }\n }\n }\n }\n }\n }\n`;","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\nimport { CLOSE_NEGOTIABLE_QUOTE_MUTATION } from './graphql/CloseNegotiableQuoteMutation';\n\nexport interface CloseNegotiableQuoteInput {\n quoteUids: string[];\n}\n\nexport interface CloseNegotiableQuoteSuccessResult {\n __typename: 'NegotiableQuoteUidOperationSuccess';\n quoteUid: string;\n}\n\nexport interface CloseNegotiableQuoteFailureError {\n __typename: string;\n message?: string;\n uid?: string;\n}\n\nexport interface CloseNegotiableQuoteFailureResult {\n __typename: 'CloseNegotiableQuoteOperationFailure';\n quoteUid: string;\n errors: CloseNegotiableQuoteFailureError[];\n}\n\nexport interface CloseNegotiableQuoteResult {\n resultStatus: string;\n operationResults: Array<CloseNegotiableQuoteSuccessResult | CloseNegotiableQuoteFailureResult>;\n}\n\nexport const closeNegotiableQuote = async (input: CloseNegotiableQuoteInput): Promise<CloseNegotiableQuoteResult> => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const { quoteUids } = input;\n\n if (!quoteUids || quoteUids.length === 0) {\n throw new Error('Quote UIDs are required');\n }\n\n try {\n const response: any = await fetchGraphQl(CLOSE_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n quoteUids,\n },\n });\n\n const { errors } = response || {};\n if (errors && errors.length) {\n const errorMessages = errors\n .map((e: any) => e?.message)\n .filter(Boolean)\n .join('; ');\n throw new Error(errorMessages || 'Failed to close negotiable quotes');\n }\n\n const raw = response?.data?.closeNegotiableQuotes;\n if (!raw) {\n throw new Error('No close result returned');\n }\n\n const transformed: CloseNegotiableQuoteResult = {\n resultStatus: raw.result_status,\n operationResults: (raw.operation_results || []).map((result: any) => {\n const typename = result?.__typename;\n if (typename === 'NegotiableQuoteUidOperationSuccess') {\n const success: CloseNegotiableQuoteSuccessResult = {\n __typename: 'NegotiableQuoteUidOperationSuccess',\n quoteUid: result?.quote_uid,\n };\n return success;\n }\n const failure: CloseNegotiableQuoteFailureResult = {\n __typename: 'CloseNegotiableQuoteOperationFailure',\n quoteUid: result?.quote_uid,\n errors: (result?.errors || []).map((err: any) => ({\n __typename: err?.__typename,\n message: err?.message,\n uid: err?.uid,\n })),\n };\n return failure;\n }),\n };\n\n // Check for operation failures\n const failures = transformed.operationResults\n .filter(\n (res) => res.__typename === 'CloseNegotiableQuoteOperationFailure'\n )\n .map((res) => res as CloseNegotiableQuoteFailureResult);\n\n if (failures.length > 0) {\n // Create error message from failures\n const failureMessages = failures\n .map((failure) => {\n if (failure.errors && failure.errors.length > 0) {\n return failure.errors\n .map(\n (err) =>\n err.message || `Failed to close quote ${failure.quoteUid}`\n )\n .join(', ');\n }\n return `Failed to close quote ${failure.quoteUid}`;\n })\n .join('; ');\n\n throw new Error(failureMessages);\n }\n\n // Emit success event with closed quote UIDs\n const closedUids = transformed.operationResults\n .filter((res) => res.__typename === 'NegotiableQuoteUidOperationSuccess')\n .map((res) => (res as CloseNegotiableQuoteSuccessResult).quoteUid);\n\n if (closedUids.length > 0) {\n events.emit('quote-management/negotiable-quote-closed', {\n closedQuoteUids: closedUids,\n resultStatus: transformed.resultStatus,\n });\n }\n\n return transformed;\n } catch (error) {\n // Emit error event for integration layer\n events.emit('quote-management/negotiable-quote-close-error', {\n error: error instanceof Error ? error : new Error(String(error)),\n attemptedQuoteUids: quoteUids,\n });\n return Promise.reject(error);\n }\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from \"../../graphql/NegotiableQuoteTemplateFragment\";\n\nexport const CREATE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {\n requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { CREATE_QUOTE_TEMPLATE_MUTATION } from './graphql/createQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\n\nexport const createQuoteTemplate = async (\n quoteId: string\n): Promise<NegotiableQuoteTemplateModel | null> => {\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!quoteId) {\n throw new Error('Cart ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(CREATE_QUOTE_TEMPLATE_MUTATION, {\n variables: {\n cartId: quoteId,\n },\n });\n\n if (!results?.data?.requestNegotiableQuoteTemplateFromQuote) {\n throw new Error('Failed to create quote template');\n }\n\n const transformedQuoteTemplate = transformQuoteTemplate(\n results.data.requestNegotiableQuoteTemplateFromQuote\n );\n\n if (!transformedQuoteTemplate) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedQuoteTemplate,\n permissions: state.permissions,\n });\n\n return transformedQuoteTemplate;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const RENAME_NEGOTIABLE_QUOTE_MUTATION = `\n mutation renameNegotiableQuote($input: RenameNegotiableQuoteInput!) {\n renameNegotiableQuote(input: $input) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { RENAME_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RenameNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RenameNegotiableQuoteInput {\n quoteUid: string;\n quoteName: string;\n quoteComment?: string;\n}\n\nexport const renameNegotiableQuote = async (\n input: RenameNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, quoteName, quoteComment } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n // Backend requires quote_comment to be present (even if empty string)\n const mutationInput = {\n quote_uid: quoteUid,\n quote_name: quoteName,\n quote_comment: quoteComment || '', // Always include, use empty string if not provided\n };\n\n return fetchGraphQl(RENAME_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n input: mutationInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to rename quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.renameNegotiableQuote?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quote-renamed', {\n quote: quoteData,\n input: { quoteUid, quoteName, quoteComment },\n });\n\n return quoteData;\n });\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const DUPLICATE_NEGOTIABLE_QUOTE_MUTATION = `\n mutation DUPLICATE_NEGOTIABLE_QUOTE_MUTATION($quoteUid: ID!, $duplicatedQuoteUid: ID!) {\n duplicateNegotiableQuote(input: { quote_uid: $quoteUid, duplicated_quote_uid: $duplicatedQuoteUid }) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { DUPLICATE_NEGOTIABLE_QUOTE_MUTATION } from './graphql/duplicateNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport interface DuplicateQuoteInput {\n quoteUid: string;\n duplicatedQuoteUid: string;\n hasOutOfStockItems?: boolean;\n}\n\nexport const duplicateQuote = async (\n input: DuplicateQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n const { quoteUid, duplicatedQuoteUid, hasOutOfStockItems } = input;\n\n if (!quoteUid || !quoteUid.trim()) {\n throw new Error('Quote UID is required');\n }\n\n if (!duplicatedQuoteUid || !duplicatedQuoteUid.trim()) {\n throw new Error('Duplicated Quote UID is required');\n }\n\n return fetchGraphQl(DUPLICATE_NEGOTIABLE_QUOTE_MUTATION, {\n variables: { quoteUid, duplicatedQuoteUid },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to duplicate quote: ${errorMessages}`);\n }\n\n const quoteData = transformQuote(\n response.data?.duplicateNegotiableQuote?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n events.emit('quote-management/quote-duplicated', {\n quote: quoteData,\n input: { quoteUid, duplicatedQuoteUid },\n hasOutOfStockItems,\n });\n\n return quoteData;\n });\n};\n"],"names":["QUOTE_DATA_QUERY","NEGOTIABLE_QUOTE_FRAGMENT","getQuoteData","quoteId","state","results","fetchGraphQl","transformedQuote","transformQuote","_a","events","error","DELETE_QUOTE_MUTATION","deleteQuote","quoteUids","quoteUidsArray","response","errors","errorMessages","e","raw","transformed","result","err","deletedUids","res","SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION","sendForReview","input","quoteUid","comment","attachments","commentInput","quoteData","_b","CLOSE_NEGOTIABLE_QUOTE_MUTATION","closeNegotiableQuote","failures","failureMessages","failure","closedUids","CREATE_QUOTE_TEMPLATE_MUTATION","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","createQuoteTemplate","transformedQuoteTemplate","transformQuoteTemplate","RENAME_NEGOTIABLE_QUOTE_MUTATION","renameNegotiableQuote","quoteName","quoteComment","DUPLICATE_NEGOTIABLE_QUOTE_MUTATION","duplicateQuote","duplicatedQuoteUid","hasOutOfStockItems"],"mappings":"gSAEO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAW1BC,CAAyB;AAAA,ECElBC,EAAe,MAAOC,GAAoB,OACnD,GAAI,CAACC,EAAM,cACP,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,CAAC,EAGnD,GAAI,CAACA,EAAM,YAAY,UACnB,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,CAAC,EAGnD,GAAI,CACA,MAAMC,EAAe,MAAMC,EAAaN,EAAkB,CACtD,UAAW,CACP,QAAAG,CAAA,CACJ,CACH,EAEKI,EAAmBC,GAAeC,EAAAJ,GAAA,YAAAA,EAAS,OAAT,YAAAI,E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