PageSourceSearch

https://www.robinsonpetshop.it/app/plugins/rewardsystem/includes/frontend/js/frontendscripts.js?ver=31.3.0

js robinsonpetshop.it collected 2026-09-26 19:19:39 UTC 31,761 bytes, 585 lines download raw bytes

1jQuery( function ( $ ) {
2    'use strict' ;
3    var FPFrontendScripts = {
4        init : function ( ) {
5            if ( frontendscripts_params.enqueue_footable === '1' ) {
6                this.table_as_footable( ) ;
7            }
8
9            this.trigger_on_page_load() ;
10            this.toggle_birthday_date_field_on_myaccount() ;
11            this.toggle_birthday_date_field_on_checkout();
12            $( ".rs_success_msg_for_pointurl" ).fadeOut( 10000 ) ;
13            $( ".sk_failure_msg_for_pointsurl" ).fadeOut( 10000 ) ;
14            $( '.woocommerce_booking_variations' ).hide() ;
15            $( '#value_variable_product' ).hide() ;
16            $( '.rs-minimum-quantity-error-variable' ).hide();
17            $( document ).on( 'change' , 'input, wcva_attribute_radio' , this.message_for_variations ) ;
18            $( document ).on( 'click' , '.share_wrapper' , this.fb_share ) ;
19            $( document ).on( 'click' , '#refgeneratenow' , this.generated_referral_link ) ;
20            $( document ).on( 'click' , '.referrals, .footable-toggle' , this.display_social_icons_reward_table ) ;
21            $( document ).on( 'click' , 'a.add_removed_free_product_to_cart' , this.unset_removed_free_products ) ;
22            $( document ).on( 'click' , '.rs_copy_clipboard_image' , this.copy_to_clipboard ) ;
23            $( '#wc-bookings-booking-form' ).on( 'change' , 'input, select' , this.message_for_booking ) ;
24            $( document ).on( 'change' , '#rs_duration_type' , this.toggle_my_reward_table_date_filter ) ;
25            $( document ).on( 'click' , '#rs_submit' , this.prevent_submit_in_my_reward_table ) ;
26            $( document ).on( 'click' , '.toggle-email-share-button' , this.toggle_referral_email ) ;
27            $( document ).on( 'click' , '.email-share-close-button' , this.close_referral_email ) ;
28            $( document ).on( 'click' , '.email-share-button' , this.send_referral_email ) ;
29            $( document ).on( 'change' , '#rs_enable_earn_points_for_user_in_reg_form' , this.toggle_birthday_date_field_on_myaccount ) ;
30            $( document ).on( 'change' , '#enable_reward_prgm' , this.toggle_birthday_date_field_on_checkout ) ;
31            $( document ).on( 'click' , '#subscribeoption' , this.subscribe_or_unsubscribe_mail ) ;
32        
33        } ,
34        trigger_on_page_load : function ( ) {
35
36            if ( '1' == frontendscripts_params.is_date_filter_enabled ) {
37                // Date picker for my reward table date filter.
38                $( '#rs_custom_from_date_field' ).datepicker( { dateFormat : 'yy-mm-dd' } ) ;
39                $( '#rs_custom_to_date_field' ).datepicker( { dateFormat : 'yy-mm-dd' } ) ;
40
41                FPFrontendScripts.toggle_my_reward_table_date_filter() ;
42            }
43
44            if ( frontendscripts_params.variable_product_earnmessage == 'no' && '1' == frontendscripts_params.is_product_page ) {
45                $( '.variableshopmessage' ).next( 'br' ).hide() ;
46                $( '.variableshopmessage' ).hide( ) ;
47            } else {
48                $( '.variableshopmessage' ).next( 'br' ).show() ;
49                $( '.variableshopmessage' ).show( ) ;
50            }
51            
52            $( '.displaymessage' ).parent().hide() ;
53            
54            FPFrontendScripts.unsubscribe_email_link_alert();
55            $( '.rs_social_buttons' ).find( '.email-share-field' ).hide();
56        } ,
57        table_as_footable : function ( ) {
58            jQuery( '.my_reward_table' ).footable( ).bind( 'footable_filtering' , function ( e ) {
59                var selected = jQuery( '.filter-status' ).find( ':selected' ).text( ) ;
60                if ( selected && selected.length > 0 ) {
61                    e.filter += ( e.filter && e.filter.length > 0 ) ? ' ' + selected : selected ;
62                    e.clear = ! e.filter ;
63                }
64            } ) ;
65            
66            jQuery( '#change-page-sizes' ).change( function ( e ) {
67                e.preventDefault( ) ;
68                var pageSize = jQuery( this ).val( ) ;
69                jQuery( '.footable' ).data( 'page-size' , pageSize ) ;
70                jQuery( '.footable' ).trigger( 'footable_initialized' ) ;
71            } ) ;
72            jQuery( '#page_size_for_points' ).change( function ( e ) {
73                e.preventDefault( ) ;
74                var pageSize = jQuery( this ).val( ) ;
75                jQuery( '.footable' ).data( 'page-size' , pageSize ) ;
76                jQuery( '.footable' ).trigger( 'footable_initialized' ) ;
77            } ) ;
78
79            // Footable for Shortcode 'rs_points_earned_in_a_specific_duration'.
80            jQuery( '.rs_points_earned_in_specific_duration' ).footable() ;
81            
82            jQuery( '.list_of_orders' ).footable() ;
83            jQuery( '#change-page-sizesss' ).change( function ( e ) {
84                e.preventDefault() ;
85                var pageSize = jQuery( this ).val() ;
86                jQuery( '.footable' ).data( 'page-size' , pageSize ) ;
87                jQuery( '.footable' ).trigger( 'footable_initialized' ) ;
88	    } ) ;
89        } ,
90        display_social_icons_reward_table : function ( ) {
91            $( '.rs_social_buttons .fb-share-button span' ).css( "width" , "60px" ) ;
92            $( '.rs_social_buttons .fb-share-button span iframe' ).css( { "width" : "59px" , "height" : "29px" , "visibility" : "visible" } ) ;
93            $( '.rs_social_buttons iframe.twitter-share-button' ).css( { "width" : "59px" , "height" : "29px" , "visibility" : "visible" } ) ;
94            $( '.rs_social_buttons' ).find( '.toggle-email-share-button' ).show();
95            $( '.rs_social_buttons' ).find( '.email-share-field' ).hide();
96        } ,
97        generated_referral_link : function ( ) {
98            var urlstring = jQuery( '#generate_referral_field' ).val( ) ;
99            var data = ( {
100                action : 'generate_referral_link' ,
101                url : urlstring ,
102                sumo_security : frontendscripts_params.generate_referral
103            } ) ;
104            $.post( frontendscripts_params.ajaxurl , data , function ( response ) {
105                if ( true === response.success ) {
106                    window.location.reload( ) ;
107                } else {
108                    window.alert( response.data.error ) ;
109                }
110            } ) ;
111        } ,
112        fb_share : function ( evt ) {
113            evt.preventDefault( ) ;
114            var a = document.getElementById( 'share_wrapper' )
115            var url = a.getAttribute( 'href' ) ;
116            var image = a.getAttribute( 'data-image' ) ;
117            var title = a.getAttribute( 'data-title' ) ;
118            var description = a.getAttribute( 'data-description' ) ;
119            if ( image == '' ) {
120                FB.ui( {
121                    method : 'share_open_graph' ,
122                    action_type : 'og.shares' ,
123                    action_properties : JSON.stringify( {
124                        object : {
125                            'og:url' : url ,
126                            'og:title' : title ,
127                            'og:description' : description ,
128                        }
129                    } )
130                } , function ( response ) {
131                    // Action after response
132                    if ( response != null ) {
133                        alert( 'Sucessfully Shared' ) ;
134                    } else {
135                        alert( 'Cancelled' ) ;
136                    }
137                } ) ;
138            } else {
139                FB.ui( {
140                    method : 'share_open_graph' ,
141                    action_type : 'og.shares' ,
142                    action_properties : JSON.stringify( {
143                        object : {
144                            'og:url' : url ,
145                            'og:title' : title ,
146                            'og:description' : description ,
147                            'og:image' : image
148                        }
149                    } )
150                } , function ( response ) {
151                    // Action after response
152                    if ( response != null ) {
153                        alert( 'Sucessfully Shared' ) ;
154                    } else {
155                        alert( 'Cancelled' ) ;
156                    }
157                } ) ;
158            }
159            return false ;
160        } ,
161        unset_removed_free_products : function ( evt ) {
162            var data = {
163                action : 'unsetproduct' ,
164                sumo_security : frontendscripts_params.unset_product ,
165                key_to_remove : $( evt.target ).data( 'product_id' ) ,
166            } ;
167            $.post( frontendscripts_params.ajaxurl , data , function ( response ) {
168                if ( true === response.success ) {
169                    window.location.reload( ) ;
170                } else {
171                    window.alert( response.data.error ) ;
172                }
173            } ) ;
174        } ,
175        message_for_booking : function ( ) {
176            var xhr ;
177            if ( xhr )
178                xhr.abort() ;
179            var form = jQuery( this ).closest( 'form' ) ;
180            var data = ( {
181                action : 'messageforbooking' ,
182                form : form.serialize() ,
183                sumo_security : frontendscripts_params.booking_msg
184            } ) ;
185            $.post( frontendscripts_params.ajaxurl , data , function ( response ) {
186                if ( true === response.success ) {
187                    if ( ( response.data.sumorewardpoints !== 0 ) && ( response.data.sumorewardpoints !== '' ) ) {
188                        $( '.woocommerce_booking_variations' ).addClass( 'woocommerce-info' ) ;
189                        $( '.woocommerce_booking_variations' ).show() ;
190                        $( '.sumobookingpoints' ).html( response.data.sumorewardpoints ) ;
191                    } else {
192                        $( '.woocommerce_booking_variations' ).hide() ;
193                    }
194                } else {
195                    window.alert( response.data.error ) ;
196                }
197            } ) ;
198        } ,
199        message_for_variations : function ( ) {
200            if ( ! $( this ).closest( 'div.single_variation_wrap' ).find( 'input:hidden[name=variation_id], input.variation_id' ).length )
201                return false ;
202
203            if ( 'no' === frontendscripts_params.check_purchase_notice_for_variation && 'no' === frontendscripts_params.check_referral_notice_for_variation && 'no' === frontendscripts_params.check_buying_notice_for_variation ) {
204                return false ;
205            }
206
207            var variation_id = $( this ).closest( 'div.single_variation_wrap' ).find( 'input:hidden[name=variation_id], input.variation_id' ).val() ;
208            if ( variation_id === '' || variation_id === 0 || variation_id === undefined ) {
209                $( '#value_variable_product' ).hide() ;
210                $( '#buy_Point_value_variable_product' ).hide() ;
211                $( '.rs_variable_earn_messages' ).hide() ;
212                $( '.rs-minimum-quantity-error-variable' ).hide();
213                if ( frontendscripts_params.variable_product_earnmessage === 'no' ) {
214                    $( '.variableshopmessage' ).hide( ) ;
215                    $( '.variableshopmessage' ).next( 'br' ).hide() ;
216                }
217                return false ;
218            } else {
219                $( '#value_variable_product1' ).hide() ;
220                $( '#value_variable_product2' ).hide() ;
221                var data = ( {
222                    action : 'getvariationpoints' ,
223                    variation_id : variation_id ,
224                    sumo_security : frontendscripts_params.variation_msg
225                } ) ;
226                $.post( frontendscripts_params.ajaxurl , data , function ( response ) {
227                    if ( true === response.success ) {
228                            if ( frontendscripts_params.productpurchasecheckbox == 'yes' ) {
229                                if ( frontendscripts_params.showreferralmsg == '1' ) {
230                                    if ( response.data.showmsg && response.data.earnpointmsg != '' ) {
231                                        if ( frontendscripts_params.loggedinuser == "yes" ) {
232                                            if ( frontendscripts_params.showearnmsg == '1' ) {
233                                                $( '.variableshopmessage' ).show() ;
234                                                $( '.variableshopmessage' ).next( 'br' ).show() ;
235                                                $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
236
237                                                // Troubleshoot option in Earn Messages for Variations
238                                                $( '.rs_variable_earn_messages' ).show() ;
239                                                $( '.rs_variable_earn_messages' ).html( response.data.earnpointmsg ) ;
240                                            }
241                                        } else {
242                                            if ( frontendscripts_params.showearnmsg_guest == '1' ) {
243                                                $( '.variableshopmessage' ).show() ;
244                                                $( '.variableshopmessage' ).next( 'br' ).show() ;
245                                                $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
246
247                                                // Troubleshoot option in Earn Messages for Variations
248                                                $( '.rs_variable_earn_messages' ).show() ;
249                                                $( '.rs_variable_earn_messages' ).html( response.data.earnpointmsg ) ;
250                                            }
251                                        }
252                                    } else {
253                                        $( '.variableshopmessage' ).next( 'br' ).hide() ;
254                                        $( '.variableshopmessage' ).hide( ) ;
255
256                                        $( '.rs_variable_earn_messages' ).hide() ;
257                                    }
258                                    $( '.gift_icon' ).show() ;
259
260                                    $( '#referral_value_variable_product' ).addClass( 'woocommerce-info rs_message_for_single_product' ) ;
261                                    $( '#referral_value_variable_product' ).show() ;
262                                    $( '#referral_value_variable_product' ).html( response.data.refmsg ) ;
263                                }
264                                if ( frontendscripts_params.showbuyingmsg == '1' && response.data.buymsg != '' ) {
265                                    $( '.variableshopmessage' ).show() ;
266                                    $( '.variableshopmessage' ).next( 'br' ).show() ;
267                                    if ( response.data.earnpointmsg != '' ) {
268                                        if ( frontendscripts_params.loggedinuser == "yes" ) {
269                                            if ( frontendscripts_params.showearnmsg == '1' ) {
270                                                $( '.variableshopmessage' ).append( '<br>' + response.data.buymsg + '</br>' ) ;
271                                            } else {
272                                                $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) ;
273                                            }
274                                        } else {
275                                            if ( frontendscripts_params.showearnmsg_guest == '1' ) {
276                                                $( '.variableshopmessage' ).append( '<br>' + response.data.buymsg + '</br>' ) ;
277                                            } else {
278                                                $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) ;
279                                            }
280                                        }
281                                    } else {
282                                        $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) ;
283                                    }
284                                }
285                                if ( frontendscripts_params.showpurchasemsg == '1' && response.data.purchasemsg ) {
286                                    $( '#value_variable_product' ).addClass( 'woocommerce-info rs_message_for_single_product' ) ;
287                                    $( '#value_variable_product' ).show() ;
288                                    $( '#value_variable_product' ).html( response.data.purchasemsg ) ;
289                                    if ( response.data.earnpointmsg != '' ) {
290                                        if ( frontendscripts_params.loggedinuser == "yes" ) {
291                                            if ( frontendscripts_params.showearnmsg == '1' ) {
292                                                $( '.variableshopmessage' ).show() ;
293                                                $( '.variableshopmessage' ).next( 'br' ).show() ;
294                                                $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
295                                            }
296                                        } else {
297                                            if ( frontendscripts_params.showearnmsg_guest == '1' ) {
298                                                $( '.variableshopmessage' ).show() ;
299                                                $( '.variableshopmessage' ).next( 'br' ).show() ;
300                                                $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
301                                            }
302                                        }
303                                    }
304                                }
305                                if ( response.data.earnpointmsg != '' ) {
306                                    if ( frontendscripts_params.loggedinuser == "yes" ) {
307                                        if ( frontendscripts_params.showearnmsg == '1' ) {
308                                            $( '.variableshopmessage' ).show() ;
309                                            $( '.variableshopmessage' ).next( 'br' ).show() ;
310                                            $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
311                                        }
312                                    } else {
313                                        if ( frontendscripts_params.showearnmsg_guest == '1' ) {
314                                            $( '.variableshopmessage' ).show() ;
315                                            $( '.variableshopmessage' ).next( 'br' ).show() ;
316                                            $( '.variableshopmessage' ).html( response.data.earnpointmsg ) ;
317                                        }
318                                    }
319                                }
320                            } else {
321                                if ( frontendscripts_params.showreferralmsg == '1' ) {
322                                    $( '#referral_value_variable_product' ).addClass( 'woocommerce-info rs_message_for_single_product' ) ;
323                                    $( '#referral_value_variable_product' ).show() ;
324                                    $( '#referral_value_variable_product' ).html( response.data.refmsg ) ;
325                                }
326                            }
327                            if ( frontendscripts_params.buyingpointscheckbox == 'yes' ) {
328                                if ( frontendscripts_params.buyingmsg == '1' && response.data.showbuypoint == '1' && response.data.buying_msg != '' ) {
329                                    $( '#buy_Point_value_variable_product' ).addClass( 'woocommerce-info rs_message_for_single_product' ) ;
330                                    $( '#buy_Point_value_variable_product' ).show() ;
331                                    $( '#buy_Point_value_variable_product' ).html( response.data.buying_msg ) ;
332                                } else {
333                                    $( '#buy_Point_value_variable_product' ).hide() ;
334                                }
335                                if ( frontendscripts_params.showbuyingmsg == '1' && response.data.buymsg != '' ) {
336                                    $( '.variableshopmessage' ).show() ;
337                                    $( '.variableshopmessage' ).next( 'br' ).show() ;
338                                    if ( response.data.earnpointmsg != '' && frontendscripts_params.productpurchasecheckbox == 'yes' ) {
339                                        if ( frontendscripts_params.loggedinuser == "yes" ) {
340                                            if ( frontendscripts_params.showearnmsg == '1' ) {
341                                                $( '.variableshopmessage' ).append( '<br>' + response.data.buymsg + '</br>' ) ;
342                                            } else {
343                                                $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) ;
344                                            }
345                                        } else {
346                                            if ( frontendscripts_params.showearnmsg_guest == '1' ) {
347                                                $( '.variableshopmessage' ).append( '<br>' + response.data.buymsg + '</br>' ) ;
348                                            } else {
349                                                $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) ;
350                                            }
351                                        }
352                                    } else {
353                                        $( '.variableshopmessage' ).html( '<br>' + response.data.buymsg + '</br>' ) 
353;
354                                    }
355                                }
356                            }
357                            
358                            if(response.data.min_quantity_error_message){
359                                $( '.rs-minimum-quantity-error-variable' ).show();
360                                $( '.rs-minimum-quantity-error-variable' ).addClass("woocommerce-error");
361                                $( '.rs-minimum-quantity-error-variable' ).html( response.data.min_quantity_error_message ) ;
362                            }
363                    } else {
364                        window.alert( response.data.error ) ;
365                    }
366                } ) ;
367            }
368        } ,
369        copy_to_clipboard : function () {
370
371            /* Code Improvement for Copy Link Functionality in V23.8 */
372
373            var input = document.createElement( 'input' ) ;
374            input.setAttribute( 'readonly' , false ) ;
375            input.setAttribute( 'contenteditable' , true ) ;
376            input.style.position = 'fixed' ; // prevent scroll from jumping to the bottom when focus is set.
377            input.value = $( this ).attr( 'data-referralurl' ) ;
378            document.body.appendChild( input ) ;
379
380            var range = document.createRange() ;
381            range.selectNodeContents( input ) ;
382            var sel = window.getSelection() ;
383            sel.removeAllRanges() ;
384            sel.addRange( range ) ;
385            input.setSelectionRange( 0 , 999999 ) ;
386
387            input.focus() ;
388            input.select() ;
389
390            document.execCommand( 'copy' ) ;
391
392            input.contentEditable = false ;
393            input.readOnly = false ;
394
395            $( '.rs_alert_div_for_copy' ).css( { display : 'block' } ).delay( 7000 ).fadeOut() ;
396
397            input.remove() ;
398        } ,
399        toggle_my_reward_table_date_filter : function ( ) {
400            if ( '5' == $( '#rs_duration_type' ).val( ) ) {
401                $( 'table.rs-my-reward-date-filter' ).find( '#rs_submit' ).removeClass( 'rs_disabled' ) ;
402                $( '#rs_custom_from_date_field' ).closest( 'tr' ).show( ) ;
403                $( '#rs_custom_to_date_field' ).closest( 'tr' ).show( ) ;
404            } else if ( '0' == $( '#rs_duration_type' ).val( ) ) {
405                $( 'table.rs-my-reward-date-filter' ).find( '#rs_submit' ).addClass( 'rs_disabled' ) ;
406                $( '#rs_custom_from_date_field' ).closest( 'tr' ).hide( ) ;
407                $( '#rs_custom_to_date_field' ).closest( 'tr' ).hide( ) ;
408            } else {
409                $( 'table.rs-my-reward-date-filter' ).find( '#rs_submit' ).removeClass( 'rs_disabled' ) ;
410                $( '#rs_custom_from_date_field' ).closest( 'tr' ).hide( ) ;
411                $( '#rs_custom_to_date_field' ).closest( 'tr' ).hide( ) ;
412            }
413        } ,
414        prevent_submit_in_my_reward_table : function () {
415
416            var $error_message = false ;
417
418            if ( '0' == $( '#rs_duration_type' ).val( ) ) {
419                $error_message = frontendscripts_params.default_selection_error_message ;
420            }
421
422            if ( '5' == $( '#rs_duration_type' ).val( ) ) {
423                var $from_date = $( '#rs_custom_from_date_field' ).val() ;
424                var $to_date = $( '#rs_custom_to_date_field' ).val() ;
425
426                if ( ! $from_date || ! $to_date ) {
427                    $error_message = frontendscripts_params.custom_date_error_message ;
428                }
429            }
430
431            if ( $error_message ) {
432                alert( $error_message )
433                return false ;
434            }
435        } ,
436        unsubscribe_email_link_alert:function(){                        
437            $.urlParam = function( name ) {
438				var results = new RegExp( '[\?&]' + name + '=([^&#]*)' ).exec( window.location.href ) ;
439				if ( results ) {
440					return results[1] ;
441				} else {
442					return 0 ;
443				}
444			}
445                        
446            var $email_user_id = $.urlParam( 'userid' ),
447                $email_unsub_link = $.urlParam( 'unsub' ),
448                $unsub_link_nonce = $.urlParam( 'nonce' );    
449            
450            if(!$email_user_id || !$email_unsub_link || !$unsub_link_nonce){
451		        return false;
452            }
453            
454            if(!frontendscripts_params.is_user_logged_in){
455                alert( frontendscripts_params.loggedinuser_err );
456                window.location.href = frontendscripts_params.myaccount_url;
457                return false;
458            }
459            
460            if( $email_user_id != frontendscripts_params.user_id || 'yes' != $email_unsub_link){
461                alert(frontendscripts_params.unsub_link_error);
462		        return false;
463            }
464            
465            let data = ( {
466                action : 'unsubscribe_user' ,
467                user_id : $email_user_id ,
468                sumo_security : frontendscripts_params.unsubscribe_user,
469            } ) ;
470
471            $.post( frontendscripts_params.ajaxurl , data , function ( res ) {                
472                if ( true === res.success ) {
473                    alert(frontendscripts_params.unsub_link_success);
474                } else {
475                    alert(res.data.error);
476                }
477
478                window.location.href = frontendscripts_params.myaccount_url;
479            } );
480
481        },
482        block : function ( id ) {
483            $( id ).block( {
484                message : null ,
485                overlayCSS : {
486                    background : '#fff' ,
487                    opacity : 0.6
488                }
489            } ) ;
490        } ,
491        unblock : function ( id ) {
492            $( id ).unblock( ) ;
493        } ,
494
495        toggle_referral_email : function ( e ) {
496            e.preventDefault();
497            let $this = $( e.currentTarget );
498            $( $this ).hide();
499            $( '.rs_social_buttons' ).find( '.email-share-field' ).show();
500        } ,
501
502        close_referral_email : function ( e ) {
503            e.preventDefault();
504            let $this = $( e.currentTarget );
505            $( $this ).closest('p').find( '#receiver_email_ids' ).val('');
506            $( $this ).closest('p').hide();
507            $( $this ).closest('div').find( '.toggle-email-share-button' ).show();
508            $($this).closest('p').find('.error, .success').remove();
509        } ,
510
511        send_referral_email : function ( e ) {
512            e.preventDefault();
513            let $this = $( e.currentTarget ),
514                $ref_link = $($this).closest( '.email-share-field' ).find( '#email_ref_link' ).val(),
515                $receiver_ids = $($this).closest( '.email-share-field' ).find( '#receiver_email_ids' ).val();            
516            $($this).closest('div').find('.error, .success').remove();
517            
518            if ( '' === $receiver_ids ){
519                $($this).closest('p').append('<p class="error">Enter any email id with comma separate.</p>');
520                return;
521            }
522            var data = ( {
523                action : 'send_referral_email' ,
524                ref_link : $ref_link,
525                receiver_ids : $receiver_ids,
526                sumo_security : frontendscripts_params.send_referral_email
527            } ) ;
528            FPFrontendScripts.block($($this).closest('p'));
529            $.post( frontendscripts_params.ajaxurl , data , function ( res ) {                
530                if ( true === res.success ) {
531                    $($this).closest('p').hide() ;
532                    $($this).closest('div').find('.toggle-email-sh
532are-button').show();
533                    $($this).closest('div').append('<p class="success">'+res.data+'</p>');
534                    $($this).closest('div').find('.success').fadeOut( 10000 ) ;
535                    $($this).closest('p').find( '#receiver_email_ids' ).val('');
536                } else {
537                    $($this).closest('p').append( '<p class="error">'+res.data.error+' '+res.data.ids+'</p>' );
538                }
539
540                FPFrontendScripts.unblock($($this).closest('p'));
541            } );
542        } ,
543
544        toggle_birthday_date_field_on_myaccount : function ( ) {
545            if ( 'yes' === $('#rs_enable_earn_points_for_user_in_reg_form').data('enable-reward-program') ){
546                if( false === $('#rs_enable_earn_points_for_user_in_reg_form').is(':checked') ){
547                    $( '#srp_birthday_date' ).closest('p').hide();
548                } else {
549                    $( '#srp_birthday_date' ).closest('p').show();
550                }
551            } else {
552                $( '#srp_birthday_date' ).closest('p').show();
553            }
554        } ,
555
556        toggle_birthday_date_field_on_checkout : function ( ) {
557            if( 'yes' === $('#enable_reward_prgm').closest('p').find('.checkbox').data('enable-reward-program') ){
558                if( false === $('#enable_reward_prgm').is(':checked') ){
559                    $( '#srp_birthday_date_field' ).closest('p').hide();
560                } else {
561                    $( '#srp_birthday_date_field' ).closest('p').show();
562                }                
563            } else {             
564                $( '#srp_birthday_date_field' ).closest('p').show();
565            }
566        } ,
567        subscribe_or_unsubscribe_mail : function () {
568            var subscribe = $( '#subscribeoption' ).is( ':checked' ) ? 'yes' : 'no' ;
569            var data = {
570                action : "subscribemail" ,
571                subscribe : subscribe ,
572                sumo_security : frontendscripts_params.fp_subscribe_mail
573            } ;
574            $.post( frontendscripts_params.ajaxurl , data , function ( response ) {
575                if ( true === response.success ) {
576                    window.alert( response.data.content ) ;
577                } else {
578                    window.alert( response.data.error ) ;
579                }
580            } ) ;
581        } ,
582
583    } ;
584    FPFrontendScripts.init( ) ;
585} ) ;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.