vendor: 5,219 bytes, lines 1-162
1/*! 2 * JavaScript Cookie v2.2.0 3 * https://github.com/js-cookie/js-cookie 4 * 5 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 6 * Released under the MIT license 7 */ 8;(function (factory) { 9 var registeredInModuleLoader; 10 if (typeof define === 'function' && define.amd) { 11 define(factory); 12 registeredInModuleLoader = true; 13 } 14 if (typeof exports === 'object') { 15 module.exports = factory(); 16 registeredInModuleLoader = true; 17 } 18 if (!registeredInModuleLoader) { 19 var OldCookies = window.Cookies; 20 var api = window.Cookies = factory(); 21 api.noConflict = function () { 22 window.Cookies = OldCookies; 23 return api; 24 }; 25 } 26}(function () { 27 function extend () { 28 var i = 0; 29 var result = {}; 30 for (; i < arguments.length; i++) { 31 var attributes = arguments[ i ]; 32 for (var key in attributes) { 33 result[key] = attributes[key]; 34 } 35 } 36 return result; 37 } 38 39 function init (converter) { 40 function api (key, value, attributes) { 41 if (typeof document === 'undefined') { 42 return; 43 } 44 45 // Write 46 47 if (arguments.length > 1) { 48 attributes = extend({ 49 path: '/' 50 }, api.defaults, attributes); 51 52 if (typeof attributes.expires === 'number') { 53 attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); 54 } 55 56 // We're using "expires" because "max-age" is not supported by IE 57 attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; 58 59 try { 60 var result = JSON.stringify(value); 61 if (/^[\{\[]/.test(result)) { 62 value = result; 63 } 64 } catch (e) {} 65 66 value = converter.write ? 67 converter.write(value, key) : 68 encodeURIComponent(String(value)) 69 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 70 71 key = encodeURIComponent(String(key)) 72 .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) 73 .replace(/[\(\)]/g, escape); 74 75 var stringifiedAttributes = ''; 76 for (var attributeName in attributes) { 77 if (!attributes[attributeName]) { 78 continue; 79 } 80 stringifiedAttributes += '; ' + attributeName; 81 if (attributes[attributeName] === true) { 82 continue; 83 } 84 85 // Considers RFC 6265 section 5.2: 86 // ... 87 // 3. If the remaining unparsed-attributes contains a %x3B (";") 88 // character: 89 // Consume the characters of the unparsed-attributes up to, 90 // not including, the first %x3B (";") character. 91 // ... 92 stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; 93 } 94 95 return (document.cookie = key + '=' + value + stringifiedAttributes); 96 } 97 98 // Read 99 100 var jar = {}; 101 var decode = function (s) { 102 return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 103 }; 104 // To prevent the for loop in the first place assign an empty array 105 // in case there are no cookies at all. 106 var cookies = document.cookie ? document.cookie.split('; ') : []; 107 var i = 0; 108 109 for (; i < cookies.length; i++) { 110 var parts = cookies[i].split('='); 111 var cookie = parts.slice(1).join('='); 112 113 if (!this.json && cookie.charAt(0) === '"') { 114 cookie = cookie.slice(1, -1); 115 } 116 117 try { 118 var name = decode(parts[0]); 119 cookie = (converter.read || converter)(cookie, name) || 120 decode(cookie); 121 122 if (this.json) { 123 try { 124 cookie = JSON.parse(cookie); 125 } catch (e) {} 126 } 127 128 jar[name] = cookie; 129 130 if (key === name) { 131 break; 132 } 133 } catch (e) {} 134 } 135 136 return key ? jar[key] : jar; 137 } 138 139 api.set = api; 140 api.get = function (key) { 141 return api.call(api, key); 142 }; 143 api.getJSON = function () { 144 return api.apply({ 145 json: true 146 }, arguments); 147 }; 148 api.remove = function (key, attributes) { 149 api(key, '', extend(attributes, { 150 expires: -1 151 })); 152 }; 153 154 api.defaults = {}; 155 156 api.withConverter = init; 157 158 return api; 159 } 160 161 return init(function () {}); 162}));
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.