1var DriEnhancedEcommerceLib=function(e){var t={};function i(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(o,r,function(t){return e[t]}.bind(null,r));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnhancedEcommerceLib=void 0,window.dataLayer=window.dataLayer||[];var o=function(){function e(){this.templateIds=[],this.getProductVariantByDisplaySpecs=function(e,t){var i="";if(void 0===e&&(e=null),void 0===t&&(t=[]),e)for(var o in e){var r=e[o],a=void 0!==r.attr_id?r.attr_id:r.attribute_id,n=void 0!==r.attr_name?r.attr_name:r.attribute_name,d=r.attr_value;-1!=t.indexOf(a)&&(i+=(i?"":"|")+n+":"+d+"|")}return i}}return Object.defineProperty(e.prototype,"setConfig",{set:function(e){this.config=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getConfig",{get:function(){return this.config},enumerable:!1,configurable:!0}),e.prototype.pushProductClick=function(e,t){void 0===e.list?void 0===t&&(t="Category page"):t=e.list;var i=parseFloat(e.price).toFixed(6);e.id&&window.dataLayer.push({event:"ProductClick",ecommerce:{currencyCode:"USD",click:{actionField:{list:t},products:[{id:e.id,name:e.name,price:i,brand:e.brand,category:e.category,position:e.position}]}}})},e.prototype.pushProductDetailImpression=function(e){var t=parseFloat(e.price).toFixed(6),i={event:"EEProductDetail",ecommerce:{currencyCode:"USD",detail:{products:[{id:e.id,name:e.name,brand:e.brand,category:e.category,variant:e.variant,price:t,quantity:e.quantity}]}}};void 0!==this.getConfig&&void 0!==this.getConfig.enhanced_ecommerce&&void 0!==this.getConfig.enhanced_ecommerce.enabled_template_id&&void 0!==this.getConfig.cloudlab&&void 0!==this.getConfig.cloudlab.template_id&&this.getConfig.enhanced_ecommerce.enabled_template_id&&(i.template_id=[this.getConfig.cloudlab.template_id],i.ecommerce.detail.products[0].brand=this.getConfig.cloudlab.template_id,i.ecommerce.detail.products[0].dimension7=this.getConfig.cloudlab.template_id),window.dataLayer.push(i)},e.prototype.setProductTemplateImpression=function(e,t){var i=[],o=[];if(t.length>0){var r=1;t.forEach((function(t){t.forEach((function(t){-1==o.indexOf(t.id)&&(i.push({id:e.id,name:t.name,brand:t.brand,list:t.list+" Page Results",category:e.category,position:r,dimension7:t.brand}),r++)}))}))}i.length>0&&this.pushProductImpressions(i)},e.prototype.setTemplatePageImpression=function(e,t){var i=[],o=1;e.forEach((function(e){i.push({id:e.product_id?e.product_id:e.default_product_id,name:e.template_name,brand:e.template_id,list:"Search Results",category:t.url_path,position:o,dimension7:e.template_id}),o++})),i.length>0&&this.pushProductImpressions(i)},e.prototype.pushProductImpressions=function(e){e.length>0&&window.dataLayer.push({event:"EEProductImpressions",ecommerce:{currencyCode:"USD",impressions:e}})},e.prototype.pushAddToCart=function(e){var t=parseFloat(e.price).toFixed(6);window.dataLayer.push({event:"EEaddToCart",ecommerce:{currencyCode:"USD",add:{products:[{id:e.id,name:e.name,brand:e.brand,category:e.category,variant:e.variant,price:t,quantity:e.quantity}]}}})},e.prototype.pushRemoveFromCart=function(e){var t=parseFloat(e.price).toFixed(6);window.dataLayer.push({event:"EEremoveToCart",ecommerce:{currencyCode:"USD",remove:{products:[{id:e.id,name:e.name,brand:e.brand,category:e.category||e.name,variant:e.variant,price:t,quantity:e.quantity}]}}})},e.prototype.setTemplateIds=function(e){for(var t in this.templateIds=[],e){var i=e[t],o=null;"object"==typeof i.ext_other_details&&null!=i.ext_other_details&&void 0!==i.ext_other_details.template_id&&(o=i.ext_other_details.template_id),this.templateIds.push(o)}},e.prototype.pushCheckout=function(e,t,i,o){void 0===o&&(o=!1),void 0===i&&(i=[]);var r={},a={checkout:{actionField:{step:e,action:"checkout",option:t},num_items:i.length,products:[]}};r.event="EEcheckout",this.templateIds.length&&(r.template_id=JSON.parse(JSON.stringify(this.templateIds)),this.templateIds=[]),r.ecommerce=a,o&&(r.ecommerce.checkout.paid_design_services_only_flag="y"),i.length>0?r.ecommerce.checkout.products=i:(delete r.ecommerce.checkout.num_items,delete r.ecommerce.checkout.products),window.dataLayer.push(r)},e.prototype.pushTransaction=function(e,t,i,o,r,a,n,d,c,s,p){void 0===d&&(d=""),void 0===c&&(c=""),void 0===s&&(s="n"),void 0===p&&(p="EEtransaction");var u={event:p,ecommerce:{purchase:{actionField:{id:e,affiliation:"Online Store",revenue:r,tax:n,shipping:a,c
1oupon:c,action:"purchase"},products:o}},customerId:t,adm:d,customerType:i,non_converting_order:s};void 0!==this.getConfig&&void 0!==this.getConfig.enabled_template_id&&this.getConfig.enabled_template_id&&(u.template_id=this.templateIds),"PaidDesignServices"==p&&(u.leadID=e,delete u.customerType),window.dataLayer.push(u)},e.prototype.pushData=function(e){window.dataLayer.push(e)},e.prototype.pushLogData=function(e){window.dataLayer.push({event:e.event,label:e.label,log:e.logMessage,time:e.time})},e.prototype.getProductVariantByOrderSpecs=function(e,t){var i="";if(void 0===e&&(e=null),void 0===t&&(t=[]),e)for(var o in e){var r=e[o],a=void 0!==r.spec_code?r.spec_code:r.order_spec_code,n=void 0!==r.spec?r.spec:r.order_spec,d=void 0!==r.value?r.value:r.order_spec_value;-1!=t.indexOf(a)&&(i+=(i?"":"|")+n+":"+d+"|")}return i},e.prototype.getCategory=function(e,t){var i="";if(e||(e=[]),e.length>0){for(var o in e){var r=e[o];for(var a in r)"Home"!==r[a]&&"breadcrumb"==a&&(i+=r[a].replace(/^\s+|\s+$/gm,"")+"/")}i=i.replace(/\/$/,"")}else{var n=localStorage.getItem("ecommerce");if(null!=n){var d=JSON.parse(n);null!=d&&void 0!==d[t]&&(i=d[t])}}return i},e.prototype.storeCategory=function(e,t){var i=localStorage.getItem("ecommerce");if(null!=i){var o=JSON.parse(i);o||(o={}),o[t]=e,localStorage.setItem("ecommerce",JSON.stringify(o))}},e.prototype.getEcommerceProductData=function(e,t,i,o,r,a,n,d){var c=this.getCategory(a,r);void 0===t&&(t=""),void 0===n&&(n=e.page_title||""),void 0===d&&(d="display_specs"),t&&(t="|Type:"+t);var s=void 0!==e.product_specs&&void 0!==e.product_specs.order_specs?e.product_specs.order_specs:e.order_specs,p=void 0!==e.product_specs&&void 0!==e.product_specs.display_specs?e.product_specs.display_specs:e.display_specs,u="order_specs"==d?this.getProductVariantByOrderSpecs(s,i):this.getProductVariantByDisplaySpecs(p,i),l=parseFloat(e.unit_price).toFixed(6),m={id:e.product_id,name:e.item_name,price:l,quantity:e.qty,brand:o&&e.item_name?o+" "+e.item_name:"",variant:t+u,category:c||n||e.item_name,position:"",ecomm_prodid:e.product_specs?e.product_specs.item_data.page_id:"",ecomm_pagetype:"Product",ecomm_category:c||n||e.item_name};return void 0!==this.getConfig&&void 0!==this.getConfig.enabled_template_id&&this.getConfig.enabled_template_id&&(m.brand="object"==typeof e.ext_other_details&&null!=e.ext_other_details&&void 0!==e.ext_other_details.template_id?e.ext_other_details.template_id:null,m.dimension7=m.brand),e.position&&m?m.position=e.position:delete m.position,m},e.prototype.getOrderData=function(e){var t=["MSP","MS"],i="",o=!1,r=0;if(e.items.length>0)for(var a in e.items){if("ul"==e.items[a].tx_type&&(o=!0),void 0!==e.items[a].child_items&&e.items[a].child_items.length>0)for(var n in e.items[a].child_items)t.indexOf(e.items[a].child_items[n].account_type_code)>=0&&(r+=parseFloat(e.items[a].child_items[n].price));if(void 0!==e.items[a].discount_data&&null!=e.items[a].discount_data&&void 0!==e.items[a].discount_data.applied_discount_data&&null!=e.items[a].discount_data.applied_discount_data){var d=e.items[a].discount_data.applied_discount_data;if(void 0!==d.coupon)if(void 0!==d.coupon.product)for(var c in d.coupon.product){i=c;break}else if(void 0!==d.coupon.shipping)for(var s in d.coupon.shipping){i=s;break}}}var p=parseFloat(e.sub_total)-r-parseFloat(e.discount)+parseFloat(e.shipping_total);return{customerId:e.customer_id,customerType:e.customer.customer_type,revenue:p.toFixed(2),shipping:parseFloat(e.shipping_total).toFixed(2),tax:parseFloat(e.tax).toFixed(2),coupon:i,uploadLater:o,testFlag:"y"==e.customer.test_flag?1:0}},e.prototype.getOrderShippingAddress=function(e){var t=null;if(e.items.length>0)for(var i in e.items){var o=e.items[i];if(o.shipping_info.shipping)for(var r in o.shipping_info.shipping){var a=o.shipping_info.shipping[r];null!=a.transit_time&&(t?Number(a.transit_time)>Number(t.transit_time)&&(t=a):t=a)}}return t},e.prototype.getProductData=function(e,t){var i=[],o=1;if(t)for(var r in t){var a=t[r];a.unit_price=a.price/a.qty,a.position=o;var n=this.getEcommerceProductData(a,this.getItemVariantType(a),["SZ","SHAPE","DIECUT","FOLD","PPR","SUBST"],e,a.page_id?a.page_id:0,a.product_specs.item_data.breadcrumbs?a.product_specs.item_data.breadcrumbs:null,a.product_specs.item_data.page_title?a.product_specs.item_datapage_title:null,"order_specs");i.push(n),o++}return i}
1,e.prototype.getItemVariantType=function(e){var t;switch(e.tx_type){case"j":t="Upload";break;case"dt":case"e":t="Design";break;case"ul":t=9!==e.job_item_status_id?"Upload Later":"Upload";break;case"ro":t="Reorder";break;default:t=""}return t},e.prototype.dataLayerPush=function(e){e&&window.dataLayer.push(e)},e}();t.EnhancedEcommerceLib=o}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.