1"use strict";(self.webpackChunkshopwp=self.webpackChunkshopwp||[]).push([["SettingSyncingByCollections-admin"],{"./_tmp/admin/js/app/settings/_common/select.jsx"(n,e,t){t.d(e,{l:()=>i});var r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),o=t("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),a=t("./_tmp/admin/js/app/settings/_state/context.js");function i(n){var e=n.settingsKey,t=n.help,i=n.label,u=n.options,s=void 0!==u&&u,c=n.disableWhen,l=void 0===c?[]:c,d=n.customCSS,y=void 0!==d&&d,g=n.multiple,p=void 0!==g&&g,m=n.alsoChange,f=void 0!==m&&m,b=n.customOnChange,v=void 0!==b&&b,h=n.customValue,C=void 0!==h&&h,$=wp.components.SelectControl,I=wp.element,A=I.useContext,P=I.useState,S=I.useEffect,j=A(a.A),x=(0,r.A)(j,2),w=x[0],q=x[1],_=P((function(){return"syncByWebhooks"===e&&"string"==typeof w.syncByWebhooks?w.syncByWebhooks.split(","):p&&!w[e]?[]:w[e]})),k=(0,r.A)(_,2),T=k[0],O=k[1];function L(n){if(!n||!n.length)return!1;var e=!1;return n.forEach((function(n){n&&(e=n)})),e}var E=P(L),D=(0,r.A)(E,2),B=D[0],N=D[1];S((function(){N(L(l))}),l);var K=(0,o.AH)(".components-select-control{flex-direction:column;justify-content:flex-start;align-items:flex-start;.components-input-control__container,.components-select-control__input{min-height:",p?"200px":"auto","!important;}}.components-input-control__label{font-weight:bold;}.components-select-control__input[multiple]{min-height:200px!important;overflow:scroll!important;};label:selectStyles;");return(0,o.Y)("div",{css:[K,y,";label:Select;"],id:"shopwp-select-control"},(0,o.Y)($,{disabled:B,value:C||T,options:s,onChange:v||function(n){O(n),q({type:"UPDATE_SETTING",payload:{key:e,value:n}}),f&&f(n)},help:t,label:i,multiple:p}))}},"./_tmp/admin/js/app/settings/syncing/sync-by-collections.jsx"(n,e,t){t.r(e),t.d(e,{default:()=>b});var r=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),o=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=t("./node_modules/@babel/runtime/regenerator/index.js"),i=t.n(a),u=t("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),s=t("./_tmp/admin/js/app/settings/_state/context.js"),c=t("./_tmp/admin/js/app/settings/_common/select.jsx"),l=t("./_tmp/admin/js/app/utils/utils-tabs.js"),d=t("./_tmp/admin/js/app/utils/utils-data.js"),y=t("./node_modules/lodash-es/isArray.js"),g=t("./_tmp/admin/js/app/admin/_state/hooks.js"),p=t("./npm-packages/@shopwp/common/src/utils/index.jsx"),m=t("./npm-packages/@shopwp/api/src/internal/cart/index.js"),f={name:"2o7zyj-LoadingCollectionsCSS",styles:"background:rgba(240, 240, 240, 63%);padding:40px 20px;margin:20px 0!important;display:flex;justify-content:center;.components-spinner{margin-top:0;};label:LoadingCollectionsCSS;"};const b=function(){var n,e=wp.element,t=e.useContext,a=e.useState,b=e.useEffect,v=wp.components,h=v.Spinner,C=v.Notice,$=v.Button,I=t(s.A),A=(0,o.A)(I,2),P=A[0],S=A[1],j=a(null!=P&&P.syncByCollections?null==P?void 0:P.syncByCollections.map((function(n){return n.id})):[]),x=(0,o.A)(j,2),w=x[0],q=x[1],_=(0,g.G)(),k=(0,g.H)(),T=a(!1),O=(0,o.A)(T,2),L=O[0],E=O[1],D=f;return b((function(){function n(){return(n=(0,r.A)(i().mark((function n(){var e,t,r,a,u;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return k({type:"SET_IS_LOADING_COLLECTIONS",payload:!0}),n.next=1,(0,p.to)((0,m.qw)({queryParams:{query:"*",first:250}},_));case 1:if(t=n.sent,r=(0,o.A)(t,2),a=r[0],u=r[1],k({type:"SET_IS_LOADING_COLLECTIONS",payload:!1}),!a){n.next=2;break}return E(a),n.abrupt("return");case 2:if(null!=u&&null!==(e=u.collections)&&void 0!==e&&null!==(e=e.edges)&&void 0!==e&&e.length){n.next=3;break}return E("No collections found to sync. Make sure your collections are assigned to the ShopWP sales channel inside Shopify."),n.abrupt("return");case 3:k({type:"SET_AVAILABLE_COLLECTIONS",payload:(i=u.collections.edges,i&&(0,y.A)(i)?i.map((function(n){return{id:n.node.id,title:n.node.title,handle:n.node.handle,smart:!!n.node.hasOwnProperty("rules")}})).sort((function(n,e){return n.title.localeCompare(e.title)})):[])}),(u.collections.edges&&Array.isArray(u.collections.edges)?u.collections.edges.filter((function(n){return w.includes(n.node.id)})):[]).length||(q([]),S({type:"UPDATE_SETTING",payload:{key:"syncByCollections",value:[]}}));case 4:case"end":return n.stop()}var i}),n)})))).apply(this,arguments)}!function(){n.apply(this,arguments)}()}),[]),_.hasConnection?_.availableCollections?(0,u.Y)(c.l,{label:_.t.a.syncProductsFromCollections,settingsKey:"syncByCollections",options:(n=_.availableCollections,n?n.map((function(n){return{label:n.title,value:n.id}})):[]),customValue:w,customOnChange:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];q(n);var e=function(n,e){return e.filter((function(e){return!!n&&n.includes(e.id.toString())}))}(n,_.availableCollections);S({type:"UPDATE_SETTING",payload:{key:"syncByCollections",value:e}})},disableWhen:[(0,d.M6)(P)],multiple:!0,help:_.t.a.selectMultiple}):L?(0,u.Y)(C,{status:"error",isDismissible:!1},L):(0,u.Y)("div",{css:D},_.t.a.loadingCollections," ",(0,u.Y)(h,null)):(0,u.Y)(C,{status:"warning",isDismissible:!1},_.t.e.noConnection,(0,u.Y)($,{isLink:!0,onClick:function(n){(0,l.EF)("connect")}},_.t.a.reconnect))}},"./_tmp/admin/js/app/utils/utils-data.js"(n,e,t){function r(n){var e=parseInt(n);return isNaN(e)||e<=0?"auto":e}function o(n){return!1===n.selectiveSyncImages&&!1===n.selectiveSyncMetafields&&!1===n.selectiveSyncOptions&&!1===n.selectiveSyncProducts&&!1===n.selectiveSyncTags&&!1===n.selectiveSyncVariants&&!1===n.selectiveSyncCollections}t.d(e,{M6:()=>o,mA:()=>r})},"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"(n,e,t){function r(n,e){if(null==n)return{};var t,r,o=function(n,e){if(null==n)return{};var t={};for(var r in n)if({}
1.hasOwnProperty.call(n,r)){if(-1!==e.indexOf(r))continue;t[r]=n[r]}return t}(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],-1===e.indexOf(t)&&{}.propertyIsEnumerable.call(n,t)&&(o[t]=n[t])}return o}t.d(e,{A:()=>r})},"./node_modules/await-to-js/dist/await-to-js.es5.js"(n,e,t){t.d(e,{A:()=>r});const r=function(n,e){return n.then((function(n){return[null,n]})).catch((function(n){return e&&Object.assign(n,e),[n,void 0]}))}},"./npm-packages/@shopwp/api/src/internal/cart/index.js"(n,e,t){t.d(e,{uJ:()=>x,w9:()=>k,zA:()=>j,r:()=>L,DI:()=>E,DP:()=>F,Xl:()=>S,X_:()=>K,qw:()=>N,d$:()=>D,Bj:()=>B,XR:()=>q,jv:()=>O,HI:()=>T,wq:()=>w,w3:()=>_});var r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),o=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),a=t("./node_modules/@babel/runtime/regenerator/index.js"),i=t("./node_modules/await-to-js/dist/await-to-js.es5.js"),u=t("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),s=t("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),c=["country","language","currency"];function l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function d(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?l(Object(t),!0).forEach((function(e){(0,u.A)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function y(n,e){return new Promise(function(){var t=(0,o.A)(a.mark((function t(r,o){var i,u,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=1;break}return t.abrupt("return",o("No Shopify connection found. Please try reconnecting your Shopify store to ShopWP."));case 1:return i=wp.hooks.applyFilters("cart.requestSettings",wp.hooks.applyFilters("product.requestSettings",n.variables)),t.next=2,e.request(n.query,{variables:i});case 2:u=t.sent,s=u.data,c=u.errors,u.extensions,c&&o(c),r(s);case 3:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}())}function g(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(n){if(n.productMetafields&&"[]"!==n.productMetafields)var e=atob(n.productMetafields);else e=n.productMetafields;if(n.productVariantMetafields&&"[]"!==n.productVariantMetafields)var t=atob(n.productVariantMetafields);else t=n.productVariantMetafields}return e||(e="[]"),t||(t="[]"),"\n availableForSale\n compareAtPriceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n createdAt\n description\n descriptionHtml\n handle\n id\n onlineStoreUrl\n options {\n id\n name\n values\n }\n metafields(identifiers:".concat(e,") { \n type \n namespace \n key \n value\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n productType\n publishedAt\n requiresSellingPlan\n title\n totalInventory\n updatedAt\n vendor\n tags\n images(first: 250) {\n edges {\n node {\n width\n height\n altText\n id\n originalSrc\n transformedSrc\n }\n }\n },\n media(first: 250) {\n edges {\n node {\n alt\n mediaContentType\n previewImage {\n width\n height\n altText\n id\n url\n }\n ...on ExternalVideo {\n id\n embeddedUrl\n }\n ...on MediaImage {\n image {\n width\n height\n altText\n id\n originalSrc\n transformedSrc \n }\n }\n ...on Video {\n sources {\n url\n mimeType\n format\n height\n width\n }\n }\n }\n }\n },\n variants(first: 100) {\n edges {\n node {\n product {\n id\n title\n productType\n vendor\n collections(first: 1) {\n edges {\n node {\n title\n }\n }\n }\n }\n availableForSale\n compareAtPrice {\n amount\n currencyCode\n }\n currentlyNotInStock\n id\n image {\n width\n height\n altText\n id\n originalSrc\n transformedSrc\n }\n metafields(identifiers:").concat(t,") { \n type \n namespace \n key \n value\n }\n price {\n amount\n currencyCode\n }\n quantityAvailable\n requiresShipping\n selectedOptions {\n name \n value\n }\n sellingPlanAllocations(first: 50) {\n edges {\n node {\n sellingPlan {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ...on SellingPlanPriceAdjustmentValue {\n ...on SellingPlanFixedAmountPriceAdjustment {\n adjustmentAmount {\n amount\n }\n }\n }\n\n ...on SellingPlanFixedPriceAdjustment {\n price {\n amount\n }\n }\n\n ... on SellingPlanPercentagePriceAdjustment {\n adjustmentPercentage\n }\n }\n }\n }\n priceAdjustments {\n compareAtPrice {\n amount\n }\n price {\n amount\n }\n }\n remainingBalanceChargeAmount {\n amount\n }\n checkoutChargeAmount {\n amount\n }\n }\n }\n }\n sku\n title\n weight\n weightUnit\n }\n }\n }\n sellingPlanGroups(first: 50) {\n edges {\n node {\n appName\n name\n options {\n name\n values\n }\n sellingPlans(first: 50) {\n edges {\n node {\n description\n id\n name\n recurringDeliveries\n options {\n name\n value\n }\n priceAdjustments {\n orderCount\n adjustmentValue {\n ...on SellingPlanPriceAdjustmentValue {\n ...on SellingPlanFixedAmountPriceAdjustment {\n adjustmentAmount {\n amount\n }\n }\n }\n\n ...on SellingPlanFixedPriceAdjustment {\n price {\n amount\n }\n }\n\n ... on SellingPlanPercentagePriceAdjustment {\n adjustmentPercentage\n }\n }\n }\n }\n }\n }\n }\n }\n }")}function p(n){var e="";return n&&n.metafields&&(e=n.metafields),"\n id\n note\n checkoutUrl\n createdAt\n updatedAt\n totalQuantity\n buyerIdentity {\n countryCode\n email\n phone\n }\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode \n }\n subtotalAmount {\n amount\n currencyCode\n }\n subtotalAmountEstimated\n totalAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalDutyAmount {\n amount\n currencyCode\n }\n totalDutyAmountEstimated\n totalTaxAmount {\n amount\n currencyCode\n }\n totalTaxAmountEstimated\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n }
1\n lines(first: 250) {\n edges {\n node {\n id\n merchandise {\n ... on ProductVariant {\n product {\n id\n title\n handle\n }\n availableForSale\n compareAtPrice {\n amount\n currencyCode\n }\n currentlyNotInStock\n id\n image {\n width\n height\n altText\n id\n originalSrc\n transformedSrc\n }\n ".concat(e,"\n price {\n amount\n currencyCode\n }\n quantityAvailable\n requiresShipping\n selectedOptions {\n name \n value\n }\n sku\n title\n weight\n weightUnit\n }\n }\n quantity\n sellingPlanAllocation {\n priceAdjustments {\n price {\n amount\n currencyCode\n }\n }\n sellingPlan {\n description\n id\n name\n recurringDeliveries\n options {\n name\n value\n }\n priceAdjustments {\n adjustmentValue \n orderCount\n }\n \n }\n }\n attributes {\n key\n value\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n }\n }\n }")}function m(n){return"query($id: ID!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cart(id: $id) {\n ".concat(p(n),"\n }\n }")}function f(n){return"mutation cartCreate($lines: [CartLineInput!], $note: String, $attributes: [AttributeInput!]!, $buyerIdentity: CartBuyerIdentityInput\n, $discountCodes: [String!], $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartCreate(input: {\n lines: $lines, \n note: $note, \n attributes: $attributes, \n discountCodes: $discountCodes, \n buyerIdentity: $buyerIdentity\n }) \n {\n cart {\n ".concat(p(n),"\n }\n userErrors {\n field\n code\n message\n }\n }\n }")}function b(n){return"mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ".concat(p(n),"\n }\n userErrors {\n field\n code\n message\n }\n }\n }")}function v(n){return"mutation cartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ".concat(p(n),"\n }\n userErrors {\n field\n message\n }\n }\n }")}function h(n){return"query ProductByCollections($query: String, $first: Int!, $sort
1Key: ProductCollectionSortKeys, $reverse: Boolean, $language: LanguageCode, $country: CountryCode, $buyer: BuyerInput, $cursor: String, $filters: [ProductFilter!]) @inContext(country: $country, language: $language, buyer: $buyer) {\n collections(first: 250, query: $query) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n title\n products(first: $first, sortKey: $sortKey, reverse: $reverse, after: $cursor, filters: $filters) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n cursor\n node {\n ".concat(g(n),"\n }\n }\n }\n }\n }\n }\n }")}function C(n){var e=function(n){var e=g(),t=n.withProducts?"products(first: "+n.queryParams.first+" sortKey: "+n.queryParams.sortKey+") { pageInfo { hasNextPage hasPreviousPage } edges { cursor node { "+e+" } } }":"";return"title\n handle\n id\n description\n descriptionHtml\n onlineStoreUrl\n image {\n width\n height\n altText\n id\n originalSrc\n transformedSrc\n }\n ".concat(t)}(n.withProducts);return"query getCollectionById($id: ID!) {\n collection(id: $id) {\n ".concat(e,"\n }\n }")}function $(n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2]||function(n,e){if(n.first)var t=n.first;else t=250;if(n.sortKey)var r=n.sortKey.toUpperCase();else r="TITLE";var o=g(n);return"title\n handle\n id\n description\n descriptionHtml\n onlineStoreUrl\n image {\n width\n height\n altText\n id\n originalSrc\n transformedSrc\n }\n ".concat(e?"products(first: "+t+" sortKey: "+r+") { pageInfo { hasNextPage hasPreviousPage } edges { cursor node { "+o+" } } }":"")}(n,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return n.cursor||delete n.cursor,n.ids&&n.ids.length?"query getCollectionsById($ids: [ID!]!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n nodes(ids: $ids) {\
1n ... on Collection {\n ".concat(e,"\n }\n }\n }"):"query($query: String!, $first: Int!, $cursor: String, $sortKey: CollectionSortKeys, $reverse: Boolean, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n collections(first: $first, query: $query, after: $cursor, reverse: $reverse, sortKey: $sortKey) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n cursor\n node {\n ".concat(e,"\n }\n }\n }\n }")}function I(n){var e=n||{},t=e.country,o=(e.language,e.currency,d(d({},(0,s.A)(e,c)),t?{countryCode:t}:{})),a=d({companyLocationId:!1,countryCode:!1,customerAccessToken:!1,deliveryAddressPreferences:!1,email:!1,phone:!1,preferences:!1},o),i=Object.fromEntries(Object.entries(a).filter((function(n){var e=(0,r.A)(n,2),t=(e[0],e[1]);return Boolean(t)})));return 0!==Object.keys(i).length&&i}function A(n,e,t){return t.indexOf(n)===e}function P(){return{query:"query ($numProducts: Int!, $cursor: String) {\n products(first: $numProducts, after: $cursor) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n vendor\n }\n }\n }\n }",variables:{numProducts:250,cursor:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}}}function S(n,e){return y(function(n,e){var t={id:n.id,language:e.language,country:n.buyerIdentity.country};return{query:m(n),variables:t}}(n,e),e.client)}function j(n,e){return y(function(n,e){var t={lines:n.lines?n.lines:[],note:n.note?n.note:"",attributes:n.attributes?n.attributes:[],discountCodes:n.discountCodes?n.discountCodes:[],language:e.language,country:n.buyerIdentity.country,buyerIdentity:I(n.buyerIdentity)};return{query:f(n),variables:t}}(n,e),e.client)}function x(n,e){return y(function(n,e){return{query:b(n),variables:{cartId:n.cartId,lines:n.lines?n.lines:[],language:e.language,country:n.buyerIdentity.country}}}(n,e),e.client)}function w(n,e){return y(function(n,e){return{query:v(n),variables:{cartId:n.cartId,lines:n.lines?n.lines:[],language:e.language,country:n.buyerIdentity.country,metafields:!!n.metafields&&n.metafields}}}(n,e),e.client)}function q(n,e){return y(function(n){return{query:(e=n,"mutation cartLinesRemove($cartId: ID!, $lineIds: [ID!]!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ".concat(p(e),"\n }\n userErrors {\n field\n message\n }\n }\n }")),variables:{cartId:n.cartId,lineIds:n.lineIds?n.lineIds:[],language:n.buyerIdentity.language,country:n.buyerIdentity.country}};var e}(n),e.client)}function _(n,e){return y(function(n,e){return{query:(t=n,"mutation cartNoteUpdate($cartId: ID!, $note: String!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ".concat(p(t),"\n }\n userErrors {\n field\n message\n }\n }\n }")),variables:{cartId:n.cartId,note:n.note?n.note:"",language:e.language,country:n.buyerIdentity.country}};var t}(n,e),e.client)}function k(n,e){return y(function(n,e){var t,r=function(n){var e=n.existingDiscountCodes?n.existingDiscountCodes.filter(A):[],t=n.discountToChange;if(n.isRemoving)var r=e.filter((function(n){return n.code!==t})).map((function(n){return n.code}));else(r=e.map((function(n){return n.code}))).push(t);return r.filter(A)}(n);return{query:(t=n,"mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ".concat(p(t),"\n }\n userErrors {\n field\n message\n }\n }\n }")),variables:{cartId:n.cartId,discountCodes:r,language:e.language,country:n.buyerIdentity.country}}}(n,e),e.client)}function T(n,e){return y(function(n,e){return{query:(t=n,"mutation cartAttributesUpdate($attributes: [AttributeInput!]!, $cartId: ID!, $language: LanguageCode, $country: CountryCode) @inContext(country: $country, language: $language) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) \n {\n cart {\n ".concat(p(t),"\n }\n userErrors {\n code\n field\n message\n }\n }\n }")),variables:{cartId:n.cartId,attributes:n.attributes?n.attributes:[],language:e.language,country:n.buyerIdentity.country}};var t}(n,e),e.client)}function O(n,e){var t=function(n){return{query:(e=n,"mutation cartBuyerIdentityUpdate($buyerIdentity: CartBuyerIdentityInput!, $cartId: ID!) {\n cartBuyerIdentityUpdate(buyerIdentity: $buyerIdentity, cartId: $cartId) {\n cart {\n ".concat(p(e),"\n }\n userErrors {\n field\n message\n code\n }\n }\n }")),variables:{cartId:n.cartId,buyerIdentity:I(n.buyerIdentity)}};var e}(n);return y(t,e.client)}function L(n){return y({query:"query {\n productTags(first:250) {\n edges {\n node\n }\n }\n }",variables:!1},n.client)}function E(n){return y({query:"query {\n productTypes(first:250) {\n edges {\n node\n }\n }\n }",variables:!1},n.client)}function D(n,e){return y(function(n,e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2]||g(n),r={query:n.query,first:n.first,reverse:n.reverse,sortKey:n.sortKey?n.sortKey:"TITLE",language:e.language,country:n.country,buyer:n.buyer};return n.cursor&&(r.cursor=n.cursor),{query:"query ProductQuery($query: String!, $first: Int!, $cursor: String, $sortKey: ProductSortKeys, $reverse: Boolean, $language: LanguageCode, $country: CountryCode, $buyer: BuyerInput) @inContext(country: $country, language: $language, buyer: $buyer) {\n products(first: $first, query: $query, after: $cursor, reverse: $reverse, sortKey: $sortKey) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n cursor\n node {\n ".concat(t,"\n }\n }\n }\n }"),variables:r}}(n,e),e.client)}function B(n,e){var t,r;return y((r={query:(t=n).query,first:t.first,reverse:t.reverse,sortKey:t.sortKey?t.sortKey:"TITLE",language:t.language,country:t.country,buyer:t.buyer},t.cursor&&(r.cursor=t.cursor),t.filters&&t.filters.length>0&&(r.filters=t.filters),{query:h(t),variables:r}),e.client)}function N(n,e){return y(function(n){return{query:$(n.queryParams,n.withProducts,n.customSchema),variables:n.queryParams}}(n),e.client)}function K(n,e){return y(function(n){return{query:C(n),variables:{id:"gid://shopify/Collection/"+n.queryParams.id}}}(n),e.client)}function U(n){return V.apply(this,arguments)}function V(){return(V=(0,o.A)(a.mark((function n(e){var t,o,u,s,c;return a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=1,(0,i.A)(y(e.queryFn(e.cursor),e.client));case 1:if(t=n.sent,o=(0,r.A)(t,2),u=o[0],s=o[1],!u){n.next=2;break}throw u;case 2:if(c=e.results.concat(s.products.edges),!s.products.pageInfo.hasNextPage){n.next=3;break}return n.abrupt("return",U({client:e.client,cursor:s.products.pageInfo.endCursor,results:c,queryFn:e.queryFn}));case 3:return n.abrupt("return",c);case 4:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function F(n){return M.apply(this,arguments)}function M(){return(M=(0,o.A)(a.mark((function n(e){var t,o,u,s;return a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=1,(0,i.A)(U({client:e.client,results:[],cursor:null,queryFn:P}));case 1:if(t=n.sent,o=(0,r.A)(t,2),u=o[0],s=o[1],!u){n.next=2;break}throw u;case 2:return n.abrupt("return",{data:{edges:s}});case 3:case"end":return n.stop()}}),n)})))).apply(this,arguments)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.