{"ScriptPreparationCode":"function getCookies(str) {\r\n str = str || document.cookie;\r\n var reKey = /(?:^|; )([^=]\u002B?)(?:=([^;]*))?(?:;|$)/g;\r\n var cookies = {};\r\n var match;\r\n var cnt = 0;\r\n while ((match = reKey.exec(str))) {\r\n cnt \u002B= 1;\r\n reKey.lastIndex = match.index \u002B match.length - 1;\r\n var k = match[1];\r\n var v = decodeURIComponent(match[2]);\r\n if (!!cookies[k]) {\r\n if (typeof cookies[k] == \u0022string\u0022) {\r\n cookies[k] = [cookies[k]];\r\n }\r\n cookies[k].push(v);\r\n } else {\r\n cookies[k] = v;\r\n }\r\n }\r\n !!!cnt \u0026\u0026 (cookies = undefined);\r\n return cookies;\r\n}\r\n// make the multiple values of the cookie into a comma delimitted string\r\nfunction all(str) {\r\n str || document.cookie;\r\n let cookies = getCookies(str);\r\n if (!!cookies) {\r\n if (!!cookies[\u0022BGC_AUT_LVL\u0022]) {\r\n if (typeof cookies[\u0022BGC_AUT_LVL\u0022] !== \u0022string\u0022) {\r\n cookies[\u0022BGC_AUT_LVL\u0022] = cookies[\u0022BGC_AUT_LVL\u0022].join(\u0022,\u0022);\r\n }\r\n }\r\n } else {\r\n cookies = {};\r\n }\r\n return cookies;\r\n}\r\n\r\nfunction getCookie(name) {\r\n var nameEQ = name \u002B \u0022=\u0022;\r\n var ca = document.cookie.split(\u0022;\u0022);\r\n for (var i = 0; i \u003C ca.length; i\u002B\u002B) {\r\n var c = ca[i];\r\n while (c.charAt(0) == \u0022 \u0022) c = c.substring(1, c.length);\r\n if (c.indexOf(nameEQ) == 0) {\r\n var d = c.substring(nameEQ.length, c.length);\r\n //d = decodeRFC(d);\r\n return d;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction decodeRFC(s) {\r\n s = s \u002B \u0022\u0022;\r\n return s.replace(/\\*/gm, \u0022##\u0022).replace(/##/gm, \u0022,\u0022).replace(/!/gm, \u0022 \u0022);\r\n}\r\n\r\ndocument.cookie = \u0022foo=bar\u002B\u0022\u002Bperformance.now();\r\ndocument.cookie = \u0022hello=bar\u002B\u0022\u002Bperformance.now();\r\ndocument.cookie = \u0022world=bar\u002B\u0022\u002Bperformance.now();\r\ndocument.cookie = \u0022foo=bar2\u002B\u0022\u002Bperformance.now();","TestCases":[{"Name":"gc","Code":"var cookie1 = getCookie(\u0027foo\u0027);\r\nvar cookie1 = getCookie(\u0027hello\u0027);\r\nvar cookie1 = getCookie(\u0027world\u0027);\r\nvar cookie1 = getCookie(\u0027foo\u0027);","IsDeferred":false},{"Name":"all","Code":"var cookies = all();\r\nvar cookie1= cookies[\u0027foo\u0027];\r\nvar cookie2= cookies[\u0027hello\u0027];\r\nvar cookie3= cookies[\u0027world\u0027];\r\nvar cookie4= cookies[\u0027foo\u0027];","IsDeferred":false}]}