// source --> https://www.lawyers.su/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1.9 ( function( $ ) { 'use strict'; if ( typeof wpcf7 === 'undefined' || wpcf7 === null ) { return; } wpcf7 = $.extend( { cached: 0, inputs: [] }, wpcf7 ); $( function() { wpcf7.supportHtml5 = ( function() { var features = {}; var input = document.createElement( 'input' ); features.placeholder = 'placeholder' in input; var inputTypes = [ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each( inputTypes, function( index, value ) { input.setAttribute( 'type', value ); features[ value ] = input.type !== 'text'; } ); return features; } )(); $( 'div.wpcf7 > form' ).each( function() { var $form = $( this ); wpcf7.initForm( $form ); if ( wpcf7.cached ) { wpcf7.refill( $form ); } } ); } ); wpcf7.getId = function( form ) { return parseInt( $( 'input[name="_wpcf7"]', form ).val(), 10 ); }; wpcf7.initForm = function( form ) { var $form = $( form ); $form.submit( function( event ) { if ( ! wpcf7.supportHtml5.placeholder ) { $( '[placeholder].placeheld', $form ).each( function( i, n ) { $( n ).val( '' ).removeClass( 'placeheld' ); } ); } if ( typeof window.FormData === 'function' ) { wpcf7.submit( $form ); event.preventDefault(); } } ); $( '.wpcf7-submit', $form ).after( '' ); wpcf7.toggleSubmit( $form ); $form.on( 'click', '.wpcf7-acceptance', function() { wpcf7.toggleSubmit( $form ); } ); // Exclusive Checkbox $( '.wpcf7-exclusive-checkbox', $form ).on( 'click', 'input:checkbox', function() { var name = $( this ).attr( 'name' ); $form.find( 'input:checkbox[name="' + name + '"]' ).not( this ).prop( 'checked', false ); } ); // Free Text Option for Checkboxes and Radio Buttons $( '.wpcf7-list-item.has-free-text', $form ).each( function() { var $freetext = $( ':input.wpcf7-free-text', this ); var $wrap = $( this ).closest( '.wpcf7-form-control' ); if ( $( ':checkbox, :radio', this ).is( ':checked' ) ) { $freetext.prop( 'disabled', false ); } else { $freetext.prop( 'disabled', true ); } $wrap.on( 'change', ':checkbox, :radio', function() { var $cb = $( '.has-free-text', $wrap ).find( ':checkbox, :radio' ); if ( $cb.is( ':checked' ) ) { $freetext.prop( 'disabled', false ).focus(); } else { $freetext.prop( 'disabled', true ); } } ); } ); // Placeholder Fallback if ( ! wpcf7.supportHtml5.placeholder ) { $( '[placeholder]', $form ).each( function() { $( this ).val( $( this ).attr( 'placeholder' ) ); $( this ).addClass( 'placeheld' ); $( this ).focus( function() { if ( $( this ).hasClass( 'placeheld' ) ) { $( this ).val( '' ).removeClass( 'placeheld' ); } } ); $( this ).blur( function() { if ( '' === $( this ).val() ) { $( this ).val( $( this ).attr( 'placeholder' ) ); $( this ).addClass( 'placeheld' ); } } ); } ); } if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.date ) { $form.find( 'input.wpcf7-date[type="date"]' ).each( function() { $( this ).datepicker( { dateFormat: 'yy-mm-dd', minDate: new Date( $( this ).attr( 'min' ) ), maxDate: new Date( $( this ).attr( 'max' ) ) } ); } ); } if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.number ) { $form.find( 'input.wpcf7-number[type="number"]' ).each( function() { $( this ).spinner( { min: $( this ).attr( 'min' ), max: $( this ).attr( 'max' ), step: $( this ).attr( 'step' ) } ); } ); } // Character Count wpcf7.resetCounter( $form ); // URL Input Correction $form.on( 'change', '.wpcf7-validates-as-url', function() { var val = $.trim( $( this ).val() ); if ( val && ! val.match( /^[a-z][a-z0-9.+-]*:/i ) && -1 !== val.indexOf( '.' ) ) { val = val.replace( /^\/+/, '' ); val = 'http://' + val; } $( this ).val( val ); } ); }; wpcf7.submit = function( form ) { if ( typeof window.FormData !== 'function' ) { return; } var $form = $( form ); $( '.ajax-loader', $form ).addClass( 'is-active' ); wpcf7.clearResponse( $form ); var formData = new FormData( $form.get( 0 ) ); var detail = { id: $form.closest( 'div.wpcf7' ).attr( 'id' ), status: 'init', inputs: [], formData: formData }; $.each( $form.serializeArray(), function( i, field ) { if ( '_wpcf7' == field.name ) { detail.contactFormId = field.value; } else if ( '_wpcf7_version' == field.name ) { detail.pluginVersion = field.value; } else if ( '_wpcf7_locale' == field.name ) { detail.contactFormLocale = field.value; } else if ( '_wpcf7_unit_tag' == field.name ) { detail.unitTag = field.value; } else if ( '_wpcf7_container_post' == field.name ) { detail.containerPostId = field.value; } else if ( field.name.match( /^_wpcf7_\w+_free_text_/ ) ) { var owner = field.name.replace( /^_wpcf7_\w+_free_text_/, '' ); detail.inputs.push( { name: owner + '-free-text', value: field.value } ); } else if ( field.name.match( /^_/ ) ) { // do nothing } else { detail.inputs.push( field ); } } ); wpcf7.triggerEvent( $form.closest( 'div.wpcf7' ), 'beforesubmit', detail ); var ajaxSuccess = function( data, status, xhr, $form ) { detail.id = $( data.into ).attr( 'id' ); detail.status = data.status; detail.apiResponse = data; var $message = $( '.wpcf7-response-output', $form ); switch ( data.status ) { case 'validation_failed': $.each( data.invalidFields, function( i, n ) { $( n.into, $form ).each( function() { wpcf7.notValidTip( this, n.message ); $( '.wpcf7-form-control', this ).addClass( 'wpcf7-not-valid' ); $( '[aria-invalid]', this ).attr( 'aria-invalid', 'true' ); } ); } ); $message.addClass( 'wpcf7-validation-errors' ); $form.addClass( 'invalid' ); wpcf7.triggerEvent( data.into, 'invalid', detail ); break; case 'acceptance_missing': $message.addClass( 'wpcf7-acceptance-missing' ); $form.addClass( 'unaccepted' ); wpcf7.triggerEvent( data.into, 'unaccepted', detail ); break; case 'spam': $message.addClass( 'wpcf7-spam-blocked' ); $form.addClass( 'spam' ); wpcf7.triggerEvent( data.into, 'spam', detail ); break; case 'aborted': $message.addClass( 'wpcf7-aborted' ); $form.addClass( 'aborted' ); wpcf7.triggerEvent( data.into, 'aborted', detail ); break; case 'mail_sent': $message.addClass( 'wpcf7-mail-sent-ok' ); $form.addClass( 'sent' ); wpcf7.triggerEvent( data.into, 'mailsent', detail ); break; case 'mail_failed': $message.addClass( 'wpcf7-mail-sent-ng' ); $form.addClass( 'failed' ); wpcf7.triggerEvent( data.into, 'mailfailed', detail ); break; default: var customStatusClass = 'custom-' + data.status.replace( /[^0-9a-z]+/i, '-' ); $message.addClass( 'wpcf7-' + customStatusClass ); $form.addClass( customStatusClass ); } wpcf7.refill( $form, data ); wpcf7.triggerEvent( data.into, 'submit', detail ); if ( 'mail_sent' == data.status ) { $form.each( function() { this.reset(); } ); wpcf7.toggleSubmit( $form ); wpcf7.resetCounter( $form ); } if ( ! wpcf7.supportHtml5.placeholder ) { $form.find( '[placeholder].placeheld' ).each( function( i, n ) { $( n ).val( $( n ).attr( 'placeholder' ) ); } ); } $message.html( '' ).append( data.message ).slideDown( 'fast' ); $message.attr( 'role', 'alert' ); $( '.screen-reader-response', $form.closest( '.wpcf7' ) ).each( function() { var $response = $( this ); $response.html( '' ).attr( 'role', '' ).append( data.message ); if ( data.invalidFields ) { var $invalids = $( '' ); $.each( data.invalidFields, function( i, n ) { if ( n.idref ) { var $li = $( '
  • ' ).append( $( '' ).attr( 'href', '#' + n.idref ).append( n.message ) ); } else { var $li = $( '
  • ' ).append( n.message ); } $invalids.append( $li ); } ); $response.append( $invalids ); } $response.attr( 'role', 'alert' ).focus(); } ); }; $.ajax( { type: 'POST', url: wpcf7.apiSettings.getRoute( '/contact-forms/' + wpcf7.getId( $form ) + '/feedback' ), data: formData, dataType: 'json', processData: false, contentType: false } ).done( function( data, status, xhr ) { ajaxSuccess( data, status, xhr, $form ); $( '.ajax-loader', $form ).removeClass( 'is-active' ); } ).fail( function( xhr, status, error ) { var $e = $( '
    ' ).text( error.message ); $form.after( $e ); } ); }; wpcf7.triggerEvent = function( target, name, detail ) { var $target = $( target ); /* DOM event */ var event = new CustomEvent( 'wpcf7' + name, { bubbles: true, detail: detail } ); $target.get( 0 ).dispatchEvent( event ); /* jQuery event */ $target.trigger( 'wpcf7:' + name, detail ); $target.trigger( name + '.wpcf7', detail ); // deprecated }; wpcf7.toggleSubmit = function( form, state ) { var $form = $( form ); var $submit = $( 'input:submit', $form ); if ( typeof state !== 'undefined' ) { $submit.prop( 'disabled', ! state ); return; } if ( $form.hasClass( 'wpcf7-acceptance-as-validation' ) ) { return; } $submit.prop( 'disabled', false ); $( '.wpcf7-acceptance', $form ).each( function() { var $span = $( this ); var $input = $( 'input:checkbox', $span ); if ( ! $span.hasClass( 'optional' ) ) { if ( $span.hasClass( 'invert' ) && $input.is( ':checked' ) || ! $span.hasClass( 'invert' ) && ! $input.is( ':checked' ) ) { $submit.prop( 'disabled', true ); return false; } } } ); }; wpcf7.resetCounter = function( form ) { var $form = $( form ); $( '.wpcf7-character-count', $form ).each( function() { var $count = $( this ); var name = $count.attr( 'data-target-name' ); var down = $count.hasClass( 'down' ); var starting = parseInt( $count.attr( 'data-starting-value' ), 10 ); var maximum = parseInt( $count.attr( 'data-maximum-value' ), 10 ); var minimum = parseInt( $count.attr( 'data-minimum-value' ), 10 ); var updateCount = function( target ) { var $target = $( target ); var length = $target.val().length; var count = down ? starting - length : length; $count.attr( 'data-current-value', count ); $count.text( count ); if ( maximum && maximum < length ) { $count.addClass( 'too-long' ); } else { $count.removeClass( 'too-long' ); } if ( minimum && length < minimum ) { $count.addClass( 'too-short' ); } else { $count.removeClass( 'too-short' ); } }; $( ':input[name="' + name + '"]', $form ).each( function() { updateCount( this ); $( this ).keyup( function() { updateCount( this ); } ); } ); } ); }; wpcf7.notValidTip = function( target, message ) { var $target = $( target ); $( '.wpcf7-not-valid-tip', $target ).remove(); $( '' ).attr( { 'class': 'wpcf7-not-valid-tip', 'role': 'alert', 'aria-hidden': 'true', } ).text( message ).appendTo( $target ); if ( $target.is( '.use-floating-validation-tip *' ) ) { var fadeOut = function( target ) { $( target ).not( ':hidden' ).animate( { opacity: 0 }, 'fast', function() { $( this ).css( { 'z-index': -100 } ); } ); }; $target.on( 'mouseover', '.wpcf7-not-valid-tip', function() { fadeOut( this ); } ); $target.on( 'focus', ':input', function() { fadeOut( $( '.wpcf7-not-valid-tip', $target ) ); } ); } }; wpcf7.refill = function( form, data ) { var $form = $( form ); var refillCaptcha = function( $form, items ) { $.each( items, function( i, n ) { $form.find( ':input[name="' + i + '"]' ).val( '' ); $form.find( 'img.wpcf7-captcha-' + i ).attr( 'src', n ); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec( n ); $form.find( 'input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]' ).attr( 'value', match[ 1 ] ); } ); }; var refillQuiz = function( $form, items ) { $.each( items, function( i, n ) { $form.find( ':input[name="' + i + '"]' ).val( '' ); $form.find( ':input[name="' + i + '"]' ).siblings( 'span.wpcf7-quiz-label' ).text( n[ 0 ] ); $form.find( 'input:hidden[name="_wpcf7_quiz_answer_' + i + '"]' ).attr( 'value', n[ 1 ] ); } ); }; if ( typeof data === 'undefined' ) { $.ajax( { type: 'GET', url: wpcf7.apiSettings.getRoute( '/contact-forms/' + wpcf7.getId( $form ) + '/refill' ), beforeSend: function( xhr ) { var nonce = $form.find( ':input[name="_wpnonce"]' ).val(); if ( nonce ) { xhr.setRequestHeader( 'X-WP-Nonce', nonce ); } }, dataType: 'json' } ).done( function( data, status, xhr ) { if ( data.captcha ) { refillCaptcha( $form, data.captcha ); } if ( data.quiz ) { refillQuiz( $form, data.quiz ); } } ); } else { if ( data.captcha ) { refillCaptcha( $form, data.captcha ); } if ( data.quiz ) { refillQuiz( $form, data.quiz ); } } }; wpcf7.clearResponse = function( form ) { var $form = $( form ); $form.removeClass( 'invalid spam sent failed' ); $form.siblings( '.screen-reader-response' ).html( '' ).attr( 'role', '' ); $( '.wpcf7-not-valid-tip', $form ).remove(); $( '[aria-invalid]', $form ).attr( 'aria-invalid', 'false' ); $( '.wpcf7-form-control', $form ).removeClass( 'wpcf7-not-valid' ); $( '.wpcf7-response-output', $form ) .hide().empty().removeAttr( 'role' ) .removeClass( 'wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked' ); }; wpcf7.apiSettings.getRoute = function( path ) { var url = wpcf7.apiSettings.root; url = url.replace( wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path ); return url; }; } )( jQuery ); /* * Polyfill for Internet Explorer * See https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent */ ( function () { if ( typeof window.CustomEvent === "function" ) return false; function CustomEvent ( event, params ) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent( 'CustomEvent' ); evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; } )(); // source --> https://www.lawyers.su/wp-content/plugins/lite-embed-for-youtube/lite-yt-embed.js?ver=1.0 /** * A lightweight youtube embed. Still should feel the same to the user, just MUCH faster to initialize and paint. * * Thx to these as the inspiration * https://storage.googleapis.com/amp-vs-non-amp/youtube-lazy.html * https://autoplay-youtube-player.glitch.me/ * * Once built it, I also found these: * https://github.com/ampproject/amphtml/blob/master/extensions/amp-youtube (👍👍) * https://github.com/Daugilas/lazyYT * https://github.com/vb/lazyframe */ class LiteYTEmbed extends HTMLElement { constructor() { super(); // Gotta encode the untrusted value // https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#rule-2---attribute-escape-before-inserting-untrusted-data-into-html-common-attributes this.videoId = encodeURIComponent(this.getAttribute('videoid')); /** * Lo, the youtube placeholder image! (aka the thumbnail, poster image, etc) * There is much internet debate on the reliability of thumbnail URLs. Weak consensus is that you * cannot rely on anything and have to use the YouTube Data API. * * amp-youtube also eschews using the API, so they just try sddefault with a hqdefault fallback: * https://github.com/ampproject/amphtml/blob/6039a6317325a8589586e72e4f98c047dbcbf7ba/extensions/amp-youtube/0.1/amp-youtube.js#L498-L537 * For now I'm gonna go with this confident (lol) assertion: https://stackoverflow.com/a/20542029, though I'll use `i.ytimg` to optimize for origin reuse. * * Worth noting that sddefault is _higher_ resolution than hqdefault. Naming is hard. ;) * From my own testing, it appears that hqdefault is ALWAYS there sddefault is missing for ~10% of videos * * TODO: Do the sddefault->hqdefault fallback * - When doing this, apply referrerpolicy (https://github.com/ampproject/amphtml/pull/3940) * TODO: Consider using webp if supported, falling back to jpg */ this.posterUrl = `https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg`; // Warm the connection for the poster image LiteYTEmbed.addPrefetch('preload', this.posterUrl, 'image'); // TODO: support dynamically setting the attribute via attributeChangedCallback } connectedCallback() { this.style.backgroundImage = `url("${this.posterUrl}")`; const playBtn = document.createElement('div'); playBtn.classList.add('lty-playbtn'); this.append(playBtn); // On hover (or tap), warm up the TCP connections we're (likely) about to use. this.addEventListener('pointerover', LiteYTEmbed.warmConnections, {once: true}); // Once the user clicks, add the real iframe and drop our play button // TODO: In the future we could be like amp-youtube and silently swap in the iframe during idle time // We'd want to only do this for in-viewport or near-viewport ones: https://github.com/ampproject/amphtml/pull/5003 this.addEventListener('click', e => this.addIframe()); } // // TODO: Support the the user changing the [videoid] attribute // attributeChangedCallback() { // } /** * Add a to the head */ static addPrefetch(kind, url, as) { const linkElem = document.createElement('link'); linkElem.rel = kind; linkElem.href = url; if (as) { linkElem.as = as; } linkElem.crossorigin = true; document.head.append(linkElem); } /** * Begin pre-connecting to warm up the iframe load * Since the embed's network requests load within its iframe, * preload/prefetch'ing them outside the iframe will only cause double-downloads. * So, the best we can do is warm up a few connections to origins that are in the critical path. * * Maybe `` would work, but it's unsupported: http://crbug.com/593267 * But TBH, I don't think it'll happen soon with Site Isolation and split caches adding serious complexity. */ static warmConnections() { if (LiteYTEmbed.preconnected) return; // The iframe document and most of its subresources come right off youtube.com LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com'); // The botguard script is fetched off from google.com LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com'); // Not certain if these ad related domains are in the critical path. Could verify with domain-specific throttling. LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net'); LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net'); LiteYTEmbed.preconnected = true; } addIframe(){ const iframeHTML = ` `; this.insertAdjacentHTML('beforeend', iframeHTML); this.classList.add('lyt-activated'); } } // Register custome element customElements.define('lite-youtube', LiteYTEmbed); // source --> https://www.lawyers.su/wp-content/plugins/easy-fancybox/js/jquery.fancybox.min.js?ver=1.3.24 (function(l){var D,j,B,r,c,z,w,H,v,i,F,g=0,y={},h=[],d=0,a={},e=[],k=null,E=new Image(),u=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,p=/[^\.]\.(swf)\s*$/i,A=/[^\.]\.(svg)\s*$/i,G=/[^\.]\.(pdf)\s*$/i,m,o=1,q=0,b="",t,n,C=false,f=l.extend(l("
    ")[0],{prop:0}),x=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,s=document.createTouch!==undefined;_abort=function(){l.fancybox.hideActivity();E.onerror=E.onload=null;if(k){k.abort()}D.empty()},_error=function(I){if(false===y.onError(h,g,y)){l.fancybox.hideActivity();C=false;return}if(typeof I==="undefined"){I="Please try again later."}y.titleShow=false;y.width="auto";y.height="auto";D.html('

    The requested content cannot be loaded.
    '+I+"

    ");_process_inline()},_start=function(){var M=h[g],J,L,O,N,I,K;_abort();y=l.extend({},l.fn.fancybox.defaults,(typeof l(M).data("fancybox")=="undefined"?y:l(M).data("fancybox")));if(document.documentElement.clientWidth0?"inline":"ajax"}y.type=L;y.href=J;y.title=O;if(y.autoDimensions){if(y.type=="html"||y.type=="inline"||y.type=="ajax"){y.width="auto";y.height="auto"}else{y.autoDimensions=false}}if(y.modal){y.overlayShow=true;y.hideOnOverlayClick=false;y.hideOnContentClick=false;y.enableEscapeButton=false;y.showCloseButton=false}y.padding=parseInt(y.padding,10);y.margin=parseInt(y.margin,10);D.css("padding",(y.padding+y.margin));l(".fancybox-inline-tmp").off("fancybox-cancel").on("fancybox-change",function(){l(this).replaceWith(z.children())});switch(L){case"html":D.html(y.content);_process_inline();break;case"inline":if(l(M).parent().is("#fancybox-content")===true){C=false;return}l('
    ').hide().insertBefore(l(M)).on("fancybox-cleanup",function(){l(this).replaceWith(z.find(M))}).on("fancybox-cancel",function(){l(this).replaceWith(D.find(M))});l(M).appendTo(D);_process_inline();break;case"image":y.keepRatio=true;C=false;l.fancybox.showActivity();E=new Image();E.onerror=function(){_error("No image found.")};E.onload=function(){C=true;E.onerror=E.onload=null;_process_image()};E.src=J;break;case"swf":y.scrolling="no";y.keepRatio=true;N='';I="";l.each(y.swf,function(P,Q){N+='';I+=" "+P+'="'+Q+'"'});N+='";D.html(N);_process_inline();break;case"svg":y.scrolling="no";y.keepRatio=true;N='';D.html(N);_process_inline();break;case"pdf":y.scrolling="no";y.enableKeyboardNav=false;y.showNavArrows=false;N=''+l(M).html()+"";D.html(N);_process_inline();break;case"ajax":C=false;l.fancybox.showActivity();y.ajax.win=y.ajax.success;k=l.ajax(l.extend({},y.ajax,{url:J,data:y.ajax.data||{},error:function(P,R,Q){if(P.status>0){_error(Q)}},success:function(Q,S,P){var R=typeof P=="object"?P:k;if(R.status==200){if(typeof y.ajax.win=="function"){K=y.ajax.win(J,Q,S,P);if(K===false){l.fancybox.hideActivity();return}else{if(typeof K=="string"||typeof K=="object"){Q=K}}}if(Q.indexOf("-1||Q.indexOf("-1||Q.indexOf("-1){_error("Unexpected response.")}else{D.html(Q);_process_inline()}}}}));break;case"iframe":y.enableKeyboardNav=false;y.showNavArrows=false;l.fancybox.showActivity();_show();break}},_process_inline=function(){var J=y.width,K=y.height,L=l(window).width()==0?window.innerWidth:l(window).width(),I=l(window).height()==0?window.innerHeight:l(window).height();if(J.toString().indexOf("%")>-1){J=parseInt((L-(y.margin*2))*parseFloat(J)/100,10)+"px"}else{J=J=="auto"?"auto":J+"px"}if(K.toString().indexOf("%")>-1){K=parseInt((I-(y.margin*2))*parseFloat(K)/100,10)+"px"}else{K=K=="auto"?"auto":K+"px"}D.wrapInner('
    ');y.width=D.width();y.height=D.height();_show()},_process_image=function(){y.width=E.width;y.height=E.height;l("").attr({id:"fancybox-img",src:E.src,alt:y.title}).appendTo(D);_show()},_show=function(){var J,I;if(y.type!=="iframe"){l.fancybox.hideActivity()}if(r.is(":visible")&&false===a.onCleanup(e,d,a)){l(".fancybox-inline-tmp").trigger("fancybox-cancel");C=false;return}C=true;l(z.add(B)).off();l(window).off("orientationchange.fb resize.fb scroll.fb");l(document).off("keydown.fb");if(r.is(":visible")&&a.titlePosition!=="outside"){r.css("height",r.height())}e=h;d=g;a=y;if(a.overlayShow){l("html").addClass("fancybox-active");B.css({"background-color":a.overlayColor,opacity:a.overlayOpacity,cursor:a.hideOnOverlayClick?"pointer":"auto",height:l(document).height()});if(!B.is(":visible")){if(x){l("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}B.show()}}else{B.hide()}n=_get_zoom_to();_process_title();if(r.is(":visible")){l(w.add(v).add(i)).hide();J=r.position(),t={top:J.top,left:J.left,width:r.width(),height:r.height()};I=(t.width==n.width&&t.height==n.height);z.fadeTo(a.changeFade,0.3,function(){var K=function(){z.html(D.contents()).fadeTo(a.changeFade,1,_finish)};l(".fancybox-inline-tmp").trigger("fancybox-change");z.empty().removeAttr("filter").css({"border-width":a.padding,width:n.width-a.padding*2,height:a.autoDimensions?"auto":n.height-q-a.padding*2});if(I){K()}else{f.prop=0;l(f).animate({prop:1},{duration:a.changeSpeed,easing:a.easingChange,step:_draw,complete:K})}});return}r.removeAttr("style");z.css("border-width",a.padding);if(a.transitionIn=="elastic"){t=_get_zoom_from();z.html(D.contents());r.show();if(a.opacity){n.opacity=0}f.prop=0;l(f).animate({prop:1},{duration:a.speedIn,easing:a.easingIn,step:_draw,complete:_finish});return}if(a.titlePosition=="inside"&&q>0){H.show()}z.css({width:n.width-a.padding*2,height:a.autoDimensions?"auto":n.height-q-a.padding*2}).html(D.contents());r.css(n).fadeIn(a.transitionIn=="none"?0:a.speedIn,_finish)},_format_title=function(I){if(I&&I.length){if(a.titlePosition=="float"){return'
    '+I+'
    '}return'
    '+I+"
    "}return false},_process_title=function(){b=a.title||"";q=0;H.empty().removeAttr("style").removeClass();if(a.titleShow===false){H.hide();return}b=l.isFunction(a.titleFormat)?a.titleFormat(b,e,d,a):_format_title(b);if(!b||b===""){H.hide();return}H.addClass("fancybox-title-"+a.titlePosition).html(b).appendTo("body").show();switch(a.titlePosition){case"inside":H.css({width:n.width-(a.padding*2),marginLeft:a.padding,marginRight:a.padding}).appendTo(c);q=H.outerHeight(true);n.height+=q;break;case"over":H.css({marginLeft:a.padding,width:n.width-(a.padding*2),bottom:a.padding}).appendTo(c);break;case"float":H.css("left",parseInt((H.width()-n.width)/2,10)*-1).appendTo(c);break;default:H.css({width:n.width-(a.padding*2),paddingLeft:a.padding,paddingRight:a.padding}).appendTo(r);break}H.hide()},_set_navigation=function(){if(a.enableEscapeButton||a.enableKeyboardNav){l(document).on("keydown.fb",function(I){if(I.keyCode==27&&a.enableEscapeButton){I.preventDefault();l.fancybox.close()}else{if((I.keyCode==37||I.keyCode==39)&&a.enableKeyboardNav&&I.target.tagName!=="INPUT"&&I.target.tagName!=="TEXTAREA"&&I.target.tagName!=="SELECT"){I.preventDefault();l.fancybox[I.keyCode==37?"prev":"next"]()}else{if((I.keyCode==9)&&a.enableKeyboardNav&&I.target.tagName!=="INPUT"&&I.target.tagName!=="TEXTAREA"&&I.target.tagName!=="SELECT"){I.preventDefault();l.fancybox[I.shiftKey?"prev":"next"]()}}}})}if(!a.showNavArrows){v.hide();i.hide();return}if((a.cyclic&&e.length>1)||d!==0){v.show()}if((a.cyclic&&e.length>1)||d!=(e.length-1)){i.show()}},_finish=function(){if(!l.support.opacity){z.css("filter",0);r.css("filter",0)}if(a.autoDimensions){z.css("height","auto")}r.css("height","auto");if(b&&b.length){H.show()}if(a.showCloseButton){w.show()}_set_navigation();if(a.hideOnContentClick){z.on("click",l.fancybox.close)}if(a.hideOnOverlayClick){B.on("click",l.fancybox.close)}if(a.autoResize){l(window).on("resize.fb",l.fancybox.resize)}if(a.centerOnScroll&&!s){l(window).on("scroll.fb",l.fancybox.center)}if(l.fn.mousewheel){r.on("mousewheel.fb",function(I,J){if(C){I.preventDefault()}else{if(a.type=="image"&&(l(I.target).outerHeight()==0||l(I.target).prop("scrollHeight")===l(I.target).outerHeight())){I.preventDefault();l.fancybox[J>0?"prev":"next"]()}}})}if(a.type=="iframe"){l('').appendTo(z).on("load",function(){l.fancybox.hideActivity()}).focus()}r.show();C=false;l.fancybox.center();a.onComplete(e,d,a);if(e.length>1){_preload_next();_preload_prev()}},_preload_next=function(){var I=typeof arguments[0]=="number"?arguments[0]:d+1;if(I>=e.length){if(a.cyclic){I=0}else{return}}if(I==d){a.enableKeyboardNav=false;r.off("mousewheel.fb");i.hide();return}if(_preload_image(I)){return}else{_preload_next(I+1)}},_preload_prev=function(){var I=typeof arguments[0]=="number"?arguments[0]:d-1;if(I<0){if(a.cyclic){I=e.length-1}else{return}}if(I==d){a.enableKeyboardNav=false;r.off("mousewheel.fb");v.hide();return}if(_preload_image(I)){return}else{_preload_prev(I-1)}},_preload_image=function(K){var J,I=e[K];if(typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href!==a.href&&(I.href.match(u)||l(I).hasClass("image"))){J=new Image();J.src=I.href;return true}else{return false}},_draw=function(J){var I={width:parseInt(t.width+(n.width-t.width)*J,10),height:parseInt(t.height+(n.height-t.height)*J,10),top:parseInt(t.top+(n.top-t.top)*J,10),left:parseInt(t.left+(n.left-t.left)*J,10)};if(typeof n.opacity!=="undefined"){I.opacity=J<0.5?0.5:J}r.css(I);z.css({width:I.width-a.padding*2,height:I.height-(q*J)-a.padding*2})},_get_viewport=function(){var I=!s&&window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,J=!s&&window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight,K;K=arguments[0]===true?0:a.margin;return[I-(K*2),J-(K*2),l(document).scrollLeft()+K,l(document).scrollTop()+K]},_get_zoom_to=function(){var I=_get_viewport(),L={},J=a.padding*2,K;if(a.width.toString().indexOf("%")>-1){L.width=parseInt((I[0]*parseFloat(a.width))/100,10)}else{L.width=a.width+J}if(a.height.toString().indexOf("%")>-1){L.height=parseInt((I[1]*parseFloat(a.height))/100,10)}else{L.height=a.height+J}if(a.autoScale&&(L.width>I[0]||L.height>I[1])){if(a.keepRatio){K=a.width/a.height;if((L.width)>I[0]){L.width=I[0];L.height=parseInt(((L.width-J)/K)+J,10)}if((L.height)>I[1]){L.height=I[1];L.width=parseInt(((L.height-J)*K)+J,10)}}else{L.width=Math.min(L.width,I[0]);L.height=Math.min(L.height,I[1])}}L.top=parseInt(Math.max(I[3]-20,I[3]+((I[1]-L.height-40)*0.5)),10);L.left=parseInt(Math.max(I[2]-20,I[2]+((I[0]-L.width-40)*0.5)),10);return L},_get_obj_pos=function(I){var J=I.offset();J.top+=parseInt(I.css("paddingTop"),10)||0;J.left+=parseInt(I.css("paddingLeft"),10)||0;J.top+=parseInt(I.css("border-top-width"),10)||0;J.left+=parseInt(I.css("border-left-width"),10)||0;J.width=I.width();J.height=I.height();return J},_get_zoom_from=function(){var L=y.orig?l(y.orig):false,K={},J,I;if(L&&L.length){J=_get_obj_pos(L);K={width:J.width+(a.padding*2),height:J.height+(a.padding*2),top:J.top-a.padding-20,left:J.left-a.padding-20}}else{I=_get_viewport();K={width:a.padding*2,height:a.padding*2,top:parseInt((I[3]+I[1])*0.5,10),left:parseInt((I[2]+I[0])*0.5,10)}}return K},_animate_loading=function(){if(!j.is(":visible")){clearInterval(m);return}l("div",j).css("top",(o*-40)+"px");o=(o+1)%12};l.fn.fancybox=function(I){if(!l(this).length){return this}l(this).data("fancybox",l.extend({},I,(l.metadata?l(this).metadata():{}))).off("click.fb").on("click.fb",function(K){if(C){return}C=true;l(this).blur();h=[];g=0;var J=l(this).attr("rel")||"";if(J==""||J.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,"")==""){h.push(this)}else{h=l('a[rel="'+J+'"], area[rel="'+J+'"]');g=h.index(this)}_start(K);return});return this};l.fancybox=function(L){var K;if(C){return}C=true;K=typeof arguments[1]!=="undefined"?arguments[1]:{};h=[];g=parseInt(K.index,10)||0;if(l.isArray(L)){for(var J=0,I=L.length;Jh.length||g<0){g=0}_start()};l.fancybox.showActivity=function(){clearInterval(m);j.show();m=setInterval(_animate_loading,66)};l.fancybox.hideActivity=function(){j.hide()};l.fancybox.next=function(){var I,J=typeof arguments[0]=="number"?arguments[0]:d+1;if(J>=e.length){if(a.cyclic){J=0}else{return}}I=e[J];if(J!=d&&typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href===a.href){l.fancybox.next(J+1)}else{l.fancybox.pos(J)}return};l.fancybox.prev=function(){var I,J=typeof arguments[0]=="number"?arguments[0]:d-1;if(J<0){if(a.cyclic){J=e.length-1}else{return}}I=e[J];if(J!=d&&typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href===a.href){l.fancybox.prev(J-1)}else{l.fancybox.pos(J)}return};l.fancybox.pos=function(I){if(C){return}I=parseInt(I);h=e;if(I>-1&&II[0]||(r.height()+40)>I[1])){return}r.stop().animate({top:parseInt(Math.max(I[3]-20,I[3]+((I[1]-z.height()-40)*0.5)-a.padding)),left:parseInt(Math.max(I[2]-20,I[2]+((I[0]-z.width()-40)*0.5)-a.padding))},typeof arguments[0]=="number"?arguments[0]:300)};l.fancybox.init=function(){if(l("#fancybox-wrap").length){return}l("body").append(D=l('
    '),j=l('
    '),B=l('
    '),r=l('
    '));c=l('
    ').append('
    ').appendTo(r);c.append(z=l('
    '),w=l(''),H=l('
    '),v=l(''),i=l(''));w.click(l.fancybox.close);j.click(l.fancybox.cancel);v.click(function(I){I.preventDefault();l.fancybox.prev()});i.click(function(I){I.preventDefault();l.fancybox.next()});if(!l.support.opacity){r.addClass("fancybox-ie")}if(x){j.addClass("fancybox-ie6");r.addClass("fancybox-ie6");l('').prependTo(c)}};l.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,allowfullscreen:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,autoResize:true,keepRatio:false,minViewportWidth:0,ajax:{},swf:{wmode:"opaque"},svg:{wmode:"opaque"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:true,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};l(document).ready(function(){l.fancybox.init()})})(jQuery);