@expedite-commerce/expedite-components 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -142,4 +142,4 @@
|
|
|
142
142
|
query SalesforceActions($action: String!, $data: SalesforceData) {
|
|
143
143
|
salesforceActions(action: $action, data: $data)
|
|
144
144
|
}
|
|
145
|
-
`,Po={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function et({action:t,data:l,config:n={}}){var h,i;const r=lt(),o=n.apiKey??r.composablesApiKey.value,c=n.salesforceOrgId??r.organizationId.value,u=n.userId??r.userId.value,g=n.orgType??r.composablesOrgType.value,m=n.baseUrl??r.composablesApiUrl.value,p=Po[n.pathKey]??Po[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!p)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(Po).join(", ")}`);const d=`${m}${p}`;if(!c)throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let _;t?_={action:t,data:l}:_=l;const s={"x-api-key":o,"X-Salesforce-Org-Id":c,"X-Salesforce-Org-Type":g,"Content-Type":"application/json"};if(u&&(s["X-Salesforce-User-Id"]=u),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(_)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,s);const f=await Ne.post(d,_,{headers:s});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,f.data),!t&&((h=f.data)!=null&&h.data)&&typeof f.data.data=="string")try{f.data=JSON.parse(f.data.data)}catch(a){console.warn("[COMPOSABLES_API] Failed to parse data field:",a)}else if(!t&&((i=f.data)!=null&&i.data)&&typeof f.data.data=="object")try{f.data=f.data.data}catch(a){console.warn("[COMPOSABLES_API] Failed to parse content field:",a)}return f.data}catch(f){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,f),f}}const cn="https://d2pgvmpph8dmlo.cloudfront.net";function Dl(t,l,n){return t?t==null?void 0:t.map(r=>kp(r,l,n)):[]}function kp(t,l,n){const{url:r,staticResource:o}=t;if(!r)return null;if(r.includes("/resource/")&&!r.includes("://")&&o){const c=r.split("/"),u=c[c.length-1];return`${cn}/${n}/static/${u}.${l}`}else return r}const qo=Pe.defineStore("blockLegacy",()=>{const t=lt(),l=e.ref(null),n=e.ref(null),r=e.ref(!1),o=e.ref(null);async function c(d,_=!0){var i,f;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;_&&(l.value=[],r.value=!1);const s={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(s)),console.log("fetchBlockInformation getTemplateBlock",Vl);const h=await sr(Vl,s);if(console.log("fetchBlockInformation getTemplateBlockResponse",h),console.log("fetchBlockInformation pageBlocks",l.value),n.value=d.templateId,_)(i=h.content)!=null&&i.blocks?(l.value=u(JSON.parse(h.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",l.value)):l.value=[],r.value=!0;else return((f=h==null?void 0:h.content)==null?void 0:f.blocks)||[]}function u(d){const _=t.organizationId.value;return d==null||d.forEach(s=>{s.blocks=s.blocks?JSON.parse(s.blocks):[],s.blocks.forEach(h=>{var i,f;Object.assign(h,JSON.parse(h.contentJSON)),h.contentJSON=null,h.id=h.blockId||h.Id,(h.componentName==="catalogBlock"||h.componentName==="relatedProducts")&&(g(h.fields.productCard.actions),h.fields.noFriendlyURL=!0,h.fields.productCard.friendlyURL=null,h.fields.productCard.friendlyURLFields=null,(i=h.configuration)!=null&&i.productTemplateId?h.fields.productCard.url="/product/"+((f=h.configuration)==null?void 0:f.productTemplateId):h.fields.productCard.url=null),h.componentName==="productSummary"&&(console.log("block.fields.actions",h.fields.actions),g(h.fields.actions)),h.customJS&&(h.customJS=Dl(h.customJS,"js",_)),h.customCSS&&(h.customCSS=Dl(h.customCSS,"css",_))})}),d}function g(d){d.forEach(_=>{_.action==="CUSTOM_ACTION"&&(_.action="CUSTOM",_.name=_.label.title,_.value=_.url.field||_.url.title,_.newTab=_.openInNewTab)})}async function m(d,_=!0){var s;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){_&&(l.value=[],r.value=!1);try{const h=await et({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const i=(s=h==null?void 0:h.data)==null?void 0:s.blocks;if(console.log("fetchBlockInformationREST blocksData",i),_){if(i){const f=typeof i=="string"?JSON.parse(i):i;console.log("fetchBlockInformationREST parsedBlocks",f),l.value=u(f),console.log("fetchBlockInformationREST pageBlocks",l.value)}else console.log("fetchBlockInformationREST blocksData is null"),l.value=[];r.value=!0}else return i||[]}catch(h){throw console.error("fetchBlockInformationREST error:",h),_&&(l.value=[],r.value=!0),h}}}return{metaInfo:o,currentPageId:n,pageBlocks:l,blockLoaded:r,fetchBlockInformation:c,fetchBlockInformationREST:m,getFormattedSectionBlocks:d=>e.computed(()=>{const _=[];return l.value&&l.value.length>0&&l.value.forEach(s=>{const h=s.blocks;h&&h.length>0&&h.forEach(i=>{if(i.id=i.blockId,d){const f=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",s.sectionName,i.componentName),i&&i.configuration&&(f.includes(i.componentName)||i.configuration.isCheckoutBlock)&&_.push(i)}else i&&i.configuration&&!d&&_.push(i)})}),_})}}),Dt=async(t,l=null,n="",r=!1)=>{const o=lt();console.log("appsyncHandler composableStore",o);const c=o.graphqlEndpoint.value,u=o.apiKey.value;let g=200,m;const p=o.hostName.value;console.log("appsyncHandler currentHostname",p);const d=jo();try{const _=l;let s="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!s&&(s=d.activeStorefrontInfo.accountId),_.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(_.data.userType=d.activeStorefrontInfo.userType,_.data.accountId=s,_.data.domain=p);const h=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":u},body:JSON.stringify({query:t,variables:_})});if(m=await(h==null?void 0:h.json()),m=m.data,n)m=JSON.parse(m[n]),g=Number(m.statusCode),m=m.content,g===401&&console.info("401",t,JSON.stringify(l));else if(t.includes("SalesforceActions")){let i=m;i=JSON.parse(m.salesforceActions),i.statusCode==="401"&&console.info("401",t,JSON.stringify(l),m)}}catch(_){console.log(_),g=400,m=_}return{statusCode:g,response:m}},$o=["Needs Configuration","Suggests Configuration","Upload Configuration"],Bp=["Upload","Upload Add","Upload Configuration"],wp=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],Np=["CONFIGURE","UPLOAD","ADD_TO_CART"],Ap=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),Sp=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),dn=(t,l,n=!1)=>{const r=rt();let o,c,u;return n?(c=t.statusCode,u=t.content):(o=JSON.parse(t.response.salesforceActions),c=o.statusCode,u=o.content),Number(c)===200&&u&&u.message&&typeof u.message=="string"&&u.message.startsWith("ERROR:")?(r.handleError(u.message,"useExtractContent"),!1):Number(c)!==200||t.statusCode!==200||typeof u=="string"&&u.includes("ERROR:")||typeof u=="string"&&u.includes("Error:")||u.errorCode==="APEX_ERROR"?(u.errorCode==="APEX_ERROR"?r.handleError(u.message,"useExtractContent"):l||r.handleError(u,"useExtractContent"),!1):u},Mt=Pe.defineStore("catalog",()=>{const t=lt(),l=e.ref(!1),n=e.ref(0),r=e.ref(null),o=e.ref(null),c=e.ref([]),u=e.ref({}),g=e.ref({}),m=e.ref(null),p=e.ref(null),d=e.ref(!1),_=e.ref({search:""}),s=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),h=e.computed(()=>t.accountId.value),i=e.computed(()=>({domain:t.hostName.value,accountId:h.value,userType:t.userId.value}));function f(L="true"){Us(`qreset-${r.value}`,L)}async function a(L){try{const $={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray(L)?L:[L]},U=await et({data:$,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),T(!0),console.log("[CATALOG:deleteLineItems] success",U),f(),U}catch($){console.log("[CATALOG:deleteLineItems] error",$),f();return}}async function x(L){var B,O;if(!L.qty)return;const $=t.quoteId.value;if(!$)return;L.retry=1;const U={...L,quoteid:$},Q={action:"makeCall",data:{...i.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(U)}},Z=await Dt(kt,Q,void 0,!0),X=(O=(B=Z.response)==null?void 0:B.salesforceActions)==null?void 0:O.toLowerCase();(X.includes("record currently unavailable")||X.includes("unable_to_lock_row"))&&L.retry<3&&setTimeout(()=>{L.retry+=1,x(L)},500),dn(Z)&&T(!0),f()}async function y(L){var Q,Z,X,F;const $=t==null?void 0:t.quoteId.value;Array.isArray(L)&&(L=L[0]);const U={itemId:L.itemID,eCatalogItemId:L.eCatalogItemID,quantity:L.qty,accountId:h.value,qtyTierAmt:(L==null?void 0:L.qtyTierAmt)??null};$&&(U.quoteId=$);try{const B=await et({data:U,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),O=(B==null?void 0:B.quoteId)||((Q=B==null?void 0:B.data)==null?void 0:Q.quoteId)||((X=(Z=B==null?void 0:B.data)==null?void 0:Z.quote)==null?void 0:X.Id);O&&O!==$&&(r.value=O,t.updateConfig({quoteId:O}));const I=((F=B==null?void 0:B.data)==null?void 0:F.QliId)||(B==null?void 0:B.QliId)||null,R=L==null?void 0:L.itemID,P=L==null?void 0:L.qty;if(I&&R){const M=g.value?g.value[R]:null;g.value={...g.value||{},[R]:{...M||{},Id:I,XX_ORD1__Item__c:R,XX_ORD1__QTY__c:typeof P=="number"?P:(M==null?void 0:M.XX_ORD1__QTY__c)||0}}}return T(!0),f(),B}catch(B){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",B),f();return}}async function v({itemId:L,qty:$,qliId:U,eCatalogItemId:Q}={}){var F,B,O,I,R;if(console.log("updateQuoteLineQtyTxn",{itemId:L,qty:$,qliId:U,eCatalogItemId:Q}),!$&&$!==0)return;let Z=U||((B=(F=g.value)==null?void 0:F[L])==null?void 0:B.Id);if(Z||(await A(!0),Z=U||((I=(O=g.value)==null?void 0:O[L])==null?void 0:I.Id)),!Z){if($>0&&L&&Q)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:L,eCatalogItemId:Q}),await y({itemID:L,eCatalogItemID:Q,qty:$,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:L});return}const X={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:Z},{fieldName:"XX_ORD1__QTY__c",fieldValue:$}]}]};try{const P=await et({data:X,config:{pathKey:"catalog.updateLines"}});if(L){const M=((R=g.value)==null?void 0:R[L])||{};g.value={...g.value||{},[L]:{...M,Id:Z,XX_ORD1__Item__c:L,XX_ORD1__QTY__c:$}}}return T(!0),f(),P}catch(P){console.log("[CATALOG:updateQuoteLineQtyTxn] error",P),f();return}}async function b(L,$,U){var O;const Q=U==="Item",Z=[],X=((L==null?void 0:L.searchText)||"").toString().trim(),F=Array.isArray(L==null?void 0:L.fields)?L.fields:[];Array.isArray(L==null?void 0:L.filters)&&L.filters,L==null||L.filterLogic;const B={searchPL:X,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:$t(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:(L==null?void 0:L.numberOfRecords)||(L==null?void 0:L.rowLimit)||10,fields:F,filters:(L==null?void 0:L.whereCondition)||[]};try{const I=await et({data:B,config:{pathKey:"catalog.getProductItems"}}),R=I.selected_products,P=Object.values(R).map(q=>{var j;return(j=q==null?void 0:q.catalogResponse)==null?void 0:j.productInfo}).filter(Boolean);P.forEach(q=>{var J,Y,ae,W;const j=JSON.parse(JSON.stringify($)),z=Ie(q,Q?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),K=Ie(q,Q?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");Q?j.itemId=q.Id:(j.itemId=q.XX_ORD1__Item__c,j.catalogItemId=q.Id),j.thumbnail.value=j.thumbnail.field&&!j.thumbnail.isStatic?Ie(q,j.thumbnail.field):"",j.title.value=j.title.field&&!j.title.isStatic?Ie(q,j.title.field):"",j.description.value=j.description.field&&!j.description.isStatic?Ie(q,j.description.field):"",(J=j.attributes)==null||J.forEach(ee=>{ee.value.field&&(ee.value.value=Ie(q,ee.value.field,ee.value.dataType)||"-"),ee.label.field&&(ee.label.value=Ie(q,ee.label.field,ee.label.dataType)||"-")}),j.actions=j.actions.filter(({action:ee})=>ee==="ADD_TO_CART"&&wp.includes(K)||ee==="CONFIGURE"&&$o.includes(K)||ee==="UPLOAD"&&Bp.includes(K)||!Np.includes(ee)),(Y=j.actions)==null||Y.forEach(ee=>{if(ee.action==="CUSTOM"){const{url:le,label:de}=ee;le.isStatic||(le.value=Ie(q,le.field)),de.isStatic||(de.value=Ie(q,de.field))}}),((ae=j.friendlyURLFields)==null?void 0:ae.length)>0&&z?((W=j.friendlyURLFields)==null||W.forEach(ee=>{j.friendlyURL=j.friendlyURL.replace(`{!${ee}}`,Ie(q,ee))}),j.friendlyURL="/"+j.friendlyURL+"/"+z):j.url&&(j.friendlyURL=j.url+"/"+q.Id),j.friendlyURL&&(j.friendlyURL=j.friendlyURL.replace(/\/{2,}/g,"/")),Z.push(j)});const M=Number(((O=I==null?void 0:I.data)==null?void 0:O.totalCount)||P.length)||0;return{items:Z,count:M>2e3?2e3:M}}catch(I){console.log("[CATALOG:getProductItems] new API error",I);return}}async function C(L){var Z;console.log("[CATALOG:getEcatalogDetails] jsonData",L),L.accountID=t.accountId.value;const $={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify(L)}},U=await Dt(kt,$),Q=dn(U);if(Q!==!1)return(Z=JSON.parse(Q))==null?void 0:Z.recordData}async function E(L,$=()=>{}){L.accountID=t.accountId.value||"";const U={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify(L)}},Q=await Dt(kt,U,void 0,!0),Z=JSON.parse(JSON.parse(Q.response.salesforceActions).content);return $(Z),Z}async function w(L,$=()=>{}){const U={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify(L)}},Q=await Dt(kt,U,void 0,!0);return $(JSON.parse(JSON.parse(Q.response.salesforceActions).content)),JSON.parse(JSON.parse(Q.response.salesforceActions).content)}async function S(){var Z,X,F,B,O,I;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:r.value,payload:i.value});const L=t.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",L),L)console.log("[CATALOG:getObjectDetails] Quote found!"+L),console.log("[CATALOG:getObjectDetails] Quote found",L);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const $={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${L}`}};console.log("[CATALOG:getObjectDetails] request",$.data.endpoint),s.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const U=await Dt(kt,$,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(U!=null&&U.response),len:String(((Z=U==null?void 0:U.response)==null?void 0:Z.salesforceActions)||"").length});const Q=dn(U,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!Q}),s.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),Q?(u.value=JSON.parse(Q),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(X=u.value)==null?void 0:X.Id,accountName:(F=u.value)==null?void 0:F.XX_ORD1__Account_Name__c,checkedOut:(B=u.value)==null?void 0:B.XX_ORD1__Checked_Out__c}),t.quoteAccount=(O=u.value)==null?void 0:O.XX_ORD1__Account_Name__c,u.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),l.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(I=u.value)==null?void 0:I.Id}),u.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:L}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const T=nt(A,500);async function A(L=!1){var X,F;console.log("[CATALOG:getQuoteItems] start",{noLoad:L}),s.value.qliRecords=!L;const $=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",$),!$){console.log("[CATALOG:getQuoteItems] No quote found!"),s.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const U={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getQuoteItems&ut=${t.userId.value}"eid=${$}`}};console.log("[CATALOG:getQuoteItems] request",U.data.endpoint);const Q=await Dt(kt,U,void 0,!0);console.log("[CATALOG:getQuoteItems] response received",{hasResponse:!!(Q!=null&&Q.response),len:String(((X=Q==null?void 0:Q.response)==null?void 0:X.salesforceActions)||"").length});const Z=dn(Q);if(console.log("[CATALOG:getQuoteItems] extracted content",{hasContent:!!Z}),s.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] loading.qliRecords -> false"),Z){const B={};c.value=JSON.parse(Z),console.log("[CATALOG:getQuoteItems] qliRecords set",{count:(F=c.value)==null?void 0:F.length}),c.value.forEach(O=>{B[O.XX_ORD1__Item__c]=O}),g.value=B,n.value=c.value.length,console.log("[CATALOG:getQuoteItems] qliRecords",c.value),console.log("[CATALOG:getQuoteItems] end (success)",{cartCount:n.value})}else console.warn("[CATALOG:getQuoteItems] end (no content)")}async function k(L){console.log("[CATALOG:getSavedFilter] ecfr",L);const $={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${L}`}},U=await Dt(kt,$,void 0,!0),Q=dn(U);return Q?(console.log("[CATALOG:getSavedFilter] Saved Filters",Q),JSON.parse(Q)):!1}async function N(){var Q;console.log("[CATALOG:calculateAvaTax]"),p.value=null;const L=t.quoteId.value;if(!L)return;(Q=u.value)!=null&&Q.Id||await S();const $=u.value;if($.XX_ORD1__Shipping_Address__c&&$.XX_ORD1__Shipping_City__c&&$.XX_ORD1__Shipping_Country__c&&$.XX_ORD1__Shipping_State__c&&$.XX_ORD1__Shipping_Zip__c){const Z={recordId:L,isCommit:!1},X={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(Z)}};d.value=!0;const F=await Dt(kt,X,void 0,!0),B=dn(F);if(B)console.log("[CATALOG:calculateAvaTax] content",B);else{const O=JSON.parse(F.response.salesforceActions).content;p.value=O}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function D(L,$,U=!0){const Q=$.qtyTiers;if(!Q)return null;const Z=Q.find(X=>X.ev===null?L>=X.sv:L>=X.sv&&L<=X.ev);return Z?U?Z.formattedOfferPrice:Z.originalPrice:null}return{quoteCheckedOut:l,avaTaxError:p,avaTaxLoading:d,cartCount:n,cartUpdated:f,quoteId:r,loading:s,filter:_,quoteRecord:u,secondQuoteId:o,qliRecords:c,savedItems:g,savedFilter:m,getObjectDetails:S,getSavedFilter:k,saveItemToQuoteBlinkTxn:y,updateQuoteLineQtyTxn:v,deleteLineItems:a,getPicklistFilterData:w,getQuoteItems:A,updateCart:x,getFilterData:E,getProductItems:b,calculateAvaTax:N,getEcatalogDetails:C,getVolumePrice:D}}),jo=Pe.defineStore("composableCatalog",()=>{const t=qo();Mt();const l=rt(),n=lt(),r=e.ref(!0),o=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),c=e.ref({}),u=e.ref(""),g=e.ref(""),m=e.ref(""),p=e.ref(""),d=e.ref(""),_=e.ref(""),s=e.ref(null),h=e.ref(!1),i=e.computed(()=>p.value+"::"+d.value);async function f(){s.value=null,h.value=!0;try{const S={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},T=Date.now().toString(),A=await Ne.post(`${n.graphqlEndpoint.value}?t=${T}`,{query:Ep,variables:S},{headers:{"Content-Type":"application/json","x-api-key":n.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":T},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",A);const k=A&&A.data?A.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",k);const N=k&&k.data&&k.data.dataByDomain&&Array.isArray(k.data.dataByDomain.items)?k.data.dataByDomain.items:[],D=N.length?N[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",D),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",c.value),c.value=D,o.value={accountId:D.guestAccountId,contactId:"",userType:"AWSGuest",domain:D.domain,locale:"en-US"},p.value=D.organization.salesforceOrgId,d.value=D.storefrontId,D}catch(S){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",S),s.value=S&&S.message?S.message:"Unknown error",S}finally{h.value=!1}}function a(S){g.value=(S==null?void 0:S.templateId)??"",m.value=(S==null?void 0:S.quoteId)??"",_.value=(S==null?void 0:S.userId)??""}function x(S){m.value=S}function y(S){c.value=S}async function v(){try{await t.fetchBlockInformation({templateId:g.value,storefrontId:d.value},!0)}catch(S){l.handleError(S,"getBlockInformation")}}const b=async()=>{var S,T;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const A=await sr(Tl,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",A),((T=(S=A.content)==null?void 0:S.items)==null?void 0:T[0])??null}catch(A){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",A)}},C=()=>{if(typeof document>"u")return;const S=p.value,T=d.value;if(!S||!T)return;const A=`${cn}/${S}/${T}/css/theme_${T}.css`;let k=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(A),k=!0}catch(U){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",U)}let N="";try{N=new URL(n.graphqlEndpoint.value).origin}catch{}const D=typeof window<"u"?window.location.href:"",L=(U,Q={})=>{const Z=document.head||document.getElementsByTagName("head")[0];if(!Z)return;let X=document.getElementById(U);X||(X=document.createElement("link"),X.id=U,Z.appendChild(X)),Object.entries(Q).forEach(([F,B])=>{B!=null&&X.setAttribute(F,String(B))})};((U,Q,Z=!0)=>{const X=document.head||document.getElementsByTagName("head")[0];if(!X||document.getElementById(U))return;const F=document.createElement("script");F.id=U,F.src=Q,Z&&(F.async=!0),X.appendChild(F)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),L("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),N&&L("ec-preconnect-appsync",{rel:"preconnect",href:N}),k||L("ec-theme-stylesheet",{rel:"stylesheet",href:A}),L("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),D&&L("ec-canonical",{rel:"canonical",href:D}),L("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${cn}/expedite/Expedite_Favicon.ico`})};function E(){return!0}function w(){g.value="",m.value="",p.value="",d.value="",_.value=""}return{templateId:g,isLoading:r,activeStorefrontInfo:o,quoteAccount:u,storefrontDetails:c,salesforceOrgId:p,storefrontId:d,userId:_,orgWithStorefrontId:i,useVisiblity:E,fetchDomainDetails:f,setData:a,setQuoteId:x,setStorefrontDetails:y,getBlockInformation:v,getTheme:b,setThemeData:C,reset:w}}),Ip=t=>{const l=t.match(/query\s+(\w+)/);return l?l[1]:null},Op=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(l,n)=>n.toLowerCase()).replace(/\s(\w)/g,(l,n)=>n.toUpperCase()).replace(/\s/g,""),Ml=t=>{try{JSON.parse(t)}catch{return!1}return!0},Ho=new Map,sr=async(t,l=null)=>{var g,m,p;const n=jo(),r=lt();let o=200,c,u;try{const d=l,_=r.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((g=n.activeStorefrontInfo)==null?void 0:g.userType)||"",d.data.accountId=_||((m=n.activeStorefrontInfo)==null?void 0:m.accountId)||"",d.data.domain=r.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:r.hostName.value});const s=Cp([t,d,_]);if(Ho.has(s))c=Ho.get(s);else try{const f=await Ne.post(r.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":r.apiKey.value}});if(!f.data)return{statusCode:500,content:"Error fetching data from AppSync."};c=f.data.data,Ho.set(s,c)}catch(f){const a=((p=f==null?void 0:f.response)==null?void 0:p.status)||500;return a===401&&console.info("401",t,l),{statusCode:a,content:"Error fetching data from AppSync."}}const h=Ip(t);if(!h)return{statusCode:404,content:"Query name not found, improper request."};const i=Op(h);c=c[i],Ml(c)&&(c=JSON.parse(c)),c&&c.statusCode&&c.statusCode===401&&console.info("401",t,l),u=c!=null&&c.content?c.content:c,Ml(u)&&(u=JSON.parse(u))}catch(d){o=400,u=d}return{statusCode:o,content:u}},cr=e.ref(""),Ll=e.ref(""),Uo=e.ref(""),Rl=e.ref(""),Fl=e.ref(""),dr=e.ref(""),Nn=e.ref(""),Pl=e.ref(""),ql=e.ref(""),$l=e.ref(""),jl=e.ref(""),Hl=e.ref(""),Vp=e.ref(!1),Tp=e.ref(null),Dp=e.ref(null),Ul=e.ref("");function lt(){function t(u){u.templateId!==void 0&&(cr.value=u.templateId),u.hostName!==void 0&&(Ll.value=u.hostName),u.graphqlEndpoint!==void 0&&(Uo.value=u.graphqlEndpoint),u.apiKey!==void 0&&(Rl.value=u.apiKey),u.accountId!==void 0&&(Fl.value=u.accountId),u.organizationId!==void 0&&(dr.value=u.organizationId),u.storefrontId!==void 0&&(Nn.value=u.storefrontId),u.cid!==void 0&&(Pl.value=u.cid),u.userId!==void 0&&(ql.value=u.userId),u.composablesApiUrl!==void 0&&($l.value=u.composablesApiUrl),u.composablesApiKey!==void 0&&(jl.value=u.composablesApiKey),u.composablesOrgType!==void 0&&(Hl.value=u.composablesOrgType),u.isPreview!==void 0&&(Vp.value=u.isPreview),u.sections!==void 0&&(Tp.value=u.sections),u.theme!==void 0&&(Dp.value=u.theme),u.quoteId!==void 0&&(Ul.value=u.quoteId)}const l=async()=>{var u,g;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!Nn.value)try{const m=await sr(Tl,{storefrontId:Nn.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",m),((g=(u=m.content)==null?void 0:u.items)==null?void 0:g[0])??null}catch(m){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",m)}},n=async()=>{var u;try{const g=await et({action:"retrieveMeta",data:{salesforceOrgId:dr.value,storefrontId:cr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=(u=g==null?void 0:g.data)==null?void 0:u.value;return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(g){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",g),g}};return{hostName:Ll,graphqlEndpoint:Uo,apiKey:Rl,accountId:Fl,organizationId:dr,storefrontId:Nn,cid:Pl,userId:ql,composablesApiUrl:$l,composablesApiKey:jl,composablesOrgType:Hl,quoteId:Ul,updateConfig:t,getTheme:l,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const u=dr.value,g=Nn.value;if(!u||!g)return;const m=`${cn}/${u}/${g}/css/theme_${g}.css`;let p="";try{p=new URL(Uo.value).origin}catch{}const d=typeof window<"u"?window.location.href:"",_=(h,i={})=>{const f=document.head||document.getElementsByTagName("head")[0];if(!f)return;let a=document.getElementById(h);a||(a=document.createElement("link"),a.id=h,f.appendChild(a)),Object.entries(i).forEach(([x,y])=>{y!=null&&a.setAttribute(x,String(y))})};((h,i,f=!0)=>{const a=document.head||document.getElementsByTagName("head")[0];if(!a||document.getElementById(h))return;const x=document.createElement("script");x.id=h,x.src=i,f&&(x.async=!0),a.appendChild(x)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),_("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),p&&_("ec-preconnect-appsync",{rel:"preconnect",href:p}),_("ec-theme-stylesheet",{rel:"stylesheet",href:m}),_("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),d&&_("ec-canonical",{rel:"canonical",href:d}),_("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${cn}/expedite/Expedite_Favicon.ico`})},processSections:async(u,g)=>{const m=qo();if(u&&g)try{const p=typeof g=="string"?JSON.parse(g):g;m.pageBlocks=p}catch(p){console.error("[ExpediteCart] Error parsing sections:",p)}else u||await m.fetchBlockInformationREST({templateId:cr.value||cr.value})},processTheme:async(u,g)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",u),console.log("[COMPOSABLECATALOG:processTheme] theme",g),u&&g)try{return typeof g=="string"?JSON.parse(g):g}catch(m){return console.error("[ExpediteCart] Error parsing theme:",m),null}else if(!u)try{return await n()}catch(m){return console.error("[ExpediteCart] Error fetching theme:",m),null}return null}}}const Mp=["href"],Lp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),Rp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),Fp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),Pp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),zl={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const l=t,n=lt(),r=e.ref(""),o=e.ref(""),c=async()=>{if(!(!l.organizationId||!l.templateId))try{const u=await n.processTheme(l.isPreview,l.theme);u&&(r.value=u),n.setThemeData();const g=Date.now(),m=`${cn}/${l.organizationId}/${l.templateId}/css/theme_${l.templateId}.css?t=${g}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",m),o.value=m}catch(u){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",u)}};return e.onBeforeMount(()=>{c()}),e.watch(()=>[l.organizationId,l.templateId,l.isPreview,l.theme],()=>{c()},{deep:!0}),(u,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:o.value,"data-name":"ec-theme-stylesheet-link"},null,8,Mp)):e.createCommentVNode("",!0),Lp,Rp,Fp,Pp],64))}},qp={KNOWLEDGE_DETAIL:"knowledgeDetail"},Xl={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},$p={name:"SkeletonLoader"},jp={class:"skeleton-loader"};function Hp(t,l,n,r,o,c){return e.openBlock(),e.createElementBlock("div",jp)}const st=me($p,[["render",Hp],["__scopeId","data-v-826b27ef"]]),ve=me({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(t){const l=t,n={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},r=e.ref(!1),o=e.computed(()=>{if(l.text===null||l.text===void 0)return"";const m=String(l.text);return(m==null?void 0:m.replace(/\r\n|\n/g,"<br>"))||""}),c=e.computed(()=>{var p,d;const m=l.tag||((p=l.style)==null?void 0:p.tag)||((d=l.secStyle)==null?void 0:d.tag)||"p";return m==="large"||m==="strong"?"div":m}),u=e.computed(()=>{var p;const m=l.tag||((p=l.style)==null?void 0:p.tag)||"p";return n[m]||"ecb-text-regular"}),g=e.computed(()=>{var p,d;const m={};if(l.style&&((p=l.style)!=null&&p.overrite)){const{bold:_,color:s,italic:h,underline:i,strikethrough:f,strikeThrough:a,size:x,family:y,lineHeight:v}=l.style;_&&(m.fontWeight="700"),s&&(m.color=s),h&&(m.fontStyle="italic"),y&&(m.fontFamily=y),v&&(m.lineHeight=v),i?m.textDecoration="underline":(f||a)&&(m.textDecoration="line-through"),x&&(m.fontSize=x)}if(l.secStyle&&((d=l.secStyle)!=null&&d.overrite)){const{bold:_,color:s,italic:h,underline:i,strikethrough:f,strikeThrough:a,size:x,family:y,lineHeight:v}=l.secStyle;_&&(m.fontWeight="700"),s&&(m.color=s),h&&(m.fontStyle="italic"),y&&(m.fontFamily=y),v&&(m.lineHeight=v),i?m.textDecoration="underline":(f||a)&&(m.textDecoration="line-through"),x&&(m.fontSize=x)}for(const _ of l.inherit)m[_]="inherit";return m});return(m,p)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(st)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),e.mergeProps({key:1},m.$attrs,{type:t.method,disabled:t.disabled,style:g.value,class:u.value,onMouseover:p[0]||(p[0]=d=>r.value=!0),onMouseout:p[1]||(p[1]=d=>r.value=!1),innerHTML:o.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),Up={key:1,class:"field-label"},zp={class:"ect-flex ect-flex-col ect-justify-start"},Xp={key:0,class:"ect-pr-5"},Kp={key:1,class:"field-value ect-pr-5"},Qp={key:1,class:"field-value"},Kl=me({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(t){const l=Mt(),n=t,r=e.computed(()=>!1),o=e.computed(()=>{var s;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((s=n.offer.offerValue.qtyTiers)==null?void 0:s.length)>0?!!n.appliedOnOfferMatchingField:!1}),c=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),u=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),g=e.computed(()=>{var _,s;return(_=n.offer.offerValue)!=null&&_.qtyTiers?l.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(s=n.offer.offerValue)==null?void 0:s.formattedOfferPrice}),m=e.computed(()=>({"ect-flex ect-line-through":r.value&&n.offer.offerValue&&o.value})),p=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(r.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(_,s)=>{var h,i;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(h=t.label.style)==null?void 0:h.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",Up,[e.createVNode(st)])),e.createElementVNode("div",zp,[r.value&&n.offer.offerValue&&o.value?(e.openBlock(),e.createElementBlock("div",Xp,[e.createVNode(ve,{tag:c.value,text:g.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):r.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",Kp,[e.createVNode(st)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(m.value)},[p.value?(e.openBlock(),e.createBlock(ve,{key:0,tag:(i=t.value.style)==null?void 0:i.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",Qp,[e.createVNode(st)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(ve,{tag:u.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(u.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),Gp={key:1,class:"filter"},Wp={class:"filter-title"},Zp={key:0,class:"filter-desc"},Jp={key:1,class:"filter-desc"},Yp={key:2,class:"filter-desc"},Ql=me({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const l=jt(),n=t;function r(){n.url&&!n.loading&&l.push(n.url)}return(o,c)=>t.loading?(e.openBlock(),e.createElementBlock("div",Gp,[e.createElementVNode("div",Wp,[e.createVNode(st)]),t.description?(e.openBlock(),e.createElementBlock("div",Zp,[e.createVNode(st)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",Jp,[e.createVNode(st)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",Yp,[e.createVNode(st)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(ve,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:r},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(ve,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),e9={name:"Spinner"},t9={class:"spinner"};function n9(t,l,n,r,o,c){return e.openBlock(),e.createElementBlock("div",t9)}const An=me(e9,[["render",n9],["__scopeId","data-v-83f8c910"]]),r9={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:st,AtomSpinner:An},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:qp}}},zo=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),o9={key:0,class:"page"},a9=zo(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),i9={class:"page-body"},l9={class:"page-body_board"},s9={key:1,class:"field"},c9={key:2,class:"filter"},d9={class:"filter-option_inner"},u9={key:3,class:"full"},f9={key:4,class:"shuttle"},h9={class:"shuttle-full"},p9={class:"shuttle-full"},m9={class:"shuttle-half"},y9={class:"shuttle-half"},g9={class:"shuttle-button"},x9={key:5,class:"shuttle2"},_9={class:"shuttle2-full"},b9=zo(()=>e.createElementVNode("span",null,"Processing payment",-1)),v9={key:6,class:"shuttle2"},C9={class:"shuttle2-full"},E9=zo(()=>e.createElementVNode("span",null,"Processing order",-1)),k9={key:10,class:"skeleton-shipping"},B9={class:"skeleton-shipping-full"},w9={class:"skeleton-shipping-half"},N9={key:11,class:"skeleton-terms"},A9={class:"skeleton-terms-half"},S9={class:"skeleton-terms-full"},I9={class:"skeleton-terms-full"},O9={key:12,class:""},V9={class:"skeleton-terms-half"},T9={key:13,class:""},D9={class:"skeleton-terms-half"},M9={key:14,class:"product"},L9={class:"product-image"},R9={class:"product-texts"},F9={class:"product-description"},P9={class:"product-action"},q9={class:"product-button"},$9={key:15,class:""};function j9(t,l,n,r,o,c){const u=e.resolveComponent("AtomSkeletonLoader"),g=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",o9,[a9,e.createElementVNode("div",i9,[e.createElementVNode("div",l9,[e.createVNode(u)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",s9,[e.createVNode(u)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",c9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"filter-option"},[e.createElementVNode("div",d9,[e.createVNode(u)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",u9,[e.createVNode(u)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(u)]),e.createElementVNode("div",p9,[e.createVNode(u)]),e.createElementVNode("div",m9,[e.createVNode(u)]),e.createElementVNode("div",y9,[e.createVNode(u)]),e.createElementVNode("div",g9,[e.createVNode(u)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(g,{class:"shuttle2-spinner"}),e.createTextVNode(),b9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",v9,[e.createElementVNode("div",C9,[e.createVNode(g,{class:"shuttle2-spinner"}),e.createTextVNode(),E9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",B9,[e.createVNode(u)]),e.createElementVNode("div",w9,[e.createVNode(u)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",N9,[e.createElementVNode("div",A9,[e.createVNode(u)]),e.createElementVNode("div",S9,[e.createVNode(u)]),e.createElementVNode("div",I9,[e.createVNode(u)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("div",V9,[e.createVNode(u)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",T9,[e.createElementVNode("div",D9,[e.createVNode(u)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",M9,[e.createElementVNode("div",L9,[e.createVNode(u)]),e.createElementVNode("div",R9,[e.createVNode(u)]),e.createElementVNode("div",F9,[e.createVNode(u)]),e.createElementVNode("div",P9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"product-action_item"},[e.createVNode(u)]))),128))]),e.createElementVNode("div",q9,[e.createVNode(u)])])):n.type===o.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",$9,[e.createVNode(u,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const Bt=me(r9,[["render",j9],["__scopeId","data-v-956cc081"]]),H9=["src"],Xo={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(t){const l=t,n=e.computed(()=>l.src.includes("/resource/")&&!l.src.includes("://")&&l.resourcesDomain?l.resourcesDomain+l.src:l.src.includes("/servlet/servlet.ImageServer")&&!l.src.includes("://")&&l.resourcesDomain?l.resourcesDomain+"/"+l.src:l.src);return(r,o)=>t.loading?(e.openBlock(),e.createBlock(Bt,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:n.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,H9)):e.createCommentVNode("",!0)}},U9=t=>(e.pushScopeId("data-v-37f42d3b"),t=t(),e.popScopeId(),t),z9={class:"counter"},X9=["disabled"],K9={class:"material-icons-outlined counter-icon"},Q9={key:0,class:"counter-spinner"},G9=["max","disabled","value"],W9=["disabled"],Z9=[U9(()=>e.createElementVNode("span",{class:"material-icons-outlined counter-icon"}," add ",-1))],ur=me({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,r=l,o=e.computed(()=>n.disabled||n.loading),c=nt(function(p){p.target.value?r("update:modelValue",Number(p.target.value)):r("update:modelValue",0)}),u=p=>{(p.key==="."||p.key==="e"||p.key==="E")&&!p.ctrlKey&&!p.metaKey&&n.decimal&&p.preventDefault()};function g(){n.modelValue<n.max&&r("update:modelValue",n.modelValue+1)}function m(){n.modelValue>n.min&&r("update:modelValue",n.modelValue-1)}return(p,d)=>(e.openBlock(),e.createElementBlock("div",z9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||o.value,onClick:m},[e.createElementVNode("span",K9,e.toDisplayString(t.modelValue>1?"remove":"close"),1)],8,X9),t.loading?(e.openBlock(),e.createElementBlock("div",Q9,[e.createVNode(An,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:o.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=(..._)=>e.unref(c)&&e.unref(c)(..._)),onKeydown:u},null,40,G9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||o.value,onClick:g},Z9,8,W9)]))}},[["__scopeId","data-v-37f42d3b"]]),Gl=e.ref(!1),Wl=e.ref(!1),Zl=e.ref(!1),Jl=e.ref(!1),Ko=()=>{if(typeof window<"u"){const t=()=>{const l=window.innerWidth;Wl.value=l<768,Zl.value=l>=768&&l<1024,Jl.value=l>=1024};e.onMounted(()=>{Gl.value||(Gl.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Wl,isTablet:Zl,isDesktop:Jl}},J9=["disabled"],Y9=["disabled"],em={class:"ect-w-max"},tm={class:"button-header-icon"},nm=["onClick"],rm={key:0,class:"button-options_item-icon"},om=["disabled"],am={class:"ect-w-max"},im={class:"button-header-icon"},lm=["onClick"],sm={key:0,class:"button-options_item-icon"},Yl=me({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(t,{emit:l}){const n=t,r=Ko(),o=e.ref(!1),c=e.ref(null),u=e.ref({}),g=e.ref(!1),m=l;function p(f){f.stopPropagation(),o.value=!o.value}function d(f){f.stopPropagation(),o.value=!o.value,g.value=e.ref(o.value)}function _(f){m("selected",f),o.value=!1}function s(){!r.isMobile.value&&!n.disabled&&(o.value=!0)}function h(){!r.isMobile.value&&!g.value&&(o.value=!1)}function i(f){o.value&&(o.value=!1,g.value=!1)}return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(f,a)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:a[0]||(a[0]=y=>f.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,J9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(p,["stop"])},[e.createElementVNode("span",em,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",tm,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,Y9),!t.disabled&&t.options.length&&o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:a[1]||(a[1]=y=>o.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,y=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"button-options_item",onClick:v=>_(y)},[y.selected&&t.select?(e.openBlock(),e.createElementBlock("div",rm,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(y.name),1)],8,nm))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:s,onMouseleave:h},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:c,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",am,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",im,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,om),!t.disabled&&t.options.length&&o.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(u.value),class:"button-options",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,y=>{var v;return e.openBlock(),e.createElementBlock("div",{key:y,class:"button-options_item",onClick:b=>f.$emit("selected",y)},[y.selected&&t.select?(e.openBlock(),e.createElementBlock("div",sm,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((v=y.label)==null?void 0:v.value)||y.name),1)],8,lm)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),cm={class:"ect-flex ect-flex-col ect-w-full"},dm={key:0,class:"ect-h-[20px] ect-w-[150px]"},um={key:1,class:"ect-flex ect-flex-col ect-gap-1"},fm=me({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var x,y;const l=jo(),n=Mt(),r=t,o=e.ref(((y=(x=n.savedItems)==null?void 0:x[r.itemId])==null?void 0:y.XX_ORD1__QTY__c)||0),c=e.ref(!1),u=e.ref(null),g=e.ref(!1),m=e.ref(!1),p=e.computed(()=>r.actions&&r.actions.length>0),d=e.computed(()=>r.actions.some(v=>v.action==="ADD_TO_CART")),_=e.computed(()=>{var v,b,C;return(v=r.offer)!=null&&v.appliedOnField?Xl[(b=r.offer)==null?void 0:b.appliedOnField]===((C=r.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>n.savedItems,v=>{var b,C;v[r.itemId]&&!m.value&&((b=v[r.itemId])==null?void 0:b.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=v[r.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,m.value=!0)},{deep:!0});function s(v){var b;m.value=!0,v===0&&((b=n.savedItems)!=null&&b[r.itemId])?i():a()}const h=v=>{var b;v.action==="ADD_TO_CART"?(m.value=!0,o.value=1,f()):v.action==="CONFIGURE"||(v.action==="CUSTOM"?window.open(((b=v.url)==null?void 0:b.value)||v.value,v.newTab?"_blank":"_self"):v.action==="ORDER_PARTS"||v.action)},i=async function(){c.value=!0,u.value=null;const v=[n.savedItems[r.itemId].Id];await n.deleteLineItems(v),c.value=!1},f=async function(){c.value=!0,u.value=null;const v={itemID:r.itemId,eCatalogItemID:r.catalogItemId,qty:o.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(v),c.value=!1},a=nt(async function(){console.log("updateToCart 1",o.value),g.value=!0,await n.updateQuoteLineQtyTxn({itemId:r.itemId,qty:o.value,eCatalogItemId:r.catalogItemId}),g.value=!1});return(v,b)=>{var C,E;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(Xo,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(l).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ql,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",cm,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.attributes,(w,S)=>(e.openBlock(),e.createBlock(Kl,{key:S,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:w.value,label:w.label,field:w.value.field,offer:{applyOffer:w.applyOffer,offerDetails:w.offerDetails,offerValue:r.offer},"item-count":o.value,"applied-on-offer-matching-field":_.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),r.offerSetting&&_.value&&((C=r.offer)!=null&&C.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(ve,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(E=r.offer)==null?void 0:E.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(v.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!r.offer?(e.openBlock(),e.createElementBlock("div",dm,[e.createVNode(st)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createBlock(An,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",um,[o.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:o.value,"onUpdate:modelValue":[b[0]||(b[0]=w=>o.value=w),s],loading:g.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Yl,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:b[1]||(b[1]=w=>h(w))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-11bccb46"]]),hm={class:"item"},pm={class:"item-text"},mm={class:"item-attributes"},ym={key:0,class:"item-button"},gm={key:1,class:"ect-flex ect-flex-col ect-gap-1"},xm=me({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var f,a;const l=Mt(),n=t,r=e.ref(((a=(f=l.savedItems)==null?void 0:f[n.itemId])==null?void 0:a.XX_ORD1__QTY__c)||0),o=e.ref(!1),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>n.actions&&n.actions.length>0),m=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),p=e.computed(()=>{var x,y,v;return(x=n.offer)!=null&&x.appliedOnField?Xl[(y=n.offer)==null?void 0:y.appliedOnField]===((v=n.offerSetting.value)==null?void 0:v.field):!0});e.watch(()=>l.savedItems,x=>{var y,v;x[n.itemId]&&!c.value&&((y=x[n.itemId])==null?void 0:y.XX_ORD1__QTY__c)!==r.value&&(r.value=((v=x[n.itemId])==null?void 0:v.XX_ORD1__QTY__c)||0,c.value=!0)},{deep:!0});function d(x){var y;c.value=!0,x===0&&((y=l.savedItems)!=null&&y[n.itemId])?s():i()}const _=x=>{var y;x.action==="ADD_TO_CART"?(c.value=!0,r.value=1,h()):x.action==="CONFIGURE"||(x.action==="CUSTOM"?window.open(((y=x.url)==null?void 0:y.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action)},s=async function(){o.value=!0;const x=[l.savedItems[n.itemId].Id];await l.deleteLineItems(x),delete l.savedItems[n.itemId],o.value=!1},h=async function(){o.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:r.value,qtyTierAmt:null};await l.saveItemToQuoteBlinkTxn(x),o.value=!1},i=nt(async function(){console.log("updateToCart 2",r.value),u.value=!0,await l.updateQuoteLineQtyTxn({itemId:n.itemId,qty:r.value,eCatalogItemId:n.catalogItemId}),u.value=!1},800);return(x,y)=>(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",pm,[e.createVNode(Ql,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",mm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,v=>{var b;return e.openBlock(),e.createBlock(Kl,{key:v.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:v.value,label:v.label,offer:{applyOffer:v.applyOffer,offerDetails:v.offerDetails,offerValue:n.offer},"item-count":r.value,"applied-on-offer-matching-field":p.value,"show-offer-description":!!((b=n.offer)!=null&&b.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),g.value?(e.openBlock(),e.createElementBlock("div",ym,[o.value?(e.openBlock(),e.createBlock(An,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",gm,[r.value>0&&!t.loading&&m.value?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:r.value,"onUpdate:modelValue":[y[0]||(y[0]=v=>r.value=v),d],loading:u.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Yl,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:y[1]||(y[1]=v=>_(v))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-324ddfb1"]]),_m=["placeholder"],bm={key:0,class:"srch-error"},vm={class:"srch-option_lst-main"},Cm={class:"italic"},Em={class:"srch-option_lst-sugg"},km={class:"italic"},Bm={class:"srch-option_lst-main"},wm={class:"italic"},Nm={class:"srch-option_lst-sugg"},Am={class:"italic"},Sm={class:"srch-option_lst-main"},Im={class:"italic"},Om={class:"srch-option_lst-sugg"},Vm={class:"italic"},Tm={key:1,class:"search1"},Dm={class:"search-container_header"},Mm={class:"search-container_header_input ectheme-input-box"},Lm=["placeholder","value"],Rm=me({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(t,{emit:l}){const n=l;let r;const o=e.ref(""),c=e.ref(!1),u=e.ref(!1),g=e.ref(null),m=()=>{g.value=null,o.value="",n("update:modelValue",""),n("enter")},p=f=>{o.value.length>1?(f.target.blur(),_(o.value+"*")):g.value="Search text must be more than one character.",c.value=!1},d=()=>{u.value||(g.value=null,o.value.length>1?_(o.value+"*"):o.value.length===1&&(g.value="Search text must be more than one character."),c.value=!1)},_=f=>{n("update:modelValue",f),c.value=!1,u.value=!1},s=f=>{const a=f.target.value;g.value=null,a.length||n("update:modelValue","")},h=()=>{n("enter")},i=f=>{var x;r&&(clearTimeout(r),r=null);const a=((x=f==null?void 0:f.target)==null?void 0:x.value)??"";r=setTimeout(()=>{n("update:modelValue",a)},500)};return(f,a)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:a[6]||(a[6]=x=>c.value=!0),onFocusout:d,onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":g.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=x=>o.value=x),type:"search",placeholder:t.placeholder,onInput:s},null,40,_m),[[e.vModelText,o.value]]),e.createVNode(Be,{icon:o.value?"close":"search",size:14,color:g.value?"red":"#acacac",onClick:m},null,8,["icon","color"])],2),g.value?(e.openBlock(),e.createElementBlock("div",bm,[e.createElementVNode("span",null,e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0),o.value.length>1&&c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:a[4]||(a[4]=x=>u.value=!0),onMouseout:a[5]||(a[5]=x=>u.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:a[1]||(a[1]=x=>_(o.value+"*"))},[e.createElementVNode("div",vm,[e.createTextVNode(" Search for "),e.createElementVNode("span",Cm,e.toDisplayString(o.value)+"*",1)]),e.createElementVNode("div",Em,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",km,e.toDisplayString(o.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:a[2]||(a[2]=x=>_(o.value))},[e.createElementVNode("div",Bm,[e.createTextVNode(" Search for "),e.createElementVNode("span",wm,'"'+e.toDisplayString(o.value)+'"',1)]),e.createElementVNode("div",Nm,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",Am,'"'+e.toDisplayString(o.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:a[3]||(a[3]=x=>_("*"+o.value+"*"))},[e.createElementVNode("div",Sm,[e.createTextVNode(" Search for "),e.createElementVNode("span",Im,"*"+e.toDisplayString(o.value)+"*",1)]),e.createElementVNode("div",Om,[e.createTextVNode(" word that includes "),e.createElementVNode("span",Vm,"*"+e.toDisplayString(o.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",Tm,[e.createElementVNode("div",Dm,[e.createElementVNode("div",Mm,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:i,onKeyup:e.withKeys(h,["enter"])},null,40,Lm),t.loading?(e.openBlock(),e.createBlock(An,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:m})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:h})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),es=t=>(e.pushScopeId("data-v-57022b93"),t=t(),e.popScopeId(),t),Fm=["id"],Pm={key:0,class:"product-search"},qm={key:1,class:"product-not-found"},$m=es(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),jm=es(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),Hm={key:2,class:"product-item"},Um=20,zm=me({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:l}){const n=["vertical","horizontal","square","table"],r=t,o=e.ref(Math.floor(Math.random()*1e9)),c=e.ref(null),u=Mt(),g=e.ref(1),m=e.ref(!0),p=e.ref(!0);e.ref(!1);const d=e.ref([]),_=e.ref(0),s=e.ref(r.request);let h=200;const i=e.ref(r.searchText||""),f=e.computed(()=>r.initialItems||[]),a=e.computed(()=>!!(i.value||r.searchText));function x(X,F,B){const O=B==="Item",I=[];return X.forEach(R=>{var M,q;const P=JSON.parse(JSON.stringify(F));try{O?P.itemId=R.Id:(P.itemId=R.XX_ORD1__Item__c,P.catalogItemId=R.Id);const{description:j,thumbnail:z,title:K,attributes:J,actions:Y}=P;z!=null&&z.field&&!z.isStatic&&(z.value=Ie(R,z.field)),K!=null&&K.field&&!K.isStatic&&(K.value=Ie(R,K.field)),j!=null&&j.field&&!j.isStatic&&(j.value=Ie(R,j.field)),(J||[]).forEach(W=>{var ee,le;(ee=W==null?void 0:W.value)!=null&&ee.field&&!W.value.isStatic&&(W.value.value=Ie(R,W.value.field,W.value.dataType)||"-"),(le=W==null?void 0:W.label)!=null&&le.field&&!W.label.isStatic&&(W.label.value=Ie(R,W.label.field,W.label.dataType)||"-")}),(Y||[]).forEach(W=>{W.action==="CUSTOM"&&(W.url&&!W.url.isStatic&&(W.url.value=Ie(R,W.url.field)),W.label&&!W.label.isStatic&&(W.label.value=Ie(R,W.label.field)))});const ae=O?Ie(R,"XX_ORD1__Friendly_URL__c"):Ie(R,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((M=P.friendlyURLFields)==null?void 0:M.length)>0&&ae?((q=P.friendlyURLFields)==null||q.forEach(W=>{P.friendlyURL=(P.friendlyURL||"").replace(`{!${W}}`,Ie(R,W))}),P.friendlyURL="/"+(P.friendlyURL||"")+"/"+ae):P.url&&(P.friendlyURL=P.url+"/"+((R==null?void 0:R.Id)||"")),P.friendlyURL&&(P.friendlyURL=P.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}I.push(P)}),I}const y=e.ref(null),v=e.ref(null),b=e.computed(()=>{}),C=e.computed(()=>{var X;return(X=r.fields)==null?void 0:X.header});e.computed(()=>{var X;return((X=C.value)==null?void 0:X.mainHeading)||{}}),e.computed(()=>{var X;return((X=C.value)==null?void 0:X.subHeading)||{}});const E=e.computed(()=>{var X;return d.value.length>0?d.value:Array(w.value).fill((X=r.fields)==null?void 0:X.productCard)}),w=e.computed(()=>Number(r.configuration.displaySettings.itemsPerPage||Um)),S=e.computed(()=>Number(r.configuration.displaySettings.lazyLoadBatch)),T=e.computed(()=>{var X;return((X=r.configuration.productItemOrientation)==null?void 0:X.toLowerCase())||"vertical"}),A=e.ref(n.includes(T.value)?y.value||T.value:"vertical"),k=e.computed(()=>d.value.length<1&&!p.value),N=e.computed(()=>`product-${A.value} width-${v.value?v.value:r.configuration.displaySettings.columns||1}`),D=e.computed(()=>r.configuration.displaySettings.enableSearch),L=e.ref(null),$=e.ref(!1),U=e.ref({});e.watch(g,(X,F)=>{X!==F&&(console.log("[fetchProducts] 1"),Q(!0))}),e.watch(L,X=>{X!==null&&r.onCountUpdate&&r.onCountUpdate(X)}),e.watch(i,()=>{g.value=1,console.log("[fetchProducts] 2"),Q(!0)}),e.watch(()=>r.searchText,(X,F)=>{X!==F&&(i.value=X||"")});const Q=nt(async function(X){var R;if(h=600,f.value&&f.value.length>0&&!a.value){const P=x(f.value,(R=r.fields)==null?void 0:R.productCard,r.catalogType);d.value=P,L.value=P.length,p.value=!1,X&&c.value&&c.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}p.value=!0;let B=w.value;S.value<B&&S.value>0&&(B=S.value);const O={...s.value,accountID:r.accountId,rowLimit:B,searchText:i.value||r.searchText,rowOffSet:w.value*(g.value-1)};X&&c.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});const I=await u.getProductItems(O,r.fields.productCard,r.catalogType);I&&(m.value=I.items.length===B,L.value=I.count,d.value=I.items,_.value=Math.ceil(I.count/w.value)),console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",I),p.value=!1},h);async function Z(){const{mainHeading:X,subHeading:F}=r.fields.header;if(!X.isStatic&&X.field||!F.isStatic&&F.field){const B=[];X.isStatic?X.value=X.title:B.push(X.field),F.isStatic?F.value=F.title:B.push(F.field);const O={...s.value,accountID:r.accountId,fields:B},I=await u.getEcatalogDetails(O);X.isStatic||(X.value=I[X.field],X.isStatic=!0),F.isStatic||(F.value=I[F.field],F.isStatic=!0)}else X.value=X.title,F.value=F.title}return l({currentPage:g,fetchProducts:Q}),e.onMounted(()=>{Q(),Z()}),(X,F)=>(e.openBlock(),e.createElementBlock("div",{id:o.value,ref_key:"productBlock",ref:c,class:"product"},[D.value&&b.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",Pm,[e.createVNode(Rm,{modelValue:i.value,"onUpdate:modelValue":F[0]||(F[0]=B=>i.value=B),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(X.$slots,"default",{},void 0,!0),k.value?(e.openBlock(),e.createElementBlock("div",qm,[$m,e.createTextVNode(),jm])):(e.openBlock(),e.createElementBlock("div",Hm,[A.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,B=>(e.openBlock(),e.createElementBlock("div",{key:(B==null?void 0:B.catalogItemId)||(B==null?void 0:B.itemId),class:"product-item_table"},[e.createVNode(xm,{class:"ecb-theme-card","item-id":B==null?void 0:B.itemId,"catalog-item-id":B==null?void 0:B.catalogItemId,loading:p.value,mode:A.value,title:B==null?void 0:B.title,attributes:B==null?void 0:B.attributes,actions:B==null?void 0:B.actions,thumbnail:{value:B==null?void 0:B.thumbnail.value},description:B==null?void 0:B.description,url:B==null?void 0:B.friendlyURL,"template-id":t.configuration.productTemplateId,"ecatalog-id":B==null?void 0:B.eCatalogId,"apply-offer":$.value,"offer-setting":U.value,offer:B==null?void 0:B.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","ecatalog-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(E.value,B=>(e.openBlock(),e.createElementBlock("div",{key:(B==null?void 0:B.catalogItemId)||(B==null?void 0:B.itemId),class:e.normalizeClass(["product-item_record",N.value])},[e.createVNode(fm,{"item-id":B==null?void 0:B.itemId,"catalog-item-id":B==null?void 0:B.catalogItemId,loading:p.value,mode:A.value,title:B==null?void 0:B.title,attributes:B==null?void 0:B.attributes,actions:B==null?void 0:B.actions,thumbnail:{value:B==null?void 0:B.thumbnail.value},description:B==null?void 0:B.description,url:B==null?void 0:B.friendlyURL,"template-id":t.configuration.productTemplateId,"ecatalog-id":B==null?void 0:B.eCatalogId,"apply-offer":$.value,"offer-setting":U.value,offer:B==null?void 0:B.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","ecatalog-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,Fm))}},[["__scopeId","data-v-57022b93"]]),ts=t=>(e.pushScopeId("data-v-f4d2ce2f"),t=t(),e.popScopeId(),t),Xm={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},Km={class:"catalog-product md:ect-grow"},Qm={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},Gm=ts(()=>e.createElementVNode("h3",null,"Filter Products",-1)),Wm=ts(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),Zm=me({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t){var s,h,i,f,a,x,y,v,b,C,E;const l=lt(),n=t,r=e.ref(!1),o=e.ref(((s=n.configuration.dynamicFilters)==null?void 0:s.length)>0&&((h=n.configuration.displaySettings)==null?void 0:h.displayDynamicFilters)&&!n.searchTerm),c=e.ref(n.configuration.displaySettings),u=e.computed(()=>Sp.get(n.configuration.catalogType)),g=e.computed(()=>{let w=p.value.searchText;return w&&!w.endsWith("*")&&(w+="*"),w||""}),m=e.computed(()=>{var L;const w=[],{description:S,thumbnail:T,title:A,attributes:k,actions:N}=n.fields.productCard,D=[S,T,A];return k.forEach($=>{D.push($.value),D.push($.label)}),(N==null?void 0:N.length)>0&&N.forEach($=>{$.action==="CUSTOM"&&(D.push($.url),D.push($.label))}),D.forEach($=>{!$.isStatic&&$.field?w.push($.field):$.value=$.title||"-"}),u.value==="eCatalog"?(w.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),w.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(w.push("XX_ORD1__Friendly_URL__c"),w.push("XX_ORD1__SYS_Requires_Configuration__c")),((L=n.fields.productCard.friendlyURLFields)==null?void 0:L.length)>0&&w.push(...n.fields.productCard.friendlyURLFields),w}),p=e.ref({blockId:n.id,catalogType:Ap.get(n.configuration.catalogType)||"Full",checkcurrency:(i=c.value)==null?void 0:i.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:m.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((a=(f=n.configuration.sort)==null?void 0:f.primary)==null?void 0:a.field)||"Name",sortOrder:(y=(x=n.configuration.sort)==null?void 0:x.primary)==null?void 0:y.direction,secondarySortByField:(b=(v=n.configuration.sort)==null?void 0:v.secondary)==null?void 0:b.field,secondarySortOrder:(E=(C=n.configuration.sort)==null?void 0:C.secondary)==null?void 0:E.direction}),d=e.ref(null),_=e.ref(null);return e.watch(()=>r.value,w=>{w&&window.scrollTo(0,0)}),e.onMounted(()=>{p.value.searchText=n.searchTerm||""}),e.watch(p,w=>{_.value&&_.value.fetchFilterList(),d.value&&(d.value.currentPage=1,console.log("[fetchProducts] 4"),d.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,w=>{typeof w=="string"&&(p.value.searchText=w)}),(w,S)=>(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Km,[e.createVNode(zm,{ref_key:"product",ref:d,"block-id":t.id,"account-id":e.unref(l).accountId,configuration:t.configuration,"catalog-type":u.value,request:p.value,fields:t.fields,"search-text":g.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Qm,[Gm,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:S[0]||(S[0]=T=>r.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),Wm])],512),[[e.vShow,!r.value&&o.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-f4d2ce2f"]]),Jm={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},Ym=["width","height"],e4=["href"],t4=["width","height"],n4=["href"];function r4(t,l,n,r,o,c){const u=e.resolveComponent("AtomIcons"),g=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(g,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:l[0]||(l[0]=m=>o.isHover=!0),onMouseleave:l[1]||(l[1]=m=>o.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(u),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:o.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:o.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,e4)],12,Ym))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(c.mode),style:e.normalizeStyle(c.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:l[2]||(l[2]=m=>o.isHover=!0),onMouseleave:l[3]||(l[3]=m=>o.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(u),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:o.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:o.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,n4)],12,t4))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(c.mode),style:e.normalizeStyle(c.style)},e.toDisplayString(n.icon),7))],34))}const Qo=me(Jm,[["render",r4],["__scopeId","data-v-16108bca"]]);async function ns(t,l,n,r={},o={}){let c=`/services/apexrest/${t}?type=${l}`;if(r&&Object.keys(r).length>0){const m=new URLSearchParams;Object.keys(r).forEach(d=>{const _=r[d];_!=null&&_!==""&&m.append(d,String(_))});const p=m.toString();p&&(c+=`&${p}`)}const u={action:"makeCall",data:{callType:n,endpoint:c,...n!=="GET"&&{payload:JSON.stringify(o)}}};return(await sr(kt,u)).content}const Lt=Pe.defineStore("expediteCart",()=>{const t=e.ref(null),l=e.ref([]),n=e.ref(),r=e.ref({}),o=lt();async function c(h,i){let f=i?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await et({data:JSON.stringify(h),config:{pathKey:f}})}async function u(h){return await et({data:JSON.stringify({lineItemIds:h}),config:{pathKey:"common.getLineItemAttributes"}})}async function g(){const h=t.value?{quoteId:t.value}:{};return await et({data:JSON.stringify(h),config:{pathKey:"promocode.getPromoCodes"}})}async function m(){const h=t.value?{quoteId:t.value}:{},i=await ns("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",h,{});return n.value=i,l.value=i.qliIds,i}async function p(h,i,f){const a={promoCode:h,quoteId:t.value,qliIds:i,isLastBatch:f,originalTotalSalesPrice:h?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await et({data:JSON.stringify(a),config:{pathKey:"promocode.applyPromoCode"}})}async function d(h){const f={records:[{fields:h.fields.map(x=>({fieldName:x.fieldName,fieldValue:x.fieldValue}))}],uniqueField:"Id",objectType:h.objectType};return await et({data:JSON.stringify(f),config:{pathKey:"update.upsertRecords"}})}async function _(h){return await et({data:JSON.stringify(h),config:{pathKey:"fetch.getRecord"}})}async function s(h){const i=h||o.cid.value;return await ns("XX_ORD1/ecommerce","startNewCart","POST",i?{cid:i}:{},{})}return{quoteId:t,qlisList:l,quoteRecord:r,getRowItems:c,getLineItemAttributesNG:u,getPromoCodeInfo:g,getQLIsForPromoCode:m,applyPromoCodeNG:p,updateRecord:d,getRecordFieldValue:_,startNewCart:s}}),o4={components:{AppTooltip:si,AppIcon:Be},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},rs=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),a4=["data-test-id"],i4=["data-test-id"],l4={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s4=[rs(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],c4={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d4=[rs(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],u4=["data-test-id"];function f4(t,l,n,r,o,c){const u=e.resolveComponent("AppIcon"),g=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:l[0]||(l[0]=(...m)=>c.toggleChecked&&c.toggleChecked(...m))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",l4,s4)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",c4,d4)):e.createCommentVNode("",!0)],10,i4),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,u4)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(g,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(u,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,a4)}const fr=me(o4,[["render",f4],["__scopeId","data-v-888eb5f4"]]),h4={class:"m-content"},p4={key:0,class:"attribute-input"},m4={key:1,class:"attribute-lookup"},y4={class:"attribute-lookup-main"},g4={key:1},x4={key:2,class:"attribute-input"},_4={key:2},b4={class:"m-footer"},v4=me({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:l}){const n=Lt(),r=t,o=l,c=e.ref([]),u=e.ref([]),g=e.ref({}),m=e.ref(!1);async function p(){m.value=!0;const i=[{fieldName:"Id",fieldValue:r.quoteId}];u.value.forEach(a=>{if(a.editable&&!a.apiName.includes(".")){let x=a.apiName;a.dataType==="REFERENCE"?(x=a.apiName.replace("__r","__c"),i.push({fieldName:x,fieldValue:a.referenceRecordId})):i.push({fieldName:x,fieldValue:a.value})}});const f={fields:i,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(f),await n.updateRecord(f),d(),o("reload",r.quoteId),o("close"),m.value=!1}function d(){const i={},f={};c.value.forEach(a=>{a.dataType==="REFERENCE"&&(f[a.apiName]=a.referenceRecordId),i[a.apiName]=a.value}),r.data.forEach(a=>{a.dataType==="REFERENCE"&&(a.referenceRecordId=f[a.apiName]),a.value=i[a.apiName]})}function _(i,f){if(i){const a=c.value.find(y=>y.label===f.firstLookup.replace("Copy from ",""));console.log("Parent",a);const x={};a.relatedFields.forEach(y=>{x[y.child]=y.value}),a&&(f.referenceRecordId=a.referenceRecordId,f.value=a.value,f.options=a.options,f.relatedFields.forEach(y=>{y.value=x[y.child]}))}else f.referenceRecordId=null,f.options=[],f.relatedFields.forEach(a=>{a.value=null})}function s(i,f){console.log(i,f);const a=f.options.find(x=>x.Id===i);i===null?(f.options=[],f.value=null,f.relatedFields.forEach(x=>{x.value=null})):(f.value=a.Name,f.relatedFields.forEach(x=>{x.value=a[x.child]}))}const h=nt(async function(i,f){f.loading=!0;const a={lookupObjectApiName:f.referenceObject,searchTerm:i||"",fields:g.value[f.apiName]||[]},x=await n.getLookupRecords(a);console.log(x),f.options=x,f.loading=!1});return e.onBeforeMount(()=>{const i={};c.value=JSON.parse(JSON.stringify(r.data)),c.value.forEach(a=>{a.dataType==="REFERENCE"&&(g.value[a.apiName]=[],a.relatedFields=[],i[a.apiName]=a,a.options=[{Name:a.value||"",Id:a.referenceRecordId}]),a.editable=a.editable&&!a.apiName.includes(".")});let f=null;c.value.forEach(a=>{if(a.referenceObject==="XX_Base__Location__c"&&(f?a.firstLookup="Copy from "+f.label:f=a),a.apiName.includes(".")){const[x,y]=a.apiName.split(".");a.parent=x,a.child=y,g.value[x]!=null&&(g.value[x].push(y),i[x].relatedFields.push(a))}}),u.value=c.value.filter(a=>!a.apiName.includes(".")),console.log(u.value,i)}),(i,f)=>(e.openBlock(),e.createBlock(Da,{title:"Modify attributes",onClicked:f[1]||(f[1]=a=>i.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",h4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,x)=>{var y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[a.firstLookup?(e.openBlock(),e.createElementBlock("div",p4,[e.createElementVNode("label",null,e.toDisplayString(a.firstLookup),1),e.createVNode(fr,{modelValue:a.same,"onUpdate:modelValue":[v=>a.same=v,v=>_(v,a)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),a.dataType==="REFERENCE"&&((y=a.relatedFields)==null?void 0:y.length)>0?(e.openBlock(),e.createElementBlock("div",m4,[e.createElementVNode("div",y4,[e.createVNode(ft,{modelValue:a.referenceRecordId,"onUpdate:modelValue":[v=>a.referenceRecordId=v,v=>s(v,a)],label:a.label,disabled:!a.editable||a.same,options:a.options,lookup:"",search:"",highlight:"",loading:a.loading,property:{key:"Id",value:"Name"},onSearch:v=>e.unref(h)(v,a)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.relatedFields,(v,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"attribute-input"},[v.dataType==="PICKLIST"||v.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,label:v.label,disabled:!v.editable,options:v.picklistValues.map(C=>({label:C,value:C})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):v.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",g4,[e.createElementVNode("label",null,e.toDisplayString(v.label),1),e.createVNode(fr,{modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,disabled:!v.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Ht,{key:2,label:v.label,disabled:!v.editable,modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",x4,[a.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:a.referenceRecordId,"onUpdate:modelValue":[v=>a.referenceRecordId=v,v=>s(v,a)],label:a.label,disabled:!a.editable,options:a.options,lookup:"",search:"",highlight:"",loading:a.loading,property:{key:"Id",value:"Name"},onSearch:v=>e.unref(h)(v,a)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):a.dataType==="PICKLIST"||a.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,label:a.label,disabled:!a.editable,options:a.picklistValues.map(v=>({label:v,value:v})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):a.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",_4,[e.createElementVNode("label",null,e.toDisplayString(a.label),1),e.createVNode(fr,{modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,disabled:!a.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Ht,{key:3,label:a.label,disabled:!a.editable,modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",b4,[e.createVNode(Ue,{text:"CANCEL",btype:"secondary",onClick:f[0]||(f[0]=a=>i.$emit("close"))}),e.createVNode(Ue,{text:"SAVE",btype:"primary",loading:m.value,onClick:p},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-55410518"]]),C4={class:"datatable"},E4={class:"m-show"},k4={key:0},B4=["onClick"],w4={key:1},N4=["onClick"],A4={class:"desktop d-show"},S4={class:"datatable-skeletion"},I4={class:"datatable-skeletion"},O4={class:"datatable-skeletion"},V4=["colspan"],T4={style:{display:"flex",gap:"1rem",height:"40px"}},D4=["onClick"],M4=["onClick"],L4={key:0},R4=["colspan"],F4={style:{display:"flex",gap:"1rem",height:"40px"}},P4={key:1},q4=["colspan"],$4={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},j4={key:0,class:"attribute",style:{width:"50%"}},H4={key:0,class:"ect-flex ect-gap-2"},U4={key:1,class:"ect-flex ect-gap-2"},z4={key:1,class:"attribute",style:{width:"50%"}},X4={key:0},K4={key:2,class:"attribute",style:{width:"50%"}},Q4={key:0},G4={key:1},hr=me({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(t,{emit:l}){const n=t,r=e.ref(null),o=e.ref(null),c=l,u=e.ref(null),g=e.ref({}),m=e.ref(null),p=e.computed(()=>n.disabled),d=function(v,b){return u.value&&u.value!==v+":"+b||n.delRecords.has(v)||p.value||m.value&&m.value!==v},_=e.computed(()=>{const{headerStyle:v,optionRow:b,productRow:C}=n.style;return{product:{backgroundColor:C.background,verticalAlign:C.verticalAlignment||"middle"},option:{backgroundColor:b.background,verticalAlign:b.verticalAlignment||"middle"},header:{backgroundColor:v.background,verticalAlign:v.verticalAlignment||"middle"}}}),s=e.computed(()=>{const{headerStyle:v,optionRow:b,productRow:C}=n.style;return{header:v.style||{},option:b.style||{},product:C.style||{}}}),h=e.computed(()=>200/n.cols.length+"px");function i(v,b,C){const E={},{table:w}=n.style;if(v){const{alignment:S,strikethrough:T}=v;S&&(E.textAlign=S),T&&(E.textDecoration="line-through")}if(b){const{width:S,minWidth:T}=b;S&&(E.width=`calc(${S.value+S.unit} - ${h.value})`),T&&(E.minWidth=T.value+T.unit)}return w.border!=="n"&&!C?(E.borderStyle="solid",E.borderColor=w.color,w.border==="b"?E.borderWidth=w.width:w.border==="x"?(E.borderTopWidth=w.width,E.borderBottomWidth=w.width,E.borderLeftWidth=0,E.borderRightWidth=0):w.border==="y"?(E.borderLeftWidth=w.width,E.borderRightWidth=w.width,E.borderTopWidth=0,E.borderBottomWidth=0):w.border==="bottom"||w.border==="default"?(E.borderTopWidth=0,E.borderBottomWidth=w.width,E.borderLeftWidth=0,E.borderRightWidth=0):w.border==="top"&&(E.borderTopWidth=w.width,E.borderBottomWidth=0,E.borderLeftWidth=0,E.borderRightWidth=0)):E.borderWidth="0px",E}function f(v,b){var E;if(b.dataType==="REFERENCE")return(E=v[b.content.replace("__c","__r")])==null?void 0:E.Name;const C=Ie(v,b.api,b.dataType);return C===""?C:b.dataType==="PERCENT"?C+"%":C}function a(v,b){v===0?c("delete",b):x(v,"XX_ORD1__QTY__c",b)}function x(v,b,C){m.value=C.Id,y(v,b,C)}const y=nt(function(v,b,C){u.value=C.Id+":"+b,g.value.Id=C.Id,g.value[b]=v;const E=()=>{u.value=null,g.value={},m.value=null};c("update",{record:g.value,callback:E})},500);return(v,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value&&o.value?(e.openBlock(),e.createBlock(v4,{key:0,data:r.value,"quote-id":o.value,onClose:b[0]||(b[0]=C=>(r.value=null,o.value=null)),onReload:b[1]||(b[1]=C=>v.$emit("reload",C))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",C4,[e.createElementVNode("div",E4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,C=>(e.openBlock(),e.createElementBlock("table",{key:C.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(E,w)=>{var S,T,A,k;return e.openBlock(),e.createElementBlock("tr",{key:w},[e.createElementVNode("th",{style:e.normalizeStyle({...i(E.header.style),..._.value.header})},[E.header?(e.openBlock(),e.createBlock(ve,{key:0,text:E.header.title,style:e.normalizeStyle(E.header.style),"sec-style":s.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...i(E.content.style),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[E.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[E.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>a(N,C)],disabled:d(C.Id,E.api),loading:C.Id+":"+E.api===u.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),options:E.content.picklist,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Ht,{key:2,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.dataType==="URL"?(e.openBlock(),e.createBlock(Xo,{key:0,src:f(C,E)},null,8,["src"])):E.content.isStatic?(e.openBlock(),e.createBlock(ve,{key:1,tag:(S=E.content)==null?void 0:S.style.tag,text:E.content.content,style:e.normalizeStyle((T=E.content)==null?void 0:T.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(ve,{key:2,loading:t.loading.includes(E.dataType)&&(!t.loadingRowId||t.loadingRowId===C.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:f(C,E),style:e.normalizeStyle((k=E.content)==null?void 0:k.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",k4,[e.createElementVNode("th",{style:e.normalizeStyle({...i(),..._.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...i(),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("delete",C)},"REMOVE",10,B4)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref($o).includes(C.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",w4,[e.createElementVNode("th",{style:e.normalizeStyle({...i(),..._.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...i(),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("configure",C)},"CONFIGURE",10,N4)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",A4,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(_.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,C=>{var E;return e.openBlock(),e.createElementBlock("th",{key:C.key,style:e.normalizeStyle(i((E=C.header)==null?void 0:E.style,C.style))},[C.header?(e.openBlock(),e.createBlock(ve,{key:0,text:C.header.title,style:e.normalizeStyle(C.header.style),"sec-style":s.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,E=>(e.openBlock(),e.createElementBlock("td",{key:E.key,style:e.normalizeStyle(i(E.content.style,E.style))},[e.createElementVNode("div",S4,[e.createVNode(Bt)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",I4,[e.createVNode(Bt)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",O4,[e.createVNode(Bt)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",T4,[e.createVNode(Bt),e.createVNode(Bt)])],12,V4)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(_.value[C.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(E,w)=>{var S,T,A,k;return e.openBlock(),e.createElementBlock("td",{key:w,style:e.normalizeStyle(i(E.content.style,E.style,!!C.Attributes)),class:e.normalizeClass({"padding-left":w==0&&C.XX_ORD1__Parent_QLI__c})},[E.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[E.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>a(N,C)],disabled:d(C.Id,E.api),loading:C.Id+":"+E.api===u.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),options:E.content.picklist,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Ht,{key:2,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.dataType==="URL"?(e.openBlock(),e.createBlock(Xo,{key:0,src:f(C,E)},null,8,["src"])):E.content.isStatic?(e.openBlock(),e.createBlock(ve,{key:1,tag:(S=E.content)==null?void 0:S.style.tag,text:E.content.content,style:e.normalizeStyle((T=E.content)==null?void 0:T.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(ve,{key:2,loading:t.loading.includes(E.dataType)&&(!t.loadingRowId||t.loadingRowId===C.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:f(C,E),style:e.normalizeStyle((k=E.content)==null?void 0:k.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...i(null,null,!!C.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("delete",C)},"REMOVE",10,D4)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...i(null,null,!!C.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref($o).includes(C.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("configure",C)}," CONFIGURE ",10,M4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),C.attributesLoading?(e.openBlock(),e.createElementBlock("tr",L4,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",F4,[e.createVNode(Bt),e.createVNode(Bt)])],12,R4)])):C.Attributes?(e.openBlock(),e.createElementBlock("tr",P4,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",$4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.Attributes,(E,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[E.value||E.existingValue||E.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.value&&(E.existingValue||E.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",j4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value!==E.existingValue&&E.value!==E.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",H4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(ve,{text:E.existingValueReferenceName||E.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",U4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&E.editable&&C.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Qo,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):E.value?(e.openBlock(),e.createElementBlock("div",z4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value?(e.openBlock(),e.createElementBlock("div",X4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&E.editable?(e.openBlock(),e.createBlock(Qo,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):E.existingValue?(e.openBlock(),e.createElementBlock("div",G4,[e.createVNode(ve,{text:E.existingValueReferenceName||E.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&E.editable?(e.openBlock(),e.createBlock(Qo,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,q4)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-54bd5aa5"]]),W4={class:"prodlist"},Z4={class:"prodlist-header"},J4={key:0},Y4={key:1,class:"summary"},e6={key:1,class:"summary"},t6=me({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1}},emits:["counts"],setup(t,{emit:l}){const n=Lt(),r=Mt(),o=t,c=l,u=O=>O.toUpperCase()||"",g=e.computed(()=>{var O;return((O=o.fields)==null?void 0:O.styling)||{}}),m=e.computed(()=>{var O,I;return(I=(O=o.configuration)==null?void 0:O.allowedActions)==null?void 0:I.delete}),p=e.computed(()=>{var O,I;return(I=(O=o.configuration)==null?void 0:O.allowedActions)==null?void 0:I.configure}),d=e.computed(()=>{var O;return o.configuration.displayAttributes?(O=o.configuration)==null?void 0:O.attribute:!1}),_=e.computed(()=>{var O;return(O=o.configuration)==null?void 0:O.sort}),s=e.computed(()=>{var O;return(O=o.configuration)==null?void 0:O.group}),h=e.computed(()=>{const O=s.value.groupheader.style;return O?D(O):{}}),i=e.computed(()=>{const O=s.value.groupfooter.style;return O?D(O):{}}),f=e.computed(()=>{const O={},{border:I,color:R,width:P}=g.value.table;return I==="default"&&(O.borderStyle="solid",O.borderColor=R,O.borderWidth=P,O.borderTopWidth=0),O}),a=jt(),x=["CURRENCY","DOUBLE","PERCENT"],y=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],v=e.ref(null),b=e.ref([]),C=e.ref([]),E=e.ref([]),w=e.ref(!1),S=e.ref(!1),T=e.ref(new Set),A=e.ref([]),k=e.ref([]),N=new Map;function D(O){let I={padding:"1.25rem 2rem"};const{overrite:R,backgroundColor:P,verticalAlignment:M,padding:q}=O;return R&&(I={backgroundColor:P,verticalAlign:M,padding:q||"1.25rem 2rem"}),I}const L=async function({record:O,callback:I}){const R=[];for(const M in O)R.push({fieldName:M,fieldValue:O[M]});const P={fields:R,objectType:o.configuration.objectType};await n.updateRecord(P),I(),O.XX_ORD1__QTY__c!==void 0&&(v.value=O.Id,await Z("FIELD_RELOAD"),v.value=null)};async function $(O){v.value=O,await Z("RELOAD_ALL_FIELDS"),v.value=null}const U=O=>{a.push({path:"/cpq",query:{id:O.XX_ORD1__Item__c,lid:O.Id,cstid:storefrontStore.continueShoppingId}})},Q=async function(O){T.value.add(O.Id),w.value=!0;const I=[O.Id];await r.deleteLineItems(I),await Z("RELOAD"),w.value=!1,T.value.delete(O.Id)};async function Z(O){O==="RELOAD"?S.value=!0:O==="FIELD_RELOAD"?E.value=x:O==="RELOAD_ALL_FIELDS"&&(E.value=y);const{groupby:I,grouplevel:R}=o.configuration.group,P=n.quoteId,M=o.footer.map(K=>({field:K.field,snippet:K.function||"SUM"})),q={filterObject:o.configuration.objectType,fieldsToDisplay:[...C.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:o.configuration.filters,parentObjectField:o.configuration.parentObjectField,objectId:P,groupby:I.field,grouplevel:R,primarysort:_.value.primary.field,secondarysort:_.value.secondary.field,primarysortdesc:_.value.primary.direction!=="asc",secondarysortdesc:_.value.secondary.direction!=="asc",filterlogic:o.configuration.filterlogic},j=I.field&&R,z=await n.getRowItems(q,j);j?B(z,R):F(z),o.configuration.displayAttributes&&X(),S.value=!1,E.value=[]}async function X(){const O=v.value,I=[];k.value.forEach(P=>{P.rows.forEach(M=>{M.attributes=N.get(M.Id),console.log("row.attributes",M.attributes),O?M.Attributes=N.get(M.Id):M.attributesLoading=!0,I.push(M.Id)})});const R=await n.getLineItemAttributesNG(I);k.value.forEach(P=>{P.rows.forEach(M=>{const q=R[M.Id];if(q==null?void 0:q.some(z=>z.value&&!d.value.displayonlychanged||z.value&&z.existingValue&&d.value.displayonlychanged)){const z=[],K=new Set;q.forEach(J=>{K.has(J.apiName)||(K.add(J.apiName),z.push(J))}),M.Attributes=z,N.set(M.Id,z)}M.attributesLoading=!1})}),console.log("attributesByIdMap",N)}function F(O){var M;const I=O.lstRecords,R=[],P=O.lstRecords&&((M=O.lstRecords)==null?void 0:M.length)>0;if(c("counts",P),O.lstAggregateField&&O.lstAggregateField.length>0){const q=new Map;O.lstAggregateField.forEach(j=>{q.set(j.fieldName,j.totalValue)}),o.footer.forEach(j=>{j.value=q.get(j.field),R.push(j)})}k.value=[{rows:I,summary:R}]}function B(O,I){const R=[];let P;O.forEach(M=>{var q;if(I==="option"){if((q=M.product)!=null&&q.thisobject){const j={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(z=>{const K={name:z.groupName,rows:[]},J=[];z.options.forEach(Y=>{K.rows.push(Y.thisobject)}),z.groupTotals&&z.groupTotals.length>0&&z.groupTotals.forEach(Y=>{var ae,W;J.push({label:K.name,value:Y.amount,style:((W=(ae=s.value)==null?void 0:ae.groupfooter)==null?void 0:W.style)||{}})}),K.summary=J,j.options.push(K)}),R.push(j)}}else{if(P={name:M.groupName,rows:[]},M.productRows.forEach(j=>{P.rows.push(j[I].thisobject),j.options.forEach(z=>{const K={...z.thisobject};K.isOption=!0,P.rows.push(K)})}),s.value.displaygroupfooter){const j=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(z=>{var K,J;j.push({label:P.name,value:z.amount,style:((J=(K=s.value)==null?void 0:K.groupfooter)==null?void 0:J.style)||{}})}),P.summary=j}else P.summary=[];R.push(P)}}),k.value=R}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),A.value=JSON.parse(JSON.stringify(o.columns)),b.value=o.summary,A.value.forEach(O=>{O.content.dataType=u(O.content.dataType),O.editby=O.editable,O.editable=O.editable!=="not",O.dataType=O.content.dataType,O.api=O.content.field,C.value.push(O.content.field)}),C.value.includes("XX_ORD1__QLI_Type__c")||C.value.push("XX_ORD1__QLI_Type__c"),Z("RELOAD")}),(O,I)=>{var R;return e.openBlock(),e.createElementBlock("div",W4,[e.createElementVNode("div",Z4,[t.header.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(R=t.header.style)==null?void 0:R.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!s.value.repeatcolumheadings||S.value?(e.openBlock(),e.createElementBlock("div",J4,[e.createVNode(hr,{cols:A.value,rows:[],summary:[],style:e.normalizeStyle(g.value),loading:E.value,del:m.value,configure:p.value,disabled:w.value,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[0]||(I[0]=P=>$(P))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(f.value)},[e.createVNode(hr,{hidecolumn:"",cols:A.value,rows:[],summary:[],style:e.normalizeStyle(g.value),"row-loading":!0,loading:E.value,del:m.value,configure:p.value,disabled:w.value,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[1]||(I[1]=P=>$(P))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(f.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,P=>(e.openBlock(),e.createElementBlock("div",{key:P.name,class:e.normalizeClass(["productlist",P.isProduct?"prodlist-product":"prodlist-option"])},[s.value.displaygroupheader&&P.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(h.value)},[e.createVNode(ve,{text:"Group: "+P.name,style:e.normalizeStyle(s.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(hr,{hidecolumn:!s.value.repeatcolumheadings,cols:A.value,rows:P.rows,style:e.normalizeStyle(g.value),"row-loading":S.value,loading:E.value,del:m.value,configure:p.value,disabled:w.value,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[2]||(I[2]=M=>$(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),P.summary.length>0?(e.openBlock(),e.createElementBlock("div",Y4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.summary,(M,q)=>{var j,z,K;return e.openBlock(),e.createElementBlock("div",{key:q,class:"summary_row",style:e.normalizeStyle(i.value)},[e.createVNode(ve,{tag:(j=M==null?void 0:M.style)==null?void 0:j.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(ve,{loading:((z=E.value)==null?void 0:z.length)>0||S.value,tag:(K=M==null?void 0:M.style)==null?void 0:K.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),P.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(P.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[s.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(h.value)},[e.createVNode(ve,{text:"Group: "+M.name,style:e.normalizeStyle(s.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(hr,{hidecolumn:!s.value.repeatcolumheadings,cols:A.value,rows:M.rows,style:e.normalizeStyle(g.value),"row-loading":S.value,loading:E.value,del:m.value,configure:p.value,disabled:w.value,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,"is-option":!0,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[3]||(I[3]=q=>$(q))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",e6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(q,j)=>{var z,K,J;return e.openBlock(),e.createElementBlock("div",{key:j,class:"summary_row",style:e.normalizeStyle(i.value)},[e.createVNode(ve,{tag:(z=q==null?void 0:q.style)==null?void 0:z.tag,text:q.label+" : ",style:e.normalizeStyle(q==null?void 0:q.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(ve,{loading:((K=E.value)==null?void 0:K.length)>0||S.value,tag:(J=q==null?void 0:q.style)==null?void 0:J.tag,text:q.value,style:e.normalizeStyle(q==null?void 0:q.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))])}}},[["__scopeId","data-v-59af0e9f"]]),n6={class:"detail-section"},r6={key:0,class:"selectedtext sm:hidden"},o6={class:"expand material-icons-outlined"},a6={key:1,class:"detail-section_title"},i6={key:2,class:"detail-section_slot"},l6=me({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(t,{emit:l}){const n=t;return(r,o)=>{var c,u;return e.openBlock(),e.createElementBlock("div",n6,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:o[0]||(o[0]=g=>!n.disabled&&r.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(c=n.style)==null?void 0:c.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(Bt,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",r6,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",o6,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",a6,[t.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(u=t.style)==null?void 0:u.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",i6,[e.renderSlot(r.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function s6(t,l,n){if(!l)return t;if(n.aliasName)return c6(t,l,n);{const o=l.split(".").reduce((c,u)=>c[u]||"",t)||"";return{original:o,value:o,metadata:n}}}function c6(t,l,n){var u;const r=l.split(".");let o=l;r.length>1&&(o=r.pop(),t=r.reduce((g,m)=>g[m]||{},t));let c=t[n.aliasName]||t[o]||"";return c&&n.dataType&&((u=n.dataType)==null?void 0:u.toUpperCase())==="CURRENCY"&&c.includes("(")&&(c=c.split("(")[0]),{value:c,original:t[o],metadata:n}}function d6(t){let l=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",l),l}const u6={class:"quote-summary"},f6={key:0,class:"qt-smuarry"},h6={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},p6=me({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(t){const l=Mt(),n=Lt(),r=t,o=Ko(),c=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.header}),u=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.content}),g=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.footer}),m=e.ref(!1),p=e.ref(!1),d=e.ref(!1),_=e.ref([]),s=e.ref({}),h=e.computed(()=>{var a,x;return o.isMobile.value&&!m.value&&g.value&&g.value.length>0?`${g.value[0].label} ${((a=s.value[g.value[0].field])==null?void 0:a.value)||""}`:(x=c.value)==null?void 0:x.title});async function i(a){console.log("Quote Summary",a),p.value=!0,d.value&&await l.calculateAvaTax();const x=_.value.map(({field:y})=>y);s.value=await n.getRecordFieldValue({recordId:r.quoteId,lstFields:x}),_.value.forEach(({field:y,dataType:v})=>{s.value[y]=s6(s.value,y,{dataType:v,aliasName:d6(y)})}),p.value=!1}const f=()=>{o.isMobile.value?m.value=!m.value:m.value=!0};return e.onMounted(async()=>{var x,y,v,b,C,E,w,S,T;m.value=!o.isMobile.value;const a=(y=(x=document.querySelector(`[page-block-id="${r.id}"]`))==null?void 0:x.parentElement)==null?void 0:y.parentElement;a&&(a.style.display=o.isMobile.value?"none":"block"),d.value=r.tax||((v=u.value)==null?void 0:v.some(({field:A})=>A==="XX_ORD1__Taxes__c")),(r.quoteId||d.value)&&(_.value=(C=(b=r.fields)==null?void 0:b.content)==null?void 0:C.map(({field:A,dataType:k})=>({field:A,dataType:k})),((w=(E=r.fields)==null?void 0:E.footer)==null?void 0:w.length)>0&&((T=(S=r.fields)==null?void 0:S.footer)==null||T.forEach(({field:A,dataType:k})=>_.value.push({field:A,dataType:k}))),i())}),(a,x)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",u6,[t.quoteId?(e.openBlock(),e.createElementBlock("div",f6,[e.createVNode(l6,{expand:m.value,title:h.value,style:e.normalizeStyle(c.value.style),header:e.unref(o).isMobile.value,onExpand:x[0]||(x[0]=y=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",h6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,y=>{var v,b,C,E;return e.openBlock(),e.createElementBlock("div",{key:y.field,class:"summary-item"},[y.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(v=y.style)==null?void 0:v.tag,text:y.label,style:e.normalizeStyle(y.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(b=s.value[y.field])!=null&&b.value?(e.openBlock(),e.createBlock(ve,{key:1,loading:p.value,tag:(C=y.style)==null?void 0:C.tag,text:(E=s.value[y.field])==null?void 0:E.value,style:e.normalizeStyle(y.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,y=>{var v,b,C,E;return e.openBlock(),e.createElementBlock("div",{key:y.field,class:"summary-total"},[y.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(v=y.style)==null?void 0:v.tag,text:y.label,style:e.normalizeStyle(y.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(b=s.value[y.field])!=null&&b.value?(e.openBlock(),e.createBlock(ve,{key:1,loading:p.value,tag:(C=y.style)==null?void 0:C.tag,text:(E=s.value[y.field])==null?void 0:E.value,style:e.normalizeStyle(y.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-9dce15f7"]]),m6={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},y6={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const t=[];return!this.type||!m6[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},g6={key:0,class:"ect-flex ect-justify-center"},x6={key:1};function _6(t,l,n,r,o,c){const u=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",c.getBtnClass()],style:c.getBtnStyle(),onClick:l[0]||(l[0]=e.withModifiers(g=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",g6,[e.createVNode(u,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",x6,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const Go=me(y6,[["render",_6],["__scopeId","data-v-7428ebd4"]]),b6={class:"promocode-input"},v6={class:"m-1"},C6=me({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0}},setup(t){const l=Lt(),n=t,r=e.computed(()=>n.fields.label),o=e.ref(!1),c=e.ref(""),u=e.ref(!1),g=e.ref(!1),m=e.ref(""),p=e.ref(null),d=async()=>{u.value=!0,o.value=!0,g.value=!1,await l.getQLIsForPromoCode();const i=await _(!1);i.error||(m.value=i),u.value=!1},_=async i=>{const a=l.qlisList,x=Math.ceil(a.length/50);let y="";for(let v=0;v<x;v++){const b=v*50,C=b+50,E=v===x-1;if(y=await s(a.slice(b,C),E,i),y&&y.error)return g.value=y.error,p.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),u.value=!1,i||(o.value=!1,h(!0)),y}return y},s=async(i,f,a)=>await l.applyPromoCodeNG(a?"":c.value,i,f),h=async i=>{u.value=!0,await l.getQLIsForPromoCode(),i!==!0&&(g.value=!1);const f=await _(!0);(!f||f&&!f.error)&&i!==!0&&(o.value=!1,m.value="",c.value=""),u.value=!1};return e.onMounted(async()=>{const i=await l.getPromoCodeInfo();console.log("Offer::",i),i!=null&&i.XX_ORD1__Promo_Code__c&&(c.value=i.XX_ORD1__Promo_Code__c,m.value=i.XX_ORD1__Short_Description__c,o.value=!0)}),(i,f)=>{var a,x,y,v,b,C,E;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:p,class:"promocode"},[(a=r.value)!=null&&a.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(x=r.value)==null?void 0:x.title,style:e.normalizeStyle((y=r.value)==null?void 0:y.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",b6,[e.createVNode(Ht,{modelValue:c.value,"onUpdate:modelValue":[f[0]||(f[0]=w=>c.value=w),f[1]||(f[1]=w=>o.value=!1)],class:"promocode-input_box",disabled:o.value,error:g.value},null,8,["modelValue","disabled","error"]),u.value?(e.openBlock(),e.createBlock($n,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.value?(e.openBlock(),e.createBlock(Go,{key:1,theme:(C=t.fields.removeButton)==null?void 0:C.style.theme,disabled:c.value.length<1,text:(E=t.fields.removeButton)==null?void 0:E.title,onClick:h},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(Go,{key:0,theme:(v=t.fields.applyButton)==null?void 0:v.style.theme,disabled:c.value.length<1,text:(b=t.fields.applyButton)==null?void 0:b.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",v6,e.toDisplayString(m.value),1)])],512)}}},[["__scopeId","data-v-c0d9fa36"]]),os={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function E6(t){return os[t]||"dd/MM/yyyy"}function k6(t,l){if((t==null?void 0:t.length)<6||!l)return null;const n=os[l]||"dd/MM/yyyy",r=n.includes("/")?"/":n.includes("-")?"-":".",o=n.split(r),c=t.split(r),u={};if(o.forEach((m,p)=>{u[m]=parseInt(c[p])}),u.yyyy>9999||u.yyyy<1e3||u.MM<0||u.MM>12||u.dd<0||u.dd>31)return null;const g=new Date(u.yyyy,u.MM-1,u.dd);return g!="Invalid Date"?g:null}const pr=t=>(e.pushScopeId("data-v-975857d5"),t=t(),e.popScopeId(),t),B6=["data-test-id"],w6=["for","data-test-id"],N6=["data-test-id"],A6=["placeholder","data-test-id"],S6=["data-test-id"],I6=["data-test-id"],O6=["data-test-id"],V6=["data-test-id"],T6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],D6=["data-test-id"],M6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],L6=["data-test-id"],R6=["data-test-id"],F6=["data-test-id"],P6=["data-test-id"],q6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],$6=["data-test-id"],j6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],H6=["data-test-id"],U6={class:"c-container"},z6={class:"cc-head"},X6={class:"cc-body"},K6={class:"cdc-day"},Q6=["onClick"],G6=60*60*24*1e3,W6=me({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(t,{emit:l}){const n=t,r=l,o=Date.now()-Date.now()%G6+new Date().getTimezoneOffset()*1e3*60,c=W=>{if(!W)return"";const[ee,le,de]=W.split("-");return`${le}/${de}/${ee}`},u=W=>{if(!W)return"";const[ee,le,de]=W.split("/");return`${de}-${ee.padStart(2,"0")}-${le.padStart(2,"0")}`},g=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:o,monthDetails:[]}),m=e.ref({position:"absolute",top:"0px",left:"0px",width:"0px"}),p=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"],s=e.ref(new Date(1e3,0,1)),h=e.ref(new Date(9999,0,1)),i=e.ref(!0),f=e.ref(!1),a=e.ref(""),x=e.ref(""),y=e.ref(!1),v=e.ref(""),b=e.ref(-1),C=e.computed(()=>E6(n.locale)),E=e.computed(()=>s.value.getFullYear()<g.value.year),w=e.computed(()=>h.value.getFullYear()>g.value.year),S=e.computed(()=>E.value||s.value.getMonth()<g.value.month),T=e.computed(()=>w.value||h.value.getMonth()>g.value.month),A=e.computed(()=>{if(x.value){const W=x.value.getTime();if(h.value.getTime()<W)return"Max date can be "+h.value.toLocaleDateString(n.locale);if(s.value.getTime()>W)return"Min date can be "+s.value.toLocaleDateString(n.locale)}return!1}),k=e.computed(()=>{let W=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return i.value||(W="Date format must be "+C.value),A.value&&(W=A.value),r("error",W),W}),N=e.computed(()=>(v.value==""||v.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:v.value!=n.modelValue);e.watch(()=>n.modelValue,W=>{a.value=W?c(W):""}),e.watch(()=>n.min,W=>{s.value=W?new Date(W):new Date(1e3,0,1)}),e.watch(()=>n.max,W=>{h.value=W?new Date(W):new Date(9999,0,1)}),e.watch(a,W=>{if(W)try{const ee=k6(W,n.locale);if(x.value=ee||x.value,i.value=!!ee,i.value){const le=u(W);if(v.value===le)return;r("update:modelValue",le)}}catch(ee){console.info("[ERROR]: Date parsing error:",ee),i.value=!1}else i.value=!0,x.value=null,r("update:modelValue","")});const D=e.ref(null),L=e.ref(null),$=e.ref(null);e.onMounted(()=>{ae(),h.value=n.max?new Date(n.max):h.value,s.value=n.min?new Date(n.min):s.value,n.modelValue&&(a.value=c(n.modelValue),i.value=!!a.value),v.value=n.modelValue,window.addEventListener("resize",U),window.addEventListener("scroll",U,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)});const U=()=>{if(!$.value)return;const W=$.value.getBoundingClientRect(),ee=420,le=334,de=window.innerHeight-W.bottom,ne=W.top,re=de<ee&&ne>ee;m.value={position:"absolute",top:`${re?W.top-ee:W.bottom}px`,left:`${W.left}px`,width:`${le}px`,zIndex:9999}},Q=()=>{y.value||(j(),y.value=!0,U(),r("focus-in"))},Z=(W=!1)=>{(!f.value||W)&&setTimeout(()=>{b.value=-1,y.value=!1,r("focus-out",x.value)},100)},X=()=>{L.value&&L.value.focus()},F=W=>{const ee=W.index-W.firstDay,le=W.index%7;let de=W.month-1,ne=W.year;de<0&&(de=11,ne--);const re=B(ne,de),se=(ee<0?re+ee:ee%W.numberOfDays)+1,ce=new Date(W.year,W.month,se).getTime(),ie=ee<0||s.value.getTime()>ce?-1:ee>=W.numberOfDays||h.value.getTime()<ce?1:0;return{date:se,day:le,month:ie,timestamp:ce,dayString:d[le]}},B=(W,ee)=>40-new Date(W,ee,40).getDate(),O=(W,ee)=>{const le=new Date(W,ee).getDay(),de=B(W,ee),ne=[],re=6;let se=null,ce=0;const ie=7;for(let pe=0;pe<re;pe++)for(let ue=0;ue<ie;ue++)se=F({index:ce,numberOfDays:de,firstDay:le,year:W,month:ee}),ne.push(se),ce++;return ne},I=W=>W.timestamp===o,R=W=>W.timestamp===g.value.selectedDay,P=W=>{if(!W)return null;if(W instanceof Date)return{year:W.getFullYear(),month:W.getMonth()+1,date:W.getDate()};if(typeof W=="string"&&W.includes("/")){const[ee,le,de]=W.split("/");return{year:parseInt(de),month:parseInt(ee),date:parseInt(le)}}return null},M=W=>_[Math.max(Math.min(11,W),0)]||"Month",q=W=>{const ee=new Date(W.year,W.month-1,W.date).getTime();g.value={selectedDay:ee}},j=()=>{ae();const W=P(x.value);W!==null&&(q(W),g.value={year:W.year,month:W.month-1,monthDetails:O(W.year,W.month-1)})},z=W=>{const ee=new Date(W),le=(ee.getMonth()+1).toString().padStart(2,"0"),de=ee.getDate().toString().padStart(2,"0"),ne=ee.getFullYear();return a.value=`${le}/${de}/${ne}`,`${ne}-${le}-${de}`},K=W=>{g.value={selectedDay:W.timestamp};const ee=z(W.timestamp);Z(!0),r("update:modelValue",ee),L.value&&L.value.blur()},J=W=>{if(n.disableYear)return;const ee=g.value.year+W;let le=g.value.month;s.value.getFullYear()===ee&&s.value.getMonth()>le&&(le=s.value.getMonth()),h.value.getFullYear()===ee&&h.value.getMonth()<le&&(le=h.value.getMonth()),g.value={year:ee,month:le,monthDetails:O(ee,le)}},Y=W=>{if(n.disableMonth)return;let ee=g.value.year,le=g.value.month+W;le===-1?(le=11,ee--):le===12&&(le=0,ee++),g.value={year:ee,month:le,monthDetails:O(ee,le)}},ae=()=>{const W=new Date,ee=W.getFullYear(),le=W.getMonth();g.value={...g.value,year:ee,month:le,selectedDay:o,monthDetails:O(ee,le)}};return(W,ee)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:D,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ee[2]||(ee[2]=le=>f.value=!0),onMouseout:ee[3]||(ee[3]=le=>f.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!k.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!k.value})},"*",2)):e.createCommentVNode("",!0)],10,w6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:$,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":y.value,errorBorder_color:!!k.value,highlight:N.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:Q,onFocusout:ee[1]||(ee[1]=le=>Z(!1)),onClick:X},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:L,"onUpdate:modelValue":ee[0]||(ee[0]=le=>a.value=le),type:"text",autocomplete:"off",placeholder:C.value,"data-test-id":`${t.dataTestId}-input`},null,8,A6),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,N6),k.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(k.value),1)],8,S6)):e.createCommentVNode("",!0)],40,B6),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[y.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(m.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ee[8]||(ee[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!E.value||t.disableYear}]),onClick:ee[4]||(ee[4]=le=>J(-1))},T6,2)],8,V6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!S.value||t.disableMonth}]),onClick:ee[5]||(ee[5]=le=>Y(-1))},M6,2)],8,D6),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(g.value.year),9,R6),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(g.value.month)),9,F6)],8,L6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!T.value||t.disableMonth}]),onClick:ee[6]||(ee[6]=le=>Y(1))},q6,2)],8,P6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!w.value||t.disableYear}]),onClick:ee[7]||(ee[7]=le=>J(1))},j6,2)],8,$6)],8,O6),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",U6,[e.createElementVNode("div",z6,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,(le,de)=>e.createElementVNode("div",{key:de,class:"cch-name"},e.toDisplayString(le),1)),64))]),e.createElementVNode("div",X6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.monthDetails,(le,de)=>(e.openBlock(),e.createElementBlock("div",{key:de,class:e.normalizeClass(["c-day-container",{disabled:le.month!==0,highlight:I(le),"highlight-green":R(le)}])},[e.createElementVNode("div",K6,[e.createElementVNode("span",{onClick:ne=>K(le)},e.toDisplayString(le.date),9,Q6)])],2))),128))])])],8,H6)],44,I6)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-975857d5"]]),Z6=t=>(e.pushScopeId("data-v-b4b46e61"),t=t(),e.popScopeId(),t),J6={key:0,class:"custom-form_block"},Y6={class:"custom-form_block-header"},e8={key:0,class:"custom-form_block-content"},t8={key:1,class:"custom-form_block-content"},n8={key:2,class:"custom-form_block-footer"},r8={key:3,class:"custom-form_block-action"},o8={key:1,class:"custom-form_success"},a8={class:"custom-form_success_message"},i8=Z6(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),l8=me({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(t,{expose:l}){var A;const n=Lt(),r=t,o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,c=e.ref({}),u=e.ref(!1),g=e.ref(!1),m=e.ref(!1),p=e.ref({}),d=e.ref(null),_=e.ref(0),s=e.ref({}),h=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.header}),i=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.footer}),f=e.computed(()=>r.fields&&r.fields.action&&r.fields.action.label?r.fields.action:!1),a=e.computed(()=>"en-US");e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.guidance});const x=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.confirmation}),y=e.computed(()=>r.configuration),v=e.ref(JSON.parse(JSON.stringify((A=r.fields)==null?void 0:A.content))),b=k=>k?"custom-form_block-content_"+k.toLowerCase():"custom-form_block-content_full",C=()=>{m.value=!1,v.value.forEach(k=>{y.value.populate||(c.value[k.field]="")})},E=nt(async function(k,N,D){v.value[D].loading=!0;const L={objectApiName:r.configuration.objectType,lookupFieldApiName:N,searchTerm:k||""},$=await n.getLookupRecords(L);console.log("Records:::",$),v.value[D].options=$,v.value[D].loading=!1}),w=nt(()=>{!f.value&&!r.fields.isGuidance&&S(!0)},500),S=async k=>{console.log("handlerActionClick");let N=!1;if(v.value.forEach(D=>{D.isFormulaField||(D.dataType==="DATETIME"?c.value[D.field]=new Date().toISOString():D.required&&D.editable&&!c.value[D.field]&&D.dataType!=="BOOLEAN"?(D.error=!0,N=!0):(D.error=null,D.dataType==="EMAIL"&&c.value[D.field]&&!o.test(c.value[D.field])&&(D.error="Enter a valid email",N=!0)))}),!N){g.value=!0;const D=[];for(const U in c.value)(s.value[U]||U==="Id")&&D.push({fieldName:U,fieldValue:c.value[U]});const L={fields:D,objectType:r.configuration.objectType};if(r.options&&r.options.returnError){const U=await n.updateRecord(L,!0);if(!U||typeof U=="object"&&U.ERROR)return console.log("Error in saving",U),g.value=!1,U?U.ERROR:!1}else if(!await n.updateRecord(L))return g.value=!1,!1;const $=n.quoteRecord;for(const U in c.value)$[U]=c.value[U];return g.value=!1,k||(m.value=!0),!0}};function T(){u.value=!0,console.log("Quote Records:::",r.quoteId),v.value.forEach(k=>{var N,D,L;if(k.visiblity=k.dataType!=="DATETIME",y.value.populate&&r.quoteId)if(k.dataType==="BOOLEAN")c.value[k.field]=((N=n.quoteRecord)==null?void 0:N[k.field])||!1;else if(k.dataType==="REFERENCE"){const $=k.field.replace("__c","__r"),U=(D=n.quoteRecord)==null?void 0:D[$];U&&(c.value[k.field]=U.Id,k.options=[{Name:U.Name,Id:U.Id}])}else if(k.dataType==="DATE"){const $=k.field.replaceAll("_","").toLowerCase();c.value[k.field]=(L=n.quoteRecord)==null?void 0:L[$]}else c.value[k.field]=Ie(n.quoteRecord,k.field,k.dataType,!0,!0);k.editable&&k.dataType==="PICKLIST"&&(k.options=k.picklist.map($=>({label:$,value:$})))}),u.value=!1}return e.watch(n.quoteRecord,k=>{for(const N in c.value)c.value[N]=k==null?void 0:k[N]}),e.onBeforeMount(async()=>{u.value=!0,p.value=JSON.parse(JSON.stringify(r.fields)),v.value=p.value.content;const k=r.quoteId,N=[];v.value.forEach(D=>{N.push(D.field),s.value[D.field]=D.editable&&!D.isFormulaField,D.size=b(D.size)}),p.value.request=c.value={Id:k},d.value=setInterval(()=>{r.quoteId&&_.value>5&&(T(),clearInterval(d.value)),_.value++},100)}),l({handlerActionClick:S}),(k,N)=>{var D,L,$,U,Q,Z,X;return m.value?(e.openBlock(),e.createElementBlock("div",o8,[e.createElementVNode("div",a8,[i8,e.createTextVNode(" "+e.toDisplayString((X=x.value)==null?void 0:X.label),1)]),x.value&&x.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",J6,[e.createElementVNode("div",Y6,[(D=h.value)!=null&&D.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(L=h.value)==null?void 0:L.title,style:e.normalizeStyle(($=h.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),u.value?(e.openBlock(),e.createElementBlock("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(F,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["custom-form_block-content_skeletion",F.size])},[e.createVNode(st)],2))),128))])):u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",t8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(F,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[F.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",F.size])},[F.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],options:F.options,disabled:!F.editable,select:"",error:F.error,required:F.required,label:F.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):F.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(fr,{key:1,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],label:F.label},null,8,["modelValue","onUpdate:modelValue","label"])):F.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(ft,{key:2,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],options:F.options,disabled:!F.editable,lookup:"",search:"",error:F.error,required:F.required,label:F.label,loading:F.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:O=>e.unref(E)(O,F.field,B)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):F.dataType==="DATE"?(e.openBlock(),e.createBlock(W6,{key:3,label:F.label,required:F.required,disabled:!F.editable,error:F.error,modelValue:c.value[F.field],"onUpdate:modelValue":O=>c.value[F.field]=O,locale:a.value,highlight:""},null,8,["label","required","disabled","error","modelValue","onUpdate:modelValue","locale"])):F.visiblity?(e.openBlock(),e.createBlock(Ht,{key:4,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],error:F.error,required:F.required,disabled:!F.editable,label:F.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),i.value?(e.openBlock(),e.createElementBlock("div",n8,[(U=i.value)!=null&&U.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(Q=i.value)==null?void 0:Q.title,style:e.normalizeStyle((Z=i.value)==null?void 0:Z.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",r8,[g.value?(e.openBlock(),e.createBlock($n,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(Ue,{key:1,theme:f.value.style.theme,text:f.value.label,onClick:N[0]||(N[0]=F=>S(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-b4b46e61"]]),s8={class:"custom-button"},c8={key:1,class:"custom-button_spinner"},d8=me({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""}},setup(t){const l=Lt(),n=Mt(),r=jt(),o=t,c=e.computed(()=>{var p;return!!((p=n.quoteRecord)!=null&&p.XX_ORD1__Active_Customer_Contact__c)||!0}),u=e.computed(()=>{var p,d;return(d=(p=o.fields)==null?void 0:p.actions)==null?void 0:d.filter(_=>c.value?_.action!=="ACTIVATE":_.action!=="SAVE_FOR_LATER")}),g=async p=>{p.spinner=!0,p.action==="CHECKOUT"||(p.action==="SAVE_FOR_LATER"?await l.startNewCart():p.action==="ACTIVATE"&&await l.makeActiveCart()),p.spinner=!1,m(p.targetTemplateId)};function m(p){p&&r.push({path:"/",query:Object.assign({pageId:p})})}return(p,d)=>(e.openBlock(),e.createElementBlock("div",s8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[_.spinner?(e.openBlock(),e.createElementBlock("div",c8,[e.createVNode($n)])):(e.openBlock(),e.createBlock(Go,{key:0,theme:_.style.theme,text:_.label,onClick:h=>g(_)},null,8,["theme","text","onClick"]))],64))),128))]))}},[["__scopeId","data-v-218277a5"]]),Wo=function(t,l){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:r}=t;n.visibility=r;const{layout:o}=t;if(n.blockStyle=u8(o,l),o&&(o!=null&&o.padding)){const{top:g,bottom:m,left:p,right:d}=o.padding;g&&(n.sectionStyle.paddingTop=`${g}px`),m&&(n.sectionStyle.paddingBottom=`${m}px`),p&&(n.sectionStyle.paddingLeft=`${p}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}o!=null&&o.gap&&(n.sectionStyle.gap=`${o.gap}px`);const{styling:c}=t;c&&(c.verticalAlignment&&(n.sectionStyle.alignItems=c.verticalAlignment),c.radius&&(n.sectionStyle.borderRadius=c.radius),c.borderStyle&&(n.sectionStyle.borderStyle=c.borderStyle));const{Background:u}=t;return u&&u.style==="Solid"&&(n.sectionStyle.backgroundColor=u.color),u&&u.opacity==="100%"&&(n.sectionStyle.opacity=1),u&&u.image&&u.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${u.image})`,u.imageSize&&(n.sectionStyle.backgroundSize=u.imageSize)),u&&u.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=u.repeat),u&&(u.horizontalAlignment||u.verticalAlignment)&&(n.sectionStyle.backgroundPosition=u.horizontalAlignment+" "+u.verticalAlignment),n};function u8(t,l){if(!t)return[{}];const{columnSize:n,columns:r}=t;if(l)return Array(r).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(r).fill({});const o=n.split("/");return typeof r=="string"&&o.length!==parseInt(r)?Array(r).fill({}):typeof r=="number"&&o.length!==r?Array(r).fill({}):o.map(c=>({flexBasis:`${c}`}))}const f8=["data-sid","data-sname"],h8=["data-bid","data-bname"],p8=["page-block-id"],m8=["page-block-id"],y8=["page-block-id"],g8=["page-block-id"],x8=["page-block-id"],_8=["page-block-id"],as={__name:"TemplateRenderer",props:{isPreview:{type:Object,required:!0},onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:l}){const n=t,r=qo(),o=Lt(),c=Ko(),u=e.computed(()=>r.pageBlocks||[]),g=e.ref(0);l({refreshTemplate:()=>{g.value+=1}});const p=_=>!0,d=e.computed(()=>{var s,h,i,f;const _=[];return console.log("props.sections template renderer",u.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((s=u.value)!=null&&s.content)?(i=(h=u.value)==null?void 0:h.content)==null||i.forEach(a=>{const x=[],y=a.section,v=JSON.parse(y.XX_ORD1__Content_JSON__c);let b={};v&&(b=Wo(v,c.isMobile),y.styleObject=y.hideStyle?{}:b.sectionStyle,y.visibility=b.visibility),a.blocks.forEach(C=>{let E=C.XX_ORD1__Content_Block__r;const w=JSON.parse(E.XX_ORD1__Content_JSON__c);E={...E,...w};let S={};w&&(S=Wo(w,c.isMobile),E.styleObject=E.hideStyle?{}:S.blockStyle),x.push(E)}),y.blocks=x,_.push(y)}):(f=u.value)==null||f.forEach(a=>{var b;const x={...a},y=typeof a.contentJSON=="string"?JSON.parse(a.contentJSON):a.contentJSON;let v={};y&&(v=Wo(y,c.isMobile),x.styleObject=a.hideStyle?{}:v.sectionStyle,x.visibility=v.visibility,(b=x.blocks)==null||b.forEach((C,E)=>{C.styleObject=v.blockStyle[E]})),_.push(x)}),_});return(_,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Fa),(e.openBlock(),e.createElementBlock("div",{key:g.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.id},[p(h.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(h.styleObject),class:"ect-flex ect-flex-col md:ect-flex-row","data-sid":h.sectionId,"data-sname":h.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.blocks,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,style:e.normalizeStyle(i.styleObject),class:"ect-w-full","data-bid":i.blockId,"data-bname":i.blockName},[i.componentName==="productList"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":i.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(t6,{id:i.Id,header:i.fields.header,columns:i.fields.columns,footer:i.fields.footer,fields:i.fields,configuration:i.configuration},null,8,["id","header","columns","footer","fields","configuration"])],8,p8)):i.componentName==="quoteSummary"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":i.Id,class:""},[e.createVNode(p6,{id:i.Id,configuration:i.configuration,fields:i.fields,"quote-id":e.unref(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,m8)):i.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":i.Id,class:""},[e.createVNode(C6,{id:i.Id,fields:i.fields,configuration:i.configuration},null,8,["id","fields","configuration"])],8,y8)):i.componentName==="customForm"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":i.Id,class:"ect-w-full"},[e.createVNode(l8,{id:i.Id,configuration:i.configuration,fields:i.fields,"quote-id":e.unref(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,g8)):i.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":i.Id,class:""},[e.createVNode(d8,{id:i.Id,configuration:i.configuration,fields:i.fields,"quote-id":e.unref(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,x8)):i.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":i.Id,class:""},[e.createVNode(Zm,{id:i.Id,mode:"preview",configuration:i.configuration,fields:i.fields,"search-term":i.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview"])],8,_8)):e.createCommentVNode("",!0)],12,h8))),128))],12,f8)):e.createCommentVNode("",!0)],64))),128))]))],64))}},b8=t=>(e.pushScopeId("data-v-afae9e98"),t=t(),e.popScopeId(),t),v8={class:"ect-composable-catalog-wrapper"},C8={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]"},E8=[b8(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],Zo=me({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},organizationId:{type:String,required:!0},quoteId:{type:String,default:null},userId:{type:String,required:!0},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},accountId:{type:String,required:!1},cid:{type:String,required:!1},composablesApiUrl:{type:String,required:!1},composablesApiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1}},setup(t){const l=lt(),n=t,r=e.ref(!1),o=e.ref(!1),c=()=>{r.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{l.updateConfig({templateId:n.templateId,organizationId:n.organizationId,hostName:n.hostName,graphqlEndpoint:n.graphqlEndpoint,apiKey:n.apiKey,accountId:n.accountId,cid:n.cid,composablesApiUrl:n.composablesApiUrl,composablesApiKey:n.composablesApiKey,composablesOrgType:n.composablesOrgType,isPreview:n.isPreview,quoteId:n.quoteId,userId:n.userId}),l.quoteId=n.quoteId,console.log("props.sections expedite catalog",n.sections),await l.processSections(n.isPreview,n.sections)}),e.onMounted(async()=>{window.addEventListener("resize",c),c()}),(u,g)=>(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(zl,{"organization-id":n.organizationId,"template-id":n.templateId,"is-preview":n.isPreview,theme:n.theme},null,8,["organization-id","template-id","is-preview","theme"]),o.value?(e.openBlock(),e.createElementBlock("div",C8,E8)):(e.openBlock(),e.createBlock(as,{key:1,ref:"templateRendererRef","is-preview":n.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["is-preview","on-catalog-count-update","initial-catalog-items"]))]))}},[["__scopeId","data-v-afae9e98"]]),Jo={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},organizationId:{type:String,required:!0},accountId:{type:String,required:!0},cid:{type:String,required:!1},userId:{type:String,required:!1},quoteId:{type:String,required:!1},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesApiUrl:{type:String,required:!1},composablesApiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1}},setup(t){const l=lt(),n=Lt(),r=e.ref(null),o=t;return e.onBeforeMount(async()=>{l.updateConfig({templateId:o.templateId,organizationId:o.organizationId,hostName:o.hostName,graphqlEndpoint:o.graphqlEndpoint,apiKey:o.apiKey,accountId:o.accountId,cid:o.cid,userId:o.userId,composablesApiUrl:o.composablesApiUrl,composablesApiKey:o.composablesApiKey,composablesOrgType:o.composablesOrgType,isPreview:o.isPreview}),n.quoteId=o.quoteId,console.log("props.sections expedite cart",o.sections),await l.processSections(o.isPreview,o.sections)}),e.watch(()=>o.sections,async(c,u)=>{c!==u&&(await l.processSections(o.isPreview,c),r.value&&r.value.refreshTemplate&&r.value.refreshTemplate())},{deep:!0}),(c,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(zl,{"organization-id":o.organizationId,"template-id":o.templateId,"is-preview":o.isPreview,theme:o.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(as,{ref_key:"templateRendererRef",ref:r,"is-preview":o.isPreview},null,8,["is-preview"])],64))}},is={ExpediteConfigurator:Yr,ExpediteGPT:eo,ExpediteCatalog:Zo,ExpediteCart:Jo},k8={install(t,l={}){t.component("ExpediteConfigurator",Yr),t.component("ExpediteGPT",eo),t.component("ExpediteCatalog",Zo),t.component("ExpediteCart",Jo)},...is};Xe.Components=is,Xe.ExpediteCart=Jo,Xe.ExpediteCatalog=Zo,Xe.ExpediteConfigurator=Yr,Xe.ExpediteGPT=eo,Xe.default=k8,Xe.useComRootStore=xn,Object.defineProperties(Xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
145
|
+
`,Po={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function et({action:t,data:l,config:n={}}){var h,i;const r=lt(),o=n.apiKey??r.composablesApiKey.value,c=n.salesforceOrgId??r.organizationId.value,u=n.userId??r.userId.value,g=n.orgType??r.composablesOrgType.value,m=n.baseUrl??r.composablesApiUrl.value,p=Po[n.pathKey]??Po[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!p)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(Po).join(", ")}`);const d=`${m}${p}`;if(!c)throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let _;t?_={action:t,data:l}:_=l;const s={"x-api-key":o,"X-Salesforce-Org-Id":c,"X-Salesforce-Org-Type":g,"Content-Type":"application/json"};if(u&&(s["X-Salesforce-User-Id"]=u),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(_)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,s);const f=await Ne.post(d,_,{headers:s});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,f.data),!t&&((h=f.data)!=null&&h.data)&&typeof f.data.data=="string")try{f.data=JSON.parse(f.data.data)}catch(a){console.warn("[COMPOSABLES_API] Failed to parse data field:",a)}else if(!t&&((i=f.data)!=null&&i.data)&&typeof f.data.data=="object")try{f.data=f.data.data}catch(a){console.warn("[COMPOSABLES_API] Failed to parse content field:",a)}return f.data}catch(f){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,f),f}}const cn="https://d2pgvmpph8dmlo.cloudfront.net";function Dl(t,l,n){return t?t==null?void 0:t.map(r=>kp(r,l,n)):[]}function kp(t,l,n){const{url:r,staticResource:o}=t;if(!r)return null;if(r.includes("/resource/")&&!r.includes("://")&&o){const c=r.split("/"),u=c[c.length-1];return`${cn}/${n}/static/${u}.${l}`}else return r}const qo=Pe.defineStore("blockLegacy",()=>{const t=lt(),l=e.ref(null),n=e.ref(null),r=e.ref(!1),o=e.ref(null);async function c(d,_=!0){var i,f;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;_&&(l.value=[],r.value=!1);const s={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(s)),console.log("fetchBlockInformation getTemplateBlock",Vl);const h=await sr(Vl,s);if(console.log("fetchBlockInformation getTemplateBlockResponse",h),console.log("fetchBlockInformation pageBlocks",l.value),n.value=d.templateId,_)(i=h.content)!=null&&i.blocks?(l.value=u(JSON.parse(h.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",l.value)):l.value=[],r.value=!0;else return((f=h==null?void 0:h.content)==null?void 0:f.blocks)||[]}function u(d){const _=t.organizationId.value;return d==null||d.forEach(s=>{s.blocks=s.blocks?JSON.parse(s.blocks):[],s.blocks.forEach(h=>{var i,f;Object.assign(h,JSON.parse(h.contentJSON)),h.contentJSON=null,h.id=h.blockId||h.Id,(h.componentName==="catalogBlock"||h.componentName==="relatedProducts")&&(g(h.fields.productCard.actions),h.fields.noFriendlyURL=!0,h.fields.productCard.friendlyURL=null,h.fields.productCard.friendlyURLFields=null,(i=h.configuration)!=null&&i.productTemplateId?h.fields.productCard.url="/product/"+((f=h.configuration)==null?void 0:f.productTemplateId):h.fields.productCard.url=null),h.componentName==="productSummary"&&(console.log("block.fields.actions",h.fields.actions),g(h.fields.actions)),h.customJS&&(h.customJS=Dl(h.customJS,"js",_)),h.customCSS&&(h.customCSS=Dl(h.customCSS,"css",_))})}),d}function g(d){d.forEach(_=>{_.action==="CUSTOM_ACTION"&&(_.action="CUSTOM",_.name=_.label.title,_.value=_.url.field||_.url.title,_.newTab=_.openInNewTab)})}async function m(d,_=!0){var s;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){_&&(l.value=[],r.value=!1);try{const h=await et({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const i=(s=h==null?void 0:h.data)==null?void 0:s.blocks;if(console.log("fetchBlockInformationREST blocksData",i),_){if(i){const f=typeof i=="string"?JSON.parse(i):i;console.log("fetchBlockInformationREST parsedBlocks",f),l.value=u(f),console.log("fetchBlockInformationREST pageBlocks",l.value)}else console.log("fetchBlockInformationREST blocksData is null"),l.value=[];r.value=!0}else return i||[]}catch(h){throw console.error("fetchBlockInformationREST error:",h),_&&(l.value=[],r.value=!0),h}}}return{metaInfo:o,currentPageId:n,pageBlocks:l,blockLoaded:r,fetchBlockInformation:c,fetchBlockInformationREST:m,getFormattedSectionBlocks:d=>e.computed(()=>{const _=[];return l.value&&l.value.length>0&&l.value.forEach(s=>{const h=s.blocks;h&&h.length>0&&h.forEach(i=>{if(i.id=i.blockId,d){const f=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",s.sectionName,i.componentName),i&&i.configuration&&(f.includes(i.componentName)||i.configuration.isCheckoutBlock)&&_.push(i)}else i&&i.configuration&&!d&&_.push(i)})}),_})}}),Dt=async(t,l=null,n="",r=!1)=>{const o=lt();console.log("appsyncHandler composableStore",o);const c=o.graphqlEndpoint.value,u=o.apiKey.value;let g=200,m;const p=o.hostName.value;console.log("appsyncHandler currentHostname",p);const d=jo();try{const _=l;let s="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!s&&(s=d.activeStorefrontInfo.accountId),_.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(_.data.userType=d.activeStorefrontInfo.userType,_.data.accountId=s,_.data.domain=p);const h=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":u},body:JSON.stringify({query:t,variables:_})});if(m=await(h==null?void 0:h.json()),m=m.data,n)m=JSON.parse(m[n]),g=Number(m.statusCode),m=m.content,g===401&&console.info("401",t,JSON.stringify(l));else if(t.includes("SalesforceActions")){let i=m;i=JSON.parse(m.salesforceActions),i.statusCode==="401"&&console.info("401",t,JSON.stringify(l),m)}}catch(_){console.log(_),g=400,m=_}return{statusCode:g,response:m}},$o=["Needs Configuration","Suggests Configuration","Upload Configuration"],Bp=["Upload","Upload Add","Upload Configuration"],wp=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],Np=["CONFIGURE","UPLOAD","ADD_TO_CART"],Ap=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),Sp=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),dn=(t,l,n=!1)=>{const r=rt();let o,c,u;return n?(c=t.statusCode,u=t.content):(o=JSON.parse(t.response.salesforceActions),c=o.statusCode,u=o.content),Number(c)===200&&u&&u.message&&typeof u.message=="string"&&u.message.startsWith("ERROR:")?(r.handleError(u.message,"useExtractContent"),!1):Number(c)!==200||t.statusCode!==200||typeof u=="string"&&u.includes("ERROR:")||typeof u=="string"&&u.includes("Error:")||u.errorCode==="APEX_ERROR"?(u.errorCode==="APEX_ERROR"?r.handleError(u.message,"useExtractContent"):l||r.handleError(u,"useExtractContent"),!1):u},Mt=Pe.defineStore("catalog",()=>{const t=lt(),l=e.ref(!1),n=e.ref(0),r=e.ref(null),o=e.ref(null),c=e.ref([]),u=e.ref({}),g=e.ref({}),m=e.ref(null),p=e.ref(null),d=e.ref(!1),_=e.ref({search:""}),s=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),h=e.computed(()=>t.accountId.value),i=e.computed(()=>({domain:t.hostName.value,accountId:h.value,userType:t.userId.value}));function f(L="true"){Us(`qreset-${r.value}`,L)}async function a(L){try{const $={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray(L)?L:[L]},U=await et({data:$,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),T(!0),console.log("[CATALOG:deleteLineItems] success",U),f(),U}catch($){console.log("[CATALOG:deleteLineItems] error",$),f();return}}async function x(L){var B,O;if(!L.qty)return;const $=t.quoteId.value;if(!$)return;L.retry=1;const U={...L,quoteid:$},Q={action:"makeCall",data:{...i.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(U)}},Z=await Dt(kt,Q,void 0,!0),X=(O=(B=Z.response)==null?void 0:B.salesforceActions)==null?void 0:O.toLowerCase();(X.includes("record currently unavailable")||X.includes("unable_to_lock_row"))&&L.retry<3&&setTimeout(()=>{L.retry+=1,x(L)},500),dn(Z)&&T(!0),f()}async function y(L){var Q,Z,X,F;const $=t==null?void 0:t.quoteId.value;Array.isArray(L)&&(L=L[0]);const U={itemId:L.itemID,eCatalogItemId:L.eCatalogItemID,quantity:L.qty,accountId:h.value,qtyTierAmt:(L==null?void 0:L.qtyTierAmt)??null};$&&(U.quoteId=$);try{const B=await et({data:U,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),O=(B==null?void 0:B.quoteId)||((Q=B==null?void 0:B.data)==null?void 0:Q.quoteId)||((X=(Z=B==null?void 0:B.data)==null?void 0:Z.quote)==null?void 0:X.Id);O&&O!==$&&(r.value=O,t.updateConfig({quoteId:O}));const I=((F=B==null?void 0:B.data)==null?void 0:F.QliId)||(B==null?void 0:B.QliId)||null,R=L==null?void 0:L.itemID,P=L==null?void 0:L.qty;if(I&&R){const M=g.value?g.value[R]:null;g.value={...g.value||{},[R]:{...M||{},Id:I,XX_ORD1__Item__c:R,XX_ORD1__QTY__c:typeof P=="number"?P:(M==null?void 0:M.XX_ORD1__QTY__c)||0}}}return T(!0),f(),B}catch(B){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",B),f();return}}async function v({itemId:L,qty:$,qliId:U,eCatalogItemId:Q}={}){var F,B,O,I,R;if(console.log("updateQuoteLineQtyTxn",{itemId:L,qty:$,qliId:U,eCatalogItemId:Q}),!$&&$!==0)return;let Z=U||((B=(F=g.value)==null?void 0:F[L])==null?void 0:B.Id);if(Z||(await A(!0),Z=U||((I=(O=g.value)==null?void 0:O[L])==null?void 0:I.Id)),!Z){if($>0&&L&&Q)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:L,eCatalogItemId:Q}),await y({itemID:L,eCatalogItemID:Q,qty:$,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:L});return}const X={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:Z},{fieldName:"XX_ORD1__QTY__c",fieldValue:$}]}]};try{const P=await et({data:X,config:{pathKey:"catalog.updateLines"}});if(L){const M=((R=g.value)==null?void 0:R[L])||{};g.value={...g.value||{},[L]:{...M,Id:Z,XX_ORD1__Item__c:L,XX_ORD1__QTY__c:$}}}return T(!0),f(),P}catch(P){console.log("[CATALOG:updateQuoteLineQtyTxn] error",P),f();return}}async function b(L,$,U){var O;const Q=U==="Item",Z=[],X=((L==null?void 0:L.searchText)||"").toString().trim(),F=Array.isArray(L==null?void 0:L.fields)?L.fields:[];Array.isArray(L==null?void 0:L.filters)&&L.filters,L==null||L.filterLogic;const B={searchPL:X,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:$t(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:(L==null?void 0:L.numberOfRecords)||(L==null?void 0:L.rowLimit)||10,fields:F,filters:(L==null?void 0:L.whereCondition)||[]};try{const I=await et({data:B,config:{pathKey:"catalog.getProductItems"}}),R=I.selected_products,P=Object.values(R).map(q=>{var j;return(j=q==null?void 0:q.catalogResponse)==null?void 0:j.productInfo}).filter(Boolean);P.forEach(q=>{var J,Y,ae,W;const j=JSON.parse(JSON.stringify($)),z=Ie(q,Q?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),K=Ie(q,Q?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");Q?j.itemId=q.Id:(j.itemId=q.XX_ORD1__Item__c,j.catalogItemId=q.Id),j.thumbnail.value=j.thumbnail.field&&!j.thumbnail.isStatic?Ie(q,j.thumbnail.field):"",j.title.value=j.title.field&&!j.title.isStatic?Ie(q,j.title.field):"",j.description.value=j.description.field&&!j.description.isStatic?Ie(q,j.description.field):"",(J=j.attributes)==null||J.forEach(ee=>{ee.value.field&&(ee.value.value=Ie(q,ee.value.field,ee.value.dataType)||"-"),ee.label.field&&(ee.label.value=Ie(q,ee.label.field,ee.label.dataType)||"-")}),j.actions=j.actions.filter(({action:ee})=>ee==="ADD_TO_CART"&&wp.includes(K)||ee==="CONFIGURE"&&$o.includes(K)||ee==="UPLOAD"&&Bp.includes(K)||!Np.includes(ee)),(Y=j.actions)==null||Y.forEach(ee=>{if(ee.action==="CUSTOM"){const{url:le,label:de}=ee;le.isStatic||(le.value=Ie(q,le.field)),de.isStatic||(de.value=Ie(q,de.field))}}),((ae=j.friendlyURLFields)==null?void 0:ae.length)>0&&z?((W=j.friendlyURLFields)==null||W.forEach(ee=>{j.friendlyURL=j.friendlyURL.replace(`{!${ee}}`,Ie(q,ee))}),j.friendlyURL="/"+j.friendlyURL+"/"+z):j.url&&(j.friendlyURL=j.url+"/"+q.Id),j.friendlyURL&&(j.friendlyURL=j.friendlyURL.replace(/\/{2,}/g,"/")),Z.push(j)});const M=Number(((O=I==null?void 0:I.data)==null?void 0:O.totalCount)||P.length)||0;return{items:Z,count:M>2e3?2e3:M}}catch(I){console.log("[CATALOG:getProductItems] new API error",I);return}}async function C(L){var Z;console.log("[CATALOG:getEcatalogDetails] jsonData",L),L.accountID=t.accountId.value;const $={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify(L)}},U=await Dt(kt,$),Q=dn(U);if(Q!==!1)return(Z=JSON.parse(Q))==null?void 0:Z.recordData}async function E(L,$=()=>{}){L.accountID=t.accountId.value||"";const U={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify(L)}},Q=await Dt(kt,U,void 0,!0),Z=JSON.parse(JSON.parse(Q.response.salesforceActions).content);return $(Z),Z}async function w(L,$=()=>{}){const U={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify(L)}},Q=await Dt(kt,U,void 0,!0);return $(JSON.parse(JSON.parse(Q.response.salesforceActions).content)),JSON.parse(JSON.parse(Q.response.salesforceActions).content)}async function S(){var Z,X,F,B,O,I;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:r.value,payload:i.value});const L=t.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",L),L)console.log("[CATALOG:getObjectDetails] Quote found!"+L),console.log("[CATALOG:getObjectDetails] Quote found",L);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const $={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${L}`}};console.log("[CATALOG:getObjectDetails] request",$.data.endpoint),s.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const U=await Dt(kt,$,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(U!=null&&U.response),len:String(((Z=U==null?void 0:U.response)==null?void 0:Z.salesforceActions)||"").length});const Q=dn(U,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!Q}),s.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),Q?(u.value=JSON.parse(Q),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(X=u.value)==null?void 0:X.Id,accountName:(F=u.value)==null?void 0:F.XX_ORD1__Account_Name__c,checkedOut:(B=u.value)==null?void 0:B.XX_ORD1__Checked_Out__c}),t.quoteAccount=(O=u.value)==null?void 0:O.XX_ORD1__Account_Name__c,u.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),l.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(I=u.value)==null?void 0:I.Id}),u.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:L}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const T=nt(A,500);async function A(L=!1){var X,F;console.log("[CATALOG:getQuoteItems] start",{noLoad:L}),s.value.qliRecords=!L;const $=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",$),!$){console.log("[CATALOG:getQuoteItems] No quote found!"),s.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const U={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getQuoteItems&ut=${t.userId.value}"eid=${$}`}};console.log("[CATALOG:getQuoteItems] request",U.data.endpoint);const Q=await Dt(kt,U,void 0,!0);console.log("[CATALOG:getQuoteItems] response received",{hasResponse:!!(Q!=null&&Q.response),len:String(((X=Q==null?void 0:Q.response)==null?void 0:X.salesforceActions)||"").length});const Z=dn(Q);if(console.log("[CATALOG:getQuoteItems] extracted content",{hasContent:!!Z}),s.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] loading.qliRecords -> false"),Z){const B={};c.value=JSON.parse(Z),console.log("[CATALOG:getQuoteItems] qliRecords set",{count:(F=c.value)==null?void 0:F.length}),c.value.forEach(O=>{B[O.XX_ORD1__Item__c]=O}),g.value=B,n.value=c.value.length,console.log("[CATALOG:getQuoteItems] qliRecords",c.value),console.log("[CATALOG:getQuoteItems] end (success)",{cartCount:n.value})}else console.warn("[CATALOG:getQuoteItems] end (no content)")}async function k(L){console.log("[CATALOG:getSavedFilter] ecfr",L);const $={action:"makeCall",data:{...i.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${L}`}},U=await Dt(kt,$,void 0,!0),Q=dn(U);return Q?(console.log("[CATALOG:getSavedFilter] Saved Filters",Q),JSON.parse(Q)):!1}async function N(){var Q;console.log("[CATALOG:calculateAvaTax]"),p.value=null;const L=t.quoteId.value;if(!L)return;(Q=u.value)!=null&&Q.Id||await S();const $=u.value;if($.XX_ORD1__Shipping_Address__c&&$.XX_ORD1__Shipping_City__c&&$.XX_ORD1__Shipping_Country__c&&$.XX_ORD1__Shipping_State__c&&$.XX_ORD1__Shipping_Zip__c){const Z={recordId:L,isCommit:!1},X={action:"makeCall",data:{...i.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(Z)}};d.value=!0;const F=await Dt(kt,X,void 0,!0),B=dn(F);if(B)console.log("[CATALOG:calculateAvaTax] content",B);else{const O=JSON.parse(F.response.salesforceActions).content;p.value=O}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function D(L,$,U=!0){const Q=$.qtyTiers;if(!Q)return null;const Z=Q.find(X=>X.ev===null?L>=X.sv:L>=X.sv&&L<=X.ev);return Z?U?Z.formattedOfferPrice:Z.originalPrice:null}return{quoteCheckedOut:l,avaTaxError:p,avaTaxLoading:d,cartCount:n,cartUpdated:f,quoteId:r,loading:s,filter:_,quoteRecord:u,secondQuoteId:o,qliRecords:c,savedItems:g,savedFilter:m,getObjectDetails:S,getSavedFilter:k,saveItemToQuoteBlinkTxn:y,updateQuoteLineQtyTxn:v,deleteLineItems:a,getPicklistFilterData:w,getQuoteItems:A,updateCart:x,getFilterData:E,getProductItems:b,calculateAvaTax:N,getEcatalogDetails:C,getVolumePrice:D}}),jo=Pe.defineStore("composableCatalog",()=>{const t=qo();Mt();const l=rt(),n=lt(),r=e.ref(!0),o=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),c=e.ref({}),u=e.ref(""),g=e.ref(""),m=e.ref(""),p=e.ref(""),d=e.ref(""),_=e.ref(""),s=e.ref(null),h=e.ref(!1),i=e.computed(()=>p.value+"::"+d.value);async function f(){s.value=null,h.value=!0;try{const S={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},T=Date.now().toString(),A=await Ne.post(`${n.graphqlEndpoint.value}?t=${T}`,{query:Ep,variables:S},{headers:{"Content-Type":"application/json","x-api-key":n.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":T},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",A);const k=A&&A.data?A.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",k);const N=k&&k.data&&k.data.dataByDomain&&Array.isArray(k.data.dataByDomain.items)?k.data.dataByDomain.items:[],D=N.length?N[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",D),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",c.value),c.value=D,o.value={accountId:D.guestAccountId,contactId:"",userType:"AWSGuest",domain:D.domain,locale:"en-US"},p.value=D.organization.salesforceOrgId,d.value=D.storefrontId,D}catch(S){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",S),s.value=S&&S.message?S.message:"Unknown error",S}finally{h.value=!1}}function a(S){g.value=(S==null?void 0:S.templateId)??"",m.value=(S==null?void 0:S.quoteId)??"",_.value=(S==null?void 0:S.userId)??""}function x(S){m.value=S}function y(S){c.value=S}async function v(){try{await t.fetchBlockInformation({templateId:g.value,storefrontId:d.value},!0)}catch(S){l.handleError(S,"getBlockInformation")}}const b=async()=>{var S,T;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const A=await sr(Tl,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",A),((T=(S=A.content)==null?void 0:S.items)==null?void 0:T[0])??null}catch(A){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",A)}},C=()=>{if(typeof document>"u")return;const S=p.value,T=d.value;if(!S||!T)return;const A=`${cn}/${S}/${T}/css/theme_${T}.css`;let k=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(A),k=!0}catch(U){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",U)}let N="";try{N=new URL(n.graphqlEndpoint.value).origin}catch{}const D=typeof window<"u"?window.location.href:"",L=(U,Q={})=>{const Z=document.head||document.getElementsByTagName("head")[0];if(!Z)return;let X=document.getElementById(U);X||(X=document.createElement("link"),X.id=U,Z.appendChild(X)),Object.entries(Q).forEach(([F,B])=>{B!=null&&X.setAttribute(F,String(B))})};((U,Q,Z=!0)=>{const X=document.head||document.getElementsByTagName("head")[0];if(!X||document.getElementById(U))return;const F=document.createElement("script");F.id=U,F.src=Q,Z&&(F.async=!0),X.appendChild(F)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),L("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),N&&L("ec-preconnect-appsync",{rel:"preconnect",href:N}),k||L("ec-theme-stylesheet",{rel:"stylesheet",href:A}),L("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),D&&L("ec-canonical",{rel:"canonical",href:D}),L("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${cn}/expedite/Expedite_Favicon.ico`})};function E(){return!0}function w(){g.value="",m.value="",p.value="",d.value="",_.value=""}return{templateId:g,isLoading:r,activeStorefrontInfo:o,quoteAccount:u,storefrontDetails:c,salesforceOrgId:p,storefrontId:d,userId:_,orgWithStorefrontId:i,useVisiblity:E,fetchDomainDetails:f,setData:a,setQuoteId:x,setStorefrontDetails:y,getBlockInformation:v,getTheme:b,setThemeData:C,reset:w}}),Ip=t=>{const l=t.match(/query\s+(\w+)/);return l?l[1]:null},Op=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(l,n)=>n.toLowerCase()).replace(/\s(\w)/g,(l,n)=>n.toUpperCase()).replace(/\s/g,""),Ml=t=>{try{JSON.parse(t)}catch{return!1}return!0},Ho=new Map,sr=async(t,l=null)=>{var g,m,p;const n=jo(),r=lt();let o=200,c,u;try{const d=l,_=r.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((g=n.activeStorefrontInfo)==null?void 0:g.userType)||"",d.data.accountId=_||((m=n.activeStorefrontInfo)==null?void 0:m.accountId)||"",d.data.domain=r.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:r.hostName.value});const s=Cp([t,d,_]);if(Ho.has(s))c=Ho.get(s);else try{const f=await Ne.post(r.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":r.apiKey.value}});if(!f.data)return{statusCode:500,content:"Error fetching data from AppSync."};c=f.data.data,Ho.set(s,c)}catch(f){const a=((p=f==null?void 0:f.response)==null?void 0:p.status)||500;return a===401&&console.info("401",t,l),{statusCode:a,content:"Error fetching data from AppSync."}}const h=Ip(t);if(!h)return{statusCode:404,content:"Query name not found, improper request."};const i=Op(h);c=c[i],Ml(c)&&(c=JSON.parse(c)),c&&c.statusCode&&c.statusCode===401&&console.info("401",t,l),u=c!=null&&c.content?c.content:c,Ml(u)&&(u=JSON.parse(u))}catch(d){o=400,u=d}return{statusCode:o,content:u}},cr=e.ref(""),Ll=e.ref(""),Uo=e.ref(""),Rl=e.ref(""),Fl=e.ref(""),dr=e.ref(""),Nn=e.ref(""),Pl=e.ref(""),ql=e.ref(""),$l=e.ref(""),jl=e.ref(""),Hl=e.ref(""),Vp=e.ref(!1),Tp=e.ref(null),Dp=e.ref(null),Ul=e.ref("");function lt(){function t(u){u.templateId!==void 0&&(cr.value=u.templateId),u.hostName!==void 0&&(Ll.value=u.hostName),u.graphqlEndpoint!==void 0&&(Uo.value=u.graphqlEndpoint),u.apiKey!==void 0&&(Rl.value=u.apiKey),u.accountId!==void 0&&(Fl.value=u.accountId),u.organizationId!==void 0&&(dr.value=u.organizationId),u.storefrontId!==void 0&&(Nn.value=u.storefrontId),u.cid!==void 0&&(Pl.value=u.cid),u.userId!==void 0&&(ql.value=u.userId),u.composablesApiUrl!==void 0&&($l.value=u.composablesApiUrl),u.composablesApiKey!==void 0&&(jl.value=u.composablesApiKey),u.composablesOrgType!==void 0&&(Hl.value=u.composablesOrgType),u.isPreview!==void 0&&(Vp.value=u.isPreview),u.sections!==void 0&&(Tp.value=u.sections),u.theme!==void 0&&(Dp.value=u.theme),u.quoteId!==void 0&&(Ul.value=u.quoteId)}const l=async()=>{var u,g;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!Nn.value)try{const m=await sr(Tl,{storefrontId:Nn.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",m),((g=(u=m.content)==null?void 0:u.items)==null?void 0:g[0])??null}catch(m){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",m)}},n=async()=>{var u;try{const g=await et({action:"retrieveMeta",data:{salesforceOrgId:dr.value,storefrontId:cr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=(u=g==null?void 0:g.data)==null?void 0:u.value;return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(g){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",g),g}};return{hostName:Ll,graphqlEndpoint:Uo,apiKey:Rl,accountId:Fl,organizationId:dr,storefrontId:Nn,cid:Pl,userId:ql,composablesApiUrl:$l,composablesApiKey:jl,composablesOrgType:Hl,quoteId:Ul,updateConfig:t,getTheme:l,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const u=dr.value,g=Nn.value;if(!u||!g)return;const m=`${cn}/${u}/${g}/css/theme_${g}.css`;let p="";try{p=new URL(Uo.value).origin}catch{}const d=typeof window<"u"?window.location.href:"",_=(h,i={})=>{const f=document.head||document.getElementsByTagName("head")[0];if(!f)return;let a=document.getElementById(h);a||(a=document.createElement("link"),a.id=h,f.appendChild(a)),Object.entries(i).forEach(([x,y])=>{y!=null&&a.setAttribute(x,String(y))})};((h,i,f=!0)=>{const a=document.head||document.getElementsByTagName("head")[0];if(!a||document.getElementById(h))return;const x=document.createElement("script");x.id=h,x.src=i,f&&(x.async=!0),a.appendChild(x)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),_("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),p&&_("ec-preconnect-appsync",{rel:"preconnect",href:p}),_("ec-theme-stylesheet",{rel:"stylesheet",href:m}),_("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),d&&_("ec-canonical",{rel:"canonical",href:d}),_("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${cn}/expedite/Expedite_Favicon.ico`})},processSections:async(u,g)=>{const m=qo();if(u&&g)try{const p=typeof g=="string"?JSON.parse(g):g;m.pageBlocks=p}catch(p){console.error("[ExpediteCart] Error parsing sections:",p)}else u||await m.fetchBlockInformationREST({templateId:cr.value||cr.value})},processTheme:async(u,g)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",u),console.log("[COMPOSABLECATALOG:processTheme] theme",g),u&&g)try{return typeof g=="string"?JSON.parse(g):g}catch(m){return console.error("[ExpediteCart] Error parsing theme:",m),null}else if(!u)try{return await n()}catch(m){return console.error("[ExpediteCart] Error fetching theme:",m),null}return null}}}const Mp=["href"],Lp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),Rp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),Fp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),Pp=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),zl={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const l=t,n=lt(),r=e.ref(""),o=e.ref(""),c=async()=>{if(!(!l.organizationId||!l.templateId))try{const u=await n.processTheme(l.isPreview,l.theme);u&&(r.value=u),n.setThemeData();const g=Date.now(),m=`${cn}/${l.organizationId}/${l.templateId}/css/theme_${l.templateId}.css?t=${g}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",m),o.value=m}catch(u){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",u)}};return e.onBeforeMount(()=>{c()}),e.watch(()=>[l.organizationId,l.templateId,l.isPreview,l.theme],()=>{c()},{deep:!0}),(u,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:o.value,"data-name":"ec-theme-stylesheet-link"},null,8,Mp)):e.createCommentVNode("",!0),Lp,Rp,Fp,Pp],64))}},qp={KNOWLEDGE_DETAIL:"knowledgeDetail"},Xl={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},$p={name:"SkeletonLoader"},jp={class:"skeleton-loader"};function Hp(t,l,n,r,o,c){return e.openBlock(),e.createElementBlock("div",jp)}const st=me($p,[["render",Hp],["__scopeId","data-v-826b27ef"]]),ve=me({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(t){const l=t,n={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},r=e.ref(!1),o=e.computed(()=>{if(l.text===null||l.text===void 0)return"";const m=String(l.text);return(m==null?void 0:m.replace(/\r\n|\n/g,"<br>"))||""}),c=e.computed(()=>{var p,d;const m=l.tag||((p=l.style)==null?void 0:p.tag)||((d=l.secStyle)==null?void 0:d.tag)||"p";return m==="large"||m==="strong"?"div":m}),u=e.computed(()=>{var p;const m=l.tag||((p=l.style)==null?void 0:p.tag)||"p";return n[m]||"ecb-text-regular"}),g=e.computed(()=>{var p,d;const m={};if(l.style&&((p=l.style)!=null&&p.overrite)){const{bold:_,color:s,italic:h,underline:i,strikethrough:f,strikeThrough:a,size:x,family:y,lineHeight:v}=l.style;_&&(m.fontWeight="700"),s&&(m.color=s),h&&(m.fontStyle="italic"),y&&(m.fontFamily=y),v&&(m.lineHeight=v),i?m.textDecoration="underline":(f||a)&&(m.textDecoration="line-through"),x&&(m.fontSize=x)}if(l.secStyle&&((d=l.secStyle)!=null&&d.overrite)){const{bold:_,color:s,italic:h,underline:i,strikethrough:f,strikeThrough:a,size:x,family:y,lineHeight:v}=l.secStyle;_&&(m.fontWeight="700"),s&&(m.color=s),h&&(m.fontStyle="italic"),y&&(m.fontFamily=y),v&&(m.lineHeight=v),i?m.textDecoration="underline":(f||a)&&(m.textDecoration="line-through"),x&&(m.fontSize=x)}for(const _ of l.inherit)m[_]="inherit";return m});return(m,p)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(st)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),e.mergeProps({key:1},m.$attrs,{type:t.method,disabled:t.disabled,style:g.value,class:u.value,onMouseover:p[0]||(p[0]=d=>r.value=!0),onMouseout:p[1]||(p[1]=d=>r.value=!1),innerHTML:o.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),Up={key:1,class:"field-label"},zp={class:"ect-flex ect-flex-col ect-justify-start"},Xp={key:0,class:"ect-pr-5"},Kp={key:1,class:"field-value ect-pr-5"},Qp={key:1,class:"field-value"},Kl=me({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(t){const l=Mt(),n=t,r=e.computed(()=>!1),o=e.computed(()=>{var s;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((s=n.offer.offerValue.qtyTiers)==null?void 0:s.length)>0?!!n.appliedOnOfferMatchingField:!1}),c=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),u=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),g=e.computed(()=>{var _,s;return(_=n.offer.offerValue)!=null&&_.qtyTiers?l.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(s=n.offer.offerValue)==null?void 0:s.formattedOfferPrice}),m=e.computed(()=>({"ect-flex ect-line-through":r.value&&n.offer.offerValue&&o.value})),p=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(r.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(_,s)=>{var h,i;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(h=t.label.style)==null?void 0:h.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",Up,[e.createVNode(st)])),e.createElementVNode("div",zp,[r.value&&n.offer.offerValue&&o.value?(e.openBlock(),e.createElementBlock("div",Xp,[e.createVNode(ve,{tag:c.value,text:g.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):r.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",Kp,[e.createVNode(st)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(m.value)},[p.value?(e.openBlock(),e.createBlock(ve,{key:0,tag:(i=t.value.style)==null?void 0:i.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",Qp,[e.createVNode(st)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(ve,{tag:u.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(u.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),Gp={key:1,class:"filter"},Wp={class:"filter-title"},Zp={key:0,class:"filter-desc"},Jp={key:1,class:"filter-desc"},Yp={key:2,class:"filter-desc"},Ql=me({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const l=jt(),n=t;function r(){n.url&&!n.loading&&l.push(n.url)}return(o,c)=>t.loading?(e.openBlock(),e.createElementBlock("div",Gp,[e.createElementVNode("div",Wp,[e.createVNode(st)]),t.description?(e.openBlock(),e.createElementBlock("div",Zp,[e.createVNode(st)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",Jp,[e.createVNode(st)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",Yp,[e.createVNode(st)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(ve,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:r},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(ve,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),e9={name:"Spinner"},t9={class:"spinner"};function n9(t,l,n,r,o,c){return e.openBlock(),e.createElementBlock("div",t9)}const An=me(e9,[["render",n9],["__scopeId","data-v-83f8c910"]]),r9={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:st,AtomSpinner:An},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:qp}}},zo=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),o9={key:0,class:"page"},a9=zo(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),i9={class:"page-body"},l9={class:"page-body_board"},s9={key:1,class:"field"},c9={key:2,class:"filter"},d9={class:"filter-option_inner"},u9={key:3,class:"full"},f9={key:4,class:"shuttle"},h9={class:"shuttle-full"},p9={class:"shuttle-full"},m9={class:"shuttle-half"},y9={class:"shuttle-half"},g9={class:"shuttle-button"},x9={key:5,class:"shuttle2"},_9={class:"shuttle2-full"},b9=zo(()=>e.createElementVNode("span",null,"Processing payment",-1)),v9={key:6,class:"shuttle2"},C9={class:"shuttle2-full"},E9=zo(()=>e.createElementVNode("span",null,"Processing order",-1)),k9={key:10,class:"skeleton-shipping"},B9={class:"skeleton-shipping-full"},w9={class:"skeleton-shipping-half"},N9={key:11,class:"skeleton-terms"},A9={class:"skeleton-terms-half"},S9={class:"skeleton-terms-full"},I9={class:"skeleton-terms-full"},O9={key:12,class:""},V9={class:"skeleton-terms-half"},T9={key:13,class:""},D9={class:"skeleton-terms-half"},M9={key:14,class:"product"},L9={class:"product-image"},R9={class:"product-texts"},F9={class:"product-description"},P9={class:"product-action"},q9={class:"product-button"},$9={key:15,class:""};function j9(t,l,n,r,o,c){const u=e.resolveComponent("AtomSkeletonLoader"),g=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",o9,[a9,e.createElementVNode("div",i9,[e.createElementVNode("div",l9,[e.createVNode(u)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",s9,[e.createVNode(u)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",c9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"filter-option"},[e.createElementVNode("div",d9,[e.createVNode(u)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",u9,[e.createVNode(u)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(u)]),e.createElementVNode("div",p9,[e.createVNode(u)]),e.createElementVNode("div",m9,[e.createVNode(u)]),e.createElementVNode("div",y9,[e.createVNode(u)]),e.createElementVNode("div",g9,[e.createVNode(u)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(g,{class:"shuttle2-spinner"}),e.createTextVNode(),b9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",v9,[e.createElementVNode("div",C9,[e.createVNode(g,{class:"shuttle2-spinner"}),e.createTextVNode(),E9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(u)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",B9,[e.createVNode(u)]),e.createElementVNode("div",w9,[e.createVNode(u)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",N9,[e.createElementVNode("div",A9,[e.createVNode(u)]),e.createElementVNode("div",S9,[e.createVNode(u)]),e.createElementVNode("div",I9,[e.createVNode(u)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("div",V9,[e.createVNode(u)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",T9,[e.createElementVNode("div",D9,[e.createVNode(u)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",M9,[e.createElementVNode("div",L9,[e.createVNode(u)]),e.createElementVNode("div",R9,[e.createVNode(u)]),e.createElementVNode("div",F9,[e.createVNode(u)]),e.createElementVNode("div",P9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"product-action_item"},[e.createVNode(u)]))),128))]),e.createElementVNode("div",q9,[e.createVNode(u)])])):n.type===o.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",$9,[e.createVNode(u,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const Bt=me(r9,[["render",j9],["__scopeId","data-v-956cc081"]]),H9=["src"],Xo={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(t){const l=t,n=e.computed(()=>l.src.includes("/resource/")&&!l.src.includes("://")&&l.resourcesDomain?l.resourcesDomain+l.src:l.src.includes("/servlet/servlet.ImageServer")&&!l.src.includes("://")&&l.resourcesDomain?l.resourcesDomain+"/"+l.src:l.src);return(r,o)=>t.loading?(e.openBlock(),e.createBlock(Bt,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:n.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,H9)):e.createCommentVNode("",!0)}},U9=t=>(e.pushScopeId("data-v-37f42d3b"),t=t(),e.popScopeId(),t),z9={class:"counter"},X9=["disabled"],K9={class:"material-icons-outlined counter-icon"},Q9={key:0,class:"counter-spinner"},G9=["max","disabled","value"],W9=["disabled"],Z9=[U9(()=>e.createElementVNode("span",{class:"material-icons-outlined counter-icon"}," add ",-1))],ur=me({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,r=l,o=e.computed(()=>n.disabled||n.loading),c=nt(function(p){p.target.value?r("update:modelValue",Number(p.target.value)):r("update:modelValue",0)}),u=p=>{(p.key==="."||p.key==="e"||p.key==="E")&&!p.ctrlKey&&!p.metaKey&&n.decimal&&p.preventDefault()};function g(){n.modelValue<n.max&&r("update:modelValue",n.modelValue+1)}function m(){n.modelValue>n.min&&r("update:modelValue",n.modelValue-1)}return(p,d)=>(e.openBlock(),e.createElementBlock("div",z9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||o.value,onClick:m},[e.createElementVNode("span",K9,e.toDisplayString(t.modelValue>1?"remove":"close"),1)],8,X9),t.loading?(e.openBlock(),e.createElementBlock("div",Q9,[e.createVNode(An,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:o.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=(..._)=>e.unref(c)&&e.unref(c)(..._)),onKeydown:u},null,40,G9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||o.value,onClick:g},Z9,8,W9)]))}},[["__scopeId","data-v-37f42d3b"]]),Gl=e.ref(!1),Wl=e.ref(!1),Zl=e.ref(!1),Jl=e.ref(!1),Ko=()=>{if(typeof window<"u"){const t=()=>{const l=window.innerWidth;Wl.value=l<768,Zl.value=l>=768&&l<1024,Jl.value=l>=1024};e.onMounted(()=>{Gl.value||(Gl.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Wl,isTablet:Zl,isDesktop:Jl}},J9=["disabled"],Y9=["disabled"],em={class:"ect-w-max"},tm={class:"button-header-icon"},nm=["onClick"],rm={key:0,class:"button-options_item-icon"},om=["disabled"],am={class:"ect-w-max"},im={class:"button-header-icon"},lm=["onClick"],sm={key:0,class:"button-options_item-icon"},Yl=me({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(t,{emit:l}){const n=t,r=Ko(),o=e.ref(!1),c=e.ref(null),u=e.ref({}),g=e.ref(!1),m=l;function p(f){f.stopPropagation(),o.value=!o.value}function d(f){f.stopPropagation(),o.value=!o.value,g.value=e.ref(o.value)}function _(f){m("selected",f),o.value=!1}function s(){!r.isMobile.value&&!n.disabled&&(o.value=!0)}function h(){!r.isMobile.value&&!g.value&&(o.value=!1)}function i(f){o.value&&(o.value=!1,g.value=!1)}return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(f,a)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:a[0]||(a[0]=y=>f.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,J9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(p,["stop"])},[e.createElementVNode("span",em,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",tm,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,Y9),!t.disabled&&t.options.length&&o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:a[1]||(a[1]=y=>o.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,y=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"button-options_item",onClick:v=>_(y)},[y.selected&&t.select?(e.openBlock(),e.createElementBlock("div",rm,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(y.name),1)],8,nm))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:s,onMouseleave:h},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:c,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",am,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",im,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,om),!t.disabled&&t.options.length&&o.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(u.value),class:"button-options",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,y=>{var v;return e.openBlock(),e.createElementBlock("div",{key:y,class:"button-options_item",onClick:b=>f.$emit("selected",y)},[y.selected&&t.select?(e.openBlock(),e.createElementBlock("div",sm,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((v=y.label)==null?void 0:v.value)||y.name),1)],8,lm)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),cm={class:"ect-flex ect-flex-col ect-w-full"},dm={key:0,class:"ect-h-[20px] ect-w-[150px]"},um={key:1,class:"ect-flex ect-flex-col ect-gap-1"},fm=me({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var x,y;const l=jo(),n=Mt(),r=t,o=e.ref(((y=(x=n.savedItems)==null?void 0:x[r.itemId])==null?void 0:y.XX_ORD1__QTY__c)||0),c=e.ref(!1),u=e.ref(null),g=e.ref(!1),m=e.ref(!1),p=e.computed(()=>r.actions&&r.actions.length>0),d=e.computed(()=>r.actions.some(v=>v.action==="ADD_TO_CART")),_=e.computed(()=>{var v,b,C;return(v=r.offer)!=null&&v.appliedOnField?Xl[(b=r.offer)==null?void 0:b.appliedOnField]===((C=r.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>n.savedItems,v=>{var b,C;v[r.itemId]&&!m.value&&((b=v[r.itemId])==null?void 0:b.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=v[r.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,m.value=!0)},{deep:!0});function s(v){var b;m.value=!0,v===0&&((b=n.savedItems)!=null&&b[r.itemId])?i():a()}const h=v=>{var b;v.action==="ADD_TO_CART"?(m.value=!0,o.value=1,f()):v.action==="CONFIGURE"||(v.action==="CUSTOM"?window.open(((b=v.url)==null?void 0:b.value)||v.value,v.newTab?"_blank":"_self"):v.action==="ORDER_PARTS"||v.action)},i=async function(){c.value=!0,u.value=null;const v=[n.savedItems[r.itemId].Id];await n.deleteLineItems(v),c.value=!1},f=async function(){c.value=!0,u.value=null;const v={itemID:r.itemId,eCatalogItemID:r.catalogItemId,qty:o.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(v),c.value=!1},a=nt(async function(){console.log("updateToCart 1",o.value),g.value=!0,await n.updateQuoteLineQtyTxn({itemId:r.itemId,qty:o.value,eCatalogItemId:r.catalogItemId}),g.value=!1});return(v,b)=>{var C,E;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(Xo,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(l).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ql,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",cm,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.attributes,(w,S)=>(e.openBlock(),e.createBlock(Kl,{key:S,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:w.value,label:w.label,field:w.value.field,offer:{applyOffer:w.applyOffer,offerDetails:w.offerDetails,offerValue:r.offer},"item-count":o.value,"applied-on-offer-matching-field":_.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),r.offerSetting&&_.value&&((C=r.offer)!=null&&C.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(ve,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(E=r.offer)==null?void 0:E.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(v.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!r.offer?(e.openBlock(),e.createElementBlock("div",dm,[e.createVNode(st)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createBlock(An,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",um,[o.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:o.value,"onUpdate:modelValue":[b[0]||(b[0]=w=>o.value=w),s],loading:g.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Yl,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:b[1]||(b[1]=w=>h(w))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-11bccb46"]]),hm={class:"item"},pm={class:"item-text"},mm={class:"item-attributes"},ym={key:0,class:"item-button"},gm={key:1,class:"ect-flex ect-flex-col ect-gap-1"},xm=me({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var f,a;const l=Mt(),n=t,r=e.ref(((a=(f=l.savedItems)==null?void 0:f[n.itemId])==null?void 0:a.XX_ORD1__QTY__c)||0),o=e.ref(!1),c=e.ref(!1),u=e.ref(!1),g=e.computed(()=>n.actions&&n.actions.length>0),m=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),p=e.computed(()=>{var x,y,v;return(x=n.offer)!=null&&x.appliedOnField?Xl[(y=n.offer)==null?void 0:y.appliedOnField]===((v=n.offerSetting.value)==null?void 0:v.field):!0});e.watch(()=>l.savedItems,x=>{var y,v;x[n.itemId]&&!c.value&&((y=x[n.itemId])==null?void 0:y.XX_ORD1__QTY__c)!==r.value&&(r.value=((v=x[n.itemId])==null?void 0:v.XX_ORD1__QTY__c)||0,c.value=!0)},{deep:!0});function d(x){var y;c.value=!0,x===0&&((y=l.savedItems)!=null&&y[n.itemId])?s():i()}const _=x=>{var y;x.action==="ADD_TO_CART"?(c.value=!0,r.value=1,h()):x.action==="CONFIGURE"||(x.action==="CUSTOM"?window.open(((y=x.url)==null?void 0:y.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action)},s=async function(){o.value=!0;const x=[l.savedItems[n.itemId].Id];await l.deleteLineItems(x),delete l.savedItems[n.itemId],o.value=!1},h=async function(){o.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:r.value,qtyTierAmt:null};await l.saveItemToQuoteBlinkTxn(x),o.value=!1},i=nt(async function(){console.log("updateToCart 2",r.value),u.value=!0,await l.updateQuoteLineQtyTxn({itemId:n.itemId,qty:r.value,eCatalogItemId:n.catalogItemId}),u.value=!1},800);return(x,y)=>(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",pm,[e.createVNode(Ql,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",mm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,v=>{var b;return e.openBlock(),e.createBlock(Kl,{key:v.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:v.value,label:v.label,offer:{applyOffer:v.applyOffer,offerDetails:v.offerDetails,offerValue:n.offer},"item-count":r.value,"applied-on-offer-matching-field":p.value,"show-offer-description":!!((b=n.offer)!=null&&b.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),g.value?(e.openBlock(),e.createElementBlock("div",ym,[o.value?(e.openBlock(),e.createBlock(An,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",gm,[r.value>0&&!t.loading&&m.value?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:r.value,"onUpdate:modelValue":[y[0]||(y[0]=v=>r.value=v),d],loading:u.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Yl,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:y[1]||(y[1]=v=>_(v))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-324ddfb1"]]),_m=["placeholder"],bm={key:0,class:"srch-error"},vm={class:"srch-option_lst-main"},Cm={class:"italic"},Em={class:"srch-option_lst-sugg"},km={class:"italic"},Bm={class:"srch-option_lst-main"},wm={class:"italic"},Nm={class:"srch-option_lst-sugg"},Am={class:"italic"},Sm={class:"srch-option_lst-main"},Im={class:"italic"},Om={class:"srch-option_lst-sugg"},Vm={class:"italic"},Tm={key:1,class:"search1"},Dm={class:"search-container_header"},Mm={class:"search-container_header_input ectheme-input-box"},Lm=["placeholder","value"],Rm=me({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(t,{emit:l}){const n=l;let r;const o=e.ref(""),c=e.ref(!1),u=e.ref(!1),g=e.ref(null),m=()=>{g.value=null,o.value="",n("update:modelValue",""),n("enter")},p=f=>{o.value.length>1?(f.target.blur(),_(o.value+"*")):g.value="Search text must be more than one character.",c.value=!1},d=()=>{u.value||(g.value=null,o.value.length>1?_(o.value+"*"):o.value.length===1&&(g.value="Search text must be more than one character."),c.value=!1)},_=f=>{n("update:modelValue",f),c.value=!1,u.value=!1},s=f=>{const a=f.target.value;g.value=null,a.length||n("update:modelValue","")},h=()=>{n("enter")},i=f=>{var x;r&&(clearTimeout(r),r=null);const a=((x=f==null?void 0:f.target)==null?void 0:x.value)??"";r=setTimeout(()=>{n("update:modelValue",a)},500)};return(f,a)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:a[6]||(a[6]=x=>c.value=!0),onFocusout:d,onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":g.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=x=>o.value=x),type:"search",placeholder:t.placeholder,onInput:s},null,40,_m),[[e.vModelText,o.value]]),e.createVNode(Be,{icon:o.value?"close":"search",size:14,color:g.value?"red":"#acacac",onClick:m},null,8,["icon","color"])],2),g.value?(e.openBlock(),e.createElementBlock("div",bm,[e.createElementVNode("span",null,e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0),o.value.length>1&&c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:a[4]||(a[4]=x=>u.value=!0),onMouseout:a[5]||(a[5]=x=>u.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:a[1]||(a[1]=x=>_(o.value+"*"))},[e.createElementVNode("div",vm,[e.createTextVNode(" Search for "),e.createElementVNode("span",Cm,e.toDisplayString(o.value)+"*",1)]),e.createElementVNode("div",Em,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",km,e.toDisplayString(o.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:a[2]||(a[2]=x=>_(o.value))},[e.createElementVNode("div",Bm,[e.createTextVNode(" Search for "),e.createElementVNode("span",wm,'"'+e.toDisplayString(o.value)+'"',1)]),e.createElementVNode("div",Nm,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",Am,'"'+e.toDisplayString(o.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:a[3]||(a[3]=x=>_("*"+o.value+"*"))},[e.createElementVNode("div",Sm,[e.createTextVNode(" Search for "),e.createElementVNode("span",Im,"*"+e.toDisplayString(o.value)+"*",1)]),e.createElementVNode("div",Om,[e.createTextVNode(" word that includes "),e.createElementVNode("span",Vm,"*"+e.toDisplayString(o.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",Tm,[e.createElementVNode("div",Dm,[e.createElementVNode("div",Mm,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:i,onKeyup:e.withKeys(h,["enter"])},null,40,Lm),t.loading?(e.openBlock(),e.createBlock(An,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:m})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:h})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),es=t=>(e.pushScopeId("data-v-57022b93"),t=t(),e.popScopeId(),t),Fm=["id"],Pm={key:0,class:"product-search"},qm={key:1,class:"product-not-found"},$m=es(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),jm=es(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),Hm={key:2,class:"product-item"},Um=20,zm=me({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:l}){const n=["vertical","horizontal","square","table"],r=t,o=e.ref(Math.floor(Math.random()*1e9)),c=e.ref(null),u=Mt(),g=e.ref(1),m=e.ref(!0),p=e.ref(!0);e.ref(!1);const d=e.ref([]),_=e.ref(0),s=e.ref(r.request);let h=200;const i=e.ref(r.searchText||""),f=e.computed(()=>r.initialItems||[]),a=e.computed(()=>!!(i.value||r.searchText));function x(X,F,B){const O=B==="Item",I=[];return X.forEach(R=>{var M,q;const P=JSON.parse(JSON.stringify(F));try{O?P.itemId=R.Id:(P.itemId=R.XX_ORD1__Item__c,P.catalogItemId=R.Id);const{description:j,thumbnail:z,title:K,attributes:J,actions:Y}=P;z!=null&&z.field&&!z.isStatic&&(z.value=Ie(R,z.field)),K!=null&&K.field&&!K.isStatic&&(K.value=Ie(R,K.field)),j!=null&&j.field&&!j.isStatic&&(j.value=Ie(R,j.field)),(J||[]).forEach(W=>{var ee,le;(ee=W==null?void 0:W.value)!=null&&ee.field&&!W.value.isStatic&&(W.value.value=Ie(R,W.value.field,W.value.dataType)||"-"),(le=W==null?void 0:W.label)!=null&&le.field&&!W.label.isStatic&&(W.label.value=Ie(R,W.label.field,W.label.dataType)||"-")}),(Y||[]).forEach(W=>{W.action==="CUSTOM"&&(W.url&&!W.url.isStatic&&(W.url.value=Ie(R,W.url.field)),W.label&&!W.label.isStatic&&(W.label.value=Ie(R,W.label.field)))});const ae=O?Ie(R,"XX_ORD1__Friendly_URL__c"):Ie(R,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((M=P.friendlyURLFields)==null?void 0:M.length)>0&&ae?((q=P.friendlyURLFields)==null||q.forEach(W=>{P.friendlyURL=(P.friendlyURL||"").replace(`{!${W}}`,Ie(R,W))}),P.friendlyURL="/"+(P.friendlyURL||"")+"/"+ae):P.url&&(P.friendlyURL=P.url+"/"+((R==null?void 0:R.Id)||"")),P.friendlyURL&&(P.friendlyURL=P.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}I.push(P)}),I}const y=e.ref(null),v=e.ref(null),b=e.computed(()=>{}),C=e.computed(()=>{var X;return(X=r.fields)==null?void 0:X.header});e.computed(()=>{var X;return((X=C.value)==null?void 0:X.mainHeading)||{}}),e.computed(()=>{var X;return((X=C.value)==null?void 0:X.subHeading)||{}});const E=e.computed(()=>{var X;return d.value.length>0?d.value:Array(w.value).fill((X=r.fields)==null?void 0:X.productCard)}),w=e.computed(()=>Number(r.configuration.displaySettings.itemsPerPage||Um)),S=e.computed(()=>Number(r.configuration.displaySettings.lazyLoadBatch)),T=e.computed(()=>{var X;return((X=r.configuration.productItemOrientation)==null?void 0:X.toLowerCase())||"vertical"}),A=e.ref(n.includes(T.value)?y.value||T.value:"vertical"),k=e.computed(()=>d.value.length<1&&!p.value),N=e.computed(()=>`product-${A.value} width-${v.value?v.value:r.configuration.displaySettings.columns||1}`),D=e.computed(()=>r.configuration.displaySettings.enableSearch),L=e.ref(null),$=e.ref(!1),U=e.ref({});e.watch(g,(X,F)=>{X!==F&&(console.log("[fetchProducts] 1"),Q(!0))}),e.watch(L,X=>{X!==null&&r.onCountUpdate&&r.onCountUpdate(X)}),e.watch(i,()=>{g.value=1,console.log("[fetchProducts] 2"),Q(!0)}),e.watch(()=>r.searchText,(X,F)=>{X!==F&&(i.value=X||"")});const Q=nt(async function(X){var R;if(h=600,f.value&&f.value.length>0&&!a.value){const P=x(f.value,(R=r.fields)==null?void 0:R.productCard,r.catalogType);d.value=P,L.value=P.length,p.value=!1,X&&c.value&&c.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}p.value=!0;let B=w.value;S.value<B&&S.value>0&&(B=S.value);const O={...s.value,accountID:r.accountId,rowLimit:B,searchText:i.value||r.searchText,rowOffSet:w.value*(g.value-1)};X&&c.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});const I=await u.getProductItems(O,r.fields.productCard,r.catalogType);I&&(m.value=I.items.length===B,L.value=I.count,d.value=I.items,_.value=Math.ceil(I.count/w.value)),console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",I),p.value=!1},h);async function Z(){const{mainHeading:X,subHeading:F}=r.fields.header;if(!X.isStatic&&X.field||!F.isStatic&&F.field){const B=[];X.isStatic?X.value=X.title:B.push(X.field),F.isStatic?F.value=F.title:B.push(F.field);const O={...s.value,accountID:r.accountId,fields:B},I=await u.getEcatalogDetails(O);X.isStatic||(X.value=I[X.field],X.isStatic=!0),F.isStatic||(F.value=I[F.field],F.isStatic=!0)}else X.value=X.title,F.value=F.title}return l({currentPage:g,fetchProducts:Q}),e.onMounted(()=>{Q(),Z()}),(X,F)=>(e.openBlock(),e.createElementBlock("div",{id:o.value,ref_key:"productBlock",ref:c,class:"product"},[D.value&&b.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",Pm,[e.createVNode(Rm,{modelValue:i.value,"onUpdate:modelValue":F[0]||(F[0]=B=>i.value=B),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(X.$slots,"default",{},void 0,!0),k.value?(e.openBlock(),e.createElementBlock("div",qm,[$m,e.createTextVNode(),jm])):(e.openBlock(),e.createElementBlock("div",Hm,[A.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,B=>(e.openBlock(),e.createElementBlock("div",{key:(B==null?void 0:B.catalogItemId)||(B==null?void 0:B.itemId),class:"product-item_table"},[e.createVNode(xm,{class:"ecb-theme-card","item-id":B==null?void 0:B.itemId,"catalog-item-id":B==null?void 0:B.catalogItemId,loading:p.value,mode:A.value,title:B==null?void 0:B.title,attributes:B==null?void 0:B.attributes,actions:B==null?void 0:B.actions,thumbnail:{value:B==null?void 0:B.thumbnail.value},description:B==null?void 0:B.description,url:B==null?void 0:B.friendlyURL,"template-id":t.configuration.productTemplateId,"ecatalog-id":B==null?void 0:B.eCatalogId,"apply-offer":$.value,"offer-setting":U.value,offer:B==null?void 0:B.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","ecatalog-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(E.value,B=>(e.openBlock(),e.createElementBlock("div",{key:(B==null?void 0:B.catalogItemId)||(B==null?void 0:B.itemId),class:e.normalizeClass(["product-item_record",N.value])},[e.createVNode(fm,{"item-id":B==null?void 0:B.itemId,"catalog-item-id":B==null?void 0:B.catalogItemId,loading:p.value,mode:A.value,title:B==null?void 0:B.title,attributes:B==null?void 0:B.attributes,actions:B==null?void 0:B.actions,thumbnail:{value:B==null?void 0:B.thumbnail.value},description:B==null?void 0:B.description,url:B==null?void 0:B.friendlyURL,"template-id":t.configuration.productTemplateId,"ecatalog-id":B==null?void 0:B.eCatalogId,"apply-offer":$.value,"offer-setting":U.value,offer:B==null?void 0:B.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","ecatalog-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,Fm))}},[["__scopeId","data-v-57022b93"]]),ts=t=>(e.pushScopeId("data-v-f4d2ce2f"),t=t(),e.popScopeId(),t),Xm={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},Km={class:"catalog-product md:ect-grow"},Qm={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},Gm=ts(()=>e.createElementVNode("h3",null,"Filter Products",-1)),Wm=ts(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),Zm=me({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t){var s,h,i,f,a,x,y,v,b,C,E;const l=lt(),n=t,r=e.ref(!1),o=e.ref(((s=n.configuration.dynamicFilters)==null?void 0:s.length)>0&&((h=n.configuration.displaySettings)==null?void 0:h.displayDynamicFilters)&&!n.searchTerm),c=e.ref(n.configuration.displaySettings),u=e.computed(()=>Sp.get(n.configuration.catalogType)),g=e.computed(()=>{let w=p.value.searchText;return w&&!w.endsWith("*")&&(w+="*"),w||""}),m=e.computed(()=>{var L;const w=[],{description:S,thumbnail:T,title:A,attributes:k,actions:N}=n.fields.productCard,D=[S,T,A];return k.forEach($=>{D.push($.value),D.push($.label)}),(N==null?void 0:N.length)>0&&N.forEach($=>{$.action==="CUSTOM"&&(D.push($.url),D.push($.label))}),D.forEach($=>{!$.isStatic&&$.field?w.push($.field):$.value=$.title||"-"}),u.value==="eCatalog"?(w.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),w.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(w.push("XX_ORD1__Friendly_URL__c"),w.push("XX_ORD1__SYS_Requires_Configuration__c")),((L=n.fields.productCard.friendlyURLFields)==null?void 0:L.length)>0&&w.push(...n.fields.productCard.friendlyURLFields),w}),p=e.ref({blockId:n.id,catalogType:Ap.get(n.configuration.catalogType)||"Full",checkcurrency:(i=c.value)==null?void 0:i.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:m.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((a=(f=n.configuration.sort)==null?void 0:f.primary)==null?void 0:a.field)||"Name",sortOrder:(y=(x=n.configuration.sort)==null?void 0:x.primary)==null?void 0:y.direction,secondarySortByField:(b=(v=n.configuration.sort)==null?void 0:v.secondary)==null?void 0:b.field,secondarySortOrder:(E=(C=n.configuration.sort)==null?void 0:C.secondary)==null?void 0:E.direction}),d=e.ref(null),_=e.ref(null);return e.watch(()=>r.value,w=>{w&&window.scrollTo(0,0)}),e.onMounted(()=>{p.value.searchText=n.searchTerm||""}),e.watch(p,w=>{_.value&&_.value.fetchFilterList(),d.value&&(d.value.currentPage=1,console.log("[fetchProducts] 4"),d.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,w=>{typeof w=="string"&&(p.value.searchText=w)}),(w,S)=>(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Km,[e.createVNode(zm,{ref_key:"product",ref:d,"block-id":t.id,"account-id":e.unref(l).accountId,configuration:t.configuration,"catalog-type":u.value,request:p.value,fields:t.fields,"search-text":g.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Qm,[Gm,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:S[0]||(S[0]=T=>r.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),Wm])],512),[[e.vShow,!r.value&&o.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-f4d2ce2f"]]),Jm={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},Ym=["width","height"],e4=["href"],t4=["width","height"],n4=["href"];function r4(t,l,n,r,o,c){const u=e.resolveComponent("AtomIcons"),g=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(g,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:l[0]||(l[0]=m=>o.isHover=!0),onMouseleave:l[1]||(l[1]=m=>o.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(u),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:o.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:o.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,e4)],12,Ym))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(c.mode),style:e.normalizeStyle(c.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:l[2]||(l[2]=m=>o.isHover=!0),onMouseleave:l[3]||(l[3]=m=>o.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(u),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:o.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:o.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,n4)],12,t4))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(c.mode),style:e.normalizeStyle(c.style)},e.toDisplayString(n.icon),7))],34))}const Qo=me(Jm,[["render",r4],["__scopeId","data-v-16108bca"]]);async function ns(t,l,n,r={},o={}){let c=`/services/apexrest/${t}?type=${l}`;if(r&&Object.keys(r).length>0){const m=new URLSearchParams;Object.keys(r).forEach(d=>{const _=r[d];_!=null&&_!==""&&m.append(d,String(_))});const p=m.toString();p&&(c+=`&${p}`)}const u={action:"makeCall",data:{callType:n,endpoint:c,...n!=="GET"&&{payload:JSON.stringify(o)}}};return(await sr(kt,u)).content}const Lt=Pe.defineStore("expediteCart",()=>{const t=e.ref(null),l=e.ref([]),n=e.ref(),r=e.ref({}),o=lt();async function c(h,i){let f=i?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await et({data:JSON.stringify(h),config:{pathKey:f}})}async function u(h){return await et({data:JSON.stringify({lineItemIds:h}),config:{pathKey:"common.getLineItemAttributes"}})}async function g(){const h=t.value?{quoteId:t.value}:{};return await et({data:JSON.stringify(h),config:{pathKey:"promocode.getPromoCodes"}})}async function m(){const h=t.value?{quoteId:t.value}:{},i=await ns("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",h,{});return n.value=i,l.value=i.qliIds,i}async function p(h,i,f){const a={promoCode:h,quoteId:t.value,qliIds:i,isLastBatch:f,originalTotalSalesPrice:h?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await et({data:JSON.stringify(a),config:{pathKey:"promocode.applyPromoCode"}})}async function d(h){const f={records:[{fields:h.fields.map(x=>({fieldName:x.fieldName,fieldValue:x.fieldValue}))}],uniqueField:"Id",objectType:h.objectType};return await et({data:JSON.stringify(f),config:{pathKey:"update.upsertRecords"}})}async function _(h){return await et({data:JSON.stringify(h),config:{pathKey:"fetch.getRecord"}})}async function s(h){const i=h||o.cid.value;return await ns("XX_ORD1/ecommerce","startNewCart","POST",i?{cid:i}:{},{})}return{quoteId:t,qlisList:l,quoteRecord:r,getRowItems:c,getLineItemAttributesNG:u,getPromoCodeInfo:g,getQLIsForPromoCode:m,applyPromoCodeNG:p,updateRecord:d,getRecordFieldValue:_,startNewCart:s}}),o4={components:{AppTooltip:si,AppIcon:Be},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},rs=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),a4=["data-test-id"],i4=["data-test-id"],l4={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s4=[rs(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],c4={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d4=[rs(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],u4=["data-test-id"];function f4(t,l,n,r,o,c){const u=e.resolveComponent("AppIcon"),g=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:l[0]||(l[0]=(...m)=>c.toggleChecked&&c.toggleChecked(...m))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",l4,s4)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",c4,d4)):e.createCommentVNode("",!0)],10,i4),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,u4)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(g,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(u,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,a4)}const fr=me(o4,[["render",f4],["__scopeId","data-v-888eb5f4"]]),h4={class:"m-content"},p4={key:0,class:"attribute-input"},m4={key:1,class:"attribute-lookup"},y4={class:"attribute-lookup-main"},g4={key:1},x4={key:2,class:"attribute-input"},_4={key:2},b4={class:"m-footer"},v4=me({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:l}){const n=Lt(),r=t,o=l,c=e.ref([]),u=e.ref([]),g=e.ref({}),m=e.ref(!1);async function p(){m.value=!0;const i=[{fieldName:"Id",fieldValue:r.quoteId}];u.value.forEach(a=>{if(a.editable&&!a.apiName.includes(".")){let x=a.apiName;a.dataType==="REFERENCE"?(x=a.apiName.replace("__r","__c"),i.push({fieldName:x,fieldValue:a.referenceRecordId})):i.push({fieldName:x,fieldValue:a.value})}});const f={fields:i,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(f),await n.updateRecord(f),d(),o("reload",r.quoteId),o("close"),m.value=!1}function d(){const i={},f={};c.value.forEach(a=>{a.dataType==="REFERENCE"&&(f[a.apiName]=a.referenceRecordId),i[a.apiName]=a.value}),r.data.forEach(a=>{a.dataType==="REFERENCE"&&(a.referenceRecordId=f[a.apiName]),a.value=i[a.apiName]})}function _(i,f){if(i){const a=c.value.find(y=>y.label===f.firstLookup.replace("Copy from ",""));console.log("Parent",a);const x={};a.relatedFields.forEach(y=>{x[y.child]=y.value}),a&&(f.referenceRecordId=a.referenceRecordId,f.value=a.value,f.options=a.options,f.relatedFields.forEach(y=>{y.value=x[y.child]}))}else f.referenceRecordId=null,f.options=[],f.relatedFields.forEach(a=>{a.value=null})}function s(i,f){console.log(i,f);const a=f.options.find(x=>x.Id===i);i===null?(f.options=[],f.value=null,f.relatedFields.forEach(x=>{x.value=null})):(f.value=a.Name,f.relatedFields.forEach(x=>{x.value=a[x.child]}))}const h=nt(async function(i,f){f.loading=!0;const a={lookupObjectApiName:f.referenceObject,searchTerm:i||"",fields:g.value[f.apiName]||[]},x=await n.getLookupRecords(a);console.log(x),f.options=x,f.loading=!1});return e.onBeforeMount(()=>{const i={};c.value=JSON.parse(JSON.stringify(r.data)),c.value.forEach(a=>{a.dataType==="REFERENCE"&&(g.value[a.apiName]=[],a.relatedFields=[],i[a.apiName]=a,a.options=[{Name:a.value||"",Id:a.referenceRecordId}]),a.editable=a.editable&&!a.apiName.includes(".")});let f=null;c.value.forEach(a=>{if(a.referenceObject==="XX_Base__Location__c"&&(f?a.firstLookup="Copy from "+f.label:f=a),a.apiName.includes(".")){const[x,y]=a.apiName.split(".");a.parent=x,a.child=y,g.value[x]!=null&&(g.value[x].push(y),i[x].relatedFields.push(a))}}),u.value=c.value.filter(a=>!a.apiName.includes(".")),console.log(u.value,i)}),(i,f)=>(e.openBlock(),e.createBlock(Da,{title:"Modify attributes",onClicked:f[1]||(f[1]=a=>i.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",h4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,x)=>{var y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[a.firstLookup?(e.openBlock(),e.createElementBlock("div",p4,[e.createElementVNode("label",null,e.toDisplayString(a.firstLookup),1),e.createVNode(fr,{modelValue:a.same,"onUpdate:modelValue":[v=>a.same=v,v=>_(v,a)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),a.dataType==="REFERENCE"&&((y=a.relatedFields)==null?void 0:y.length)>0?(e.openBlock(),e.createElementBlock("div",m4,[e.createElementVNode("div",y4,[e.createVNode(ft,{modelValue:a.referenceRecordId,"onUpdate:modelValue":[v=>a.referenceRecordId=v,v=>s(v,a)],label:a.label,disabled:!a.editable||a.same,options:a.options,lookup:"",search:"",highlight:"",loading:a.loading,property:{key:"Id",value:"Name"},onSearch:v=>e.unref(h)(v,a)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.relatedFields,(v,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"attribute-input"},[v.dataType==="PICKLIST"||v.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,label:v.label,disabled:!v.editable,options:v.picklistValues.map(C=>({label:C,value:C})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):v.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",g4,[e.createElementVNode("label",null,e.toDisplayString(v.label),1),e.createVNode(fr,{modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,disabled:!v.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Ht,{key:2,label:v.label,disabled:!v.editable,modelValue:v.value,"onUpdate:modelValue":C=>v.value=C,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",x4,[a.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:a.referenceRecordId,"onUpdate:modelValue":[v=>a.referenceRecordId=v,v=>s(v,a)],label:a.label,disabled:!a.editable,options:a.options,lookup:"",search:"",highlight:"",loading:a.loading,property:{key:"Id",value:"Name"},onSearch:v=>e.unref(h)(v,a)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):a.dataType==="PICKLIST"||a.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,label:a.label,disabled:!a.editable,options:a.picklistValues.map(v=>({label:v,value:v})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):a.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",_4,[e.createElementVNode("label",null,e.toDisplayString(a.label),1),e.createVNode(fr,{modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,disabled:!a.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Ht,{key:3,label:a.label,disabled:!a.editable,modelValue:a.value,"onUpdate:modelValue":v=>a.value=v,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",b4,[e.createVNode(Ue,{text:"CANCEL",btype:"secondary",onClick:f[0]||(f[0]=a=>i.$emit("close"))}),e.createVNode(Ue,{text:"SAVE",btype:"primary",loading:m.value,onClick:p},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-55410518"]]),C4={class:"datatable"},E4={class:"m-show"},k4={key:0},B4=["onClick"],w4={key:1},N4=["onClick"],A4={class:"desktop d-show"},S4={class:"datatable-skeletion"},I4={class:"datatable-skeletion"},O4={class:"datatable-skeletion"},V4=["colspan"],T4={style:{display:"flex",gap:"1rem",height:"40px"}},D4=["onClick"],M4=["onClick"],L4={key:0},R4=["colspan"],F4={style:{display:"flex",gap:"1rem",height:"40px"}},P4={key:1},q4=["colspan"],$4={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},j4={key:0,class:"attribute",style:{width:"50%"}},H4={key:0,class:"ect-flex ect-gap-2"},U4={key:1,class:"ect-flex ect-gap-2"},z4={key:1,class:"attribute",style:{width:"50%"}},X4={key:0},K4={key:2,class:"attribute",style:{width:"50%"}},Q4={key:0},G4={key:1},hr=me({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(t,{emit:l}){const n=t,r=e.ref(null),o=e.ref(null),c=l,u=e.ref(null),g=e.ref({}),m=e.ref(null),p=e.computed(()=>n.disabled),d=function(v,b){return u.value&&u.value!==v+":"+b||n.delRecords.has(v)||p.value||m.value&&m.value!==v},_=e.computed(()=>{const{headerStyle:v,optionRow:b,productRow:C}=n.style;return{product:{backgroundColor:C.background,verticalAlign:C.verticalAlignment||"middle"},option:{backgroundColor:b.background,verticalAlign:b.verticalAlignment||"middle"},header:{backgroundColor:v.background,verticalAlign:v.verticalAlignment||"middle"}}}),s=e.computed(()=>{const{headerStyle:v,optionRow:b,productRow:C}=n.style;return{header:v.style||{},option:b.style||{},product:C.style||{}}}),h=e.computed(()=>200/n.cols.length+"px");function i(v,b,C){const E={},{table:w}=n.style;if(v){const{alignment:S,strikethrough:T}=v;S&&(E.textAlign=S),T&&(E.textDecoration="line-through")}if(b){const{width:S,minWidth:T}=b;S&&(E.width=`calc(${S.value+S.unit} - ${h.value})`),T&&(E.minWidth=T.value+T.unit)}return w.border!=="n"&&!C?(E.borderStyle="solid",E.borderColor=w.color,w.border==="b"?E.borderWidth=w.width:w.border==="x"?(E.borderTopWidth=w.width,E.borderBottomWidth=w.width,E.borderLeftWidth=0,E.borderRightWidth=0):w.border==="y"?(E.borderLeftWidth=w.width,E.borderRightWidth=w.width,E.borderTopWidth=0,E.borderBottomWidth=0):w.border==="bottom"||w.border==="default"?(E.borderTopWidth=0,E.borderBottomWidth=w.width,E.borderLeftWidth=0,E.borderRightWidth=0):w.border==="top"&&(E.borderTopWidth=w.width,E.borderBottomWidth=0,E.borderLeftWidth=0,E.borderRightWidth=0)):E.borderWidth="0px",E}function f(v,b){var E;if(b.dataType==="REFERENCE")return(E=v[b.content.replace("__c","__r")])==null?void 0:E.Name;const C=Ie(v,b.api,b.dataType);return C===""?C:b.dataType==="PERCENT"?C+"%":C}function a(v,b){v===0?c("delete",b):x(v,"XX_ORD1__QTY__c",b)}function x(v,b,C){m.value=C.Id,y(v,b,C)}const y=nt(function(v,b,C){u.value=C.Id+":"+b,g.value.Id=C.Id,g.value[b]=v;const E=()=>{u.value=null,g.value={},m.value=null};c("update",{record:g.value,callback:E})},500);return(v,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.value&&o.value?(e.openBlock(),e.createBlock(v4,{key:0,data:r.value,"quote-id":o.value,onClose:b[0]||(b[0]=C=>(r.value=null,o.value=null)),onReload:b[1]||(b[1]=C=>v.$emit("reload",C))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",C4,[e.createElementVNode("div",E4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,C=>(e.openBlock(),e.createElementBlock("table",{key:C.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(E,w)=>{var S,T,A,k;return e.openBlock(),e.createElementBlock("tr",{key:w},[e.createElementVNode("th",{style:e.normalizeStyle({...i(E.header.style),..._.value.header})},[E.header?(e.openBlock(),e.createBlock(ve,{key:0,text:E.header.title,style:e.normalizeStyle(E.header.style),"sec-style":s.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...i(E.content.style),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[E.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[E.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>a(N,C)],disabled:d(C.Id,E.api),loading:C.Id+":"+E.api===u.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),options:E.content.picklist,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Ht,{key:2,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.dataType==="URL"?(e.openBlock(),e.createBlock(Xo,{key:0,src:f(C,E)},null,8,["src"])):E.content.isStatic?(e.openBlock(),e.createBlock(ve,{key:1,tag:(S=E.content)==null?void 0:S.style.tag,text:E.content.content,style:e.normalizeStyle((T=E.content)==null?void 0:T.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(ve,{key:2,loading:t.loading.includes(E.dataType)&&(!t.loadingRowId||t.loadingRowId===C.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:f(C,E),style:e.normalizeStyle((k=E.content)==null?void 0:k.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",k4,[e.createElementVNode("th",{style:e.normalizeStyle({...i(),..._.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...i(),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("delete",C)},"REMOVE",10,B4)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref($o).includes(C.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",w4,[e.createElementVNode("th",{style:e.normalizeStyle({...i(),..._.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...i(),..._.value[C.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("configure",C)},"CONFIGURE",10,N4)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",A4,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(_.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,C=>{var E;return e.openBlock(),e.createElementBlock("th",{key:C.key,style:e.normalizeStyle(i((E=C.header)==null?void 0:E.style,C.style))},[C.header?(e.openBlock(),e.createBlock(ve,{key:0,text:C.header.title,style:e.normalizeStyle(C.header.style),"sec-style":s.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,E=>(e.openBlock(),e.createElementBlock("td",{key:E.key,style:e.normalizeStyle(i(E.content.style,E.style))},[e.createElementVNode("div",S4,[e.createVNode(Bt)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",I4,[e.createVNode(Bt)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...i(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",O4,[e.createVNode(Bt)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",T4,[e.createVNode(Bt),e.createVNode(Bt)])],12,V4)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(_.value[C.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(E,w)=>{var S,T,A,k;return e.openBlock(),e.createElementBlock("td",{key:w,style:e.normalizeStyle(i(E.content.style,E.style,!!C.Attributes)),class:e.normalizeClass({"padding-left":w==0&&C.XX_ORD1__Parent_QLI__c})},[E.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[E.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(ur,{key:0,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>a(N,C)],disabled:d(C.Id,E.api),loading:C.Id+":"+E.api===u.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:1,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),options:E.content.picklist,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Ht,{key:2,modelValue:C[E.api],"onUpdate:modelValue":[N=>C[E.api]=N,N=>x(N,E.api,C)],disabled:d(C.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.dataType==="URL"?(e.openBlock(),e.createBlock(Xo,{key:0,src:f(C,E)},null,8,["src"])):E.content.isStatic?(e.openBlock(),e.createBlock(ve,{key:1,tag:(S=E.content)==null?void 0:S.style.tag,text:E.content.content,style:e.normalizeStyle((T=E.content)==null?void 0:T.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(ve,{key:2,loading:t.loading.includes(E.dataType)&&(!t.loadingRowId||t.loadingRowId===C.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:f(C,E),style:e.normalizeStyle((k=E.content)==null?void 0:k.style),"sec-style":C.XX_ORD1__Parent_QLI__c?s.value.option:s.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...i(null,null,!!C.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("delete",C)},"REMOVE",10,D4)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...i(null,null,!!C.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref($o).includes(C.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(C.Id)}]),onClick:E=>!d(C.Id)&&v.$emit("configure",C)}," CONFIGURE ",10,M4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),C.attributesLoading?(e.openBlock(),e.createElementBlock("tr",L4,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",F4,[e.createVNode(Bt),e.createVNode(Bt)])],12,R4)])):C.Attributes?(e.openBlock(),e.createElementBlock("tr",P4,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(i())},[e.createElementVNode("div",$4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.Attributes,(E,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[E.value||E.existingValue||E.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E.value&&(E.existingValue||E.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",j4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value!==E.existingValue&&E.value!==E.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",H4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(ve,{text:E.existingValueReferenceName||E.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",U4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&E.editable&&C.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Qo,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):E.value?(e.openBlock(),e.createElementBlock("div",z4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value?(e.openBlock(),e.createElementBlock("div",X4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&E.editable?(e.openBlock(),e.createBlock(Qo,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",K4,[e.createElementVNode("b",null,e.toDisplayString(E.label)+":",1),E.value?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(ve,{text:E.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):E.existingValue?(e.openBlock(),e.createElementBlock("div",G4,[e.createVNode(ve,{text:E.existingValueReferenceName||E.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&E.editable?(e.openBlock(),e.createBlock(Qo,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:S=>(r.value=C.Attributes,o.value=C.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,q4)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-54bd5aa5"]]),W4={class:"prodlist"},Z4={class:"prodlist-header"},J4={key:0},Y4={key:1,class:"summary"},e6={key:1,class:"summary"},t6=me({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1},isPreview:{type:Boolean,default:!1}},emits:["counts"],setup(t,{emit:l}){const n=Lt(),r=Mt(),o=t,c=l,u=O=>O.toUpperCase()||"",g=e.computed(()=>{var O;return((O=o.fields)==null?void 0:O.styling)||{}}),m=e.computed(()=>{var O,I;return(I=(O=o.configuration)==null?void 0:O.allowedActions)==null?void 0:I.delete}),p=e.computed(()=>{var O,I;return(I=(O=o.configuration)==null?void 0:O.allowedActions)==null?void 0:I.configure}),d=e.computed(()=>{var O;return o.configuration.displayAttributes?(O=o.configuration)==null?void 0:O.attribute:!1}),_=e.computed(()=>{var O;return(O=o.configuration)==null?void 0:O.sort}),s=e.computed(()=>{var O;return(O=o.configuration)==null?void 0:O.group}),h=e.computed(()=>{const O=s.value.groupheader.style;return O?D(O):{}}),i=e.computed(()=>{const O=s.value.groupfooter.style;return O?D(O):{}}),f=e.computed(()=>{const O={},{border:I,color:R,width:P}=g.value.table;return I==="default"&&(O.borderStyle="solid",O.borderColor=R,O.borderWidth=P,O.borderTopWidth=0),O}),a=jt(),x=["CURRENCY","DOUBLE","PERCENT"],y=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],v=e.ref(null),b=e.ref([]),C=e.ref([]),E=e.ref([]),w=e.ref(!1),S=e.ref(!1),T=e.ref(new Set),A=e.ref([]),k=e.ref([]),N=new Map;function D(O){let I={padding:"1.25rem 2rem"};const{overrite:R,backgroundColor:P,verticalAlignment:M,padding:q}=O;return R&&(I={backgroundColor:P,verticalAlign:M,padding:q||"1.25rem 2rem"}),I}const L=async function({record:O,callback:I}){const R=[];for(const M in O)R.push({fieldName:M,fieldValue:O[M]});const P={fields:R,objectType:o.configuration.objectType};await n.updateRecord(P),I(),O.XX_ORD1__QTY__c!==void 0&&(v.value=O.Id,await Z("FIELD_RELOAD"),v.value=null)};async function $(O){v.value=O,await Z("RELOAD_ALL_FIELDS"),v.value=null}const U=O=>{a.push({path:"/cpq",query:{id:O.XX_ORD1__Item__c,lid:O.Id,cstid:storefrontStore.continueShoppingId}})},Q=async function(O){T.value.add(O.Id),w.value=!0;const I=[O.Id];await r.deleteLineItems(I),await Z("RELOAD"),w.value=!1,T.value.delete(O.Id)};async function Z(O){O==="RELOAD"?S.value=!0:O==="FIELD_RELOAD"?E.value=x:O==="RELOAD_ALL_FIELDS"&&(E.value=y);const{groupby:I,grouplevel:R}=o.configuration.group,P=n.quoteId,M=o.footer.map(K=>({field:K.field,snippet:K.function||"SUM"})),q={filterObject:o.configuration.objectType,fieldsToDisplay:[...C.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:o.configuration.filters,parentObjectField:o.configuration.parentObjectField,objectId:P,groupby:I.field,grouplevel:R,primarysort:_.value.primary.field,secondarysort:_.value.secondary.field,primarysortdesc:_.value.primary.direction!=="asc",secondarysortdesc:_.value.secondary.direction!=="asc",filterlogic:o.configuration.filterlogic},j=I.field&&R,z=await n.getRowItems(q,j);j?B(z,R):F(z),o.configuration.displayAttributes&&X(),S.value=!1,E.value=[]}async function X(){const O=v.value,I=[];k.value.forEach(P=>{P.rows.forEach(M=>{M.attributes=N.get(M.Id),console.log("row.attributes",M.attributes),O?M.Attributes=N.get(M.Id):M.attributesLoading=!0,I.push(M.Id)})});const R=await n.getLineItemAttributesNG(I);k.value.forEach(P=>{P.rows.forEach(M=>{const q=R[M.Id];if(q==null?void 0:q.some(z=>z.value&&!d.value.displayonlychanged||z.value&&z.existingValue&&d.value.displayonlychanged)){const z=[],K=new Set;q.forEach(J=>{K.has(J.apiName)||(K.add(J.apiName),z.push(J))}),M.Attributes=z,N.set(M.Id,z)}M.attributesLoading=!1})}),console.log("attributesByIdMap",N)}function F(O){var M;const I=O.lstRecords,R=[],P=O.lstRecords&&((M=O.lstRecords)==null?void 0:M.length)>0;if(c("counts",P),O.lstAggregateField&&O.lstAggregateField.length>0){const q=new Map;O.lstAggregateField.forEach(j=>{q.set(j.fieldName,j.totalValue)}),o.footer.forEach(j=>{j.value=q.get(j.field),R.push(j)})}k.value=[{rows:I,summary:R}]}function B(O,I){const R=[];let P;O.forEach(M=>{var q;if(I==="option"){if((q=M.product)!=null&&q.thisobject){const j={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(z=>{const K={name:z.groupName,rows:[]},J=[];z.options.forEach(Y=>{K.rows.push(Y.thisobject)}),z.groupTotals&&z.groupTotals.length>0&&z.groupTotals.forEach(Y=>{var ae,W;J.push({label:K.name,value:Y.amount,style:((W=(ae=s.value)==null?void 0:ae.groupfooter)==null?void 0:W.style)||{}})}),K.summary=J,j.options.push(K)}),R.push(j)}}else{if(P={name:M.groupName,rows:[]},M.productRows.forEach(j=>{P.rows.push(j[I].thisobject),j.options.forEach(z=>{const K={...z.thisobject};K.isOption=!0,P.rows.push(K)})}),s.value.displaygroupfooter){const j=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(z=>{var K,J;j.push({label:P.name,value:z.amount,style:((J=(K=s.value)==null?void 0:K.groupfooter)==null?void 0:J.style)||{}})}),P.summary=j}else P.summary=[];R.push(P)}}),k.value=R}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),A.value=JSON.parse(JSON.stringify(o.columns)),b.value=o.summary,A.value.forEach(O=>{O.content.dataType=u(O.content.dataType),O.editby=O.editable,O.editable=O.editable!=="not",O.dataType=O.content.dataType,O.api=O.content.field,C.value.push(O.content.field)}),C.value.includes("XX_ORD1__QLI_Type__c")||C.value.push("XX_ORD1__QLI_Type__c"),Z("RELOAD")}),(O,I)=>{var R;return e.openBlock(),e.createElementBlock("div",W4,[e.createElementVNode("div",Z4,[t.header.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(R=t.header.style)==null?void 0:R.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!s.value.repeatcolumheadings||S.value?(e.openBlock(),e.createElementBlock("div",J4,[e.createVNode(hr,{cols:A.value,rows:[],summary:[],style:e.normalizeStyle(g.value),loading:E.value,del:m.value,configure:p.value,disabled:w.value||t.isPreview,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[0]||(I[0]=P=>$(P))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(f.value)},[e.createVNode(hr,{hidecolumn:"",cols:A.value,rows:[],summary:[],style:e.normalizeStyle(g.value),"row-loading":!0,loading:E.value,del:m.value,configure:p.value,disabled:w.value||t.isPreview,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[1]||(I[1]=P=>$(P))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(f.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,P=>(e.openBlock(),e.createElementBlock("div",{key:P.name,class:e.normalizeClass(["productlist",P.isProduct?"prodlist-product":"prodlist-option"])},[s.value.displaygroupheader&&P.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(h.value)},[e.createVNode(ve,{text:"Group: "+P.name,style:e.normalizeStyle(s.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(hr,{hidecolumn:!s.value.repeatcolumheadings,cols:A.value,rows:P.rows,style:e.normalizeStyle(g.value),"row-loading":S.value,loading:E.value,del:m.value,configure:p.value,disabled:w.value||t.isPreview,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[2]||(I[2]=M=>$(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),P.summary.length>0?(e.openBlock(),e.createElementBlock("div",Y4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.summary,(M,q)=>{var j,z,K;return e.openBlock(),e.createElementBlock("div",{key:q,class:"summary_row",style:e.normalizeStyle(i.value)},[e.createVNode(ve,{tag:(j=M==null?void 0:M.style)==null?void 0:j.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(ve,{loading:((z=E.value)==null?void 0:z.length)>0||S.value,tag:(K=M==null?void 0:M.style)==null?void 0:K.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),P.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(P.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[s.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(h.value)},[e.createVNode(ve,{text:"Group: "+M.name,style:e.normalizeStyle(s.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(hr,{hidecolumn:!s.value.repeatcolumheadings,cols:A.value,rows:M.rows,style:e.normalizeStyle(g.value),"row-loading":S.value,loading:E.value,del:m.value,configure:p.value,disabled:w.value||t.isPreview,"loading-row-id":v.value,"del-records":T.value,attribute:d.value,"is-option":!0,onDelete:Q,onConfigure:U,onUpdate:L,onReload:I[3]||(I[3]=q=>$(q))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",e6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(q,j)=>{var z,K,J;return e.openBlock(),e.createElementBlock("div",{key:j,class:"summary_row",style:e.normalizeStyle(i.value)},[e.createVNode(ve,{tag:(z=q==null?void 0:q.style)==null?void 0:z.tag,text:q.label+" : ",style:e.normalizeStyle(q==null?void 0:q.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(ve,{loading:((K=E.value)==null?void 0:K.length)>0||S.value,tag:(J=q==null?void 0:q.style)==null?void 0:J.tag,text:q.value,style:e.normalizeStyle(q==null?void 0:q.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))])}}},[["__scopeId","data-v-be33ba29"]]),n6={class:"detail-section"},r6={key:0,class:"selectedtext sm:hidden"},o6={class:"expand material-icons-outlined"},a6={key:1,class:"detail-section_title"},i6={key:2,class:"detail-section_slot"},l6=me({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(t,{emit:l}){const n=t;return(r,o)=>{var c,u;return e.openBlock(),e.createElementBlock("div",n6,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:o[0]||(o[0]=g=>!n.disabled&&r.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(c=n.style)==null?void 0:c.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(Bt,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",r6,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",o6,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",a6,[t.title?(e.openBlock(),e.createBlock(ve,{key:0,tag:(u=t.style)==null?void 0:u.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",i6,[e.renderSlot(r.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function s6(t,l,n){if(!l)return t;if(n.aliasName)return c6(t,l,n);{const o=l.split(".").reduce((c,u)=>c[u]||"",t)||"";return{original:o,value:o,metadata:n}}}function c6(t,l,n){var u;const r=l.split(".");let o=l;r.length>1&&(o=r.pop(),t=r.reduce((g,m)=>g[m]||{},t));let c=t[n.aliasName]||t[o]||"";return c&&n.dataType&&((u=n.dataType)==null?void 0:u.toUpperCase())==="CURRENCY"&&c.includes("(")&&(c=c.split("(")[0]),{value:c,original:t[o],metadata:n}}function d6(t){let l=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",l),l}const u6={class:"quote-summary"},f6={key:0,class:"qt-smuarry"},h6={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},p6=me({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(t){const l=Mt(),n=Lt(),r=t,o=Ko(),c=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.header}),u=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.content}),g=e.computed(()=>{var a;return(a=r.fields)==null?void 0:a.footer}),m=e.ref(!1),p=e.ref(!1),d=e.ref(!1),_=e.ref([]),s=e.ref({}),h=e.computed(()=>{var a,x;return o.isMobile.value&&!m.value&&g.value&&g.value.length>0?`${g.value[0].label} ${((a=s.value[g.value[0].field])==null?void 0:a.value)||""}`:(x=c.value)==null?void 0:x.title});async function i(a){console.log("Quote Summary",a),p.value=!0,d.value&&await l.calculateAvaTax();const x=_.value.map(({field:y})=>y);s.value=await n.getRecordFieldValue({recordId:r.quoteId,lstFields:x}),_.value.forEach(({field:y,dataType:v})=>{s.value[y]=s6(s.value,y,{dataType:v,aliasName:d6(y)})}),p.value=!1}const f=()=>{o.isMobile.value?m.value=!m.value:m.value=!0};return e.onMounted(async()=>{var x,y,v,b,C,E,w,S,T;m.value=!o.isMobile.value;const a=(y=(x=document.querySelector(`[page-block-id="${r.id}"]`))==null?void 0:x.parentElement)==null?void 0:y.parentElement;a&&(a.style.display=o.isMobile.value?"none":"block"),d.value=r.tax||((v=u.value)==null?void 0:v.some(({field:A})=>A==="XX_ORD1__Taxes__c")),(r.quoteId||d.value)&&(_.value=(C=(b=r.fields)==null?void 0:b.content)==null?void 0:C.map(({field:A,dataType:k})=>({field:A,dataType:k})),((w=(E=r.fields)==null?void 0:E.footer)==null?void 0:w.length)>0&&((T=(S=r.fields)==null?void 0:S.footer)==null||T.forEach(({field:A,dataType:k})=>_.value.push({field:A,dataType:k}))),i())}),(a,x)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",u6,[t.quoteId?(e.openBlock(),e.createElementBlock("div",f6,[e.createVNode(l6,{expand:m.value,title:h.value,style:e.normalizeStyle(c.value.style),header:e.unref(o).isMobile.value,onExpand:x[0]||(x[0]=y=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",h6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,y=>{var v,b,C,E;return e.openBlock(),e.createElementBlock("div",{key:y.field,class:"summary-item"},[y.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(v=y.style)==null?void 0:v.tag,text:y.label,style:e.normalizeStyle(y.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(b=s.value[y.field])!=null&&b.value?(e.openBlock(),e.createBlock(ve,{key:1,loading:p.value,tag:(C=y.style)==null?void 0:C.tag,text:(E=s.value[y.field])==null?void 0:E.value,style:e.normalizeStyle(y.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,y=>{var v,b,C,E;return e.openBlock(),e.createElementBlock("div",{key:y.field,class:"summary-total"},[y.label?(e.openBlock(),e.createBlock(ve,{key:0,tag:(v=y.style)==null?void 0:v.tag,text:y.label,style:e.normalizeStyle(y.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(b=s.value[y.field])!=null&&b.value?(e.openBlock(),e.createBlock(ve,{key:1,loading:p.value,tag:(C=y.style)==null?void 0:C.tag,text:(E=s.value[y.field])==null?void 0:E.value,style:e.normalizeStyle(y.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-9dce15f7"]]),m6={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},y6={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const t=[];return!this.type||!m6[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},g6={key:0,class:"ect-flex ect-justify-center"},x6={key:1};function _6(t,l,n,r,o,c){const u=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",c.getBtnClass()],style:c.getBtnStyle(),onClick:l[0]||(l[0]=e.withModifiers(g=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",g6,[e.createVNode(u,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",x6,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const Go=me(y6,[["render",_6],["__scopeId","data-v-7428ebd4"]]),b6={class:"promocode-input"},v6={class:"m-1"},C6=me({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(t){const l=Lt(),n=t,r=e.computed(()=>n.fields.label),o=e.ref(!1),c=e.ref(""),u=e.ref(!1),g=e.ref(!1),m=e.ref(""),p=e.ref(null),d=async()=>{u.value=!0,o.value=!0,g.value=!1,await l.getQLIsForPromoCode();const i=await _(!1);i.error||(m.value=i),u.value=!1},_=async i=>{const a=l.qlisList,x=Math.ceil(a.length/50);let y="";for(let v=0;v<x;v++){const b=v*50,C=b+50,E=v===x-1;if(y=await s(a.slice(b,C),E,i),y&&y.error)return g.value=y.error,p.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),u.value=!1,i||(o.value=!1,h(!0)),y}return y},s=async(i,f,a)=>await l.applyPromoCodeNG(a?"":c.value,i,f),h=async i=>{u.value=!0,await l.getQLIsForPromoCode(),i!==!0&&(g.value=!1);const f=await _(!0);(!f||f&&!f.error)&&i!==!0&&(o.value=!1,m.value="",c.value=""),u.value=!1};return e.onMounted(async()=>{const i=await l.getPromoCodeInfo();console.log("Offer::",i),i!=null&&i.XX_ORD1__Promo_Code__c&&(c.value=i.XX_ORD1__Promo_Code__c,m.value=i.XX_ORD1__Short_Description__c,o.value=!0)}),(i,f)=>{var a,x,y,v,b,C,E;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:p,class:"promocode"},[(a=r.value)!=null&&a.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(x=r.value)==null?void 0:x.title,style:e.normalizeStyle((y=r.value)==null?void 0:y.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",b6,[e.createVNode(Ht,{modelValue:c.value,"onUpdate:modelValue":[f[0]||(f[0]=w=>c.value=w),f[1]||(f[1]=w=>o.value=!1)],class:"promocode-input_box",disabled:o.value||t.isPreview,error:g.value},null,8,["modelValue","disabled","error"]),u.value?(e.openBlock(),e.createBlock($n,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.value?(e.openBlock(),e.createBlock(Go,{key:1,theme:(C=t.fields.removeButton)==null?void 0:C.style.theme,disabled:c.value.length<1||t.isPreview,text:(E=t.fields.removeButton)==null?void 0:E.title,onClick:h},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(Go,{key:0,theme:(v=t.fields.applyButton)==null?void 0:v.style.theme,disabled:c.value.length<1||t.isPreview,text:(b=t.fields.applyButton)==null?void 0:b.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",v6,e.toDisplayString(m.value),1)])],512)}}},[["__scopeId","data-v-788d5034"]]),os={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function E6(t){return os[t]||"dd/MM/yyyy"}function k6(t,l){if((t==null?void 0:t.length)<6||!l)return null;const n=os[l]||"dd/MM/yyyy",r=n.includes("/")?"/":n.includes("-")?"-":".",o=n.split(r),c=t.split(r),u={};if(o.forEach((m,p)=>{u[m]=parseInt(c[p])}),u.yyyy>9999||u.yyyy<1e3||u.MM<0||u.MM>12||u.dd<0||u.dd>31)return null;const g=new Date(u.yyyy,u.MM-1,u.dd);return g!="Invalid Date"?g:null}const pr=t=>(e.pushScopeId("data-v-975857d5"),t=t(),e.popScopeId(),t),B6=["data-test-id"],w6=["for","data-test-id"],N6=["data-test-id"],A6=["placeholder","data-test-id"],S6=["data-test-id"],I6=["data-test-id"],O6=["data-test-id"],V6=["data-test-id"],T6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],D6=["data-test-id"],M6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],L6=["data-test-id"],R6=["data-test-id"],F6=["data-test-id"],P6=["data-test-id"],q6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],$6=["data-test-id"],j6=[pr(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],H6=["data-test-id"],U6={class:"c-container"},z6={class:"cc-head"},X6={class:"cc-body"},K6={class:"cdc-day"},Q6=["onClick"],G6=60*60*24*1e3,W6=me({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(t,{emit:l}){const n=t,r=l,o=Date.now()-Date.now()%G6+new Date().getTimezoneOffset()*1e3*60,c=W=>{if(!W)return"";const[ee,le,de]=W.split("-");return`${le}/${de}/${ee}`},u=W=>{if(!W)return"";const[ee,le,de]=W.split("/");return`${de}-${ee.padStart(2,"0")}-${le.padStart(2,"0")}`},g=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:o,monthDetails:[]}),m=e.ref({position:"absolute",top:"0px",left:"0px",width:"0px"}),p=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"],s=e.ref(new Date(1e3,0,1)),h=e.ref(new Date(9999,0,1)),i=e.ref(!0),f=e.ref(!1),a=e.ref(""),x=e.ref(""),y=e.ref(!1),v=e.ref(""),b=e.ref(-1),C=e.computed(()=>E6(n.locale)),E=e.computed(()=>s.value.getFullYear()<g.value.year),w=e.computed(()=>h.value.getFullYear()>g.value.year),S=e.computed(()=>E.value||s.value.getMonth()<g.value.month),T=e.computed(()=>w.value||h.value.getMonth()>g.value.month),A=e.computed(()=>{if(x.value){const W=x.value.getTime();if(h.value.getTime()<W)return"Max date can be "+h.value.toLocaleDateString(n.locale);if(s.value.getTime()>W)return"Min date can be "+s.value.toLocaleDateString(n.locale)}return!1}),k=e.computed(()=>{let W=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return i.value||(W="Date format must be "+C.value),A.value&&(W=A.value),r("error",W),W}),N=e.computed(()=>(v.value==""||v.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:v.value!=n.modelValue);e.watch(()=>n.modelValue,W=>{a.value=W?c(W):""}),e.watch(()=>n.min,W=>{s.value=W?new Date(W):new Date(1e3,0,1)}),e.watch(()=>n.max,W=>{h.value=W?new Date(W):new Date(9999,0,1)}),e.watch(a,W=>{if(W)try{const ee=k6(W,n.locale);if(x.value=ee||x.value,i.value=!!ee,i.value){const le=u(W);if(v.value===le)return;r("update:modelValue",le)}}catch(ee){console.info("[ERROR]: Date parsing error:",ee),i.value=!1}else i.value=!0,x.value=null,r("update:modelValue","")});const D=e.ref(null),L=e.ref(null),$=e.ref(null);e.onMounted(()=>{ae(),h.value=n.max?new Date(n.max):h.value,s.value=n.min?new Date(n.min):s.value,n.modelValue&&(a.value=c(n.modelValue),i.value=!!a.value),v.value=n.modelValue,window.addEventListener("resize",U),window.addEventListener("scroll",U,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)});const U=()=>{if(!$.value)return;const W=$.value.getBoundingClientRect(),ee=420,le=334,de=window.innerHeight-W.bottom,ne=W.top,re=de<ee&&ne>ee;m.value={position:"absolute",top:`${re?W.top-ee:W.bottom}px`,left:`${W.left}px`,width:`${le}px`,zIndex:9999}},Q=()=>{y.value||(j(),y.value=!0,U(),r("focus-in"))},Z=(W=!1)=>{(!f.value||W)&&setTimeout(()=>{b.value=-1,y.value=!1,r("focus-out",x.value)},100)},X=()=>{L.value&&L.value.focus()},F=W=>{const ee=W.index-W.firstDay,le=W.index%7;let de=W.month-1,ne=W.year;de<0&&(de=11,ne--);const re=B(ne,de),se=(ee<0?re+ee:ee%W.numberOfDays)+1,ce=new Date(W.year,W.month,se).getTime(),ie=ee<0||s.value.getTime()>ce?-1:ee>=W.numberOfDays||h.value.getTime()<ce?1:0;return{date:se,day:le,month:ie,timestamp:ce,dayString:d[le]}},B=(W,ee)=>40-new Date(W,ee,40).getDate(),O=(W,ee)=>{const le=new Date(W,ee).getDay(),de=B(W,ee),ne=[],re=6;let se=null,ce=0;const ie=7;for(let pe=0;pe<re;pe++)for(let ue=0;ue<ie;ue++)se=F({index:ce,numberOfDays:de,firstDay:le,year:W,month:ee}),ne.push(se),ce++;return ne},I=W=>W.timestamp===o,R=W=>W.timestamp===g.value.selectedDay,P=W=>{if(!W)return null;if(W instanceof Date)return{year:W.getFullYear(),month:W.getMonth()+1,date:W.getDate()};if(typeof W=="string"&&W.includes("/")){const[ee,le,de]=W.split("/");return{year:parseInt(de),month:parseInt(ee),date:parseInt(le)}}return null},M=W=>_[Math.max(Math.min(11,W),0)]||"Month",q=W=>{const ee=new Date(W.year,W.month-1,W.date).getTime();g.value={selectedDay:ee}},j=()=>{ae();const W=P(x.value);W!==null&&(q(W),g.value={year:W.year,month:W.month-1,monthDetails:O(W.year,W.month-1)})},z=W=>{const ee=new Date(W),le=(ee.getMonth()+1).toString().padStart(2,"0"),de=ee.getDate().toString().padStart(2,"0"),ne=ee.getFullYear();return a.value=`${le}/${de}/${ne}`,`${ne}-${le}-${de}`},K=W=>{g.value={selectedDay:W.timestamp};const ee=z(W.timestamp);Z(!0),r("update:modelValue",ee),L.value&&L.value.blur()},J=W=>{if(n.disableYear)return;const ee=g.value.year+W;let le=g.value.month;s.value.getFullYear()===ee&&s.value.getMonth()>le&&(le=s.value.getMonth()),h.value.getFullYear()===ee&&h.value.getMonth()<le&&(le=h.value.getMonth()),g.value={year:ee,month:le,monthDetails:O(ee,le)}},Y=W=>{if(n.disableMonth)return;let ee=g.value.year,le=g.value.month+W;le===-1?(le=11,ee--):le===12&&(le=0,ee++),g.value={year:ee,month:le,monthDetails:O(ee,le)}},ae=()=>{const W=new Date,ee=W.getFullYear(),le=W.getMonth();g.value={...g.value,year:ee,month:le,selectedDay:o,monthDetails:O(ee,le)}};return(W,ee)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:D,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ee[2]||(ee[2]=le=>f.value=!0),onMouseout:ee[3]||(ee[3]=le=>f.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!k.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!k.value})},"*",2)):e.createCommentVNode("",!0)],10,w6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:$,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":y.value,errorBorder_color:!!k.value,highlight:N.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:Q,onFocusout:ee[1]||(ee[1]=le=>Z(!1)),onClick:X},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:L,"onUpdate:modelValue":ee[0]||(ee[0]=le=>a.value=le),type:"text",autocomplete:"off",placeholder:C.value,"data-test-id":`${t.dataTestId}-input`},null,8,A6),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,N6),k.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(k.value),1)],8,S6)):e.createCommentVNode("",!0)],40,B6),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[y.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(m.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ee[8]||(ee[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!E.value||t.disableYear}]),onClick:ee[4]||(ee[4]=le=>J(-1))},T6,2)],8,V6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!S.value||t.disableMonth}]),onClick:ee[5]||(ee[5]=le=>Y(-1))},M6,2)],8,D6),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(g.value.year),9,R6),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(g.value.month)),9,F6)],8,L6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!T.value||t.disableMonth}]),onClick:ee[6]||(ee[6]=le=>Y(1))},q6,2)],8,P6),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!w.value||t.disableYear}]),onClick:ee[7]||(ee[7]=le=>J(1))},j6,2)],8,$6)],8,O6),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",U6,[e.createElementVNode("div",z6,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,(le,de)=>e.createElementVNode("div",{key:de,class:"cch-name"},e.toDisplayString(le),1)),64))]),e.createElementVNode("div",X6,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.monthDetails,(le,de)=>(e.openBlock(),e.createElementBlock("div",{key:de,class:e.normalizeClass(["c-day-container",{disabled:le.month!==0,highlight:I(le),"highlight-green":R(le)}])},[e.createElementVNode("div",K6,[e.createElementVNode("span",{onClick:ne=>K(le)},e.toDisplayString(le.date),9,Q6)])],2))),128))])])],8,H6)],44,I6)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-975857d5"]]),Z6=t=>(e.pushScopeId("data-v-b4b46e61"),t=t(),e.popScopeId(),t),J6={key:0,class:"custom-form_block"},Y6={class:"custom-form_block-header"},e8={key:0,class:"custom-form_block-content"},t8={key:1,class:"custom-form_block-content"},n8={key:2,class:"custom-form_block-footer"},r8={key:3,class:"custom-form_block-action"},o8={key:1,class:"custom-form_success"},a8={class:"custom-form_success_message"},i8=Z6(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),l8=me({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(t,{expose:l}){var A;const n=Lt(),r=t,o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,c=e.ref({}),u=e.ref(!1),g=e.ref(!1),m=e.ref(!1),p=e.ref({}),d=e.ref(null),_=e.ref(0),s=e.ref({}),h=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.header}),i=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.footer}),f=e.computed(()=>r.fields&&r.fields.action&&r.fields.action.label?r.fields.action:!1),a=e.computed(()=>"en-US");e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.guidance});const x=e.computed(()=>{var k;return(k=r.fields)==null?void 0:k.confirmation}),y=e.computed(()=>r.configuration),v=e.ref(JSON.parse(JSON.stringify((A=r.fields)==null?void 0:A.content))),b=k=>k?"custom-form_block-content_"+k.toLowerCase():"custom-form_block-content_full",C=()=>{m.value=!1,v.value.forEach(k=>{y.value.populate||(c.value[k.field]="")})},E=nt(async function(k,N,D){v.value[D].loading=!0;const L={objectApiName:r.configuration.objectType,lookupFieldApiName:N,searchTerm:k||""},$=await n.getLookupRecords(L);console.log("Records:::",$),v.value[D].options=$,v.value[D].loading=!1}),w=nt(()=>{!f.value&&!r.fields.isGuidance&&S(!0)},500),S=async k=>{console.log("handlerActionClick");let N=!1;if(v.value.forEach(D=>{D.isFormulaField||(D.dataType==="DATETIME"?c.value[D.field]=new Date().toISOString():D.required&&D.editable&&!c.value[D.field]&&D.dataType!=="BOOLEAN"?(D.error=!0,N=!0):(D.error=null,D.dataType==="EMAIL"&&c.value[D.field]&&!o.test(c.value[D.field])&&(D.error="Enter a valid email",N=!0)))}),!N){g.value=!0;const D=[];for(const U in c.value)(s.value[U]||U==="Id")&&D.push({fieldName:U,fieldValue:c.value[U]});const L={fields:D,objectType:r.configuration.objectType};if(r.options&&r.options.returnError){const U=await n.updateRecord(L,!0);if(!U||typeof U=="object"&&U.ERROR)return console.log("Error in saving",U),g.value=!1,U?U.ERROR:!1}else if(!await n.updateRecord(L))return g.value=!1,!1;const $=n.quoteRecord;for(const U in c.value)$[U]=c.value[U];return g.value=!1,k||(m.value=!0),!0}};function T(){u.value=!0,console.log("Quote Records:::",r.quoteId),v.value.forEach(k=>{var N,D,L;if(k.visiblity=k.dataType!=="DATETIME",y.value.populate&&r.quoteId)if(k.dataType==="BOOLEAN")c.value[k.field]=((N=n.quoteRecord)==null?void 0:N[k.field])||!1;else if(k.dataType==="REFERENCE"){const $=k.field.replace("__c","__r"),U=(D=n.quoteRecord)==null?void 0:D[$];U&&(c.value[k.field]=U.Id,k.options=[{Name:U.Name,Id:U.Id}])}else if(k.dataType==="DATE"){const $=k.field.replaceAll("_","").toLowerCase();c.value[k.field]=(L=n.quoteRecord)==null?void 0:L[$]}else c.value[k.field]=Ie(n.quoteRecord,k.field,k.dataType,!0,!0);k.editable&&k.dataType==="PICKLIST"&&(k.options=k.picklist.map($=>({label:$,value:$})))}),u.value=!1}return e.watch(n.quoteRecord,k=>{for(const N in c.value)c.value[N]=k==null?void 0:k[N]}),e.onBeforeMount(async()=>{u.value=!0,p.value=JSON.parse(JSON.stringify(r.fields)),v.value=p.value.content;const k=r.quoteId,N=[];v.value.forEach(D=>{N.push(D.field),s.value[D.field]=D.editable&&!D.isFormulaField,D.size=b(D.size)}),p.value.request=c.value={Id:k},d.value=setInterval(()=>{r.quoteId&&_.value>5&&(T(),clearInterval(d.value)),_.value++},100)}),l({handlerActionClick:S}),(k,N)=>{var D,L,$,U,Q,Z,X;return m.value?(e.openBlock(),e.createElementBlock("div",o8,[e.createElementVNode("div",a8,[i8,e.createTextVNode(" "+e.toDisplayString((X=x.value)==null?void 0:X.label),1)]),x.value&&x.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",J6,[e.createElementVNode("div",Y6,[(D=h.value)!=null&&D.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(L=h.value)==null?void 0:L.title,style:e.normalizeStyle(($=h.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),u.value?(e.openBlock(),e.createElementBlock("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(F,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["custom-form_block-content_skeletion",F.size])},[e.createVNode(st)],2))),128))])):u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",t8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(F,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[F.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",F.size])},[F.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(ft,{key:0,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],options:F.options,disabled:!F.editable,select:"",error:F.error,required:F.required,label:F.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):F.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(fr,{key:1,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],label:F.label},null,8,["modelValue","onUpdate:modelValue","label"])):F.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(ft,{key:2,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],options:F.options,disabled:!F.editable,lookup:"",search:"",error:F.error,required:F.required,label:F.label,loading:F.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:O=>e.unref(E)(O,F.field,B)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):F.dataType==="DATE"?(e.openBlock(),e.createBlock(W6,{key:3,label:F.label,required:F.required,disabled:!F.editable,error:F.error,modelValue:c.value[F.field],"onUpdate:modelValue":O=>c.value[F.field]=O,locale:a.value,highlight:""},null,8,["label","required","disabled","error","modelValue","onUpdate:modelValue","locale"])):F.visiblity?(e.openBlock(),e.createBlock(Ht,{key:4,modelValue:c.value[F.field],"onUpdate:modelValue":[O=>c.value[F.field]=O,e.unref(w)],error:F.error,required:F.required,disabled:!F.editable,label:F.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),i.value?(e.openBlock(),e.createElementBlock("div",n8,[(U=i.value)!=null&&U.title?(e.openBlock(),e.createBlock(ve,{key:0,text:(Q=i.value)==null?void 0:Q.title,style:e.normalizeStyle((Z=i.value)==null?void 0:Z.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",r8,[g.value?(e.openBlock(),e.createBlock($n,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(Ue,{key:1,theme:f.value.style.theme,text:f.value.label,onClick:N[0]||(N[0]=F=>S(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))}}},[["__scopeId","data-v-b4b46e61"]]),s8={class:"custom-button"},c8={key:1,class:"custom-button_spinner"},d8=me({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},isPreview:{type:Boolean,default:!1}},setup(t){const l=Lt(),n=Mt(),r=jt(),o=t,c=e.computed(()=>{var p;return!!((p=n.quoteRecord)!=null&&p.XX_ORD1__Active_Customer_Contact__c)||!0}),u=e.computed(()=>{var p,d;return(d=(p=o.fields)==null?void 0:p.actions)==null?void 0:d.filter(_=>c.value?_.action!=="ACTIVATE":_.action!=="SAVE_FOR_LATER")}),g=async p=>{o.isPreview||(p.spinner=!0,p.action==="CHECKOUT"||(p.action==="SAVE_FOR_LATER"?await l.startNewCart():p.action==="ACTIVATE"&&await l.makeActiveCart()),p.spinner=!1,m(p.targetTemplateId))};function m(p){p&&r.push({path:"/",query:Object.assign({pageId:p})})}return(p,d)=>(e.openBlock(),e.createElementBlock("div",s8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[_.spinner?(e.openBlock(),e.createElementBlock("div",c8,[e.createVNode($n)])):(e.openBlock(),e.createBlock(Go,{key:0,theme:_.style.theme,text:_.label,disabled:t.isPreview,onClick:h=>g(_)},null,8,["theme","text","disabled","onClick"]))],64))),128))]))}},[["__scopeId","data-v-6f38ab38"]]),Wo=function(t,l){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:r}=t;n.visibility=r;const{layout:o}=t;if(n.blockStyle=u8(o,l),o&&(o!=null&&o.padding)){const{top:g,bottom:m,left:p,right:d}=o.padding;g&&(n.sectionStyle.paddingTop=`${g}px`),m&&(n.sectionStyle.paddingBottom=`${m}px`),p&&(n.sectionStyle.paddingLeft=`${p}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}o!=null&&o.gap&&(n.sectionStyle.gap=`${o.gap}px`);const{styling:c}=t;c&&(c.verticalAlignment&&(n.sectionStyle.alignItems=c.verticalAlignment),c.radius&&(n.sectionStyle.borderRadius=c.radius),c.borderStyle&&(n.sectionStyle.borderStyle=c.borderStyle));const{Background:u}=t;return u&&u.style==="Solid"&&(n.sectionStyle.backgroundColor=u.color),u&&u.opacity==="100%"&&(n.sectionStyle.opacity=1),u&&u.image&&u.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${u.image})`,u.imageSize&&(n.sectionStyle.backgroundSize=u.imageSize)),u&&u.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=u.repeat),u&&(u.horizontalAlignment||u.verticalAlignment)&&(n.sectionStyle.backgroundPosition=u.horizontalAlignment+" "+u.verticalAlignment),n};function u8(t,l){if(!t)return[{}];const{columnSize:n,columns:r}=t;if(l)return Array(r).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(r).fill({});const o=n.split("/");return typeof r=="string"&&o.length!==parseInt(r)?Array(r).fill({}):typeof r=="number"&&o.length!==r?Array(r).fill({}):o.map(c=>({flexBasis:`${c}`}))}const f8=["data-sid","data-sname"],h8=["data-bid","data-bname"],p8=["page-block-id"],m8=["page-block-id"],y8=["page-block-id"],g8=["page-block-id"],x8=["page-block-id"],_8=["page-block-id"],as={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:l}){const n=t,r=qo(),o=Lt(),c=Ko(),u=e.computed(()=>r.pageBlocks||[]),g=e.ref(0);l({refreshTemplate:()=>{g.value+=1}});const p=_=>!0,d=e.computed(()=>{var s,h,i,f;const _=[];return console.log("props.sections template renderer",u.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((s=u.value)!=null&&s.content)?(i=(h=u.value)==null?void 0:h.content)==null||i.forEach(a=>{const x=[],y=a.section,v=JSON.parse(y.XX_ORD1__Content_JSON__c);let b={};v&&(b=Wo(v,c.isMobile),y.styleObject=y.hideStyle?{}:b.sectionStyle,y.visibility=b.visibility),a.blocks.forEach(C=>{let E=C.XX_ORD1__Content_Block__r;const w=JSON.parse(E.XX_ORD1__Content_JSON__c);E={...E,...w};let S={};w&&(S=Wo(w,c.isMobile),E.styleObject=E.hideStyle?{}:S.blockStyle),x.push(E)}),y.blocks=x,_.push(y)}):(f=u.value)==null||f.forEach(a=>{var b;const x={...a},y=typeof a.contentJSON=="string"?JSON.parse(a.contentJSON):a.contentJSON;let v={};y&&(v=Wo(y,c.isMobile),x.styleObject=a.hideStyle?{}:v.sectionStyle,x.visibility=v.visibility,(b=x.blocks)==null||b.forEach((C,E)=>{C.styleObject=v.blockStyle[E]})),_.push(x)}),_});return(_,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Fa),(e.openBlock(),e.createElementBlock("div",{key:g.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.id},[p(h.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(h.styleObject),class:"ect-flex ect-flex-col md:ect-flex-row","data-sid":h.sectionId,"data-sname":h.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.blocks,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,style:e.normalizeStyle(i.styleObject),class:"ect-w-full","data-bid":i.blockId,"data-bname":i.blockName},[i.componentName==="productList"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":i.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(t6,{id:i.Id,header:i.fields.header,columns:i.fields.columns,footer:i.fields.footer,fields:i.fields,configuration:i.configuration,"is-preview":t.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,p8)):i.componentName==="quoteSummary"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":i.Id,class:""},[e.createVNode(p6,{id:i.Id,configuration:i.configuration,fields:i.fields,"quote-id":e.unref(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,m8)):i.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":i.Id,class:""},[e.createVNode(C6,{id:i.Id,fields:i.fields,configuration:i.configuration,"is-preview":t.isPreview},null,8,["id","fields","configuration","is-preview"])],8,y8)):i.componentName==="customForm"&&e.unref(o).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":i.Id,class:"ect-w-full"},[e.createVNode(l8,{id:i.Id,configuration:i.configuration,fields:i.fields,"quote-id":e.unref(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,g8)):i.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":i.Id,class:""},[e.createVNode(d8,{id:i.Id,configuration:i.configuration,fields:i.fields,"is-preview":t.isPreview},null,8,["id","configuration","fields","is-preview"])],8,x8)):i.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":i.Id,class:""},[e.createVNode(Zm,{id:i.Id,mode:"preview",configuration:i.configuration,fields:i.fields,"search-term":i.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview"])],8,_8)):e.createCommentVNode("",!0)],12,h8))),128))],12,f8)):e.createCommentVNode("",!0)],64))),128))]))],64))}},b8=t=>(e.pushScopeId("data-v-afae9e98"),t=t(),e.popScopeId(),t),v8={class:"ect-composable-catalog-wrapper"},C8={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]"},E8=[b8(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],Zo=me({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},organizationId:{type:String,required:!0},quoteId:{type:String,default:null},userId:{type:String,required:!0},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},accountId:{type:String,required:!1},cid:{type:String,required:!1},composablesApiUrl:{type:String,required:!1},composablesApiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1}},setup(t){const l=lt(),n=t,r=e.ref(!1),o=e.ref(!1),c=()=>{r.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{l.updateConfig({templateId:n.templateId,organizationId:n.organizationId,hostName:n.hostName,graphqlEndpoint:n.graphqlEndpoint,apiKey:n.apiKey,accountId:n.accountId,cid:n.cid,composablesApiUrl:n.composablesApiUrl,composablesApiKey:n.composablesApiKey,composablesOrgType:n.composablesOrgType,isPreview:n.isPreview,quoteId:n.quoteId,userId:n.userId}),l.quoteId=n.quoteId,console.log("props.sections expedite catalog",n.sections),await l.processSections(n.isPreview,n.sections)}),e.onMounted(async()=>{window.addEventListener("resize",c),c()}),(u,g)=>(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(zl,{"organization-id":n.organizationId,"template-id":n.templateId,"is-preview":n.isPreview,theme:n.theme},null,8,["organization-id","template-id","is-preview","theme"]),o.value?(e.openBlock(),e.createElementBlock("div",C8,E8)):(e.openBlock(),e.createBlock(as,{key:1,ref:"templateRendererRef","is-preview":n.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["is-preview","on-catalog-count-update","initial-catalog-items"]))]))}},[["__scopeId","data-v-afae9e98"]]),Jo={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},organizationId:{type:String,required:!0},accountId:{type:String,required:!0},cid:{type:String,required:!1},userId:{type:String,required:!1},quoteId:{type:String,required:!1},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesApiUrl:{type:String,required:!1},composablesApiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1}},setup(t){const l=lt(),n=Lt(),r=e.ref(null),o=t;return e.onBeforeMount(async()=>{l.updateConfig({templateId:o.templateId,organizationId:o.organizationId,hostName:o.hostName,graphqlEndpoint:o.graphqlEndpoint,apiKey:o.apiKey,accountId:o.accountId,cid:o.cid,userId:o.userId,composablesApiUrl:o.composablesApiUrl,composablesApiKey:o.composablesApiKey,composablesOrgType:o.composablesOrgType,isPreview:o.isPreview}),n.quoteId=o.quoteId,console.log("props.sections expedite cart",o.sections),await l.processSections(o.isPreview,o.sections)}),e.watch(()=>o.sections,async(c,u)=>{c!==u&&(await l.processSections(o.isPreview,c),r.value&&r.value.refreshTemplate&&r.value.refreshTemplate())},{deep:!0}),(c,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(zl,{"organization-id":o.organizationId,"template-id":o.templateId,"is-preview":o.isPreview,theme:o.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(as,{ref_key:"templateRendererRef",ref:r,"is-preview":o.isPreview},null,8,["is-preview"])],64))}},is={ExpediteConfigurator:Yr,ExpediteGPT:eo,ExpediteCatalog:Zo,ExpediteCart:Jo},k8={install(t,l={}){t.component("ExpediteConfigurator",Yr),t.component("ExpediteGPT",eo),t.component("ExpediteCatalog",Zo),t.component("ExpediteCart",Jo)},...is};Xe.Components=is,Xe.ExpediteCart=Jo,Xe.ExpediteCatalog=Zo,Xe.ExpediteConfigurator=Yr,Xe.ExpediteGPT=eo,Xe.default=k8,Xe.useComRootStore=xn,Object.defineProperties(Xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|