(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var ui = require( './../libs/ui.js' );

(function($)
{
  "use strict";

  $(document).ready(function()
  {
    //
    //Init ui
    ui.base.modal.prototype.top_margin = '20px';
    var modal  = new ui.base.modal();

    ui.base.loader.prototype.image_base  = ipjck_img_url;
    ui.base.loader.prototype.loader_file = 'loading.gif';
    var loader  = new ui.base.loader();
    var message = new ui.base.message();

    var winWidth = $(window).width();

    //
    //Form horizontal setup
    function formHorizontalSetup()
    {
      $( '.ipjck-form-horizontal' ).each( function()
      {
        var form   = $(this);
        var widget = form.parents( '.ipjck-widget' );
        widget.show();

        var formWidth  = form.width();
        var btnWidth   = $( '.ipjck-form-submit', form ).width();
        var fieldWidth = formWidth - btnWidth - 15;
        $( '.ipjck-fields', form ).width( fieldWidth );
        $( '.ipjck-form-input', form ).width( fieldWidth - 20 );

        widget.hide();
      });
    };
    formHorizontalSetup();

    //
    //Fixed widget height
    if ( $( '.ipjck-bar.ipjck-template-5' ).length > 0 )
    {
      var widget = $( '.ipjck-bar.ipjck-template-5' );
      widget.show();
      var contentHeight = $( '.ipjck-widget-content', widget ).height();

      $( '.ipjck-widget-main', widget ).height( contentHeight );
      $( '.ipjck-widget-main-inner', widget ).innerHeight( contentHeight );
      $( '.ipjck-widget-secondary', widget ).height( contentHeight );

      widget.hide();
    }
    if ( $( '.ipjck-bar.ipjck-template-6' ).length > 0 )
    {
      var widget = $( '.ipjck-bar.ipjck-template-6' );
      widget.show();
      var contentHeight = $( '.ipjck-widget-secondary', widget ).height();

      $( '.ipjck-widget-main', widget ).height( contentHeight+20 );
      $( '.ipjck-widget-main-inner', widget ).innerHeight( contentHeight+20 );

      widget.hide();
    }

    //
    //Fixed modal full
    if ( $( '.ipjck-modal-full' ).length > 0 )
    {
      $( '.ipjck-modal-full' ).each( function()
      {
        var modal = $(this);
        modal.show();

        var modalHeight   = $( '.ipjck-widget-inner', modal ).height();
        var contentHeight = $( '.ipjck-widget-main', modal ).height();
        var contentTop    = (modalHeight - contentHeight - 100)/2;
        $( '.ipjck-widget-content', modal ).css( 'paddingTop', contentTop + 'px' );

        modal.hide();
      });
    }

    //
    //Widget library
    //
    var IPScri_Widget =
    {
      //
      //Submit form subscribe
      //
      subscribeSubmit: function( widget )
      {
        var $this = this;

        //
        //Submit form subscribe
        //
        $( '.ipjck-form-submit button', widget ).click( function()
        {
          var button   = $(this);
          var form     = button.parents( '.ipjck-form' );
          var root     = button.parents( '.ipjck-widget' );
          var sett     = $( '.ipjck-setting-submission', root );
          var widgetId = sett.data( 'id' );

          //
          //Check email
          var email = $( '#ipjck-input-email', form ).val();
          if ( email == '' || email == ' ' ) {
            $( '.ipjck-form-message' ).removeClass( 'show' );
            $( '#ipjck-message-email-empty' ).addClass( 'show' );
            return false;
          }
          if ( ! $this.validateEmail( email ) ) {
            $( '.ipjck-form-message' ).removeClass( 'show' );
            $( '#ipjck-message-email-wrong' ).addClass( 'show' );
            return false;
          }

          var name  = '';
          if ( $( '#ipjck-input-name', form ).length > 0 )
          {
            var name = $( '#ipjck-input-name', form ).val();
            if ( name == '' || name == ' ' ) {
              $( '.ipjck-form-message' ).removeClass( 'show' );
              $( '#ipjck-message-name-empty' ).addClass( 'show' );
              return false;
            }
          }

          //Show loader
          $( '.ipjck-form-message' ).removeClass( 'show' );
          loader.show();

          //
          //Save stat
          $.ajax({
            url: ipjck_ajaxurl+'?doajax=1&ipjck=1&action=save_subscribe',
            type: "POST",
            data: 'widget_id='+widgetId+'&email='+email+'&name='+name,
            dataType: "json",
            success: function ( result )
            {
              //Hide loader
              loader.hide();

              if ( result.status == 0 )
              {
                $( '.ipjck-form-message' ).removeClass( 'show' );
                $( '#ipjck-message-error .ipjck-alert span' ).text( result.message );
                $( '#ipjck-message-error' ).addClass( 'show' );
                return false;
              }
              else
              {

                $( '.ipjck-form-message' ).removeClass( 'show' );
                $( '#ipjck-message-success .ipjck-alert span' ).text( result.message );
                $( '#ipjck-message-success' ).addClass( 'show' );

                //
                //Form submit
                $( 'form', root )[0].submit();
                //
                //Save cookie
                $this.saveSubmitCookie( root );
              }

            }
          });
          return false;
        });
      },

      //
      //Validating email
      //
      validateEmail: function(email)
      {
        var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(email);
      },

      //
      //Button adn link click handler
      //
      buttonSubmit: function( widget )
      {
        var $this = this;

        $( '.ipjck-action-button .ipjck-button, .ipjck-action-link .ipjck-link, .ipjck-action-social .ipjck-social-button', widget  )
          .click( function()
          {
            loader.show();

            var href       = $(this).attr( 'href' );
            var widget     = $(this).parents( '.ipjck-widget' );
            var submission = $( '.ipjck-setting-submission', widget );
            var widgetId   = submission.attr( 'data-id' );

            //
            //Save stat
            $.ajax({
              url: ipjck_ajaxurl+'?doajax=1&ipjck=1&action=savestat',
              type: "POST",
              data: 'widget_id='+widgetId+'&type=click',
              dataType: "json",
              success: function ( result )
              {
                window.location.href = href;
              }
            });

            return false;
          });
      },

      //
      //Close message
      //
      closeMessage: function( widget )
      {
        $( '.ipjck-form-message a', widget ).click( function()
        {
          var msg = $(this).parents( '.ipjck-form-message' );
          msg.removeClass( 'show' );
          return false;
        });
      },

      //
      //Behaviour
      //
      behaviour: function( widget )
      {
        var $this = this;
        //
        //First Show widget
        //
        if ( widget.hasClass( 'ipjck-widget-first-visible' ) )
        {
          $this.showWidget( widget );
        }
        //
        //After show widget
        //
        if ( widget.hasClass( 'ipjck-widget-first-after' ) )
        {
          var behaviour = $( '.ipjck-setting-behaviour', widget );
          var delay = behaviour.attr( 'data-show-delay' );
          delay *= 1000;

          setTimeout( function()
          {
            $this.showWidget( widget );
          }
          ,delay);
        }
        //
        //Behaviour widget
        //
        var effect    = $( '.ipjck-setting-effect', widget );
        var behaviour = $( '.ipjck-setting-behaviour', widget );

        //
        //Exit intent
        var exit = behaviour.attr( 'data-exit-intent' );
        if ( exit == 1 )
        {
          $('body').on('mouseleave', function () {
            setTimeout( function(){ $this.showWidget( widget ); }, 400 );
          });
        }

        //
        //Scroll
        var scroll = behaviour.attr( 'data-user-scroll' );
        var pageId = behaviour.attr( 'data-scroll-id' );
        var height = behaviour.attr( 'data-scroll-height' );

        var scrollIsShow = false;
        if ( scroll == 1 )
        {
          $(window).scroll( function()
          {
            if ( scrollIsShow ) {
              return true;
            }
            var scrollTop = $(window).scrollTop();
            if ( pageId != '' && $( '#'+pageId ).length > 0 )
            {
              var scrollContent = $( '#'+pageId ).offset().top;
              if ( scrollTop > scrollContent ) {
                $this.showWidget( widget );
                scrollIsShow = true;
              }
            }
            else if ( height != '' )
            {
              var heightNum = new Number( height );
              if ( scrollTop > heightNum ) {
                $this.showWidget( widget );
                scrollIsShow = true;
              }
            }
          });
        }

        //
        //Inactive
        //
        var inactive = behaviour.attr( 'data-user-inactive' );
        var time     = behaviour.attr( 'data-inactive-time' );

        if ( inactive == 1 )
        {
          var idleTimer = null;
          var idleState = false;
          var idleWait  = time*1000;

          $('*').bind('mousemove keydown scroll', function ()
          {
            clearTimeout(idleTimer);

            idleState = false;
            idleTimer = setTimeout(function()
            {
              idleState = true;
            }, idleWait);
          });

          var idleInterval = setInterval( function()
          {
            if ( idleState == true )
            {
              clearInterval( idleInterval );
              $this.showWidget( widget );
            }
          },100);
        };
      },

      //
      //Close widget
      //
      closeWidget: function( widget )
      {
        var $this = this;

        $( '.ipjck-close-button', widget ).click( function()
        {
          $this.hideWidget( widget );
          return false;
        });
      },

      //
      //Miniming widget
      //
      minimizeWidget: function( widget )
      {
        //
        //Setup Minimize widget
        //
        var content = $( '.ipjck-widget-content', widget );
        content.attr( 'data-height', content.height() );
        content.css( 'overflow', 'hidden' );

        $( '.ipjck-widget .ipjck-minimize-button', widget ).click( function()
        {
          var content = $( '.ipjck-widget-content', widget );
          var height  = content.attr( 'data-height' );
          var headHeight = $( '.ipjck-header', widget ).outerHeight();

          if ( widget.hasClass( 'minimized' ) )
          {
            content.velocity({
              height: height+'px',
              duration: 500
            });
            widget.removeClass( 'minimized' );
          }
          else
          {
            content.velocity({
              height: headHeight+4+'px',
              duration: 500
            });
            widget.addClass( 'minimized' )
          }
          return false;
        });
      },

      //
      //Show widget
      //
      showWidget: function( widget )
      {
        //
        //Check cookie
        //
        var behaviour  = $( '.ipjck-setting-behaviour', widget );
        var submission = $( '.ipjck-setting-submission', widget );
        var widgetId   = submission.attr( 'data-id' );

        var useCookie = behaviour.attr( 'data-cookies' );
        if ( useCookie == 1 )
        {
          var cookieClosing = this.getCookie( '__ipjck_repeat_closing' );
          var cookieConvers = this.getCookie( '__ipjck_repeat_conversion' );
          if ( ( cookieClosing && cookieClosing == 1 ) ||
               ( cookieConvers && cookieConvers == 1 )
          ) {
            return false;
          }
        }

        var content = $( '.ipjck-widget-content', widget );
        var overlay = $( '.ipjck-widget-overlay', widget );
        var setting = $( '.ipjck-setting-effect', widget );
        var effect  = setting.data( 'show_effect' );
        var speed   = setting.data( 'show_speed' );

        if ( effect == 'none' || typeof effect == 'undefined' ) {
          effect = 'transition.bounceIn';
        }

        overlay.css( 'opacity', 0 );
        widget.show();

        var winWidth     = $(window).width();
        var hideInMobile = setting.attr( 'data-disable-mobile' );

        if ( hideInMobile != 1 && winWidth < 480 )
        {
          content.show();
          overlay.css( 'opacity', 1 );
        }
        else
        {

          content.velocity( effect, {
            duration: speed
          });

          if ( widget.hasClass( 'ipjck-modal' ))
          {
            overlay.velocity({
              opacity: overlay.attr( 'data-opacity' ),
              duration: 500
            });
          }

          //
          //play audio
          this.playAudio( 'show', widget );
        }

        //
        //Save stat
        $.ajax({
          url: ipjck_ajaxurl+'?doajax=1&ipjck=1&action=savestat',
          type: "POST",
          data: 'widget_id='+widgetId+'&type=view',
          dataType: "json",
          success: function ( result ) {}
        });

      },

      //
      //Hide widget
      //
      hideWidget: function( widget )
      {
        var content = $( '.ipjck-widget-content', widget );
        var overlay = $( '.ipjck-widget-overlay', widget );
        var setting = $( '.ipjck-setting-effect', widget );
        var effect  = setting.data( 'hide_effect' );
        var speed   = setting.data( 'hide_speed' );

        if ( effect == 'none' || typeof effect == 'undefined' ) {
          effect = 'transition.bounceOut';
        }

        var winWidth     = $(window).width();
        var hideInMobile = setting.attr( 'data-disable-mobile' );

        if ( hideInMobile != 1 && winWidth < 480 )
        {
          content.hide();
          overlay.css( 'opacity', 0 );
          widget.hide();
        }
        else
        {
          content.velocity( effect, {
            duration: speed,
            complete: function()
            {
              setTimeout( function()
              {
                widget.hide();
              },1000 );
            }
          });

          if ( widget.hasClass( 'ipjck-modal' ))
          {
            overlay.velocity({
              opacity: 0,
              duration: 500
            });
          }

          //
          //play audio
          this.playAudio( 'hide', widget );
        }

        //
        //Save cookie
        this.saveCloseCookie( modal );
      },

      //
      //Playing audio
      playAudio: function( type, root )
      {
        if ( type == 'hide' ) {
          var audio = $( '.ipjck-audio-hide', root );
          if ( audio.length > 0 ) {
              audio[0].play();
          }
        } else
        {
          var audio = $( '.ipjck-audio-show', root );
          if ( audio.length > 0 ) {
              audio[0].play();
          }
        }
      },

      //
      //Save cookie when closing widget
      //
      saveCloseCookie: function( widget )
      {
        var behaviour = $( '.ipjck-setting-behaviour', widget );
        var useCookie = behaviour.attr( 'data-cookies' );

        if ( useCookie == 1 )
        {
          var day = behaviour.attr( 'data-closing' );
          this.createCookie( '__ipjck_repeat_closing', 1, day );
        }
      },

      //
      //Save cookie when submiting
      //
      saveSubmitCookie: function( widget )
      {
        var behaviour = $( '.ipjck-setting-behaviour', widget );
        var useCookie = behaviour.attr( 'data-cookies' );

        if ( useCookie == 1 )
        {
          var day = behaviour.attr( 'data-conversion' );
          this.createCookie( '__ipjck_repeat_conversion', 1, day );
        }
      },

      //
      //Creating cookie
      //
      createCookie: function(name, value, expires, path, domain)
      {
        var cookie = name + "=" + escape(value) + ";";

        if (expires) {
          // If it's a date
          if(expires instanceof Date) {
            // If it isn't a valid date
            if (isNaN(expires.getTime()))
             expires = new Date();
          }
          else
            expires = new Date(new Date().getTime() + parseInt(expires) * 1000 * 60 * 60 * 24);

          cookie += "expires=" + expires.toGMTString() + ";";
        }

        if (path)
          cookie += "path=" + path + ";";
        if (domain)
          cookie += "domain=" + domain + ";";

        document.cookie = cookie;
      },

      //
      //Get cookie value
      //
      getCookie: function(name)
      {
        var regexp = new RegExp("(?:^" + name + "|;\s*"+ name + ")=(.*?)(?:;|$)", "g");
        var result = regexp.exec(document.cookie);
        return (result === null) ? null : result[1];
      }

    };

    //
    //Main widget
    if ( $( '.ipjck-widget' ).length > 0 )
    {
      $( '.ipjck-widget' ).each( function()
      {
        var widget    = $(this);
        var behaviour = $( '.ipjck-setting-behaviour', widget );
        var effect    = $( '.ipjck-setting-effect', widget );
        var isPreview = widget.hasClass( 'ipjck-widget-preview' );

        //
        //Hide in mobile
        var winWidth     = $(window).width();
        var hideInMobile = behaviour.attr( 'data-disable-mobile' );
        if ( hideInMobile == 1 && winWidth < 768 ) {
          widget.remove();
        }

        if ( ! isPreview && ! ( hideInMobile == 1 && winWidth < 768 ) )
        {
          IPScri_Widget.subscribeSubmit( widget );
          IPScri_Widget.buttonSubmit( widget );
          IPScri_Widget.closeMessage( widget );
          IPScri_Widget.behaviour( widget );
          IPScri_Widget.closeWidget( widget );
          IPScri_Widget.minimizeWidget( widget );
        }
      });
    };

    //
    //Page click link
    //
    if ( $( '.ipjck-content' ).length > 0 )
    {
      var opt    = $( '.ipjck-content' ).attr( 'data-replace-link' );
      var pageId = $( '.ipjck-content' ).attr( 'data-page-id' );

      $( '.ipjck-content a' ).click( function()
      {
        if ( opt == '1' && pageId )
        {
          //Show loader
          loader.show();

          var href = $(this).attr( 'href' );

          $.ajax({
            url: ipjck_ajaxurl+'?doajax=1&ipjck=1&action=savestatpage',
            type: "POST",
            data: 'page_id='+pageId+'&type=click',
            dataType: "json",
            success: function ( result ) {
              window.location.href = href;
            }
          });
          return false;
        }
      });
    }

  });
})(jQuery);

},{"./../libs/ui.js":2}],2:[function(require,module,exports){
/*
 *===========================================================
 * UI
 *===========================================================
 */
var ui;

(function($)
{
    "use strict";

    //Inherit function
    function inherit( proto )
    {
        function F() {}
        F.prototype = proto
        return new F
    }

    /*
     *===========================================================
     * Ui prototype
     *===========================================================*/
    function ui_construct( options ){};

    ui_construct.prototype =
    {

        vars:               {},
        class_prefix:       'ipjck-',
        class_main:         '-main',
        class_title:        '-title',
        class_content:      '-content',
        class_disabled:     'disabled',
        class_close:        'ui-close',
        label_close:        'x',
        image_base:         '',

        top_margin:         '80px',
        overlay_speed:      600,
        main_speed:         400,
        show_speed:         4000,

        show_after:         function(){},
        hide_after:         function(){},

        popup_body: function( class_root, content, title, close )
        {
            var body = $( '<div class="'+class_root+'"></div>' );
            var main = $( '<div class="'+class_root + this.class_main+'"></div>' );
            if ( title )
            {
                var _title = $( '<div class="'+class_root + this.class_title+'"></div>' )
                                .append( '<h3>'+title+'</h3>' );
                if ( close )
                {
                    var _close = $( '<a href="#">'+this.label_close+'</a>' );
                    this.popup_close( _close, class_root );

                    _title.append(
                        $( '<div class="'+this.class_prefix+this.class_close+'"></div>' ).append( _close )
                    );
                }
                main.append( _title );
            }
            if ( content ) {
                main.append(
                    $( '<div class="'+class_root + this.class_content+'"></div>' ).append( content )
                );
            }
            body.append( main );
            return body;
        },
        popup_show: function( popup )
        {
            var c_root = popup.attr( 'class' );
            var main   = $( '.'+c_root+this.class_main, popup );
            popup.show();
            main.css( 'margin-top', '-40%' )
                .animate({marginTop: this.top_margin}, this.main_speed, this.show_after);
        },
        popup_hide: function( popup )
        {
            var c_root = popup.attr( 'class' );
            var main   = $( '.'+c_root+this.class_main, popup );

            popup.animate( {opacity: 0}, this.overlay_speed, function(){
                $(this).css( 'opacity', 1 )
                       .hide();
            });
            main.animate( {marginTop: '-60%'}, this.main_speed, this.hide_after);
        },
        popup_close: function( button, class_popup )
        {
            var ui = this;
            button.click( function(){
                var popup = $( '.'+class_popup );
                ui.popup_hide( popup );
                return false;
            });
        },
        is_load: function( selector )
        {
            if ( $( selector ).length > 0 ) {
                return true;
            }
            return false;
        },
        set_vars: function( options )
        {
            this.vars = $.extend(this.vars, options);
        },
        set_base_vars: function( options )
        {
            this.vars = $.extend(this, options);
        },
        go_to: function( selector )
        {
            var pos = $( selector ).position();
            $('html, body').animate({scrollTop: ( pos.top )}, 600);
            return false;
        }
    };

    /*
     * Modal Class
     **/
    function modal(){};
    modal.prototype = inherit( ui_construct.prototype );
    //Modal message
    modal.prototype.ajax = function( id, url )
    {
        var ui      = this;
        var c_root  = this.class_prefix + this.class_modal;
        var modal   = this.popup_body( c_root, '', false, false ).appendTo( $( 'body' ) );
        modal.addClass( class_type )
             .attr( 'id', id );

        this.popup_show( modal );
    };

    /*
     * Loader Class
     **/
    function loader(){};
    loader.prototype = inherit( ui_construct.prototype );
    //Properties
    loader.prototype.class_root     = 'ui-loader';
    loader.prototype.loader_file    = 'loading.gif';
    //Show loader
    loader.prototype.show = function()
    {
        var loader = this.create();
        this.popup_show( loader );
    };
    //Hide loader
    loader.prototype.hide = function()
    {
        var loader = this.create();
        this.popup_hide( loader );
    };
    //Create loader
    loader.prototype.create = function()
    {
        var c_root = this.class_prefix + this.class_root;
        if ( this.is_load( '.'+c_root )) {
            return $( '.'+c_root );
        } else
        {
            var image  = '<img src="'+this.image_base+this.loader_file+'" alt="Loading...">';
            var loader = this.popup_body( c_root, image, false, false ).appendTo( $( 'body' ) );
            loader.hide();

            return loader;
        }
    };


    /*
     * Inline loader Class
     **/
    function iloader(){};
    iloader.prototype = inherit( ui_construct.prototype );
    //Properties
    iloader.prototype.class_root   = 'ui-inline-loader';
    iloader.prototype.loader_file  = 'spin.gif';
    //Loader show
    iloader.prototype.show = function( button )
    {
        button.attr( 'disabled', 'disabled' );
        this.create( button ).show();
    };
    //Loader hide
    iloader.prototype.hide = function( button )
    {
        button.removeAttr( 'disabled' );
        this.create( button ).hide();
    };
    //Creating loader
    iloader.prototype.create = function( button )
    {
        var root   = button.parent();
        var lclass = this.class_prefix + this.class_root;
        if ( $( '.'+lclass, root ).length > 0 ) {
            var loader = $( '.'+lclass, root );
        } else {
            var image  = '<img src="'+this.image_base+this.loader_file+'" alt="Loading...">';
            var loader = $( '<span class="'+lclass+'"></span>' )
                            .append( image )
                            .css( 'margin-left', '8px' );
        }
        button.after( loader );
        return loader;
    };


    /*
     * Confirm popup
     **/
    function confirm( options )
    {
        var defaults = {
            title:      'Confirmation',
            info:       '',
            yes_label:  'Yes',
            no_label:   'Cancel',
            yes_class:  'btn btn-danger',
            no_class:   'btn btn-success',
            action:     function( object ){}
        };
        this.vars = $.extend(defaults, options);
    };
    confirm.prototype = inherit( ui_construct.prototype );
    //Properties
    confirm.prototype.class_root = 'ui-confirm';
    //Confirm show
    confirm.prototype.show = function( object )
    {
        var confirm = this.create( object );
        this.popup_show( confirm );
    };
    //Confirm hide
    confirm.prototype.hide = function( object )
    {
        var confirm = this.create( object );
        this.popup_hide( confirm );
    };
    //Creating confirm
    confirm.prototype.create = function( object )
    {
        var ui     = this;
        var c_root = this.class_prefix + this.class_root;
        if ( this.is_load( '.'+c_root )) {
            $( '.'+c_root ).remove();
        }
        //Create confirm
        var yesbtn = $( '<a href="#" class="ip-confirm-yes '+this.vars.yes_class+'">'+this.vars.yes_label+'</a>' );
        var nobtn  = $( '<a href="#" class="ip-confirm-no '+this.vars.no_class+'">'+this.vars.no_label+'</a>' );

        yesbtn.click( function(){
            ui.vars.action( object, ui );
            return false;
        });
        this.popup_close( nobtn, c_root );

        var content = $( '<div class="'+c_root+'-inner"></div>' )
            .append( '<p>'+this.vars.info+'</p>' )
            .append(
                $( '<div class="'+c_root+'-actions"></div>' )
                    .append( yesbtn )
                    .append( nobtn )
            );

        var confirm = this.popup_body( c_root, content, this.vars.title, false ).appendTo( $( 'body' ) );
        confirm.hide();

        return confirm;
    };


    /*
     * Alert popup
     **/
    function alert( options )
    {
        var defaults = {
            message:        '',
            label_button:   'Ok',
            class_root:     '',
            class_button:   'ipjck-btn ipjck-btn-sm ipjck-btn-danger',
            after:          function(){}
        };
        this.vars = $.extend(defaults, options);
    };
    alert.prototype = inherit( ui_construct.prototype );
    //Properties
    alert.prototype.class_root = 'ui-alert';
    //Alert show
    alert.prototype.show = function( message )
    {
        this.vars.message = message;
        var alert = this.create();
        this.popup_show( alert );
    };
    //Alert hide
    alert.prototype.hide = function()
    {
        var alert = this.create();
        this.hide_after = this.vars.after;
        this.popup_hide( alert );
    };
    //Creating alert
    alert.prototype.create = function()
    {
        var ui     = this;
        var c_root = this.class_prefix + this.class_root;
        if ( this.is_load( '.'+c_root )) {
            return $( '.'+c_root );
        } else
        {
            var button = $( '<a href="#" class="'+this.vars.class_button+'">'+this.vars.label_button+'</a>' );
            this.popup_close( button, c_root );

            var c_info  = c_root + '-inner';
            if ( this.vars.class_root != '' ) {
                c_info += ' ' + this.vars.class_root;
            }
            var content = $( '<div class="'+c_info+'"></div>' )
                .append( '<p>'+this.vars.message+'</p>' )
                .append(
                    $( '<div class="'+c_root+'-actions"></div>' )
                        .append( button )
                );

            var popup  = this.popup_body( c_root, content, false, false ).appendTo( $( 'body' ) );
            popup.hide();

            return popup;
        }
    };


    /*
     * Message
     **/
    function message(){};
    message.prototype = inherit( ui_construct.prototype );
    //Properties
    message.prototype.class_modal = 'ui-modal-message';
    message.prototype.class_block = 'ui-message';
    //Modal message
    message.prototype.modal = function( message, class_type )
    {
        var ui      = this;
        var c_root  = this.class_prefix + this.class_modal;
        var content = '<p>'+message+'</p>';
        var msg     = this.popup_body( c_root, content, false, false ).appendTo( $( 'body' ) );
        msg.addClass( class_type )
           .show()
           .animate({top: "0"}, ui.overlay_speed, function(){
                var object = $( this );
                setTimeout( function(){
                    object.animate({top: '-100px'}, ui.overlay_speed, function(){
                        object.remove();
                    });
                }, ui.show_speed);
            });
    };
    //Bloack message
    message.prototype.block = function( message, class_type, block, close )
    {
        var ui      = this;
        var c_root  = this.class_prefix + this.class_block;
        var parent  = block.parent();

        $( '.'+c_root, parent ).remove();

        var msg = $( '<div></div>' );
        msg.addClass( c_root )
           .addClass( class_type )
           .append( '<p>'+message+'</p>' );

        if ( close )
        {
            var _close = $( '<a href="#">'+this.close_label+'</a>' );
            _close.click( function()
            {
                var _msg = $(this).parents( '.'+c_root );
                _msg.animate({opacity: "0"}, ui.overlay_speed, function(){
                    _msg.remove();
                });
                return false;
            });
            msg.append(
                $( '<div class="'+this.class_prefix+this.class_close+'"></div>' ).append( _close )
            );
        }
        msg.css( 'opacity', '0' );
        parent.prepend( msg );
        msg.animate({opacity: "1"}, ui.overlay_speed);
    };

    ui =
    {
        base: {
            construct:  ui_construct,
            loader:     loader,
            iloader:    iloader,
            confirm:    confirm,
            message:    message,
            alert:      alert,
            modal:      modal

        },
        init: function()
        {
            this.loader  = new this.base.loader(),
            this.iloader = new this.base.iloader(),
            this.confirm = new this.base.confirm(),
            this.message = new this.base.message(),
            this.alert   = new this.base.alert(),
            this.modal   = new this.base.modal()
        }
    };

})(jQuery);

module.exports = ui;

},{}]},{},[1]);
