PageSourceSearch

https://erp.dianxiaobao.net/assets/chunk/aeb56c9f.DVVk6y1q.js

js dianxiaobao.net collected 2026-09-28 06:06:24 UTC 66,989 bytes, 1 lines download raw bytes

1import{n as e}from"./61b66786.8BhlS34s.js";import{$i as t,Gf as n,Ji as r,Jl as i,Ml as a,Qi as o,Wf as s,Xi as c,Xl as l,Yi as u,Yl as d,Zi as f,am as p,ia as m,jl as h,na as g,om as _,ql as v,ra as y,ta as b}from"./027ffcfc.eLkoaQ3Q.js";import{G as x,J as S,R as C,Vt as w,dt as T,f as E,mt as D,r as O}from"./ce65bdc9.BVjkH_eL.js";import{At as k,Ut as A,Yt as j,_r as M,an as N,cr as P,dr as F,gn as I,mn as ee,rn as L,vr as te,xn as ne,zn as R}from"./4473ac67.BzSFK8kg.js";import{C as z,D as B,L as V,h as re,m as H,r as U,t as ie}from"./34401cca.Bgk-ks65.js";import{C as ae,S as oe,T as se,_ as ce,v as le,w as ue,x as de}from"./658d88f5.DrjgHU7g.js";import{_ as fe,l as W}from"./15330c0f.BoXUDCbg.js";import"https://js-c.etc4.com/dxb/js/vue.CQKD6T8K.js";function pe(e){return{1:`car`,2:`moto`,car:`car`,motor:`moto`,moto:`moto`}[e]||``}function me(e){return pe(e)===`moto`?`EU_MOTO`:`EU`}function he(e){return{car:1,motor:2,moto:2}[e]||0}function G(e={}){return e.afid||e.afId||e.af_id||e.id||``}function ge(e){let t=typeof e==`string`?D(e):e;if(Array.isArray(t))return t;let n=p(t,`displayData.list`,[],T);if(n.length)return n;let r=p(t,`carInfo`,[],T);return r.length?r:p(t,`data.afIds`,[],T).map(e=>({afid:e}))}function _e(e={}){let t=(e.carInfo||[]).map(e=>{let{_checked:t,...n}=e;return n}),n=e.cloneCarInfo||[],r=t.map(G).filter(Boolean),i=n.filter(e=>!r.includes(G(e))).map(G).filter(Boolean);return{displayData:{list:t},data:{afIds:r,unbindAfIds:i,productIds:[],vehicleType:pe(e.carType)}}}function K(e=[],t=1){return e.map(e=>e.data||[]).flat().filter(e=>e.value&&(Number(t)!==0||e.countryCode!==`EU`))}async function ve(){let e=await L({codes:`ae_phone_model_library`});return p(e,`ae_phone_model_library.0.content`,[],T)}async function ye(){let{ae_sku_special_product_type:e}=await L({codes:`ae_sku_special_product_type`});return e.map(e=>{if(e.content.includes(`{`)){let t=p(e,`content`,{},D);e.isSupportPop=t.pop,e.isSupportAeg=t.aeg}else e.isSupportPop=!0,e.isSupportAeg=!0;return e})}function be(e=[]){return e.flatMap(e=>{let t=T(e.sub_values);return t.length?t:[e]})}function xe(e=[]){return be(e).map(e=>({attributes:null,hasSubAttr:!1,id:e.value_id,names:JSON.stringify({en:e.label,zh:e.label}),valueTags:`{}`,parent_property_id:e.parent_prop_id||``,parent_value_id:e.parent_value_id||``}))}function Se({id:e,names:t,values:n}){return{attributeShowTypeValue:`check_box`,customizedName:!0,customizedPic:!1,features:`{}`,id:e,inputType:`STRING`,keyAttribute:!1,names:JSON.stringify(t),required:!0,sku:!0,skuStyleValue:null,spec:3,units:null,values:n,visible:!0}}function Ce(e,t=`CN`){let n=D(e?.valueTags);if(!Object.hasOwn(n,`AE_FEATURE_national`))return!0;let r=D(n.AE_FEATURE_national)[String(t||`CN`).toUpperCase()];return/(?:^|;)\s*VDisplayStrategy\s*:\s*1\s*(?:;|$)/.test(String(r||``))}async function we({storeId:e,categoryId:t}){let n=await M({storeId:e,catId:t}),r=p(n,`0.features`,null,D);return p(r,`AE_FEATURE_PLUG_LIBRARY`,``)===`Y`}var q,Te,J,Ee,Y,X,Z,De,Q;function $(){return($=e((()=>{l(),m(),v(),b(),n(),R(),ue(),z(),fe(),_(),S(),a(),t(),c(),q={check_box:`MULTIPLE_SELECT`,list_box:`SINGLE_SELECT`,input:`input`,input_int:`input`,input_string:`input`,radio:`SINGLE_SELECT`,interval:`interval`},Te={0:{value:`0`,name:`备仓模式`},1:{value:`1`,name:`即时补货(JIT)`},2:{value:`2`,name:`海外备仓`}},J=263619383,Ee=400079803,Y={...d,async merge({attrData:e,valueData:t=[],isSku:n=!1,storeId:r,categoryId:i,country:a=`CN`}={}){let o=new Set(e.map(e=>+e.id));if((await ve()).includes(`${i}`)&&!o.has(J)){let{category_cascade_properties:t}=await F({storeId:r,cateId:i});e.push(Se({id:J,names:{en:`Mobile Models`,zh:`适用手机机型`},values:xe(t)}))}if(await we({storeId:r,categoryId:i})&&!o.has(Ee)){let{category_cascade_properties:t}=await F({storeId:r,cateId:i,groupId:8});e.push(Se({id:Ee,names:{en:`Plug Type`,zh:`插头库`},values:xe(t)}))}if(e.forEach(e=>{e.values=(e.values||[]).filter(e=>Ce(e,a))}),e.filter(e=>e.sku).forEach(e=>{e.isNewItemCpRequried=!!p(D(e.features),`AE_FEATURE_newitem_cp_required`,0,Number)}),e=(e||[]).filter(e=>e.sku==n).filter(e=>{let n=D(e.features);return n?.AE_FEATURE_forbidden_use===`1`?!1:n?.AE_FEATURE_Size_chart_version!==`old_size`||T(t).filter(t=>t.attrId===e.id).length!==0}
1),e.forEach(e=>{let r=JSON.parse(e.names);n&&e.attributeShowTypeValue===`list_box`&&(e.attributeShowTypeValue=`check_box`),e.attribute_id=e.id,e.display_attribute_name=r.zh||r.en,e.name_zh=r.zh,e.name_en=r.en,e.attribute_show_type_value=e.attributeShowTypeValue,e.customized_name=e.customizedName,e.customized_pic=e.customizedPic,e.support_enum_input=e.keyAttribute,e.input_type=q[e.attribute_show_type_value]||`SINGLE_SELECT`,e.attribute_value_list=(e.values||[]).filter(e=>D(e?.valueTags)?.AE_FEATURE_forbidden_use!==`1`).map(t=>{let n=JSON.parse(t.names),r=D(t.valueTags);return Object.assign(t,{attribute_id:e.attribute_id,value_id:t.id,display_value_name:n.zh||n.en,name_zh:n.zh,name_en:n.en,value_tags:r,percent:0})});let i=t.filter(t=>e.attribute_id==t.attrId);e.dataValue=e.input_type===`MULTIPLE_SELECT`||D(e.features).AE_FEATURE_material_ratio?[]:[Object.assign(Y.getDefValueItem(),{attrId:e.attribute_id,attrName:e.name_en,valueId:[`input`,`interval`].includes(e.input_type)?-2:``})],i.length&&i.forEach(t=>{t.attrId=Number(t.attrId),t.valueId=Number(t.valueId);let n=e.attribute_value_list.find(e=>e.value_id==t.valueId),r=Object.assign(t,{attrName:e.name_en});n&&(r.valueNameOld=n.name_en,r.parent_property_id=n.parent_property_id,r.parent_value_id=n.parent_value_id,[``,null,void 0].includes(r.valueName)&&(r.valueName=n.name_en),[``,null,void 0].includes(r.valueNameOld)&&(r.valueNameOld=n.name_en)),t.attrId===J?e.dataValue.push(r):D(e.features).AE_FEATURE_material_ratio?e.attribute_value_list.length?(r.valueNameOld=n?.name_en||``,n&&r.valueId&&e.dataValue.push({...r,cnName:n.name_zh,enName:n.name_en})):e.dataValue.push({...r,cnName:r.valueName,enName:r.valueName}):([`input`,`interval`].includes(e.input_type)&&(r.valueId||=-2,e.dataValue[0]=r),[`SINGLE_SELECT`].includes(e.input_type)&&(n?e.dataValue[0]=r:e.support_enum_input&&![``,null,void 0].includes(t.valueName)&&this.addValueItem(e,{valueName:t.valueName,image:t.image})),[`MULTIPLE_SELECT`].includes(e.input_type)&&(n?e.dataValue.push(r):e.support_enum_input&&![``,null,void 0].includes(t.valueName)&&this.addValueItem(e,{valueName:t.valueName,image:t.image})))})}),r&&i){let n=[];async function o(e){for(let s of e){let c=s.attribute_value_list.filter(e=>s.dataValue.find(t=>t.valueId==e.value_id)&&e.hasSubAttr);n.some(e=>e.id===s.id)||n.push(s);for(let n of c){let{attrData:c,childAttr:l}=await Y.handleChildAttr({attrData:e,item:s,attrValueItem:n,valueData:t,storeId:r,categoryId:i,country:a});await o(l)}}}return await o(e),n}return e},async mergeAeg({attrData:e,valueData:t=[],isSku:n=!1,storeId:r,categoryId:i}={}){return(await ve()).includes(`${i}`)&&e.push(Se({id:J,names:{en:`Mobile Models`,zh:`适用手机机型`},values:[]})),e=(e||[]).filter(e=>e.sku==n),e.forEach(e=>{let r=JSON.parse(e.names);n&&e.attributeShowTypeValue==`list_box`&&(e.attributeShowTypeValue=`check_box`),e.attribute_id=e.id,e.display_attribute_name=r.zh||r.en,e.name_zh=r.zh,e.name_en=r.en,e.attribute_show_type_value=e.attributeShowTypeValue,e.customized_name=e.customizedName,e.customized_pic=e.customizedPic,e.support_enum_input=e.keyAttribute,e.input_type=q[e.attribute_show_type_value]||`SINGLE_SELECT`,e.attribute_value_list=(e.values||[]).map(t=>{let n=JSON.parse(t.names);return Object.assign(t,{attribute_id:e.attribute_id,value_id:t.id,display_value_name:n.zh||n.en,name_zh:n.zh,name_en:n.en})});let i=t.filter(t=>e.attribute_id==t.attrId);e.dataValue=e.input_type===`MULTIPLE_SELECT`?[]:[Object.assign(Y.getDefValueItem(),{attrId:e.attribute_id,attrName:e.name_en,valueId:[`input`,`interval`].includes(e.input_type)?-2:``})],i.length&&i.forEach(t=>{t.attrId=Number(t.attrId),t.valueId=Number(t.valueId);let n=e.attribute_value_list.find(e=>e.value_id==t.valueId),r=Object.assign(t,{attrName:e.name_en});n&&([``,null,void 0].includes(r.valueName)&&(r.valueName=n.name_en),[``,null,void 0].includes(r.valueNameOld)&&(r.valueNameOld=n.name_en)),[`input`,`interval`].includes(e.input_type)&&(r.valueId||=-2,e.dataValue[0]=r),[`SINGLE_SELECT`].includes(e.input_type)&&(n?e.dataValue[0]=r:e.support_enum_input&&![``,null,void 0].includes(t.valueName)&&this.addValueItem(e,{valueName:t.valueName,image:t.image})),[`MULTIPLE_SELECT`].includes(e.input_type)&&(n?e.dataValue.push(r):e.support_enum_input&&![``,null,void 0].includes(t.valueName)&&this.addValueItem(e,{valueName:t.valueName,image:t.image}))})}),e},async handleChildAttr({attrData:e,item:t,attrValueItem:n,valueData:r=[],storeId:i,categoryId:a,country:o=`CN`}){let s=E(e),c=[],l=Math.max(0,s.findIndex(e=>e.attribute_id===t.attribute_id)),u=t.attribute_value_list.filter(e=>!t.dataValue.some(t=>t.valueId==e.value_id));return s=s.filter(e=>!u.some(t=>(e.parentAttrPath||[]).includes([t.attribute_id,t.value_id].join(`:`)))
1),n&&n.hasSubAttr&&(c=await j({storeId:i,cateId:a,attrId:t.attribute_id,attrName:t.enName,valueId:n.value_id,valueName:n.name_en,aeAttrId:[t.attribute_id,n.value_id].join(`=`)}),c=await Y.merge({attrData:c,storeId:i,categoryId:a,valueData:r,country:o}),c.forEach(e=>{e.parentAttrPath=[...t.parentAttrPath||[],[n.attribute_id,n.value_id].join(`:`)]}),s.splice(l+1,0,...c)),{attrList:s,childAttr:c}},getAttrRules(e){let t=[],n=`change,blur`;return e.required&&t.push({required:e.required,validator(e,t,n,r,i,a){if(!t){n(Error(`必填项!`));return}if(t.length==0){n(Error(`必填项!`));return}if(!t.every(e=>e.valueId&&(e.valueName||e.valueStart&&e.valueEnd))){n(Error(`必填项!`));return}n()},trigger:n}),[`input`,`interval`].includes(e.input_type)&&t.push({required:!1,validator(e,t,n,r,i,a){let o=t.map(e=>[e.valueName,e.valueStart,e.valueEnd]).flat().join(``).trim();if(o&&!/^[^\u4E00-\u9FA5?“’:!。,《》()【】;、]+$/.test(o)){n(Error(`不能包含中文`));return}n()},trigger:n}),D(e.features)?.AE_FEATURE_material_ratio&&t.push({required:!0,validator(e,t,n,r,i,a){if(t.reduce((e,t)=>Number(e)+Number(t.percent),0)!==100){n(Error(`比例总和必须为100%`));return}n()},trigger:n}),t},addValueItem(e,{valueName:t,image:n}){let r=Math.min(-1,...e.attribute_value_list.map(e=>Number(e.value_id)))-1,i={names:JSON.stringify({en:t,zh:t}),id:r,has_sub_attr:!1,value_tags:`{}`,value_id:r,display_value_name:t,name_zh:t,name_en:t};e.attribute_value_list.push(i),e.input_type===`MULTIPLE_SELECT`&&this.attrChangeCheck(!0,e,i),e.input_type===`SINGLE_SELECT`&&(e.dataValue[0].valueId=r,this.attrChangeSelect(e)),e.dataValue.at(-1).image=n||``},getDefValueItem(){return{attrId:``,attrName:``,valueId:``,valueName:``,valueNameOld:``,image:``,image_url_list:[],valueUnit:``,valueStart:``,valueEnd:``,deep_image:!1,percent:0,cnName:``,enName:``}},getGoodsSaveAttrData(e){let t={};return e.forEach(e=>{e.dataValue.filter(e=>e.valueId&&(e.valueName||e.valueStart&&e.valueEnd)).forEach(n=>{if(e.input_type===`interval`)[{key:`${[n.attrId,-2].join(`:`)}`,valueName:n.valueStart||``,valueId:-2},{key:`${[n.attrId,-3].join(`:`)}`,valueName:n.valueEnd||``,valueId:-3}].forEach(e=>{t[e.key]={valueStart:n.valueStart,valueEnd:n.valueEnd,valueUnit:n.valueUnit,valueId:e.valueId,valueName:e.valueName,attrName:n.attrName,attrId:n.attrId}});else{let r;r=e.input_type===`MULTIPLE_SELECT`||D(e.features).AE_FEATURE_material_ratio?`${[n.attrId,n.valueId].join(`:`)}`:n.attrId,t[r]={valueStart:n.valueStart,valueEnd:n.valueEnd,valueUnit:n.valueUnit,valueId:n.valueId,valueName:n.valueName,attrName:n.attrName,attrId:n.attrId,percent:n?.percent||0,cnName:n.cnName,enName:n.enName}}})}),t},getGoodsSaveDiyAttrData(e){let t={};return e.forEach((e,n)=>{t[-n]={attrId:-n,attrName:e.attrName,valueId:``,valueName:e.valueName}}),t},getAttrDataFromLocal(e){return Object.values(e).filter(e=>e.attrId>0).map(e=>Object.assign(Y.getDefValueItem(),{attrId:e.attrId,attrName:e.attrName||``,valueId:e.valueId||``,valueName:e.valueName||``,valueUnit:e.valueUnit||``,valueStart:e.valueStart||``,valueEnd:e.valueEnd||``,percent:e?.percent||0,parent_property_id:e.parent_property_id||``,parent_value_id:e.parent_value_id||``}))},getAttrDataFromOnline(e){return e.filter(e=>e.attrNameId>0).map(e=>Object.assign(Y.getDefValueItem(),{attrId:e.attrNameId,attrName:e.attrName,valueId:e.attrValueId,valueName:e.attrValue,valueUnit:e.attr_value_unit||``,valueStart:e.attr_value_start||``,valueEnd:e.attr_value_end||``,percent:e?.percent||0}))}},X={...i,async merge({attrData:e,valueData:t=[],storeId:n,categoryId:r,country:i=`CN`}){return await Y.merge({attrData:e,valueData:t,isSku:!0,storeId:n,categoryId:r,country:i})},valueItem:{sort(e,t,n){e.dataValue=O.swapArray(e.dataValue,t,t+n)},del(e,t){e.dataValue.splice(t,1)}},getDefaultPriceRow({aegWarehouseList:e}={}){return{price:``,cargo_price:``,storeNumber:``,skuCode:``,imageUrl:``,original_box:`0`,weight:``,packageLength:``,packageWidth:``,packageHeight:``,special_product_type_list:[],logistic_attr_list:[],aeg:{price:``,storeNumber:(e||[]).map(e=>({...e,storeNumber:``})),skuCode:``,itemCode:``,barCode:``,original_box:`0`,weight:``,packageLength:``,packageWidth:``,packageHeight:``,special_product_type_list:[],logistic_attr_list:[],sku_cate:{unit:``,categorization:``,num:``}}}},skuGroupMake({skuData:e,skuGroup:t,currency:n,aegWarehouseList:r,virtualProductTag:i,isMultiSkuFlg:a},{filterRemote:o,skuPriceEdit:s,skuCodeEdit:c,skuGjCodeEdit:l,skuStoreNumberEdit:u,aegSkuStoreNumberEdit:d,aegSkuItemCodeEdit:f,skuImageEdit:p,skuBoxEdit:m,skuWeightEdit:h,skuSizeEdit:g,skuLogisticAttrEdit:_,skuCateEdit:v}){let{column:y,list:b}=this.skuGroupMakeBase({skuData:e,skuGroup:t,filterRemote:o,parseRow:({row:e,skuItem:t,valueItem:n})=>{let r=Object.keys(e).filter(e=>e.match(/skuId\d+/)),{customized_name:i,customized_pic:a}=t;for(let t of r)e[t].customized_name=i,e[t].customized_pic=a;e.__image||=n.image||``},aegWarehouseList:r}),x=[...y],S=[...y],C=!1;
1b.forEach(e=>{C||=!!e[`skuId${J}`],C&&!e.imageUrl&&(e.imageUrl=e.__image||``)});let w={imageUrl:[{name:`批量`,handle:p}],price:[{name:`批量`,handle:s}],sku_cate:[{name:`批量`,handle:v}],cargo_price:[{name:`批量`,handle:s}],storeNumber:[{name:`批量`,handle:u}],aegStoreNumber:[{name:`批量`,handle:d}],itemCode:[{name:`批量`,handle:f}],code:[{name:`自动`,handle:c},{name:`高级`,handle:l}],original_box:[{name:`批量`,handle:m}],weight:[{name:`批量`,handle:h}],package_size:[{name:`批量`,handle:g}],logistic_attr_list:[{name:`批量`,handle:_}]},T=this.createRenderHeader(w),E={imageUrl:{title:`预览图`,key:`imageUrl`,slot:`imageUrl`,align:`center`,width:120,_required:!1,renderHeader:T},price:{title:`价格(${n})`,key:`price`,slot:`price`,align:`center`,width:90,_required:!0,renderHeader:T},sku_cate:{title:`SKU分类|数量&单位`,key:`sku_cate`,slot:`sku_cate`,align:`center`,width:200,_required:!0,tip:`<img src="https://feitian-upload.oss-cn-shanghai.aliyuncs.com/00/00/00/feitian/oneStore/image.png">`,tipWidth:820,renderHeader:T},cargo_price:{title:`货值(${n})`,key:`cargo_price`,slot:`cargo_price`,align:`center`,width:120,rowField:`cargo_price`,_required:!0,tip:`货值是包括商品成本/营销推广/售后等费用项的价格,不含正向物流配送费或税费`,renderHeader:T,baseValueFields:[{name:`价格`,value:`price`},{name:`货值`,value:`cargo_price`}]},stock:{title:`库存`,slot:`storeNumber`,key:`storeNumber`,align:`center`,width:90,_required:!0,renderHeader:T},aegStock:{title:`库存`,slot:`aegStoreNumber`,key:`aegStoreNumber`,align:`center`,minWidth:220,_required:!0,warehouseList:r,renderHeader:T},original_box:{title:`是否原箱`,slot:`original_box`,key:`original_box`,align:`center`,width:90,_required:!i,renderHeader:T},weight:{title:`重量(kg)`,slot:`weight`,key:`weight`,align:`center`,width:90,_required:!i,renderHeader:T},package_size:{title:`包装尺寸(cm)`,slot:`package_size`,key:`package_size`,align:`center`,width:250,_required:!i,renderHeader:T},logistic_attr_list:{title:`物流属性`,slot:`logistic_attr_list`,key:`logistic_attr_list`,align:`center`,width:150,_required:!0,renderHeader:T},skuCode:{title:`商品编码`,key:`code`,slot:`code`,align:`center`,minWidth:150,_required:!1,renderHeader:T},itemCode:{title:`货品信息`,key:`itemCode`,slot:`itemCode`,align:`center`,minWidth:200,_required:!1,renderHeader:T}};return C&&y.push(E.imageUrl),y.push(E.price),y.push(E.cargo_price),y.push(E.stock),y.push(E.original_box),y.push(E.weight),y.push(E.package_size),y.push(E.logistic_attr_list),y.push(E.skuCode),x.push({...E.price,rowFieldPath:`aeg`}),a&&x.push({...E.sku_cate,rowFieldPath:`aeg`}),x.push({...E.aegStock,rowFieldPath:`aeg`}),x.push({...E.skuCode,rowFieldPath:`aeg`}),x.push({...E.itemCode,rowFieldPath:`aeg`}),S.push({...E.original_box,rowFieldPath:`aeg`}),S.push({...E.weight,rowFieldPath:`aeg`}),S.push({...E.package_size,rowFieldPath:`aeg`}),S.push({...E.logistic_attr_list,rowFieldPath:`aeg`,managedModel:`fully_managed_model`}),{column:y,column1:x,column2:S,list:b}},getGoodsSaveSkuData(e){let t={};return e.forEach(e=>{e.dataValue.filter(e=>e.valueId&&(e.valueName||e.valueStart&&e.valueEnd)).forEach(n=>{let r;r=e.input_type===`MULTIPLE_SELECT`?`${[n.attrId,n.valueId].join(`:`)}`:n.attrId,t[r]={attrId:n.attrId,attrName:n.attrName,valueId:n.valueId,valueName:n.valueNameOld||n.valueName,sku_custom_value_name:n.valueNameOld===n.valueName?``:n.valueName,sku_custom_image_url:n.image,image_url_list:n.deep_image?n.image_url_list:[],deep_image:n.deep_image,parent_property_id:n.parent_property_id||``,parent_value_id:n.parent_value_id||``,plug_parent_property_id:n.parent_property_id||``,plug_parent_value_id:n.parent_value_id||``,sku_property_id:n.attrId,property_value_id:n.valueId}})}),t},getGoodsSavePriceStoreData(e){return e.map(e=>{let t=Object.keys(e).filter(e=>e.match(/skuId-?\d+/)).map(t=>e[t]);return{price:e.price,cargo_price:e.cargo_price,sku_code:e.skuCode,enable:!0,inventory_dto_list:{current_inventory:e.storeNumber,src_inventory:``,store_code:``},attributes:t.map(e=>({attrId:e.attrId,attrName:e.attrName,valueId:e.valueId,valueName:e.valueNameOld||e.valueName,sku_custom_value_name:e.valueNameOld===e.valueName?``:e.valueName,sku_custom_image_url:e.image,image_url_list:e.deep_image?e.image_url_list:[],deep_image:e.deep_image,parent_property_id:e.parent_property_id||``,parent_value_id:e.parent_value_id||``,plug_parent_property_id:e.parent_property_id||``,plug_parent_value_id:e.parent_value_id||``,sku_property_id:e.attrId,property_value_id:e.valueId})),mobile_model_sku_image:e.imageUrl||``,original_box:[void 0,``].includes(e.original_box)?`0`:`${e.original_box}`,package_weight:e.weight||``,package_length:e.packageLength||``,package_width:e.packageWidth||``,package_height:e.packageHeight||``,special_product_type_list:e.special_product_type_list,logistic_attr_list:e.logistic_attr_list,sku_freight_id:e.sku_freight_id,sku_id:e.sku_id}})},alignSkuPriceAttributesWithSkuData(e,t){let n={};return Object.values(t||{}
1).forEach(e=>{n[[e.attrId,e.valueId].join(`:`)]=e,n[e.attrId]=e}),e.forEach(e=>{e.attributes=T(e.attributes).map(e=>{let t=n[[e.attrId,e.valueId].join(`:`)]||n[e.attrId];return t?{...e,attrName:t.attrName,valueName:t.valueName,sku_custom_value_name:t.sku_custom_value_name,sku_custom_image_url:t.sku_custom_image_url,image_url_list:t.deep_image?t.image_url_list:[],deep_image:t.deep_image,parent_property_id:t.parent_property_id||``,parent_value_id:t.parent_value_id||``}:e})}),e},getSkuDataFromLocal(e){return Object.values(e).map(e=>Object.assign(Y.getDefValueItem(),{attrId:e.attrId,attrName:e.attrName,valueId:e.valueId,valueName:e.sku_custom_value_name||e.valueName||``,image:e.sku_custom_image_url||``,valueNameOld:e.valueName||``,image_url_list:e.image_url_list||[],deep_image:e.deep_image,parent_property_id:e.parent_property_id||``,parent_value_id:e.parent_value_id||``}))},getSkuDataFromExt(e){return e.map(e=>e.skuValues.map(t=>Object.assign(Y.getDefValueItem(),{attrId:e.skuId,attrName:e.skuName,valueId:t.id,valueName:t.name||``,image:e.imageUrl||``,valueNameOld:t.name||``,image_url_list:e.image_url_list||[],deep_image:e.deep_image,parent_property_id:e.parent_property_id||``,parent_value_id:e.parent_value_id||``}))).flat()},getSkuDataFromOnline(e,t){let n=t.map(e=>e?.aeopSKUPropertyList||[]).flat(),r=[];return n.forEach(t=>{if(!r.find(e=>e.attrId==t.skuPropertyId&&e.valueId==t.propertyValueId)){let n=e.find(e=>e.attribute_id==t.skuPropertyId),i=n?.attribute_value_list?.find(e=>e.value_id==t.propertyValueId);r.push(Object.assign(Y.getDefValueItem(),{attrId:t.skuPropertyId,attrName:t.skuPropertyName||n?.name_en||``,valueId:t.propertyValueId,valueName:t.propertyValueDefinitionName||t.skuPropertyValue||i?.name_en||``,image:t.skuImage||``,image_url_list:t.imageUrlList||[],deep_image:t.deep_image,parent_property_id:t.parentPropertyId||``,parent_value_id:t.parentValueId||``}))}}),r},getSkuGroupFromLocal(e,t,n={}){let r=[],{weight:i,packageLength:a,packageWidth:o,packageHeight:s}=n;return t.length&&t.forEach(t=>{let n=Object.assign(X.getDefaultPriceRow(),{price:t.price,cargo_price:t.cargo_price,skuCode:t.sku_code,storeNumber:t?.inventory_dto_list?.current_inventory||``,imageUrl:t.mobile_model_sku_image||``,weight:t.package_weight||i||``,packageLength:t.package_length||a||``,packageWidth:t.package_width||o||``,packageHeight:t.package_height||s||``,original_box:[void 0,``].includes(t.original_box)?`0`:`${t.original_box}`,special_product_type_list:t.special_product_type_list||[],logistic_attr_list:t.logistic_attr_list||[],sku_id:t.skuId||t.sku_id,sku_freight_id:t.sku_freight_id}),c=!1;T(t.attributes).forEach(t=>{try{let r=e.find(e=>`${e.attribute_id}`==`${t.attrId}`).dataValue.find(e=>e.valueId==t.valueId);if(r)n[`skuId${t.attrId}`]=r;else throw Error(`不存在valueItem`)}catch{c=!0}}),c||r.push(n)}),r},getSkuGroupFromOnline(e,t){let n=[];return t.length&&t.forEach(t=>{let r={price:t.skuPrice||``,skuCode:t.skuCode||``,storeNumber:t.ipmSkuStock===null||t.ipmSkuStock===void 0||t.ipmSkuStock===``?``:t.ipmSkuStock,sku_id:t.skuId||``,imageUrl:t.mobileModelSkuImage||``,skuPropertyListAeg:t.aeopSKUPropertyList||[]},i=!1;T(t?.aeopSKUPropertyList).forEach(t=>{try{let n=e.find(e=>e.attribute_id==t.skuPropertyId).dataValue.find(e=>e.valueId==t.propertyValueId);n||(i=!0),r[`skuId${t.skuPropertyId}`]=n}catch{i=!0}}),i||n.push(r)}),n},getNewSizeModelList(e){let t={200000124:{standard:`常规`,onesize:`均码`,standarddual:`常规双码`,cnsize:`中国码`,cnsizedual:`中国双码`},5:{standard:`常规`,onesize:`均码`,brasize:`罩杯尺寸`}},n=e.find(e=>Object.keys(t).includes(`${e.attribute_id}`));if(n){let e=t[n.attribute_id];return Array.from(new Set(n.values.map(e=>p(e,`value_tags.size_model_value`,``)).filter(Boolean)),t=>e[t]?{name:e[t]||t,value:t}:null).filter(Boolean)}return[]},filterSizeDataValueByNewSizeModel(e,t){let n=e.find(e=>[200000124,5].includes(+e.attribute_id)),r=!1,i={};if(n&&t&&(n.dataValue.forEach(e=>{let t=n.values.find(t=>t.value_id===+e.valueId),a=p(t,`value_tags.size_model_value`,`standard`);a?(i[a]=i[a]||[],i[a].push(e)):r=!0}),Object.keys(i).length)){let e=Object.keys(i).reduce((e,t)=>
1i[e].length>i[t].length?e:t);return n.dataValue=i[e],{matchSizeModel:e,hasOldSize:r}}return{matchSizeModel:``,hasOldSize:r}},changeSizeModel(e,t,n){let r=e=>{n.$nextTick(()=>{n.$refs.newSizeModelRadioGroupRef[0].children.forEach(t=>{t.currentValue=e===t.label,t.group=!0})})};r(e.newSizeModel),n.$Modal.confirm({title:`提示`,content:`切换尺码分组将会丢失勾选的尺码及 sku 数据,确定切换?`,onOk:()=>{e.newSizeModel=t,r(t);let n=e.skuData.find(e=>[200000124,5].includes(+e.attribute_id));n.dataValue=[]}})}},Z={async merge({skuGroup:e,valueData:t=[]}){let{areaPrice:n}=Q.getDefaultSetting(),r=T(t?.configuration_data),i=r.map(e=>e.shiptoCountry);return n.countryList=await k(),n.type=t?.configuration_type||`absolute`,n.countryList.forEach(e=>{e.checked=i.includes(e.type)}),n.dataAll=e.map(e=>{let t=Object.keys(e).filter(e=>e.match(/^skuId\d+/)),i=t.map(t=>e[t]).map(e=>[e.attrId,e.valueId].join(`:`)).join(`;`),a={};return n.countryList.filter(e=>e.checked).forEach(e=>{let t=r.find(t=>t.shiptoCountry==e.type),n=Object.keys(t?.absoluteQuoteMap||{}).includes(`<none>`),o=i||(n?`<none>`:``),s=Z.getPermutations(o.split(`;`)).map(e=>p(t,`absoluteQuoteMap.['${e.join(`;`)}']`,``)).filter(Boolean)[0];a[`country_${e.type}`]={value:s==null||s==null?``:s}}),t.forEach(t=>{a[t]=e[t]}),a}),n.data=w(n.dataAll,n.page),n},tableDataMake({skuData:e,skuGroup:t,currency:n,areaPrice:r,isPreview:i,choiceCountryList:a=[]},{filterRemote:o,areaPriceBatchEdit:s}){let c=[],l=[],u=p(r,`type`,``)===`percentage`?0:2,d=r.countryList.filter(e=>e.checked);if(d.length){e.forEach(e=>{let t=e.dataValue.filter(e=>e.valueId&&e.valueName);if(t.length){let n=t.map(t=>({label:t.valueName,value:[e.attrId,t.valueId].join(`@@`)}));c.push({fixed:`left`,title:e.display_attribute_name,slot:`sku`,align:`center`,sku:e,filters:n,filterMultiple:!0,filterRemote:o,minWidth:120})}}),i||c.push({fixed:`left`,title:`批量`,slot:`action`,align:`center`,width:100}),d.forEach(e=>{c.push({title:e.name_zh,slot:`country`,align:`center`,country:e,minWidth:180,renderHeader:(t,n)=>t(`div`,{style:{whiteSpace:`pre-wrap`}},[t(`span`,`${e.name_zh}`),i?[]:[t(`a`,{style:{marginLeft:`5px`},onClick(){s(e)}},`批量`)]])})});let n={};if(r.dataAll.forEach(e=>{let t=Z.getIdStr(e);n[t]=e}),t.length)t.forEach((e,t)=>{let n={};Object.keys(e).forEach(t=>{/skuId/.test(t)&&(n[t]=e[t])}),d.forEach(e=>{n[`country_${e.type}`]={value:``,valueModle:``,type:1}}),l.push(n)});else{let e={};d.forEach(t=>{e[`country_${t.type}`]={value:``,valueModle:``,type:1}}),l.push(e)}l.forEach(e=>{let t=Z.getIdStr(e),r=Object.keys(n).find(e=>t.includes(e)),i=n[t]||n[r],o=[];a.length>0&&a.forEach(e=>{let t=e.sku_property_list?e.sku_property_list.map(e=>`${e.sku_property_id_long}:${e.property_value_id_long}`).join(`;`):``;(t===r||t===i)&&(o=e.choice_sku_price_list)}),i&&Object.keys(e).filter(e=>e.match(/^country_/)).forEach(t=>{let n=i[t]?.value,r=!1;o.length>0&&o.forEach(e=>{e.nation_name===t.slice(8)&&(n=e.price,r=!0)}),e[t].value=n?Number(n).toFixed(u):``,e[t].valueModle=n?Math.abs(n).toFixed(u):``,e[t].type=i[t]?.type||``,r&&(e[t].disabled=r)})})}return{countryList:d,column:c,list:l}},getIdStr(e){return Object.keys(e).filter(e=>e.match(/skuId\d+/)).map(e=>e.match(/\d+/)[0]).sort().map(t=>[t,e[`skuId${t}`].valueId].join(`:`)).join(`;`)},tableFilter(e,t){return e.filter(e=>Object.keys(t).every(n=>{let r=t[n].map(String);return!!(e[`skuId${n}`]&&(r.includes(String(e[`skuId${n}`].valueId))||r.includes(`dianxiaobaoall`)))}))},priceEdit(e,t,{type:n,ty:r,gs:i}){e.forEach(e=>{if(e[`country_${t.type}`].disabled!==!0&&(n===`ty`&&(e[`country_${t.type}`].value=r.priceCurrent,e[`country_${t.type}`].valueModle=Math.abs(r.priceCurrent),r.priceCurrent>0?e[`country_${t.type}`].type=1:e[`country_${t.type}`].type=-1),n===`gs`)){let n=(e[`country_${t.type}`].value*i.chen/i.chu+Number(i.jia)-i.jian).toFixed(i.xiaoshu);e[`country_${t.type}`].value=n,e[`country_${t.type}`].valueModle=Math.abs(n),n>0?e[`country_${t.type}`].type=1:e[`country_${t.type}`].type=-1}})},getGoodsSaveAreaPriceData(e){let{type:t,countryList:n,dataAll:r}=e;function i(e){let t={};return r.forEach(n=>{let r=Object.keys(n).filter(e=>e.match(/^skuId\d+/)).map(e=>[n[e].attrId,n[e].valueId].join(`:`)).join(`;`);t[r||`<none>`]=n[`country_${e}`].value}),t}return{configuration_type:t,configuration_data:n.filter(e=>e.checked).map(e=>({shiptoCountry:e.type,absoluteQuoteMap:i(e.type)}))}},getPermutations(e){let t=[];function n(e,r){if(r.length===0)t.push(e.slice());else for(let t=0;t<r.length;t++){let i=r[t];e.push(i),r.splice(t,1),n(e,r),r.splice(t,0,i),e.pop()}}return n([],e),t}},De={...y,getGoodsImage(e){let t=[];if(e?.scImages?.length&&t.push({title:`主图`,images:e.scImages}),e?.marketImages?.length&&t.push({title:`营销图`,images:e.marketImages.filter(
1Boolean)}),e?.skuData&&e.skuData.forEach(e=>{let n=e.dataValue.map(e=>e.image).filter(Boolean);n.length&&t.push({title:`SKU-${e.display_attribute_name}`,images:n})}),e?.webDetail){let n=C(e.webDetail,!1);n.length&&t.push({title:`PC详情图片`,images:n})}if(e?.wirelessDetail){let n=e.wirelessDetail.filter(e=>e.type===`image`&&e.value).map(e=>e.value);n.length&&t.push({title:`无线详情图片`,images:n})}if(e?.detail1){let n=C(e.detail1,!1);n.length&&t.push({title:`PC详情图片顶部`,images:n})}if(e?.detail2){let n=C(e.detail2,!1);n.length&&t.push({title:`PC详情图片尾部`,images:n})}return t.filter(e=>e.images.length)},getProcessImageGroup(e){let t=[];t.push(h.createNewGroup({images:e.scImages,groupType:`mainImage`,maxImageCount:e.limit.scImage1.maxCount,title:`商品主图`,maxSize:5120}));let n={0:`https://res.dianxiaobao.net/00/00/00/ae-goods-market/1-1.png`,1:`https://res.dianxiaobao.net/00/00/00/ae-goods-market/3-4.png`},r=e.marketImages.map((e,t)=>({coverImage:n[t],oldImage:e}));if(t.push(h.createNewGroup({images:r,groupType:`marketImages`,maxImageCount:2,title:`营销图`,canMove:!1,canAddImage:!1,uploadImageType:`replace`,maxSize:5120})),e?.skuData?.length&&e.skuData.forEach(e=>{let n=e.dataValue.map(e=>e.image).filter(Boolean);n.length&&t.push(h.createNewGroup({title:`SKU-${e.display_attribute_name}`,images:n,groupType:`skuImage`,attrId:e.attribute_id,maxImageCount:n.length,canAddImage:!1,uploadImageType:`replace`}))}),e?.webDetail){let n=C(e.webDetail,!1);n.length&&t.push(h.createNewGroup({title:`PC详情图片`,images:n,groupType:`webDetail`,maxImageCount:n.length,canAddImage:!1,uploadImageType:`replace`,maxSize:8192}))}if(e?.wirelessDetail){let n=e.wirelessDetail.filter(e=>e.type===`image`&&e.value).map(e=>e.value);n.length&&t.push(h.createNewGroup({title:`无线详情图片`,images:n,groupType:`wirelessDetail`,maxImageCount:e.limit.descImage.maxCount,canMove:!1,canAddImage:!1,uploadImageType:`replace`,maxSize:8192}))}return t},processImages(e,t,n){let{setting:r}=n;this.processGroup(r,e,t)}},Q={staticData:{},mergeQualificationData({qualificationList:e,qualificationStructList:t}){let n={EU:{title:`欧盟资质`,name:`欧盟`,tip:`售往欧盟市场的玩具需符合当地CE认证的相关要求。如您的商品需要销往欧盟,请在商品发布页面上传商品的CE认证证书以及带有CE标志和生产企业信息的商品包装图片或标签图片。平台已开始对部分类目的玩具商品进行强制管控,未通过CE认证和包装标签审核的玩具将在欧盟市场屏蔽。如您不销往欧盟,请忽略这个模块。`,href:`https://campaign.aliexpress.com/wow/gcp/TEP/index?wh_weex=true&amp;wx_navbar_hidden=true&amp;wx_navbar_transparent=true&amp;ignoreNavigationBar=true&amp;wx_statusbar_hidden=true&amp;previewTime=1653040829889`,data:[]},BR:{title:`巴西资质`,name:`巴西`,tip:`玩具在巴西销售时需要符合巴西INMETRO的相关要求。`,href:`https://campaign.aliexpress.com/wow/gcp/TEP/index?wh_weex=true&amp;wx_navbar_hidden=true&amp;wx_navbar_transparent=true&amp;ignoreNavigationBar=true&amp;wx_statusbar_hidden=true&amp;previewTime=1653040829889`,data:[]},TR:{title:`土耳其资质`,name:`土耳其`,tip:`土耳其新颁布的《通过远程通信工具在市场上提供产品的市场监督和审核规定》(类似欧盟GPSR)已于2025年04月01日正式实施,要求平台全量商家/商品(部分特殊商品除外)采集商品标签(含制造商信息)和土耳其责任人信息(简称土代)。`,href:``,data:[]},UK:{title:`英国资质`,name:`英国`,tip:``,href:``,data:[]},US:{title:`美国资质`,name:`美国`,tip:``,href:``,data:[]}};return e.forEach(e=>{let r=t.find(t=>t.key===e.key);e.value=r?r.value:``,Object.keys(n).includes(e.countryCode)?n[e.countryCode].data.push(e):n[e.countryCode]={title:`${e.countryCode}资质`,name:e.countryCode,tip:``,href:``,data:[e]}}),{qualificationMap:n,qualificationList:Object.values(n).filter(e=>e.data.length)}},async changeStore(e){let[t,n,r,i]=await Promise.all([ee({storeId:e}),oe({storeId:e}),de({storeId:e}),s.goods[`product/getContainsChoiceAuth|POST`]({storeId:e},{cache:!0})]);return{manufactureList:T(t),shippingTemplateList:T(n),serviceTemplateList:T(r),isChoiceAuth:i}},getQualificationQueryParams(e,t={}){let n=t.attrData?Y.getGoodsSaveAttrData(t.attrData):{},r=Object.values(n).reduce((e,t)=>
1{let n=t.attrId||t.attribute_id,r=t.valueId||t.value_id;return n&&r&&(e[n]||(e[n]=[]),e[n].push(r)),e},{});p(t,`areaPrice.countryList`,[]).filter(e=>e.checked).map(e=>e.type).filter(Boolean);let i=p(t,`online.productId`,``);return{...e,isChoice:0,productId:i||void 0,customProperty:{product_id:i||void 0,title:t.productTitle||``,properties:r,ship_to_country:[],seller_register_country:p(t,`shop.country`,``),business_type:`pop`,first_publish_time:p(t,`online.firstPublishTime`,Date.now(),Number),semi_hosted_country:[],region_saleable_condition:{}}}},async getCategoryQualificationData(e,t=[]){let{storeId:n,category:r}=e,i=r?.categoryId;if(!n||!i)return[];let a={storeId:n,categoryId:i,cateId:i,leafCategoryId:i,catId:i},o=await le(Q.getQualificationQueryParams(a,e)),{qualificationList:s}=Q.mergeQualificationData({qualificationList:o,qualificationStructList:t});return s},async changeCategory(e,t){let n={storeId:e,categoryId:t,cateId:t,leafCategoryId:t,catId:t},[r,i,a,o,s,c]=await Promise.all([H(n),ae(n),ce(n),se(n),M(n),A(n)]),l=p(a,`eu_contact_module_list`,[],T),u=p(a,`support`,!1),d=p(o,`isSuccess`,!1),{newSizeTmpTypeMap:f}=Q.getDefaultSetting(),m=p(o,`size_chart_sub_type_list`,[],T).map(e=>({name:f[e]||e,value:e})),h=p(s,`0.features`,null,D),g=he(p(h,`AE_FEATURE_CAR_TYPE`,``));return c.manualReqiredFlg=p(h,`AE_FEATURE_Product_manual_only`,``),c.installVideoReqiredFlg=p(h,`AE_FEATURE_installation_video_only`,``),c.isMultiSkuFlg=p(h,`AE_FEATURE_SKU_Multipack`,``),c.isPlugLib=p(h,`AE_FEATURE_PLUG_LIBRARY`,`N`),{attrData:r,sizeTemplateData:i,responsiblePersonData:{support:u,eu_contact_module_list:l},isSupportNewSizeTmp:d,newSizeTmpTypeList:m,isCar:g,carInfo:s,cateInfo:c}},getUnitList(){return[{type:`100000000`,name:`bag/bags`,name_zh:`袋`},{type:`100000001`,name:`barrel/barrels`,name_zh:`桶`},{type:`100000002`,name:`bushel/bushels`,name_zh:`蒲式耳`},{type:`100078580`,name:`carton`,name_zh:`箱`},{type:`100078581`,name:`centimeter`,name_zh:`厘米`},{type:`100000003`,name:`cubic meter`,name_zh:`立方米`},{type:`100000004`,name:`dozen`,name_zh:`打`},{type:`100078584`,name:`feet`,name_zh:`英尺`}
1,{type:`100000005`,name:`gallon`,name_zh:`加仑`},{type:`100000006`,name:`gram`,name_zh:`克`},{type:`100078587`,name:`inch`,name_zh:`英寸`},{type:`100000007`,name:`kilogram`,name_zh:`千克`},{type:`100078589`,name:`kiloliter`,name_zh:`千升`},{type:`100000008`,name:`kilometer`,name_zh:`千米`},{type:`100078559`,name:`liter/liters`,name_zh:`升`},{type:`100000009`,name:`long ton`,name_zh:`英吨`},{type:`100000010`,name:`meter`,name_zh:`米`},{type:`100000011`,name:`metric ton`,name_zh:`公吨`},{type:`100078560`,name:`milligram`,name_zh:`毫克`},{type:`100078596`,name:`milliliter`,name_zh:`毫升`},{type:`100078597`,name:`millimeter`,name_zh:`毫米`},{type:`100000012`,name:`ounce`,name_zh:`盎司`},{type:`100000014`,name:`pack/packs`,name_zh:`包`},{type:`100000013`,name:`pair`,name_zh:`双`},{type:`100000015`,name:`piece/pieces`,name_zh:`件/个`},{type:`100000016`,name:`pound`,name_zh:`磅`},{type:`100078603`,name:`quart`,name_zh:`夸脱`},{type:`100000017`,name:`set/sets`,name_zh:`套`},{type:`100000018`,name:`short ton`,name_zh:`美吨`},{type:`100078606`,name:`square feet`,name_zh:`平方英尺`},{type:`100078607`,name:`square inch`,name_zh:`平方英寸`},{type:`100000019`,name:`square meter`,name_zh:`平方米`},{type:`100078609`,name:`square yard`,name_zh:`平方码`},{type:`100000020`,name:`ton`,name_zh:`吨`},{type:`100078558`,name:`yard/yards`,name_zh:`码`}]},getDefaultSetting(){return{limit:{title:{minLength:1,maxLength:128},scImage1:{minCount:1,maxCount:6},scImage2:{minCount:1,maxCount:6},marketImage1:{imageWidthMin:800,imageHeightMin:800,imageRatio:[1,1],byteSizeMin:.001,byteSizeMax:3},marketImage2:{imageWidthMin:750,imageHeightMin:1e3,byteSizeMin:.001,byteSizeMax:3},descImage:{minCount:0,maxCount:50},editorNewImage:{minCount:3,maxCount:6}},template:{id:``,name:``,modules:[],moduleData:[{type:`MokuaiBase`,code:`MokuaiBase`,name:`基础信息`,isShowInTempPage:!0},{type:`MokuaiAttr`,code:`MokuaiAttr`,name:`产品属性`,isShowInTempPage:!0},{type:`MokuaiDiyAttr`,code:`MokuaiDiyAttr`,name:`自定义属性`,isShowInTempPage:!0},{type:`MokuaiSku`,code:`MokuaiSku`,name:`商品SKU`,isShowInTempPage:!0},{type:`MokuaiTrade`,code:`MokuaiTrade`,name:`价格与库存`,isShowInTempPage:!0},{type:`MokuaiAreaPrice`,code:`MokuaiAreaPrice`,name:`区域调价`,isShowInTempPage:!0},{type:`MokuaiPackage`,code:`MokuaiPackage`,name:`包装与物流`,isShowInTempPage:!0},{type:`MokuaiOther`,code:`MokuaiOther`,name:`其他信息`,isShowInTempPage:!0}]},online:{},sourceData:{source:``,sourceUrl:[``],mainImages:[],skuImages:[],detailImages:[],sourceAttr:[]},shop:null,id:``,goodsType:``,isChoice:0,isChoiceAuth:!1,storeId:``,category:{categoryId:``,categoryName:``},cateInfo:null,virtualProductTag:!1,productTitle:``,group:[],scImages:[],marketImages:[],mainVideo:{poster_url:``,media_type:`MAIN_IMAGE_VIDEO`,media_id:``,video_url:``,name:``},productManual:``,installVideo:{poster_url:``,media_id:``,video_url:``,name:``},attrData:[],diyAttrData:[],productUnit:`100000015`,productUnitName:`件/个`,productUnitList:Q.getUnitList(),packageType:0,packageTypeList:[{value:0,name:`按件销售`},{value:1,name:`打包销售(价格按照包计算)`}],isBStore:null,ladderPrice:f(null),batchPrice:{isBatchPrice:!1,batchNum:``,batchDiscount:``},lotNum:``,skuData:[],skuGroup:{dataAll:[],data:[],page:{current:1,total:0,pageSize:10},filterObject:{}},areaPrice:{countryList:[],type:`absolute`,typeList:[{type:`absolute`,name:`直接报价`},{type:`percentage`,name:`调整比例`},{type:`relative`,name:`调整金额`}],dataAll:[],data:[],page:{current:1,total:0,pageSize:10},filterObject:{}},deliveryDate:``,weight:``,is_pack_sell:!1,base_unit:``,add_unit:``,add_weight:``,packageLength:``,packageWidth:``,packageHeight:``,shippingTemplateId:``,shippingTemplateList:[],serviceTemplateId:``,serviceTemplateList:[],detailType:`1`,webDetail:``,wirelessDetail:[],robotDetail:{applyStatus:!1,html:``,json:{}},reduce_strategy:`place_order_withhold`,reduce_strategy_list:[{name:`下单减库存`,value:`place_order_withhold`},{name:`支付减库存`,value:`payment_success_deduct`}],responsiblePerson:{support:!1,msrEuId:``,eu_contact_module_list:[]},sizeTemplateId:``,sizeTemplateList:[],qualificationStructList:[],enableEuQualification:1,isSupportNewSizeTmp:!1,isNewSizeTmp:!1,newSizeModel:``,newSizeModelList:[],newSizeTmpTypeList:[],newSizeTmpTypeMap:g,sizechartIdList:Array.from({length:5}).fill(``),manufacturerId:``,aeCustomAttrInfo:{carInfo:[],cloneCarInfo:[],delCarInfo:[],type:``,carType:!1},tax_type:`1`,hsInfo:{},skuSpecialTypeList:[],choiceSkuSpecialTypeList:[],brandManufacturerIdList:[],taoTuOpen:!1,aegCountry:[],aegCountryList:[],aegWarehouseList:[]}},getGoodsSaveWireLessDetail(e){let t=[];for(let n of e)n.type===``?t.at(-1).list.push(n):t.push({type:n.type,list:[n]});return{version:`2.0.0`,moduleList:t.map(e=>
1e.type===`image`?{type:e.type,images:e.list.map(e=>{let t=e.style||{};return t.width||delete t.width,t.height||delete t.height,{url:e.value,style:t,targetUrl:e.targetUrl}})}:e.type===`text`?{type:e.type,texts:e.list.map(e=>{let t=e.style||{};return t.fontSize&&=Number(t.fontSize),{content:e.value,class:e.class,style:{...e.style||{}}}})}:e.type===`media`?e:null).filter(Boolean)}},getWireLessFromLocal(e){function t(){return{fontSize:`13`,color:`#333333`,align:`left`}}try{return(e?.moduleList||[]).map(e=>e.type===`media`?e:e.type===`image`?e.images.map(e=>({type:`image`,value:e.url,style:e.style||{},targetUrl:e.targetUrl})):e.type===`text`?e.texts.map(e=>({type:`text`,value:e.content,style:Object.assign(t(),e.style||{}),class:e.class})):e.type===`text-image`?[...(e.texts||[]).map(e=>({type:`text`,value:e.content,style:Object.assign(t(),e.style||{}),class:e.class})),...(e.images||[]).map(e=>({type:`image`,value:e.url,style:e.style||{},targetUrl:e.targetUrl}))]:null).flat().filter(Boolean)}catch{return[]}},getWebDetailFromOnline(e){let t=[];return x(e,`moduleList`)&&T(e.moduleList).forEach(e=>{switch(e.type){case`text`:(e.texts||[]).forEach(e=>{e.class===`title`?t.push(`<h3>${e.content}</h3>`):t.push(`<p>${e.content}</p>`)});break;case`image`:(e.images||[]).forEach(e=>{t.push(`<img src="${e.url}">`)});break;case`text-image`:e.texts&&e.texts.length&&e.texts.forEach(e=>{e.class===`title`?t.push(`<h3>${e.content}</h3>`):t.push(`<p>${e.content}</p>`)}),e.images&&e.images.length&&e.images.forEach(e=>{t.push(`<img src="${e.url}">`)});break;case`html`:t.push(`<h3>${e.html.content}</h3>`)}}),t.join(``)},getSaveData(e){let{cateInfo:t}=e,{manualReqiredFlg:n,installVideoReqiredFlg:r}=t,i=Y.getGoodsSaveAttrData(e.attrData),a=Y.getGoodsSaveDiyAttrData(e.diyAttrData),o=X.getGoodsSaveSkuData(e.skuData),s=X.getGoodsSavePriceStoreData(e.skuGroup.dataAll),c=Z.getGoodsSaveAreaPriceData(e.areaPrice),{images:l}=De.getGoodsImage(e).find(e=>e.title===`PC详情图片`)||{},d=this.getGoodsSaveWireLessDetail(e.wirelessDetail),f=(e.mainVideo.media_id?[e.mainVideo]:[]).map(e=>({id:e.media_id,imageUrl:e.poster_url,name:e.name,videoUrl:e.video_url})),m=(()=>{let e=Object.values(i).find(e=>e.attrName===`Brand Name`);return p(e,`valueName`,``)})(),h=_e(e.aeCustomAttrInfo),g=e.aeCustomAttrInfo.carInfo.map(e=>{let{_checked:t,...n}=e;return n}),_=e.aeCustomAttrInfo.cloneCarInfo.filter(t=>e.aeCustomAttrInfo.carInfo.some(e=>e.afid==t.afid));g.filter(e=>!_.some(t=>t.afid==e.afid));let v=e.aeCustomAttrInfo.cloneCarInfo.filter(e=>!_.some(t=>t.afid==e.afid)).map(e=>{let{_checked:t,...n}=e;return n}),y=K(e.qualificationStructList,e.enableEuQualification),b=x();function x(){let{aegCountry:t,skuGroup:n,cateInfo:r}=e,{isMultiSkuFlg:i}=r;return{countryList:t,currencyCode:e.shop.currency||`USD`,skuList:n.dataAll.map(e=>{let t=Object.keys(e).filter(e=>e.match(/^skuId.+/)),{price:n,storeNumber:r,skuCode:a,original_box:o,special_product_type_list:s,logistic_attr_list:c,barCode:l,itemCode:u,packageLength:d,packageWidth:f,packageHeight:p,weight:m,sku_cate:h}=e.aeg,g={base_price:n,package_length:d,package_width:f,package_height:p,package_weight:m,sku_code:a,pop_choice_product_sku_sc_item_info:{original_box:o,special_product_type_list:s,logistic_attr_list:c,sc_item_bar_code:l,sc_item_code:u},pop_choice_sku_warehouse_stock_list:r.map(e=>({warehouse_code:e.value,warehouse_name:e.name,sellable_quantity:+e.storeNumber})),sku_property_list:t.map(t=>{let{attrId:n,attrName:r,valueId:i,valueName:a,valueNameOld:o}=e[t];return{sku_property_id_long:n,sku_property_name:r,property_value_id_long:i,sku_property_value:o,property_value_definition_name:o===a?``:a}})};return i&&(g.sku_cate=h),g})}}return X.alignSkuPriceAttributesWithSkuData(s,o),{id:e.id,storeId:e.storeId,cateId:e.category.categoryId,cateName:e.category.categoryName,source:e?.sourceData?.source||``,sourceUrl:JSON.stringify(e.sourceData.sourceUrl),productTitle:e.productTitle,groupList:JSON.stringify(e.group),scImages:JSON.stringify(e.scImages),marketImages:JSON.stringify(e.marketImages.map((e,t)=>({image_type:t==0?2:1,url:e})).filter(e=>e.url)),aeopAeVideos:JSON.stringify(f?.[0]||{}),productManual:n?e.productManual:``,installVideo:r?JSON.stringify(e.installVideo):null,aeCatProp:JSON.stringify(i),customMoreProperty:JSON.stringify(a),saleProp:JSON.stringify(o),sku:JSON.stringify(s),productUnit:e.productUnit,packageType:+e.packageType==1?`true`:`false`,lotNum:e.lotNum,ladderPrice
1:u(e),supportWholesalePrice:!e.isBStore&&e.batchPrice.isBatchPrice,bulkOrder:e.isBStore||!e.batchPrice.isBatchPrice?``:e.batchPrice.batchNum,bulkDiscount:e.isBStore||!e.batchPrice.isBatchPrice?``:e.batchPrice.batchDiscount,currencyCode:e.shop.currency,nationalQuoteConfiguration:JSON.stringify(c),deliveryTime:e.deliveryDate,grossWeight:e.weight,isPackSell:e.is_pack_sell,baseUnit:e.base_unit,addUnit:e.add_unit,addWeight:e.add_weight,sizeInfo:JSON.stringify({l:e.packageLength,w:e.packageWidth,h:e.packageHeight}),shippingTemplateId:e.shippingTemplateId,promiseTemplateId:e.serviceTemplateId,detailType:+e.detailType==1?0:1,webDetail:e.webDetail,wirelessDetail:JSON.stringify(d),wirelessDetailType:`暂无`,reduceStrategy:e.reduce_strategy,sizechartId:e.isNewSizeTmp?``:e.sizeTemplateId,msrEuId:e.responsiblePerson.msrEuId,qualificationStructList:JSON.stringify(y),enableEuQualification:Number(e.enableEuQualification)===0?0:1,sizechartIdList:e.isNewSizeTmp?e.sizechartIdList.filter(Boolean).join(`,`):``,brandName:m,manufacturerId:e.manufacturerId,carInfo:JSON.stringify(h),deleteCarInfo:JSON.stringify(v),type:e.aeCustomAttrInfo.type,tax_type:e.tax_type,hsInfo:JSON.stringify(e.hsInfo),choiceData:JSON.stringify(b)}},async save(e){await o(e);let t=this.getSaveData(e);e.goodsType===`local`&&(t.isChoice=e.isChoice);let{id:n}=await U(t);return n},async saveAsTemp(e){await o(e);let{cateInfo:t}=e,{manualReqiredFlg:n}=t,r=e.template.modules,i=Y.getGoodsSaveAttrData(e.attrData),a=Y.getGoodsSaveDiyAttrData(e.diyAttrData),s=X.getGoodsSaveSkuData(e.skuData),c=X.getGoodsSavePriceStoreData(e.skuGroup.dataAll),l=Z.getGoodsSaveAreaPriceData(e.areaPrice),d=K(e.qualificationStructList,e.enableEuQualification);return await ie({id:e.template.id||void 0,storeId:e.storeId,tempName:e.template.name,modules:r,cateId:e.category.categoryId,cateName:e.category.categoryName,baseInfo:{groupList:e.group,productManual:n?e.productManual:``},attrInfo:i,customAttrInfo:a,skuInfo:{saleProp:s},tradeInfo:{productUnit:e.productUnit,packageType:e.packageType==1?`true`:`false`,lotNum:e.lotNum,ladderPrice:u(e),supportWholesalePrice:!e.isBStore&&e.batchPrice.isBatchPrice,bulkOrder:e.isBStore||!e.batchPrice.isBatchPrice?``:e.batchPrice.batchNum,bulkDiscount:e.isBStore||!e.batchPrice.isBatchPrice?``:e.batchPrice.batchDiscount,baseUnit:e.base_unit,currencyCode:e.shop.currency,sku:c},packInfo:{deliveryTime:e.deliveryDate,grossWeight:e.weight,isPackSell:e.is_pack_sell,baseUnit:e.base_unit,addUnit:e.add_unit,addWeight:e.add_weight,sizeInfo:JSON.stringify({l:e.packageLength,w:e.packageWidth,h:e.packageHeight}),shippingTemplateId:e.shippingTemplateId,promiseTemplateId:e.serviceTemplateId},detailInfo:{},customInfo:{nationalQuoteConfiguration:JSON.stringify(l),reduceStrategy:e.reduce_strategy,sizechartId:e.isNewSizeTmp?``:e.sizeTemplateId,msrEuId:e.responsiblePerson.msrEuId,qualificationStructList:JSON.stringify(d),enableEuQualification:Number(e.enableEuQualification)===0?0:1,sizechartIdList:e.isNewSizeTmp?e.sizechartIdList.filter(Boolean).join(`,`):``,manufacturerId:e.manufacturerId}})},async saveToOnline(e,t,n){await o(e);let i=e.isBStore&&r(e.ladderPrice);if(i)throw Error(i);let a=this.getSaveData(e);if(a.productId=e.online.productId,t===`onlineZd`||t===`onlineZdDxb`)return{storeId:e.storeId,proId:e.online.productId,id:e.id,data:JSON.stringify(a)};if(t===`getSettingData`)return a;await B({storeId:e.storeId,id:e.id,productId:e.online.productId,data:JSON.stringify(a),isUpgradeChoic:+!!n})},async onlineSave2Local({storeId:e,id:t,productId:n},r){let[i]=await V({storeId:e,id:n});i.storeId=e,i.id=t;let a=await this.toSettingFromSameOnline(this.getDefaultSetting(),i,r),{id:o}=await this.save(a);return o},async toSettingFromLocal(e,t,n,r=!0){let{productUnitList:a,robotDetail:o,installVideo:s}=e,c=p(t,`source`,``),l=[p(t,`sourceUrl`,[``],T)].flat(),u=p(t,`sourceMainImgs`,[],T),d=p(t,`sourceSkuImgs`,[],T),m=p(t,`sourceDetailImgs`,[],T),h=p(t,`customAttrInfo.customMoreProperty`,[],T).map(e=>{let{attrId:t,attrName:n,valueId:r,valueName:i}=e;return{attrId:t||``,attrName:n||``,valueId:r||``,valueName:i||``}}),g=p(t,`onlineInfo`,null),_=p(t,`id`,``),v=p(t,`storeId`,``,String),y=n(v),b=p(t,`cateInfo.catId`,``,String),x=p(t,`cateInfo.cateName`,``,String),S=p(t,`baseInfo.productTitle`,``),C=p(t,`baseInfo.groupList`,[],T),O=p(t,`isChoice`,0,Number),A=p(t,`baseInfo.scImages`,[],T),j=p(t,`baseInfo.marketImages`,[``,``],e=>{let t=T(e).find(e=>`${e.image_type}`==`1`),n=T(e).find(e=>`${e.image_type}`==`2`);return[p(n,`url`,``),p(t,`url`,``)]}),M=p(t,`baseInfo.aeopAeVideos`,{},D),N=p(t,`baseInfo.productManual`,``),P=p(t,`baseInfo.installVideo`,s,D),F={poster_url:M.imageUrl||``,media_type:M.media_type||`MAIN_IMAGE_VIDEO`,media_id:M.id||``,video_url:M.videoUrl||M.id?`https://video.aliexpress-media.com/play/${M.id}.mp4`:``,name:M.name||``},I=p(t,`choiceData.countryList`,[],T),ee=p(t,`attrInfo.aeCatProp`,{},D),L=p(t,`attrInfo.customMoreProperty`,[],e=>Object.values(D(e)).map(e=>({attrName:e.attrName||``,valueName:e.valueName||``}))),te=p(t,`skuInfo.saleProp`,{},D),ne=p(t,`tradeInfo.sku`,[],T).map(e=>(String(e.sku_id||``).match(/\d+:\d+/)&&(e.sku_id=``),e)),R=p(t,`tradeInfo.productUnit`,`100000015`),z=a.find(e=>e.type===R),B=p(z,`type`,`100000015`),V=p(z,`name_zh`,`件/个`),H=p(t,`tradeInfo.packageType`,0,e=>({true:1,false:0})[e]||+e),U=p(t,`tradeInfo.supportWholesalePrice`,!1,Boolean),ie=p(t,`tradeInfo.bulkOrder`,``),ae=p(t,`tradeInfo.bulkDiscount`,``),oe=p(t,`tradeInfo.lotNum`,``),se=p(t,`nationalQuoteConfiguration`,{},D),ce=p(t,`packInfo.deliveryTime`,``),le=p(t,`packInfo.grossWeight`,``),ue=p(t,`packInfo.isPackSell`,!1,Boolean),de=p(t,`packInfo.baseUnit`,``),fe=p(t,`packInfo.addUnit`,``),pe=p(t,`packInfo.addWeight`,``),me=p(t,`packInfo.sizeInfo`,null,D),he=p(me,`l`,``),G=p(me,`w`,``),_e=p(me,`h`,``),K=p(t,`packInfo.hsInfo`,{},D),ve={...K,hsCode:K.hsCode||``},be={weight:le,packageLength:he,packageWidth:G,packageHeight:_e},xe=p(t,`detailType`,`1`,e=>`${e}`==`1`?`0`:`1`),Se=p(t,`detailInfo.webDetail`,``),Ce=this.getWireLessFromLocal(p(t,`detailInfo.wirelessDetail`,{},D)),we=p(t,`otherInfo.reduceStrategy`,`place_order_withhold`),q=p(t,`otherInfo.tax_type`,`1`),Te=p(t,`otherInfo.enableEuQualification`,p(t,`enableEuQualification`,1),Number),J=await $(),Ee=p(J,`skuData`,[]).find(e=>`${e.id}`==`14`),De=p(Ee,`dataValue[0].deep_image`,!1);async function $(){try{let e=await ye(),t=await k(),n=await je(),r=await Ae()||{},i=await Me()||{},a=await ke(r.isChoiceAuth)||{};return Oe({skuGroup:p(i,`skuGroup.dataAll`,[]),warehouseList:p(a,`aegWarehouseList`,[])}),{skuSpecialTypeList:e.filter(e=>e.isSupportPop),choiceSkuSpecialTypeList:e.filter(e=>e.isSupportAeg),countryList:t,robotDetail:n,...r,...i,...a}}catch{return{}}}function Oe({skuGroup:e,warehouseList:n}){let r=p(t,`choiceData.skuList`,[],T).reduce((e,t)=>
1{let n=t.sku_property_list.sort((e,t)=>e.sku_property_id_long-t.sku_property_id_long).map(e=>[e.sku_property_id_long,e.property_value_id_long].join(`:`)).join(`;`);return e[n]=t,e},{});e.forEach(e=>{let t=i.getIdStr(e),{base_price:a,package_length:o,package_width:s,package_height:c,package_weight:l,sku_code:u,pop_choice_product_sku_sc_item_info:d,pop_choice_sku_warehouse_stock_list:f,sku_cate:p}=r[t]||{},m=T(f).reduce((e,t)=>(e[t.warehouse_code]=t.sellable_quantity,e),{}),{original_box:h,sc_item_bar_code:g,sc_item_code:_,special_product_type_list:v,logistic_attr_list:y}=d||{};e.aeg={price:a||``,storeNumber:n.map(e=>{let t=m[e.value]===void 0?``:m[e.value];return{name:e.name,value:e.value,storeNumber:t}}),skuCode:u||``,itemCode:_||``,barCode:g||``,original_box:[void 0,``].includes(h)?`0`:`${h}`,weight:l||``,packageLength:o||``,packageWidth:s||``,packageHeight:c||``,special_product_type_list:v||[],logistic_attr_list:y||[],sku_cate:{...e.aeg.sku_cate||{},...p||{}}}})}async function ke(e){if(!e)return null;let{pop_choice_country_list:t,pop_choice_warehouse_list:n}=await re({ptName:`aeg`,storeId:v,type:`new`}),r=T(t);return{aegCountryList:r,aegWarehouseList:T(n).map(e=>({name:e.warehouse_name,value:e.warehouse_code})),aegCountry:I.length?I:r.map(e=>e.country_code)}}async function Ae(){if(!v)return;let{manufactureList:e,shippingTemplateList:n,serviceTemplateList:r,isChoiceAuth:i}=await Q.changeStore(v),a=p(t,`packInfo.shippingTemplateId`,``,String);n.find(e=>`${e.templateId}`==`${a}`)||n.push({templateId:a,templateName:`智能运费模板`});let o=a,s=p(t,`packInfo.promiseTemplateId`,``,String),c=r.find(e=>`${e.id}`==`${s}`),l=p(c,`id`,``,String),u=p(t,`otherInfo.manufacturerId`,``,String),d=e.find(e=>`${e.id}`==`${u}`);return{manufacturerId:p(d,`id`,``,String),brandManufacturerIdList:e,shippingTemplateId:o,shippingTemplateList:n,serviceTemplateId:l,serviceTemplateList:r,isChoiceAuth:i,isChoice:i?O:0}}async function je(){if(_&&`${xe}`==`0`&&t.applyStatus){let e={goodsId:g?g.productId:_,applyType:g?`online`:`local`},t=await W(e);return{goodsId:t.goodsId,html:t.html,json:t.json,applyStatus:!0}}return o}async function Me(){if(!v||!b||!r)return;let{attrData:n,sizeTemplateData:i,responsiblePersonData:a,isSupportNewSizeTmp:o,newSizeTmpTypeList:s,isCar:c,cateInfo:l}=await Q.changeCategory(v,b),u=Y.getAttrDataFromLocal(ee),d=await Y.merge({attrData:E(n||[]),valueData:u,storeId:v,categoryId:b,country:p(y,`country`,`CN`)}),f=X.getSkuDataFromLocal(te),m=await X.merge({attrData:E(n||[]),valueData:f,storeId:v,categoryId:b,country:p(y,`country`,`CN`)}),h=X.getSkuGroupFromLocal(m,ne,be),_=await Z.merge({skuGroup:h,valueData:se}),{matchSizeModel:C}=X.filterSizeDataValueByNewSizeModel(m,o),D=X.getNewSizeModelList(m),k=C||p(D,`0.value`,``),A=p(t,`otherInfo.sizechartIdList`,Array.from({length:5}).fill(``),e=>{let t=String(e).split(`,`);return s.map(e=>{let n=i.filter(t=>t.sub_type===e.value).map(e=>`${e.sizechart_id}`);return t.find(e=>n.includes(e))||``})}),j=p(t,`otherInfo.sizechartId`,``,String),M=i.find(e=>`${e.sizechartId}`==`${j}`),N=p(M,`sizechartId`,``,String),P=p(t,`otherInfo.msrEuId`,``,String),{support:F,eu_contact_module_list:L}=a,R=L.find(e=>`${e.msr_eu_id}`==`${P}`),z={support:F,eu_contact_module_list:L,msrEuId:p(R,`msr_eu_id`,``,String)},B=p(t,`carType`,``),V=ge(p(t,`customAttrInfo.carInfo`,[])).map(e=>(e._checked=!1,e)),re=p(t,`otherInfo.qualificationStructList`,[],T),H=await Q.getCategoryQualificationData({...e,storeId:v,shop:y,productTitle:S,category:{categoryId:b,categoryName:p(l,`fullCnName`,x)},attrData:d,areaPrice:_,online:g||{},isChoice:O,enableEuQualification:Te,aegCountry:I},re),U={current:1,total:0,pageSize:10};return{attrData:d,skuData:m,skuGroup:{dataAll:h,data:w(h,U),page:U,filterObject:{}},areaPrice:_,responsiblePerson:z,sizeTemplateId:N,sizeTemplateList:i,isSupportNewSizeTmp:o,isNewSizeTmp:o,newSizeModelList:D,newSizeModel:k,newSizeTmpTypeList:s,sizechartIdList:A,aeCustomAttrInfo:{carType:typeof B==`boolean`?c:Number(B)||c,carInfo:V,cloneCarInfo:E(V),type:``},qualificationStructList:H,category:{categoryId:p(l,`catId`,b,String),categoryName:p(l,`fullCnName`,x)},virtualProductTag:p(l,`virtualProductTag`,!1,Boolean),cateInfo:l}}return Object.assign(e,{sourceData:{source:c,sourceUrl:l,mainImages:u,skuImages:d,detailImages:m,sourceAttr:h},shop:y,id:_,goodsType:`local`,storeId:v,category:{categoryId:b,categoryName:x},virtualProductTag:!1,productTitle:S,isChoice:O,group:C,scImages:A,marketImages:j,mainVideo:F,productManual:N,installVideo:P,diyAttrData:L,productUnit:B,productUnitName:V,packageType:H,ladderPrice
1:f(p(t,`tradeInfo.ladderPrice`,null,T)),batchPrice:{isBatchPrice:U,batchNum:ie,batchDiscount:ae},lotNum:oe,deliveryDate:ce,weight:le,is_pack_sell:ue,base_unit:de,add_unit:fe,add_weight:pe,packageLength:he,packageWidth:G,packageHeight:_e,hsInfo:ve,detailType:xe,webDetail:Se,wirelessDetail:Ce,reduce_strategy:we,tax_type:q,enableEuQualification:Number(Te)===0?0:1,taoTuOpen:De,...J}),e},async toSettingFromTemplate(e,t,n){let{id:r,tempName:i,modules:a,storeId:o,cateId:s,cateName:c,baseInfo:l,customAttrInfo:u,tradeInfo:d,packInfo:f,attrInfo:m,skuInfo:h,customInfo:g}=t,_=p(g,`nationalQuoteConfiguration`,{}),v={id:r,storeId:o,cateInfo:{catId:s,cateName:c},baseInfo:l,attrInfo:{aeCatProp:m,customMoreProperty:u},customAttrInfo:{customMoreProperty:u},skuInfo:h,tradeInfo:d,packInfo:f,otherInfo:g,nationalQuoteConfiguration:_},y=await Q.toSettingFromLocal(e,v,n);return Object.assign(y.template,{id:r,name:i,modules:T(a)}),y.goodsType=`template`,y.isChoice=0,y},async toSettingFromOnline(e,t,n){Object.hasOwn(t,`subject_list`)&&(t=this.toCamelCase(t));let{id:r,productId:i,storeId:a,categoryId:o,categoryName:s,subjectList:c,groupIds:l,imageURLs:u,productManual:d,installVideoId:f,installVideoPosterUrl:m,msrEuId:h,aeopAEMultimedia:g,aeopAeProductPropertys:_,productUnit:v,packageType:y,supportWholesalePrice:b,bulkOrder:x,bulkDiscount:S,lotNum:C,deliveryTime:w,grossWeight:E,isPackSell:O,baseUnit:k,addUnit:A,addWeight:j,packageLength:M,packageWidth:F,packageHeight:ee,aeopQualificationStructList:L,freightTemplateId:R,promiseTemplateId:z,reduceStrategy:B,sizechartId:re,detailSourceList:H,aeopAeProductSKUs:U,aeopNationalQuoteConfiguration:ie,manufacturerId:ae,taxType:oe,sizechartIdList:se,carType:ce,hscode:le,enableEuQualification:ue}=t,de=T(c).find(e=>e.locale===`en_US`),fe=T(t.marketImages||[]).map(e=>(e.image_type=e.imageType,e)),W=D(g||{})?.aeopAEVideos?.[0]||{},he=T(_).filter(e=>e.attrNameId<0).map((e,t)=>(e.index=t,e)).reduce((e,t)=>(e[t.index]={attrName:t.attrName,valueName:t.attrValue||t.valueName||``},e),{}),{mobileDetail:G,webDetail:_e}=T(H).find(e=>e.locale===`en_US`)||{},K=this.getWebDetailFromOnline(D(_e)),{applyStatus:ve}=await I({id:r}),ye=await J(),be=Ee(),xe=Y(),Se=X(),Ce=D(ie),we=await Te(),q=await Z();async function Te(){let e=p(t,`customAttrInfo.carInfo`,[],T);e=ge(e);let n=pe(ce)||`car`;return e.length||(e=await P({currentPage:1,pageSize:5e3,ptName:`ae`,storeId:a,productId:i,vehicleType:n,version:me(n)})),ge(e).length||(e=await te({storeId:a,productId:i,vehicleType:n})),ge(e).map(e=>({_checked:!1,...e}))}async function J(){if(l&&l.length){let e=await N({storeId:a,groupId:l[0],searchLower:!1,searchName:!1});return l.map(t=>e[t]).filter(Boolean).map(e=>{let{groupIds:t,groupNames:n}=e;return{groupId:t.at(-1),groupName:n.at(-1)}})}return[]}function Ee(){let e=1;return T(_).filter(e=>e.attrNameId>=0).reduce((t,n)=>(t[e++]={attrId:n.attrNameId||``,attrName:n.attrName||``,valueName:n.attrValue||``,valueId:n.attrValueId||``,percent:n.percent||``},t),{})}function Y(){let e={};return T(U).forEach(t=>{let{aeopSKUPropertyList:n}=t;T(n).forEach(t=>{let{skuPropertyName:n,parentPropertyId:r,parentValueId:i,imageUrlList:a,deep_image:o,skuImage:s,skuPropertyId:c,propertyValueDefinitionName:l,skuPropertyValue:u,propertyValueId:d}=t,f=[c,d].join(`:`);e[f]||(e[f]={attrId:c,attrName:n||``,valueId:d,valueName:l||u,sku_custom_image_url:s,sku_custom_value_name:l,deep_image:o,image_url_list:a,parent_property_id:r,parent_value_id:i})})}),e}function X(){return T(U).map(e=>{let{skuPrice:t,cargoPrice:n,ipmSkuStock:r,mobileModelSkuImage:i,skuId:a,skuCode:o,aeopSKUPropertyList:s,originalBox:c,packageWeight:l,packageLength:u,packageWidth:d,packageHeight:f,specialProductTypeList:p,logisticAttrList:m,skuFreightId:h}=e;return{price:t,cargo_price:n,sku_code:o,skuId:a,inventory_dto_list:{current_inventory:r===0?`0`:r,src_inventory:``,store_code:``},attributes:T(s).map(e=>{let{skuPropertyName:t,parentPropertyId:n,parentValueId:r,imageUrlList:i,deep_image:a,skuImage:o,skuPropertyId:s,propertyValueDefinitionName:c,skuPropertyValue:l,propertyValueId:u}=e;return{attrId:s,attrName:t||``,valueId:u,valueName:c||l,sku_custom_image_url:o,sku_custom_value_name:c,deep_image:a,image_url_list:i,parent_property_id:n,parent_value_id:r}}),mobile_model_sku_image:i,package_weight:l,package_length:u,package_width:d,package_height:f,original_box:c,special_product_type_list:p,logistic_attr_list:m,sku_freight_id:h}})}async function Z(){let{sourceName:e,source:t,sourceImages:n,customAttrInfo:i,isChoice:a}=await ne({id:r});return{source:e,sourceUrl:t,sourceMainImgs:p(n,`mainImage`,[]),sourceSkuImgs:p(n,`skuImage`,[]),sourceDetailImgs:p(n,`detailImage`,[]),isChoice:a,sourceAttr:p(i,`customMoreProperty`,[])}}let De={id:r,storeId:a,cateInfo:{catId:o,cateName:s},baseInfo:{productTitle:de?.value||``,scImages:u.split(`;`),marketImages:fe,groupList:ye,aeopAeVideos:{id:W.mediaId||``,imageUrl:W.posterUrl||``,name:W.name||W.mediaId||``,videoUrl:W.videoUrl||W.mediaId?`https://video.aliexpress-media.com/play/${W.mediaId}.mp4`:``},productManual:d,installVideo:{poster_url:m,media_id:f,video_url:f?`https://video.aliexpress-media.com/play/${f}.mp4`:``,name:``}},attrInfo:{aeCatProp:be,customMoreProperty:he},customAttrInfo:{carInfo:we,customMoreProperty:q.sourceAttr},skuInfo:{saleProp:xe}
1,tradeInfo:{lotNum:C,ladderPrice:p(t,`tradeInfo.ladderPrice`,t.ladderPrice),supportWholesalePrice:!!S||!!x,productUnit:v,sku:Se,bulkDiscount:S,packageType:y,bulkOrder:x},packInfo:{grossWeight:E,promiseTemplateId:z,sizeInfo:{l:M,w:F,h:ee},deliveryTime:w,isPackSell:O,baseUnit:k,addUnit:A,addWeight:j,shippingTemplateId:R,hsInfo:le},detailInfo:{webDetail:K,wirelessDetail:G},otherInfo:{reduceStrategy:B,sizechartId:re,sizechartIdList:T(se).join(`,`),msrEuId:h,manufacturerId:ae,qualificationStructList:L,tax_type:oe,enableEuQualification:ue},nationalQuoteConfiguration:{configuration_data:Ce.configurationData,configuration_type:Ce.configurationType},detailType:0,applyStatus:ve,onlineInfo:{productId:i},carType:ce,...q},$=await Q.toSettingFromLocal(e,De,n);if($.goodsType=`online`,$.online.productId=`${i}`,$.online.shippingTemplateId=`${R}`,+$.isChoice==1){let{product_sku_list:e,joined_country_list:t}=await V({ptName:`aeg`,storeId:a,id:r});$.choiceCountryList=e.map(e=>({sku_property_list:e.sku_property_list,choice_sku_price_list:e.choice_sku_price_list})),$.choiceCountryJoinedList=t,$.areaPrice.countryList.forEach(e=>{e.disabled=t.includes(e.type)})}return $},async toSettingFromSameOnline(e,t,n){return e=await this.toSettingFromOnline(e,t,n),e.goodsType=`local`,e.id=``,e.choiceCountryList=[],e.areaPrice.countryList.forEach(e=>{e.disabled=!1}),e},async toSettingFromAegOnline(e,t,n){t=this.toCamelCase(t);let{id:r,productId:i,storeId:a,categoryId:o,categoryName:s,subjectList:c,imageURLs:l,aeopAEMultimedia:u,aeopAeProductPropertys:d,productUnit:m,packageType:h,bulkOrder:g,bulkDiscount:_,lotNum:v,deliveryTime:y,grossWeight:b,isPackSell:x,baseUnit:S,addUnit:C,addWeight:w,packageLength:E,packageWidth:O,packageHeight:A,aeopQualificationStructList:j,freightTemplateId:M,promiseTemplateId:N,reduceStrategy:P,detailSourceList:F,aeopAeProductSKUs:I,aeopNationalQuoteConfiguration:ee,enableEuQualification:L}=t;o||=t.category_id;let te=T(c).find(e=>e.locale===`en_US`),ne=T(t.marketImages||[]),R=D(u||{})?.aeopAEVideos?.[0]||{},{mobileDetail:z,webDetail:B}=T(F).find(e=>e.locale===`en_US`)||{};e.areaPrice.countryList=await k(),e.online.productId=String(i),e.id=r,e.goodsType=`online`,e.storeId=a,e.category={categoryId:String(o||``),categoryName:s||``},e.productTitle=te?.value||``,e.marketImages=[ne.find(e=>e.imageType==2)?.url||``,ne.find(e=>e.imageType==1)?.url||``],e.mainVideo={poster_url:R.posterUrl||``,media_type:R.mediaType||`MAIN_IMAGE_VIDEO`,media_id:R.mediaId||``,video_url:R.videoUrl||`https://video.aliexpress-media.com/play/${R.mediaId}.mp4`,name:R.name||R.mediaId||``},e.diyAttrData=T(d).filter(e=>e.attrNameId<0).map(e=>({attrName:e.attrName,valueName:e.attrValue||e.valueName||``})),e.productUnit=String(m||`100000015`);let V=e.productUnitList.find(t=>t.type==e.productUnit);if(e.productUnitName=V?.name_zh||`未知单位`,V||(e.productUnit=`100000015`,e.productUnitName=`件/个`),e.packageType=Number(h),e.ladderPrice=f(p(t,`tradeInfo.ladderPrice`,t.ladderPrice)),e.batchPrice={isBatchPrice:!!_||!!g,batchNum:g||``,batchDiscount:_||``},e.lotNum=v||``,e.deliveryDate=y||``,e.weight=b||``,e.is_pack_sell=!!x,e.base_unit=S||``,e.add_unit=C||``,e.add_weight=w||``,e.packageLength=E||``,e.packageWidth=O||``,e.packageHeight=A||``,e.shippingTemplateId=String(M||``),e.serviceTemplateId=String(N??``),e.detailType=1,e.reduce_strategy=P||`place_order_withhold`,e.qualificationStructList=T(j||[]),e.enableEuQualification=Number(L)===0?0:1,a&&n&&(e.shop=n(a)),a&&o){let[t]=await Promise.all([H({storeId:a,categoryId:o,ptName:`aeg`,storeType:`aeg`})]);e.attrData=await Y.mergeAeg({attrData:t||[],valueData:Y.getAttrDataFromOnline(T(d)),storeId:a,categoryId:o}),e.skuData=await X.merge({attrData:t||[],storeId:a,categoryId:o,country:p(e,`shop.country`,`CN`)}),e.skuData=await X.merge({attrData:t||[],valueData:X.getSkuDataFromOnline(e.skuData,T(I)),storeId:a,categoryId:o,country:p(e,`shop.country`,`CN`)}),e.skuGroup.dataAll=X.getSkuGroupFromOnline(e.skuData,T(I));let n=D(ee);e.areaPrice=await Z.merge({skuGroup:e.skuGroup.dataAll,valueData:{configuration_data:n.configurationData,configuration_type:n.configurationType}})}return e},toAeOldSetting(e){let{id:t,online:n,goodsType:r,storeId:i,category:a,productTitle:o,group:s,scImages:c,marketImages:l,mainVideo:u,attrData:d,diyAttrData:f,skuData:p,productUnit:m,base_unit:h,packageType:g,batchPr
1ice:_,lotNum:v,shop:y,deliveryDate:b,weight:x,is_pack_sell:S,add_unit:C,add_weight:w,packageLength:T,packageWidth:E,packageHeight:D,shippingTemplateId:O,serviceTemplateId:k,reduce_strategy:A,detailType:j,webDetail:M,robotDetail:N,sourceData:P}=e,F=(u.media_id?[u]:[]).map(e=>({id:e.media_id,imageUrl:e.poster_url,name:e.name,videoUrl:e.video_url})),I=Y.getGoodsSaveAttrData(d),ee=X.getGoodsSaveSkuData(p),L=X.getGoodsSavePriceStoreData(e.skuGroup.dataAll);Z.getGoodsSaveAreaPriceData(e.areaPrice);let te=this.getGoodsSaveWireLessDetail(e.wirelessDetail);return{id:t,onlineGoodsId:n.productId,goodsType:r,storeId:i,categoryId:a.categoryId,categoryName:a.categoryName,title:o,language:`ENGLISH`,group:[],groupList:s,groupName:[],mainImage:c,marketImage:l,mainVideo:F?.[0]||null,attr:I,attrList:d,diyAttr:f.map(e=>({attrName:e.attrName,attrValue:e.valueName})),sku:ee,skuPrice:L,areaPriceCfg:{},areaPriceData:{},skuList:p.map(e=>(e.dataValue.forEach(e=>{e.customValueName=e.valueName||``,e.customImageUrl=e.image||``}),e)),yunfeiList:[],serviceTemplateList:[],sizeTemplateList:[],wholesale:{unitType:m,base_unit:h,saleType:g==1?`true`:`false`,batchNumber:v,is_bulk:_.isBatchPrice,bulk_order:_.isBatchPrice,bulk_discount:_.isBatchPrice,priceUnit:y.currency,deliveryDate:b,weight:x,is_pack_sell:S,add_unit:C,add_weight:w,packageLength:T,packageWidth:E,packageHeight:D,shippingTemplateId:O,serviceTemplateId:k,reduce_strategy:A},detailType:j==0?`robot`:`normal`,detailPc:M,detailWx:te,detailRobotInfo:N,applyStatus:N.applyStatus,sourceImages:{mainImage:P.mainImages,skuImage:P.skuImages,detailImage:P.detailImages},sourceDiyAttr:P.sourceAttr.map(e=>({attrName:e.attrName,attrValue:e.valueName})),source:P.sourceUrl}},toCamelCase(e){if(typeof e==`object`&&e){if(Array.isArray(e))return e.map(e=>this.toCamelCase(e));{let t={};for(let n in e)if(Object.hasOwn(e,n)){let r=n.replace(/_([a-z])/gi,(e,t)=>t.toUpperCase());t[r]=this.toCamelCase(e[n])}return t}}return e}}})))()}export{Q as a,Te as c,K as i,X as l,Y as n,$ as o,ve as r,De as s,Z as t};

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.