{"version":3,"file":"slick.min.js","sources":["../../../js/realperson/jquery.realperson.js"],"sourcesContent":["(function($) { // Hide scope, no $ conflict\r\n\r\n\tvar pluginName = 'realperson';\r\n\t\r\n\tvar ALPHABETIC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\tvar ALPHANUMERIC = ALPHABETIC + '0123456789';\r\n\tvar DOTS = [\r\n\t\t[' * ', ' * * ', ' * * ', ' * * ', ' ***** ', '* *', '* *'],\r\n\t\t['****** ', '* *', '* *', '****** ', '* *', '* *', '****** '],\r\n\t\t[' ***** ', '* *', '* ', '* ', '* ', '* *', ' ***** '],\r\n\t\t['****** ', '* *', '* *', '* *', '* *', '* *', '****** '],\r\n\t\t['*******', '* ', '* ', '**** ', '* ', '* ', '*******'],\r\n\t\t['*******', '* ', '* ', '**** ', '* ', '* ', '* '],\r\n\t\t[' ***** ', '* *', '* ', '* ', '* ***', '* *', ' ***** '],\r\n\t\t['* *', '* *', '* *', '*******', '* *', '* *', '* *'],\r\n\t\t['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'],\r\n\t\t[' *', ' *', ' *', ' *', ' *', '* *', ' ***** '],\r\n\t\t['* *', '* ** ', '* ** ', '** ', '* ** ', '* ** ', '* *'],\r\n\t\t['* ', '* ', '* ', '* ', '* ', '* ', '*******'],\r\n\t\t['* *', '** **', '* * * *', '* * *', '* *', '* *', '* *'],\r\n\t\t['* *', '** *', '* * *', '* * *', '* * *', '* **', '* *'],\r\n\t\t[' ***** ', '* *', '* *', '* *', '* *', '* *', ' ***** '],\r\n\t\t['****** ', '* *', '* *', '****** ', '* ', '* ', '* '],\r\n\t\t[' ***** ', '* *', '* *', '* *', '* * *', '* * ', ' **** *'],\r\n\t\t['****** ', '* *', '* *', '****** ', '* * ', '* * ', '* *'],\r\n\t\t[' ***** ', '* *', '* ', ' ***** ', ' *', '* *', ' ***** '],\r\n\t\t['*******', ' * ', ' * ', ' * ', ' * ', ' * ', ' * '],\r\n\t\t['* *', '* *', '* *', '* *', '* *', '* *', ' ***** '],\r\n\t\t['* *', '* *', ' * * ', ' * * ', ' * * ', ' * * ', ' * '],\r\n\t\t['* *', '* *', '* *', '* * *', '* * * *', '** **', '* *'],\r\n\t\t['* *', ' * * ', ' * * ', ' * ', ' * * ', ' * * ', '* *'],\r\n\t\t['* *', ' * * ', ' * * ', ' * ', ' * ', ' * ', ' * '],\r\n\t\t['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'],\r\n\t\t[' *** ', ' * * ', '* * *', '* * *', '* * *', ' * * ', ' *** '],\r\n\t\t[' * ', ' ** ', ' * * ', ' * ', ' * ', ' * ', '*******'],\r\n\t\t[' ***** ', '* *', ' *', ' * ', ' ** ', ' ** ', '*******'],\r\n\t\t[' ***** ', '* *', ' *', ' ** ', ' *', '* *', ' ***** '],\r\n\t\t[' * ', ' ** ', ' * * ', ' * * ', '*******', ' * ', ' * '],\r\n\t\t['*******', '* ', '****** ', ' *', ' *', '* *', ' ***** '],\r\n\t\t[' **** ', ' * ', '* ', '****** ', '* *', '* *', ' ***** '],\r\n\t\t['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '* '],\r\n\t\t[' ***** ', '* *', '* *', ' ***** ', '* *', '* *', ' ***** '],\r\n\t\t[' ***** ', '* *', '* *', ' ******', ' *', ' * ', ' **** ']];\r\n\r\n\t/** Create the real person plugin.\r\n\t\t

Displays a challenge to confirm that the viewer is a real person.

\r\n\t\t

Expects HTML like:

\r\n\t\t
<input...>
\r\n\t\t

Provide inline configuration like:

\r\n\t\t
<input data-realperson=\"name: 'value'\">...>
\r\n\t \t@module RealPerson\r\n\t\t@augments JQPlugin\r\n\t\t@example $(selector).realperson()\r\n $(selector).realperson({length: 200, toggle: false}) */\r\n\t$.JQPlugin.createPlugin({\r\n\t\r\n\t\t/** The name of the plugin. */\r\n\t\tname: pluginName,\r\n\r\n\t\t/** The set of alphabetic characters. */\r\n\t\talphabetic: ALPHABETIC,\r\n\t\t/** The set of alphabetic and numeric characters. */\r\n\t\talphanumeric: ALPHANUMERIC,\r\n\t\t/** The set dots that make up each character. */\r\n\t\tdefaultDots: DOTS,\r\n\r\n\t\t/** More/less change callback.\r\n\t\t\tTriggered when the more/less button is clicked.\r\n\t\t\t@callback changeCallback\r\n\t\t\t@param expanding {boolean} True if expanding the text, false if collapsing. */\r\n\t\t\t\r\n\t\t/** Default settings for the plugin.\r\n\t\t\t@property [length=6] {number} Number of characters to use.\r\n\t\t\t@property [regenerate='Click to change'] {string} Instruction text to regenerate.\r\n\t\t\t@property [hashName='{n}Hash'] {string} Name of the hash value field to compare with,\r\n\t\t\t\t\t\tuse {n} to substitute with the original field name.\r\n\t\t\t@property [dot='*'] {string} The character to use for the dot patterns.\r\n\t\t\t@property [dots=defaultDots] {string[][]} The dot patterns per letter in chars.\r\n\t\t\t@property [chars=alphabetic] {string} The characters allowed. */\r\n\t\tdefaultOptions: {\r\n\t\t\tlength: 6,\r\n\t\t\tregenerate: 'Click to change',\r\n\t\t\thashName: '{n}Hash',\r\n\t\t\tdot: '*',\r\n\t\t\tdots: DOTS,\r\n\t\t\tchars: ALPHABETIC\r\n\t\t},\r\n\t\t\r\n\t\t_getters: ['getHash'],\r\n\r\n\t\t_challengeClass: pluginName + '-challenge',\r\n\t\t_disabledClass: pluginName + '-disabled',\r\n\t\t_hashClass: pluginName + '-hash',\r\n\t\t_regenerateClass: pluginName + '-regen',\r\n\t\t_textClass: pluginName + '-text',\r\n\r\n\t\t_optionsChanged: function(elem, inst, options) {\r\n\t\t\t$.extend(inst.options, options);\r\n\t\t\tvar text = '';\r\n\t\t\tfor (var i = 0; i < inst.options.length; i++) {\r\n\t\t\t\ttext += inst.options.chars.charAt(Math.floor(Math.random() * inst.options.chars.length));\r\n\t\t\t}\r\n\t\t\tinst.hash = hash(text + salt);\r\n\t\t\tvar self = this;\r\n\t\t\telem.closest('form').off('.' + inst.name).\r\n\t\t\t\ton('submit.' + inst.name, function() {\r\n\t\t\t\t\tvar name = inst.options.hashName.replace(/\\{n\\}/, elem.attr('name'));\r\n\t\t\t\t\tvar form = $(this);\r\n\t\t\t\t\tform.find('input[name=\"' + name + '\"]').remove();\r\n\t\t\t\t\tform.append('');\r\n\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\tform.find('input[name=\"' + name + '\"]').remove();\r\n\t\t\t\t\t}, 0);\r\n\t\t\t\t});\r\n\t\t\telem.prevAll('.' + this._challengeClass + ',.' + this._hashClass).remove().end().\r\n\t\t\t\tbefore(this._generateHTML(inst, text)).\r\n\t\t\t\tprevAll('div.' + this._challengeClass).click(function() {\r\n\t\t\t\t\tif (!$(this).hasClass(self._disabledClass)) {\r\n\t\t\t\t\t\telem.realperson('option', {});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t},\r\n\r\n\t\t/* Enable the plugin functionality for a control.\r\n\t\t @param elem {element} The control to affect. */\r\n\t\tenable: function(elem) {\r\n\t\t\telem = $(elem);\r\n\t\t\tif (!elem.hasClass(this._getMarker())) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telem.removeClass(this._disabledClass).prop('disabled', false).\r\n\t\t\t\tprevAll('.' + this._challengeClass).removeClass(this._disabledClass);\r\n\t\t},\r\n\r\n\t\t/* Disable the plugin functionality for a control.\r\n\t\t @param elem {element} The control to affect. */\r\n\t\tdisable: function(elem) {\r\n\t\t\telem = $(elem);\r\n\t\t\tif (!elem.hasClass(this._getMarker())) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\telem.addClass(this._disabledClass).prop('disabled', true).\r\n\t\t\t\tprevAll('.' + this._challengeClass).addClass(this._disabledClass);\r\n\t\t},\r\n\t\t\r\n\t\t/* Retrieve the hash value.\r\n\t\t @param elem {Element} The control with the hash.\r\n\t\t @return {number} The hash value. */\r\n\t\tgetHash: function (elem) {\r\n\t\t\tvar inst = this._getInst(elem);\r\n\t\t\treturn inst ? inst.hash : 0;\r\n\t\t},\r\n\t\t\r\n\t\t/* Generate the additional content for this control.\r\n\t\t @param inst {object} The current instance settings.\r\n\t\t @param text {string} The text to display.\r\n\t\t @return {string} The additional content. */\r\n\t\t_generateHTML: function(inst, text) {\r\n\t\t var html = '
' +\r\n\t\t '
';\r\n\t\t for (var i = 0; i < inst.options.dots[0].length; i++) {\r\n\t\t for (var j = 0; j < text.length; j++) {\r\n\t\t html += inst.options.dots[inst.options.chars.indexOf(text.charAt(j))][i].\r\n\t\t replace(/ /g, ' ').replace(/\\*/g, inst.options.dot) +\r\n\t\t '  ';\r\n\t\t }\r\n\t\t html += '
';\r\n\t\t }\r\n\t\t html += '
' +\r\n\t\t inst.options.regenerate + '
';\r\n\r\n\t\t var hashHolder = $('#' + inst.options.hashName);\r\n\t\t if (hashHolder != null) {\r\n\t\t hashHolder.val(inst.hash);\r\n\t\t }\r\n\r\n\t\treturn html;\r\n\t\t},\r\n\r\n\t\t_preDestroy: function(elem, inst) {\r\n\t\t\telem.closest('form').off('.' + inst.name);\r\n\t\t\telem.prevAll('.' + this._challengeClass + ',.' + this._hashClass).remove();\r\n\t\t}\r\n\t});\r\n\r\n\t/* Load salt value and clear. */\r\n\tvar salt = $.salt || '#salt';\r\n\tdelete $.salt;\r\n\t$(function() {\r\n\t\tvar saltElem = $(salt);\r\n\t\tif (saltElem.length) {\r\n\t\t\tsalt = saltElem.text();\r\n\t\t\tsaltElem.remove();\r\n\t\t}\r\n\t\tif (salt === '#salt') {\r\n\t\t\tsalt = '';\r\n\t\t}\r\n\t});\r\n\r\n\t/* Compute a hash value for the given text.\r\n\t @param value {string} The text to hash.\r\n\t @return {number} The corresponding hash value. */\r\n\tfunction hash(value) {\r\n\t\tvar hash = 5381;\r\n\t\tfor (var i = 0; i < value.length; i++) {\r\n\t\t\thash = ((hash << 5) + hash) + value.charCodeAt(i);\r\n\t\t}\r\n\t\treturn hash;\r\n\t}\r\n\r\n})(jQuery);\r\n"],"names":["factory","define","amd","exports","module","require","jQuery","$","Slick","window","instanceUid","element","settings","_","this","dataSettings","defaults","accessibility","adaptiveHeight","appendArrows","appendDots","arrows","asNavFor","prevArrow","nextArrow","autoplay","autoplaySpeed","centerMode","centerPadding","cssEase","customPaging","slider","i","text","dots","dotsClass","draggable","easing","edgeFriction","fade","focusOnSelect","infinite","initialSlide","lazyLoad","mobileFirst","pauseOnHover","pauseOnFocus","pauseOnDotsHover","respondTo","responsive","rows","rtl","slide","slidesPerRow","slidesToShow","slidesToScroll","speed","swipe","swipeToSlide","touchMove","touchThreshold","useCSS","useTransform","variableWidth","vertical","verticalSwiping","waitForAnimate","zIndex","initials","animating","dragging","autoPlayTimer","currentDirection","currentLeft","currentSlide","direction","$dots","listWidth","listHeight","loadIndex","$nextArrow","$prevArrow","slideCount","slideWidth","$slideTrack","$slides","sliding","slideOffset","swipeLeft","$list","touchObject","transformsEnabled","unslicked","extend","activeBreakpoint","animType","animProp","breakpoints","breakpointSettings","cssTransitions","focussed","interrupted","hidden","paused","positionProp","rowCount","shouldClick","$slider","$slidesCache","transformType","transitionType","visibilityChange","windowWidth","windowTimer","data","options","originalSettings","document","mozHidden","webkitHidden","autoPlay","proxy","autoPlayClear","autoPlayIterator","changeSlide","clickHandler","selectHandler","setPosition","swipeHandler","dragHandler","keyHandler","htmlExpr","registerBreakpoints","init","prototype","activateADA","find","attr","aria-hidden","tabindex","addSlide","slickAdd","markup","index","addBefore","unload","length"],"mappings":"CAgBA,SAAUA,gBAER,UAAYC,SAAW,YAAaA,OAASC,IAAE,CAC5CD,OAAS,CAAA,UAAaD,QACjB,UAAWG,UAAW,YAAe,CAC1CC,OAASD,QAAWH,EAAOK,QAAM,eAC3B,CACNL,EAAWM,UAPhB,CAUE,SAAAC,gBAEA,IAAGC,EAAWC,OAAKD,OAAW,GAE9BA,EAAW,WAEX,IAAAE,EAAwB,EAElB,SAASF,EAAKG,EAAQC,GAEnB,IAAKC,EAAAC,KAAUC,EAExBF,EAAYG,SAAW,CACTC,cAAW,KACZC,eAAgB,MACfC,aAAWZ,EAAKI,GAChBS,WAAWb,EAAAI,G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