{"version":3,"file":"/js/tracking.js","mappings":"CAAC,SAAUA,EAAGC,EAAQC,GAElB,aAEA,IAAIC,EAAS,KAoCbH,EAAEE,GAAUE,OAAM,WA5BJ,IAACC,GA6BXF,EAASH,EAAE,kJAGAM,QAAUC,kBAAoBA,iBAAiBC,MAhC/CH,EAiCDE,iBAAiBC,IAhC3BR,EAAES,KAAK,CACHC,OAAQ,OACRC,IAAKV,EAAOM,iBAAiBK,SAC7BC,KAAM,CACFL,IAAKH,EACLS,QAASZ,EAASa,SAClBC,WAAYf,EAAOgB,SAASC,QAEjCC,MAAK,SAACC,QACiB,IAAXA,GAA4C,MAAlBA,EAAOC,SAI5ClB,EACKmB,MAAK,WACFtB,EAAE,WAAWuB,KAAK,CACdC,KAAM,SACNC,GAAI,qBACJC,KAAM,qBACNC,MAAOP,EAAOP,KAAKe,qBACpBC,SAAS7B,EAAE8B,UAGtB7B,EAAOM,iBAAiBqB,mBAAqBR,EAAOP,KAAKe,2BApCpE,CAiDEG,OAAQ9B,OAAQC","sources":["webpack://OptimizeDashboard/./resources/assets/js/tracking.js"],"sourcesContent":[";(function($, window, document) {\n\n \"use strict\";\n\n var $forms = null;\n\n /**\n * Register pageview.\n *\n * @param {String} pageId\n * @returns {Void}\n */\n const track = (pageId) => {\n $.ajax({\n method: \"POST\",\n url: window.OPDashboardStats.rest_url,\n data: {\n pid: pageId,\n referer: document.referrer,\n currentUrl: window.location.href\n }\n }).done((result) => {\n if (typeof result === 'undefined' || result.status !== 200) {\n return;\n }\n\n $forms\n .each(function() {\n $('').attr({\n type: 'hidden',\n id: 'pageview_record_id',\n name: 'pageview_record_id',\n value: result.data.pageview_record_id\n }).appendTo($(this));\n });\n\n window.OPDashboardStats.pageview_record_id = result.data.pageview_record_id;\n });\n }\n\n $(document).ready(function() {\n $forms = $('.op3-element[data-op3-element-type=\"form\"] form, form[data-op3-form=\"op3-smart-form\"], .op3-element[data-op3-element-type=\"contactform\"] form');\n \n // Register pageview only if there is op3 or smart-theme-3 form on page\n if ($forms.length && OPDashboardStats && OPDashboardStats.pid) {\n track(OPDashboardStats.pid);\n }\n });\n\n})(jQuery, window, document);"],"names":["$","window","document","$forms","ready","pageId","length","OPDashboardStats","pid","ajax","method","url","rest_url","data","referer","referrer","currentUrl","location","href","done","result","status","each","attr","type","id","name","value","pageview_record_id","appendTo","this","jQuery"],"sourceRoot":""}