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XI,KAAKe,MAAQA,CACjB,CAWA,SAASC,IAAQ,CA5BjB3B,EAAQ4B,SAAW,SAAUrB,GACzB,IAAIsB,EAAO,IAAIC,MAAMrF,UAAUC,OAAS,GACxC,GAAID,UAAUC,OAAS,EACnB,IAAK,IAAIqF,EAAI,EAAGA,EAAItF,UAAUC,OAAQqF,IAClCF,EAAKE,EAAI,GAAKtF,UAAUsF,GAGhCjB,EAAMkB,KAAK,IAAIP,EAAKlB,EAAKsB,IACJ,IAAjBf,EAAMpE,QAAiBqE,GACvBT,EAAWa,EAEnB,EAOAM,EAAKQ,UAAUX,IAAM,WACjBX,KAAKJ,IAAI2B,MAAM,KAAMvB,KAAKe,MAC9B,EACA1B,EAAQmC,MAAQ,UAChBnC,EAAQoC,SAAU,EAClBpC,EAAQqC,IAAM,CAAC,EACfrC,EAAQsC,KAAO,GACftC,EAAQuC,QAAU,GAClBvC,EAAQwC,SAAW,CAAC,EAIpBxC,EAAQyC,GAAKd,EACb3B,EAAQ0C,YAAcf,EACtB3B,EAAQ2C,KAAOhB,EACf3B,EAAQ4C,IAAMjB,EACd3B,EAAQ6C,eAAiBlB,EACzB3B,EAAQ8C,mBAAqBnB,EAC7B3B,EAAQ+C,KAAOpB,EACf3B,EAAQgD,gBAAkBrB,EAC1B3B,EAAQiD,oBAAsBtB,EAE9B3B,EAAQkD,UAAY,SAAUrF,GAAQ,MAAO,EAAG,EAEhDmC,EAAQmD,QAAU,SAAUtF,GACxB,MAAM,IAAIuC,MAAM,mCACpB,EAEAJ,EAAQoD,IAAM,WAAc,MAAO,GAAI,EACvCpD,EAAQqD,MAAQ,SAAUC,GACtB,MAAM,IAAIlD,MAAM,iCACpB,EACAJ,EAAQuD,MAAQ,WAAa,OAAO,CAAG,C","sources":["webpack://AYTM/./app/_stock/webpack/lib/storage/index.js","webpack://AYTM/./app/javascript/src/webpack-options.js","webpack://AYTM/./node_modules/process/browser.js"],"sourcesContent":["import { Buffer } from 'buffer'\nimport zlib from 'zlib'\nimport localForage from 'localforage'\n// const logger = require('debug')('lib:storage')\n// const logger = (...args) => console.debug('lib:storage:', ...args)\n\nconst Encode = (object = {}) =>\n new Promise((resolve, reject) => {\n const plaintext = JSON.stringify(object)\n zlib.gzip(plaintext, function (err, buf) {\n const buffer = Buffer.from(buf)\n const b64 = buffer.toString('base64')\n // logger(`plaintext_size: ${plaintext.length}; gzipped_size: ${buffer.length}; base64_size: ${b64.length}`)\n if (err) reject(err)\n else resolve(b64)\n })\n })\n\nconst Decode = b64String =>\n new Promise((resolve, reject) => {\n zlib.gunzip(Buffer.from(b64String, 'base64'), function (err, buf) {\n if (err) reject(err)\n else resolve(JSON.parse(buf.toString()))\n })\n })\n\nconst stores = {}\nconst Store = name => {\n if (!name || !name.length) return null\n if (stores[name]) return stores[name]\n stores[name] = localForage.createInstance({ name })\n return stores[name] || null\n}\n\nconst Dummy = () => new Promise(resolve => resolve())\n\nconst SetData = (storeName, key, value) => {\n const store = Store(storeName)\n return null != store ? store.setItem(key, Encode(value)) : Dummy()\n}\nconst GetData = (storeName, keys) => {\n const store = Store(storeName)\n return null != store\n ? Promise.all(keys.map(key => store.getItem(key).then(data => (data ? Decode(data) : data))))\n : Dummy()\n}\nconst GetByKey = (storeName, key) => {\n const store = Store(storeName)\n return null != store ? store.getItem(key).then(data => (data ? Decode(data) : data)) : Dummy()\n}\nconst ClearData = (storeName, keys) => {\n const store = Store(storeName)\n return null != store ? Promise.all(keys.map(key => store.removeItem(key))) : Dummy()\n}\nconst DataKeys = storeName => {\n const store = Store(storeName)\n return null != store ? store.keys() : Dummy()\n}\n\nexport const Storage = {\n Encode,\n Decode,\n Store,\n ClearData,\n DataKeys,\n GetByKey,\n GetData,\n SetData,\n Dummy\n}\n\nif ('undefined' !== typeof window && !window['$STRG']) {\n window['$STRG'] = Object.assign({}, Storage)\n}\n","/* eslint-disable no-undef */\n\n__webpack_nonce__ =\n window.context && (window.context.nonce || window.context.nonceToken)\n ? window.context.nonce || window.context.nonceToken\n : window.nonceToken\n ? window.nonceToken\n : null\n\n__webpack_public_path__ =\n window.context && (window.context.aytmWebpackPublicPath || window.context.webpackPublicPath)\n ? window.context.aytmWebpackPublicPath || window.context.webpackPublicPath\n : window.aytmWebpackPublicPath || window.webpackPublicPath\n ? window.aytmWebpackPublicPath || window.webpackPublicPath\n : '/packs/'\n\n/* eslint-enable no-undef */\n\nif (!window.$WEBPACKER_POLYFILL_INCLUDED) {\n window.$WEBPACKER_POLYFILL_INCLUDED = true\n require('core-js/stable')\n require('regenerator-runtime/runtime')\n}\n\nrequire('symbol-observable')\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n"],"names":["Encode","object","arguments","length","undefined","Promise","resolve","reject","plaintext","JSON","stringify","zlib","err","buf","b64","Buffer","toString","Decode","b64String","parse","stores","Store","name","localForage","Dummy","Storage","ClearData","storeName","keys","store","all","map","key","removeItem","DataKeys","GetByKey","getItem","then","data","GetData","SetData","value","setItem","window","Object","assign","__webpack_nonce__","context","nonce","nonceToken","__webpack_public_path__","aytmWebpackPublicPath","webpackPublicPath","$WEBPACKER_POLYFILL_INCLUDED","require","cachedSetTimeout","cachedClearTimeout","process","module","exports","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","setTimeout","e","call","this","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","Array","i","push","prototype","apply","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask"],"sourceRoot":""}