{"version":3,"file":"js/punches-0bd9f4c4bd5fea090509.js","mappings":"8GAEA,MAAMA,EAAaC,SAASC,eAAe,eACrCC,EAAUF,SAASC,eAAe,YAClCE,EAAcC,OAAOC,SAASC,OAC9BC,EAAYP,SAASC,eAAe,cACpCO,EAAY,IAAIC,gBAAgBN,GAChCO,EAAWV,SAASC,eAAe,mBACnCU,EAAUX,SAASC,eAAe,kBAClCW,EAAcZ,SAASC,eAAe,uBACtCY,EAAeb,SAASC,eAAe,wBAE7C,GAAIS,GAAmC,WAAvBA,GAAUI,SAAuB,CACvB,IAAIC,EAAQL,EAAU,CACxCM,WAAW,EACXC,uBAAwB,oBACxBC,kBAAmB,GACnBC,eAAgB,mBAExB,CACA,GAAIR,GAAiC,WAAtBA,GAASG,SAAuB,CACtB,IAAIC,EAAQJ,EAAS,CACtCK,WAAW,EACXC,uBAAwB,mBACxBC,kBAAmB,GACnBC,eAAgB,mBAExB,CACInB,SAASC,eAAe,oBACxBD,SAASC,eAAe,mBAAmBmB,iBAAiB,SAAS,SAAUC,GAC3EA,EAAEC,iBACFvB,EAAWwB,MAAMC,QAAU,OAC3BtB,EAAQqB,MAAMC,QAAU,QACxBjB,EAAUkB,MAAQ,MACtB,IAEAzB,SAASC,eAAe,qBACxBD,SAASC,eAAe,oBAAoBmB,iBAAiB,SAAS,SAAUC,GAC5EA,EAAEC,iBACFvB,EAAWwB,MAAMC,QAAU,QAC3BtB,EAAQqB,MAAMC,QAAU,OACxBjB,EAAUkB,MAAQ,OACtB,IAEJzB,SAASoB,iBAAiB,cAAc,WACpC,MAAMM,EAAalB,EAAUmB,IAAI,cACjCpB,EAAUkB,MAAQC,EACC,SAAfA,IACA3B,EAAWwB,MAAMC,QAAU,OAC3BtB,EAAQqB,MAAMC,QAAU,QAGhC,IAEIZ,GACAA,EAAYQ,iBAAiB,QAAQ,WACN,KAAvBP,EAAaY,QACbZ,EAAaY,MAAQb,EAAYa,MAEzC,G","sources":["webpack://app/./app/javascript/packs/punches.js"],"sourcesContent":["import * as Choices from \"choices.js\";\n\nconst clockLogin = document.getElementById('clock-login');\nconst clockQr = document.getElementById('clock-qr');\nconst queryString = window.location.search;\nconst qrScanner = document.getElementById('qr_scanner');\nconst urlParams = new URLSearchParams(queryString);\nconst personId = document.getElementById('punch_person_id');\nconst staffId = document.getElementById('punch_staff_id');\nconst punchInDate = document.getElementById('punch_stamp_in_date');\nconst punchOutDate = document.getElementById('punch_stamp_out_date');\n\nif (personId && personId?.nodeName === 'SELECT') {\n const personChoices = new Choices(personId, {\n allowHTML: false,\n searchPlaceholderValue: 'Enter Person Name',\n searchResultLimit: 10,\n itemSelectText: 'click to select',\n });\n}\nif (staffId && staffId?.nodeName === 'SELECT') {\n const staffChoices = new Choices(staffId, {\n allowHTML: false,\n searchPlaceholderValue: 'Enter Staff Name',\n searchResultLimit: 10,\n itemSelectText: 'click to select',\n });\n}\nif (document.getElementById('open-qr-scanner')) {\n document.getElementById('open-qr-scanner').addEventListener('click', function (e) {\n e.preventDefault();\n clockLogin.style.display = 'none';\n clockQr.style.display = 'block';\n qrScanner.value = 'true';\n });\n}\nif (document.getElementById('close-qr-scanner')) {\n document.getElementById('close-qr-scanner').addEventListener('click', function (e) {\n e.preventDefault();\n clockLogin.style.display = 'block';\n clockQr.style.display = 'none';\n qrScanner.value = 'false';\n });\n}\ndocument.addEventListener('turbo:load', function () {\n const useScanner = urlParams.get('qr_scanner');\n qrScanner.value = useScanner;\n if (useScanner === 'true') {\n clockLogin.style.display = 'none';\n clockQr.style.display = 'block';\n\n }\n})\n\nif (punchInDate) {\n punchInDate.addEventListener('blur', function () {\n if (punchOutDate.value === '') {\n punchOutDate.value = punchInDate.value;\n }\n })\n}"],"names":["clockLogin","document","getElementById","clockQr","queryString","window","location","search","qrScanner","urlParams","URLSearchParams","personId","staffId","punchInDate","punchOutDate","nodeName","Choices","allowHTML","searchPlaceholderValue","searchResultLimit","itemSelectText","addEventListener","e","preventDefault","style","display","value","useScanner","get"],"sourceRoot":""}