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uBI,SACjD,IArBiD,GAsBnDpE,KAAKqE,WACP,GAAC,CAAA5E,IAAA,uBAAAC,MAED,SAAqBgE,GAErB,M,8EAACzE,CAAA,CA7E8B,CAEJiB,EAAAA,IAAUjB,EAC9BkB,QAAU,CAAE,UAAW,UCGhCvB,EAAY0F,SAAS,kBAAmBC,GAGxC3F,EAAY0F,SAAS,QAASE,GAG9B5F,EAAY0F,SAAS,gBAAiBG,GAGtC7F,EAAY0F,SAAS,uBAAwBI,E","sources":["webpack://accuage/./app/javascript/channels/ sync _channel\\.js$","webpack://accuage/./app/javascript/channels/index.js","webpack://accuage/./app/javascript/controllers/application.js","webpack://accuage/./app/javascript/controllers/customer_lookup_controller.js","webpack://accuage/./app/javascript/controllers/flash_controller.js","webpack://accuage/./app/javascript/controllers/merchant_form_controller.js","webpack://accuage/./app/javascript/controllers/paya_info_collection_controller.js","webpack://accuage/./app/javascript/controllers/index.js"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 56463;\nmodule.exports = webpackEmptyContext;","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/);\nchannels.keys().forEach(channels);\n","import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus = application\n\nexport { application }\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static targets = [\"customerId\"];\n\n lookup(event) {\n event.preventDefault();\n Turbo.visit(`/admin/customers/${this.customerIdTarget.value}`);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static targets = [\"notification\"];\n\n disconnect() {\n $(this.notificationTarget).remove();\n }\n\n connect() {\n if(!document.documentElement.hasAttribute(\"data-turbo-preview\")) {\n this.showFlashNotifications();\n }\n }\n\n showFlashNotifications() {\n const element = this.notificationTarget;\n\n $.notify({\n message: element.textContent,\n },{\n type: element.dataset.notificationClass,\n placement: {\n from: 'top',\n align: 'right'\n }\n });\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n\n toggleModal(event) {\n event.preventDefault();\n $(\"#eager-checkout-modal\").modal('toggle');\n }\n\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport CryptoJS from \"crypto-js\"\n\nexport default class extends Controller {\n static targets = [ \"display\", \"method\" ]\n\n ascToHex(asc) {\n var hex = '';\n for (var i = 0; i < asc.length; i++) {\n hex += ('0' + asc.charCodeAt(i).toString(16)).slice(-2);\n }\n return hex;\n }\n\n setIframe() {\n var params = {\n \"developer-id\": this.developerId,\n \"hash-key\": this.hashKey,\n \"user-id\": this.userId,\n \"timestamp\": Math.floor((Math.floor(Date.now()) - (1*60000))/1000),\n \"data\": {\n \"accountvault\": {\n \"payment_method\": this.methodTarget.value,\n \"location_id\": this.locationId,\n \"stylesheet_url\": \"https://accuage-cdn.s3.amazonaws.com/paya.css\",\n \"account_vault_api_id\": [...Array(10)].map(i=>(~~(Math.random()*36)).toString(36)).join(''),\n \"title\": \"Payment Name\",\n \"account_holder_name\": this.merchantName,\n \"show_account_holder_name\": true,\n \"show_street\": true,\n \"ach_sec_code\": \"WEB\"\n }\n }\n };\n params['hash-key'] = CryptoJS.HmacSHA256(params['user-id'] + params['timestamp'], this.hashKey);\n params['data'] = this.ascToHex(JSON.stringify(params['data']));\n var url = this.payaHost + \"/v2/accountform?\";\n Object.keys(params).forEach(function (key) {\n url += key + '=' + params[key] + '&';\n });\n this.displayTarget.src = url;\n }\n\n connect() {\n this.developerId = document.querySelector('meta[name=\"developerId\"]').getAttribute('content');\n this.hashKey = document.querySelector('meta[name=\"hashKey\"]').getAttribute('content');\n this.userId = document.querySelector('meta[name=\"userId\"]').getAttribute('content');\n this.locationId = document.querySelector('meta[name=\"locationId\"]').getAttribute('content');\n this.payaHost = document.querySelector('meta[name=\"phost\"]').getAttribute('content');\n this.accountVaultApiId = document.querySelector('meta[name=\"accountVault\"]').getAttribute('content');\n this.merchantName = document.querySelector('meta[name=\"username\"]').getAttribute('content');\n window.addEventListener(\"message\", receiveMessage, false);\n\n function receiveMessage(event) {\n var allowed = document.querySelector('meta[name=\"phost\"]').getAttribute('content');\n var paymentData =\"\"\n if (event.origin !== allowed) return;\n paymentData = JSON.parse(event.data);\n if (paymentData.payment_method == 'cc') {\n document.getElementById('payment_method_external_payment_method_id').value = paymentData.id;\n document.getElementById('payment_method_external_payment_method_type').value = paymentData.payment_method;\n document.getElementById('payment_method_identifier').value = paymentData.last_four;\n document.getElementById('payment_method_expires').value = paymentData.exp_date;\n document.getElementById('payment_method_brand').value = paymentData.account_type;\n } else {\n document.getElementById('payment_method_external_payment_method_id').value = paymentData.id;\n document.getElementById('payment_method_external_payment_method_type').value = paymentData.payment_method;\n document.getElementById('payment_method_identifier').value = paymentData.last_four;\n document.getElementById('payment_method_expires').value = paymentData.exp_date;\n document.getElementById('payment_method_brand').value = paymentData.account_type;\n }\n document.getElementById('payment-method-form').submit();\n }\n this.setIframe();\n }\n\n processPaymentMethod(paymentData) {\n\n }\n}\n","// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from \"./application\"\n\nimport CustomerLookupController from \"./customer_lookup_controller.js\"\napplication.register(\"customer-lookup\", CustomerLookupController)\n\nimport FlashController from \"./flash_controller.js\"\napplication.register(\"flash\", FlashController)\n\nimport MerchantFormController from \"./merchant_form_controller.js\"\napplication.register(\"merchant-form\", MerchantFormController)\n\nimport PayaInfoCollectionController from \"./paya_info_collection_controller.js\"\napplication.register(\"paya-info-collection\", PayaInfoCollectionController)\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","channels","require","forEach","application","Application","debug","window","Stimulus","_default","_Controller","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","key","value","event","preventDefault","Turbo","visit","concat","this","customerIdTarget","Controller","targets","$","notificationTarget","remove","document","documentElement","hasAttribute","showFlashNotifications","element","notify","message","textContent","type","dataset","notificationClass","placement","from","align","modal","asc","hex","i","length","charCodeAt","toString","slice","params","developerId","hashKey","userId","Math","floor","Date","now","methodTarget","locationId","_toConsumableArray","Array","map","random","join","merchantName","CryptoJS","ascToHex","JSON","stringify","url","payaHost","Object","displayTarget","src","querySelector","getAttribute","accountVaultApiId","addEventListener","paymentData","allowed","origin","parse","data","payment_method","getElementById","last_four","exp_date","account_type","submit","setIframe","register","CustomerLookupController","FlashController","MerchantFormController","PayaInfoCollectionController"],"sourceRoot":""}