JSFiddle - React, Tailwind, and code Playground

by Tech Savant

JavaScript

function floatToString(t, e) {
    var o = t.toFixed(e).toString();
    return o.match(/^\.\d+/) ? "0" + o : o
}
if ("undefined" == typeof Shopify) var Shopify = {};
Shopify.each = function(t, e) {
    for (var o = 0; o < t.length; o++) e(t[o], o)
}, Shopify.map = function(t, e) {
    for (var o = [], i = 0; i < t.length; i++) o.push(e(t[i], i));
    return o
}, Shopify.arrayIncludes = function(t, e) {
    for (var o = 0; o < t.length; o++)
        if (t[o] == e) return !0;
    return !1
}, Shopify.uniq = function(t) {
    for (var e = [], o = 0; o < t.length; o++) Shopify.arrayIncludes(e, t[o]) || e.push(t[o]);
    return e
}, Shopify.isDefined = function(t) {
    return "undefined" == typeof t ? !1 : !0
}, Shopify.getClass = function(t) {
    return Object.prototype.toString.call(t).slice(8, -1)
}, Shopify.extend = function(t, e) {
    function o() {}
    o.prototype = e.prototype, t.prototype = new o, t.prototype.constructor = t, t.baseConstructor = e, t.superClass = e.prototype
}, Shopify.urlParam = function(t) {
    var e = RegExp("[?&]" + t + "=([^&]*)").exec(window.location.search);
    return e && decodeURIComponent(e[1].replace(/\+/g, " "))
}, Shopify.Product = function(t) {
    Shopify.isDefined(t) && this.update(t)
}, Shopify.Product.prototype.update = function(t) {
    for (property in t) this[property] = t[property]
}, Shopify.Product.prototype.optionNames = function() {
    return "Array" == Shopify.getClass(this.options) ? this.options : []
}, Shopify.Product.prototype.optionValues = function(t) {
    if (!Shopify.isDefined(this.variants)) return null;
    var e = Shopify.map(this.variants, function(e) {
        var o = "option" + (t + 1);
        return void 0 == e[o] ? null : e[o]
    });
    return null == e[0] ? null : Shopify.uniq(e)
}, Shopify.Product.prototype.getVariant = function(t) {
    var e = null;
    return t.length != this.options.length ? e : (Shopify.each(this.variants, function(o) {
        for (var i = !0, r = 0; r < t.length;...