{"version":3,"sources":["jquery.barrating.js"],"names":["factory","define","amd","module","exports","require","jQuery","$","BarRating","self","this","wrapElement","classes","options","theme","push","$elem","wrap","class","join","unwrapElement","unwrap","findOption","value","isNumeric","Math","floor","getInitialOption","initialRating","getEmptyOption","$emptyOpt","find","emptyValue","length","allowEmpty","prependTo","getData","key","data","setData","saveDataOnElement","$opt","val","text","emptyText","userOptions","ratingValue","ratingText","originalRatingValue","originalRatingText","emptyRatingValue","emptyRatingText","readOnly","readonly","ratingMade","removeDataOnElement","removeData","buildWidget","$w","each","html","$a","href","data-rating-value","data-rating-text","append","showSelectedRating","reverse","addClass","nextAllorPreviousAll","setSelectFieldValue","prop","change","resetSelectField","defaultSelected","parent","fraction","round","resetStyle","$widget","removeClass","index","match","applyStyle","$all","$fractional","baseValue","f","isDeselectable","$element","deselectable","attr","attachClickHandler","$elements","on","event","preventDefault","onSelect","call","attachMouseEnterHandler","attachMouseLeaveHandler","fastClicks","stopPropagation","click","disableClicks","attachHandlers","hoverState","detachHandlers","off","setupHandlers","show","insertAfter","hide","state","toggleClass","set","silent","clear","onClear","destroy","remove","onDestroy","prototype","init","elem","extend","fn","barrating","defaults","method","plugin","is","error","hasOwnProperty","next","showValues"],"mappings":"CAUC,SAAUA,GACe,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GACM,gBAAXG,SAAuBA,OAAOC,QAE5CD,OAAOC,QAAUJ,EAAQK,QAAQ,WAGjCL,EAAQM,SAEd,SAAUC,GAER,GAAIC,GAAY,WAEZ,QAASA,KACL,GAAIC,GAAOC,KAGPC,EAAc,WACd,GAAIC,IAAW,aAEY,MAAvBH,EAAKI,QAAQC,OACbF,EAAQG,KAAK,YAAcN,EAAKI,QAAQC,OAG5CL,EAAKO,MAAMC,KAAKV,EAAE,WACdW,QAASN,EAAQO,KAAK,SAK1BC,EAAgB,WAChBX,EAAKO,MAAMK,UAIXC,EAAa,SAASC,GAKtB,MAJIhB,GAAEiB,UAAUD,KACZA,EA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AEuH,GAAGC,UAAUC,UACXlH,MAAM,GACNc,cAAc,KACdM,WAAW,KACXF,WAAW,GACXuG,YAAW,EACXrE,oBAAmB,EACnBwB,cAAa,EACbvB,SAAQ,EACRd,UAAS,EACTgD,YAAW,EACXK,YAAW,EACXU,QAAO,EACPnB,SAAS,SAAU1E,EAAOoB,EAAMoD,KAEhCuB,QAAQ,SAAU/F,EAAOoB,KAEzB8E,UAAU,SAAUlG,EAAOoB,MAI/BpC,EAAEuH,GAAGC,UAAUvH,UAAYA","file":"jquery.barrating.min.js","sourcesContent":["/**\n * jQuery Bar Rating Plugin v1.2.2\n *\n * http://github.com/antennaio/jquery-bar-rating\n *\n * Copyright (c) 2012-2016 Kazik Pietruszewski\n *\n * This plugin is available under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n */\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(['jquery'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node/CommonJS\n module.exports = factory(require('jquery'));\n } else {\n // browser globals\n factory(jQuery);\n }\n}(function ($) {\n\n var BarRating = (function() {\n\n function BarRating() {\n var self = this;\n\n // wrap element in a wrapper div\n var wrapElement = function() {\n var classes = ['br-wrapper'];\n\n if (self.options.theme !== '') {\n classes.push('br-theme-' + self.options.theme);\n }\n\n self.$elem.wrap($('
', {\n 'class': classes.join(' ')\n }));\n };\n\n // unwrap element\n var unwrapElement = function() {\n self.$elem.unwrap();\n };\n\n // find option by value\n var findOption = function(value) {\n if ($.isNumeric(value)) {\n value = Math.floor(value);\n }\n\n return $('option[value=\"' + value + '\"]', self.$elem);\n };\n\n // get initial option\n var getInitialOption = function() {\n var initialRating = self.options.initialRating;\n\n if (!initialRating) {\n return $('option:selected', self.$elem);\n }\n\n return findOption(initialRating);\n };\n\n // get empty option\n var getEmptyOption = function() {\n var $emptyOpt = self.$elem.find('option[value=\"' + self.options.emptyValue + '\"]');\n\n if (!$emptyOpt.length && self.options.allowEmpty) {\n $emptyOpt = $('