PageSourceSearch

https://www.tehamafamilyfitness.com/min/static/js/jquery/fi.js,sta…photoswipe-lightbox.umd.min.js?1780646934.1

js tehamafamilyfitness.com collected 2026-09-27 03:51:02 UTC 314,249 bytes, 1,363 lines download raw bytes

1$.FI={functions:Array(),plugins:Array(),readys:Array(),lang:{},extend:function(funcorsel,plugin){if(typeof(funcorsel)=='function'){$.FI.functions[$.FI.functions.length]=funcorsel;return true;}
2if(typeof(funcorsel)=='string'&&typeof(plugin)=='undefined'){plugin=funcorsel;funcorsel='';}
3$.FI.plugins[$.FI.plugins.length]={selector:funcorsel,plugin:plugin};},ready:function(func){$.FI.readys[$.FI.readys.length]=func;},hasFlash:function(){if(navigator.plugins&&navigator.plugins.length){var plugin=navigator.plugins['Shockwave Flash'];if(plugin)
4return true;if(navigator.plugins['Shockwave Flash 2.0'])
5return true;}else if(navigator.mimeTypes&&navigator.mimeTypes.length){var mimeType=navigator.mimeTypes['application/x-shockwave-flash'];return mimeType&&mimeType.enabledPlugin;}else{try{var ax=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7');return true;}catch(e){try{var ax=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');return true;}catch(e){try{var ax=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');return true;}catch(e){return false;}}}}
6return false;},toast:function(msg,type,duration){if(typeof($.loading)=='undefined')
7return false;if(!msg){$.loading(false);return false;}
8if(typeof msg!=='string'&&!(msg instanceof String))
9msg=JSON.stringify(msg);msg=msg.replace(/<(\/?)(pre|code)/igm,'<$1div');if(type)msg='<div class="tooltip '+type+'"><span>'+msg+'</span></div>';if(typeof(duration)=='undefined')duration=5000;var tooltip=$('<div>'+msg+'</div>').find('.tooltip');$.loading(false);$.loading(true,{html:(tooltip.length?tooltip.prop('outerHTML'):'<span>'+msg+'</span>'),text:'',pulse:false,max:duration});return false;},format:function(format,args){return format.replace(/{(\d+)}/g,function(match,number){return(typeof args[number-1]!='undefined'?args[number-1]:match);});},dialog:function(type,msg,args,val){if(args&&args.length)
10msg=$.FI.format(msg,args);if(type=='prompt'){return prompt(msg,val);}else if(type=="confirm"){return confirm(msg);}else{return alert(msg);}},alert:function(msg,args){return $.FI.dialog('alert',msg,args);},confirm:function(msg,args){return $.FI.dialog('confirm',msg,args);},prompt:function(msg,args,val){return $.FI.dialog('prompt',msg,args,val);},tip:function(elm){try{$(elm).tipsy({trigger:'manual',html:true,opacity:1.0,additionalClassName:'tipsy-big',closeButton:true,gravity:'n'}).tipsy("show");}catch(e){alert($(elm).attr('title'));}},cleanupTips:function(force){var $tips=$('body > .tipsy');if(!$tips.length)
11return;$tips.each(function(){var $tip=$(this);if(!force&&$tip.is('.tipsy-big')){if($tip.data('tipsy-owner')&&!$tip.data('tipsy-owner').get(0).isConnected)
12$tip.remove();}else{$tip.remove();}});},copyToClipboard:function(text){if(!navigator.clipboard){$.FI.toast('Clipboard not supported.');return;}
13navigator.clipboard.writeText(text).then(function(){$.FI.toast('Copied to clipboard.','success');},function(err){$.FI.toast('Error: ',err.message,'error');});},getSelection:function(){var html="";if(typeof window.getSelection!="undefined"){var sel=window.getSelection();if(sel.rangeCount){var container=document.createElement("div");for(var i=0,len=sel.rangeCount;i<len;++i){container.appendChild(sel.getRangeAt(i).cloneContents());}
14html=container.innerHTML;}}else if(typeof document.selection!="undefined"){if(document.selection.type=="Text")
15html=document.selection.createRange().htmlText;}
16return html;},inIframe:function(){try{return window.self!==window.top;}catch(e){return true;}},inViewport:function(elm,approximately){if(!elm)
17return false;if(typeof jQuery==="function"&&elm instanceof jQuery)
18elm=elm[0];var rect=elm.getBoundingClientRect();var bottom=0;if(approximately)
19bottom=(window.innerHeight||document.documentElement.clientHeight)/4;return(rect.bottom>=bottom&&rect.right>=0&&rect.top<=(window.innerHeight||document.documentElement.clientHeight)&&rect.left<=(window.innerWidth||document.documentElement.clientWidth));}};$.fn.extend({FI:function(){return this.each(function(){var jthis=$(this);if(typeof($.loading)!='undefined')
20$.loading({onAjax:true,delay:1000});jthis.find('.recaptchav3').each(function(){var jthis=$(this);var jform=jthis.closest('form');if(!jform.length||!jthis.data('sitekey'))
21return;jform.unbind('.recaptchav3').bind('submit.recaptchav3',function(e){if(typeof(grecaptcha)=='undefined')
22return;e.preventDefault();e.stopPropagation();
22grecaptcha.ready(function(){grecaptcha.execute(jthis.data('sitekey'),{action:'recaptchav3'}).then(function(token){jform.prepend('<input type="hidden" name="g-recaptcha-response" value="'+token+'">');jform.prepend('<input type="hidden" name="g-recaptcha-action" value="recaptchav3">');jform.unbind('.recaptchav3');if(e.originalEvent&&e.originalEvent.submitter)
23$(e.originalEvent.submitter).click();else
24jform.submit();});});})});jthis.find('.confirm').each(function(){var jthis=$(this);jthis.unbind('click.FI').bind('click.FI',function(e){if(e.ctrlKey||jthis.is('input[type=checkbox]:not(:checked)'))
25return;var faction=jthis.attr('href');var isprompt=jthis.is('.prompt');var confirmtitle=(jthis.attr('confirm-title')||jthis.attr('title')||jthis.attr('original-title')||jthis.attr('value')||jthis.text()||'Please confirm your action')+'?!';var confirmed;var promptvar=jthis.attr('data-prompt-var');var promptnote='';if(isprompt){if(!promptvar)
26promptvar='note';if(jthis.attr('data-prompt-title'))
27confirmtitle=jthis.attr('data-prompt-title');confirmed=prompt(confirmtitle);if(confirmed!==null){promptnote=confirmed;confirmed=true;}else{confirmed=false;}}else{confirmed=confirm(confirmtitle);}
28if(faction&&(faction.indexOf('#')===0||faction.indexOf('javascript:')===0))
29faction=false;if(confirmed&&faction&&this.tagName.toLowerCase()=='a'&&!jthis.is('.ajax_content')&&!jthis.is('.ajax_link'))
30{var fvariable=faction.match(/\/([a-z_-]+)\/?([0-9\.]*?)$/);var jform=$("<form action='"+faction+"' method='post' "+
31(jthis.prop('target')?"target='"+jthis.prop('target')+"'":"")+" style='display:none;'>"+"<input type='hidden' name='"+CI_CSRF_TOKEN_NAME+"' value='"+CI_CSRF_TOKEN_VALUE+"' />"+
32(isprompt?"<input type='hidden' name='"+promptvar+"' value='"+encodeURIComponent(promptnote)+"' />":"")+
33(fvariable&&fvariable[1]&&fvariable[2]?"<input type='hidden' name='"+fvariable[1]+"' value='"+fvariable[2]+"' />":"")+"<input type='hidden' name='confirmed' value='Yes' />"+"</form>");$('body').append(jform);jform.submit();return false;}
34if(confirmed)
35jthis.trigger('click_confirmed');else
36e.stopImmediatePropagation();return confirmed;});});if(typeof(jthis.validationEngine)!='undefined'){jthis.find('form').validationEngine('attach',{scrollOffset:parseInt($(window).height()/2)});}
37if(typeof(jthis.intlTelInput)!='undefined'){jthis.find('input.intl_tel').intlTelInput({initialCountry:'us'}).unbind('countrychange.iti, change.iti').bind('countrychange.iti, change.iti',function(){var jinput=$(this);jinput.val(jinput.intlTelInput("getNumber"));});}
38if(typeof(jthis.ajaxLink)!='undefined')
39jthis.find('.ajax_link').ajaxLink();if(typeof(jthis.ajaxForm)!='undefined')
40jthis.find('form.ajax_form,form.ajax_submit_form').ajaxForm().find('input.target_blank').unbind('.ajaxForm').bind('click.ajaxForm',function(){var jthis=$(this);var jform=jthis.closest('form');var btarget=jform.attr('target');jform.attr('target','_blank');setTimeout(function(){if(btarget)
41jform.attr('target',btarget);else
42jform.removeAttr('target');jform.data('submitting',false)},100);});if(typeof(jthis.ajaxContentLink)!='undefined')
43jthis.find('.ajax_content').ajaxContentLink();if(typeof(jthis.ajaxPaging)!='undefined')
44jthis.find('.ajax_paging a,.ajax_paging select').ajaxPaging();if(typeof(jthis.fcToggle)!='undefined')
45jthis.find(".fc_title,.fc_content[data-parent]").fcToggle();if(typeof(jthis.ccFormat)!='undefined')
46jthis.find('.cc_format').ccFormat();if(typeof(jthis.tabby)!='undefined')
47jthis.find('.tabby').tabby();if(typeof(jthis.stackedRows)!='undefined')
48jthis.find('.stackedrows').stackedRows();if(typeof(jthis.fancybox)!='undefined')
49jthis.find(".fancybox").fancybox({'transitionIn':'none','transitionOut':'none','overlayOpacity':1,'overlayColor':'rgba(0,0,0,.9)','cyclic':true});if(typeof(jthis.photoSwipe)!='undefined'){var galleries={};jthis.find('.fancybox:not(.no_photoswipe)').each(function(){if(!this.rel&&$.photoSwipe.isImage(this.href))
50this.rel=this.href;if(!this.rel)
51return;if(!galleries[this.rel])
52galleries[this.rel]=[];galleries[this.rel].push(this);});$.each(galleries,function(){$(this).photoSwipe();});jthis.find('.photo_gallery_outer, .video_gallery_outer, .qr_code_category').add(jthis.find('.photo_gallery_pic').closest('.photo_gallery_outer')).add(jthis.find('.video_gallery_vid').closest('.video_gallery_outer')).add(jthis.find('.qr_code').closest('.qr_code_category')).each(function(){$(this).find('a.fancybox:not(.no_photoswipe)').photoSwipe({preload:[0,0]});});}
53jthis.find('input[type="file"]').unbind('change.FI').bind('change.FI',function(){var jfile=$(this);var files=this.files;var filesize=0;if(!jfile.is(':visible')||!files||!files.length||typeof(CI_MAX_UPLOAD_SIZE)=='undefined')
54return;for(var i=0;i<files.length;i++){if(files[i]&&files[i].size>0)
55filesize+=files[i].size;}
56if(filesize>0&&filesize>CI_MAX_UPLOAD_SIZE)
57alert('Files size of '+Math.round(filesize/1024/1024)+' MB is bigger than the upload limit set ('+Math.round(CI_MAX_UPLOAD_SIZE/1024/1024)+' MB)! \n'+'Please select a smaller file to upload or less files in case of multiple files selected.');});jthis.find(".check_all").unbind('click.FI').bind('click.FI',function(){var jthis=$(this);var checked_status=this.checked;var parent_element="table";if(jthis.attr('alt'))
58parent_element=jthis.attr('alt');jthis.closest(parent_element).find("input[type=checkbox]").prop('checked',checked_status);});jthis.find("td > a.fc_title").each(function(){var jgroup=$(this);jgroup.closest('tr').find('input[type=checkbox]').unbind('click.FI').bind('click.FI',function(){var jthis=$(this);var checked_status=this.checked;var parent_element="table";if(jthis.attr('alt'))
59parent_element=jthis.attr('alt');jthis.parents(parent_element).find(jgroup.attr('data-target')).find('input[type=checkbox]').prop('checked',checked_status);});});jthis.find('td.link').unbind('click.FI').bind('click.FI',function(e){if(e.ctrlKey)
60return;if(typeof(e.clientX)!='undefined')
61$(this).find('a').first().click();});jthis.find(".auto_submit").unbind('change.FI').bind('change.FI',function(){var jinput=$(this);if(jinput.attr('form'))
62$('#'+jinput.attr('form')).submit();else
63jinput.closest('form').submit();});jthis.find(".tooltip").each(function(){var jthis=$(this);if(!jthis.find('.close:first').size())
64jthis.prepend('<span class="close" style="float:right;" onclick="$(this).parent().showHide();">&times;</span>');});if(typeof(jthis.tipsy)!='undefined'){var jthis=$(this);var fancybox=jthis.closest('#fancybox-content');var zindex;if(fancybox&&fancybox.length)
65zindex=fancybox.css('z-index');jthis.find('table td[title]').tipsy({delayIn:100,html:true,gravity:'w',zindex:zindex});jthis.find('.tip,table a[title]').tipsy({delayIn:100,html:true,zindex:zindex});jthis.find('form input[type=file][title]').tipsy({delayIn:100,trigger:'hover',gravity:'w',zindex:zindex});jthis.find('form input[title],form textarea[title],form select[title]').tipsy({trigger:'focus',gravity:'w',zindex:zindex});}
66jthis.find('input.auto').each(function(){$(this).unbind('keyup.FI').bind('keyup.FI',function(){var jthis=$(this);var nwidth=jthis.val().length*(jthis.css('font-size')?parseFloat(jthis.css('font-size'))-7:8);if(nwidth>700)
67nwidth=700;if(nwidth>150&&jthis.width()<nwidth)
68jthis.width(nwidth);}).keyup();});jthis.find('.combobox').each(function(){var jinput=$(this).find('input');var jselect=$(this).find('select');jselect.change(function(){jinput.val(this.value).trigger('keyup').trigger('change');});});if(typeof(jthis.datepicker)!='undefined'){jthis.find("input.calendar").each(function(){var jthis=$(this);var dateformat='';if(jthis.data('datepicker'))
69return true;if(jthis.is('.timestamp')&&!jthis.datepicker.DPGlobal){var d=new Date();dateformat='m/dd/yy '+((d.getHours()==0?12:d.getHours()>12?d.getHours()-12:d.getHours()))+':'+d.getMinutes()+' '+(d.getHours()>=12?"'PM'":"'AM'");}else if(jthis.is('.time')&&!jthis.datepicker.DPGlobal){var d=new Date();dateformat=((d.getHours()==0?12:d.getHours()>12?d.getHours()-12:d.getHours()))+':'+d.getMinutes()+' '+(d.getHours()>=12?"'PM'":"'AM'");}else{dateformat='m/dd/yy';}
70jthis.datepicker({showAnim:'fadeIn',dateFormat:dateformat,constrainInput:false}).after($("<a class='show_calendar_picker'>&nbsp;</a>").click(function(){jthis.focus();}));});}
71if(typeof(jthis.passy)!='undefined'){var ignore=false;var jfields=jthis.find("input.passy:not([type=hidden])");jfields.each(function(i){if(ignore){ignore=false;return true;}
72if(typeof(jfields[i+1])!='undefined'&&jfields[i+1].name.indexOf('re_')===0){$([this,jfields[i+1]]).passy('ui');ignore=true;return true;}
73$(this).passy('ui');});}
74if(typeof(jthis.tabs)!='undefined'){jthis.find(".ui-tabs").tabs();}
75if(typeof(jthis.ColorPicker)!='undefined'||typeof(jthis.spectrum)!='undefined'){jthis.find("input.color").each(function(){var jthis=$(this);if(jthis.data('colorpickerID')||jthis.data('spectrum.id')!=undefined)
76return true;if(typeof(jthis.spectrum)!='undefined'){var colorChangeTimeout;jthis.spectrum({showAlpha:true,showInput:true,showInitial:true,allowEmpty:true,showButtons:false,clickoutFiresChange:!jthis.is('.flat'),hideAfterPaletteSelect:true,showPalette:true,palette:[],maxSelectionSize:10,localStorageKey:"spectrum.fi",preferredFormat:"hexd",flat:jthis.is('.flat'),color:(jthis.val()?jthis.val():jthis.attr('placeholder')),move:function(color){jthis.val((color?color.toRgbString():''));clearTimeout(colorChangeTimeout);colorChangeTimeout=setTimeout(function(){jthis.trigger('change');},500);}});return true;}
77jthis.ColorPicker({onBeforeShow:function(){$(this).ColorPickerSetColor(this.value);}}).after($("<a class='show_color_picker'>&nbsp;</a>").click(function(){$(this).parent().find('input').focus();return false;}));});}
78jthis.find(".search_input").each(function(){var jthis=$(this);var jclear=jthis.parent().find('.clear_search_input');if(!jclear.length){jclear=$('<a class="clear_search_input" '+'style="'+(jthis.val()==''?'display:none;':'')+'">&nbsp;</a>').click(function(){jthis.val('').closest('form').submit();jclear.hide();});jthis.after(jclear);}
79jthis.unbind('keyup.FI, blur.FI').bind('keyup.FI, blur.FI',function(){if(jthis.val()!='')jclear.css('display','inline-block');else jclear.hide();});jthis.trigger('keyup');});if(typeof(jthis.filePreview)!='undefined')
80jthis.find('input[type=file].preview').filePreview();if(typeof(CKEDITOR)!='undefined'){jthis.find('.editor').each(function(){var jthis=$(this);var inline=jthis.is('.inline');var width=jthis.outerWidth();if(typeof(CKEDITOR.instances[jthis.attr('id')])!='undefined')
81delete CKEDITOR.instances[jthis.attr('id')];if(typeof(CKEDITOR.instances[jthis.attr('name')])!='undefined')
82delete CKEDITOR.instances[jthis.attr('name')];CKEDITOR[(inline?'inline':'replace')](this,{startupMode:(jthis.is('.source')?'source':'wysiwyg'),toolbar:(jthis.is('.simple')?'simple':'full'),height:(inline||jthis.is('.simple')?'150px':'300px'),on:{instanceReady:function(ev){if(inline&&width>20)
83jthis.parent().find('.cke_textarea_inline').outerWidth(width);if(typeof(jthis.tipsy)!='undefined')
84jthis.parent().find('.cke_toolbox a[title]').tipsy({delayIn:100,html:true});},paste:function(ev){console.log(ev);if(ev&&ev.data&&ev.data.dataValue)
85ev.data.dataValue=ev.data.dataValue.replace(/(class[\s]*?=[\s]*?"[^"]*?)ai_.*?([\s"])/ig,'$1$2');}}});});}
86if(typeof(jthis.froalaEditor)!='undefined'){jthis.find('.editor').each(function(){var jthis=$(this);var inline=jthis.is('.inline');var width=jthis.outerWidth();var placeholder=jthis.attr('placeholder');var cssfiles=[];var buttons=[(!inline?'fullscreen':''),'bold','italic','underline','strikeThrough','subscript','superscript','|','paragraphFormat','fontFamily','fontSize','align','color','|','formatOL','formatUL','outdent','indent','quote','|','insertLink','anchor','insertImage','insertVideo','insertTable','insertHR',(!inline?'specialCharacters':''),(!inline?'emoticons':''),'fontAwesome','contentCodes','|','undo','redo','|','clearFormatting','html',(!inline?'help':''),(!inline?'contentHistory':'')];if(jthis.is('.simple'))
87buttons=[(!inline?'fullscreen':''),'bold','italic','underline','strikeThrough','|','paragraphFormat','fontFamily','fontSize','align','color','|',(!inline?'formatOL':''),(!inline?'formatUL':''),'insertLink',(!inline?'anchor':''),'insertImage',(!inline?'specialCharacters':''),
87(!inline?'emoticons':''),'fontAwesome','contentCodes','|','undo','redo','|','html','contentHistory'];var videoparams={};var imageparams={trough:'froala',mode:'add',currentpath:'/static/sitefiles/images/'};imageparams[CI_CSRF_TOKEN_NAME]=CI_CSRF_TOKEN_VALUE;$.extend(videoparams,imageparams);videoparams.currentpath='/static/sitefiles/media/';if(typeof(CI_SITE_URL)!='undefined'){$('link').each(function(){if(this.href&&this.href.indexOf(CI_SITE_URL)!=-1)
88cssfiles.push(this.href);});}
89jthis.froalaEditor({iframe:true,iframeStyleFiles:cssfiles,key:'wA6C6C5F5hB3D3B11D9C3B4A3F3D3H3cODOb1HLEBFZOTGHW==',toolbarButtons:buttons,toolbarButtonsMD:buttons,toolbarButtonsSM:buttons,toolbarButtonsXS:buttons,charCounterCount:false,codeMirror:false,contentHistory:true,imageDefaultWidth:0,toolbarStickyOffset:($('body>.header>.nav').is(':visible')?30:0),width:(inline&&width>20?width:'auto'),heightMin:(inline?80:130),heightMax:($('html').is('.in_iframe')?500:0),imageUploadURL:(CI_SITE_URL?CI_SITE_URL:'')+'ckeditor/filemanager/connectors/php/filemanager.php',imageCORSProxy:false,imageUploadParam:'newfile[]',imageUploadParams:imageparams,videoUploadURL:(CI_SITE_URL?CI_SITE_URL:'')+'ckeditor/filemanager/connectors/php/filemanager.php',videoUploadParam:'newfile[]',videoUploadParams:videoparams,pluginsEnabled:['align','codeView','colors','colorsMod','draggable','emoticons','entities','file','fontFamily','fontSize','forms','fullscreen','help','image','inlineStyle','lineBreaker','link','lists','paragraphFormat','paragraphStyle','quickInsert','quote','specialCharacters','table','url','video','wordPaste','codeViewMod','formatMod','popupMod','insertLinkMod','anchor','imageMod','contentCodes','fontAwesome','contentHistoryPopup',(!inline?'contentHistory':''),'fileManager'],htmlRemoveTags:[],htmlExecuteScripts:false,htmlAllowedTags:['.*'],htmlAllowedStyleProps:[".*",".*%|"],htmlAllowedAttrs:['.*'],htmlDoNotWrapTags:['script','style','span','img'],htmlAllowedEmptyTags:['textarea','a','iframe','object','video','style','script','i','span','path','line'],tableEditButtons:['tableHeader','tableRemove','|','tableRows','tableColumns','-','tableCells','tableCellBackgroun
89d','tableCellVerticalAlign','tableCellHorizontalAlign'],fontFamily:$.extend({},{"'Arial', 'Helvetica', 'sans-serif'":'Arial',"'Arial Black', 'Gadget', 'sans-serif'":'Arial Black',"'Helvetica', 'sans-serif'":'Helvetica',"'Comic Sans MS', 'cursive', 'sans-serif'":'Comic Sans MS',"'Impact', 'Charcoal', 'sans-serif'":'Impact',"'Lucida Sans Unicode', 'Lucida Grande', 'sans-serif'":'Lucida Sans Unicode',"'Tahoma', 'Geneva', 'sans-serif'":'Tahoma',"'Trebuchet MS', 'Helvetica', 'sans-serif'":'Trebuchet MS',"'Verdana', 'Geneva', 'sans-serif'":'Verdana',"'Georgia', 'serif'":'Georgia',"'Palatino Linotype', 'Book Antiqua', 'Palatino', 'serif'":'Palatino Linotype',"'Times New Roman', 'Times', 'serif'":'Times New Roman',"'Courier', 'monospace'":'Courier',"'Courier New', 'Courier', 'monospace'":'Courier New',"'Lucida Console', 'Monaco', 'monospace'":'Lucida Console',"'monospace'":'Monospace'},(typeof(EDITOR_FONTS)!='undefined'?EDITOR_FONTS:{})),linkList:[{text:'Google',href:'https://google.com'},{text:'Bing',href:'https://bing.com'},{text:'Facebook',href:'https://facebook.com'}],linkStyles:{'button':'Button','fa-rotate-90':'Rotate 90','fa-rotate-180':'Rotate 180','fa-rotate-270':'Rotate 270','fa-flip-horizontal':'Flip Horizontal','fa-flip-vertical':'Flip Vertical','fa-spin':'Spinning'},imageStyles:{'fa-round':'Rounded','fa-border':'Bordered','fa-rotate-90':'Rotate 90','fa-rotate-180':'Rotate 180','fa-rotate-270':'Rotate 270','fa-flip-horizontal':'Flip Horizontal','fa-flip-vertical':'Flip Vertical','fa-spin':'Spinning'},toolbarInline:inline,toolbarVisibleWithoutSelection:inline,placeholderText:(placeholder?placeholder:'Type Something')}).on('froalaEditor.paste.afterCleanup',function(e,editor,html){if(html)
90return html.replace(/(class[\s]*?=[\s]*?"[^"]*?)ai_.*?([\s"])/ig,'$1$2');}).on('froalaEditor.image.error,froalaEditor.video.error',function(e,editor,error,response){try{var jresponse=jQuery.parseJSON(response);if(jresponse.Error)
91response=jresponse.Error;}catch(e){}
92if(!response&&error)
93response=error.message;if(response)
94$('.fr-image-progress-bar-layer.fr-active h3,.fr-video-progress-bar-layer.fr-active h3').append('<br /><span class="red">'+response+"</span>");});});}
95jthis.find('input[data-max-chars],input[data-min-chars],textarea[data-max-chars],textarea[data-min-chars]').charCounter();jthis.find('label').each(function(){var jlabel=$(this);var jinput=jlabel.next();if(!jinput.is('input'))
96jinput=jinput.find('input')
97if(!jinput.length||jinput.attr('aria-label'))
98return;jinput.attr('aria-label',jlabel.text());});if($.FI.plugins.length>0){for(var i=0;i<$.FI.plugins.length;i++){if(!$.FI.plugins[i].selector){jthis[$.FI.plugins[i].plugin]();continue;}
99if(typeof($.FI.plugins[i].plugin)=='function'){jthis.find($.FI.plugins[i].selector).each($.FI.plugins[i].plugin);}else if(typeof($.fn[$.FI.plugins[i].plugin])!='undefined'){jthis.find($.FI.plugins[i].selector)[$.FI.plugins[i].plugin]();}}}
100if($.FI.functions.length>0){for(var i=0;i<$.FI.functions.length;i++){jthis.each($.FI.functions[i]);}}
101if($.FI.readys.length>0){for(var i=0;i<$.FI.readys.length;i++){jthis.each($.FI.readys[i]);}
102$.FI.readys=new Array();}
103if(typeof(FB)!='undefined'&&FB.XFBML&&FB.XFBML.parse)
104try{FB.XFBML.parse(jthis[0]);}catch(e){}
105if(typeof(DISQUS)!='undefined'&&DISQUS.reset)
106try{DISQUS.reset({reload:true});}catch(e){}
107if(typeof(gapi)!='undefined'&&gapi.plusone&&gapi.plusone.go)
108try{gapi.plusone.go();}catch(e){}
109if(typeof(twttr)!='undefined'&&twttr.widgets&&twttr.widgets.load)
110try{twttr.widgets.load();}catch(e){}});},showHide:function(speed,callback,showHide){if(typeof(speed)=='boolean'){showHide=speed;speed='fast';}
111if(typeof(speed)=='function'){callback=speed;speed='fast';}
112if(typeof(speed)=='undefined')
113speed='fast';return this.each(function(){var jthis=$(this);var jwindow=$(window);var inline=(jthis.css('display')=='inline'||jthis.is('.inline'));if(jthis.css('display')=='none'&&(typeof(showHide)=='undefined'||showHide==true))
114{jthis.stop().css((inline?{'opacity':'','display':'inline'}:{'opacity':'','height':''})).animate((inline?{'opacity':'show'}:{'opacity':'show','height':'show'}),speed,function(){jthis.css({'overflow':''});if(typeof(callback)=='function')
115callback();var jthisoffset=jthis.offset();if((jthis.is('.auto_scroll_to')&&((jthisoffset&&jthisoffset.top&&jwindow.scrollTop()>jthisoffset.top)||(jthisoffset&&jthisoffset.top&&jthisoffset.top>jwindow.scrollTop()+jwindow.height()-50)))||(jthisoffset&&jthis.is('.scroll_to')))
116{$('html,body').animate({scrollTop:jthisoffset.top-100},50,'linear');}});}else if(jthis.css('display')!='none'&&(typeof(showHide)=='undefined'||showHide==false))
117{jthis.closest('form').find('div.formError').fadeOut('fast',function(){$(this).remove();});jthis.stop().css((inline?{'opacity':''}:{'opacity':'','height':''})).animate((inline?{'opacity':"hide"}:{'opacity':"hide",'height':"hide"}),(inline?0:speed),function(){if(typeof(callback)=='function')
118callback();});}});},redirectSubmit:function(action,target){return this.each(function(){var jform=$(this);var baction=jform.attr('action');var btarget=jform.attr('target');jform.attr('action',action);jform.attr('target',target);jform.submit();jform.removeData('submitting');
118if(!baction)
119jform.removeAttr('action');else
120jform.attr('action',baction);if(!btarget)
121jform.removeAttr('target');else
122jform.attr('target',btarget);return false;});}});(function(){$.fn.charCounter=function(){var jinput=$(this);var maxChars=jinput.attr('data-max-chars');var minChars=jinput.attr('data-min-chars');jinput.unbind('.char_count').bind('keyup.char_count focus.char_count',function(){if(typeof(jinput.tipsy)=='undefined')
123return;if(!jinput.data('tipsy'))
124jinput.tipsy({title:function(){var chars=jinput.val().length;if(chars>maxChars)
125chars='<b style="color:red">'+chars+'</b>';else
126chars='<b>'+chars+'</b>';return'Characters: '+chars+
127(maxChars>0?' / '+maxChars+' recommended maximum':'')+
128(minChars>0?' / '+minChars+' recommended minimum':'');},trigger:'manual',html:true,opacity:1.0,gravity:'w'});jinput.tipsy("show");}).bind('blur.char_count',function(){if(typeof(jinput.tipsy)=='undefined')
129return;jinput.tipsy("hide");});};if(top!==self&&typeof(top.postMessage)!='undefined'){try{top.location.href.replace('#','#');}catch(e){var lastHeight=document.body.clientHeight,newHeight;(function run(){newHeight=document.body.clientHeight;if(lastHeight!=newHeight)
130top.postMessage(newHeight+':iframeheight','*');lastHeight=newHeight;setTimeout(run,250);})();}}
131$(document).delegate('form','submit',function(){var jform=$(this);if(jform.data('submitting'))
132return false;jform.data('submitting',true);});window.sessionTimeout=setTimeout(function(){var msg='Your session timed out.';if(typeof($.loading)=='undefined'){if(confirm(msg+' Refresh?'))window.location.reload();return;}
133$.FI.toast('<span>'+msg+' <a href="javascript:window.location.reload();">Refresh</a></span>','','');},18000*1000);})();;;(function($){var L=$.loading=function(show,opts){return $('body').loading(show,opts,true);};$.fn.loading=function(show,opts,page){opts=toOpts(show,opts);var base=page?$.extend(true,{},L,L.pageOptions):L;return this.each(function(){var $el=$(this),l=$.extend(true,{},base,$.metadata?$el.metadata():null,opts);if(typeof l.onAjax=="boolean"){L.setAjax.call($el,l);}else{L.toggle.call($el,l);}});};var fixed={position:'fixed'};var watchingAjax=false;$.extend(L,{version:"1.6.4",align:'top-left',pulse:'working giveup',mask:false,img:null,element:null,text:'',onAjax:undefined,delay:0,max:0,classname:'loading',imgClass:'loading-img',elementClass:'loading-element',maskClass:'loading-mask',css:{position:'absolute',whiteSpace:'nowrap',zIndex:999999},maskCss:{position:'absolute',opacity:.15,background:'#333',zIndex:101,display:'block',cursor:'wait'},cloneEvents:true,pageOptions:{page:true,align:'top-center',css:fixed,maskCss:fixed},html:'<div></div>',maskHtml:'<div></div>',maskedClass:'loading-masked',maskEvents:'mousedown mouseup keydown keypress',resizeEvents:'resize',working:{time:10000,text:'',run:function(l){var w=l.working,self=this;w.timeout=setTimeout(function(){self.height('auto').width('auto').text(l.text=w.text);l.place.call(self,l);},w.time);}},error:{time:100000,text:'Task takes longer than usual...',classname:'loading-error',run:function(l){var e=l.error,self=this;e.timeout=setTimeout(function(){self.height('auto').width('auto').text(l.text=e.text).addClass(e.classname);l.place.call(self,l);},e.time);}},giveup:{time:1000000,run:function(l){var g=l.giveup,self=this;g.timeout=setTimeout(function(){self.hide();},g.time);}},fade:{time:800,speed:'slow',run:function(l){var f=l.fade,s=f.speed,self=this;f.interval=setInterval(function(){self.fadeOut(s).fadeIn(s);},f.time);}},ellipsis:{time:300,run:function(l){var e=l.ellipsis,self=this;e.interval=setInterval(function(){var et=self.text(),t=l.text,i=dotIndex(t);self.text((et.length-i)<3?et+'.':t.substring(0,i));},e.time);function dotIndex(t){var x=t.indexOf('.');return x<0?t.length:x;}}},type:{time:100,run:function(l){var t=l.type,self=this;t.interval=setInterval(function(){var e=self.text(),el=e.length,txt=l.text;self.text(el==txt.length?txt.charAt(0):txt.substring(0,el+1));},t.time);}},toggle:function(l){var old=this.data('loading'+(l.onAjax?'Ajax':''));if(old){if(l.show!==true)old.off.call(this,old,l);}else{if(l.show!==false)l.on.call(this,l);}},setAjax:function(l){if(l.onAjax){if(watchingAjax)return;var self=this,count=0,A=l.ajax={start:function(){if(!count++)l.on.call(self,l);},stop:function(){if(!--count)l.off.call(self,l,l);}};$(document).bind('ajaxStart.loading',A.start).bind('ajaxStop.loading',A.stop);watchingAjax=true;}else{$(document).unbind('ajaxStart.loading ajaxStop.loading');watchingAjax=false;}},on:function(l,force){var p=l.parent=this.data('loading'+(l.onAjax?'Ajax':''),l);if(l.max)l.maxout=setTimeout(function(){l.off.call(p,l,l);},l.max);if(l.delay&&!force){return l.timeout=setTimeout(function(){delete l.timeout;l.on.call(p,l,true);},l.delay);}
134if(l.mask)l.mask=l.createMask.call(p,l);l.display=l.create.call(p,l);if(l.img){l.initImg.call(p,l);}else if(l.element){l.initElement.call(p,l);}else{l.init.call(p,l);}
135p.trigger('loadingStart',[l]);},initImg:function(l){var self=this;l.imgElement=$('<img src="'+l.img+'"/>').bind('load',function(){l.init.call(self,l);});l.display.addClass(l.imgClass).append(l.imgElement);},initElement:function(l){l.element=$(l.element).clone(l.cloneEvents).show();l.display.addClass(l.elementClass).append(l.element);l.init.call(this,l);},init:function(l){l.place.call(l.display,l);if(l.pulse)l.initPulse.call(this,l);},initPulse:function(l){$.each(l.pulse.split(' '),function(){l[this].run.call(l.display,l);});},create:function(l){var el=$(l.html).addClass(l.classname).css(l.css).appendTo(this);if(l.text&&!l.img&&!l.element)el.text(l.originalText=l.text);$(window).bind(l.resizeEvents,l.resizer=function(){l.resize(l);});return el;},resize:function(l){l.parent.box=null;if(l.mask)l.mask.hide();l.place.call(l.display.hide(),l);if(l.mask)l.mask.show().css(l.parent.box);},createMask:function(l){var box=l.measure.call(this.addClass(l.maskedClass),l);l.handler=function(e){return l.maskHandler(e,l);};
135$(document).bind(l.maskEvents,l.handler);return $(l.maskHtml).addClass(l.maskClass).css(box).css(l.maskCss).appendTo(this);},maskHandler:function(e,l){var $els=$(e.target).parents().andSelf();if($els.filter('.'+l.classname).length!=0)return true;return!l.page&&$els.filter('.'+l.maskedClass).length==0;},place:function(l){var box=l.align,v='top',h='left';if(typeof box=="object"){box=$.extend(l.calc.call(this,v,h,l),box);}else{if(box!='top-left'){var s=box.split('-');if(s.length==1){v=h=s[0];}else{v=s[0];h=s[1];}}
136if(!this.hasClass(v))this.addClass(v);if(!this.hasClass(h))this.addClass(h);box=l.calc.call(this,v,h,l);}
137this.show().css(l.box=box);},calc:function(v,h,l){var box=$.extend({},l.measure.call(l.parent,l)),H=this.height(),W=this.width();if(v!='top'){var d=box.height-H;if(v=='center'){d/=2;}else if(v!='bottom'){d=0;}else{d-=css(this,'paddingTop')+css(this,'paddingBottom');}
138box.top+=d;}
139if(h!='left'){var d=box.width-W;if(h=='center'){d/=2;}else if(h!='right'){d=0;}else{d-=css(this,'paddingLeft')+css(this,'paddingRight');}
140box.left+=d;}
141box.height=H;box.width=W;return box;},measure:function(l){return this.box||(this.box=l.page?l.pageBox(l):l.elementBox(this,l));},elementBox:function(e,l){if(e.css('position')=='absolute'){var box={top:0,left:0};}else{var box=e.position();box.top+=css(e,'marginTop');box.left+=css(e,'marginLeft');}
142box.height=e.outerHeight();box.width=e.outerWidth();return box;},pageBox:function(l){var full=l.css.position!='fixed';return{top:0,left:0,height:get(full,'Height'),width:get(full,'Width')};function get(full,side){var doc=document;if(full){var s=side.toLowerCase(),d=$(doc)[s](),w=$(window)[s]();return d-css($(doc.body),'marginTop')>w?d:w;}
143var c='client'+side;return Math.max(doc.documentElement[c],doc.body[c]);}},off:function(old,l){this.data('loading'+(l.onAjax?'Ajax':''),null);if(old.maxout)clearTimeout(old.maxout);if(old.timeout)return clearTimeout(old.timeout);if(old.pulse)old.stopPulse.call(this,old,l);if(old.originalText)old.text=old.originalText;if(old.mask)old.stopMask.call(this,old,l);$(window).unbind(old.resizeEvents,old.resizer);if(old.display)old.display.remove();if(old.parent)old.parent.trigger('loadingEnd',[old]);},stopPulse:function(old,l){$.each(old.pulse.split(' '),function(){var p=old[this];if(p.end)p.end.call(l.display,old,l);if(p.interval)clearInterval(p.interval);if(p.timeout)clearTimeout(p.timeout);});},stopMask:function(old,l){this.removeClass(l.maskedClass);$(document).unbind(old.maskEvents,old.handler);old.mask.remove();}});function toOpts(s,l){if(l===undefined){l=(typeof s=="boolean")?{show:s}:s;}else{l.show=s;}
144if(l&&(l.img||l.element)&&!l.pulse)l.pulse=false;if(l&&l.onAjax!==undefined&&l.show===undefined)l.show=false;return l;}
145function css(el,prop){var val=el.css(prop);return val=='auto'?0:parseFloat(val,10);}})(jQuery);;(function($){var appendTo=document.body;function Tipsy(element,options){this.$element=$(element);this.options=options;this.enabled=true;this.fixTitle();}
146Tipsy.prototype={show:function(){var title=this.getTitle();if(title&&this.enabled){var $tip=this.tip();$tip.find('.tipsy-inner')[this.options.html?'html':'text'](title);$tip[0].className='tipsy';$tip.remove().css({top:0,left:0,visibility:'hidden',display:'block'});if(this.options.relative)
147$tip.insertAfter(this.$element);else
148$tip.appendTo(appendTo);if(this.options.zindex)
149$tip.css({'z-index':this.options.zindex});this.update();if(this.options.fade){$tip.stop().css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:this.options.opacity});}else{$tip.css({visibility:'visible',opacity:this.options.opacity});}
150if(this.options.relative&&typeof this.options.gravity!='function'&&$tip[0].offsetParent){this.options.origGravity=this.options.gravity;if(this.options.gravity.charAt(0)=='n'){if($tip[0].offsetTop+$tip[0].offsetHeight>$tip[0].offsetParent.scrollTop+$tip[0].offsetParent.offsetHeight){this.options.gravity='s';this.update();}}else if(this.options.gravity.charAt(0)=='s'){if($tip[0].offsetTop<$tip[0].offsetParent.scrollTop){this.options.gravity='n';this.update();}}
151this.options.gravity=this.options.origGravity;}
152if(this.options.closeButton){$tip.find('.tipsy-close-button a').mousedown(function(e){$tip.find('iframe').blur();$tip.hide();e.preventDefault();});}else if($tip.is('.tipsy-menu')){if($tip[0].offsetTop===0&&$tip[0].offsetLeft===0&&$tip[0].offsetWidth>=$tip[0].offsetParent.offsetWidth-5){$tip.children('.tipsy-outer').css({top:$tip[0].style.top,left
152:$tip[0].style.left})
153$tip.click(function(e){if(e.target==this)
154$tip.hide();});}}}},update:function(){if(this.enabled){var $tip=this.tip();$tip[0].className='tipsy'+
155(this.options.additionalClassName!=''?' '+this.options.additionalClassName:'');var pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var relativePos={left:this.$element[0].offsetLeft,top:this.$element[0].offsetTop};var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;var gravity=(typeof this.options.gravity=='function')?this.options.gravity.call(this.$element[0]):this.options.gravity;if($tip.is('.tipsy-menu')){if($tip[0].offsetTop===0&&$tip[0].offsetLeft===0&&actualWidth>=$tip[0].offsetParent.offsetWidth-5){actualWidth=$tip.children('.tipsy-outer')[0].offsetWidth;actualHeight=$tip.children('.tipsy-outer')[0].offsetHeight;}}
156if(pos.top==0)
157pos.top=$tip.offset().top;if(pos.left==0)
158pos.left=$tip.offset().left;var tp;switch(gravity.charAt(0)){case'n':if(this.options.relative)
159tp={top:relativePos.top+pos.height,left:relativePos.left+pos.width/2-actualWidth/2};else
160tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case's':if(this.options.relative)
161tp={top:relativePos.top-actualHeight,left:relativePos.left+pos.width/2-actualWidth/2};else
162tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case'e':if(this.options.relative)
163tp={top:relativePos.top+pos.height/2-actualHeight/2,left:relativePos.left-actualWidth};else
164tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset};break;case'w':if(this.options.relative)
165tp={top:relativePos.top+pos.height/2-actualHeight/2,left:relativePos.left+pos.width};else
166tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset};break;}
167if(gravity.length==2&&!this.options.relative){if(gravity.charAt(1)=='w'){tp.left=pos.left+pos.width/2-15;}else{tp.left=pos.left+pos.width/2-actualWidth+15;}}
168var ns=(gravity.charAt(0)=='n'||gravity.charAt(0)=='s');var bkleft=tp.left;$tip.children('.tipsy-arrow').css({left:''});if($tip.is('.tipsy-big,.tipsy-menu')&&ns){var maxWidth=$(document).scrollLeft()+$(window).width();if(tp.left+actualWidth>maxWidth){tp.left=maxWidth-actualWidth-
169(parseInt($tip.css('padding-right'))+
170parseInt($tip.find('.tipsy-outer').css('padding-right')));$tip.children('.tipsy-arrow').css({left:'calc(50% + '+(bkleft-tp.left)+'px)'});}
171try{if(window.self!==window.top){var maxHeight=$(document).scrollTop()+$(window).height();if(tp.top+actualHeight>maxHeight)
172tp.top=maxHeight-actualHeight-
173(parseInt($tip.css('padding-bottom'))+
174parseInt($tip.find('.tipsy-outer').css('padding-bottom')));}}catch(e){}}
175if($tip.is('.tipsy-fixed')||this.options.fixed){tp.position='fixed';tp.top-=$(document).scrollTop();}
176if(tp.left<0&&!this.options.relative){tp.left=0;if(ns)
177$tip.children('.tipsy-arrow').css({left:'calc(50% + '+(bkleft-tp.left)+'px)'});}
178if(tp.top<0&&!this.options.relative)
179tp.top=0;$tip.css(tp).addClass('tipsy-'+gravity).data('tipsyOwner',this.$element);}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){$(this).remove();});}else{this.tip().remove();}
180if(this.$element.data('original-tipsy')){this.options=this.$element.data('original-tipsy').options;this.$element.removeData('original-tipsy');}},fixTitle:function(){var $e=this.$element;if($e.attr('title')||typeof($e.attr('original-title'))!='string'){$e.attr('original-title',$e.attr('title')||'').removeAttr('title');}},getTitle:function(){var title,$e=this.$element,o=this.options;this.fixTitle();var title,o=this.options;if(typeof o.title=='string'){title=$e.attr(o.title=='title'?'original-title':o.title);}else if(typeof o.title=='function'){title=o.title.call($e[0]);}
181title=(''+title).replace(/(^\s*|\s*$)/,"");return title||o.fallback;},tip:function(){if(!this.$tip){this.$tip=$('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div>'+'<div class="tipsy-outer">'+
182(this.options.closeButton?'<div class="tipsy-close-button">'+'<a href="javascript://">'+'<span>x</span>'+'</a>
182'+'</div>':'')+'<div class="tipsy-inner"></div>'+'</div>');this.$tip.data('tipsy-owner',this.$element);}
183return this.$tip;},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null;}},enable:function(){this.enabled=true;},disable:function(){this.enabled=false;},toggleEnabled:function(){this.enabled=!this.enabled;}};$.fn.tipsy=function(options){if(options===true){return this.data('tipsy');}else if(typeof options=='string'){var tipsy=this.data('tipsy');if(tipsy)tipsy[options]();return this;}
184options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,'tipsy');if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,'tipsy',tipsy);}
185return tipsy;}
186function enter(){var tipsy=get(this);if(tipsy.options.trigger=='manual')
187return;tipsy.hoverState='in';if(options.delayIn==0){tipsy.show();}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=='in')tipsy.show();},options.delayIn);}};function leave(){var tipsy=get(this);if(tipsy.options.trigger=='manual')
188return;tipsy.hoverState='out';if(options.delayOut==0){tipsy.hide();}else{setTimeout(function(){if(tipsy.hoverState=='out')tipsy.hide();},options.delayOut);}};if(!options.live)this.each(function(){get(this);});if(options.trigger!='manual'){var touch=('ontouchstart'in document.documentElement);var binder=options.live?'live':'bind',eventIn=options.trigger=='hover'?(touch?'touchstart':'mouseenter'):'focus',eventOut=options.trigger=='hover'?(touch?'touchend':'mouseleave'):'blur';this[binder](eventIn,enter)[binder](eventOut,leave);}
189return this;};$.fn.tipsy.defaults={delayIn:0,delayOut:0,fade:false,fallback:'',additionalClassName:'',gravity:'n',html:false,live:false,fixed:false,offset:0,opacity:0.8,title:'title',trigger:'hover',closeButton:false,relative:false,zindex:0};$.fn.tipsy.elementOptions=function(ele,options){var $element=$(ele);options=$.extend({},options);if($element.attr('tipsy-class'))
190options.additionalClassName=$element.attr('tipsy-class');if($element.attr('tipsy-gravity'))
191options.gravity=$element.attr('tipsy-gravity');if($element.attr('tipsy-zindex'))
192options.zindex=$element.attr('tipsy-zindex');if(window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.match(/iP(ad|hone)/i)){if($element.is('input'))
193options.delayIn=1000;}
194return $.metadata?$.extend({},options,$element.metadata()):options;};$.fn.tipsy.autoNS=function(){return $(this).offset().top>($(document).scrollTop()+$(window).height()/2)?'s':'n';};$.fn.tipsy.autoWE=function(){return $(this).offset().left>($(document).scrollLeft()+$(window).width()/2)?'e':'w';};})(jQuery);;$.fn.ajaxLink=function(){$(this).unbind('click.ajaxlinks').bind('click.ajaxlinks',function(e){if(e.ctrlKey)
195return;var jthis=$(this);var url=jthis.attr('href');var dataparser=window[jthis.attr('data-parser')];var isconfirm=jthis.is('.confirm');$.ajax({url:url,type:(isconfirm?'POST':'GET'),data:(isconfirm?'confirmed=1&'+CI_CSRF_TOKEN_NAME+'='+CI_CSRF_TOKEN_VALUE:null),complete:function(xhr){var data=xhr.responseText;if(typeof(dataparser)=='function')
196data=dataparser(data);if(data)$.FI.toast(data);}});return false;});};$.fn.ajaxPaging=function(){$(this).each(function(){var tagName=this.tagName.toLowerCase();$(this).unbind((tagName=='select'?'change':'click')+'.ajaxpaging').bind((tagName=='select'?'change':'click')+'.ajaxpaging',function(e){if(tagName!='select'&&e.ctrlKey)
197return;var jthis=$(this);let contentholder=$(this).closest('.paging').parent();var url=jthis.attr('href');var scrollto=jthis.attr('data-scroll-target');if(tagName=='select')
198url=jthis.attr('data-href')+'/0/'+jthis.val();if(contentholder.children().size()<=1)
199contentholder=contentholder.parent();$.get(url,function(data){var jdata=(data&&data.trim()[0]=='<'?$(data):$('<p>'+data+'</p>'));if(contentholder.is('form')&&jdata.first().is('form'))
200contentholder=contentholder.parent();if(typeof($.FroalaEditor)!='undefined')
201contentholder.find('.editor').froalaEditor('destroy');contentholder.html(jdata);setTimeout(function(){contentholder.FI();},1);if(typeof($.mobile)!='undefined')
202contentholder.closest('div[data-role*="page"]').page('destroy').page();var contentoffset=contentholder.offset();var jwindow=$(window);if(scrollto)
203contentoffset=contentholder.find(scrollto).offset();if((contentoffset&&contentoffset.top&&jwindow.scrollTop()>contentoffset.top)||(contentoffset&&contentoffset.top&&contentoffset.top>jwindow.scrollTop()+jwindow.height()-50))
204{$('html,body').animate({scrollTop:contentoffset.top-100},50,'linear');}});jthis.blur();return false;});});};$.fn.ajaxContentLink=function(){$(this).unbind('click.ajaxcontentlink').bind('click.ajaxcontentlink',function(e){if(e.ctrlKey)
205return;var jthis=$(this);var url=jthis.attr('href');var hash=url.match(/(\#[^#]+$)/);var tooltip=jthis.attr('title')||jthis.attr('original-title')||jthis.attr('value')||jthis.text();var reqheader=new Array();
205var dataparser=window[jthis.attr('data-parser')];var isconfirm=jthis.is('.confirm');var isblank=(jthis.attr('target')=='_blank'&&jthis.attr('data-target')?true:false);if(typeof(tooltip)=='undefined')
206tooltip=jthis.text();if(jthis.attr('data-request-header'))
207reqheader=jthis.attr('data-request-header').split(':');if(jthis.attr('data-target')){var target;var method='';var lookup=jthis.attr('data-target-lookup');var scrollto=jthis.attr('data-scroll-target');if(jthis.attr('data-target-method'))
208method=jthis.attr('data-target-method');if(jthis.attr('data-target')=='parent')
209target=jthis.parent();else if(jthis.attr('data-target')=='self')
210target=jthis;else if(method=='closest'||lookup=='closest')
211target=$(this).closest(jthis.attr('data-target'));else
212target=$(jthis.attr('data-target')).first();if(!target.length)
213return true;if(jthis.attr('data-loaded')){if(method=='after')
214target.next().showHide();else if(method=='before')
215target.prev().showHide();else if(method=='append')
216target.last().showHide();else if(method=='prepend')
217target.first().showHide();else
218target.showHide();return false;}
219if(jthis.attr('data-loading'))
220return false;$.ajax({url:url,type:(isconfirm?'POST':'GET'),data:(isconfirm?'confirmed=1&'+CI_CSRF_TOKEN_NAME+'='+CI_CSRF_TOKEN_VALUE:null),beforeSend:function(xhr){if(typeof(reqheader[0])=='undefined')
221return;if(typeof(reqheader[1])=='undefined')
222reqheader[1]='';xhr.setRequestHeader(reqheader[0],reqheader[1]);},complete:function(xhr){var data=xhr.responseText;if(hash&&!$(hash[1]).is(':visible'))
223window.location.hash=hash[1];if(xhr&&xhr.status==201){if(data)$('body').append(data);return;}
224if(typeof(dataparser)=='function')
225data=dataparser(data);jthis.removeAttr('data-loading');if(!data||xhr.status!=200){if(data)$.FI.toast(data);return false;}
226let jdata=(data&&data.trim()[0]=='<'?$(data):$('<p>'+data+'</p>'));if(jdata.length==1&&jdata.is('.tooltip.success,.tooltip.error')){$.FI.toast(jdata.prop('outerHTML'));return false;}
227if(typeof($.FroalaEditor)!='undefined'&&(!method||method=='replace'))
228target.find('.editor').froalaEditor('destroy');if(jthis.is('.slide')){if(method=='after')
229target.after(jdata.css('display','none').showHide());else if(method=='before')
230target.before(jdata.css('display','none').showHide());else if(method=='append')
231target.append(jdata.css('display','none').showHide());else if(method=='prepend')
232target.prepend(jdata.css('display','none').showHide());else if(method=='replace')
233target.replaceWith(jdata.css('display','none').showHide());else
234target.html(jdata).css('display','none').showHide();}else{if(method=='after')
235target.after(jdata);else if(method=='before')
236target.before(jdata);else if(method=='append')
237target.append(jdata);else if(method=='prepend')
238target.prepend(jdata);else if(method=='replace')
239target.replaceWith(jdata);else
240target.html(jdata);}
241if($.FI)$.FI.cleanupTips();setTimeout(function(){jdata.parent().FI();},1);if(typeof($.mobile)!='undefined')
242target.closest('div[data-role*="page"]').page('destroy').page();if(!jthis.is('.renew'))
243jthis.attr('data-loaded','1');var targetoffset=target.offset();var jwindow=$(window);if(scrollto)
244targetoffset=target.find(scrollto).offset();if((targetoffset&&targetoffset.top&&$(window).scrollTop()>targetoffset.top)||(targetoffset&&targetoffset.top&&targetoffset.top>jwindow.scrollTop()+jwindow.height()-50))
245{$('html,body').animate({scrollTop:targetoffset.top-100},50,'linear');}
246jthis.trigger('ajaxContentReady');if(isconfirm)
247$.FI.toast(tooltip+" was successful.",'success');}});jthis.attr('data-loading','true');return isblank;}
248if(typeof(jthis.tipsy)=='undefined')
249return true;if(jthis.data('tipsy')&&!jthis.is('.renew')){if(jthis.data('tipsy').$tip.is(':visible')){jthis.data('tipsy').$tip.hide();}else{jthis.data('tipsy').$tip.show();jthis.tipsy("update");}
250if(jthis.data('tipsy').options.trigger=='hover')
251jthis.tipsy("hide").removeData('tipsy').unbind('mouseenter mouseleave');else
252return false;}
253if(!tooltip||tooltip.indexOf('Loading')==-1)
254jthis.attr('title','Loading '+tooltip+' ... &nbsp; &nbsp; &nbsp;');if(typeof(dataparser)!='function'){jthis.tipsy({trigger:'manual',html:true,opacity:1.0,additionalClassName:'tipsy-big',closeButton:true,gravity:'n'});jthis.tipsy("show");if(jthis.data('tipsy').$tip){var parenttipsy=jthis.closest('.tipsy');if(parenttipsy&&parenttipsy.length&&parseInt(parenttipsy.css('z-index'))>parseInt(jthis.data('tipsy').$tip.css('z-index')))
255{jthis.data('tipsy').$tip.css({'z-index':parenttipsy.css('z-index')});}
256var fancybox=jthis.closest('#fancybox-content');if(fancybox&&fancybox.length){$(document).bind('fancybox-cleanup',function(){jthis.tipsy("hide");});if(parseInt(fancybox.css('z-index'))>parseInt(jthis.data('tipsy').$tip.css('z-index'))){jthis.data('tipsy').$tip.css({'z-index':fancybox.css('z-index')});}}}}
257$.ajax({url:url,type:(isconfirm?'POST':'GET'),data:(isconfirm?'confirmed=1&'+CI_CSRF_TOKEN_NAME+'='+CI_CSRF_TOKEN_VALUE:null),beforeSend:function(xhr){if(typeof(reqheader[0])=='undefined')
258return;if(typeof(reqheader[1])=='undefined')
259reqheader[1]='';xhr.setRequestHeader(reqheader[0],[1]);},complete:function(xhr){var data=xhr.responseText;if(xhr&&xhr.status==201){if(data)$('body').append(data);return;}
260if(hash&&!$(hash[1]).is(':visible'))
261window.location.hash=hash[1];if(typeof(dataparser)=='function')
262data=dataparser(data);if(!data||xhr.status!=200){if(data)$.FI.toast(data);return false;}
263let target=jthis.data('tipsy').$tip.find('.tipsy-inner');target.html(data);
263jthis.tipsy("update").trigger('ajaxContentReady');setTimeout(function(){target.FI();},1);if(isconfirm)
264$.FI.toast(tooltip+" was successful.",'success');}});return isblank;});};$.fn.ajaxLightboxLink=function(){$(this).lightBox({hideDetails:true,disableNavigation:true,ajaxContent:true});};;
265/*!
266 * jQuery Form Plugin
267 * version: 3.36.0-2013.06.16
268 * @requires jQuery v1.5 or later
269 * Copyright (c) 2013 M. Alsup
270 * Examples and documentation at: http://malsup.com/jquery/form/
271 * Project repository: https://github.com/malsup/form
272 * Dual licensed under the MIT and GPL licenses.
273 * https://github.com/malsup/form#copyright-and-license
274 */
275;(function($){"use strict";var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp)
276return this.attr.apply(this,arguments);var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string')
277return val;return this.attr.apply(this,arguments);};$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
278var method,action,url,$form=this;if($form.data('submitting'))
279return false;if(typeof options=='function'){options={success:options};}
280method=options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?$.trim(action):'';url=url||window.location.href||'';if(url){url=(url.match(/^([^#]+)/)||[])[1];}
281options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options);var submit_status_timeout;if(typeof(CKEDITOR)!='undefined'){for(var i in CKEDITOR.instances)
282CKEDITOR.instances[i].updateElement();}
283var soldBeforeSend=options.beforeSend;options.beforeSend=function(xhr){$form.data('submitting',true);document.cookie='frontend_admin='+(top!==self?'1':'')+';path=/';if($form.is('.ajax_submit_form')){xhr.setRequestHeader('X-Requested-With','XMLHttpSubmitRequest');xhr.setRequestHeader('X-Request-No-Layout','true');}
284submit_status_timeout=setTimeout(function(){submitStatusShow(xhr);},(hasFileInputs&&fileInputs.val()!=''?1:3000));if(soldBeforeSend)soldBeforeSend.call(xhr,o);}
285var soldUploadProgress=options.uploadProgress;options.uploadProgress=function(event,position,total,percentComplete){if(percentComplete>=100)
286submitStatusUpdate('Waiting for response ...',percentComplete+'%');else
287submitStatusUpdate('Uploading files ...',percentComplete+'%');if(soldUploadProgress)soldUploadProgress.call(event,position,total,percentComplete);}
288var soldComplete=options.complete;options.complete=function(xhr){if(xhr.status!=200&&xhr.responseText){if(xhr.status==201)$('body').append(xhr.responseText);else if(typeof($.FI)!='undefined')$.FI.toast(xhr.responseText);else alert(xhr.responseText);}
289$form.data('submitting',false);clearTimeout(submit_status_timeout);submitStatusHide();if(soldComplete)soldComplete.call(xhr,status);}
290var soldSuccess=options.success;options.success=function(data,status,xhr,form){$form.data('submitting',false);clearTimeout(submit_status_timeout);submitStatusHide();if(soldSuccess)soldSuccess.call(data,status,xhr,form);}
291var soldError=options.error;options.error=function(xhr,status,error){$form.data('submitting',false);clearTimeout(submit_status_timeout);submitStatusHide();if(soldError)soldError.call(xhr,status,error);}
292function submitStatusShow(xhr){function animateProgressBar(){var status_bar=$('.ajax_submit_form_status_bar span');if(!status_bar.length)
293return;status_bar.animate({'left':(status_bar.position().left>1?'0px':'270px')},2000,function(){animateProgressBar();});}
294var submit_status=$('.ajax_submit_form_status');if(!submit_status.length){submit_status=$('<div class="ajax_submit_form_status">'+'<div class="ajax_submit_form_status_overlay"></div>'+'<div class="ajax_submit_form_status_content">'+'<div class="ajax_submit_form_status_title"></div>'+'<div class="ajax_submit_form_status_bar"><span></span></div>'+'<div class="ajax_submit_form_status_footer">'+'<div class="button r"><a>Cancel</a></div>'+'</div>'+'</div>'+'</div>').appendTo('body');}
295submit_status.find('.ajax_submit_form_status_bar span').width('30px').text('');submit_status.find('.ajax_submit_form_status_title').html('<p>Sending request ...</p>');if(xhr){submit_status.find('.ajax_submit_form_status_footer .button').unbind('click').click(function(){xhr.abort();if(xhr.readyState==4)
296submitStatusHide();}).show();}else{submit_status.find('.ajax_submit_form_status_footer .button').unbind('click').hide();}
297submit_status.show();animateProgressBar();}
298function submitStatusHide(){var submit_status=$('.ajax_submit_form_status');if(!submit_status.length)
299return;submit_status.remove();}
300function submitStatusUpdate(title,status){if(title){var status_title=$('.ajax_submit_form_status_title');if(status_title.length)
301status_title.html('<p>'+title+'</p>');}
302if(status){var status_bar=$('.ajax_submit_form_status_bar span');if(status_bar.length)
303status_bar.stop().width(status).text(status).css('left','0px');}}
304var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
305if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
306var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}
307var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}
308if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
309this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
310var q=$.param(a,traditional);if(qx){q=(q?(q+'&'+qx):qx);}
311if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
312else{options.data=q;}
313var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}
314if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}
315if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';if(typeof($.FroalaEditor)!='undefined')
316$(options.target).find('.editor').froalaEditor('destroy');$(options.target)[fn](data).each(oldSuccess,arguments);if(typeof($.FI)!='undefined')$(options.target).FI();});}
317else if(options.success){callbacks.push(options.success);}
318options.success=function(data,status,xhr){if(xhr&&xhr.status==201)
319return;
319var dataparserstr=$form.attr('data-parser');if(dataparserstr){var dataparser=window[dataparserstr];if(typeof(dataparser)!='function'&&dataparserstr.indexOf('.')){var dataparsersplit=dataparserstr.split('.');dataparser=window;for(var i=0;i<dataparsersplit.length;i++){dataparser=dataparser[dataparsersplit[i]];if(typeof(dataparser)=='undefined')
320break;}}
321if(typeof(dataparser)=='function'&&dataparser!=window)
322data=dataparser(data);}
323var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}
324var isFI=(typeof($.FI)!='undefined');if(data&&$form.attr('data-target')){var target;var method='';var scrollto='';if($form.attr('data-target-method'))
325method=$form.attr('data-target-method');if($form.attr('data-scroll-target'))
326scrollto=$form.attr('data-scroll-target');if($form.attr('data-target')=='self')
327target=$form;else if($form.attr('data-target')=='parent')
328target=$form.parent();else if(method=='closest')
329target=$form.closest($form.attr('data-target'));else
330target=$($form.attr('data-target')).first();if(typeof($.FroalaEditor)!='undefined'&&(!method||method=='replace'))
331target.find('.editor').froalaEditor('destroy');let jdata=(data&&data.trim()[0]=='<'?$(data):$('<p>'+data+'</p>'));if(jdata.length==1&&jdata.is('.tooltip.error')){$.FI.toast(jdata.prop('outerHTML'));return false;}
332if(method=='after')
333target.after(jdata);else if(method=='before')
334target.before(jdata);else if(method=='append')
335target.append(jdata);else if(method=='prepend')
336target.prepend(jdata);else if(method=='replace')
337target.replaceWith(jdata);else
338target.html(jdata);if(isFI){$.FI.cleanupTips();setTimeout(function(){jdata.parent().FI();},1);}
339var targetoffset=target.offset();var jwindow=$(window);if(scrollto)
340targetoffset=target.find(scrollto).offset();if((targetoffset&&targetoffset.top&&$(window).scrollTop()>targetoffset.top)||(targetoffset&&targetoffset.top&&targetoffset.top>jwindow.scrollTop()+jwindow.height()-50))
341{$('html,body').animate({scrollTop:targetoffset.top-100},50,'linear');}}else if(data&&!options.target){if(isFI)$.FI.toast(data);else alert(data);}};if(options.error){var oldError=options.error;options.error=function(xhr,status,error){var context=options.context||this;oldError.apply(context,[xhr,status,error,$form]);};}
342if(options.complete){var oldComplete=options.complete;options.complete=function(xhr,status){var context=options.context||this;oldComplete.apply(context,[xhr,status,$form]);};}
343var fileInputs=$('input[type=file]:enabled',this);var hasFileInputs=false;fileInputs.each(function(){if(this.value!="")
344hasFileInputs=true;});var mp='multipart/form-data';var multipart=($form.attr('enctype')==mp||$form.attr('encoding')==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=hasFileInputs&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}
345else{jqxhr=fileUploadIframe(a);}}
346else if(hasFileInputs&&fileAPI){jqxhr=fileUploadXhr(a);}
347else{jqxhr=$.ajax(options);}
348$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k<elements.length;k++)
349elements[k]=null;this.trigger('form-submit-notify',[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData,options.traditional).split('&');var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g,' ');part=serialized[i].split('=');result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}
350return result;}
351function fileUploadXhr(a){var formdata=new FormData();var ignore_files={};$form.find('input[type=file]').each(function(){var jthis=$(this);if(jthis.data('ignore_files'))
352ignore_files[this.name]=jthis.data('ignore_files');});for(var i=0;i<a.length;i++){if(a[i].type=='file'&&typeof(ignore_files)=='object'&&ignore_files[a[i].name]&&ignore_files[a[i].name][a[i].value.name])
353continue;formdata.append(a[i].name,a[i].value);}
354if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++)
355if(serializedData[i])
356formdata.append(serializedData[i][0],serializedData[i][1]);}
357options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||'POST'});if(options.uploadProgress){s.xhr=function(){var xhr=$.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener('progress',function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);}
358options.uploadProgress(event,position,total,percent);},false);}
359return xhr;};}
360s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){o.data=formdata;if(beforeSend)
361beforeSend.call(this,xhr,o);};return $.ajax(s);}
362function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var deferred=$.Deferred();if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(hasProp)
363el.prop('disabled',false);else
364el.removeAttr('disabled');}}
365s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr2('name');if(!n)
366$io.attr2('name',id);else
367id=n;}
368else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:'absolute',top:'-1000px',left:'-1000px'});}
369io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand('Stop');}}
370catch(ignore){}
371$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error)
372s.error.call(s.context,xhr,e,status);if(g)
373$.event.trigger("ajaxError",[xhr,s,e]);if(s.complete)
374s.complete.call(s.context,xhr,e);}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}
375if(g){$.event.trigger("ajaxSend",[xhr,s]);}
376if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}
377deferred.reject();return deferred;}
378if(xhr.aborted){deferred.reject();return deferred;}
379sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y;}}}
380var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=null;try{if(frame.contentWindow){doc=frame.contentWindow.document;}}catch(err){log('cannot get iframe.contentWindow document: '+err);}
381if(doc){return doc;}
382try{doc=frame.contentDocument?frame.contentDocument:frame.document;}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document;}
383return doc;}
384var csrf_token=$('meta[name=csrf-token]').attr('content');var csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}
385function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action');form.setAttribute('target',id);if(!method){form.setAttribute('method','POST');}
386if(a!=s.url){form.setAttribute('action',s.url);}
387if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
388if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}
389function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()=='uninitialized')
390setTimeout(checkState,50);}
391catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle)
392clearTimeout(timeoutHandle);timeoutHandle=undefined;}}
393var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value')){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}}
394if(!s.iframeTarget){$io.appendTo('body');if(io.attachEvent)
395io.attachEvent('onload',cb);else
396io.addEventListener('load',cb,false);}
397setTimeout(checkState,15);try{form.submit();}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form);}}
398finally{form.setAttribute('action',a);if(t){form.setAttribute('target',t);}else{$form.removeAttr('target');}
399$(extraInputs).remove();}}
400if(s.forceSync){doSubmit();}
401else{setTimeout(doSubmit,10);}
402var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}
403doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT;}
404if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return;}
405else if(e==SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return;}
406if(!doc||doc.location.href==s.iframeSrc){if(!timedOut)
407return;}
408if(io.detachEvent)
409io.detachEvent('onload',cb);else
410io.removeEventListener('load',cb,false);var status='success',errMsg;
410try{if(timedOut){throw'timeout';}
411var isXml=s.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}}
412var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml)
413s.dataType='xml';xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText;}
414var dt=(s.dataType||'').toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText;}
415else if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}
416else if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}
417else if(dt=='xml'&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}
418try{data=httpData(xhr,dt,s);}
419catch(err){status='parsererror';xhr.error=errMsg=(err||status);}}
420catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status);}
421if(xhr.aborted){log('upload aborted');status=null;}
422if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?'success':'error';}
423if(status==='success'){if(s.success)
424s.success.call(s.context,data,'success',xhr);deferred.resolve(xhr.responseText,'success',xhr);if(g)
425$.event.trigger("ajaxSuccess",[xhr,s]);}
426else if(status){if(errMsg===undefined)
427errMsg=xhr.statusText;if(s.error)
428s.error.call(s.context,xhr,status,errMsg);deferred.reject(xhr,'error',errMsg);if(g)
429$.event.trigger("ajaxError",[xhr,s,errMsg]);}
430if(g)
431$.event.trigger("ajaxComplete",[xhr,s]);if(g&&!--$.active){$.event.trigger("ajaxStop");}
432if(s.complete)
433s.complete.call(s.context,xhr,status);callbackProcessed=true;if(s.timeout)
434clearTimeout(timeoutHandle);setTimeout(function(){if(!s.iframeTarget)
435$io.remove();xhr.responseXML=null;},100);}
436var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
437else{doc=(new DOMParser()).parseFromString(s,'text/xml');}
438return(doc&&doc.documentElement&&doc.documentElement.nodeName!='parsererror')?doc:null;};var parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')');};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=type==='xml'||!type&&ct.indexOf('xml')>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror'){if($.error)
439$.error('parsererror');}
440if(s&&s.dataFilter){data=s.dataFilter(data,type);}
441if(typeof data==='string'){if(type==='json'||!type&&ct.indexOf('json')>=0){data=parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}
442return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options);});return this;}
443log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this;}
444if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this;}
445return this.ajaxFormUnbind().bind('submit.form-plugin',options,doAjaxSubmit).bind('click.form-plugin',options,captureSubmittingElement);};function doAjaxSubmit(e){if($(this).attr('target')=='_blank')
446return true;var fileInputs=$('input[type=file]:enabled',this);var hasFileInputs=false;fileInputs.each(function(){if(this.value!="")
447hasFileInputs=true;});var fileAPI=feature.fileapi&&feature.formdata;var shouldUseFrame=hasFileInputs&&!fileAPI;if(shouldUseFrame&&$(this).is('.ajax_submit_form'))
448return true;var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}
449function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest('[type=submit]');if(t.length===0){return;}
450target=t[0];}
451var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}
452setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}
453$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}
454var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els){return a;}
455var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n||el.disabled){continue;}
456if(semantic&&form.clk&&el.type=="image"){if(form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
457continue;}
458v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements)
459elements.push(el);for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}
460else if(feature.fileapi&&el.type=='file'){if(elements)
461elements.push(el);var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}}
462else{a.push({name:n,value:'',type:el.type});}}
463else if(v!==null&&typeof v!='undefined'){if(elements)
464elements.push(el);a.push({name:n,value:v,type:el.type,required:el.required});}}
465if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
466return a;};
466$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}
467var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}
468else if(v!==null&&typeof v!='undefined'){a.push({name:this.name,value:v});}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length)){continue;}
469if(v.constructor==Array)
470$.merge(val,v);else
471val.push(v);}
472return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}
473if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1)){return null;}
474if(tag=='select'){var index=el.selectedIndex;if(index<0){return null;}
475var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;}
476if(one){return v;}
477a.push(v);}}
478return a;}
479return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$('input,select,textarea',this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=='textarea'){this.value='';}
480else if(t=='checkbox'||t=='radio'){this.checked=false;}
481else if(tag=='select'){this.selectedIndex=-1;}
482else if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone(true));}else{$(this).val('');}}
483else if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=='string'&&$(this).is(includeHidden)))
484this.value='';}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}
485return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}
486return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio'){this.checked=select;}
487else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
488this.selected=select;}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug)
489return;var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log){window.console.log(msg);}
490else if(window.opera&&window.opera.postError){window.opera.postError(msg);}}})(jQuery);;jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
491var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
492expires='; expires='+date.toUTCString();}
493var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
494return cookieValue;}};;$.fn.extend({fcToggle:function(){var cookie='';if(typeof($.cookie)!='undefined')
495cookie=$.cookie('fcstates');if(cookie==null)
496cookie='';function saveState(fcname){if(typeof(fcname)!='string')
497return;fcname=fcname.replace(/^fc/,'');if(cookie.indexOf('|'+fcname+'|')==-1)
498cookie=cookie+(cookie==''?'|':'')+fcname+'|';else
499cookie=cookie.replace('|'+fcname+'|','|');if(cookie=='|')
500cookie='';if(typeof($.cookie)!='undefined')
501$.cookie('fcstates',cookie,{expires:10,path:'/'});}
502function toggle(fc,preload){fc=$(fc);var fccontent=null;if(!preload&&fc.parent().is('.manual'))
503return;if(fc.attr('data-target'))
504fccontent=$(fc.attr('data-target'));else
505fccontent=fc.nextAll('.fc_content');if(fc.is(".expanded")||fc.parent().is(".expanded")){fc.closest('form').find('div.formError').fadeOut('fast',function(){$(this).remove();});fccontent.stop().css({'opacity':'','height':''}).animate({opacity:"hide",height:"hide"},(preload?0:"fast"),function(){if(fc.parent().is(".expanded"))
506fc.parent().removeClass("expanded");fc.removeClass("expanded").addClass("colapsed");fccontent.trigger('fctoggle',[0,fccontent]);if(!preload&&fc.attr('name'))
507saveState(fc.attr('name'));});}else{fccontent.stop().css({'opacity':'','height':''}).animate({opacity:"show",height:"show"},(preload?0:"fast"),function(){fc.removeClass("colapsed").addClass("expanded");fccontent.trigger('fctoggle',[1,fccontent]);if(!preload&&fc.attr('name'))
508saveState(fc.attr('name'));});}}
509this.each(function(){var jthis=$(this);if(jthis.is('.fc_content')){var target=jthis.attr('data-parent-target');var parent=(target=='parent'?jthis.parent().find(jthis.attr('data-parent')):(target?$(target).find(jthis.attr('data-parent')):$(jthis.attr('data-parent'))));var parent_value=jthis.attr('data-parent-value').split('|');var neg_parent_value=[];var contains_parent_value=[];var onchange=function(){var show=false;var selected_value=this.value;if(this.type=='checkbox'||this.type=='radio'){selected_value=new Object();parent.parent().find('input[name="'+this.name+'"]').each(function(i){if(this.checked)
510selected_value[i]=this.value;});if($.isEmptyObject(selected_value))
511selected_value[0]="";}
512if(typeof(selected_value)!='object')
513selected_value={0:selected_value};for(var i in selected_value){if($.inArray(selected_value[i],parent_value)!=-1||(neg_parent_value.length>0&&$.inArray(selected_value[i],neg_parent_value)==-1)||(contains_parent_value.length>0&&contains_parent_value.filter(part=>new RegExp(part,'i').test(selected_value[i])).length>=1))
514show=true;}
515var isDisplayNone=(jthis.css('display')=='none');if((show&&!isDisplayNone)||(!show&&isDisplayNone))
516return;jthis.showHide(show,function(){jthis.trigger('fctoggle',[show,jthis]);});return false;}
517for(var i in parent_value){if(parent_value[i].indexOf('!')!=-1)
518neg_parent_value.push(parent_value[i].substring(1));else if(parent_value[i].indexOf('*')!=-1)
519contains_parent_value.push(parent_value[i].substring(1));}
520parent.change(onchange).change();return true;}
521if(this.name&&!jthis.data('fctoggled')&&cookie.indexOf('|'+this.name+'|')!=-1)
522toggle(this,true);jthis.data('fctoggled',true).unbind('click.fctoggle').bind('click.fctoggle',function(){toggle(this);return false;}).parent().unbind('focus.fctoggle').bind('focus.fctoggle',function(){$(this).keypress(function(event){if(event.which=='13'||event.which=='32'||event.which=='43'||event.which=='45'){toggle($(this).find('.fc_title:first'));return false;}});}).unbind('blur.fctoggle').bind('blur.fctoggle',function(){$(this).unbind('keypress');});});return this;}});;;(function($){var $template;var appendTo=document.body;var checkIframeSizeTimeout;var $window=$(window);var $document=$(document);var tmp,loading,overlay,wrap,outer,content,iframebody,close,title,nav_left,nav_right,selectedIndex=0,selectedOpts={},selectedArray=[],currentIndex=0,currentOpts={},currentArray=[],ajaxLoader=null,imgPreloader=new Image(),imgRegExp=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,swfRegExp=/[^\.]\.(swf)\s*$/i,loadingTimer,loadingFrame=1,wrapMargin=0,titleHeight=0,titleStr='',start_pos,final_pos,busy=false,fx=$.extend($('<div/>')[0],{prop:0}),_abort=function(){loading.hide();imgPreloader.onerror=imgPreloader.onload=null;if(ajaxLoader){ajaxLoader.abort();}
523tmp.empty();},_error=function(){if(false===selectedOpts.onError(selectedArray,selectedIndex,selectedOpts)){loading.hide();busy=false;return;}
524selectedOpts.titleShow=false;selectedOpts.width='auto';selectedOpts.height='auto';tmp.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');_process_inline();},_start=function(){var obj=selectedArray[selectedIndex],href,type,title,str,emb,ret;_abort();selectedOpts=$.extend({},$.fn.fancybox.defaults,(typeof $(obj).data('fancybox')=='undefined'?selectedOpts:$(obj).data('fancybox')));ret=selectedOpts.onStart(selectedArray,selectedIndex,selectedOpts);if(ret===false){busy=false;return;}else if(typeof ret=='object'){selectedOpts=$.extend(selectedOpts,ret);}
525var jobj=$(obj);var objwidth,objheight;if(!selectedOpts['width']){objwidth=jobj.attr('data-width');if(objwidth){if((""+objwidth).indexOf('%')!=-1)
526selectedOpts['width']=parseInt(objwidth)*$window.width()/100;else
527selectedOpts['width']=parseInt(objwidth);}else{selectedOpts['width']=560;}}
528if(!selectedOpts['height']){objheight=jobj.attr('data-height');
528if(objheight){if((""+objheight).indexOf('%')!=-1)
529selectedOpts['height']=parseInt(objheight)*$window.height()/100;else
530selectedOpts['height']=parseInt(objheight);}else{selectedOpts['height']=340;}}
531title=selectedOpts.title||(obj.nodeName?$(obj).attr('title'):obj.title)||'';if(obj.nodeName&&!selectedOpts.orig){selectedOpts.orig=$(obj).children("img:first").length?$(obj).children("img:first"):$(obj);}
532if(title===''&&selectedOpts.orig&&selectedOpts.titleFromAlt){title=selectedOpts.orig.attr('alt');}
533href=selectedOpts.href||(obj.nodeName?$(obj).attr('href'):obj.href)||null;if((/^(?:javascript)/i).test(href)||href=='#'){href=null;}
534if(selectedOpts.type){type=selectedOpts.type;if(!href){href=selectedOpts.content;}}else if(selectedOpts.content){type='html';}else if(href){if(href.match(imgRegExp)){type='image';}else if(href.match(swfRegExp)){type='swf';}else if(href.indexOf("#")===0){type='inline';}else if($(obj).hasClass("iframe")||(CI_SITE_URL&&href.indexOf(CI_SITE_URL)==-1)||selectedOpts.iframe)
535{type='iframe';}else{type='ajax';}}
536if(!type){_error();return;}
537if(type=='inline'){obj=href.substr(href.indexOf("#"));type=$(obj).length>0?'inline':'ajax';}
538selectedOpts.type=type;selectedOpts.href=href;selectedOpts.title=title;if(selectedOpts.autoDimensions){if(selectedOpts.type=='html'||selectedOpts.type=='inline'||selectedOpts.type=='ajax'){selectedOpts.width='auto';selectedOpts.height='auto';}else{selectedOpts.autoDimensions=false;}}
539if(selectedOpts.modal){selectedOpts.overlayShow=true;selectedOpts.hideOnOverlayClick=false;selectedOpts.hideOnContentClick=false;selectedOpts.enableEscapeButton=false;selectedOpts.showCloseButton=false;}
540selectedOpts.padding=parseInt(selectedOpts.padding,10);selectedOpts.margin=parseInt(selectedOpts.margin,10);tmp.css('padding',(selectedOpts.padding+selectedOpts.margin));switch(type){case'html':tmp.html(selectedOpts.content);_process_inline();break;case'inline':if($(obj).parent().is('#fancybox-content')===true){busy=false;return;}
541$(obj).clone().appendTo(tmp);_process_inline();break;case'image':busy=false;$.fancybox.showActivity();imgPreloader=new Image();imgPreloader.onerror=function(){_error();};imgPreloader.onload=function(){busy=true;imgPreloader.onerror=imgPreloader.onload=null;_process_image();};imgPreloader.src=href;break;case'swf':selectedOpts.scrolling='no';str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"><param name="movie" value="'+href+'"></param>';emb='';$.each(selectedOpts.swf,function(name,val){str+='<param name="'+name+'" value="'+val+'"></param>';emb+=' '+name+'="'+val+'"';});str+='<embed src="'+href+'" type="application/x-shockwave-flash" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"'+emb+'></embed></object>';tmp.html(str);_process_inline();break;case'ajax':busy=false;$.fancybox.showActivity();selectedOpts.ajax.win=selectedOpts.ajax.success;ajaxLoader=$.ajax($.extend({},selectedOpts.ajax,{url:href,data:selectedOpts.ajax.data||{},error:function(XMLHttpRequest,textStatus,errorThrown){if(XMLHttpRequest.status>0){_error();}},success:function(data,textStatus,XMLHttpRequest){var o=typeof XMLHttpRequest=='object'?XMLHttpRequest:ajaxLoader;if(o.status==200){if(typeof selectedOpts.ajax.win=='function'){ret=selectedOpts.ajax.win(href,data,textStatus,XMLHttpRequest);if(ret===false){loading.hide();return;}else if(typeof ret=='string'||typeof ret=='object'){data=ret;}}
542var redirectMatches;if(typeof CI_ADMIN_URL!='undefined'&&data&&typeof data.match=='function'&&window.location&&window.location.href&&window.location.href.indexOf(CI_ADMIN_URL)!=-1&&(redirectMatches=data.match(/<script[^>]*?>window.location="(.*?)"/))&&redirectMatches[1])
543{data='<p id="fancybox-error">The requested url is no longer valid.<br />'+'<a href="'+redirectMatches[1]+'">Visit Updated Location</a></p>';}
544tmp.html(data);var preloadImg=tmp.find('img:first');if(preloadImg.length){objImage=new Image();objImage.src=preloadImg.attr('src');if(objImage.complete||(objImage.height&&objImage.height>0)){imgPreloader.height=objImage.height;imgPreloader.width=objImage.width;_process_inline();}else{objImage.onload=function(){imgPreloader.height=objImage.height;imgPreloader.width=objImage.width;_process_inline();};objImage.onerror=function(){imgPreloader.height=objImage.height;imgPreloader.width=objImage.width;_process_inline();};}}else{_process_inline();}}}}));break;case'iframe':$.fancybox.showActivity();wrap.css({visibility:'hidden',display:'block'});if(currentOpts.showCloseButton)
545close.hide();if(!selectedOpts.reloadIframe){var iframe=content.find('>iframe');if(iframe.attr('src')==href){wrap.css({visibility:'',display:'none'});_show();return;}}
546content.empty();var reposition=true;$('<iframe id="fancybox-frame" '+'name="fancybox-frame'+new Date().getTime()+'" '+'frameborder="0" '+'hspace="0" '+'allowtransparency="true" '+
547(CI_SITE_URL&&href.indexOf(CI_SITE_URL)!=-1?'scrolling="no" ':'')+'src="'+href+'">'+'</iframe>').appendTo(content).load(function(){if(reposition){wrap.css({visibility:'',display:'none'});_show();}
548try{iframebody=$(this).contents().find('body');iframebody.css('overflow','hidden');wrap.width('auto').height('auto');$.fancybox.checkIframeSize(reposition);reposition=false;}catch(e){var recMessage=function(e){if(!e.data)return;if((e.data+"").match(':iframeheight')){var fh=parseInt(e.data)+30;var ch=content.height();if((fh>currentOpts.height||ch>currentOpts.height)&&fh!=ch)
549content.animate({height:fh},'fast','swing',function(){content.height(fh);if(reposition)
550$.fancybox.center(true);reposition=false;});}
551if((e.data+"").match('refreshwebsite')){var fwoffset=$("#fancybox-wrap").offset();if(fwoffset)
552$("html,body").animate({scrollTop:fwoffset.top-20},50,"linear");$("#fancybox-wrap").hide();$.fancybox.showActivity();location.reload();}};if(typeof(window.addEventListener)!='undefined'){window.addEventListener("message",recMessage,fal
552se);}else if(typeof(window.attachEvent)!='undefined'){window.attachEvent("onmessage",recMessage,false);}}});break;}},_process_inline=function(){var
553w=selectedOpts.width,h=selectedOpts.height;if(w.toString().indexOf('%')>-1){w=parseInt(($window.width()-(selectedOpts.margin*2))*parseFloat(w)/100,10)+'px';}else{w=w=='auto'?'auto':w+'px';}
554if(h.toString().indexOf('%')>-1){h=parseInt(($window.height()-(selectedOpts.margin*2))*parseFloat(h)/100,10)+'px';}else{h=h=='auto'?'auto':h+'px';}
555tmp.wrapInner('<div style="width:'+w+';height:'+h+';overflow: '+(selectedOpts.scrolling=='auto'?'visible':(selectedOpts.scrolling=='yes'?'scroll':'hidden'))+';position:relative;"></div>');selectedOpts.width=tmp.width();selectedOpts.height=tmp.height();if(imgPreloader.width>selectedOpts.width||imgPreloader.height>selectedOpts.height)
556tmp.find('img:first').attr('style','cursor:pointer;').click(function(){_toggle_size(true);});_show();},_process_image=function(){selectedOpts.width=imgPreloader.width;selectedOpts.height=imgPreloader.height;$("<img />").attr({'id':'fancybox-img','src':imgPreloader.src,'alt':selectedOpts.title}).appendTo(tmp).click(function(){_toggle_size();});_show();},_toggle_size=function(inline){var resetstyle='width:auto;height:auto;max-width:none;max-height:none;';if((imgPreloader.width>content.outerWidth()&&(inline!==false||window.width>imgPreloader.width+currentOpts.padding*2))||(imgPreloader.height>content.outerHeight()&&(inline!==false||window.height>imgPreloader.height+currentOpts.padding*2)))
557{wrap.width('');if(inline)
558content.find('img:first').attr('style',resetstyle+'cursor:pointer;').parent().attr('style',resetstyle).parent().attr('style',resetstyle);content.css({'width':imgPreloader.width,'height':'auto'});}else{final_pos=_get_zoom_to();if(inline)
559content.find('img:first').attr('style','cursor:pointer;').parent().attr('style','').parent().attr('style','');content.css({'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2});}
560$.fancybox.center(true);},_show=function(){var pos,equal;loading.hide();if(wrap.is(":visible")&&currentOpts.onCleanup&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){$.event.trigger('fancybox-cancel');busy=false;return;}
561if(selectedOpts.wrapClass)
562wrap.addClass(selectedOpts.wrapClass);if(selectedOpts.additionalClass)
563content.addClass(selectedOpts.additionalClass);busy=true;$(content.add(overlay)).unbind();$window.unbind("resize.fb scroll.fb");$document.unbind('keydown.fb');if(wrap.is(":visible")&&currentOpts.titlePosition!=='outside'){wrap.css('height',wrap.height());}
564currentArray=selectedArray;currentIndex=selectedIndex;currentOpts=selectedOpts;if(currentOpts.overlayShow){overlay.css({'backdrop-filter':'blur(10px)','background-color':currentOpts.overlayColor,'opacity':currentOpts.overlayOpacity,'cursor':currentOpts.hideOnOverlayClick?'pointer':'auto'});if(!overlay.is(':visible')){overlay.show();}}else{overlay.hide();}
565final_pos=_get_zoom_to();_process_title();if(wrap.is(":visible")){$(close.add(nav_left).add(nav_right)).hide();pos=wrap.position(),start_pos={top:pos.top,left:pos.left,width:wrap.width()-(content.css('borderLeftWidth')+content.css('borderRightWidth')),height:wrap.height()-(content.css('borderTopWidth')+content.css('borderBottomWidth'))};equal=(start_pos.width==final_pos.width&&start_pos.height==final_pos.height);content.fadeTo(currentOpts.changeFade,0.3,function(){var finish_resizing=function(){content.html(tmp.contents()).FI().fadeTo(currentOpts.changeFade,1,_finish);};$.event.trigger('fancybox-change');content.empty().removeAttr('filter').css({'border-width':currentOpts.padding,'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2});if(equal){finish_resizing();}else{fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.changeSpeed,easing:currentOpts.easingChange,step:_draw,complete:finish_resizing});}});return;}
566wrap.removeAttr("style");content.css('border-width',currentOpts.padding);if(currentOpts.transitionIn=='elastic'){start_pos=_get_zoom_from();content.html(tmp.contents()).FI();wrap.show();if(currentOpts.opacity){final_pos.opacity=0;}
567fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.speedIn,easing:currentOpts.easingIn,step:_draw,complete:_finish});return;}
568if(currentOpts.titlePosition=='inside'&&titleHeight>0){title.show();}
569content.css({'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2});if(currentOpts.type!='iframe'&&currentOpts.type!='custom')
570content.html(tmp.contents()).FI();wrap.css(final_pos).fadeIn(currentOpts.transitionIn=='none'?0:currentOpts.speedIn,_finish);},_format_title=function(title){if(title&&title.length){if(currentOpts.titlePosition=='float'){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+title+'</td><td id="fancybox-title-float-right"></td></tr></table>';}
571return'<div id="fancybox-title-'+currentOpts.titlePosition+'">'+title+'</div>';}
572return false;},_process_title=function(){titleStr=currentOpts.title||'';titleHeight=0;title.empty().removeAttr('style').removeClass();if(currentOpts.titleShow===false){title.hide();return;}
573titleStr=$.isFunction(currentOpts.titleFormat)?currentOpts.titleFormat(titleStr,currentArray,currentIndex,currentOpts):_format_title(titleStr);if(!titleStr||titleStr===''){title.hide();return;}
574title.addClass('fancybox-title-'+currentOpts.titlePosition).html(titleStr).appendTo(appendTo).show();switch(currentOpts.titlePosition){case'inside':title.css({'width':final_pos.width-(currentOpts.padding*2),'marginLeft':currentOpts.padding,'marginRight':currentOpts.padding});titleHeight=title.outerHeight(true);title.appendTo(outer);final_pos.height+=titleHeight;break;case'over':title.css({'marginLeft':currentOpts.padding,'width':final_pos.width-(currentOpts.padding*2),'bottom':currentOpts.padding}).appendTo(outer);break;case'float':title.css('left',parseInt((title.width()-final_pos.width-40)/2,10)*-1).appendTo(wrap
574);break;default:title.css({'width':final_pos.width-(currentOpts.padding*2),'paddingLeft':currentOpts.padding,'paddingRight':currentOpts.padding}).appendTo(wrap);break;}
575title.hide();},_set_navigation=function(){if(currentOpts.enableEscapeButton||currentOpts.enableKeyboardNav){$document.bind('keydown.fb',function(e){if(e.keyCode==27&&currentOpts.enableEscapeButton){e.preventDefault();$.fancybox.close();}else if((e.keyCode==37||e.keyCode==39)&&currentOpts.enableKeyboardNav&&e.target.tagName!=='INPUT'&&e.target.tagName!=='TEXTAREA'&&e.target.tagName!=='SELECT'){e.preventDefault();$.fancybox[e.keyCode==37?'prev':'next']();}});}
576if(!currentOpts.showNavArrows){nav_left.hide();nav_right.hide();return;}
577if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!==0){nav_left.show();}
578if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!=(currentArray.length-1)){nav_right.show();}},_finish=function(){if(!$.support.opacity){content.get(0).style.removeAttribute('filter');wrap.get(0).style.removeAttribute('filter');}
579if(selectedOpts.autoDimensions){content.css('height','auto');}
580wrap.css('height','auto');if(titleStr&&titleStr.length){title.show();}
581if(currentOpts.showCloseButton){close.show();}
582_set_navigation();if(currentOpts.hideOnContentClick){content.bind('click',$.fancybox.close);}
583if(currentOpts.hideOnOverlayClick){overlay.bind('click',$.fancybox.close);}
584$window.bind("resize.fb",$.fancybox.resize);if(currentOpts.centerOnScroll){$window.bind("scroll.fb",$.fancybox.center);}
585wrap.show();busy=false;$.fancybox.center();currentOpts.onComplete(currentArray,currentIndex,currentOpts);_preload_images();},_preload_images=function(){var href,objNext;if((currentArray.length-1)>currentIndex){href=currentArray[currentIndex+1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}
586if(currentIndex>0){href=currentArray[currentIndex-1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}},_draw=function(pos){var dim={width:parseInt(start_pos.width+(final_pos.width-start_pos.width)*pos,10),height:parseInt(start_pos.height+(final_pos.height-start_pos.height)*pos,10),top:parseInt(start_pos.top+(final_pos.top-start_pos.top)*pos,10),left:parseInt(start_pos.left+(final_pos.left-start_pos.left)*pos,10)};if(typeof final_pos.opacity!=='undefined'){dim.opacity=pos<0.5?0.5:pos;}
587wrap.css(dim);content.css({'width':dim.width-currentOpts.padding*2,'height':dim.height-(titleHeight*pos)-currentOpts.padding*2});},_get_viewport=function(){var templateLeftMargin=0;var templateTopMargin=0;if($template.length&&($template.css('position')=='relative'||$template.css('position')=='absolute'||$template.css('position')=='fixed'))
588{if($template.offset().left>0)
589templateLeftMargin=$template.offset().left;if($template.offset().top>0)
590templateTopMargin=$template.offset().top;}
591var fiaiWidth=$('#fiai.ai_open').outerWidth();if(!fiaiWidth||fiaiWidth>$window.width()/1.5)
592fiaiWidth=0;return[$window.width()-(currentOpts.margin*2)-(wrapMargin*2)-fiaiWidth,$window.height()-(currentOpts.margin*2)-(wrapMargin*2),$document.scrollLeft()+currentOpts.margin-templateLeftMargin,$document.scrollTop()+currentOpts.margin-templateTopMargin];},_get_zoom_to=function(){var view=_get_viewport(),to={},resize=currentOpts.autoScale,double_padding=currentOpts.padding*2,ratio;if(currentOpts.width.toString().indexOf('%')>-1){to.width=parseInt((view[0]*parseFloat(currentOpts.width))/100,10);}else{to.width=currentOpts.width+double_padding;}
593if(currentOpts.height.toString().indexOf('%')>-1){to.height=parseInt((view[1]*parseFloat(currentOpts.height))/100,10);}else{to.height=currentOpts.height+double_padding;}
594if(resize&&(to.width>view[0]||to.height>view[1])){if(selectedOpts.type=='image'||selectedOpts.type=='swf'){ratio=(currentOpts.width)/(currentOpts.height);if((to.width)>view[0]){to.width=view[0];to.height=parseInt(((to.width-double_padding)/ratio)+double_padding,10);}
595if((to.height)>view[1]){to.height=view[1];to.width=parseInt(((to.height-double_padding)*ratio)+double_padding,10);}}else{to.width=Math.min(to.width,view[0]);to.height=Math.min(to.height,view[1]);}}
596to.top=parseInt(Math.max(view[3]-currentOpts.spacer,view[3]+((view[1]-to.height-currentOpts.spacer*2)*0.5)),10);to.left=parseInt(Math.max(view[2]-currentOpts.spacer,view[2]+((view[0]-to.width-currentOpts.spacer*2)*0.5)),10);return to;},_get_obj_pos=function(obj){var pos=obj.offset();pos.top+=parseInt(obj.css('paddingTop'),10)||0;pos.left+=parseInt(obj.css('paddingLeft'),10)||0;pos.top+=parseInt(obj.css('border-top-width'),10)||0;pos.left+=parseInt(obj.css('border-left-width'),10)||0;pos.width=obj.width();pos.height=obj.height();return pos;},_get_zoom_from=function(){var orig=selectedOpts.orig?$(selectedOpts.orig):false,from={},pos,view;if(orig&&orig.length){pos=_get_obj_pos(orig);from={width:pos.width+(currentOpts.padding*2),height:pos.height+(currentOpts.padding*2),top:pos.top-currentOpts.padding-currentOpts.spacer,left:pos.left-currentOpts.padding-currentOpts.spacer};}else{view=_get_viewport();from={width:currentOpts.padding*2,height:currentOpts.padding*2,top:parseInt(view[3]+view[1]*0.5,10),left:parseInt(view[2]+view[0]*0.5,10)};}
597return from;},_animate_loading=function(){if(!loading.is(':visible')){clearInterval(loadingTimer);return;}
598$('div',loading).css('top',(loadingFrame*-40)+'px');loadingFrame=(loadingFrame+1)%12;};$.fn.fancybox=function(options){if(!$(this).length){return this;}
599$(this).data('fancybox',$.extend({}
599,options,($.metadata?$(this).metadata():{}))).unbind('click.fb').bind('click.fb',function(e){if(e.ctrlKey)
600return;e.preventDefault();if(busy){return;}
601busy=true;$(this).blur();selectedArray=[];selectedIndex=0;var rel=$(this).attr('rel')||'';if(!rel||rel==''||rel==='nofollow'){selectedArray.push(this);}else{selectedArray=$("a[rel="+rel+"], area[rel="+rel+"]");selectedIndex=selectedArray.index(this);}
602_start();return;});return this;};$.fancybox=function(obj){var opts;if(busy){return;}
603busy=true;opts=typeof arguments[1]!=='undefined'?arguments[1]:{};selectedArray=[];selectedIndex=parseInt(opts.index,10)||0;if($.isArray(obj)){for(var i=0,j=obj.length;i<j;i++){if(typeof obj[i]=='object'){$(obj[i]).data('fancybox',$.extend({},opts,obj[i]));}else{obj[i]=$({}).data('fancybox',$.extend({content:obj[i]},opts));}}
604selectedArray=jQuery.merge(selectedArray,obj);}else{if(typeof obj=='object'){$(obj).data('fancybox',$.extend({},opts,obj));}else{obj=$({}).data('fancybox',$.extend({content:obj},opts));}
605selectedArray.push(obj);}
606if(selectedIndex>selectedArray.length||selectedIndex<0){selectedIndex=0;}
607_start();};$.fancybox.showActivity=function(with_overlay){clearInterval(loadingTimer);if(with_overlay){overlay.css({'backdrop-filter':'blur(10px)','background-color':'rgba(0,0,0,.9)','opacity':'1','cursor':'auto'});overlay.show();}
608loading.show();loadingTimer=setInterval(_animate_loading,66);};$.fancybox.hideActivity=function(with_overlay){if(with_overlay)
609overlay.hide();loading.hide();};$.fancybox.show=function(){_show();};$.fancybox.next=function(){return $.fancybox.pos(currentIndex+1);};$.fancybox.prev=function(){return $.fancybox.pos(currentIndex-1);};$.fancybox.pos=function(pos){if(busy){return;}
610pos=parseInt(pos);selectedArray=currentArray;if(pos>-1&&pos<currentArray.length){selectedIndex=pos;_start();}else if(currentOpts.cyclic&&currentArray.length>1){selectedIndex=pos>=currentArray.length?0:currentArray.length-1;_start();}
611return;};$.fancybox.cancel=function(){if(busy){return;}
612busy=true;$.event.trigger('fancybox-cancel');_abort();if(typeof(selectedOpts.onCancel)=='function')
613selectedOpts.onCancel(selectedArray,selectedIndex,selectedOpts);busy=false;};$.fancybox.close=function(){if(busy||wrap.is(':hidden')){return;}
614busy=true;if(currentOpts&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){busy=false;return;}
615_abort();$(close.add(nav_left).add(nav_right)).hide();$(content.add(overlay)).unbind();$window.unbind("resize.fb scroll.fb");$document.unbind('keydown.fb');if(selectedOpts.reloadIframe)
616content.find('iframe').attr('src','about:blank');if(currentOpts.titlePosition!=='inside'){title.empty();}
617wrap.stop();function _cleanup(){overlay.fadeOut('fast');title.empty().hide();wrap.hide();$.event.trigger('fancybox-cleanup');if(selectedOpts.reloadIframe)
618content.empty();if(selectedOpts.wrapClass)
619wrap.removeClass(selectedOpts.wrapClass);if(selectedOpts.additionalClass)
620content.removeClass(selectedOpts.additionalClass);currentOpts.onClosed(currentArray,currentIndex,currentOpts);currentArray=selectedOpts=[];currentIndex=selectedIndex=0;currentOpts=selectedOpts={};busy=false;}
621if(currentOpts.transitionOut=='elastic'){start_pos=_get_zoom_from();var pos=wrap.position();final_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};if(currentOpts.opacity){final_pos.opacity=1;}
622title.empty().hide();fx.prop=1;$(fx).animate({prop:0},{duration:currentOpts.speedOut,easing:currentOpts.easingOut,step:_draw,complete:_cleanup});}else{wrap.fadeOut(currentOpts.transitionOut=='none'?0:currentOpts.speedOut,_cleanup);}};$.fancybox.resize=function(){_toggle_size(false);};$.fancybox.center=function(){var view,align;if(busy){return;}
623align=arguments[0]===true?1:0;view=_get_viewport();if(!align&&(wrap.width()>view[0]||wrap.height()>view[1])){return;}
624if($.FI)$.FI.cleanupTips();wrap.stop().animate({'top':parseInt(Math.max(view[3]-currentOpts.spacer,view[3]+((view[1]-content.height()-currentOpts.spacer*2)*0.5)-currentOpts.padding)),'left':parseInt(Math.max(view[2]-currentOpts.spacer,view[2]+((view[0]-content.width()-currentOpts.spacer*2)*0.5)-currentOpts.padding))},typeof arguments[0]=='number'?arguments[0]:200);};$.fancybox.checkIframeSize=function(position){if(!iframebody||!currentArray.length)
625return;if(checkIframeSizeTimeout){clearTimeout(checkIframeSizeTimeout);checkIframeSizeTimeout=false;}
626var fw=parseInt(iframebody.width());var fh=parseInt(iframebody.height());var cw=parseInt(content.width());var ch=parseInt(content.height());checkIframeSizeTimeout=setTimeout($.fancybox.checkIframeSize,250);if(fw>cw)
627content.animate({width:fw},'fast','swing',function(){content.width(fw);if(position)
628$.fancybox.center(true);});if((fh>currentOpts.height||ch>currentOpts.height)&&fh!=ch)
629content.animate({height:fh},'fast','swing',function(){content.height(fh);if(position)
630$.fancybox.center(true);});};$.fancybox.init=function(){if($("#fancybox-wrap").length){return;}
631$template=$('body > #template');if($template.length)
632appendTo=$template;$(appendTo).append(tmp=$('<div id="fancybox-tmp"></div>'),loading=$('<div id="fancybox-loading"><div></div></div>'),overlay=$('<div id="fancybox-overlay"></div>').css({position:'fixed',width:'100%',height:'100%'}),wrap=$('<div id="fancybox-wrap"></div>'));outer=$('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>
632').appendTo(wrap);outer.append(content=$('<div id="fancybox-content"></div>'),close=$('<a id="fancybox-close"></a>'),title=$('<div id="fancybox-title"></div>'),nav_left=$('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),nav_right=$('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));close.click($.fancybox.close);loading.click($.fancybox.cancel);nav_left.click(function(e){e.preventDefault();$.fancybox.prev();});nav_right.click(function(e){e.preventDefault();$.fancybox.next();});if(!$.support.opacity){wrap.addClass('fancybox-ie');}
633var marginLeft=parseInt(wrap.css('marginLeft'));if(marginLeft)
634wrapMargin=marginLeft;};$.fn.fancybox.defaults={padding:20,margin:40,spacer:20,opacity:false,modal:false,cyclic:false,scrolling:'auto',iframe:false,reloadIframe:true,wrapClass:'',additionalClass:'',width:false,height:false,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:'transparent'},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:1,overlayColor:'rgba(0,0,0,.9)',titleShow:true,titlePosition:'float',titleFormat:null,titleFromAlt:false,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(){}};$document.ready(function(){$.fancybox.init();});})(jQuery);;(function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory);}
635else if(typeof exports=="object"&&typeof module=="object"){module.exports=factory;}
636else{factory(jQuery);}})(function($,undefined){"use strict";var defaultOpts={beforeShow:noop,move:noop,change:noop,show:noop,hide:noop,color:false,flat:false,showInput:false,allowEmpty:false,showButtons:true,clickoutFiresChange:true,showInitial:false,showPalette:false,showPaletteOnly:false,hideAfterPaletteSelect:false,togglePaletteOnly:false,showSelectionPalette:true,localStorageKey:false,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:false,className:"",containerClassName:"",replacerClassName:"",showAlpha:false,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:false,offset:null},spectrums=[],IE=!!/msie/i.exec(window.navigator.userAgent),rgbaSupport=(function(){function contains(str,substr){return!!~(''+str).indexOf(substr);}
637var elem=document.createElement('div');var style=elem.style;style.cssText='background-color:rgba(0,0,0,.5)';return contains(style.backgroundColor,'rgba')||contains(style.backgroundColor,'hsla');})(),replaceInput=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>","</div>"].join(''),markup=(function(){var gradientFix="";if(IE){for(var i=1;i<=6;i++){gradientFix+="<div class='sp-"+i+"'></div>";}}
638return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",gradientFix,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("");})();function paletteTemplate(p,color,className,opts){var html=[];for(var i=0;i<p.length;i++){var current=p[i];if(current){var tiny=tinycolor(current);var c=tiny.toHsl().l<0.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=(tinycolor.equals(color,current))?" sp-thumb-active":"";var formattedString=tiny.toString(opts.preferredFormat||"rgb");var swatchStyle=rgbaSupport?("background-color:"+tiny.toRgbString()):"filter:"+tiny.toFilter();html.push('<span title="'+formattedString+'" data-color="'+tiny.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+swatchStyle+';"></span></span>');}else{var cls='sp-clear-display';html.push($('<div />').append($('<span data-color="" style="background-color:transparent;" class="'+cls+'"></span>').attr('title',opts.noColorSelectedText)).html());}}
639return"<div class='sp-cf "+className+"'>"+html.join('')+"</div>";}
640function hideAll(){for(var i=0;i<spectrums.length;i++){if(spectrums[i]){spectrums[i].hide();}}}
vendor: 18,290 bytes, lines 641-750
641function instanceOptions(o,callbackContext){var opts=$.extend({},defaultOpts,o);opts.callbacks={'move':bind(opts.move,callbackContext),'change':bind(opts.change,callbackContext),'show':bind(opts.show,callbackContext),'hide':bind(opts.hide,callbackContext),'beforeShow':bind(opts.beforeShow,callbackContext)};return opts;}
642function spectrum(element,o){var opts=instanceOptions(o,element),flat=opts.flat,showSelectionPalette=opts.showSelectionPalette,localStorageKey=opts.localStorageKey,theme=opts.theme,callbacks=opts.callbacks,resize=throttle(reflow,10),visible=false,isDragging=false,dragWidth=0,dragHeight=0,dragHelperHeight=0,slideHeight=0,slideWidth=0,alphaWidth=0,alphaSlideHelperWidth=0,slideHelperHeight=0,currentHue=0,currentSaturation=0,currentValue=0,currentAlpha=1,palette=[],paletteArray=[],paletteLookup={},selectionPalette=opts.selectionPalette.slice(0),maxSelectionSize=opts.maxSelectionSize,draggingClass="sp-dragging",shiftMovementDirection=null;var doc=element.ownerDocument,body=doc.body,boundElement=$(element),disabled=false,container=$(markup,doc).addClass(theme),pickerContainer=container.find(".sp-picker-container"),dragger=container.find(".sp-color"),dragHelper=container.find(".sp-dragger"),slider=container.find(".sp-hue"),slideHelper=container.find(".sp-slider"),alphaSliderInner=container.find(".sp-alpha-inner"),alphaSlider=container.find(".sp-alpha"),alphaSlideHelper=container.find(".sp-alpha-handle"),textInput=container.find(".sp-input"),paletteContainer=container.find(".sp-palette"),initialColorContainer=container.find(".sp-initial"),cancelButton=container.find(".sp-cancel"),clearButton=container.find(".sp-clear"),chooseButton=container.find(".sp-choose"),toggleButton=container.find(".sp-palette-toggle"),isInput=boundElement.is("input"),isInputTypeColor=isInput&&boundElement.attr("type")==="color"&&inputTypeColorSupport(),shouldReplace=isInput&&!flat,replacer=(shouldReplace)?$(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName):$([]),offsetElement=(shouldReplace)?replacer:boundElement,previewElement=replacer.find(".sp-preview-inner"),initialColor=opts.color||(isInput&&boundElement.val()),colorOnShow=false,preferredFormat=opts.preferredFormat,currentPreferredFormat=preferredFormat,clickoutFiresChange=(typeof(opts.clickoutFiresChange)!='undefined'?opts.clickoutFiresChange:!opts.showButtons||opts.clickoutFiresChange),isEmpty=!initialColor,allowEmpty=opts.allowEmpty&&!isInputTypeColor;function applyOptions(){if(opts.showPaletteOnly){opts.showPalette=true;}
643toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText);if(opts.palette){palette=opts.palette.slice(0);paletteArray=$.isArray(palette[0])?palette:[palette];paletteLookup={};for(var i=0;i<paletteArray.length;i++){for(var j=0;j<paletteArray[i].length;j++){var rgb=tinycolor(paletteArray[i][j]).toRgbString();paletteLookup[rgb]=true;}}}
644container.toggleClass("sp-flat",flat);container.toggleClass("sp-input-disabled",!opts.showInput);container.toggleClass("sp-alpha-enabled",opts.showAlpha);container.toggleClass("sp-clear-enabled",allowEmpty);container.toggleClass("sp-buttons-disabled",!opts.showButtons);container.toggleClass("sp-palette-buttons-disabled",!opts.togglePaletteOnly);container.toggleClass("sp-palette-disabled",!opts.showPalette);container.toggleClass("sp-palette-only",opts.showPaletteOnly);container.toggleClass("sp-initial-disabled",!opts.showInitial);container.addClass(opts.className).addClass(opts.containerClassName);reflow();}
645function initialize(){if(IE){container.find("*:not(input)").attr("unselectable","on");}
646applyOptions();if(shouldReplace){boundElement.after(replacer).hide();}
647if(!allowEmpty){clearButton.hide();}
648if(flat){boundElement.after(container).hide();}
649else{var appendTo=opts.appendTo==="parent"?boundElement.parent():$(opts.appendTo);if(appendTo.length!==1){appendTo=$("body");}
650appendTo.append(container);}
651updateSelectionPaletteFromStorage();offsetElement.bind("click.spectrum touchstart.spectrum",function(e){if(!disabled){toggle();}
652e.stopPropagation();if(!$(e.target).is("input")){e.preventDefault();}});if(boundElement.is(":disabled")||(opts.disabled===true)){disable();}
653container.click(stopPropagation);textInput.change(setFromTextInput);textInput.bind("paste",function(){setTimeout(setFromTextInput,1);});textInput.keydown(function(e){if(e.keyCode==13){setFromTextInput();}});cancelButton.text(opts.cancelText);cancelButton.bind("click.spectrum",function(e){e.stopPropagation();e.preventDefault();revert();hide();});clearButton.attr("title",opts.clearText);clearButton.bind("click.spectrum",function(e){e.stopPropagation();e.preventDefault();isEmpty=true;move();if(flat){updateOriginalInput(true);}});chooseButton.text(opts.chooseText);chooseButton.bind("click.spectrum",function(e){e.stopPropagation();e.preventDefault();if(IE&&textInput.is(":focus")){textInput.trigger('change');}
654if(isValid()){updateOriginalInput(true);hide();}});toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText);toggleButton.bind("click.spectrum",function(e){e.stopPropagation();e.preventDefault();opts.showPaletteOnly=!opts.showPaletteOnly;if(!opts.showPaletteOnly&&!flat){container.css('left','-='+(pickerContainer.outerWidth(true)+5));}
655applyOptions();});draggable(alphaSlider,function(dragX,dragY,e){currentAlpha=(dragX/alphaWidth);isEmpty=false;if(e.shiftKey){currentAlpha=Math.round(currentAlpha*10)/10;}
656move();},dragStart,dragStop);draggable(slider,function(dragX,dragY){currentHue=parseFloat(dragY/slideHeight);isEmpty=false;if(!opts.showAlpha){currentAlpha=1;}
657move();},dragStart,dragStop);draggable(dragger,function(dragX,dragY,e){if(!e.shiftKey){shiftMovementDirection=null;}
658else if(!shiftMovementDirection){var oldDragX=currentSaturation*dragWidth;var oldDragY=dragHeight-(currentValue*dragHeight);var furtherFromX=Math.abs(dragX-oldDragX)>Math.abs(dragY-oldDragY);shiftMovementDirection=furtherFromX?"x":"y";}
659var setSaturation=!shiftMovementDirection||shiftMovementDirection==="x";var setValue=!shiftMovementDirection||shiftMovementDirection==="y";if(setSaturation){currentSaturation=parseFloat(dragX/dragWidth);}
660if(setValue){currentValue=parseFloat((dragHeight-dragY)/dragHeight);}
661isEmpty=false;if(!opts.showAlpha){currentAlpha=1;}
662move();},dragStart,dragStop);if(!!initialColor){set(initialColor);updateUI();currentPreferredFormat=preferredFormat||tinycolor(initialColor).format;addColorToSelectionPalette(initialColor);}
663else{updateUI();}
664if(flat){show();}
665function paletteElementClick(e){if(e.data&&e.data.ignore){set($(e.target).closest(".sp-thumb-el").data("color"));move();}
666else{set($(e.target).closest(".sp-thumb-el").data("color"));move();updateOriginalInput(true);if(opts.hideAfterPaletteSelect){hide();}}
667return false;}
668var paletteEvent=IE?"mousedown.spectrum":"click.spectrum touchstart.spectrum";paletteContainer.delegate(".sp-thumb-el",paletteEvent,paletteElementClick);initialColorContainer.delegate(".sp-thumb-el:nth-child(1)",paletteEvent,{ignore:true},paletteElementClick);}
669function updateSelectionPaletteFromStorage(){if(localStorageKey&&window.localStorage){try{var oldPalette=window.localStorage[localStorageKey].split(",#");if(oldPalette.length>1){delete window.localStorage[localStorageKey];$.each(oldPalette,function(i,c){addColorToSelectionPalette(c);});}}
670catch(e){}
671try{selectionPalette=window.localStorage[localStorageKey].split(";");}
672catch(e){}}}
673function addColorToSelectionPalette(color){if(showSelectionPalette){var rgb=tinycolor(color).toRgbString();if(!paletteLookup[rgb]&&$.inArray(rgb,selectionPalette)===-1){selectionPalette.push(rgb);while(selectionPalette.length>maxSelectionSize){selectionPalette.shift();}}
674if(localStorageKey&&window.localStorage){try{window.localStorage[localStorageKey]=selectionPalette.join(";");}
675catch(e){}}}}
676function getUniqueSelectionPalette(){var unique=[];if(opts.showPalette){for(var i=0;i<selectionPalette.length;i++){var rgb=tinycolor(selectionPalette[i]).toRgbString();if(!paletteLookup[rgb]){unique.push(selectionPalette[i]);}}}
677return unique.reverse().slice(0,opts.maxSelectionSize);}
678function drawPalette(){var currentColor=get();var html=$.map(paletteArray,function(palette,i){return paletteTemplate(palette,currentColor,"sp-palette-row sp-palette-row-"+i,opts);});updateSelectionPaletteFromStorage();if(selectionPalette){html.push(paletteTemplate(getUniqueSelectionPalette(),currentColor,"sp-palette-row sp-palette-row-selection",opts));}
679paletteContainer.html(html.join(""));}
680function drawInitial(){if(opts.showInitial){var initial=colorOnShow;var current=get();initialColorContainer.html(paletteTemplate([initial,current],current,"sp-palette-row-initial",opts));}}
681function dragStart(){if(dragHeight<=0||dragWidth<=0||slideHeight<=0){reflow();}
682isDragging=true;container.addClass(draggingClass);shiftMovementDirection=null;boundElement.trigger('dragstart.spectrum',[get()]);}
683function dragStop(){isDragging=false;container.removeClass(draggingClass);boundElement.trigger('dragstop.spectrum',[get()]);}
684function setFromTextInput(){var value=textInput.val();if((value===null||value==="")&&allowEmpty){set(null);updateOriginalInput(true);}
685else{var tiny=tinycolor(value);if(tiny.isValid()){set(tiny);updateOriginalInput(true);}
686else{textInput.addClass("sp-validation-error");}}}
687function toggle(){if(visible){hide();}
688else{show();}}
689function show(){var event=$.Event('beforeShow.spectrum');if(visible){reflow();return;}
690boundElement.trigger(event,[get()]);if(callbacks.beforeShow(get())===false||event.isDefaultPrevented()){return;}
691hideAll();visible=true;$(doc).bind("keydown.spectrum",onkeydown);$(doc).bind("click.spectrum",clickout);$(window).bind("resize.spectrum",resize);replacer.addClass("sp-active");container.removeClass("sp-hidden");reflow();updateUI();colorOnShow=get();drawInitial();callbacks.show(colorOnShow);boundElement.trigger('show.spectrum',[colorOnShow]);}
692function onkeydown(e){if(e.keyCode===27){hide();}}
693function clickout(e){if(e.button==2){return;}
694if(isDragging){return;}
695if(clickoutFiresChange){updateOriginalInput(true);}
696else if(!flat){revert();}
697hide();}
698function hide(){if(!visible||flat){return;}
699visible=false;$(doc).unbind("keydown.spectrum",onkeydown);$(doc).unbind("click.spectrum",clickout);$(window).unbind("resize.spectrum",resize);replacer.removeClass("sp-active");container.addClass("sp-hidden");callbacks.hide(get());boundElement.trigger('hide.spectrum',[get()]);}
700function revert(){set(colorOnShow,true);}
701function set(color,ignoreFormatChange){if(tinycolor.equals(color,get())){updateUI();return;}
702var newColor,newHsv;if(!color&&allowEmpty){isEmpty=true;}else{isEmpty=false;newColor=tinycolor(color);newHsv=newColor.toHsv();currentHue=(newHsv.h%360)/360;currentSaturation=newHsv.s;currentValue=newHsv.v;currentAlpha=newHsv.a;}
703updateUI();if(newColor&&newColor.isValid()&&!ignoreFormatChange){currentPreferredFormat=preferredFormat||newColor.getFormat();}}
704function get(opts){opts=opts||{};if(allowEmpty&&isEmpty){return null;}
705return tinycolor.fromRatio({h:currentHue,s:currentSaturation,v:currentValue,a:Math.round(currentAlpha*100)/100},{format:opts.format||currentPreferredFormat});}
706function isValid(){return!textInput.hasClass("sp-validation-error");}
707function move(){updateUI();callbacks.move(get());boundElement.trigger('move.spectrum',[get()]);}
708function updateUI(){textInput.removeClass("sp-validation-error");updateHelperLocations();var flatColor=tinycolor.fromRatio({h:currentHue,s:1,v:1});dragger.css("background-color",flatColor.toHexString());var format=currentPreferredFormat;if(currentAlpha<1&&!(currentAlpha===0&&format==="name")){if(format==="hex"||format==="hex3"||format==="hex6"||format==="name"){format="rgb";}}
709var realColor=get({format:format}),displayColor='';previewElement.removeClass("sp-clear-display");previewElement.css('background-color','transparent');if(!realColor&&allowEmpty){previewElement.addClass("sp-clear-display");}
710else{var realHex=realColor.toHexString(),realRgb=realColor.toRgbString();if(rgbaSupport||realColor.alpha===1){previewElement.css("background-color",realRgb);}
711else{previewElement.css("background-color","transparent");previewElement.css("filter",realColor.toFilter());}
712if(opts.showAlpha){var rgb=realColor.toRgb();rgb.a=0;var realAlpha=tinycolor(rgb).toRgbString();var gradient="linear-gradient(left, "+realAlpha+", "+realHex+")";if(IE){alphaSliderInner.css("filter",tinycolor(realAlpha).toFilter({gradientType:1},realHex));}
713else{alphaSliderInner.css("background","-webkit-"+gradient);alphaSliderInner.css("background","-moz-"+gradient);alphaSliderInner.css("background","-ms-"+gradient);alphaSliderInner.css("background","linear-gradient(to right, "+realAlpha+", "+realHex+")");}}
714displayColor=realColor.toString(format);}
715if(opts.showInput){textInput.val(displayColor);}
716if(opts.showPalette){drawPalette();}
717drawInitial();}
718function updateHelperLocations(){var s=currentSaturation;var v=currentValue;if(allowEmpty&&isEmpty){alphaSlideHelper.hide();slideHelper.hide();dragHelper.hide();}
719else{alphaSlideHelper.show();slideHelper.show();dragHelper.show();var dragX=s*dragWidth;var dragY=dragHeight-(v*dragHeight);dragX=Math.max(-dragHelperHeight,Math.min(dragWidth-dragHelperHeight,dragX-dragHelperHeight));dragY=Math.max(-dragHelperHeight,Math.min(dragHeight-dragHelperHeight,dragY-dragHelperHeight));dragHelper.css({"top":dragY+"px","left":dragX+"px"});var alphaX=currentAlpha*alphaWidth;alphaSlideHelper.css({"left":(alphaX-(alphaSlideHelperWidth/2))+"px"});var slideY=(currentHue)*slideHeight;slideHelper.css({"top":(slideY-slideHelperHeight)+"px"});}}
720function updateOriginalInput(fireCallback){var color=get(),displayColor='',hasChanged=!tinycolor.equals(color,colorOnShow);if(color){displayColor=color.toString(currentPreferredFormat);addColorToSelectionPalette(color);}
721if(isInput){boundElement.val(displayColor);}
722if(fireCallback&&hasChanged){callbacks.change(color);boundElement.trigger('change',[color]);}}
723function reflow(){dragWidth=dragger.width();dragHeight=dragger.height();dragHelperHeight=dragHelper.height();slideWidth=slider.width();slideHeight=slider.height();slideHelperHeight=slideHelper.height();alphaWidth=alphaSlider.width();alphaSlideHelperWidth=alphaSlideHelper.width();if(!flat){container.css("position","absolute");if(opts.offset){container.offset(opts.offset);}else{container.offset(getOffset(container,offsetElement));}}
724updateHelperLocations();if(opts.showPalette){drawPalette();}
725boundElement.trigger('reflow.spectrum');}
726function destroy(){boundElement.show();offsetElement.unbind("click.spectrum touchstart.spectrum");container.remove();replacer.remove();spectrums[spect.id]=null;}
727function option(optionName,optionValue){if(optionName===undefined){return $.extend({},opts);}
728if(optionValue===undefined){return opts[optionName];}
729opts[optionName]=optionValue;applyOptions();}
730function enable(){disabled=false;boundElement.attr("disabled",false);offsetElement.removeClass("sp-disabled");}
731function disable(){hide();disabled=true;boundElement.attr("disabled",true);offsetElement.addClass("sp-disabled");}
732function setOffset(coord){opts.offset=coord;reflow();}
733initialize();var spect={show:show,hide:hide,toggle:toggle,reflow:reflow,option:option,enable:enable,disable:disable,offset:setOffset,set:function(c){set(c);updateOriginalInput();},get:get,destroy:destroy,container:container};spect.id=spectrums.push(spect)-1;return spect;}
734function getOffset(picker,input){var extraY=0;var dpWidth=picker.outerWidth();var dpHeight=picker.outerHeight();var inputHeight=input.outerHeight();var doc=picker[0].ownerDocument;var docElem=doc.documentElement;var viewWidth=docElem.clientWidth+$(doc).scrollLeft();var viewHeight=docElem.clientHeight+$(doc).scrollTop();var offset=input.offset();offset.top+=inputHeight;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,((offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight-extraY):extraY));return offset;}
735function noop(){}
736function stopPropagation(e){e.stopPropagation();}
737function bind(func,obj){var slice=Array.prototype.slice;var args=slice.call(arguments,2);return function(){return func.apply(obj,args.concat(slice.call(arguments)));};}
738function draggable(element,onmove,onstart,onstop){onmove=onmove||function(){};onstart=onstart||function(){};onstop=onstop||function(){};var doc=document;var dragging=false;var offset={};var maxHeight=0;var maxWidth=0;var hasTouch=('ontouchstart'in window);var duringDragEvents={};duringDragEvents["selectstart"]=prevent;duringDragEvents["dragstart"]=prevent;duringDragEvents["touchmove mousemove"]=move;duringDragEvents["touchend mouseup"]=stop;function prevent(e){if(e.stopPropagation){e.stopPropagation();}
739if(e.preventDefault){e.preventDefault();}
740e.returnValue=false;}
741function move(e){if(dragging){if(IE&&doc.documentMode<9&&!e.button){return stop();}
742var t0=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0];var pageX=t0&&t0.pageX||e.pageX;var pageY=t0&&t0.pageY||e.pageY;var dragX=Math.max(0,Math.min(pageX-offset.left,maxWidth));var dragY=Math.max(0,Math.min(pageY-offset.top,maxHeight));if(hasTouch){prevent(e);}
743onmove.apply(element,[dragX,dragY,e]);}}
744function start(e){var rightclick=(e.which)?(e.which==3):(e.button==2);if(!rightclick&&!dragging){if(onstart.apply(element,arguments)!==false){dragging=true;maxHeight=$(element).height();maxWidth=$(element).width();offset=$(element).offset();$(doc).bind(duringDragEvents);$(doc.body).addClass("sp-dragging");move(e);prevent(e);}}}
745function stop(){if(dragging){$(doc).unbind(duringDragEvents);$(doc.body).removeClass("sp-dragging");setTimeout(function(){onstop.apply(element,arguments);},0);}
746dragging=false;}
747$(element).bind("touchstart mousedown",start);}
748function throttle(func,wait,debounce){var timeout;return function(){var context=this,args=arguments;var throttler=function(){timeout=null;func.apply(context,args);};if(debounce)clearTimeout(timeout);if(debounce||!timeout)timeout=setTimeout(throttler,wait);};}
749function inputTypeColorSupport(){return $.fn.spectrum.inputTypeColorSupport();}
750var dataID="spectrum.id";$.fn.spectrum=function(opts,extra){if(typeof opts=="string"){var returnValue=this;
vendor: 16,033 bytes, lines 750-824
750var args=Array.prototype.slice.call(arguments,1);this.each(function(){var spect=spectrums[$(this).data(dataID)];if(spect){var method=spect[opts];if(!method){throw new Error("Spectrum: no such method: '"+opts+"'");}
751if(opts=="get"){returnValue=spect.get();}
752else if(opts=="container"){returnValue=spect.container;}
753else if(opts=="option"){returnValue=spect.option.apply(spect,args);}
754else if(opts=="destroy"){spect.destroy();$(this).removeData(dataID);}
755else{method.apply(spect,args);}}});return returnValue;}
756return this.spectrum("destroy").each(function(){var options=$.extend({},opts,$(this).data());var spect=spectrum(this,options);$(this).data(dataID,spect.id);});};$.fn.spectrum.load=true;$.fn.spectrum.loadOpts={};$.fn.spectrum.draggable=draggable;$.fn.spectrum.defaults=defaultOpts;$.fn.spectrum.inputTypeColorSupport=function inputTypeColorSupport(){if(typeof inputTypeColorSupport._cachedResult==="undefined"){var colorInput=$("<input type='color' value='!' />")[0];inputTypeColorSupport._cachedResult=colorInput.type==="color"&&colorInput.value!=="!";}
757return inputTypeColorSupport._cachedResult;};$.spectrum={};$.spectrum.localization={};$.spectrum.palettes={};$.fn.spectrum.processNativeColorInputs=function(){var colorInputs=$("input[type=color]");if(colorInputs.length&&!inputTypeColorSupport()){colorInputs.spectrum({preferredFormat:"hex6"});}};(function(){var trimLeft=/^[\s,#]+/,trimRight=/\s+$/,tinyCounter=0,math=Math,mathRound=math.round,mathMin=math.min,mathMax=math.max,mathRandom=math.random;var tinycolor=function(color,opts){color=(color)?color:'';opts=opts||{};if(color instanceof tinycolor){return color;}
758if(!(this instanceof tinycolor)){return new tinycolor(color,opts);}
759var rgb=inputToRGB(color);this._originalInput=color,this._r=rgb.r,this._g=rgb.g,this._b=rgb.b,this._a=rgb.a,this._roundA=mathRound(100*this._a)/100,this._format=opts.format||rgb.format;this._gradientType=opts.gradientType;if(this._r<1){this._r=mathRound(this._r);}
760if(this._g<1){this._g=mathRound(this._g);}
761if(this._b<1){this._b=mathRound(this._b);}
762this._ok=rgb.ok;this._tc_id=tinyCounter++;};tinycolor.prototype={isDark:function(){return this.getBrightness()<128;},isLight:function(){return!this.isDark();},isValid:function(){return this._ok;},getOriginalInput:function(){return this._originalInput;},getFormat:function(){return this._format;},getAlpha:function(){return this._a;},getBrightness:function(){var rgb=this.toRgb();return(rgb.r*299+rgb.g*587+rgb.b*114)/1000;},setAlpha:function(value){this._a=boundAlpha(value);this._roundA=mathRound(100*this._a)/100;return this;},toHsv:function(){var hsv=rgbToHsv(this._r,this._g,this._b);return{h:hsv.h*360,s:hsv.s,v:hsv.v,a:this._a};},toHsvString:function(){var hsv=rgbToHsv(this._r,this._g,this._b);var h=mathRound(hsv.h*360),s=mathRound(hsv.s*100),v=mathRound(hsv.v*100);return(this._a==1)?"hsv("+h+", "+s+"%, "+v+"%)":"hsva("+h+", "+s+"%, "+v+"%, "+this._roundA+")";},toHsl:function(){var hsl=rgbToHsl(this._r,this._g,this._b);return{h:hsl.h*360,s:hsl.s,l:hsl.l,a:this._a};},toHslString:function(){var hsl=rgbToHsl(this._r,this._g,this._b);var h=mathRound(hsl.h*360),s=mathRound(hsl.s*100),l=mathRound(hsl.l*100);return(this._a==1)?"hsl("+h+", "+s+"%, "+l+"%)":"hsla("+h+", "+s+"%, "+l+"%, "+this._roundA+")";},toHex:function(allow3Char){return rgbToHex(this._r,this._g,this._b,allow3Char);},toHexString:function(allow3Char){return'#'+this.toHex(allow3Char);},toHex8:function(){return rgbaToHex(this._r,this._g,this._b,this._a);},toHex8String:function(dynamic){if(dynamic){var hex=this.toHex8();if(hex.substr(0,2)!='ff')
763return this.toRgbString();return this.toHexString();}
764return'#'+this.toHex8();},toRgb:function(){return{r:mathRound(this._r),g:mathRound(this._g),b:mathRound(this._b),a:this._a};},toRgbString:function(){return(this._a==1)?"rgb("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+")":"rgba("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+", "+this._roundA+")";},toPercentageRgb:function(){return{r:mathRound(bound01(this._r,255)*100)+"%",g:mathRound(bound01(this._g,255)*100)+"%",b:mathRound(bound01(this._b,255)*100)+"%",a:this._a};},toPercentageRgbString:function(){return(this._a==1)?"rgb("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%)":"rgba("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%, "+this._roundA+")";},toName:function(){if(this._a===0){return"transparent";}
765if(this._a<1){return false;}
766return hexNames[rgbToHex(this._r,this._g,this._b,true)]||false;},toFilter:function(secondColor){var hex8String='#'+rgbaToHex(this._r,this._g,this._b,this._a);var secondHex8String=hex8String;var gradientType=this._gradientType?"GradientType = 1, ":"";if(secondColor){var s=tinycolor(secondColor);secondHex8String=s.toHex8String();}
767return"progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";},toString:function(format){var formatSet=!!format;format=format||this._format;var formattedString=false;var hasAlpha=this._a<1&&this._a>=0;var needsAlphaFormat=!formatSet&&hasAlpha&&(format==="hex"||format==="hex6"||format==="hex3"||format==="name");if(needsAlphaFormat){if(format==="name"&&this._a===0){return this.toName();}
768return this.toRgbString();}
769if(format==="rgb"){formattedString=this.toRgbString();}
770if(format==="prgb"){formattedString=this.toPercentageRgbString();}
771if(format==="hex"||format==="hex6"){formattedString=this.toHexString();}
772if(format==="hex3"){formattedString=this.toHexString(true);}
773if(format==="hex8"){formattedString=this.toHex8String();}
774if(format==="hexd"){formattedString=this.toHex8String(true);}
775if(format==="name"){formattedString=this.toName();}
776if(format==="hsl"){formattedString=this.toHslString();}
777if(format==="hsv"){formattedString=this.toHsvString();}
778return formattedString||this.toHexString();},_applyModification:function(fn,args){var color=fn.apply(null,[this].concat([].slice.call(args)));this._r=color._r;this._g=color._g;this._b=color._b;this.setAlpha(color._a);return this;},lighten:function(){return this._applyModification(lighten,arguments);},brighten:function(){return this._applyModification(brighten,arguments);},darken:function(){return this._applyModification(darken,arguments);},desaturate:function(){return this._applyModification(desaturate,arguments);},saturate:function(){return this._applyModification(saturate,arguments);},greyscale:function(){return this._applyModification(greyscale,arguments);},spin:function(){return this._applyModification(spin,arguments);},_applyCombination:function(fn,args){return fn.apply(null,[this].concat([].slice.call(args)));},analogous:function(){return this._applyCombination(analogous,arguments);},complement:function(){return this._applyCombination(complement,arguments);},monochromatic:function(){return this._applyCombination(monochromatic,arguments);},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments);},triad:function(){return this._applyCombination(triad,arguments);},tetrad:function(){return this._applyCombination(tetrad,arguments);}};tinycolor.fromRatio=function(color,opts){if(typeof color=="object"){var newColor={};for(var i in color){if(color.hasOwnProperty(i)){if(i==="a"){newColor[i]=color[i];}
779else{newColor[i]=convertToPercentage(color[i]);}}}
780color=newColor;}
781return tinycolor(color,opts);};function inputToRGB(color){var rgb={r:0,g:0,b:0};var a=1;var ok=false;var format=false;if(typeof color=="string"){color=stringInputToObject(color);}
782if(typeof color=="object"){if(color.hasOwnProperty("r")&&color.hasOwnProperty("g")&&color.hasOwnProperty("b")){rgb=rgbToRgb(color.r,color.g,color.b);ok=true;format=String(color.r).substr(-1)==="%"?"prgb":"rgb";}
783else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("v")){color.s=convertToPercentage(color.s);color.v=convertToPercentage(color.v);rgb=hsvToRgb(color.h,color.s,color.v);ok=true;format="hsv";}
784else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("l")){color.s=convertToPercentage(color.s);color.l=convertToPercentage(color.l);rgb=hslToRgb(color.h,color.s,color.l);ok=true;format="hsl";}
785if(color.hasOwnProperty("a")){a=color.a;}}
786a=boundAlpha(a);return{ok:ok,format:color.format||format,r:mathMin(255,mathMax(rgb.r,0)),g:mathMin(255,mathMax(rgb.g,0)),b:mathMin(255,mathMax(rgb.b,0)),a:a};}
787function rgbToRgb(r,g,b){return{r:bound01(r,255)*255,g:bound01(g,255)*255,b:bound01(b,255)*255};}
788function rgbToHsl(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,l=(max+min)/2;if(max==min){h=s=0;}
789else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break;}
790h/=6;}
791return{h:h,s:s,l:l};}
792function hslToRgb(h,s,l){var r,g,b;h=bound01(h,360);s=bound01(s,100);l=bound01(l,100);function hue2rgb(p,q,t){if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p;}
793if(s===0){r=g=b=l;}
794else{var q=l<0.5?l*(1+s):l+s-l*s;var p=2*l-q;r=hue2rgb(p,q,h+1/3);g=hue2rgb(p,q,h);b=hue2rgb(p,q,h-1/3);}
795return{r:r*255,g:g*255,b:b*255};}
796function rgbToHsv(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,v=max;var d=max-min;s=max===0?0:d/max;if(max==min){h=0;}
797else{switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break;}
798h/=6;}
799return{h:h,s:s,v:v};}
800function hsvToRgb(h,s,v){h=bound01(h,360)*6;s=bound01(s,100);v=bound01(v,100);var i=math.floor(h),f=h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6,r=[v,q,p,p,t,v][mod],g=[t,v,v,q,p,p][mod],b=[p,p,t,v,v,q][mod];return{r:r*255,g:g*255,b:b*255};}
801function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];if(allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0);}
802return hex.join("");}
803function rgbaToHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join("");}
804tinycolor.equals=function(color1,color2){if(!color1||!color2){return false;}
805return tinycolor(color1).toRgbString()==tinycolor(color2).toRgbString();};tinycolor.random=function(){return tinycolor.fromRatio({r:mathRandom(),g:mathRandom(),b:mathRandom()});};function desaturate(color,amount){amount=(amount===0)?0:(amount||10);var hsl=tinycolor(color).toHsl();hsl.s-=amount/100;hsl.s=clamp01(hsl.s);return tinycolor(hsl);}
806function saturate(color,amount){amount=(amount===0)?0:(amount||10);var hsl=tinycolor(color).toHsl();hsl.s+=amount/100;hsl.s=clamp01(hsl.s);return tinycolor(hsl);}
807function greyscale(color){return tinycolor(color).desaturate(100);}
808function lighten(color,amount){amount=(amount===0)?0:(amount||10);var hsl=tinycolor(color).toHsl();hsl.l+=amount/100;hsl.l=clamp01(hsl.l);return tinycolor(hsl);}
809function brighten(color,amount){amount=(amount===0)?0:(amount||10);var rgb=tinycolor(color).toRgb();rgb.r=mathMax(0,mathMin(255,rgb.r-mathRound(255*-(amount/100))));rgb.g=mathMax(0,mathMin(255,rgb.g-mathRound(255*-(amount/100))));rgb.b=mathMax(0,mathMin(255,rgb.b-mathRound(255*-(amount/100))));return tinycolor(rgb);}
810function darken(color,amount){amount=(amount===0)?0:(amount||10);var hsl=tinycolor(color).toHsl();hsl.l-=amount/100;hsl.l=clamp01(hsl.l);return tinycolor(hsl);}
811function spin(color,amount){var hsl=tinycolor(color).toHsl();var hue=(mathRound(hsl.h)+amount)%360;hsl.h=hue<0?360+hue:hue;return tinycolor(hsl);}
812function complement(color){var hsl=tinycolor(color).toHsl();hsl.h=(hsl.h+180)%360;return tinycolor(hsl);}
813function triad(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+120)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+240)%360,s:hsl.s,l:hsl.l})];}
814function tetrad(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+90)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+180)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+270)%360,s:hsl.s,l:hsl.l})];}
815function splitcomplement(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+72)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+216)%360,s:hsl.s,l:hsl.l})];}
816function analogous(color,results,slices){results=results||6;slices=slices||30;var hsl=tinycolor(color).toHsl();var part=360/slices;var ret=[tinycolor(color)];for(hsl.h=((hsl.h-(part*results>>1))+720)%360;--results;){hsl.h=(hsl.h+part)%360;ret.push(tinycolor(hsl));}
817return ret;}
818function monochromatic(color,results){results=results||6;var hsv=tinycolor(color).toHsv();var h=hsv.h,s=hsv.s,v=hsv.v;var ret=[];var modification=1/results;while(results--){ret.push(tinycolor({h:h,s:s,v:v}));v=(v+modification)%1;}
819return ret;}
820tinycolor.mix=function(color1,color2,amount){amount=(amount===0)?0:(amount||50);var rgb1=tinycolor(color1).toRgb();var rgb2=tinycolor(color2).toRgb();var p=amount/100;var w=p*2-1;var a=rgb2.a-rgb1.a;var w1;if(w*a==-1){w1=w;}else{w1=(w+a)/(1+w*a);}
821w1=(w1+1)/2;var w2=1-w1;var rgba={r:rgb2.r*w1+rgb1.r*w2,g:rgb2.g*w1+rgb1.g*w2,b:rgb2.b*w1+rgb1.b*w2,a:rgb2.a*p+rgb1.a*(1-p)};return tinycolor(rgba);};tinycolor.readability=function(color1,color2){var c1=tinycolor(color1);var c2=tinycolor(color2);var rgb1=c1.toRgb();var rgb2=c2.toRgb();var brightnessA=c1.getBrightness();var brightnessB=c2.getBrightness();var colorDiff=(Math.max(rgb1.r,rgb2.r)-Math.min(rgb1.r,rgb2.r)+
822Math.max(rgb1.g,rgb2.g)-Math.min(rgb1.g,rgb2.g)+
823Math.max(rgb1.b,rgb2.b)-Math.min(rgb1.b,rgb2.b));return{brightness:Math.abs(brightnessA-brightnessB),color:colorDiff};};tinycolor.isReadable=function(color1,color2){var readability=tinycolor.readability(color1,color2);return readability.brightness>125&&readability.color>500;};tinycolor.mostReadable=function(baseColor,colorList){var bestColor=null;var bestScore=0;var bestIsReadable=false;for(var i=0;i<colorList.length;i++){var readability=tinycolor.readability(baseColor,colorList[i]);var readable=readability.brightness>125&&readability.color>500;var score=3*(readability.brightness/125)+(readability.color/500);if((readable&&!bestIsReadable)||(readable&&bestIsReadable&&score>bestScore)||((!readable)&&(!bestIsReadable)&&score>bestScore)){bestIsReadable=readable;bestScore=score;bestColor=tinycolor(colorList[i]);}}
824return bestColor;};var names=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
8240",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var hexNames=tinycolor.hexNames=flip(names);function flip(o){var flipped={};for(var i in o){if(o.hasOwnProperty(i)){flipped[o[i]]=i;}}
825return flipped;}
826function boundAlpha(a){a=parseFloat(a);if(isNaN(a)||a<0||a>1){a=1;}
827return a;}
828function bound01(n,max){if(isOnePointZero(n)){n="100%";}
829var processPercent=isPercentage(n);n=mathMin(max,mathMax(0,parseFloat(n)));if(processPercent){n=parseInt(n*max,10)/100;}
830if((math.abs(n-max)<0.000001)){return 1;}
831return(n%max)/parseFloat(max);}
832function clamp01(val){return mathMin(1,mathMax(0,val));}
833function parseIntFromHex(val){return parseInt(val,16);}
834function isOnePointZero(n){return typeof n=="string"&&n.indexOf('.')!=-1&&parseFloat(n)===1;}
835function isPercentage(n){return typeof n==="string"&&n.indexOf('%')!=-1;}
836function pad2(c){return c.length==1?'0'+c:''+c;}
837function convertToPercentage(n){if(n<=1){n=(n*100)+"%";}
838return n;}
839function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16);}
840function convertHexToDecimal(h){return(parseIntFromHex(h)/255);}
841var matchers=(function(){var CSS_INTEGER="[-\\+]?\\d+%?";var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?";var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")";var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";return{rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"
841+PERMISSIVE_MATCH4),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hexd:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};})();function stringInputToObject(color){color=color.replace(trimLeft,'').replace(trimRight,'').toLowerCase();var named=false;if(names[color]){color=names[color];named=true;}
842else if(color=='transparent'){return{r:0,g:0,b:0,a:0,format:"name"};}
843var match;if((match=matchers.rgb.exec(color))){return{r:match[1],g:match[2],b:match[3]};}
844if((match=matchers.rgba.exec(color))){return{r:match[1],g:match[2],b:match[3],a:match[4]};}
845if((match=matchers.hsl.exec(color))){return{h:match[1],s:match[2],l:match[3]};}
846if((match=matchers.hsla.exec(color))){return{h:match[1],s:match[2],l:match[3],a:match[4]};}
847if((match=matchers.hsv.exec(color))){return{h:match[1],s:match[2],v:match[3]};}
848if((match=matchers.hsva.exec(color))){return{h:match[1],s:match[2],v:match[3],a:match[4]};}
849if((match=matchers.hex8.exec(color))){return{a:convertHexToDecimal(match[1]),r:parseIntFromHex(match[2]),g:parseIntFromHex(match[3]),b:parseIntFromHex(match[4]),format:named?"name":"hex8"};}
850if((match=matchers.hex6.exec(color))){return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"};}
851if((match=matchers.hex3.exec(color))){return{r:parseIntFromHex(match[1]+''+match[1]),g:parseIntFromHex(match[2]+''+match[2]),b:parseIntFromHex(match[3]+''+match[3]),format:named?"name":"hex"};}
852return false;}
853window.tinycolor=tinycolor;})();$(function(){if($.fn.spectrum.load){$.fn.spectrum.processNativeColorInputs();}});});;(function($){var passy={character:{DIGIT:1,LOWERCASE:2,UPPERCASE:4,PUNCTUATION:8},strength:{LOW:0,MEDIUM:1,HIGH:2,EXTREME:3},dictionary:[],patterns:['0123456789','abcdefghijklmnopqrstuvwxyz','qwertyuiopasdfghjklzxcvbnm','azertyuiopqsdfghjklmwxcvbn','!#$*+-.:?@^'],threshold:{medium:16,high:22,extreme:36}};passy.requirements={characters:passy.character.DIGIT|passy.character.LOWERCASE|passy.character.UPPERCASE,length:{min:6,max:Infinity}};if(Object.seal){Object.seal(passy.character);Object.seal(passy.strength);}
854if(Object.freeze){Object.freeze(passy.character);Object.freeze(passy.strength);}
855passy.analize=function(password,return_score){var score=Math.floor(password.length*2);var i=password.length;score+=$.passy.analizePatterns(password);score+=$.passy.analizeDictionary(password);while(i--)score+=$.passy.analizeCharacter(password.charAt(i));if(return_score)
856return score;return $.passy.analizeScore(score);};passy.analizeCharacter=function(character){var code=character.charCodeAt(0);if(code>=97&&code<=122)return 1;if(code>=48&&code<=57)return 2;if(code>=65&&code<=90)return 3;if(code<=126)return 4;return 5;};passy.analizePattern=function(password,pattern){var lastmatch=-1;var score=-2;for(var i=0;i<password.length;i++){var match=pattern.indexOf(password.charAt(i));if(lastmatch===match-1){lastmatch=match;score++;}}
857return Math.max(0,score);};passy.analizePatterns=function(password){var chars=password.toLowerCase();var score=0;for(var i in $.passy.patterns){var pattern=$.passy.patterns[i].toLowerCase();score+=$.passy.analizePattern(chars,pattern);}
858return score*-5;};passy.analizeDictionary=function(password){var chars=password.toLowerCase();var score=0;for(var i in $.passy.dictionary){var word=$.passy.dictionary[i].toLowerCase();if(password.indexOf(word)>=0)score++;}
859return score*-5;};passy.analizeScore=function(score){if(score>=$.passy.threshold.extreme)return $.passy.strength.EXTREME;if(score>=$.passy.threshold.high)return $.passy.strength.HIGH;if(score>=$.passy.threshold.medium)return $.passy.strength.MEDIUM;return $.passy.strength.LOW;};passy.generate=function(len,specials,numbers,uppercases){var chars=['abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ','0123456789','!#$&()*+<=>@[]^'];if(typeof(specials)!='undefined'&&!specials)
860chars.splice(3,1);if(typeof(numbers)!='undefined'&&!numbers)
861chars.splice(2,1);if(typeof(uppercases)!='undefined'&&!uppercases)
862chars.splice(1,1);var password=[];var type,index;len=Math.max(len,$.passy.requirements.length.min);len=Math.min(len,$.passy.requirements.length.max);while(len--){type=len%chars.length;index=Math.floor(Math.random()*chars[type].length);password.push(chars[type].charAt(index));}
863password.sort(function(){return Math.random()*2-1;});return password.join('');};passy.contains=function(str,character){if(character===$.passy.character.DIGIT){return /\d/.test(str);}else if(character===$.passy.character.LOWERCASE){return /[a-z]/.test(str);}else if(character===$.passy.character.UPPERCASE){return /[A-Z]/.test(str);}else if(character===$.passy.character.PUNCTUATION){return /[!"#$%&'()*+,\-./:;<=>?@[\\]\^_`{\|}~]/.test(str);}};passy.valid=function(str){var valid=true;if(!$.passy.requirements)return true;if(str.length<$.passy.requirements.length.min)return false;if(str.length>$.passy.requirements.length.max)return false;for(var i in $.passy.character){if($.passy.requirements.characters&$.passy.character[i]){valid=$.passy.contains(str,$.passy.character[i])&&valid;}}
864return valid;};var methods={init:function(callback){var $this=$(this);$this.on('change keyup',function(){if(typeof callback!=='function')return;var value=$this.val();callback.call($this,$.passy.analize(value),methods.valid.call($this));});},generate:function(len,specials,numbers,uppercases){this.val($.passy.generate(len,specials,numbers,uppercases));this.change();},valid:function(){return $.passy.valid(this.val());},ui:function(){var $this=$(this);if($this.parent().find('.passy_status').length)
865return;$this.after('<span class="passy_status"><i></i></span>');if(typeof($this.tipsy)!='undefined')
866$this.after('<a class="passy_icon" title="Password Generator"><b>*</b></a>');var jicon=$this.parent().find('.passy_icon');jicon.click(function(){if(jicon.data('tipsy')){if(jicon.data('tipsy').$tip.is(':visible')){jicon.data('tipsy').$tip.hide();}else{jicon.data('tipsy').$tip.show();jicon.tipsy("update");}
867return false;}
868jicon.tipsy({trigger:'manual',html:true,opacity:1.0,additionalClassName:'tipsy-big',closeButton:true,gravity:'n'});jicon.tipsy("show");if(jicon.closest('#fancybox-content').length)
869jicon.data('tipsy').$tip.css({'z-index':'1102'});var content=$('<div class="passy_generator form">'+'<fieldset>'+'<div class="field"><input type="text" /><select></select></div>'+'<div class="field">'+'<label><input type="checkbox" name="passy_specials" checked="true" /> Special chars</label> '+'<label><input type="checkbox" name="passy_numbers" checked="true" /> Numbers</label> '+'<label><input type="checkbox" name="passy_uppers" checked="true" /> Upper/Lower case</label></div>'+'</fieldset>'+'<p class="buttons"><input type="submit" class="button b" value="Use" /> <input type="button" class="button" value="Generate New" /></p>'+'</div>');var password=content.find('input[type=text]');var select=content.find('select');var generate=content.find('input[type=button]');var use=content.find('input[type=submit]');var checkboxes=content.find('input[type=checkbox]');var specials=true,numbers=true,uppers=true;for(var i=6;i<=32;i++)
870select.append('<option'+(i==16?' selected="true"':'')+'>'+i+'</option>');checkboxes.change(function(){if(this.name=='passy_specials')
871specials=this.checked;if(this.name=='passy_numbers')
872numbers=this.checked;if(this.name=='passy_uppers')
873uppers=this.checked;});generate.click(function(){password.passy('generate',select.val(),specials,numbers,uppers);return false;}).click();use.click(function(){$this.val(password.val()).trigger('change');jicon.data('tipsy').$tip.hide();return false;});jicon.data('tipsy').$tip.find('.tipsy-inner').html(content);jicon.tipsy("update");});$this.on('change keyup',function(){var jstatus=$(this).parent().find('.passy_status');var score=$.passy.analize(this.value,true);var percent=score*100/36;percent=percent<100?percent:100;
873var red=Math.round((100-percent)*200/50);var green=Math.round(percent*200/50);jstatus.find('i').css('width',percent+'%').css('background-color','rgb('+red+', '+(green<200?green:200)+', 0)');});}};$.fn.passy=function(opt){if(methods[opt]){return methods[opt].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof opt==='function'||!opt){return methods.init.apply(this,arguments);}
874return this;};$.extend({passy:passy});})(jQuery);;(function($){"use strict";var methods={init:function(options){var form=this;if(!form.data('jqv')||form.data('jqv')==null){options=methods._saveOptions(form,options);$(document).on("click",".formError",function(){$(this).fadeOut(150,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});});}
875return this;},attach:function(userOptions){var form=this;var options;if(userOptions)
876options=methods._saveOptions(form,userOptions);else
877options=form.data('jqv');options.validateAttribute=(form.find("[data-validation-engine*=validate]").length)?"data-validation-engine":"class";if(options.binded){form.on("click","["+options.validateAttribute+"*=validate][type=checkbox],["+options.validateAttribute+"*=validate][type=radio]",methods._onFieldEvent);form.on(options.validationEventTrigger,"["+options.validateAttribute+"*=validate][class*=datepicker]",{"delay":300},methods._onFieldEvent);}
878if(options.autoPositionUpdate){$(window).bind("resize",{"noAnimation":true,"formElem":form},methods.updatePromptsPosition);}
879form.on("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",methods._submitButtonClick);form.removeData('jqv_submitButton');form.on("submit",methods._onSubmitEvent);return this;},detach:function(){var form=this;var options=form.data('jqv');form.find("["+options.validateAttribute+"*=validate]").not("[type=checkbox]").off(options.validationEventTrigger,methods._onFieldEvent);form.find("["+options.validateAttribute+"*=validate][type=checkbox],[class*=validate][type=radio]").off("click",methods._onFieldEvent);form.off("submit",methods._onSubmitEvent);form.removeData('jqv');form.off("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",methods._submitButtonClick);form.removeData('jqv_submitButton');if(options.autoPositionUpdate)
880$(window).off("resize",methods.updatePromptsPosition);return this;},validate:function(){var element=$(this);var valid=null;
880if(element.is("form")||element.hasClass("validationEngineContainer")){if(element.hasClass('validating')){return false;}else{element.addClass('validating');var options=element.data('jqv');var valid=methods._validateFields(this);setTimeout(function(){element.removeClass('validating');},100);if(valid&&options.onSuccess){options.onSuccess();}else if(!valid&&options.onFailure){options.onFailure();}}}else if(element.is('form')||element.hasClass('validationEngineContainer')){element.removeClass('validating');}else{var form=element.closest('form, .validationEngineContainer'),options=(form.data('jqv'))?form.data('jqv'):$.validationEngine.defaults,valid=methods._validateField(element,options);if(valid&&options.onFieldSuccess)
881options.onFieldSuccess();else if(options.onFieldFailure&&options.InvalidFields.length>0){options.onFieldFailure();}}
882if(options.onValidationComplete){return!!options.onValidationComplete(form,valid);}
883return valid;},updatePromptsPosition:function(event){if(event&&this==window){var form=event.data.formElem;var noAnimation=event.data.noAnimation;}
884else
885var form=$(this.closest('form, .validationEngineContainer'));var options=form.data('jqv');form.find('['+options.validateAttribute+'*=validate]').not(":disabled").each(function(){var field=$(this);if(options.prettySelect&&field.is(":hidden"))
886field=form.find("#"+options.usePrefix+field.attr('id')+options.useSuffix);var prompt=methods._getPrompt(field);var promptText=$(prompt).find(".formErrorContent").html();if(prompt)
887methods._updatePrompt(field,$(prompt),promptText,undefined,false,options,noAnimation);});return this;},showPrompt:function(promptText,type,promptPosition,showArrow){var form=this.closest('form, .validationEngineContainer');var options=form.data('jqv');if(!options)
888options=methods._saveOptions(this,options);if(promptPosition)
889options.promptPosition=promptPosition;options.showArrow=showArrow==true;methods._showPrompt(this,promptText,type,false,options);return this;},hide:function(){var form=$(this).closest('form, .validationEngineContainer');var options=form.data('jqv');var fadeDuration=(options&&options.fadeDuration)?options.fadeDuration:0.3;var closingtag;
889if($(this).is("form")||$(this).hasClass("validationEngineContainer")){closingtag="parentForm"+methods._getClassName($(this).attr("id"));}else{closingtag=methods._getClassName($(this).attr("id"))+"formError";}
890$('.'+closingtag).fadeTo(fadeDuration,0.3,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});return this;},hideAll:function(){var form=this;var options=form.data('jqv');var duration=options?options.fadeDuration:300;$('.formError').fadeTo(duration,300,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});return this;},_onFieldEvent:function(event){var field=$(this);var form=field.closest('form, .validationEngineContainer');var options=form.data('jqv');options.eventTrigger="field";window.setTimeout(function(){methods._validateField(field,options);if(options.InvalidFields.length==0&&options.onFieldSuccess){options.onFieldSuccess();}else if(options.InvalidFields.length>0&&options.onFieldFailure){options.onFieldFailure();}},(event.data)?event.data.delay:0);},_onSubmitEvent:function(){var form=$(this);var options=form.data('jqv');if(form.data("jqv_submitButton")){var submitButton=$("#"+form.data("jqv_submitButton"));if(submitButton){if(submitButton.length>
8900){if(submitButton.hasClass("validate-skip")||submitButton.attr("data-validation-engine-skip")=="true")
891return true;}}}
892options.eventTrigger="submit";var r=methods._validateFields(form);if(r&&options.ajaxFormValidation){methods._validateFormWithAjax(form,options);return false;}
893if(options.onValidationComplete){return!!options.onValidationComplete(form,r);}
894return r;},_checkAjaxStatus:function(options){var status=true;$.each(options.ajaxValidCache,function(key,value){if(!value){status=false;return false;}});return status;},_checkAjaxFieldStatus:function(fieldid,options){return options.ajaxValidCache[fieldid]==true;},_validateFields:function(form){var options=form.data('jqv');var errorFound=false;form.trigger("jqv.form.validating");var first_err=null;form.find('['+options.validateAttribute+'*=validate]').not(":disabled").filter(":input").each(function(){var field=$(this);var names=[];if($.inArray(field.attr('name'),names)<0){errorFound|=methods._validateField(field,options);if(errorFound&&first_err==null)
895if(field.is(":hidden")&&options.prettySelect)
896first_err=field=form.find("#"+options.usePrefix+methods._jqSelector(field.attr('id'))+options.useSuffix);else{if(field.data('jqv-prompt-at')instanceof jQuery){field=field.data('jqv-prompt-at');}else if(field.data('jqv-prompt-at')){field=$(field.data('jqv-prompt-at'));}
897first_err=field;}
898if(options.doNotShowAllErrosOnSubmit)
899return false;names.push(field.attr('name'));if(options.showOneMessage==true&&errorFound){return false;}}});form.trigger("jqv.form.result",[errorFound]);if(errorFound){if(options.scroll){var destination=first_err.offset().top;var fixleft=first_err.offset().left;var positionType=options.promptPosition;if(typeof(positionType)=='string'&&positionType.indexOf(":")!=-1)
900positionType=positionType.substring(0,positionType.indexOf(":"));if(positionType!="bottomRight"&&positionType!="bottomLeft"){var prompt_err=methods._getPrompt(first_err);if(prompt_err){destination=prompt_err.offset().top;}}
901if(options.scrollOffset){destination-=options.scrollOffset;}
902if(options.isOverflown){var overflowDIV=$(options.overflownDIV);if(!overflowDIV.length)return false;var scrollContainerScroll=overflowDIV.scrollTop();var scrollContainerPos=-parseInt(overflowDIV.offset().top);destination+=scrollContainerScroll+scrollContainerPos-5;var scrollContainer=$(options.overflownDIV+":not(:animated)");scrollContainer.animate({scrollTop:destination},1100,function(){if(options.focusFirstField)first_err.focus();});}else{$("html, body").animate({scrollTop:destination},1100,function(){if(options.focusFirstField)first_err.focus();});$("html, body").animate({scrollLeft:fixleft},1100)}}else if(options.focusFirstField)
903first_err.focus();return false;}
904return true;},_validateFormWithAjax:function(form,options){var data=form.serialize();var type=(options.ajaxFormValidationMethod)?options.ajaxFormValidationMethod:"GET";var url=(options.ajaxFormValidationURL)?options.ajaxFormValidationURL:form.attr("action");var dataType=(options.dataType)?options.dataType:"json";$.ajax({type:type,url:url,cache:false,dataType:dataType,data:data,form:form,methods:methods,options:options,beforeSend:function(){return options.onBeforeAjaxFormValidation(form,options);},error:function(data,transport){if(options.onFailure){options.onFailure(data,transport);}else{methods._ajaxError(data,transport);}},success:function(json){if((dataType=="json")&&(json!==true)){var errorInForm=false;for(var i=0;i<json.length;i++){var value=json[i];var errorFieldId=value[0];var errorField=$($("#"+errorFieldId)[0]);if(errorField.length==1){var msg=value[2];if(value[1]==true){if(msg==""||!msg){methods._closePrompt(errorField);}else{if(options.allrules[msg]){var txt=options.allrules[msg].alertTextOk;if(txt)
905msg=txt;}
906if(options.showPrompts)methods._showPrompt(errorField,msg,"pass",false,options,true);}}else{errorInForm|=true;if(options.allrules[msg]){var txt=options.allrules[msg].alertText;if(txt)
907msg=txt;}
908if(options.showPrompts)methods._showPrompt(errorField,msg,"",false,options,true);}}}
909options.onAjaxFormComplete(!errorInForm,form,json,options);}else
910options.onAjaxFormComplete(true,form,json,options);}});}
910,_validateField:function(field,options,skipAjaxValidation){if(!field.attr("id")){field.attr("id","form-validation-field-"+$.validationEngine.fieldIdCounter);++$.validationEngine.fieldIdCounter;}
911if(!options.validateNonVisibleFields&&(field.is(":hidden")&&!options.prettySelect||field.parent().is(":hidden")))
912return false;var rulesParsing=field.attr(options.validateAttribute);var getRules=/validate\[(.*)\]/.exec(rulesParsing);if(!getRules)
913return false;var str=getRules[1];var rules=str.split(/\[|,|\]/);var isAjaxValidator=false;var fieldName=field.attr("name");var promptText="";var promptType="";var required=false;var limitErrors=false;options.isError=false;options.showArrow=true;if(options.maxErrorsPerField>0){limitErrors=true;}
914var form=$(field.closest("form, .validationEngineContainer"));for(var i=0;i<rules.length;i++){rules[i]=rules[i].replace(" ","");if(rules[i]===''){delete rules[i];}}
915for(var i=0,field_errors=0;i<rules.length;i++){if(limitErrors&&field_errors>=options.maxErrorsPerField){if(!required){var have_required=$.inArray('required',rules);required=(have_required!=-1&&have_required>=i);}
916break;}
917var errorMsg=undefined;switch(rules[i]){case"required":required=true;errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._required);break;case"custom":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._custom);break;case"groupRequired":var classGroup="["+options.validateAttribute+"*=\"groupRequired["+rules[i+1]+"\"]";var firstOfGroup=form.find(classGroup).eq(0);if(firstOfGroup[0]!=field[0]){methods._validateField(firstOfGroup,options,skipAjaxValidation);options.showArrow=true;}
918errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._groupRequired);if(errorMsg)required=true;options.showArrow=false;break;case"ajax":errorMsg=methods._ajax(field,rules,i,options);if(errorMsg){promptType="load";}
919break;case"minSize":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._minSize);break;case"maxSize":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._maxSize);break;case"min":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._min);break;case"max":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._max);break;case"past":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._past);break;case"future":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._future);break;case"dateRange":var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";options.firstOfGroup=form.find(classGroup).eq(0);options.secondOfGroup=form.find(classGroup).eq(1);if(options.firstOfGroup[0].value||options.secondOfGroup[0].value){errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._dateRange);}
920if(errorMsg)required=true;options.showArrow=false;break;case"dateTimeRange":var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";options.firstOfGroup=form.find(classGroup).eq(0);options.secondOfGroup=form.find(classGroup).eq(1);if(options.firstOfGroup[0].value||options.secondOfGroup[0].value){errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._dateTimeRange);}
921if(errorMsg)required=true;options.showArrow=false;break;case"maxCheckbox":field=$(form.find("input[name='"+fieldName+"']"));errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._maxCheckbox);break;case"minCheckbox":field=$(form.find("input[name='"+fieldName+"']"));errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._minCheckbox);break;case"equals":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._equals);break;case"funcCall":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._funcCall);break;case"creditCard":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._creditCard);break;case"condRequired":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._c
921ondRequired);if(errorMsg!==undefined){required=true;}
922break;default:}
923var end_validation=false;if(typeof errorMsg=="object"){switch(errorMsg.status){case"_break":end_validation=true;break;case"_error":errorMsg=errorMsg.message;break;case"_error_no_prompt":return true;break;default:break;}}
924if(end_validation){break;}
925if(typeof errorMsg=='string'){promptText+=errorMsg+"<br/>";options.isError=true;field_errors++;}}
926if(!required&&!(field.val())&&field.val().length<1&&rules.indexOf("equals")<0)options.isError=false;var fieldType=field.prop("type");var positionType=field.data("promptPosition")||options.promptPosition;if((fieldType=="radio"||fieldType=="checkbox")&&form.find("input[name='"+fieldName+"']").size()>1){if(positionType==='inline'){field=$(form.find("input[name='"+fieldName+"'][type!=hidden]:last"));}else{field=$(form.find("input[name='"+fieldName+"'][type!=hidden]:first"));}
927options.showArrow=false;}
928if(field.is(":hidden")&&options.prettySelect){field=form.find("#"+options.usePrefix+methods._jqSelector(field.attr('id'))+options.useSuffix);}
929if(options.isError&&options.showPrompts){methods._showPrompt(field,promptText,promptType,false,options);}else{if(!isAjaxValidator)methods._closePrompt(field);}
930if(!isAjaxValidator){field.trigger("jqv.field.result",[field,options.isError,promptText]);}
931var errindex=$.inArray(field[0],options.InvalidFields);if(errindex==-1){if(options.isError)
932options.InvalidFields.push(field[0]);}else if(!options.isError){options.InvalidFields.splice(errindex,1);}
933methods._handleStatusCssClasses(field,options);if(options.isError&&options.onFieldFailure)
934options.onFieldFailure(field);if(!options.isError&&options.onFieldSuccess)
935options.onFieldSuccess(field);return options.isError;},_handleStatusCssClasses:function(field,options){if(options.addSuccessCssClassToField)
936field.removeClass(options.addSuccessCssClassToField);if(options.addFailureCssClassToField)
937field.removeClass(options.addFailureCssClassToField);if(options.addSuccessCssClassToField&&!options.isError)
938field.addClass(options.addSuccessCssClassToField);if(options.addFailureCssClassToField&&options.isError)
939field.addClass(options.addFailureCssClassToField);},_getErrorMessage:function(form,field,rule,rules,i,options,originalValidationMethod){var rule_index=jQuery.inArray(rule,rules);if(rule==="custom"||rule==="funcCall"){var custom_validation_type=rules[rule_index+1];rule=rule+"["+custom_validation_type+"]";delete(rules[rule_index]);}
940var alteredRule=rule;var element_classes=(field.attr("data-validation-engine"))?field.attr("data-validation-engine"):field.attr("class");var element_classes_array=element_classes.split(" ");var errorMsg;if(rule=="future"||rule=="past"||rule=="maxCheckbox"||rule=="minCheckbox"){errorMsg=originalValidationMethod(form,field,rules,i,options);}else{errorMsg=originalValidationMethod(field,rules,i,options);}
941if(errorMsg!=undefined){var custom_message=methods._getCustomErrorMessage($(field),element_classes_array,alteredRule,options);if(custom_message)errorMsg=custom_message;}
942return errorMsg;},_getCustomErrorMessage:function(field,classes,rule,options){var custom_message=false;var validityProp=/^custom\[.*\]$/.test(rule)?methods._validityProp["custom"]:methods._validityProp[rule];if(validityProp!=undefined){custom_message=field.attr("data-errormessage-"+validityProp);if(custom_message!=undefined)
943return custom_message;}
944custom_message=field.attr("data-errormessage");if(custom_message!=undefined)
945return custom_message;var id='#'+field.attr("id");if(typeof options.custom_error_messages[id]!="undefined"&&typeof options.custom_error_messages[id][rule]!="undefined"){custom_message=options.custom_error_messages[id][rule]['message'];}else if(classes.length>0){for(var i=0;i<classes.length&&classes.length>0;i++){var element_class="."+classes[i];if(typeof options.custom_error_messages[element_class]!="undefined"&&typeof options.custom_error_messages[element_class][rule]!="undefined"){custom_message=options.custom_error_messages[element_class][rule]['message'];break;}}}
946if(!custom_message&&typeof options.custom_error_messages[rule]!="undefined"&&typeof options.custom_error_messages[rule]['message']!="undefined"){custom_message=options.custom_error_messages[rule]['message'];}
947return custom_message;}
947,_validityProp:{"required":"value-missing","custom":"custom-error","groupRequired":"value-missing","ajax":"custom-error","minSize":"range-underflow","maxSize":"range-overflow","min":"range-underflow","max":"range-overflow","past":"type-mismatch","future":"type-mismatch","dateRange":"type-mismatch","dateTimeRange":"type-mismatch","maxCheckbox":"range-overflow","minCheckbox":"range-underflow","equals":"pattern-mismatch","funcCall":"custom-error","creditCard":"pattern-mismatch","condRequired":"value-missing"},_required:function(field,rules,i,options,condRequired){switch(field.prop("type")){case"text":case"password":case"textarea":case"file":case"select-one":case"select-multiple":default:var field_val=$.trim(field.val());var dv_placeholder=$.trim(field.attr("data-validation-placeholder"));var placeholder=$.trim(field.attr("placeholder"));if((!field_val)||(dv_placeholder&&field_val==dv_placeholder)||(placeholder&&field_val==placeholder)){return options.allrules[rules[i]].alertText;}
948break;case"radio":case"checkbox":if(condRequired){if(!field.attr('checked')){return options.allrules[rules[i]].alertTextCheckboxMultiple;}
949break;}
950var form=field.closest("form, .validationEngineContainer");var name=field.attr("name");if(form.find("input[name='"+name+"']:checked").size()==0){if(form.find("input[name='"+name+"']:visible").size()==1)
951return options.allrules[rules[i]].alertTextCheckboxe;else
952return options.allrules[rules[i]].alertTextCheckboxMultiple;}
953break;}},_groupRequired:function(field,rules,i,options){var classGroup="["+options.validateAttribute+"*=\"groupRequired["+rules[i+1]+"\"]";var isValid=false;field.closest("form, .validationEngineContainer").find(classGroup).each(function(){if(!methods._required($(this),rules,i,options)){isValid=true;return false;}});if(!isValid){return options.allrules[rules[i]].alertText;}},_custom:function(field,rules,i,options){var customRule=rules[i+1];var rule=options.allrules[customRule];var fn;if(!rule){alert("jqv:custom rule not found - "+customRule);return;}
954if(rule["regex"]){var ex=rule.regex;if(!ex){alert("jqv:custom regex not found - "+customRule);return;}
955var pattern=new RegExp(ex);if(!pattern.test(field.val()))return options.allrules[customRule].alertText;}else if(rule["func"]){fn=rule["func"];if(typeof(fn)!=="function"){alert("jqv:custom parameter 'function' is no function - "+customRule);return;}
956if(!fn(field,rules,i,options))
957return options.allrules[customRule].alertText;}else{alert("jqv:custom type not allowed "+customRule);return;}},_funcCall:function(field,rules,i,options){var functionName=rules[i+1];var fn;if(functionName.indexOf('.')>-1)
958{var namespaces=functionName.split('.');var scope=window;while(namespaces.length)
959{scope=scope[namespaces.shift()];}
960fn=scope;}
961else
962fn=window[functionName]||options.customFunctions[functionName];if(typeof(fn)=='function')
963return fn(field,rules,i,options);},_equals:function(field,rules,i,options){var equalsField=rules[i+1];if(field.val()!=field.closest('form').find('[name="'+equalsField+'"]').val())
964return options.allrules.equals.alertText;},_maxSize:function(field,rules,i,options){var max=rules[i+1];var len=field.val().length;if(len>max){var rule=options.allrules.maxSize;return rule.alertText+max+rule.alertText2;}},_minSize:function(field,rules,i,options){var min=rules[i+1];var len=field.val().length;if(len<min){var rule=options.allrules.minSize;return rule.alertText+min+rule.alertText2;}},_min:function(field,rules,i,options){var min=parseFloat(rules[i+1]);var len=parseFloat(field.val());if(len<min){var rule=options.allrules.min;if(rule.alertText2)return rule.alertText+min+rule.alertText2;return rule.alertText+min;}},_max:function(field,rules,i,options){var max=parseFloat(rules[i+1]);var len=parseFloat(field.val());if(len>max){var rule=options.allrules.max;if(rule.alertText2)return rule.alertText+max+rule.alertText2;return rule.alertText+max;}},_past:function(form,field,rules,i,options){var p=rules[i+1];var fieldAlt=$(form.find("*[name='"+p.replace(/^#+/,'')+"']"));var pdate;if(p.toLowerCase()=="now"){pdate=new Date();}else if(undefined!=fieldAlt.val()){if(fieldAlt.is(":disabled"))
965return;pdate=methods._parseDate(fieldAlt.val());}else{pdate=methods._parseDate(p);}
966var vdate=methods._parseDate(field.val());if(vdate>pdate){var rule=options.allrules.past;if(rule.alertText2)return rule.alertText+methods._dateToString(pdate)+rule.alertText2;return rule.alertText+methods._dateToString(pdate);}},_future:function(form,field,rules,i,options){var p=rules[i+1];var fieldAlt=$(form.find("*[name='"+p.replace(/^#+/,'')+"']"));var pdate;if(p.toLowerCase()=="now"){pdate=new Date();}else if(undefined!=fieldAlt.val()){if(fieldAlt.is(":disabled"))
967return;pdate=methods._parseDate(fieldAlt.val());}else{pdate=methods._parseDate(p);}
968var vdate=methods._parseDate(field.val());if(vdate<pdate){var rule=options.allrules.future;if(rule.alertText2)
969return rule.alertText+methods._dateToString(pdate)+rule.alertText2;return rule.alertText+methods._dateToString(pdate);}},_isDate:function(value){var dateRegEx=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?
969:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);return dateRegEx.test(value);},_isDateTime:function(value){var dateTimeRegEx=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/);return dateTimeRegEx.test(value);},_dateCompare:function(start,end){return(new Date(start.toString())<new Date(end.toString()));},_dateRange:function(field,rules,i,options){if((!options.firstOfGroup[0].value&&options.secondOfGroup[0].value)||(options.firstOfGroup[0].value&&!options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}
970if(!methods._isDate(options.firstOfGroup[0].value)||!methods._isDate(options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}
971if(!methods._dateCompare(options.firstOfGroup[0].value,options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}},_dateTimeRange:function(field,rules,i,options){if((!options.firstOfGroup[0].value&&options.secondOfGroup[0].value)||(options.firstOfGroup[0].value&&!options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}
972if(!methods._isDateTime(options.firstOfGroup[0].value)||!methods._isDateTime(options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}
973if(!methods._dateCompare(options.firstOfGroup[0].value,options.secondOfGroup[0].value)){return options.allrules[rules[i]].alertText+options.allrules[rules[i]].alertText2;}},_maxCheckbox:function(form,field,rules,i,options){var nbCheck=rules[i+1];var groupname=field.attr("name");var groupSize=form.find("input[name='"+groupname+"']:checked").size();if(groupSize>nbCheck){options.showArrow=false;if(options.allrules.maxCheckbox.alertText2)
974return options.allrules.maxCheckbox.alertText+" "+nbCheck+" "+options.allrules.maxCheckbox.alertText2;return options.allrules.maxCheckbox.alertText;}},_minCheckbox:function(form,field,rules,i,options){var nbCheck=rules[i+1];var groupname=field.attr("name");var groupSize=form.find("input[name='"+groupname+"']:checked").size();if(groupSize<nbCheck){options.showArrow=false;return options.allrules.minCheckbox.alertText+" "+nbCheck+" "+options.allrules.minCheckbox.alertText2;}},_creditCard:function(field,rules,i,options){var valid=false,cardNumber=field.val().replace(/ +/g,'').replace(/-+/g,'');var numDigits=cardNumber.length;if(numDigits>=14&&numDigits<=16&&parseInt(cardNumber)>0){var sum=0,i=numDigits-1,pos=1,digit,luhn=new String();do{digit=parseInt(cardNumber.charAt(i));luhn+=(pos++%2==0)?digit*2:digit;}while(--i>=0)
975for(i=0;i<luhn.length;i++){sum+=parseInt(luhn.charAt(i));}
976valid=sum%10==0;}
977if(!valid)return options.allrules.creditCard.alertText;},_ajax:function(field,rules,i,options){var errorSelector=rules[i+1];var rule=options.allrules[errorSelector];var extraData=rule.extraData;var extraDataDynamic=rule.extraDataDynamic;var data={"fieldId":field.attr("id"),"fieldValue":field.val()};if(typeof extraData==="object"){$.extend(data,extraData);}else if(typeof extraData==="string"){var tempData=extraData.split("&");for(var i=0;i<tempData.length;i++){var values=tempData[i].split("=");if(values[0]&&values[0]){data[values[0]]=values[1];}}}
978if(extraDataDynamic){var tmpData=[];var domIds=String(extraDataDynamic).split(",");for(var i=0;i<domIds.length;i++){var id=domIds[i];if($(id).length){var inputValue=field.closest("form, .validationEngineContainer").find(id).val();var keyValue=id.replace('#','')+'='+escape(inputValue);data[id.replace('#','')]=inputValue;}}}
979if(options.eventTrigger=="field"){delete(options.ajaxValidCache[field.attr("id")]);}
980if(!options.isError&&!methods._checkAjaxFieldStatus(field.attr("id"),options)){$.ajax({type:options.ajaxFormValidationMethod,url:rule.url,cache:false,dataType:"json",data:data,field:field,rule:rule,methods:methods,options:options,beforeSend:function(){},error:function(data,transport){if(options.onFailure){options.onFailure(data,transport);}else{methods._ajaxError(data,transport);}},success:function(json){var errorFieldId=json[0];var errorField=$("#"+errorFieldId).eq(0);if(errorField.length==1){var status=json[1];var msg=json[2];if(!status){options.ajaxValidCache[errorFieldId]=false;options.isError=true;if(msg){if(options.allrules[msg]){var txt=options.allrules[msg].alertText;if(txt){msg=txt;}}}
981else
982msg=rule.alertText;if(options.showPrompts)methods._showPrompt(errorField,msg,"",true,options);}else{options.ajaxValidCache[errorFieldId]=true;if(msg){if(options.allrules[msg]){var txt=options.allrules[msg].alertTextOk;if(txt){msg=txt;}}}
983else
984msg=rule.alertTextOk;if(options.showPrompts){if(msg)
985methods._showPrompt(errorField,msg,"pass",true,options);else
986methods._closePrompt(errorField);}
987if(options.eventTrigger=="submit")
988field.closest("form").submit();}}
989errorField.trigger("jqv.field.result",[errorField,options.isError,msg]);}});return rule.alertTextLoad;}},_ajaxError:function(data,transport){if(data.status==0&&transport==null)
990alert("The page is not served from a server! ajax call failed");else if(typeof console!="undefined")
991console.log("Ajax error: "+data.status+" "+transport);},_dateToString:function(date){return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();},_parseDate:function(d){var dateParts=d.split("-");if(dateParts==d)
992dateParts=d.split("/");if(dateParts==d){dateParts=d.split(".");return new Date(dateParts[2],(dateParts[1]-1),dateParts[0]);}
993if(dateParts[2]&&dateParts[2].length>=4)
994return new Date(dateParts[2],(dateParts[0]-1),dateParts[1]);return new Date(dateParts[0],(dateParts[1]-1),dateParts[2]);},_showPrompt:function(field,promptText,type,ajaxed,options,ajaxform){if(field.data('jqv-prompt-at')instanceof jQuery){field=field.data('jqv-prompt-at');}else if(field.data('jqv-prompt-at')){field=$(field.data('jqv-prompt-at'));}
995if($('html').is('.ui-mobile')){options.scroll=false;options.showOneMessage=true;var fieldLabel=field.closest('.field').find('label:first').text().replace(/\*|\r|\n/mg,' ');if(!fieldLabel)
996fieldLabel=field.attr('name');alert(fieldLabel+$('<div>'+promptText.replace(/\*/g,"\r\n ")+'</div>').text());return;}
997var prompt=methods._getPrompt(field);if(ajaxform)prompt=false;if($.trim(promptText)){if(prompt)
998methods._updatePrompt(field,prompt,promptText,type,ajaxed,options);else
999methods._buildPrompt(field,promptText,type,ajaxed,options);}},_buildPrompt:function(field,promptText,type,ajaxed,options){var prompt=$('<div>');prompt.addClass(methods._getClassName(field.attr("id"))+"formError");prompt.addClass("parentForm"+methods._getClassName(field.closest('form, .validationEngineContainer').attr("id")));prompt.addClass("formError");switch(type){case"pass":prompt.addClass("greenPopup");break;case"load":prompt.addClass("blackPopup");break;default:}
1000if(ajaxed)
1001prompt.addClass("ajaxed");var promptContent=$('<div>').addClass("formErrorContent").html(promptText).appendTo(prompt);var positionType=field.data("promptPosition")||options.promptPosition;if(options.showArrow){var arrow=$('<div>').addClass("formErrorArrow");if(typeof(positionType)=='string')
1002{var pos=positionType.indexOf(":");if(pos!=-1)
1003positionType=positionType.substring(0,pos);}
1004switch(positionType){case"bottomLeft":case"bottomRight":prompt.find(".formErrorContent").before(arrow);arrow.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');break;case"topLeft":case"topRight":arrow.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>');prompt.append(arrow);break;}}
1005if(options.addPromptClass)
1006prompt.addClass(options.addPromptClass);var requiredOverride=field.attr('data-required-class');if(requiredOverride!==undefined){prompt.addClass(requiredOverride);}else{if(options.prettySelect){if($('#'+field.attr('id')).next().is('select')){var prettyOverrideClass=$('#'+field.attr('id').substr(options.usePrefix.length).substring(options.useSuffix.length)).attr('data-required-class');if(prettyOverrideClass!==undefined){prompt.addClass(prettyOverrideClass);}}}}
1007prompt.css({"opacity":0});if(positionType==='inline'){prompt.addClass("inline");if(typeof field.attr('data-prompt-target')!=='undefined'&&$('#'+field.attr('data-prompt-target')).length>0){prompt.appendTo($('#'+field.attr('data-prompt-target')));}else{field.after(prompt);}}else{field.before(prompt);}
1008var pos=methods._calculatePosition(field,prompt,options);prompt.css({'position':positionType==='inline'?'relative':'absolute',"top":pos.callerTopPosition,"left"
1008:pos.callerleftPosition,"marginTop":pos.marginTopSize,"opacity":0}).data("callerField",field);if(options.autoHidePrompt){setTimeout(function(){prompt.animate({"opacity":0},function(){prompt.closest('.formErrorOuter').remove();prompt.remove();});},options.autoHideDelay);}
1009return prompt.animate({"opacity":1.0});},_updatePrompt:function(field,prompt,promptText,type,ajaxed,options,noAnimation){if(prompt){if(typeof type!=="undefined"){if(type=="pass")
1010prompt.addClass("greenPopup");else
1011prompt.removeClass("greenPopup");if(type=="load")
1012prompt.addClass("blackPopup");else
1013prompt.removeClass("blackPopup");}
1014if(ajaxed)
1015prompt.addClass("ajaxed");else
1016prompt.removeClass("ajaxed");prompt.find(".formErrorContent").html(promptText);var pos=methods._calculatePosition(field,prompt,options);var css={"top":pos.callerTopPosition,"left":pos.callerleftPosition,"marginTop":pos.marginTopSize};if(noAnimation)
1017prompt.css(css);else
1018prompt.animate(css);}},_closePrompt:function(field){var prompt=methods._getPrompt(field);if(prompt)
1019prompt.fadeTo("fast",0,function(){prompt.parent('.formErrorOuter').remove();prompt.remove();});},closePrompt:function(field){return methods._closePrompt(field);},_getPrompt:function(field){var formId=$(field).closest('form, .validationEngineContainer').attr('id');var className=methods._getClassName(field.attr("id"))+"formError";var match=$("."+methods._escapeExpression(className)+'.parentForm'+methods._getClassName(formId))[0];if(match)
1020return $(match);},_escapeExpression:function(selector){return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g,"\\$1");},isRTL:function(field)
1021{var $document=$(document);var $body=$('body');var rtl=(field&&field.hasClass('rtl'))||(field&&(field.attr('dir')||'').toLowerCase()==='rtl')||$document.hasClass('rtl')||($document.attr('dir')||'').toLowerCase()==='rtl'||$body.hasClass('rtl')||($body.attr('dir')||'').toLowerCase()==='rtl';return Boolean(rtl);},_calculatePosition:function(field,promptElmt,options){var promptTopPosition,promptleftPosition,marginTopSize;var fieldWidth=field.outerWidth();var fieldLeft=field.position().left;var fieldTop=field.position().top;var fieldHeight=field.outerHeight();var promptHeight=promptElmt.height();var promptWidth=promptElmt.width();promptTopPosition=promptleftPosition=0;marginTopSize=-promptHeight;var positionType=field.data("promptPosition")||options.promptPosition;var shift1="";var shift2="";var shiftX=0;var shiftY=0;if(typeof(positionType)=='string'){if(positionType.indexOf(":")!=-1){shift1=positionType.substring(positionType.indexOf(":")+1);positionType=positionType.substring(0,positionType.indexOf(":"));if(shift1.indexOf(",")!=-1){shift2=shift1.substring(shift1.indexOf(",")+1);shift1=shift1.substring(0,shift1.indexOf(","));shiftY=parseInt(shift2);if(isNaN(shiftY))shiftY=0;};shiftX=parseInt(shift1);if(isNaN(shift1))shift1=0;};};switch(positionType){default:case"topRight":promptleftPosition+=fieldLeft+fieldWidth-(fieldWidth>30?30:fieldWidth)-(fieldWidth>promptWidth?promptWidth-30:0);promptTopPosition+=fieldTop;break;case"topLeft":promptTopPosition+=fieldTop;promptleftPosition+=fieldLeft;break;case"centerRight":promptTopPosition=fieldTop+4;marginTopSize=0;promptleftPosition=fieldLeft+field.outerWidth(true)+5;break;case"centerLeft":promptleftPosition=fieldLeft-(promptElmt.width()+2);promptTopPosition=fieldTop+4;marginTopSize=0;break;case"bottomLeft":promptTopPosition=fieldTop+fieldHeight+5;marginTopSize=0;promptleftPosition=fieldLeft;break;case"bottomRight":promptleftPosition=fieldLeft+fieldWidth-(fieldWidth>30?30:fieldWidth)-(fieldWidth>promptWidth?promptWidth-30:0);promptTopPosition=fieldTop+fieldHeight+5;marginTopSize=0;break;case"inline":promptleftPosition=0;promptTopPosition=0;marginTopSize=0;};promptleftPosition+=shiftX;promptTopPosition+=shiftY;var maxWidth=$(document).scrollLeft()+$(window).width();var actualWidth=promptElmt.width();var offset=field.offset();if(promptleftPosition<offset.left&&offset.left+promptleftPosition+actualWidth>maxWidth)
1022promptleftPosition=promptleftPosition-((offset.left+promptleftPosition+actualWidth)-maxWidth);return{"callerTopPosition":promptTopPosition+"px","callerleftPosition":promptleftPosition+"px","marginTopSize":marginTopSize+"px"};},_saveOptions:function(form,options){if($.validationEngineLanguage)
1023var allRules=$.validationEngineLanguage.allRules;else
1024$.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");$.validationEngine.defaults.allrules=allRules;var userOptions=$.extend(true,{},$.validationEngine.defaults,options);form.data('jqv',userOptions);return userOptions;},_getClassName:function(className){if(className)
1025return className.replace(/:/g,"_").replace(/\./g,"_");},_jqSelector:function(str){return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,'\\$1');},_condRequired:function(field,rules,i,options){var idx,dependingField;for(idx=(i+1);idx<rules.length;idx++){dependingField=field.closest('form').find('[name="'+rules[idx]+'"]').first();if(dependingField.length&&methods._required(dependingField,["required"],0,options,true)==undefined){return methods._required(field,["required"],0,options);}}},_submitButtonClick:function(event){var button=$(this);var form=button.closest('form, .validationEngineContainer');form.data("jqv_submitButton",button.attr("id"));}};$.fn.validationEngine=function(method){var form=$(this);if(!form[0])return form;if(typeof(method)=='string'&&method.charAt(0)!='_'&&methods[method]){if(method!="showPrompt"&&method!="hide"&&method!="hideAll")
1026methods.init.apply(form);return methods[method].apply(form,Array.prototype.slice.call(arguments,1
1026));}else if(typeof method=='object'||!method){methods.init.apply(form,arguments);return methods.attach.apply(form);}else{$.error('Method '+method+' does not exist in jQuery.validationEngine');}};$.validationEngine={fieldIdCounter:0,defaults:{validationEventTrigger:"blur",scroll:true,focusFirstField:true,showPrompts:true,validateNonVisibleFields:false,promptPosition:"topRight",bindMethod:"bind",inlineAjax:false,ajaxFormValidation:false,ajaxFormValidationURL:false,ajaxFormValidationMethod:'get',onAjaxFormComplete:$.noop,onBeforeAjaxFormValidation:$.noop,onValidationComplete:false,doNotShowAllErrosOnSubmit:false,custom_error_messages:{},binded:true,showArrow:true,isError:false,maxErrorsPerField:false,ajaxValidCache:{},autoPositionUpdate:false,InvalidFields:[],onFieldSuccess:false,onFieldFailure:false,onSuccess:false,onFailure:false,validateAttribute:"class",addSuccessCssClassToField:"",addFailureCssClassToField:"",autoHidePrompt:false,autoHideDelay:10000,fadeDuration:0.3,prettySelect:false,addPromptClass:"",usePrefix:"",useSuffix:"",showOneMessage:false}};$(function(){$.validationEngine.defaults.promptPosition=methods.isRTL()?'topLeft':"topRight"});})(jQuery);;(function(factory){if(typeof module==="object"&&module.exports){module.exports=factory(require("jquery"));}else if(typeof define==="function"&&define.amd){define(["jquery"],function($){factory($);});}else factory(jQuery);})(function($,undefined){"use strict";var allCountries=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["G
1026ibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["S
1026omalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1,["5288","5289"]],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]];for(var i=0;i<allCountries.length;i++){var c=allCountries[i];allCountries[i]={name:c[0],iso2:c[1],dialCode:c[2],priority:c[3]||0,areaCodes:c[4]||null};}"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
1027function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
1028function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
1029var intlTelInputGlobals={getInstance:function getInstance(input){var id=input.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[id];},instances:{},documentReady:function documentReady(){return document.readyState==="complete";}};if(typeof window==="object")window.intlTelInputGlobals=intlTelInputGlobals;var id=0;var defaults={allowDropdown:true,autoHideDialCode:true,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:true,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:true,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:false,utilsScript:""};var regionlessNanpNumbers=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];
1029var forEachProp=function forEachProp(obj,callback){var keys=Object.keys(obj);for(var i=0;i<keys.length;i++){callback(keys[i],obj[keys[i]]);}};var forEachInstance=function forEachInstance(method){forEachProp(window.intlTelInputGlobals.instances,function(key){window.intlTelInputGlobals.instances[key][method]();});};var Iti=function(){function Iti(input,options){var _this=this;_classCallCheck(this,Iti);this.id=id++;this.telInput=input;this.activeItem=null;this.highlightedItem=null;var customOptions=options||{};this.options={};forEachProp(defaults,function(key,value){_this.options[key]=customOptions.hasOwnProperty(key)?customOptions[key]:value;});this.hadInitialPlaceholder=Boolean(input.getAttribute("placeholder"));}
1030_createClass(Iti,[{key:"_init",value:function _init(){var _this2=this;if(this.options.nationalMode)this.options.autoHideDialCode=false;if(this.options.separateDialCode){this.options.autoHideDialCode=this.options.nationalMode=false;}
1031this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);if(this.isMobile){document.body.classList.add("iti-mobile");if(!this.options.dropdownContainer)this.options.dropdownContainer=document.body;}
1032if(typeof Promise!=="undefined"){var autoCountryPromise=new Promise(function(resolve,reject){_this2.resolveAutoCountryPromise=resolve;_this2.rejectAutoCountryPromise=reject;});var utilsScriptPromise=new Promise(function(resolve,reject){_this2.resolveUtilsScriptPromise=resolve;_this2.rejectUtilsScriptPromise=reject;});this.promise=Promise.all([autoCountryPromise,utilsScriptPromise]);}else{this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){};this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};}
1033this.selectedCountryData={};this._processCountryData();this._generateMarkup();this._setInitialState();this._initListeners();this._initRequests();}},{key:"_processCountryData",value:function _processCountryData(){this._processAllCountries();this._processCountryCodes();this._processPreferredCountries();if(this.options.localizedCountries)this._translateCountriesByLocale();if(this.options.onlyCountries.length||this.options.localizedCountries){this.countries.sort(this._countryNameSort);}}},{key:"_addCountryCode",value:function _addCountryCode(iso2,countryCode,priority){if(countryCode.length>this.countryCodeMaxLen){this.countryCodeMaxLen=countryCode.length;}
1034if(!this.countryCodes.hasOwnProperty(countryCode)){this.countryCodes[countryCode]=[];}
1035for(var i=0;i<this.countryCodes[countryCode].length;i++){if(this.countryCodes[countryCode][i]===iso2)return;}
1036var index=priority!==undefined?priority:this.countryCodes[countryCode].length;this.countryCodes[countryCode][index]=iso2;}},{key:"_processAllCountries",value:function _processAllCountries(){if(this.options.onlyCountries.length){var lowerCaseOnlyCountries=this.options.onlyCountries.map(function(country){return country.toLowerCase();});this.countries=allCountries.filter(function(country){return lowerCaseOnlyCountries.indexOf(country.iso2)>-1;});}else if(this.options.excludeCountries.length){var lowerCaseExcludeCountries=this.options.excludeCountries.map(function(country){return country.toLowerCase();});this.countries=allCountries.filter(function(country){return lowerCaseExcludeCountries.indexOf(country.iso2)===-1;});}else{this.countries=allCountries;}}},{key:"_translateCountriesByLocale",value:function _translateCountriesByLocale(){for(var i=0;i<this.countries.length;i++){var iso=this.countries[i].iso2.toLowerCase();if(this.options.localizedCountries.hasOwnProperty(iso)){this.countries[i].name=this.options.localizedCountries[iso];}}}},{key:"_countryNameSort",value:function _countryNameSort(a,b){return a.name.localeCompare(b.name);}},{key:"_processCountryCodes",value:function _processCountryCodes(){this.countryCodeMaxLen=0;this.dialCodes={};this.countryCodes={};for(var i=0;i<this.countries.length;i++){var c=this.countries[i];if(!this.dialCodes[c.dialCode])this.dialCodes[c.dialCode]=true;this._addCountryCode(c.iso2,c.dialCode,c.priority);}
1037for(var _i=0;_i<this.countries.length;_i++){var _c=this.countries[_i];if(_c.areaCodes){var rootCountryCode=this.countryCodes[_c.dialCode][0];for(var j=0;j<_c.areaCodes.length;j++){var areaCode=_c.areaCodes[j];for(var k=1;k<areaCode.length;k++){var partialDialCode=_c.dialCode+areaCode.substr(0,k);this._addCountryCode(rootCountryCode,partialDialCode);this._addCountryCode(_c.iso2,partialDialCode);}
1038this._addCountryCode(_c.iso2,_c.dialCode+areaCode);}}}}},{key:"_processPreferredCountries",value:function _processPreferredCountries(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var countryCode=this.options.preferredCountries[i].toLowerCase();var countryData=this._getCountryData(countryCode,false,true);if(countryData)this.preferredCountries.push(countryData);}}},{key:"_createEl",value:function _createEl(name,attrs,container){var el=document.createElement(name);if(attrs)forEachProp(attrs,function(key,value){return el.setAttribute(key,value);});if(container)container.appendChild(el);return el;}},{key:"_generateMarkup",value:function _generateMarkup(){if(!this.telInput.hasAttribute("autocomplete")&&!(this.telInput.form&&this.telInput.form.hasAttribute("autocomplete"))){this.telInput.setAttribute("autocomplete","off");}
1039var parentClass="iti";if(this.options.allowDropdown)parentClass+=" iti--allow-dropdown";if(this.options.separateDialCode)parentClass+=" iti--separate-dial-code";if(this.options.customContainer){parentClass+=" ";parentClass+=this.options.customContainer;}
1040var wrapper=this._createEl("div",{"class":parentClass});this.telInput.parentNode.insertBefore(wrapper,this.telInput);this.flagsContainer=this._createEl("div",{"class":"iti__flag-container"},wrapper);wrapper.appendChild(this.telInput);this.selectedFlag=this._createEl("div",{"class":"iti__selected-flag",role:"combobox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false"},this.flagsContainer);this.selectedFlagInner=this._createEl("div",{"class":"iti__flag"},this.selectedFlag);if(this.options.separateDialCode){this.selectedDialCode=this._createEl("div",{"class":"iti__selected-dial-code"},this.selectedFlag);}
1041if(this.options.allowDropdown){this.selectedFlag.setAttribute("tabindex","0");this.dropdownArrow=this._createEl("div",{"class":"iti__arrow"},this.selectedFlag);this.countryList=this._createEl("ul",{"class":"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"});if(this.preferredCountries.length){this._appendListItems(this.preferredCountries,"iti__preferred",true);this._createEl("li",{"class":"iti__divider",role:"separator","aria-disabled":"true"},this.countryList);}
1042this._appendListItems(this.countries,"iti__standard");if(this.options.dropdownContainer){this.dropdown=this._createEl("div",{"class":"iti iti--container"});this.dropdown.appendChild(this.countryList);}else{this.flagsContainer.appendChild(this.countryList);}}
1043if(this.options.hiddenInput){var hiddenInputName=this.options.hiddenInput;var name=this.telInput.getAttribute("name");if(name){var i=name.lastIndexOf("[");if(i!==-1)hiddenInputName="".concat(name.substr(0,i),"[").concat(hiddenInputName,"]");}
1044this.hiddenInput=this._createEl("input",{type:"hidden",name:hiddenInputName});wrapper.appendChild(this.hiddenInput);}}},{key:"_appendListItems",value:function _appendListItems(countries,className,preferred){var tmp="";for(var i=0;i<countries.length;i++){var c=countries[i];var idSuffix=preferred?"-preferred":"";tmp+="<li class='iti__country ".concat(className,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(c.iso2).concat(idSuffix,"' role='option' data-dial-code='").concat(c.dialCode,"' data-country-code='").concat(c.iso2,"' aria-selected='false'>");tmp+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2,"'></div></div>");tmp+="<span class='iti__country-name'>".concat(c.name,"</span>");tmp+="<span class='iti__dial-code'>+".concat(c.dialCode,"</span>");tmp+="</li>";}
1045this.countryList.insertAdjacentHTML("beforeend",tmp);}},{key:"_setInitialState",value:function _setInitialState(){var val=this.telInput.value;var dialCode=this._getDialCode(val);var isRegionlessNanp=this._isRegionlessNanp(val);var _this$options=this.options,initialCountry=_this$options.initialCountry,nationalMode=_this$options.nationalMode,autoHideDialCode=_this$options.autoHideDialCode,separateDialCode=_this$options.separateDialCode;
1045if(dialCode&&!isRegionlessNanp){this._updateFlagFromNumber(val);}else if(initialCountry!=="auto"){if(initialCountry){this._setFlag(initialCountry.toLowerCase());}else{if(dialCode&&isRegionlessNanp){this._setFlag("us");}else{this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2;if(!val){this._setFlag(this.defaultCountry);}}}
1046if(!val&&!nationalMode&&!autoHideDialCode&&!separateDialCode){this.telInput.value="+".concat(this.selectedCountryData.dialCode);}}
1047if(val)this._updateValFromNumber(val);}},{key:"_initListeners",value:function _initListeners(){this._initKeyListeners();if(this.options.autoHideDialCode)this._initBlurListeners();if(this.options.allowDropdown)this._initDropdownListeners();if(this.hiddenInput)this._initHiddenInputListener();}},{key:"_initHiddenInputListener",value:function _initHiddenInputListener(){var _this3=this;this._handleHiddenInputSubmit=function(){_this3.hiddenInput.value=_this3.getNumber();};if(this.telInput.form)this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit);}},{key:"_getClosestLabel",value:function _getClosestLabel(){var el=this.telInput;while(el&&el.tagName!=="LABEL"){el=el.parentNode;}
1048return el;}},{key:"_initDropdownListeners",value:function _initDropdownListeners(){var _this4=this;this._handleLabelClick=function(e){if(_this4.countryList.classList.contains("iti__hide"))_this4.telInput.focus();else e.preventDefault();};var label=this._getClosestLabel();if(label)label.addEventListener("click",this._handleLabelClick);this._handleClickSelectedFlag=function(){if(_this4.countryList.classList.contains("iti__hide")&&!_this4.telInput.disabled&&!_this4.telInput.readOnly){_this4._showDropdown();}};this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag);this._handleFlagsContainerKeydown=function(e){var isDropdownHidden=_this4.countryList.classList.contains("iti__hide");if(isDropdownHidden&&["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(e.key)!==-1){e.preventDefault();e.stopPropagation();_this4._showDropdown();}
1049if(e.key==="Tab")_this4._closeDropdown();};this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown);}},{key:"_initRequests",value:function _initRequests(){var _this5=this;if(this.options.utilsScript&&!window.intlTelInputUtils){if(window.intlTelInputGlobals.documentReady()){window.intlTelInputGlobals.loadUtils(this.options.utilsScript);}else{window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(_this5.options.utilsScript);});}}else this.resolveUtilsScriptPromise();if(this.options.initialCountry==="auto")this._loadAutoCountry();else this.resolveAutoCountryPromise();}},{key:"_loadAutoCountry",value:function _loadAutoCountry(){if(window.intlTelInputGlobals.autoCountry){this.handleAutoCountry();}else if(!window.intlTelInputGlobals.startedLoadingAutoCountry){window.intlTelInputGlobals.startedLoadingAutoCountry=true;if(typeof this.options.geoIpLookup==="function"){this.options.geoIpLookup(function(countryCode){window.intlTelInputGlobals.autoCountry=countryCode.toLowerCase();setTimeout(function(){return forEachInstance("handleAutoCountry");});},function(){return forEachInstance("rejectAutoCountryPromise");});}}}},{key:"_initKeyListeners",value:function _initKeyListeners(){var _this6=this;this._handleKeyupEvent=function(){if(_this6._updateFlagFromNumber(_this6.telInput.value)){_this6._triggerCountryChange();}};this.telInput.addEventListener("keyup",this._handleKeyupEvent);this._handleClipboardEvent=function(){setTimeout(_this6._handleKeyupEvent);};this.telInput.addEventListener("cut",this._handleClipboardEvent);this.telInput.addEventListener("paste",this._handleClipboardEvent);}},{key:"_cap",value:function _cap(number){var max=this.telInput.getAttribute("maxlength");return max&&number.length>max?number.substr(0,max):number;}},{key:"_initBlurListeners",value:function _initBlurListeners(){var _this7=this;this._handleSubmitOrBlurEvent=function(){_this7._removeEmptyDialCode();};if(this.telInput.form)this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent);this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent);}},{key:"_removeEmptyDialCode",value:function _removeEmptyDialCode(){if(this.telInput.value.charAt(0)==="
1049+"){var numeric=this._getNumeric(this.telInput.value);if(!numeric||this.selectedCountryData.dialCode===numeric){this.telInput.value="";}}}},{key:"_getNumeric",value:function _getNumeric(s){return s.replace(/\D/g,"");}},{key:"_trigger",value:function _trigger(name){var e=document.createEvent("Event");e.initEvent(name,true,true);this.telInput.dispatchEvent(e);}},{key:"_showDropdown",value:function _showDropdown(){this.countryList.classList.remove("iti__hide");this.selectedFlag.setAttribute("aria-expanded","true");this._setDropdownPosition();if(this.activeItem){this._highlightListItem(this.activeItem,false);this._scrollTo(this.activeItem,true);}
1050this._bindDropdownListeners();this.dropdownArrow.classList.add("iti__arrow--up");this._trigger("open:countrydropdown");}},{key:"_toggleClass",value:function _toggleClass(el,className,shouldHaveClass){if(shouldHaveClass&&!el.classList.contains(className))el.classList.add(className);else if(!shouldHaveClass&&el.classList.contains(className))el.classList.remove(className);}},{key:"_setDropdownPosition",value:function _setDropdownPosition(){var _this8=this;if(this.options.dropdownContainer){this.options.dropdownContainer.appendChild(this.dropdown);}
1051if(!this.isMobile){var pos=this.telInput.getBoundingClientRect();var windowTop=window.pageYOffset||document.documentElement.scrollTop;var inputTop=pos.top+windowTop;var dropdownHeight=this.countryList.offsetHeight;var dropdownFitsBelow=inputTop+this.telInput.offsetHeight+dropdownHeight<windowTop+window.innerHeight;var dropdownFitsAbove=inputTop-dropdownHeight>windowTop;this._toggleClass(this.countryList,"iti__country-list--dropup",!dropdownFitsBelow&&dropdownFitsAbove);if(this.options.dropdownContainer){var extraTop=!dropdownFitsBelow&&dropdownFitsAbove?0:this.telInput.offsetHeight;this.dropdown.style.top="".concat(inputTop+extraTop,"px");this.dropdown.style.left="".concat(pos.left+document.body.scrollLeft,"px");this._handleWindowScroll=function(){return _this8._closeDropdown();};window.addEventListener("scroll",this._handleWindowScroll);}}}},{key:"_getClosestListItem",value:function _getClosestListItem(target){var el=target;while(el&&el!==this.countryList&&!el.classList.contains("iti__country")){el=el.parentNode;}
1052return el===this.countryList?null:el;}},{key:"_bindDropdownListeners",value:function _bindDropdownListeners(){var _this9=this;this._handleMouseoverCountryList=function(e){var listItem=_this9._getClosestListItem(e.target);if(listItem)_this9._highlightListItem(listItem,false);};this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList);this._handleClickCountryList=function(e){var listItem=_this9._getClosestListItem(e.target);if(listItem)_this9._selectListItem(listItem);};this.countryList.addEventListener("click",this._handleClickCountryList);var isOpening=true;this._handleClickOffToClose=function(){if(!isOpening)_this9._closeDropdown();isOpening=false;};document.documentElement.addEventListener("click",this._handleClickOffToClose);var query="";var queryTimer=null;this._handleKeydownOnDropdown=function(e){e.preventDefault();if(e.key==="ArrowUp"||e.key==="Up"||e.key==="ArrowDown"||e.key==="Down")_this9._handleUpDownKey(e.key);else if(e.key==="Enter")_this9._handleEnterKey();else if(e.key==="Escape")_this9._closeDropdown();else if(/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)){if(queryTimer)clearTimeout(queryTimer);query+=e.key.toLowerCase();_this9._searchForCountry(query);queryTimer=setTimeout(function(){query="";},1e3);}};document.addEventListener("keydown",this._handleKeydownOnDropdown);}},{key:"_handleUpDownKey",value:function _handleUpDownKey(key){var next=key==="ArrowUp"||key==="Up"?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;if(next){if(next.classList.contains("iti__divider")){next=key==="ArrowUp"||key==="Up"?next.previousElementSibling:next.nextElementSibling;}
1053this._highlightListItem(next,true);}}},{key:"_handleEnterKey",value:function _handleEnterKey(){if(this.highlightedItem)this._selectListItem(this.highlightedItem);}},{key:"_searchForCountry",value:function _searchForCountry(query){for(var i=0;i<this.countries.length;i++){if(this._startsWith(this.countries[i].name,query)){var listItem=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(this.countries[i].iso2));
1053this._highlightListItem(listItem,false);this._scrollTo(listItem,true);break;}}}},{key:"_startsWith",value:function _startsWith(a,b){return a.substr(0,b.length).toLowerCase()===b;}},{key:"_updateValFromNumber",value:function _updateValFromNumber(originalNumber){var number=originalNumber;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var useNational=!this.options.separateDialCode&&(this.options.nationalMode||number.charAt(0)!=="+");var _intlTelInputUtils$nu=intlTelInputUtils.numberFormat,NATIONAL=_intlTelInputUtils$nu.NATIONAL,INTERNATIONAL=_intlTelInputUtils$nu.INTERNATIONAL;var format=useNational?NATIONAL:INTERNATIONAL;number=intlTelInputUtils.formatNumber(number,this.selectedCountryData.iso2,format);}
1054number=this._beforeSetNumber(number);this.telInput.value=number;}},{key:"_updateFlagFromNumber",value:function _updateFlagFromNumber(originalNumber){var number=originalNumber;var selectedDialCode=this.selectedCountryData.dialCode;var isNanp=selectedDialCode==="1";if(number&&this.options.nationalMode&&isNanp&&number.charAt(0)!=="+"){if(number.charAt(0)!=="1")number="1".concat(number);number="+".concat(number);}
1055if(this.options.separateDialCode&&selectedDialCode&&number.charAt(0)!=="+"){number="+".concat(selectedDialCode).concat(number);}
1056var dialCode=this._getDialCode(number,true);var numeric=this._getNumeric(number);var countryCode=null;if(dialCode){var countryCodes=this.countryCodes[this._getNumeric(dialCode)];var alreadySelected=countryCodes.indexOf(this.selectedCountryData.iso2)!==-1&&numeric.length<=dialCode.length-1;var isRegionlessNanpNumber=selectedDialCode==="1"&&this._isRegionlessNanp(numeric);if(!isRegionlessNanpNumber&&!alreadySelected){for(var j=0;j<countryCodes.length;j++){if(countryCodes[j]){countryCode=countryCodes[j];break;}}}}else if(number.charAt(0)==="+"&&numeric.length){countryCode="";}else if(!number||number==="+"){countryCode=this.defaultCountry;}
1057if(countryCode!==null){return this._setFlag(countryCode);}
1058return false;}},{key:"_isRegionlessNanp",value:function _isRegionlessNanp(number){var numeric=this._getNumeric(number);if(numeric.charAt(0)==="1"){var areaCode=numeric.substr(1,3);return regionlessNanpNumbers.indexOf(areaCode)!==-1;}
1059return false;}},{key:"_highlightListItem",value:function _highlightListItem(listItem,shouldFocus){var prevItem=this.highlightedItem;if(prevItem)prevItem.classList.remove("iti__highlight");this.highlightedItem=listItem;this.highlightedItem.classList.add("iti__highlight");if(shouldFocus)this.highlightedItem.focus();}},{key:"_getCountryData",value:function _getCountryData(countryCode,ignoreOnlyCountriesOption,allowFail){var countryList=ignoreOnlyCountriesOption?allCountries:this.countries;for(var i=0;i<countryList.length;i++){if(countryList[i].iso2===countryCode){return countryList[i];}}
1060if(allowFail){return null;}
1061throw new Error("No country data for '".concat(countryCode,"'"));}},{key:"_setFlag",value:function _setFlag(countryCode){var prevCountry=this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=countryCode?this._getCountryData(countryCode,false,false):{};if(this.selectedCountryData.iso2){this.defaultCountry=this.selectedCountryData.iso2;}
1062this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(countryCode));var title=countryCode?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):"Unknown";this.selectedFlag.setAttribute("title",title);if(this.options.separateDialCode){var dialCode=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=dialCode;var selectedFlagWidth=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.telInput.style.paddingLeft="".concat(selectedFlagWidth+6,"px");}
1063this._updatePlaceholder();if(this.options.allowDropdown){var prevItem=this.activeItem;if(prevItem){prevItem.classList.remove("iti__active");prevItem.setAttribute("aria-selected","false");}
1064if(countryCode){var nextItem=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(countryCode,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(countryCode));nextItem.setAttribute("aria-selected","true");nextItem.classList.add("iti__active");this.activeItem=nextItem;this.selectedFlag.setAttribute("aria-activedescendant",nextItem.getAttribute("id"));}}
1065return prevCountry.iso2!==countryCode;}},{key:"_getHiddenSelectedFlagWidth",value:function _getHiddenSelectedFlagWidth(){var containerClone=this.telInput.parentNode.cloneNode();containerClone.style.visibility="hidden";document.body.appendChild(containerClone);var flagsContainerClone=this.flagsContainer.cloneNode();containerClone.appendChild(flagsContainerClone);var selectedFlagClone=this.selectedFlag.cloneNode(true);flagsContainerClone.appendChild(selectedFlagClone);var width=selectedFlagClone.offsetWidth;containerClone.parentNode.removeChild(containerClone);return width;}},{key:"_updatePlaceholder",value:function _updatePlaceholder(){var shouldSetPlaceholder=this.options.autoPlaceholder==="aggressive"||!this.hadInitialPlaceholder&&this.options.autoPlaceholder==="polite";if(window.intlTelInputUtils&&shouldSetPlaceholder){var numberType=intlTelInputUtils.numberType[this.options.placeholderNumberType];var placeholder=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,numberType):"";placeholder=this._beforeSetNumber(placeholder);if(typeof this.options.customPlaceholder==="function"){placeholder=this.options.customPlaceholder(placeholder,this.selectedCountryData);}
1066this.telInput.setAttribute("placeholder",placeholder);}}},{key:"_selectListItem",value:function _selectListItem(listItem){var flagChanged=this._setFlag(listItem.getAttribute("data-country-code"));this._closeDropdown();this._updateDialCode(listItem.getAttribute("data-dial-code"),true);this.telInput.focus();var len=this.telInput.value.length;this.telInput.setSelectionRange(len,len);if(flagChanged){this._triggerCountryChange();}}},{key:"_closeDropdown",value:function _closeDropdown(){this.countryList.classList.add("iti__hide");
1066this.selectedFlag.setAttribute("aria-expanded","false");this.dropdownArrow.classList.remove("iti__arrow--up");document.removeEventListener("keydown",this._handleKeydownOnDropdown);document.documentElement.removeEventListener("click",this._handleClickOffToClose);this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList);this.countryList.removeEventListener("click",this._handleClickCountryList);if(this.options.dropdownContainer){if(!this.isMobile)window.removeEventListener("scroll",this._handleWindowScroll);if(this.dropdown.parentNode)this.dropdown.parentNode.removeChild(this.dropdown);}
1067this._trigger("close:countrydropdown");}},{key:"_scrollTo",value:function _scrollTo(element,middle){var container=this.countryList;var windowTop=window.pageYOffset||document.documentElement.scrollTop;var containerHeight=container.offsetHeight;var containerTop=container.getBoundingClientRect().top+windowTop;var containerBottom=containerTop+containerHeight;var elementHeight=element.offsetHeight;var elementTop=element.getBoundingClientRect().top+windowTop;var elementBottom=elementTop+elementHeight;var newScrollTop=elementTop-containerTop+container.scrollTop;var middleOffset=containerHeight/2-elementHeight/2;if(elementTop<containerTop){if(middle)newScrollTop-=middleOffset;container.scrollTop=newScrollTop;}else if(elementBottom>containerBottom){if(middle)newScrollTop+=middleOffset;var heightDifference=containerHeight-elementHeight;container.scrollTop=newScrollTop-heightDifference;}}},{key:"_updateDialCode",value:function _updateDialCode(newDialCodeBare,hasSelectedListItem){var inputVal=this.telInput.value;var newDialCode="+".concat(newDialCodeBare);var newNumber;if(inputVal.charAt(0)==="+"){var prevDialCode=this._getDialCode(inputVal);if(prevDialCode){newNumber=inputVal.replace(prevDialCode,newDialCode);}else{newNumber=newDialCode;}}else if(this.options.nationalMode||this.options.separateDialCode){return;}else{if(inputVal){newNumber=newDialCode+inputVal;}else if(hasSelectedListItem||!this.options.autoHideDialCode){newNumber=newDialCode;}else{return;}}
1068this.telInput.value=newNumber;}},{key:"_getDialCode",value:function _getDialCode(number,includeAreaCode){var dialCode="";if(number.charAt(0)==="+"){var numericChars="";for(var i=0;i<number.length;i++){var c=number.charAt(i);if(!isNaN(parseInt(c,10))){numericChars+=c;if(includeAreaCode){if(this.countryCodes[numericChars]){dialCode=number.substr(0,i+1);}}else{if(this.dialCodes[numericChars]){dialCode=number.substr(0,i+1);break;}}
1069if(numericChars.length===this.countryCodeMaxLen){break;}}}}
1070return dialCode;}},{key:"_getFullNumber",value:function _getFullNumber(){var val=this.telInput.value.trim();var dialCode=this.selectedCountryData.dialCode;var prefix;var numericVal=this._getNumeric(val);if(this.options.separateDialCode&&val.charAt(0)!=="+"&&dialCode&&numericVal){prefix="+".concat(dialCode);}else{prefix="";}
1071return prefix+val;}},{key:"_beforeSetNumber",value:function _beforeSetNumber(originalNumber){var number=originalNumber;if(this.options.separateDialCode){var dialCode=this._getDialCode(number);if(dialCode){dialCode="+".concat(this.selectedCountryData.dialCode);var start=number[dialCode.length]===" "||number[dialCode.length]==="-"?dialCode.length+1:dialCode.length;number=number.substr(start);}}
1072return this._cap(number);}},{key:"_triggerCountryChange",value:function _triggerCountryChange(){this._trigger("countrychange");}},{key:"handleAutoCountry",value:function handleAutoCountry(){if(this.options.initialCountry==="auto"){this.defaultCountry=window.intlTelInputGlobals.autoCountry;if(!this.telInput.value){this.setCountry(this.defaultCountry);}
1073this.resolveAutoCountryPromise();}}},{key:"handleUtils",value:function handleUtils(){if(window.intlTelInputUtils){if(this.telInput.value){this._updateValFromNumber(this.telInput.value);}
1074this._updatePlaceholder();}
1075this.resolveUtilsScriptPromise();}},{key:"destroy",value:function destroy(){var form=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown();this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag);this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var label=this._getClosestLabel();if(label)label.removeEventListener("click",this._handleLabelClick);}
1076if(this.hiddenInput&&form)form.removeEventListener("submit",this._handleHiddenInputSubmit);if(this.options.autoHideDialCode){if(form)form.removeEventListener("submit",this._handleSubmitOrBlurEvent);this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent);}
1077this.telInput.removeEventListener("keyup",this._handleKeyupEvent);this.telInput.removeEventListener("cut",this._handleClipboardEvent);this.telInput.removeEventListener("paste",this._handleClipboardEvent);this.telInput.removeAttribute("data-intl-tel-input-id");var wrapper=this.telInput.parentNode;wrapper.parentNode.insertBefore(this.telInput,wrapper);wrapper.parentNode.removeChild(wrapper);delete window.intlTelInputGlobals.instances[this.id];}},{key:"getExtension",value:function getExtension(){if(window.intlTelInputUtils){return intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2);}
1078return"";}},{key:"getNumber",value:function getNumber(format){if(window.intlTelInputUtils){var iso2=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),iso2,format);}
1079var val=this.telInput.value.trim();var dialCode=this.selectedCountryData.dialCode;var prefix;var numericVal=this._getNumeric(val);if(val.charAt(0)!=="+"&&dialCode&&numericVal){prefix="+".concat(dialCode);}else{prefix="";}
1080return prefix+val;}}
1080,{key:"getNumberType",value:function getNumberType(){if(window.intlTelInputUtils){return intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2);}
1081return-99;}},{key:"getSelectedCountryData",value:function getSelectedCountryData(){return this.selectedCountryData;}},{key:"getValidationError",value:function getValidationError(){if(window.intlTelInputUtils){var iso2=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),iso2);}
1082return-99;}},{key:"isValidNumber",value:function isValidNumber(){var val=this._getFullNumber().trim();var countryCode=this.options.nationalMode?this.selectedCountryData.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(val,countryCode):null;}},{key:"setCountry",value:function setCountry(originalCountryCode){var countryCode=originalCountryCode.toLowerCase();if(!this.selectedFlagInner.classList.contains("iti__".concat(countryCode))){this._setFlag(countryCode);this._updateDialCode(this.selectedCountryData.dialCode,false);this._triggerCountryChange();}}},{key:"setNumber",value:function setNumber(number){var flagChanged=this._updateFlagFromNumber(number);this._updateValFromNumber(number);if(flagChanged){this._triggerCountryChange();}}},{key:"setPlaceholderNumberType",value:function setPlaceholderNumberType(type){this.options.placeholderNumberType=type;this._updatePlaceholder();}}]);return Iti;}();intlTelInputGlobals.getCountryData=function(){return allCountries;};var injectScript=function injectScript(path,handleSuccess,handleFailure){var script=document.createElement("script");script.onload=function(){forEachInstance("handleUtils");if(handleSuccess)handleSuccess();};script.onerror=function(){forEachInstance("rejectUtilsScriptPromise");if(handleFailure)handleFailure();};script.className="iti-load-utils";script.async=true;script.src=path;document.body.appendChild(script);};intlTelInputGlobals.loadUtils=function(path){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){window.intlTelInputGlobals.startedLoadingUtilsScript=true;if(typeof Promise!=="undefined"){return new Promise(function(resolve,reject){return injectScript(path,resolve,reject);});}
1083injectScript(path);}
1084return null;};intlTelInputGlobals.defaults=defaults;intlTelInputGlobals.version="17.0.8";var pluginName="intlTelInput";$.fn[pluginName]=function(options){var args=arguments;if(options===undefined||typeof options==="object"){return this.each(function(){if(!$.data(this,"plugin_"+pluginName)){var iti=new Iti(this,options);iti._init();window.intlTelInputGlobals.instances[iti.id]=iti;$.data(this,"plugin_"+pluginName,iti);}});}else if(typeof options==="string"&&options[0]!=="_"){var returns;this.each(function(){var instance=$.data(this,"plugin_"+pluginName);if(instance instanceof Iti&&typeof instance[options]==="function"){returns=instance[options].apply(instance,Array.prototype.slice.call(args,1));}
1085if(options==="destroy")$.data(this,"plugin_"+pluginName,null);});
1085return returns!==undefined?returns:this;}};});
1086;/*!
1087  * PhotoSwipe 5.4.4 - https://photoswipe.com
1088  * (c) 2024 Dmytro Semenov
1089  */
1090!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).PhotoSwipe=i()}(this,(function(){"use strict";
vendor: 38,078 bytes, line 1090
1090function t(t,i,s){const h=document.createElement(i);return t&&(h.className=t),s&&s.appendChild(h),h}function i(t,i){return t.x=i.x,t.y=i.y,void 0!==i.id&&(t.id=i.id),t}function s(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function h(t,i){const s=Math.abs(t.x-i.x),h=Math.abs(t.y-i.y);return Math.sqrt(s*s+h*h)}function e(t,i){return t.x===i.x&&t.y===i.y}function n(t,i,s){return Math.min(Math.max(t,i),s)}function o(t,i,s){let h=`translate3d(${t}px,${i||0}px,0)`;return void 0!==s&&(h+=` scale3d(${s},${s},1)`),h}function r(t,i,s,h){t.style.transform=o(i,s,h)}function a(t,i,s,h){t.style.transition=i?`${i} ${s}ms ${h||"cubic-bezier(.4,0,.22,1)"}`:"none"}function l(t,i,s){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof s?`${s}px`:s}const c="idle",d="loading",u="loaded",p="error";function m(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}let v=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{v=!0}}))}catch(t){}class f{constructor(){this.t=[]}add(t,i,s,h){this.i(t,i,s,h)}remove(t,i,s,h){this.i(t,i,s,h,!0)}removeAll(){this.t.forEach((t=>{this.i(t.target,t.type,t.listener,t.passive,!0,!0)})),this.t=[]}i(t,i,s,h,e,n){if(!t)return;const o=e?"removeEventListener":"addEventListener";i.split(" ").forEach((i=>{if(i){n||(e?this.t=this.t.filter((h=>h.type!==i||h.listener!==s||h.target!==t)):this.t.push({target:t,type:i,listener:s,passive:h}));const r=!!v&&{passive:h||!1};t[o](i,s,r)}}))}}function w(t,i){if(t.getViewportSizeFn){const s=t.getViewportSizeFn(t,i);if(s)return s}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function g(t,i,s,h,e){let n=0;if(i.paddingFn)n=i.paddingFn(s,h,e)[t];else if(i.padding)n=i.padding[t];else{const s="padding"+t[0].toUpperCase()+t.slice(1);i[s]&&(n=i[s])}return Number(n)||0}function y(t,i,s,h){return{x:i.x-g("left",t,i,s,h)-g("right",t,i,s,h),y:i.y-g("top",t,i,s,h)-g("bottom",t,i,s,h)}}class _{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this.o("x"),this.o("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}o(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,h=g("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),e=this.slide.panAreaSize[t];this.center[t]=Math.round((e-s)/2)+h,this.max[t]=s>e?Math.round(e-s)+h:this.center[t],this.min[t]=s>e?h:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return n(i,this.max[t],this.min[t])}}class x{constructor(t,i,s,h){this.pswp=h,this.options=t,this.itemData=i,this.index=s,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,s){const h={x:t,y:i};this.elementSize=h,this.panAreaSize=s;const e=s.x/h.x,n=s.y/h.y;this.fit=Math.min(1,e<n?e:n),this.fill=Math.min(1,e>n?e:n),this.vFill=Math.min(1,n),this.initial=this.l(),this.secondary=this.u(),this.max=Math.max(this.initial,this.secondary,this.p()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}m(t){const i=t+"ZoomLevel",s=this.options[i];if(s)return"function"==typeof s?s(this):"fill"===s?this.fill:"fit"===s?this.fit:Number(s)}u(){let t=this.m("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}l(){return this.m("initial")||this.fit}p(){return this.m("max")||Math.max(1,4*this.fit)}}class b{constructor(i,s,h){this.data=i,this.index=s,this.pswp=h,this.isActive=s===h.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!h.opener.isOpen,this.zoomLevels=new x(h.options,i,s,h),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:s}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=t("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new _(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,h=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(s,h)||t)&&this.content.setDisplayedSize(s,h)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){var t;return null===(t=this.content.placeholder)||void 0===t?void 0:t.element}zoomTo(t,i,h,e){const{pswp:o}=this;if(!this.isZoomable()||o.mainScroll.isShifted())return;o.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:h}),o.animations.stopAllPan();const r=this.currZoomLevel;e||(t=n(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,r),this.pan.y=this.calculateZoomToPanOffset("y",i,r),s(this.pan);const a=()=>{this.v(t),this.applyCurrentZoomPan()};h?o.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:h,easing:o.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(0===this.bounds.max[t]-this.bounds.min[t])return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const h=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*h+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this.g(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),i(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}g(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,r(this.container,t,i,s)}calculateSize(){const{pswp:t}=this;i(this.panAreaSize,y(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return o(this.pan.x,this.pan.y,t)}v(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}class S{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&i(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:h}=this.gestures,{currSlide:e}=this.pswp;if("y"===h&&this.pswp.options.closeOnVerticalDrag&&e&&e.currZoomLevel<=e.zoomLevels.fit&&!this.gestures.isMultitouch){const s=e.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:s}).defaultPrevented){this._("y",s,.6);const t=1-Math.abs(this.S(e.pan.y));this.pswp.applyBgOpacity(t),e.applyCurrentZoomPan()}}else{this.M("x")||(this.M("y"),e&&(s(e.pan),e.applyCurrentZoomPan()))}}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let h=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(h=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(h=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(h,!0,t.x)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this.P("x"),this.P("y"))}P(t){const{velocity:i}=this.gestures,{currSlide:s}=this.pswp;if(!s)return;const{pan:h,bounds:e}=s,o=h[t],r=this.pswp.bgOpacity<1&&"y"===t,a=o+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this.S(o),i=this.S(a);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const l=e.correctPan(t,a);if(o===l)return;const c=l===a?1:.82,d=this.pswp.bgOpacity,u=l-o;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:o,end:l,velocity:i[t],dampingRatio:c,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(l-i)/u;this.pswp.applyBgOpacity(n(d+(1-d)*t,0,1))}h[t]=Math.floor(i),s.applyCurrentZoomPan()}})}M(t){const{p1:i,dragAxis:s,prevP1:h,isMultitouch:e}=this.gestures,{currSlide:n,mainScroll:o}=this.pswp,r=i[t]-h[t],a=o.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!e)return o.moveTo(a,!0),!0;const{bounds:l}=n,c=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!e){const i=o.getCurrSlideX(),s=o.x-i,h=r>0,e=!h;if(c>l.min[t]&&h){if(l.min[t]<=this.startPan[t])return o.moveTo(a,!0),!0;this._(t,c)}else if(c<l.max[t]&&e){if(this.startPan[t]<=l.max[t])return o.moveTo(a,!0),!0;this._(t,c)}else if(0!==s){if(s>0)return o.moveTo(Math.max(a,i),!0),!0;if(s<0)return o.moveTo(Math.min(a,i),!0),!0}else this._(t,c)}else"y"===t&&(o.isShifted()||l.min.y===l.max.y)||this._(t,c);return!1}S(t){var i,s;return(t-(null!==(i=null===(s=this.pswp.currSlide)||void 0===s?void 0:s.bounds.center.y)&&void 0!==i?i:0))/(this.pswp.viewportSize.y/3)}_(t,i,s){const{currSlide:h}=this.pswp;if(!h)return;const{pan:e,bounds:n}=h;if(n.correctPan(t,i)!==i||s){const h=Math.round(i-e[t]);e[t]+=h*(s||.35)}else e[t]=i}}function z(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class M{constructor(t){this.gestures=t,this.C={x:0,y:0},this.T={x:0,y:0},this.A={x:0,y:0},this.D=!1,this.I=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this.I=t.currZoomLevel,i(this.C,t.pan)),this.gestures.pswp.animations.stopAllPan(),this.D=!1}change(){const{p1:t,startP1:i,p2:s,startP2:e,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const r=o.zoomLevels.min,a=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;z(this.T,i,e),z(this.A,t,s);let l=1/h(i,e)*h(t,s)*this.I;if(l>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this.D=!0),l<r)if(n.options.pinchToClose&&!this.D&&this.I<=o.zoomLevels.initial){const t=1-(r-l)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else l=r-.15*(r-l);else l>a&&(l=a+.05*(l-a));o.pan.x=this.L("x",l),o.pan.y=this.L("y",l),o.setZoomLevel(l),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this.D&&t.options.pinchToClose?t.close():this.correctZoomPan()}L(t,i){const s=i/this.I;return this.A[t]-(this.T[t]-this.C[t])*s}correctZoomPan(t){const{pswp:s}=this.gestures,{currSlide:h}=s;if(null==h||!h.isZoomable())return;0===this.A.x&&(t=!0);const o=h.currZoomLevel;let r,a=!0;o<h.zoomLevels.initial?r=h.zoomLevels.initial:o>h.zoomLevels.max?r=h.zoomLevels.max:(a=!1,r=o);const l=s.bgOpacity,c=s.bgOpacity<1,d=i({x:0,y:0},h.pan);let u=i({x:0,y:0},d);t&&(this.A.x=0,this.A.y=0,this.T.x=0,this.T.y=0,this.I=o,i(this.C,d)),a&&(u={x:this.L("x",r),y:this.L("y",r)}),h.setZoomLevel(r),u={x:h.bounds.correctPan("x",u.x),y:h.bounds.correctPan("y",u.y)},h.setZoomLevel(o);const p=!e(u,d);if(!p&&!a&&!c)return h.v(r),void h.applyCurrentZoomPan();s.animations.stopAllPan(),s.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,p||a){if(p&&(h.pan.x=d.x+(u.x-d.x)*t,h.pan.y=d.y+(u.y-d.y)*t),a){const i=o+(r-o)*t;h.setZoomLevel(i)}h.applyCurrentZoomPan()}c&&s.bgOpacity<1&&s.applyBgOpacity(n(l+(1-l)*t,0,1))},onComplete:()=>{h.v(r),h.applyCurrentZoomPan()}})}}function P(t){return!!t.target.closest(".pswp__container")}class C{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,h=s.contains("pswp__img"),e=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");h?this.k("imageClick",t,i):e&&this.k("bgClick",t,i)}tap(t,i){P(i)&&this.k("tap",t,i)}doubleTap(t,i){P(i)&&this.k("doubleTap",t,i)}k(t,i,s){var h;const{pswp:e}=this.gestures,{currSlide:n}=e,o=t+"Action",r=e.options[o];if(!e.dispatch(o,{point:i,originalEvent:s}).defaultPrevented)if("function"!=typeof r)switch(r){case"close":case"next":e[r]();break;case"zoom":null==n||n.toggleZoom(i);break;case"zoom-or-close":null!=n&&n.isZoomable()&&n.zoomLevels.secondary!==n.zoomLevels.initial?n.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":null===(h=this.gestures.pswp.element)||void 0===h||h.classList.toggle("pswp--ui-visible")}else r.call(e,i,s)}}class T{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this.Z={x:0,y:0},this.B={x:0,y:0},this.F=0,this.O=[],this.R="ontouchstart"in window,this.N=!!window.PointerEvent,this.supportsTouch=this.R||this.N&&navigator.maxTouchPoints>1,this.F=0,this.U=0,this.V=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this.G=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new S(this),this.zoomLevels=new M(this),this.tapHandler=new C(this),t.on("bindEvents",(()=>{t.events.add(t.scrollWrap,"click",this.$.bind(this)),this.N?this.q("pointer","down","up","cancel"):this.R?(this.q("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this.q("mouse","down","up")}))}q(t,i,s,h){const{pswp:e}=this,{events:n}=e,o=h?t+h:"";n.add(e.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),o&&n.add(e.scrollWrap,o,this.onPointerUp.bind(this))}onPointerDown(t){const s="mousedown"===t.type||"mouse"===t.pointerType;if(s&&t.button>0)return;const{pswp:h}=this;h.opener.isOpen?h.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(s&&(h.mouseDetected(),this.H(t,"down")),h.animations.stopAll(),this.K(t,"down"),1===this.F&&(this.dragAxis=null,i(this.startP1,this.p1)),this.F>1?(this.W(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this.H(t,"move"),this.F&&(this.K(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this.F||this.isDragging?this.F>1&&!this.isZooming&&(this.j(),this.isZooming=!0,this.X(),this.zoomLevels.start(),this.Y(),this.J()):(this.dragAxis||this.tt(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this.W(),this.X(),this.U=Date.now(),this.V=!1,i(this.B,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this.Y(),this.J()))))}j(){this.isDragging&&(this.isDragging=!1,this.V||this.it(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this.F&&(this.K(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this.F&&(this.Y(),this.isDragging?this.j():this.isZooming||this.isMultitouch||this.st(t)),this.F<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this.F&&(this.dragAxis=null,this.X()))))}J(){(this.isDragging||this.isZooming)&&(this.it(),this.isDragging?e(this.p1,this.prevP1)||this.drag.change():e(this.p1,this.prevP1)&&e(this.p2,this.prevP2)||this.zoomLevels.change(),this.ht(),this.raf=requestAnimationFrame(this.J.bind(this)))}it(t){const s=Date.now(),h=s-this.U;h<50&&!t||(this.velocity.x=this.et("x",h),this.velocity.y=this.et("y",h),this.U=s,i(this.B,this.p1),this.V=!0)}st(t){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const e=this.pswp.options.doubleTapAction?300:0;this.G?(this.W(),h(this.Z,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(i(this.Z,this.startP1),this.G=setTimeout((()=>{this.tapHandler.tap(this.startP1,t),this.W()}),e))}W(){this.G&&(clearTimeout(this.G),this.G=null)}et(t,i){const s=this.p1[t]-this.B[t];return Math.abs(s)>1&&i>5?s/i:0}Y(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}H(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}K(t,s){if(this.N){const h=t,e=this.O.findIndex((t=>t.id===h.pointerId));"up"===s&&e>-1?this.O.splice(e,1):"down"===s&&-1===e?this.O.push(this.nt(h,{x:0,y:0})):e>-1&&this.nt(h,this.O[e]),this.F=this.O.length,this.F>0&&i(this.p1,this.O[0]),this.F>1&&i(this.p2,this.O[1])}else{const i=t;this.F=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this.nt(i.touches[0],this.p1),this.F++,i.touches.length>1&&(this.nt(i.touches[1],this.p2),this.F++)):(this.nt(t,this.p1),"up"===s?this.F=0:this.F++)}}ht(){i(this.prevP1,this.p1),i(this.prevP2,this.p2)}X(){i(this.startP1,this.p1),i(this.startP2,this.p2),this.ht()}tt(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}nt(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}$(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this.ot=0,this.rt=0,this.lt=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),h=s!==this.slideWidth;h&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach(((i,s)=>{h&&r(i.el,(s+this.lt)*this.slideWidth),t&&i.slide&&i.slide.resize()}))}resetPosition(){this.ot=0,this.rt=0,this.slideWidth=0,this.lt=-1}appendHolders(){this.itemHolders=[];for(let i=0;i<3;i++){const s=t("pswp__item","div",this.pswp.container);s.setAttribute("role","group"),s.setAttribute("aria-roledescription","slide"),s.setAttribute("aria-hidden","true"),s.style.display=1===i?"block":"none",this.itemHolders.push({el:s})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:h}=this;let e=h.potentialIndex+t;const n=h.getNumItems();if(h.canLoop()){e=h.getLoopedIndex(e);const i=(t+n)%n;t=i<=n/2?i:i-n}else e<0?e=0:e>=n&&(e=n-1),t=e-h.potentialIndex;h.potentialIndex=e,this.ot-=t,h.animations.stopMainScroll();const o=this.getCurrSlideX();if(i){h.animations.startSpring({isMainScroll:!0,start:this.x,end:o,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),h.appendHeavy()}});let t=h.potentialIndex-h.currIndex;if(h.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(o),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this.ot}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:i}=this,s=this.rt-this.ot;if(!s)return;this.rt=this.ot,i.currIndex=i.potentialIndex;let h,e=Math.abs(s);e>=3&&(this.lt+=s+(s>0?-3:3),e=3,this.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.destroy(),t.slide=void 0})));for(let t=0;t<e;t++)s>0?(h=this.itemHolders.shift(),h&&(this.itemHolders[2]=h,this.lt++,r(h.el,(this.lt+2)*this.slideWidth),i.setContent(h,i.currIndex-e+t+2))):(h=this.itemHolders.pop(),h&&(this.itemHolders.unshift(h),this.lt--,r(h.el,this.lt*this.slideWidth),i.setContent(h,i.currIndex+e-t-2)));Math.abs(this.lt)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),i.animations.stopAllPan(),this.itemHolders.forEach(((t,i)=>{t.slide&&t.slide.setIsActive(1===i)})),i.currSlide=null===(t=this.itemHolders[1])||void 0===t?void 0:t.slide,i.contentLoader.updateLazy(s),i.currSlide&&i.currSlide.applyCurrentZoomPan(),i.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this.ot-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&r(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:null!=i&&i})}}const D={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},I=(t,i)=>i?t:D[t];class E{constructor(t){this.pswp=t,this.ct=!1,t.on("bindEvents",(()=>{t.options.trapFocus&&(t.options.initialPointerPos||this.dt(),t.events.add(document,"focusin",this.ut.bind(this))),t.events.add(document,"keydown",this.vt.bind(this))}));const i=document.activeElement;t.on("destroy",(()=>{t.options.returnFocus&&i&&this.ct&&i.focus()}))}dt(){!this.ct&&this.pswp.element&&(this.pswp.element.focus(),this.ct=!0)}vt(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(function(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}(t))return;let s,h,e=!1;const n="key"in t;switch(n?t.key:t.keyCode){case I("Escape",n):i.options.escKey&&(s="close");break;case I("z",n):s="toggleZoom";break;case I("ArrowLeft",n):h="x";break;case I("ArrowUp",n):h="y";break;case I("ArrowRight",n):h="x",e=!0;break;case I("ArrowDown",n):e=!0,h="y";break;case I("Tab",n):this.dt()}if(h){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===h&&i.getNumItems()>1?s=e?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[h]+=e?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}ut(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}const L="cubic-bezier(.4,0,.22,1)";class k{constructor(t){var i;this.props=t;const{target:s,onComplete:h,transform:e,onFinish:n=(()=>{}),duration:o=333,easing:r=L}=t;this.onFinish=n;const l=e?"transform":"opacity",c=null!==(i=t[l])&&void 0!==i?i:"";this.ft=s,this.wt=h,this.gt=!1,this.yt=this.yt.bind(this),this._t=setTimeout((()=>{a(s,l,o,r),this._t=setTimeout((()=>{s.addEventListener("transitionend",this.yt,!1),s.addEventListener("transitioncancel",this.yt,!1),this._t=setTimeout((()=>{this.xt()}),o+500),s.style[l]=c}),30)}),0)}yt(t){t.target===this.ft&&this.xt()}xt(){this.gt||(this.gt=!0,this.onFinish(),this.wt&&this.wt())}destroy(){this._t&&clearTimeout(this._t),a(this.ft),this.ft.removeEventListener("transitionend",this.yt,!1),this.ft.removeEventListener("transitioncancel",this.yt,!1),this.gt||this.xt()}}class Z{constructor(t,i,s){this.velocity=1e3*t,this.bt=i||.75,this.St=s||12,this.zt=this.St,this.bt<1&&(this.zt*=Math.sqrt(1-this.bt*this.bt))}easeFrame(t,i){let s,h=0;i/=1e3;const e=Math.E**(-this.bt*this.St*i);if(1===this.bt)s=this.velocity+this.St*t,h=(t+s*i)*e,this.velocity=h*-this.St+s*e;else if(this.bt<1){s=1/this.zt*(this.bt*this.St*t+this.velocity);const n=Math.cos(this.zt*i),o=Math.sin(this.zt*i);h=e*(t*n+s*o),this.velocity=h*-this.St*this.bt+e*(-this.zt*t*o+this.zt*s*n)}return h}}class B{constructor(t){this.props=t,this.Mt=0;const{start:i,end:s,velocity:h,onUpdate:e,onComplete:n,onFinish:o=(()=>{}),dampingRatio:r,naturalFrequency:a}=t;this.onFinish=o;const l=new Z(h,r,a);let c=Date.now(),d=i-s;const u=()=>{this.Mt&&(d=l.easeFrame(d,Date.now()-c),Math.abs(d)<1&&Math.abs(l.velocity)<50?(e(s),n&&n(),this.onFinish()):(c=Date.now(),e(d+s),this.Mt=requestAnimationFrame(u)))};this.Mt=requestAnimationFrame(u)}destroy(){this.Mt>=0&&cancelAnimationFrame(this.Mt),this.Mt=0}}class F{constructor(){this.activeAnimations=[]}startSpring(t){this.Pt(t,!0)}startTransition(t){this.Pt(t)}Pt(t,i){const s=i?new B(t):new k(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach((t=>{t.destroy()})),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter((t=>!t.props.isPan||(t.destroy(),!1)))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter((t=>!t.props.isMainScroll||(t.destroy(),!1)))}isPanRunning(){return this.activeAnimations.some((t=>t.props.isPan))}}class O{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this.Ct.bind(this))}Ct(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:h}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-h;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const e=i.currZoomLevel*s;i.zoomTo(e,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,h*=18),i.panTo(i.pan.x-s,i.pan.y-h))}}class R{constructor(i,s){var h;const e=s.name||s.className;let n=s.html;if(!1===i.options[e])return;"string"==typeof i.options[e+"SVG"]&&(n=i.options[e+"SVG"]),i.dispatch("uiElementCreate",{data:s});let o="";s.isButton?(o+="pswp__button ",o+=s.className||`pswp__button--${s.name}`):o+=s.className||`pswp__${s.name}`;let r=s.isButton?s.tagName||"button":s.tagName||"div";r=r.toLowerCase();const a=t(o,r);if(s.isButton){"button"===r&&(a.type="button");let{title:t}=s;const{ariaLabel:h}=s;"string"==typeof i.options[e+"Title"]&&(t=i.options[e+"Title"]),t&&(a.title=t);const n=h||t;n&&a.setAttribute("aria-label",n)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(n),s.onInit&&s.onInit(a,i),s.onClick&&(a.onclick=t=>{"string"==typeof s.onClick?i[s.onClick]():"function"==typeof s.onClick&&s.onClick(t,a,i)});const l=s.appendTo||"bar";let c=i.element;"bar"===l?(i.topBar||(i.topBar=t("pswp__top-bar pswp__hide-on-close","div",i.scrollWrap)),c=i.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===l&&(c=i.scrollWrap)),null===(h=c)||void 0===h||h.appendChild(i.applyFilters("uiElement",a,s))}}function N(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",(()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))}))}const U={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:N},V={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{N(t,i,!0)}},G={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},$={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},q={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,h=null;const e=i=>{var h,e;s!==i&&(s=i,h="active",e=i,t.classList.toggle("pswp__preloader--"+h,e))},n=()=>{var t;if(null===(t=i.currSlide)||void 0===t||!t.content.isLoading())return e(!1),void(h&&(clearTimeout(h),h=null));h||(h=setTimeout((()=>{var t;e(Boolean(null===(t=i.currSlide)||void 0===t?void 0:t.content.isLoading())),h=null}),i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",(t=>{i.currSlide===t.slide&&n()})),i.ui&&(i.ui.updatePreloaderVisibility=n)}},H={name:"counter",order:5,onInit:(t,i)=>{i.on("change",(()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()}))}};function K(t,i){t.classList.toggle("pswp--zoomed-in",i)}class W{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this.Tt=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[G,U,V,$,q,H],t.dispatch("uiRegister"),this.uiElementsData.sort(((t,i)=>(t.order||0)-(i.order||0))),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach((t=>{this.registerElement(t)})),t.on("change",(()=>{var i;null===(i=t.element)||void 0===i||i.classList.toggle("pswp--one-slide",1===t.getNumItems())})),t.on("zoomPanUpdate",(()=>this.At()))}registerElement(t){this.isRegistered?this.items.push(new R(this.pswp,t)):this.uiElementsData.push(t)}At(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:h}=i;if(this.pswp.opener.isOpen||(h=i.zoomLevels.initial),h===this.Tt)return;this.Tt=h;const e=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(e)<.01||!i.isZoomable())return K(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");K(t,(h===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=h),"zoom"!==s.imageClickAction&&"zoom-or-close"!==s.imageClickAction||t.classList.add("pswp--click-to-zoom")}}class j{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}}class X{constructor(i,s){if(this.element=t("pswp__img pswp__img--placeholder",i?"img":"div",s),i){const t=this.element;t.decoding="async",t.alt="",t.src=i,t.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&("IMG"===this.element.tagName?(l(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=o(0,0,t/250)):l(this.element,t,i))}destroy(){var t;null!==(t=this.element)&&void 0!==t&&t.parentNode&&this.element.remove(),this.element=null}}class Y{constructor(t,i,s){this.instance=i,this.data=t,this.index=s,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=c,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout((()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)}),1e3)}load(i,s){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new X(t,this.slide.container)}this.element&&!s||this.instance.dispatch("contentLoad",{content:this,isLazy:i}).defaultPrevented||(this.isImageContent()?(this.element=t("pswp__img","img"),this.displayedImageWidth&&this.loadImage(i)):(this.element=t("pswp__content","div"),this.element.innerHTML=this.data.html||""),s&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var i,s;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const h=this.element;this.updateSrcsetSizes(),this.data.srcset&&(h.srcset=this.data.srcset),h.src=null!==(i=this.data.src)&&void 0!==i?i:"",h.alt=null!==(s=this.data.alt)&&void 0!==s?s:"",this.state=d,h.complete?this.onLoaded():(h.onload=()=>{this.onLoaded()},h.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=u,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==u&&this.state!==p||this.removePlaceholder())}onError(){this.state=p,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===d,this)}isError(){return this.state===p}isImageContent(){return"image"===this.type}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(l(this.element,t,i),this.isImageContent()&&!this.isError()))){const s=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,s?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==p,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=i+"px",t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var i,s;let h=t("pswp__error-msg","div");h.innerText=null!==(i=null===(s=this.instance.options)||void 0===s?void 0:s.errorMsg)&&void 0!==i?i:"",h=this.instance.applyFilters("contentErrorElement",h,this),this.element=t("pswp__content pswp__error-msg-container","div"),this.element.appendChild(h),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===p)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||m())?(this.isDecoding=!0,this.element.decode().catch((()=>{})).finally((()=>{this.isDecoding=!1,this.appendImage()}))):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!m()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==u&&this.state!==p||this.removePlaceholder()))}}function J(t,i,s){const h=i.createContentFromData(t,s);let e;const{options:n}=i;
vendor: 16,099 bytes, line 1090
1090if(n){let o;e=new x(n,t,-1),o=i.pswp?i.pswp.viewportSize:w(n,i);const r=y(n,o,t,s);e.update(h.width,h.height,r)}return h.lazyLoad(),e&&h.setDisplayedSize(Math.ceil(h.width*e.initial),Math.ceil(h.height*e.initial)),h}class Q{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this.Dt=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:s}=i.options,h=void 0===t||t>=0;let e;for(e=0;e<=s[1];e++)this.loadSlideByIndex(i.currIndex+(h?e:-e));for(e=1;e<=s[0];e++)this.loadSlideByIndex(i.currIndex+(h?-e:e))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let s=this.getContentByIndex(i);s||(s=function(t,i){const s=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:s}).defaultPrevented)return J(s,i,t)}(i,this.pswp),s&&this.addToCache(s))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this.Dt.push(t),this.Dt.length>this.limit){const t=this.Dt.findIndex((t=>!t.isAttached&&!t.hasSlide));if(-1!==t){this.Dt.splice(t,1)[0].destroy()}}}removeByIndex(t){const i=this.Dt.findIndex((i=>i.index===t));-1!==i&&this.Dt.splice(i,1)}getContentByIndex(t){return this.Dt.find((i=>i.index===t))}destroy(){this.Dt.forEach((t=>t.destroy())),this.Dt=[]}}const tt=.003;class it{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this.It=void 0,this.Et=!1,this.Lt=!1,this.kt=!1,this.Zt=!1,this.Bt=void 0,this.Ft=void 0,this.Ot=void 0,this.Rt=void 0,this.Nt=void 0,this.Ut=this.Ut.bind(this),t.on("firstZoomPan",this.Ut)}open(){this.Ut(),this.Pt()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this.It=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this.It=0),this.Vt(),setTimeout((()=>{this.Pt()}),this.Lt?30:0)}Ut(){if(this.pswp.off("firstZoomPan",this.Ut),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this.It=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this.It=0),this.Vt()}}Vt(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;var h,e;("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this.Nt=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this.It=0,this.Nt=void 0):this.isOpening&&t.Gt?this.Nt=t.Gt:this.Nt=this.pswp.getThumbBounds(),this.Bt=null==i?void 0:i.getPlaceholderElement(),t.animations.stopAll(),this.Et=Boolean(this.It&&this.It>50),this.$t=Boolean(this.Nt)&&(null==i?void 0:i.content.usePlaceholder())&&(!this.isClosing||!t.mainScroll.isShifted()),this.$t)?this.kt=null!==(h=s.showHideOpacity)&&void 0!==h&&h:(this.kt=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan()));if(this.Zt=!this.kt&&this.pswp.options.bgOpacity>tt,this.Ft=this.kt?t.element:t.bg,!this.Et)return this.It=0,this.$t=!1,this.Zt=!1,this.kt=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(tt)),t.applyBgOpacity(1)));this.$t&&this.Nt&&this.Nt.innerRect?(this.Lt=!0,this.Ot=this.pswp.container,this.Rt=null===(e=this.pswp.currSlide)||void 0===e?void 0:e.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this.Lt=!1;this.isOpening?(this.kt?(t.element&&(t.element.style.opacity=String(tt)),t.applyBgOpacity(1)):(this.Zt&&t.bg&&(t.bg.style.opacity=String(tt)),t.element&&(t.element.style.opacity="1")),this.$t&&(this.qt(),this.Bt&&(this.Bt.style.willChange="transform",this.Bt.style.opacity=String(tt)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this.Lt&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}Pt(){this.isOpening&&this.Et&&this.Bt&&"IMG"===this.Bt.tagName?new Promise((t=>{let i=!1,s=!0;var h;(h=this.Bt,"decode"in h?h.decode().catch((()=>{})):h.complete?Promise.resolve(h):new Promise(((t,i)=>{h.onload=()=>t(h),h.onerror=i}))).finally((()=>{i=!0,s||t(!0)})),setTimeout((()=>{s=!1,i&&t(!0)}),50),setTimeout(t,250)})).finally((()=>this.Ht())):this.Ht()}Ht(){var t,i;null===(t=this.pswp.element)||void 0===t||t.style.setProperty("--pswp-transition-duration",this.It+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),null===(i=this.pswp.element)||void 0===i||i.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this.Bt&&(this.Bt.style.opacity="1"),this.Kt()):this.isClosing&&this.Wt(),this.Et||this.jt()}jt(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var i;this.$t&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),null===(i=t.currSlide)||void 0===i||i.applyCurrentZoomPan()}}Kt(){const{pswp:t}=this;this.$t&&(this.Lt&&this.Ot&&this.Rt&&(this.Xt(this.Ot,"transform","translate3d(0,0,0)"),this.Xt(this.Rt,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this.Xt(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this.Zt&&t.bg&&this.Xt(t.bg,"opacity",String(t.options.bgOpacity)),this.kt&&t.element&&this.Xt(t.element,"opacity","1")}Wt(){const{pswp:t}=this;this.$t&&this.qt(!0),this.Zt&&t.bgOpacity>.01&&t.bg&&this.Xt(t.bg,"opacity","0"),this.kt&&t.element&&this.Xt(t.element,"opacity","0")}qt(t){if(!this.Nt)return;const{pswp:s}=this,{innerRect:h}=this.Nt,{currSlide:e,viewportSize:n}=s;if(this.Lt&&h&&this.Ot&&this.Rt){const i=-n.x+(this.Nt.x-h.x)+h.w,s=-n.y+(this.Nt.y-h.y)+h.h,e=n.x-h.w,a=n.y-h.h;t?(this.Xt(this.Ot,"transform",o(i,s)),this.Xt(this.Rt,"transform",o(e,a))):(r(this.Ot,i,s),r(this.Rt,e,a))}e&&(i(e.pan,h||this.Nt),e.currZoomLevel=this.Nt.w/e.width,t?this.Xt(e.container,"transform",e.getCurrentTransform()):e.applyCurrentZoomPan())}Xt(t,i,s){if(!this.It)return void(t.style[i]=s);const{animations:h}=this.pswp,e={duration:this.It,easing:this.pswp.options.easing,onComplete:()=>{h.activeAnimations.length||this.jt()},target:t};e[i]=s,h.startTransition(e)}}const st={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};return class extends class extends class{constructor(){this.Yt={},this.Jt={},this.pswp=void 0,this.options=void 0}addFilter(t,i,s=100){var h,e,n;this.Jt[t]||(this.Jt[t]=[]),null===(h=this.Jt[t])||void 0===h||h.push({fn:i,priority:s}),null===(e=this.Jt[t])||void 0===e||e.sort(((t,i)=>t.priority-i.priority)),null===(n=this.pswp)||void 0===n||n.addFilter(t,i,s)}removeFilter(t,i){this.Jt[t]&&(this.Jt[t]=this.Jt[t].filter((t=>t.fn!==i))),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){var s;return null===(s=this.Jt[t])||void 0===s||s.forEach((t=>{i[0]=t.fn.apply(this,i)})),i[0]}on(t,i){var s,h;this.Yt[t]||(this.Yt[t]=[]),null===(s=this.Yt[t])||void 0===s||s.push(i),null===(h=this.pswp)||void 0===h||h.on(t,i)}off(t,i){var s;this.Yt[t]&&(this.Yt[t]=this.Yt[t].filter((t=>i!==t))),null===(s=this.pswp)||void 0===s||s.off(t,i)}dispatch(t,i){var s;if(this.pswp)return this.pswp.dispatch(t,i);const h=new j(t,i);return null===(s=this.Yt[t])||void 0===s||s.forEach((t=>{t.call(this,h)})),h}}{getNumItems(){var t;let i=0;const s=null===(t=this.options)||void 0===t?void 0:t.dataSource;s&&"length"in s?i=s.length:s&&"gallery"in s&&(s.items||(s.items=this.Qt(s.gallery)),s.items&&(i=s.items.length));const h=this.dispatch("numItems",{dataSource:s,numItems:i});return this.applyFilters("numItems",h.numItems,s)}createContentFromData(t,i){return new Y(t,this,i)}getItemData(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.dataSource;let h={};Array.isArray(s)?h=s[t]:s&&"gallery"in s&&(s.items||(s.items=this.Qt(s.gallery)),h=s.items[t]);let e=h;e instanceof Element&&(e=this.ti(e));const n=this.dispatch("itemData",{itemData:e||{},index:t});return this.applyFilters("itemData",n.itemData,t)}Qt(t){var i,s;return null!==(i=this.options)&&void 0!==i&&i.children||null!==(s=this.options)&&void 0!==s&&s.childSelector?function(t,i,s=document){let h=[];if(t instanceof Element)h=[t];else if(t instanceof NodeList||Array.isArray(t))h=Array.from(t);else{const e="string"==typeof t?t:i;e&&(h=Array.from(s.querySelectorAll(e)))}return h}(this.options.children,this.options.childSelector,t)||[]:[t]}ti(t){const i={element:t},s="A"===t.tagName?t:t.querySelector("a");if(s){i.src=s.dataset.pswpSrc||s.href,s.dataset.pswpSrcset&&(i.srcset=s.dataset.pswpSrcset),i.width=s.dataset.pswpWidth?parseInt(s.dataset.pswpWidth,10):0,i.height=s.dataset.pswpHeight?parseInt(s.dataset.pswpHeight,10):0,i.w=i.width,i.h=i.height,s.dataset.pswpType&&(i.type=s.dataset.pswpType);const e=t.querySelector("img");var h;if(e)i.msrc=e.currentSrc||e.src,i.alt=null!==(h=e.getAttribute("alt"))&&void 0!==h?h:"";(s.dataset.pswpCropped||s.dataset.cropped)&&(i.thumbCropped=!0)}return this.applyFilters("domItemData",i,t,s)}lazyLoadData(t,i){return J(t,this,i)}}{constructor(t){super(),this.options=this.ii(t||{}),this.offset={x:0,y:0},this.si={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this.hi={},this.Gt=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new f,this.animations=new F,this.mainScroll=new A(this),this.gestures=new T(this),this.opener=new it(this),this.keyboard=new E(this),this.contentLoader=new Q(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this.ei();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new O(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this.hi=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this.hi,slide:void 0}),this.Gt=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",(()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this.ni.bind(this)),this.events.add(window,"scroll",this.oi.bind(this)),this.dispatch("bindEvents")})),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),n(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.appendHeavy()}))}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var i;null===(i=this.currSlide)||void 0===i||i.zoomTo(...t)}toggleZoom(){var t;null===(t=this.currSlide)||void 0===t||t.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this.Yt={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),null===(t=this.element)||void 0===t||t.remove(),this.mainScroll.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.destroy()})),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach(((i,s)=>{var h,e;let n=(null!==(h=null===(e=this.currSlide)||void 0===e?void 0:e.index)&&void 0!==h?h:0)-1+s;var o;(this.canLoop()&&(n=this.getLoopedIndex(n)),n===t)&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,null===(o=i.slide)||void 0===o||o.setIsActive(!0)))})),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const h=this.getItemData(i);t.slide=new b(h,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const s=w(this.options,this);!t&&e(s,this.si)||(i(this.si,s),this.dispatch("beforeResize"),i(this.viewportSize,this.si),this.oi(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){var t;this.hasMouse||(this.hasMouse=!0,null===(t=this.element)||void 0===t||t.classList.add("pswp--has_mouse"))}ni(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout((()=>{this.updateSize()}),500)}oi(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}ei(){this.element=t("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=t("pswp__bg","div",this.element),this.scrollWrap=t("pswp__scroll-wrap","section",this.element),this.container=t("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new W(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const h=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(h.thumbBounds)return h.thumbBounds;const{element:e}=i;let n,o;if(e&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";o=e.matches(t)?e:e.querySelector(t)}return o=s.applyFilters("thumbEl",o,i,t),o&&(n=i.thumbCropped?function(t,i,s){const h=t.getBoundingClientRect(),e=h.width/i,n=h.height/s,o=e>n?e:n,r=(h.width-i*o)/2,a=(h.height-s*o)/2,l={x:h.left+r,y:h.top+a,w:i*o};return l.innerRect={w:h.width,h:h.height,x:r,y:a},l}(o,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(o)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this.hi,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}ii(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...st,...t}}}}));
1091
1092;
vendor: 14,569 bytes, lines 1092-1096
1092/*!
1093  * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
1094  * (c) 2024 Dmytro Semenov
1095  */
1096!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).PhotoSwipeLightbox=i()}(this,(function(){"use strict";function t(t,i,s){const h=document.createElement(i);return t&&(h.className=t),s&&s.appendChild(h),h}function i(t,i,s){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof s?`${s}px`:s}const s="idle",h="loading",e="loaded",n="error";function o(t,i,s=document){let h=[];if(t instanceof Element)h=[t];else if(t instanceof NodeList||Array.isArray(t))h=Array.from(t);else{const e="string"==typeof t?t:i;e&&(h=Array.from(s.querySelectorAll(e)))}return h}function r(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}class l{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}}class a{constructor(i,s){if(this.element=t("pswp__img pswp__img--placeholder",i?"img":"div",s),i){const t=this.element;t.decoding="async",t.alt="",t.src=i,t.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,s){this.element&&("IMG"===this.element.tagName?(i(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=function(t,i,s){let h=`translate3d(${t}px,${i||0}px,0)`;return void 0!==s&&(h+=` scale3d(${s},${s},1)`),h}(0,0,t/250)):i(this.element,t,s))}destroy(){var t;null!==(t=this.element)&&void 0!==t&&t.parentNode&&this.element.remove(),this.element=null}}class d{constructor(t,i,h){this.instance=i,this.data=t,this.index=h,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=s,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout((()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)}),1e3)}load(i,s){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new a(t,this.slide.container)}this.element&&!s||this.instance.dispatch("contentLoad",{content:this,isLazy:i}).defaultPrevented||(this.isImageContent()?(this.element=t("pswp__img","img"),this.displayedImageWidth&&this.loadImage(i)):(this.element=t("pswp__content","div"),this.element.innerHTML=this.data.html||""),s&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var i,s;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const e=this.element;this.updateSrcsetSizes(),this.data.srcset&&(e.srcset=this.data.srcset),e.src=null!==(i=this.data.src)&&void 0!==i?i:"",e.alt=null!==(s=this.data.alt)&&void 0!==s?s:"",this.state=h,e.complete?this.onLoaded():(e.onload=()=>{this.onLoaded()},e.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=e,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==e&&this.state!==n||this.removePlaceholder())}onError(){this.state=n,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===h,this)}isError(){return this.state===n}isImageContent(){return"image"===this.type}setDisplayedSize(t,s){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,s),!this.instance.dispatch("contentResize",{content:this,width:t,height:s}).defaultPrevented&&(i(this.element,t,s),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=s,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:s,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==n,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=i+"px",t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var i,s;let h=t("pswp__error-msg","div");h.innerText=null!==(i=null===(s=this.instance.options)||void 0===s?void 0:s.errorMsg)&&void 0!==i?i:"",h=this.instance.applyFilters("contentErrorElement",h,this),this.element=t("pswp__content pswp__error-msg-container","div"),this.element.appendChild(h),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===n)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||r())?(this.isDecoding=!0,this.element.decode().catch((()=>{})).finally((()=>{this.isDecoding=!1,this.appendImage()}))):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!r()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==e&&this.state!==n||this.removePlaceholder()))}}function c(t,i,s,h,e){let n=0;if(i.paddingFn)n=i.paddingFn(s,h,e)[t];else if(i.padding)n=i.padding[t];else{const s="padding"+t[0].toUpperCase()+t.slice(1);i[s]&&(n=i[s])}return Number(n)||0}class u{constructor(t,i,s,h){this.pswp=h,this.options=t,this.itemData=i,this.index=s,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,s){const h={x:t,y:i};this.elementSize=h,this.panAreaSize=s;const e=s.x/h.x,n=s.y/h.y;this.fit=Math.min(1,e<n?e:n),this.fill=Math.min(1,e>n?e:n),this.vFill=Math.min(1,n),this.initial=this.t(),this.secondary=this.i(),this.max=Math.max(this.initial,this.secondary,this.o()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}l(t){const i=t+"ZoomLevel",s=this.options[i];if(s)return"function"==typeof s?s(this):"fill"===s?this.fill:"fit"===s?this.fit:Number(s)}i(){let t=this.l("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}t(){return this.l("initial")||this.fit}o(){return this.l("max")||Math.max(1,4*this.fit)}}function p(t,i,s){const h=i.createContentFromData(t,s);let e;const{options:n}=i;if(n){let o;e=new u(n,t,-1),o=i.pswp?i.pswp.viewportSize:function(t,i){if(t.getViewportSizeFn){const s=t.getViewportSizeFn(t,i);if(s)return s}return{x:document.documentElement.clientWidth,y:window.innerHeight}}(n,i);const r=function(t,i,s,h){return{x:i.x-c("left",t,i,s,h)-c("right",t,i,s,h),y:i.y-c("top",t,i,s,h)-c("bottom",t,i,s,h)}}(n,o,t,s);e.update(h.width,h.height,r)}return h.lazyLoad(),e&&h.setDisplayedSize(Math.ceil(h.width*e.initial),Math.ceil(h.height*e.initial)),h}return class extends class extends class{constructor(){this.u={},this.p={},this.pswp=void 0,this.options=void 0}addFilter(t,i,s=100){var h,e,n;this.p[t]||(this.p[t]=[]),null===(h=this.p[t])||void 0===h||h.push({fn:i,priority:s}),null===(e=this.p[t])||void 0===e||e.sort(((t,i)=>t.priority-i.priority)),null===(n=this.pswp)||void 0===n||n.addFilter(t,i,s)}removeFilter(t,i){this.p[t]&&(this.p[t]=this.p[t].filter((t=>t.fn!==i))),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){var s;return null===(s=this.p[t])||void 0===s||s.forEach((t=>{i[0]=t.fn.apply(this,i)})),i[0]}on(t,i){var s,h;this.u[t]||(this.u[t]=[]),null===(s=this.u[t])||void 0===s||s.push(i),null===(h=this.pswp)||void 0===h||h.on(t,i)}off(t,i){var s;this.u[t]&&(this.u[t]=this.u[t].filter((t=>i!==t))),null===(s=this.pswp)||void 0===s||s.off(t,i)}dispatch(t,i){var s;if(this.pswp)return this.pswp.dispatch(t,i);const h=new l(t,i);return null===(s=this.u[t])||void 0===s||s.forEach((t=>{t.call(this,h)})),h}}{getNumItems(){var t;let i=0;const s=null===(t=this.options)||void 0===t?void 0:t.dataSource;s&&"length"in s?i=s.length:s&&"gallery"in s&&(s.items||(s.items=this.v(s.gallery)),s.items&&(i=s.items.length));const h=this.dispatch("numItems",{dataSource:s,numItems:i});return this.applyFilters("numItems",h.numItems,s)}createContentFromData(t,i){return new d(t,this,i)}getItemData(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.dataSource;let h={};Array.isArray(s)?h=s[t]:s&&"gallery"in s&&(s.items||(s.items=this.v(s.gallery)),h=s.items[t]);let e=h;e instanceof Element&&(e=this.m(e));const n=this.dispatch("itemData",{itemData:e||{},index:t});return this.applyFilters("itemData",n.itemData,t)}v(t){var i,s;return null!==(i=this.options)&&void 0!==i&&i.children||null!==(s=this.options)&&void 0!==s&&s.childSelector?o(this.options.children,this.options.childSelector,t)||[]:[t]}m(t){const i={element:t},s="A"===t.tagName?t:t.querySelector("a");if(s){i.src=s.dataset.pswpSrc||s.href,s.dataset.pswpSrcset&&(i.srcset=s.dataset.pswpSrcset),i.width=s.dataset.pswpWidth?parseInt(s.dataset.pswpWidth,10):0,i.height=s.dataset.pswpHeight?parseInt(s.dataset.pswpHeight,10):0,i.w=i.width,i.h=i.height,s.dataset.pswpType&&(i.type=s.dataset.pswpType);const e=t.querySelector("img");var h;if(e)i.msrc=e.currentSrc||e.src,i.alt=null!==(h=e.getAttribute("alt"))&&void 0!==h?h:"";(s.dataset.pswpCropped||s.dataset.cropped)&&(i.thumbCropped=!0)}return this.applyFilters("domItemData",i,t,s)}lazyLoadData(t,i){return p(t,this,i)}}{constructor(t){super(),this.options=t||{},this.g=0,this.shouldOpen=!1,this._=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){o(this.options.gallery,this.options.gallerySelector).forEach((t=>{t.addEventListener("click",this.onThumbnailsClick,!1)}))}onThumbnailsClick(t){if(function(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}(t)||window.pswp)return;let i={x:t.clientX,y:t.clientY};i.x||i.y||(i=null);let s=this.getClickedIndex(t);s=this.applyFilters("clickedIndex",s,t,this);const h={gallery:t.currentTarget};s>=0&&(t.preventDefault(),this.loadAndOpen(s,h,i))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const i=t.target,s=o(this.options.children,this.options.childSelector,t.currentTarget).findIndex((t=>t===i||t.contains(i)));return-1!==s?s:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,i,s){if(window.pswp||!this.options)return!1;if(!i&&this.options.gallery&&this.options.children){const t=o(this.options.gallery);t[0]&&(i={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=s,this.shouldOpen=!0,this.preload(t,i),!0}preload(t,i){const{options:s}=this;i&&(s.dataSource=i);const h=[],e=typeof s.pswpModule;if("function"==typeof(n=s.pswpModule)&&n.prototype&&n.prototype.goTo)h.push(Promise.resolve(s.pswpModule));else{if("string"===e)throw new Error("pswpModule as string is no longer supported");if("function"!==e)throw new Error("pswpModule is not valid");h.push(s.pswpModule())}var n;"function"==typeof s.openPromise&&h.push(s.openPromise()),!1!==s.preloadFirstSlide&&t>=0&&(this._=function(t,i){const s=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:s}).defaultPrevented)return p(s,i,t)}(t,this));const o=++this.g;Promise.all(h).then((t=>{if(this.shouldOpen){const i=t[0];this.I(i,o)}}))}I(t,i){if(i!==this.g&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const s="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=s,window.pswp=s,Object.keys(this.u).forEach((t=>{var i;null===(i=this.u[t])||void 0===i||i.forEach((i=>{s.on(t,i)}))})),Object.keys(this.p).forEach((t=>{var i;null===(i=this.p[t])||void 0===i||i.forEach((i=>{s.addFilter(t,i.fn,i.priority)}))})),this._&&(s.contentLoader.addToCache(this._),this._=void 0),s.on("destroy",(()=>{this.pswp=void 0,delete window.pswp})),s.init()}destroy(){var t;null===(t=this.pswp)||void 0===t||t.destroy(),this.shouldOpen=!1,this.u={},o(this.options.gallery,this.options.gallerySelector).forEach((t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)}))}}}));
1097
1098$.photoSwipe = {
1099	imgRegExp: /\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,
1100	isImage: function(url) {
1101		return (url && url.match(this.imgRegExp));
1102	}
1103}
1104
1105$.fn.photoSwipe = function(options){
1106	let $this = $(this);
1107	let $template = $('body > #template');
1108	let appendTo = ($template.length?$template.get(0):document.body);
1109
1110	$this.unbind('.fb').bind('click.pswp', function(e) {
1111		if (e.isTrigger && !e.originalEvent) {
1112			e.preventDefault();
1113			e.stopImmediatePropagation();
1114			this.click();
1115		}
1116	});
1117
1118	let lightbox = new PhotoSwipeLightbox($.extend({}, {
1119		gallery: 'body',
1120		children: $this.get(),
1121		appendToEl: appendTo,
1122		bgOpacity: 1,
1123		showHideAnimationType: 'fade',
1124		pswpModule: PhotoSwipe 
1125	}, options));
1126
1127	lightbox.on('uiRegister', function() {
1128		if (!lightbox.options.downloadButton && !$this.data('download-button'))
1129			return;
1130
1131		lightbox.pswp.ui.registerElement({
1132			name: 'download-button',
1133			order: 8,
1134			isButton: true,
1135			tagName: 'a',
1136
1137			html: {
1138				isCustomSVG: true,
1139				inner: '<path d="M20.5 14.3 17.1 18V10h-2.2v7.9l-3.4-3.6L10 16l6 6.1 6-6.1ZM23 23H9v2h14Z" id="pswp__icn-download"/>',
1140				outlineID: 'pswp__icn-download'
1141			},
1142
1143			onInit: (el, pswp) => {
1144				el.setAttribute('download', '');
1145				el.setAttribute('target', '_blank');
1146				el.setAttribute('rel', 'noopener');
1147
1148				pswp.on('change', () => {
1149					el.href = pswp.currSlide.data.src.replace(/\/view\//, '/download/');
1150				});
1151			}
1152		});
1153	});
1154
1155	lightbox.on('contentLoad', (e) => {
1156		const { content } = e;
1157		const element = content.data.element;
1158		const isImage = $.photoSwipe.isImage(element.href);
1159
1160		if (isImage && element.dataset.pswpWidth > 0 && element.dataset.pswpHeight > 0) {
1161			setTimeout(function() {
1162				if (content.placeholder)
1163					content.placeholder.destroy();
1164			}, 1);
1165
1166			return;
1167		}
1168
1169		e.preventDefault();
1170		content.type = isImage?'image':'html';
1171		content.state = 'loading';
1172		content.element = document.createElement('figure');
1173		content.imgLoader = null;
1174
1175		if ($(element).hasClass("iframe") || (CI_SITE_URL && element.href.indexOf(CI_SITE_URL) == -1)) {
1176			content.element = document.createElement('iframe');
1177			content.element.style.setProperty('border', '0');
1178			content.element.src = element.href;
1179			content.onLoaded();
1180			return;
1181		}
1182
1183		content.resizeToImg = function() {
1184			content.data.element.dataset.pswpHeight =
1185			content.data.height = content.data.h =
1186			content.height = content.h =
1187				content.imgLoader.height;
1188			content.data.element.dataset.pswpWidth =
1189			content.data.width = content.data.w =
1190			content.width = content.w =
1191				content.imgLoader.width;
1192
1193			if (content.slide) {
1194				content.slide.height =
1195				content.slide.data.height =
1196				content.slide.data.h =
1197					content.imgLoader.height;
1198				content.slide.width =
1199				content.slide.data.width =
1200				content.slide.data.w =
1201					content.imgLoader.width;
1202
1203				content.slide.resize();
1204			}
1205		}
1206
1207		content.onData = function(data) {
1208			if (!data)
1209				data = element.dataset.pswpData;
1210
1211			if (!data) {
1212				content.onError();
1213				return;
1214			}
1215
1216			if ((data+'').match(/auto(play|start)=(1|true)/i) &&
1217				(!lightbox.pswp || lightbox.pswp.currIndex != content.index))
1218			{
1219				content.pending = true;
1220				return;
1221			}
1222
1223			setTimeout(function() {
1224				if (content.placeholder)
1225					content.placeholder.destroy();
1226			}, 1);
1227
1228			let $data = $(data);
1229			let $img = $data.find('img:first,object:first,iframe:first').addBack('img,object,iframe');
1230
1231			if (!$img.length) {
1232				if (content.element.firstChild)
1233					content.element.firstChild.remove();
1234
1235				$data.appendTo(content.element);
1236				content.onLoaded();
1237				return;
1238			}
1239
1240			content.type = $img.is('img')?'image':'html';
1241			$img.addClass('pswp__img').removeAttr('style');
1242
1243			if ($img.attr('width') > 0 && $img.attr('height') > 0) {
1244				content.imgLoader = {
1245					width: $img.attr('width'),
1246					height: $img.attr('height')
1247				};
1248
1249				if ($img.is('object,iframe')) {
1250					let vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
1251
1252					if (content.imgLoader.width < vw) {
1253						content.imgLoader.height = vw / (content.imgLoader.width/content.imgLoader.height);
1254						content.imgLoader.width = vw;
1255					}
1256
1257					$img.css(content.imgLoader);
1258
1259					if ($img.is('object'))
1260						$img.find('video').css(content.imgLoader);
1261				}
1262
1263				if (content.element.firstChild)
1264					content.element.firstChild.remove();
1265
1266				content.resizeToImg();
1267				$data.appendTo(content.element);
1268				content.onLoaded();
1269				return;
1270			}
1271
1272			content.imgLoader = document.createElement('img');
1273			content.imgLoader.src = $img.attr('src');
1274
1275			if (content.imgLoader.complete || (content.imgLoader.height && content.imgLoader.height > 0)) {
1276				if (content.element.firstChild)
1277					content.element.firstChild.remove();
1278
1279				content.resizeToImg();
1280				$data.appendTo(content.element);
1281				content.onLoaded();
1282
1283			} else {
1284				content.imgLoader.onload = function() {
1285					if (content.element.firstChild)
1286						content.element.firstChild.remove();
1287
1288					content.resizeToImg();
1289					$data.appendTo(content.element);
1290					content.onLoaded();
1291				};
1292				content.imgLoader.onerror = function() {
1293					content.onError();
1294				};
1295			}
1296		}
1297
1298		if (isImage)
1299			element.dataset.pswpData = '<img src="'+element.href+'" />';
1300
1301		if (element.dataset.pswpData) {
1302			content.onData();
1303			return;
1304		}
1305
1306		content.onData(element.innerHTML);
1307
1308		if (content.ajaxLoader)
1309			content.ajaxLoader.abort();
1310
1311		content.ajaxLoader = $.ajax({
1312			url	: element.href,
1313			error : function(XMLHttpRequest, textStatus, errorThrown) {
1314				if ( XMLHttpRequest.status > 0 ) {
1315					content.onError();
1316				}
1317			},
1318			success : function(data, textStatus, XMLHttpRequest) {
1319				let o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
1320
1321				if (o.status == 200) {
1322					let redirectMatches;
1323					if (typeof CI_ADMIN_URL != 'undefined' && data && typeof data.match == 'function' && 
1324						window.location && window.location.href && window.location.href.indexOf(CI_ADMIN_URL) != -1 &&
1325						(redirectMatches = data.match(/<script[^>]*?>window.location="(.*?)"/)) && redirectMatches[1])
1326					{
1327						data = '<p id="fancybox-error">The requested url is no longer valid.<br />' +
1328							'<a href="'+redirectMatches[1]+'">Visit Updated Location</a></p>';
1329					}
1330
1331					element.dataset.pswpData = data;
1332					content.onData();
1333
1334				} else {
1335					content.onError();
1336				}
1337			}
1338		});
1339	});
1340
1341	lightbox.on('contentActivate', (e) => {
1342		const { content } = e;
1343
1344		if (content.pending) {
1345			delete content.pending;
1346			content.onData();
1347		}
1348	});
1349
1350	lightbox.on('contentLoadImage', (e) => {
1351		const { content } = e;
1352		const element = content.data.element;
1353		const isImage = $.photoSwipe.isImage(element.href);
1354
1355		if (isImage && element.dataset.pswpWidth > 0 && element.dataset.pswpHeight > 0)
1356			return;
1357
1358		e.preventDefault();
1359	});
1360
1361	lightbox.init();
1362}
1363

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.