{"version":3,"file":"gf_tooltip.js","names":["gftt","$","colorPickerChoicesDynamicPosition","form_id","find","each","$icon","this","$choice","parent","offset","width","toString","css","init","forced","$formWrapper","$this","closest","length","addClass","tipID","data","$tip","tipPlacement","userOptions","gform","applyFilters","mainOptions","manual","followMouse","mouseOnToPopup","smartPlacement","popupClass","placement","options","extend","powerTip","on","powerTipPreRender","powerTipRender","document","trigger","powerTipOpen","powerTipClose","removeClass","$label","e","preventDefault","stopImmediatePropagation","$container","not","focus","$self","documentElement","window","setTimeout","event","current_page","globalDelay","hasOwnProperty","parseInt","gf_tooltips_init_delay","delay","jQuery"],"sources":["gf_tooltip.js"],"sourcesContent":["var gftt = gftt || {};\r\n\r\n(function($){\r\n\t'use strict';\r\n\r\n\tgftt.colorPickerChoicesDynamicPosition = function( form_id ) {\r\n\t\tvar $formWrapper = ( typeof form_id !== \"undefined\" ) ? $('#gform_wrapper_'+form_id) : $(\".gform_wrapper\");\r\n\t\t$formWrapper.find('.color-picker-choice .gftt-icon').each(function(){\r\n\t\t\tvar $icon = $(this);\r\n\t\t\tvar $choice = $icon.parent();\r\n\t\t\tvar $label = $choice.find('> label');\r\n\t\t\tvar offset = ( $label.width() - $choice.width() ).toString();\r\n\t\t\t$icon.css('transform', 'translateX(' + offset + 'px)');\r\n\t\t});\r\n\t};\r\n\r\n\tgftt.init = function( form_id, forced ){\r\n\r\n\t\tvar $formWrapper = $('#gform_wrapper_'+form_id);\r\n\r\n\t\t/*\r\n\t\tvar gfttHasInit = $formWrapper.data('gftt-init');\r\n\t\tif ( typeof gfttHasInit !== 'undefined' && gfttHasInit.toString() === 'true' && forced !== true ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t*/\r\n\r\n\t\t$formWrapper.find('.gftt-content > span').each(function(){\r\n\t\t\tvar $this = $(this);\r\n\r\n\t\t\tvar $choice = $this.closest('.gchoice');\r\n\t\t\tif ( $choice.length ) {\r\n\t\t\t\t$choice.addClass('gform-theme__no-reset--children');\r\n\t\t\t}\r\n\r\n\t\t\tvar tipID = $this.data('tid');\r\n\t\t\tvar $tip = $('#'+tipID);\r\n\t\t\tvar tipPlacement = $tip.data('placement');\r\n\t\t\tif (typeof tipPlacement === 'undefined' || tipPlacement === '') {\r\n\t\t\t\ttipPlacement = 'nw-alt';\r\n\t\t\t}\r\n\t\t\t$tip.data('powertiptarget', tipID+'-content');\r\n\t\t\tvar userOptions = gform.applyFilters( 'gftt_tooltip_custom_options', {} );\r\n\t\t\tvar mainOptions = {\r\n\t\t\t\tmanual: false,\r\n\t\t\t\tfollowMouse: false,\r\n\t\t\t\tmouseOnToPopup: true,\r\n\t\t\t\tsmartPlacement: true,\r\n\t\t\t\tpopupClass: tipID,\r\n\t\t\t\tplacement: tipPlacement\r\n\t\t\t};\r\n\t\t\tvar options = $.extend( true, userOptions, mainOptions );\r\n\t\t\t$tip.powerTip(options);\r\n\t\t\t$tip.on({\r\n\t\t\t\tpowerTipPreRender: function(){\r\n\t\t\t\t\t$('body').addClass('gftt_show');\r\n\t\t\t\t},\r\n\t\t\t\tpowerTipRender: function(){\r\n\t\t\t\t\tvar $self = $(this);\r\n\t\t\t\t\t$self.powerTip('reposition');\r\n\t\t\t\t\t$(document).trigger('gftt_tooltip_render', [this]);\r\n\t\t\t\t},\r\n\t\t\t\tpowerTipOpen: function(){\r\n\t\t\t\t\tvar $self = $(this);\r\n\t\t\t\t\t$self.data('tip-open', true);\r\n\t\t\t\t\t$(document).trigger('gftt_tooltip_open', [this]);\r\n\t\t\t\t},\r\n\t\t\t\tpowerTipClose: function(){\r\n\t\t\t\t\tvar $self = $(this);\r\n\t\t\t\t\t$self.data('tip-open', false);\r\n\t\t\t\t\t$('body').removeClass('gftt_show');\r\n\t\t\t\t\t$(document).trigger('gftt_tooltip_close', [this]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$formWrapper.find('.gftt-label').each(function(){\r\n\t\t\tvar $label = $(this);\r\n\t\t\tvar $gfLabel = $label.closest('.gfield_label');\r\n\t\t\t$gfLabel.on('click', function(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t});\r\n\t\t\t$label.on('click', function(e){\r\n\t\t\t\tvar $container = $(this).closest('.gfield').find('.ginput_container');\r\n\t\t\t\tif ($container.length) {\r\n\t\t\t\t\tif ( $container.find('input:first').not(':radio').not(':checkbox').length ) {\r\n\t\t\t\t\t\t$container.find('input:first').not(':radio').not(':checkbox').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( $container.find('textarea:first').length ) {\r\n\t\t\t\t\t\t$container.find('textarea:first').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( $container.find('select:first').length ) {\r\n\t\t\t\t\t\t$container.find('select:first').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$formWrapper.find('.gftt-icon').on('click', function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tvar $self = $(this);\r\n\t\t\tif ( $self.data('tip-open') === true ) {\r\n\t\t\t\t$self.powerTip('hide');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$self.powerTip('show');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif ('ontouchstart' in document.documentElement) {\r\n\t\t\t// This is a touch-based device.\r\n\t\t}\r\n\r\n\t\tvar dynamicPosition = gform.applyFilters('gftt_dynamic_colorpicker_choices_position', true, form_id);\r\n\t\tif ( dynamicPosition ) {\r\n\t\t\t$(window).on('resize', function(){\r\n\t\t\t\tgftt.colorPickerChoicesDynamicPosition( form_id );\r\n\t\t\t});\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tgftt.colorPickerChoicesDynamicPosition( form_id );\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\t$formWrapper.data('gftt-init', true);\r\n\r\n\t}\r\n\r\n\t$(document).on('gform_post_render', function(event, form_id, current_page){\r\n\t\tvar globalDelay = ( window.hasOwnProperty('gf_tooltips_init_delay') ) ? parseInt( window.gf_tooltips_init_delay, 10 ) : 0;\r\n\t\tvar delay = gform.applyFilters( 'gftt_tooltips_init_delay', globalDelay );\r\n\t\tif ( delay === 0 && $('#gform_' + form_id + ' .gpnf-nested-entries-container').length ) {\r\n\t\t\t// Seems we need to slightly delay the tooltip init if the form is using Gravity Wiz' Nested Forms and that field has a tooltip\r\n\t\t\tdelay = 1;\r\n\t\t}\r\n\t\tif ( delay > 0 ) {\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tgftt.init( form_id );\r\n\t\t\t}, delay * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tgftt.init( form_id );\r\n\t\t}\r\n\t});\r\n\r\n})(jQuery);\r\n"],"mappings":"AAAA,IAAIA,KAAOA,MAAQ,CAAC,GAEpB,SAAUC,GACT,aAEAD,KAAKE,kCAAoC,SAAUC,GACMF,OAAhB,IAAZE,EAA8B,kBAAkBA,EAAa,kBAC5EC,KAAK,mCAAmCC,MAAK,WACzD,IAAIC,EAAQL,EAAEM,MACVC,EAAUF,EAAMG,SAEhBC,GADSF,EAAQJ,KAAK,WACJO,QAAUH,EAAQG,SAAUC,WAClDN,EAAMO,IAAI,YAAa,cAAgBH,EAAS,MACjD,GACD,EAEAV,KAAKc,KAAO,SAAUX,EAASY,GAE9B,IAAIC,EAAef,EAAE,kBAAkBE,GASvCa,EAAaZ,KAAK,wBAAwBC,MAAK,WAC9C,IAAIY,EAAQhB,EAAEM,MAEVC,EAAUS,EAAMC,QAAQ,YACvBV,EAAQW,QACZX,EAAQY,SAAS,mCAGlB,IAAIC,EAAQJ,EAAMK,KAAK,OACnBC,EAAOtB,EAAE,IAAIoB,GACbG,EAAeD,EAAKD,KAAK,kBACD,IAAjBE,GAAiD,KAAjBA,IAC1CA,EAAe,UAEhBD,EAAKD,KAAK,iBAAkBD,EAAM,YAClC,IAAII,EAAcC,MAAMC,aAAc,8BAA+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