vendor: 4,998 bytes, lines 1-2
1/*! For license information please see product-form.min.js.LICENSE.txt */ 2(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach(function(e){n(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function n(t,e,r){return(e=s(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",c=r.toStringTag||"@@toStringTag";function a(r,n,o,c){var a=n&&n.prototype instanceof s?n:s,l=Object.create(a.prototype);return i(l,"_invoke",function(r,n,o){var i,c,a,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,c=0,a=t,p.n=r,u}};function d(r,n){for(c=r,a=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,y=i[2];r>3?(o=y===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,p.n=y,c=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),c=l,a=y;(e=c<2?t:a)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,a)):p.n=a:p.v=a);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(e){i=t,c=1,a=e}finally{s=1}}return{value:e,done:f}}}(r,o,c),!0),l}var u={};function s(){}function l(){}function f(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(i(e={},n,function(){return this}),e),d=f.prototype=s.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,i(t,c,"GeneratorFunction")),t.prototype=Object.create(d),t}return l.prototype=f,i(d,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,c,"GeneratorFunction"),i(d),i(d,c,"Generator"),i(d,n,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:y}})()}function i(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}i=function(t,e,r,n){function c(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(c("next",0),c("throw",1),c("return",2))},i(t,e,r,n)}function c(t,e,r,n,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)})}}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}function l(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}function f(t){var e="function"==typeof Map?new Map:void 0;return f=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(p())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&d(o,r.prototype),o}(t,arguments,y(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,t)},f(t)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}
2function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}customElements.get("product-form")||customElements.define("product-form",function(t){function e(){var t,r,n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,n=y(n=e),(t=l(r,p()?Reflect.construct(n,o||[],y(r).constructor):n.apply(r,o))).form=t.querySelector("form"),!t.form)return l(t);if(t.form.querySelector("[name=id]").disabled=!1,t.buttons=t.querySelectorAll(".product-form__buttons button"),t.buttons.forEach(function(e){e.addEventListener("click",t.onSubmitHandler.bind(t,e))}),t.isSubscriptionForm=t.hasAttribute("data-subscription-form"),t.cart=document.getElementById("cart-wrapper"),t.hasAttribute("product-info-dropdown")){var i=t.getElementsByClassName("dropdown-info-container")[0],c=t.querySelector("[data-caret]");t.children[0].addEventListener("click",function(e){e.target.classList.contains("prevent-dropdown")||t.renderProductDropDown(i,c)})}return t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,t),n=e,i=[{key:"renderProductDropDown",value:(f=a(o().m(function t(e,r){var n,i,c,a=this;return o().w(function(t){for(;;)switch(t.p=t.n){case 0:if(i=r,!(n=e).hasAttribute("fetched")){t.n=1;break}n.style.maxHeight?(i.classList.add("rotate-180"),n.style.maxHeight=null):(i.classList.remove("rotate-180"),n.style.maxHeight=n.scrollHeight+"px"),t.n=4;break;case 1:return t.p=1,i.classList.remove("rotate-180"),n.style.maxHeight="200px",t.n=2,fetch("/products/".concat(this.getAttribute("product-handle"),"?sections=b2b-product-dropdown-info")).then(function(t){return t.json()}).then(function(t){a.getElementsByClassName("dropdown-info-container")[0].innerHTML=t["b2b-product-dropdown-info"]});case 2:t.v,n.style.maxHeight=n.scrollHeight+"px",n.setAttribute("fetched",""),t.n=4;break;case 3:t.p=3,c=t.v,console.error("Error fetching or rendering section:",c);case 4:return t.a(2)}},t,this,[[1,3]])})),function(t,e){return f.apply(this,arguments)})},{key:"onSubmitHandler",value:(s=a(o().m(function t(e,n){var i,c,a,u=this;return o().w(function(t){for(;;)switch(t.n){case 0:if(n.preventDefault(),i=e,this.handleErrorMessage(),i.setAttribute("aria-disabled",!0),i.classList.add("loading"),(c=fetchConfig("javascript")).headers["X-Requested-With"]="XMLHttpRequest",delete c.headers["Content-Type"],a=new FormData(this.form),c.body=a,!this.isSubscriptionForm){t.n=1;break}return t.n=1,fetch("/cart/clear",r(r({},fetchConfig()),{method:"POST"}));case 1:fetch("".concat(routes.cart_add_url),c).then(function(t){return t.json()}).then(function(t){t.status?u.handleErrorMessage(t.description):window.location.href.includes("checkouts")||"true"===u.dataset.reload?window.location.reload():(u.cart.renderCart(!0),u.pushToKlaviyo(t),dataLayer.push({event:"add_to_cart",ecommerce:{currency:window.Shopify.currency.active,value:t.final_line_price/100,items:[{item_id:t.url.split("?")[0]}]}}),i.hasAttribute("data-direct-checkout")&&(window.location.href="/checkout"))}).catch(function(t){console.error(t)}).finally(function(){i.classList.remove("loading"),i.removeAttribute("aria-disabled")});case 2:return t.a(2)}},t,this)})),function(t,e){return s.apply(this,arguments)})},{key:"pushToKlaviyo",value:function(t){var e={title:t.title,category:t.product_type,handle:t.handle,id:t.product_id,url:"https://densidsteflaske.dk".concat(t.url),original_total_price:t.original_total_price,total_discount:t.total_discount/100,total_price:t.final_line_price/100,$value:t.final_line_price/100,image:t.image,quantity:t.quantity};_learnq.push(["track","Added to Cart",e]),fetch("".concat(window.location.origin,"/cart.js")).then(function(t){return t.clone().json().then(function(t){var r={total_price:t.total_price/100,$value:t.total_price/100,total_discount:t.total_discount,original_total_price:t.original_total_price/100,items:t.items};r=Object.assign(r,e),_learnq.push(["track","Added to Cart",r])})})}},{key:"handleErrorMessage",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];console.log(e),this.errorMessageWrapper=this.errorMessageWrapper||this.querySelector(".product-form__error-message-wrapper"),this.errorMessageWrapper&&(this.errorMessage=this.errorMessage||this.errorMessageWrapper.querySelector(".product-form__error-message"),this.errorMessageWrapper.toggleAttribute("hidden",!e),setTimeout(function(){t.errorMessageWrapper.setAttribute("hidden","")},4e3),e&&(this.errorMessage.textContent=e))}}
2],i&&u(n.prototype,i),c&&u(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,c,s,f}(f(HTMLElement)))})();
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.