{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/mustache/mustache.js","webpack:///./app/javascript/packs/pages/delivery_select.js","webpack:///./app/javascript/packs/delivery_page.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","factory","_typeof","iterator","obj","constructor","objectToString","toString","isArray","Array","isFunction","escapeRegExp","string","replace","hasProperty","propName","regExpTest","RegExp","test","nonSpaceRe","isWhitespace","re","testRegExp","entityMap","whiteRe","spaceRe","equalsRe","curlyRe","tagRe","Scanner","this","tail","pos","Context","view","parentContext","cache","parent","Writer","templateCache","_cache","set","clear","eos","scan","match","index","substring","length","scanUntil","search","push","lookup","primitive","intermediateValue","names","context","lookupHit","indexOf","split","clearCache","parse","template","tags","cacheKey","mustache","join","isCacheEnabled","tokens","undefined","openingTagRe","closingTagRe","closingCurlyRe","lineHasNonSpace","sections","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","pop","compileTags","tagsToCompile","Error","start","type","chr","token","openSection","scanner","valueLength","charAt","nestedTokens","collector","numTokens","nestTokens","lastToken","squashedTokens","squashTokens","parseTemplate","render","partials","config","getConfigTags","renderTokens","originalTemplate","symbol","buffer","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","self","j","slice","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","escape","getConfigEscape","String","version","defaultWriter","TypeError","wrapper","document","body","querySelector","countries","fetchDataObject","postages","topCountryIso","dataset","locale","initializeCustomSelect","initializeCountriesList","event","val","target","setCountryPostageInfo","countryId","querySelectorAll","forEach","e","remove","country","find","id","parseInt","infoTpl","findTemplate","listTpl","list","htmlToElement","postage_ids","map","convertedTpl","postageMapperparams","node_element","append","insertAdjacentHTML","outerHTML","selectEl","createSelectElement","assignOptionsToSelect","selectedIndex","addEventListener","selectOnChange","selectWrapperEl","createSelectWrapper","insertAdjacentElement","options","el","createElement","classList","appendChild","select","countriesData","option_c","sort","x","y","iso","option","cloneNode","text","elementTpl","baseTpl","postageId","_postageIndex","country_postage","console","log","newTpl","replaceAll","params","lead_time_is_next_day","lead_time","lead_days_equal_one","POSTAGE_COUNTRY_NAME","POSTAGE_NAME","POSTAGE_LEAD_TIME","POSTAGE_PRICE","price","ROYAL_MAIL_UK","brand","FEDEX_UK","iso_is_gb","Mustache","html","innerHTML","content","firstChild","data","JSON","keys","DeliverySelect"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,C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yG,SAAL,UAAiB0D,IACzCG,QAAQC,IAAI/C,GACZ8C,QAAQC,IAAIF,GACZ,IAAIG,EAASN,EAAQO,WAAW,WAAY,yBACtCC,EAAS,CACbC,sBACiB,MAAf3K,KAAK4G,QAA+C,GAA7ByD,EAAgBO,UAEzCC,sBAAqBR,EAAgBO,UAAY,GAEjDE,qBAAsBtD,EAAQ9K,KAC9BqO,aAAcV,EAAgB3N,KAC9BsO,kBAAmBX,EAAgBO,UACnCK,cAAeZ,EAAgBa,MAC/BC,cAA8B,MAAf3D,EAAQqC,KAAwC,cAAzBQ,EAAgBe,MACtDC,SAAyB,MAAf7D,EAAQqC,KAAwC,SAAzBQ,EAAgBe,MACjDE,UAA0B,MAAf9D,EAAQqC,KAErB,OAAO0B,IAAShH,OAAOiG,EAAQE,K,2BAGjC,SAAcc,GACZ,IAAMrC,EAAK/C,SAASgD,cAAc,YAElC,OADAD,EAAGsC,UAAYD,EACRrC,EAAGuC,QAAQC,a,0BAGpB,SAAajP,GACX,IACE,OAAOsD,KAAKmG,QAAQG,cAAb,kCAAsD5J,EAAtD,OACJ+O,UACH,SACA,U,6BAIJ,SAAgB/O,GACd,IACE,IAAMkP,EAAOC,KAAK9J,MAAM/B,KAAKmG,QAAQQ,QAAb,UAAwBjK,KAChD,OAAoC,IAA7BG,OAAOiP,KAAKF,GAAM1K,OAAe,KAAO0K,EAC/C,SACA,OAAO,W,oHC5Jb,mBAEAxF,SAASyC,iBAAiB,oBAAoB,WAC5C,IAAIkD","file":"js/delivery_page-eb1f0f962fa52ea88dfd.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 46);\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n(function (global, factory) {\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.Mustache = factory());\n})(this, function () {\n 'use strict';\n /*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n var objectToString = Object.prototype.toString;\n\n var isArray = Array.isArray || function isArrayPolyfill(object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction(object) {\n return typeof object === 'function';\n }\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n\n\n function typeStr(obj) {\n return isArray(obj) ? 'array' : _typeof(obj);\n }\n\n function escapeRegExp(string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n\n\n function hasProperty(obj, propName) {\n return obj != null && _typeof(obj) === 'object' && propName in obj;\n }\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n\n\n function primitiveHasOwnProperty(primitive, propName) {\n return primitive != null && _typeof(primitive) !== 'object' && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);\n } // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n\n\n var regExpTest = RegExp.prototype.test;\n\n function testRegExp(re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n\n function isWhitespace(string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml(string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap(s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n /**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n\n function parseTemplate(template, tags) {\n if (!template) return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n\n var tokens = []; // Buffer to hold the tokens\n\n var spaces = []; // Indices of whitespace tokens on the current line\n\n var hasTag = false; // Is there a {{tag}} on the current line?\n\n var nonSpace = false; // Is there a non-space char on the current line?\n\n var indentation = ''; // Tracks indentation for tags that use it\n\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n\n function stripSpace() {\n if (hasTag && !nonSpace) {\n while (spaces.length) {\n delete tokens[spaces.pop()];\n }\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n\n function compileTags(tagsToCompile) {\n if (typeof tagsToCompile === 'string') tagsToCompile = tagsToCompile.split(spaceRe, 2);\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) throw new Error('Invalid tags: ' + tagsToCompile);\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n var scanner = new Scanner(template);\n var start, type, value, chr, token, openSection;\n\n while (!scanner.eos()) {\n start = scanner.pos; // Match any text between tags.\n\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push(['text', chr, start, start + 1]);\n start += 1; // Check for whitespace on the current line.\n\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n } // Match the opening tag.\n\n\n if (!scanner.scan(openingTagRe)) break;\n hasTag = true; // Get the tag type.\n\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe); // Get the tag value.\n\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n } // Match the closing tag.\n\n\n if (!scanner.scan(closingTagRe)) throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];\n } else {\n token = [type, value, start, scanner.pos];\n }\n\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n if (!openSection) throw new Error('Unopened section \"' + value + '\" at ' + start);\n if (openSection[1] !== value) throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace(); // Make sure there are no open sections when we're done.\n\n openSection = sections.pop();\n if (openSection) throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n return nestTokens(squashTokens(tokens));\n }\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n\n\n function squashTokens(tokens) {\n var squashedTokens = [];\n var token, lastToken;\n\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n\n\n function nestTokens(tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n var token, section;\n\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n\n\n function Scanner(string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n\n\n Scanner.prototype.eos = function eos() {\n return this.tail === '';\n };\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n\n\n Scanner.prototype.scan = function scan(re) {\n var match = this.tail.match(re);\n if (!match || match.index !== 0) return '';\n var string = match[0];\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n return string;\n };\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n\n\n Scanner.prototype.scanUntil = function scanUntil(re) {\n var index = this.tail.search(re),\n match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n\n case 0:\n match = '';\n break;\n\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n return match;\n };\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n\n\n function Context(view, parentContext) {\n this.view = view;\n this.cache = {\n '.': this.view\n };\n this.parent = parentContext;\n }\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n\n\n Context.prototype.push = function push(view) {\n return new Context(view, this);\n };\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n\n\n Context.prototype.lookup = function lookup(name) {\n var cache = this.cache;\n var value;\n\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this,\n intermediateValue,\n names,\n index,\n lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1) lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value)) value = value.call(this.view);\n return value;\n };\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n\n\n function Writer() {\n this.templateCache = {\n _cache: {},\n set: function set(key, value) {\n this._cache[key] = value;\n },\n get: function get(key) {\n return this._cache[key];\n },\n clear: function clear() {\n this._cache = {};\n }\n };\n }\n /**\n * Clears all cached templates in this writer.\n */\n\n\n Writer.prototype.clearCache = function clearCache() {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n };\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n\n\n Writer.prototype.parse = function parse(template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n\n return tokens;\n };\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `config` argument is given here, then it should be an\n * object with a `tags` attribute or an `escape` attribute or both.\n * If an array is passed, then it will be interpreted the same way as\n * a `tags` attribute on a `config` object.\n *\n * The `tags` attribute of a `config` object must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n *\n * The `escape` attribute of a `config` object must be a function which\n * accepts a string as input and outputs a safely escaped string.\n * If an `escape` function is not provided, then an HTML-safe string\n * escaping function is used as the default.\n */\n\n\n Writer.prototype.render = function render(template, view, partials, config) {\n var tags = this.getConfigTags(config);\n var tokens = this.parse(template, tags);\n var context = view instanceof Context ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, config);\n };\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n\n\n Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {\n var buffer = '';\n var token, symbol, value;\n\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate, config);else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate, config);else if (symbol === '>') value = this.renderPartial(token, context, partials, config);else if (symbol === '&') value = this.unescapedValue(token, context);else if (symbol === 'name') value = this.escapedValue(token, context, config);else if (symbol === 'text') value = this.rawValue(token);\n if (value !== undefined) buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]); // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n\n function subRender(template) {\n return self.render(template, context, partials, config);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);\n }\n } else if (_typeof(value) === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string') throw new Error('Cannot use higher-order sections without the original template'); // Extract the portion of the original template that the section contains.\n\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n if (value != null) buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);\n }\n\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {\n var value = context.lookup(token[1]); // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n\n if (!value || isArray(value) && value.length === 0) return this.renderTokens(token[4], context, partials, originalTemplate, config);\n };\n\n Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {\n if (!partials) return;\n var tags = this.getConfigTags(config);\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n\n var tokens = this.parse(indentedValue, tags);\n return this.renderTokens(tokens, context, partials, indentedValue, config);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue(token, context) {\n var value = context.lookup(token[1]);\n if (value != null) return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue(token, context, config) {\n var escape = this.getConfigEscape(config) || mustache.escape;\n var value = context.lookup(token[1]);\n if (value != null) return typeof value === 'number' && escape === mustache.escape ? String(value) : escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue(token) {\n return token[1];\n };\n\n Writer.prototype.getConfigTags = function getConfigTags(config) {\n if (isArray(config)) {\n return config;\n } else if (config && _typeof(config) === 'object') {\n return config.tags;\n } else {\n return undefined;\n }\n };\n\n Writer.prototype.getConfigEscape = function getConfigEscape(config) {\n if (config && _typeof(config) === 'object' && !isArray(config)) {\n return config.escape;\n } else {\n return undefined;\n }\n };\n\n var mustache = {\n name: 'mustache.js',\n version: '4.2.0',\n tags: ['{{', '}}'],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache(cache) {\n defaultWriter.templateCache = cache;\n },\n\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache() {\n return defaultWriter.templateCache;\n }\n\n }; // All high-level mustache.* functions use this writer.\n\n var defaultWriter = new Writer();\n /**\n * Clears all cached templates in the default writer.\n */\n\n mustache.clearCache = function clearCache() {\n return defaultWriter.clearCache();\n };\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n\n\n mustache.parse = function parse(template, tags) {\n return defaultWriter.parse(template, tags);\n };\n /**\n * Renders the `template` with the given `view`, `partials`, and `config`\n * using the default writer.\n */\n\n\n mustache.render = function render(template, view, partials, config) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' + 'but \"' + typeStr(template) + '\" was given as the first ' + 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, config);\n }; // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n\n\n mustache.escape = escapeHtml; // Export these mainly for testing, but also for advanced usage.\n\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n return mustache;\n});","import Mustache from \"mustache\";\nexport default class {\n // THIS IS NOT A STIMULUS CONTOLLER!\n constructor() {\n this.wrapper = document.body.querySelector(\"[data-class='deliverySelect']\");\n if (this.wrapper) {\n this.start();\n }\n }\n\n start() {\n this.countries = this.fetchDataObject(\"countries\");\n this.postages = this.fetchDataObject(\"postages\");\n this.topCountryIso = this.wrapper.dataset.topCountryIso;\n this.locale = this.wrapper.dataset.locale;\n\n if (this.countries && this.postages) {\n this.initializeCustomSelect(this.countries, this.topCountryIso);\n this.initializeCountriesList(this.countries);\n }\n }\n\n selectOnChange(event) {\n const val = event.target.value;\n this.setCountryPostageInfo(val);\n }\n\n setCountryPostageInfo(countryId) {\n this.wrapper\n .querySelectorAll('[data-name=\"placed-deliveryInfo\"]')\n .forEach((e) => e.remove());\n const country = this.countries.find(({ id }) => id === parseInt(countryId));\n const infoTpl = this.findTemplate(\"deliveryInfo-el\");\n\n const listTpl = this.findTemplate(\"deliveryInfo\");\n const list = this.htmlToElement(listTpl);\n\n country.postage_ids.map((id, index) => {\n const convertedTpl = this.postageMapperparams(\n infoTpl,\n country,\n id,\n index\n );\n const node_element = this.htmlToElement(convertedTpl);\n list.querySelector(\"table\").append(node_element);\n }, this);\n this.wrapper\n .querySelector(\".delivery-link.link\")\n .insertAdjacentHTML(\"afterend\", list.outerHTML);\n }\n\n initializeCustomSelect(countries, topCountryIso) {\n const selectEl = this.createSelectElement();\n this.assignOptionsToSelect(selectEl, countries, topCountryIso);\n selectEl.selectedIndex = 0;\n\n selectEl.addEventListener(\"change\", (e) => this.selectOnChange(e));\n\n const selectWrapperEl = this.createSelectWrapper(selectEl);\n this.wrapper.insertAdjacentElement(\"afterbegin\", selectWrapperEl);\n\n this.setCountryPostageInfo(selectEl.options[0].value);\n }\n\n createSelectElement() {\n const el = document.createElement(\"select\");\n el.id = \"delivery_select\";\n el.classList = [\"js__custom-select\"];\n return el;\n }\n\n createSelectWrapper(selectEl) {\n const el = document.createElement(\"div\");\n el.classList = [\"custom-select__container\"];\n el.appendChild(selectEl);\n return el;\n }\n\n assignOptionsToSelect(select, countriesData, topCountryIso) {\n const option_c = document.createElement(\"option\");\n const sortedCountriesData = countriesData.sort(function (x, y) {\n return x.iso == topCountryIso ? -1 : x.iso == topCountryIso ? 1 : 0;\n });\n const options = sortedCountriesData.map((c) => {\n const option = option_c.cloneNode(true);\n option.text = c.name;\n option.value = c.id;\n select.appendChild(option);\n });\n }\n\n initializeCountriesList(countries) {\n const listTpl = this.findTemplate(\"deliveryTable\");\n const list = this.htmlToElement(listTpl);\n\n countries.map((country) => {\n const elementTpl = this.findTemplate(\"deliveryTable-el\");\n\n country.postage_ids.map((id, index) => {\n const convertedTpl = this.postageMapperparams(\n elementTpl,\n country,\n id,\n index\n );\n\n const node_element = this.htmlToElement(convertedTpl);\n list.querySelector(\"table\").append(node_element);\n });\n }, this);\n this.wrapper.insertAdjacentHTML(\"beforeend\", list.outerHTML);\n }\n\n postageMapperparams(baseTpl, country, postageId, _postageIndex) {\n const country_postage = this.postages[`${postageId}`];\n console.log(country);\n console.log(country_postage);\n let newTpl = baseTpl.replaceAll(\"%{count}\", \"{{POSTAGE_LEAD_TIME}}\"); // hacky way to reuse rails count translation\n const params = {\n lead_time_is_next_day:\n this.locale == \"en\" && country_postage.lead_time == 1,\n // (true = 1/false = other) helper for days counter translation\n lead_days_equal_one: country_postage.lead_time > 1 ? false : true,\n // POSTAGE_COUNTRY_NAME: postageIndex == 0 ? country.name : \"\", // in case we wanna have only one country name in first element\n POSTAGE_COUNTRY_NAME: country.name,\n POSTAGE_NAME: country_postage.name,\n POSTAGE_LEAD_TIME: country_postage.lead_time,\n POSTAGE_PRICE: country_postage.price,\n ROYAL_MAIL_UK: country.iso == \"GB\" && country_postage.brand == \"Royal Mail\",\n FEDEX_UK: country.iso == \"GB\" && country_postage.brand == \"FedEx\",\n iso_is_gb: country.iso == \"GB\",\n };\n return Mustache.render(newTpl, params);\n }\n\n htmlToElement(html) {\n const el = document.createElement(\"template\");\n el.innerHTML = html;\n return el.content.firstChild;\n }\n\n findTemplate(name) {\n try {\n return this.wrapper.querySelector(`template[data-template=\"${name}\"]`)\n .innerHTML;\n } catch {\n return undefined;\n }\n }\n\n fetchDataObject(name) {\n try {\n const data = JSON.parse(this.wrapper.dataset[`${name}`]);\n return Object.keys(data).length === 0 ? null : data;\n } catch {\n return null;\n }\n }\n}\n","import DeliverySelect from \"./pages/delivery_select\";\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n new DeliverySelect();\n});"],"sourceRoot":""}