1(this.webpackJsonpapp=this.webpackJsonpapp||[]).push([[73],{1812:function(t,e,i){"use strict";i.r(e),i.d(e,"MapOrderEPPolaris",(function(){return h}));var a=i(7),r=i(35),n=i(0),o=i.n(n),d=i(9),s=i(11),l=i(17),u=i(2),c=i(4),p=i(398),g=i(19),m=i(774),b=i(1734);const v=d.b.div``,f=r.a` 2 query products($filter: ProductFilter) { 3 products(filter: $filter) { 4 total 5 nodes { 6 id 7 title 8 sku 9 designPositions { 10 id 11 file { 12 id 13 thumbnailUrl 14 url 15 } 16 designPosition { 17 id 18 name 19 } 20 } 21 productBases { 22 id 23 title 24 slug 25 fulfillment { 26 fulfillmentTitle 27 } 28 variants { 29 id 30 attributes { 31 name 32 slug 33 option 34 } 35 } 36 shippingOptions { 37 id 38 name 39 } 40 defaultShippingOptionId 41 } 42 mainImageId 43 images { 44 id 45 file { 46 id 47 url 48 thumbnailUrl 49 } 50 } 51 variants { 52 id 53 disabled 54 productBaseVariantId 55 productBaseVariant { 56 id 57 attributes { 58 name 59 slug 60 option 61 } 62 productBase { 63 id 64 title 65 } 66 } 67 variantStores { 68 id 69 originId 70 storeId 71 } 72 } 73 fields { 74 id 75 title 76 name 77 sorting 78 } 79 } 80 } 81 } 82`,P=r.a` 83 mutation mappingProductExist($input: NewMappingProductExist!) { 84 mappingProductExist(input: $input) { 85 id 86 title 87 sku 88 description 89 designStatus 90 personalized 91 status 92 productBases { 93 id 94 title 95 } 96 images { 97 id 98 productBaseId 99 file { 100 id 101 url 102 thumbnailUrl 103 } 104 } 105 tags { 106 id 107 name 108 } 109 collections { 110 id 111 name 112 } 113 fields { 114 id 115 title 116 name 117 type 118 extraFee 119 configure 120 sorting 121 } 122 } 123 } 124`,h=t=>{var e;let{item:i,suggestMappingProduct:r,onCompleted:d,removeLabel:h,onDismiss:E,needVariantMapping:O,canSetExistProduct:S,handleRemoveCurrentProduct:M}=t;const j=O&&[c.M.Shopify].includes(null===i||void 0===i||null===(e=i.store)||void 0===e?void 0:e.platform),I=null===i||void 0===i?void 0:i.id,x=null===i||void 0===i?void 0:i.existProductID,[y,k]=Object(n.useState)(null),{currentUser:T}=Object(n.useContext)(s.a),{isStoreManager:C,isMarketplaceManager:B}=Object(u.j)(T),[D,L]=Object(n.useState)(!1),{toggleToast:U,setNotify:R}=Object(g.b)(),{data:w,error:F,loading:N}=Object(a.d)(f,{variables:{filter:{limit:20,offset:0,search:y,loadDesignPosition:!0,...C?{storeId:"all"}:null,...B?{storeId:null}:null}},skip:j,fetchPolicy:"no-cache"}),{data:V,loading:$,error:q}=Object(a.d)(l.gb,{variables:{id:I},skip:!j||!I,fetchPolicy:"no-cache"}),_=o.a.useRef(null),[J,{data:Q,error:z,client:A}]=Object(a.c)(P,{onCompleted:()=>{L(!1),R({msg:"Map Order to exist product success",err:!1}),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{d&&d()},1e3)},onError:t=>{L(!1),R({msg:Object(u.ib)(null===t||void 0===t?void 0:t.toString()),err:!0})}});Object(n.useEffect)(()=>{S&&k(x)},[x,S]),o.a.useEffect(()=>{E&&E(D)},[D]);const G=Object(n.useCallback)(t=>{U&&U(),R&&R({msg:null,err:!1}),J({variables:{input:t}}).then(t=>{var e;const i=null===t||void 0===t||null===(e=t.data)||void 0===e?void 0:e.mappingProductExist;try{const t={filter:b.DEFAULT_PRODUCT_LIST_FILTER},e=A.readQuery({query:p.a,variables:t});A.writeQuery({query:p.a,variables:t,data:{...e,products:{...e.products,total:e.products.total+1,nodes:[i,...e.products.nodes]}}})}catch(a){}})},[U,R,J]);return F?o.a.createElement("div",null,"Error: ",Object(u.ib)(F.toString())):q?o.a.createElement("div",null,"Error: ",Object(u.ib)(q.toString())):o.a.createElement(v,null,o.a.createElement(m.a,{data:w,suggestMappingProduct:r,changeSearch:t=>
124k(t),item:i,onSubmit:G,loadingMutation:D,setLoadingMutation:L,loading:N||$,removeLabel:h,isNeedVariantMapping:j,productNeedMapping:null===V||void 0===V?void 0:V.getProductMapping,existProductID:x,canSetExistProduct:S,handleRemoveCurrentProduct:M,setSearch:k}))};e.default=h}}]); 125//# sourceMappingURL=73.a4379594.chunk.js.map
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.