{"version":3,"sources":["webpack:///./src/components/miniapp/search/History.vue?c8b7","webpack:///src/components/miniapp/search/History.vue","webpack:///./src/components/miniapp/search/History.vue?47cb","webpack:///./src/components/miniapp/search/History.vue","webpack:///./src/components/mixins/global-search-history.js","webpack:///./node_modules/lodash/reverse.js","webpack:///./src/components/miniapp/search/History.vue?604d"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","mixins_global_search_historyList","length","_m","on","$event","clearHistory","_v","_e","_l","item","key","attrs","clickHistory","_s","toggleToast","toastType","options","confirmToast","staticRenderFns","components","Toast","data","dialog","title","body","action","duration","mixins","created","mixins_global_search_getHistory","methods","$emit","val","mixins_global_search_clearHistory","component","mixins_global_search_history","keyword","localForage","storageData","currentFundIndex","indexOf","splice","startElem","push","historyList","_reverse","confirmDelete","arrayProto","Array","prototype","nativeReverse","reverse","array","call","module","exports"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,UAAU,CAACE,YAAY,mBAAmB,CAAEN,EAAIO,kCAAoCP,EAAIO,iCAAiCC,OAAS,EAAGJ,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACN,EAAIS,GAAG,GAAGL,EAAG,KAAK,CAACE,YAAY,QAAQI,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOX,EAAIY,kBAAkB,CAACZ,EAAIa,GAAG,iBAAiBb,EAAIc,KAAKV,EAAG,KAAK,CAACE,YAAY,gBAAgBN,EAAIe,GAAIf,EAAoC,kCAAE,SAASgB,GAAM,OAAOZ,EAAG,KAAK,CAACa,IAAID,EAAKE,MAAM,CAAC,cAAc,iBAAiBR,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOX,EAAImB,aAAaH,MAAS,CAAChB,EAAIa,GAAGb,EAAIoB,GAAGJ,SAAW,GAAIhB,EAAe,YAAEI,EAAG,QAAQ,CAACc,MAAM,CA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,GAbZ,UAcCC,aAAoB,wBAAyBC,GAd9C,qGAgBDT,gCAhBC,6KAiBmBQ,aAAoB,yBAjBvC,OAiBDO,EAjBC,OAkBDA,GAAeA,EAAY3C,OAAS,IACtCP,KAAKM,iCAAmC6C,IAASD,IAnB9C,wGAsBDX,kCAtBC,oEAsBiCa,GAtBjC,iFAuBDA,IACFT,gBAAuB,yBACvB3C,KAAKM,iCAAmC,MAzBrC,4G,mBCRX,IAAI+C,EAAaC,MAAMC,UAGnBC,EAAgBH,EAAWI,QAyB/B,SAASA,EAAQC,GACf,OAAgB,MAATA,EAAgBA,EAAQF,EAAcG,KAAKD,GAGpDE,EAAOC,QAAUJ,G,oCCjCjB,yBAA4mB,EAAG,G","file":"js/chunk-42cc955e.4ce2cf9e.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:\"section-history\"},[(_vm.mixins_global_search_historyList && _vm.mixins_global_search_historyList.length > 0)?_c('div',{staticClass:\"history-menu\"},[_vm._m(0),_c('h3',{staticClass:\"trash\",on:{\"click\":function($event){return _vm.clearHistory()}}},[_vm._v(\"ลบประวัติ\")])]):_vm._e(),_c('ul',{staticClass:\"history-list\"},_vm._l((_vm.mixins_global_search_historyList),function(item){return _c('li',{key:item,attrs:{\"data-action\":\"recent_search\"},on:{\"click\":function($event){return _vm.clickHistory(item)}}},[_vm._v(_vm._s(item))])}),0),(_vm.toggleToast)?_c('toast',{attrs:{\"toggleToast\":_vm.toggleToast,\"toastType\":_vm.toastType,\"options\":_vm.options},on:{\"confirm-toast\":_vm.confirmToast}}):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('h3',{staticClass:\"history\"},[_c('i',{staticClass:\"fal fa-history\"}),_vm._v(\" ค้นหาล่าสุด \")])}]\n\nexport { render, staticRenderFns }","\n \n 0\"\n class=\"history-menu\"\n >\n \n ค้นหาล่าสุด\n \n ลบประวัติ\n \n \n {{item}}\n \n \n \n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./History.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./History.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./History.vue?vue&type=template&id=219a373f&scoped=true&\"\nimport script from \"./History.vue?vue&type=script&lang=js&\"\nexport * from \"./History.vue?vue&type=script&lang=js&\"\nimport style0 from \"./History.vue?vue&type=style&index=0&id=219a373f&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"219a373f\",\n null\n \n)\n\nexport default component.exports","import _reverse from \"lodash/reverse\";\nimport * as localForage from \"localforage\";\n\nexport default {\n data() {\n return {\n mixins_global_search_historyList: []\n }\n },\n methods: {\n async mixins_global_search_history(keyword) {\n let storageData = await localForage.getItem('global-search-history') || []\n let currentFundIndex = storageData.indexOf(keyword)\n if (currentFundIndex !== -1) {\n storageData.splice(currentFundIndex, 1)\n }\n\n if (storageData.length > 4) {\n let startElem = storageData.length - 4 >= 0 ? storageData.length - 4 : 0;\n storageData = storageData.splice(startElem, 4)\n }\n\n storageData.push(keyword)\n await localForage.setItem('global-search-history', storageData)\n },\n async mixins_global_search_getHistory() {\n let historyList = await localForage.getItem('global-search-history')\n if (historyList && historyList.length > 0) {\n this.mixins_global_search_historyList = _reverse(historyList)\n }\n },\n async mixins_global_search_clearHistory(confirmDelete) {\n if (confirmDelete) {\n localForage.removeItem('global-search-history')\n this.mixins_global_search_historyList = null\n }\n }\n }\n\n}\n","/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeReverse = arrayProto.reverse;\n\n/**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\nfunction reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n}\n\nmodule.exports = reverse;\n","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./History.vue?vue&type=style&index=0&id=219a373f&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./History.vue?vue&type=style&index=0&id=219a373f&lang=scss&scoped=true&\""],"sourceRoot":""}