"use strict";$(function(){if(messengerVars.bootFullMessenger){messenger.boot();messenger.fetchContacts();messenger.initAutoScroll();messenger.initMarkAsSeen();messenger.resetTextAreaHeight();if(messengerVars.lastContactID!==false&&messengerVars.lastContactID!==0){messenger.fetchConversation(messengerVars.lastContactID);}
else{$('.conversation-content').html(noMessagesLabel());}
FileUpload.initDropZone('.dropzone','/attachment/upload/message',mediaSettings.use_chunked_uploads);messenger.initSelectizeUserList();}
messenger.initNewConversationUI();});function adjustMinHeight(){var headerHeight=$('.mobile-bottom-nav').outerHeight();var viewportHeight=window.innerHeight;var elements=$('.conversations-wrapper, .conversation-wrapper');elements.each(function(){$(this).css('height',(viewportHeight-headerHeight)+'px');});}
$(document).ready(adjustMinHeight);$(window).resize(adjustMinHeight);var messenger={state:{contacts:[],conversation:[],activeConversationUserID:null,activeConversationUser:null,currentBreakPoint:'lg',redirectedToMessage:false,messagePrice:5,isPaidMessage:false,activeMessageID:null,receiverIDs:[],newConversationMode:false,newConversationSelectAllToggle:false,isSendingMessage:false,},pusher:null,selectizeInstance:null,boot:function(){Pusher.logToConsole=app.debug;let params={authorizer:PusherBatchAuthorizer,authDelay:200,authEndpoint:app.baseUrl+'/my/messenger/authorizeUser',auth:{headers:{'X-CSRF-Token':$('meta[name="csrf-token"]').attr('content')}}};if(socketsDriver==='soketi'){params.wsHost=soketi.host;params.wsPort=soketi.port;params.forceTLS=soketi.useTSL?true:false;}
else{params.cluster=messengerVars.pusherCluster;}
messenger.pusher=new Pusher(socketsDriver==='soketi'?soketi.key:pusher.key,params);},initLiveSockets:function(){$.each(messenger.state.contacts,function(k,v){const minID=Math.min(v.receiverID,v.senderID);const maxID=Math.max(v.receiverID,v.senderID);const keyID=(""+minID+'-'+maxID);let channel=messenger.pusher.subscribe('private-chat-channel-'+keyID);channel.unbind('new-message');channel.bind('new-message',function(data){const message=jQuery.parseJSON(data.message);if(message.sender_id===messenger.state.activeConversationUserID){messenger.state.conversation.push(message);messenger.reloadConversation();}
messenger.updateUnreadMessagesCount(parseInt($('#unseenMessages').html())+1);messenger.addLatestMessageToConversation(message.sender_id,message);messenger.markConversationAsRead(message.sender_id,'unread');messenger.fetchContacts();});});},initAutoScroll:function(){$(".messageBoxInput").keydown(function(e){if(e.keyCode===13){if(!e.shiftKey){e.preventDefault();$('.send-message').trigger('click');}}});},fetchContacts:function(callback=function(){}){$.ajax({type:'GET',url:app.baseUrl+'/my/messenger/fetchContacts',dataType:'json',success:function(result){if(result.status==='success'){messenger.state.contacts=result.data.contacts;messenger.reloadContactsList();messenger.initLiveSockets();callback();}
else{}}});},makeContactsHeaderResponsive:function(){const breakPoint=bootstrapDetectBreakpoint();if(breakPoint.name==='xs'){$('.conversations-list').mCustomScrollbar({theme:"minimal-dark",axis:'x',scrollInertia:200,});$('.conversations-list').addClass('border-top');}
else{$('.conversations-list').mCustomScrollbar("destroy");$('.conversations-list').removeClass('border-top');}},fetchConversation:function(userID){messenger.closeNewConversationUI();$('.conversation-loading-box').removeClass('d-none');$('.conversation-header-loading-box').removeClass('d-none');$('.conversation-header').addClass('d-none');$('.conversation-loading-box').removeClass('d-none');$('.conversation-content').html('');$.ajax({type:'GET',url:app.baseUrl+'/my/messenger/fetchMessages/'+userID,dataType:'json',success:function(result){if(result.status==='success'){messenger.state.conversation=result.data.messages;messenger.reloadConversation();messenger.state.activeConversationUserID=userID;messenger.setActiveContact(userID);messenger.reloadConversationHeader();if(app.feedDisableRightClickOnMedia!==null){messenger.disableMesagesRightClick();}
initTooltips();}
else{}}});},sendMessage:function(forceSave=false){if(FileUpload.isLoading===true&&forceSave===false){$('.confirm-post-save').unbind('click');$('.confirm-post-save').on('click',function(){messenger.sendMessage(true);});$('#confirm-post-save').modal('show');return false;}
if(messenger.state.isPaidMessage&&FileUpload.attachaments.length===0){if(!app.isTextOnlyPPVAllowed){$('#no-attachments-locked-post').modal('show');return false;}}
if(messenger.isSendingMessage){console.info(trans('Another message is being sent - please wait'));return false;}
updateButtonState('loading',$('.send-message'));if($('.messageBoxInput').val().length===0&&FileUpload.attachaments.length===0){updateButtonState('loaded',$('.send-message'));return false;}
messenger.isSendingMessage=true;$.ajax({type:'POST',url:app.baseUrl+'/my/messenger/sendMessage',data:{'message':$('.conversation-writeup .messageBoxInput').val(),'attachments':FileUpload.attachaments,'receiverIDs':messenger.state.receiverIDs,'price':messenger.state.isPaidMessage?messenger.state.messagePrice:0},dataType:'json',success:function(result){messenger.clearMessageBox();messenger.clearMessagePrice();messenger.resetTextAreaHeight();messenger.clearFileUploadsState();if(messenger.state.receiverIDs.length===1){messenger.state.conversation.push(result.data.message);messenger.addLatestMessageToConversation(result.data.message.receiverID,result.data.message);if(messenger.state.newConversationMode){messenger.fetchContacts(function(){});messenger.state.activeConversationUserID=result.data.message.receiver_id;messenger.fetchConversation(result.data.message.receiver_id);}
messenger.reloadConversation();messenger.closeNewConversationUI();messenger.isSendingMessage=false;}
else{const latestContactId=result.data[result.data.length-1].message.receiver_id;if(messenger.state.newConversationMode){messenger.fetchContacts();}
messenger.state.activeConversationUserID=latestContactId;messenger.fetchConversation(latestContactId);initTooltips();if(result.errors){launchToast('danger',trans('Error'),result.errors);}}
$('#confirm-post-save').modal('hide');messenger.hideEmptyChatElements();updateButtonState('loaded',$('.send-message'));initTooltips();messenger.isSendingMessage=false;},error:function(result){launchToast('danger',trans('Error'),result.responseJSON.message);updateButtonState('loaded',$('.send-message'));messenger.isSendingMessage=false;}});},clearFileUploadsState:function(){FileUpload.attachaments=[];$('.dropzone-previews').html('');},sendDMFromProfilePage:function(){let submitButton=$('.new-conversation-label');updateButtonState('loading',submitButton,trans('Send'),'white');$.ajax({type:'POST',url:app.baseUrl+'/my/messenger/sendMessage',data:{'receiverIDs':[$('#receiverID').val()],'message':$('#messageText').val()},success:function(){$("textarea[name=message]").val("");$('#messageModal').modal('hide');window.location.assign(app.baseUrl+'/my/messenger');updateButtonState('loaded',submitButton,trans('Save'));},error:function(result){launchToast('danger',trans('Error'),result.responseJSON.message);updateButtonState('loaded',submitButton,trans('Save'));},});},initMarkAsSeen:function(){$(".messageBoxInput").on('click',function(){if($('#unseenValue').val()!==0){$.ajax({type:'POST',url:app.baseUrl+'/my/messenger/markSeen',data:{userID:messenger.state.activeConversationUserID},dataType:'json',success:function(result){messenger.markConversationAsRead(messenger.state.activeConversationUserID,'read');messenger.updateUnreadMessagesCount(parseInt($('#unseenMessages').html())-result.data.count);incrementNotificationsCount('.menu-notification-badge.chat-menu-count',(-parseInt(result.data.count)));messenger.reloadContactsList();}});}});},isExistingContact:function(contactID){let isNewContact=false;$.map(messenger.state.contacts,function(contact){if(contactID===contact.contactID){isNewContact=true;}});return isNewContact;},reloadContactsList:function(){let contactsHtml='';$.each(messenger.state.contacts,function(key,value){contactsHtml+=contactElement(value);});if(messenger.state.contacts.length>0){$('.conversations-list').html('<div class="row">'+contactsHtml+'</div>');}
else{$('.conversations-list').html(noContactsLabel());}
$('.contact-'+messenger.state.activeConversationUserID).addClass('contact-active');},reloadConversationHeader:function(){if(typeof messenger.state.conversation[0]!=='undefined'){const contact=messenger.state.conversation[0];const userID=(contact.receiver_id!==messenger.state.activeConversationUserID?contact.sender.id:contact.receiver.id);const username=(contact.receiver_id!==messenger.state.activeConversationUserID?contact.sender.username:contact.receiver.username);const avatar=(contact.receiver_id!==messenger.state.activeConversationUserID?contact.sender.avatar:contact.receiver.avatar);const name=contact.receiver_id!==messenger.state.activeConversationUserID?`${contact.sender.name} `:`${contact.receiver.name}`;const profile=contact.receiver_id!==messenger.state.activeConversationUserID?contact.sender.profileUrl:contact.receiver.profileUrl;$('.conversation-header').removeClass('d-none');$('.conversation-header-loading-box').addClass('d-none');$('.conversation-header-avatar').attr('src',avatar);$('.conversation-header-user').html(name);$('.conversation-profile-link').attr('href',profile);$('.details-holder .unfollow-btn').unbind('click');$('.details-holder .block-btn').unbind('click');$('.details-holder .report-btn').unbind('click');if(messengerVars.followingContacts.indexOf(userID)>=0){$('.unfollow-btn').html(trans('Unfollow'));$('.details-holder .unfollow-btn').on('click',function(){Lists.showListManagementConfirmation('unfollow',userID);});}
else{$('.unfollow-btn').html(trans('Follow'));$('.unfollow-btn').on('click',function(){Lists.updateListMember(user.lists['following'],userID,'add',true);window.reload();});}
$('.details-holder .block-btn').on('click',function(){Lists.showListManagementConfirmation('block',userID);});$('.details-holder .report-btn').on('click',function(){Lists.showReportBox(userID,null);});if(contact.sender.canEarnMoney===false){$('.details-holder .tip-btn').addClass('hidden');}else{$('.details-holder .tip-btn').attr('data-username','@'+username);$('.details-holder .tip-btn').attr('data-name',name);$('.details-holder .tip-btn').attr('data-avatar',avatar);$('.details-holder .tip-btn').attr('data-recipient-id',userID);}}},reloadConversation:function(){let conversationHtml='';$.each(messenger.state.conversation,function(key,value){conversationHtml+=messageElement(value);});$('.conversation-content').html(conversationHtml);let urlParams=new URLSearchParams(window.location.search);if(urlParams.has('token')&&!messenger.state.redirectedToMessage){let token='#m-'.concat(urlParams.get('token'));if($('.conversation-content .message-box').length&&$('.conversation-content').find(token).length){let offset=$('.conversation-content').find(token).offset().top-$('.conversation-content').offset().top+$('.conversation-content').scrollTop();$(".conversation-content").animate({scrollTop:offset},'slow');}
$('.conversation-content').find(token).animate({backgroundColor:"rgba(203,12,159,.2)",},1000).delay(2000).queue(function(){$('.conversation-content').find(token).animate({backgroundColor:"rgba(0,0,0,0)",},1000).dequeue();});messenger.state.redirectedToMessage=true;}else{if($('.conversation-content .message-box').length){$(".conversation-content").animate({scrollTop:$('.conversation-content')[0].scrollHeight+100},800);}}
$('.conversation-loading-box').addClass('d-none');messenger.initMessengerGalleries();},textAreaAdjust:function(el){el.style.height=(el.scrollHeight>el.clientHeight)?(el.scrollHeight)+"px":"40px";},resetTextAreaHeight:function(){$(".messageBoxInput").css('height',45);},setActiveContact:function(userID){$('.messageBoxInput').focus();$('#receiverID').val(userID);messenger.state.receiverIDs=[userID];$('.contact-box').each(function(k,el){$(el).removeClass('contact-active');});$('.contact-'+messenger.state.activeConversationUserID).addClass('contact-active');},clearMessageBox:function(){$(".messageBoxInput").val('');},updateUnreadMessagesCount:function(val){$("#unseenMessages").html(val);return true;},markConversationAsRead:function(userID,type){$.map(messenger.state.contacts,function(contact,k){if(userID===contact.contactID){let newContact=contact;newContact.isSeen=type==='read'?1:0;messenger.state.contacts[k]=newContact;}});let newContactsList=messenger.state.contacts;},addLatestMessageToConversation:function(contactID,message){let contactKey=null;let contactObj=null;let newContact=null;$.map(messenger.state.contacts,function(contact,k){if(contactID===contact.contactID){newContact=contact;contactKey=k;newContact.lastMessage=message.message;newContact.dateAdded=message.dateAdded;newContact.dateAdded=message.dateAdded;newContact.senderID=message.sender_id;newContact.lastMessageSenderID=message.sender_id;messenger.state.contacts[k]=newContact;}});let newContactsList=messenger.state.contacts;if(contactKey!==null){newContactsList.splice(contactKey,1);newContactsList.unshift(newContact);messenger.state.contacts=newContactsList;}},initMessengerGalleries:function(){$('.message-box').each(function(index,item){if($(item).find('.attachments-holder').children().length>0){mswpScanPage($(item),'mswp');}});},parseMessage:function(text){const replaced=text.replace(/\n/g,'<br/>');const safeHtml=filterXSS(replaced,{whiteList:{br:[],}});const linkedText=Autolinker.link(safeHtml,{urls:{schemeMatches:true},email:false,phone:false,mention:false,hashtag:false,sanitizeHtml:false,className:'',truncate:{length:64,location:'middle'},replaceFn:function(match){var tag=match.buildTag();tag.setAttr('rel','nofollow noopener noreferrer');return tag;}});return linkedText;},hideEmptyChatElements:function(){$('.conversation-writeup').removeClass('hidden');$('.no-contacts').addClass('hidden');},initSelectizeUserList:function(){if(typeof Selectize!=='undefined'){messenger.selectizeInstance=$('#select-repo').selectize({valueField:'id',searchField:'label',options:messengerVars.availableContacts,create:false,render:{option:function(item,escape){return'<div>'+'<img class="searchAvatar ml-3 my-1" src="'+escape(item.avatar)+'" alt="">'+'<span class="name ml-2">'+escape(item.name)+'</span>'+'</div>';},item:function(item,escape){return'<div>'+'<img class="searchAvatar ml-1" src="'+escape(item.avatar)+'" alt="">'+'<span class="name ml-2">'+escape(item.name)+'</span>'+'</div>';}},onChange(value){messenger.state.receiverIDs=value.map(function(x){return parseInt(x,10);});}});}},showNewMessageDialog:function(){$('#messageModal').modal('show');},showSetPriceDialog:function(){$('#message-set-price-dialog').modal('show');},clearMessagePrice:function(){messenger.state.messagePrice=5;messenger.state.isPaidMessage=false;$('#message-price').val(5);$('.message-price-lock').removeClass('d-none');$('.message-price-close').addClass('d-none');$('#message-set-price-dialog').modal('hide');},saveMessagePrice:function(){messenger.state.isPaidMessage=true;messenger.state.messagePrice=$('#message-price').val();if(!passesMinMaxPPVMessageLimits(messenger.state.messagePrice)){$('#message-price').addClass('is-invalid');return false;}
$('.message-price-lock').addClass('d-none');$('.message-price-close').removeClass('d-none');$('#message-set-price-dialog').modal('hide');$('#message-price').removeClass('is-invalid');},parseMessageAttachment:function(file){let attachmentsHtml='';switch(file.type){case'avi':case'mp4':case'wmw':case'mpeg':case'm4v':case'moov':case'mov':attachmentsHtml=`
                <a href="${file.path}" rel="mswp" title="" class="mr-2 mt-2 no-long-press">
                    <div class="video-wrapper">
                     <video class="video-preview" src="${file.path}" width="150" height="150" controls controlsList="nodownload" autoplay muted playsinline></video>
                    </div>
                 </a>`;break;case'mp3':case'wav':case'ogg':attachmentsHtml=`
                <a href="${file.path}" rel="mswp" title="" class="mr-2 mt-2 d-flex align-items-center no-long-press">
                    <div class="video-wrapper">
                         <audio id="video-preview" src="${file.path}" controls controlsList="nodownload" type="audio/mpeg" muted></audio>
                    </div>
                 </a>`;break;case'png':case'jpg':case'jpeg':attachmentsHtml=`
                    <a href="${file.path}" rel="mswp" title="" class="no-long-press">
                        <img src="${file.thumbnail}" class="mr-2 mt-2">
                    </a>`;break;default:attachmentsHtml=`<img src="${file.thumbnail}" class="mr-2 mt-2">`;break;}
return attachmentsHtml;},showMessageDeleteDialog:function(messageID){showDialog('message-delete-dialog');messenger.state.activeMessageID=messageID;},deleteMessage:function(){$.ajax({type:'DELETE',dataType:'json',url:app.baseUrl+'/my/messenger/delete/'+messenger.state.activeMessageID,success:function(result){let element=$('*[data-messageid="'+messenger.state.activeMessageID+'"]');element.remove();hideDialog('message-delete-dialog');launchToast('success',trans('Success'),trans('Message removed'));if(result.isLastMessage===true){messenger.fetchContacts(function(){if(messenger.state.contacts.length>=1){messenger.state.activeConversationUserID=messenger.state.contacts[0].contactID;messenger.fetchConversation(messenger.state.activeConversationUserID);}
else{messenger.fetchContacts();$('.conversation-content').html(noMessagesLabel());$('.conversation-writeup').addClass('hidden');$('.conversation-header').addClass('d-none');}});}
else{messenger.fetchConversation(messenger.state.activeConversationUserID);}},error:function(result){hideDialog('message-delete-dialog');launchToast('danger',trans('Error'),result.responseJSON.message);}});},initNewConversationUI:function(){$('.new-conversation-toggle').on('click',function(){if(messenger.state.newConversationMode){messenger.closeNewConversationUI();}
else{messenger.openNewConversationUI();}});$('.new-conversation-close').on('click',function(){messenger.closeNewConversationUI();});$('.new-conversation-toggle-all').on('click',function(){messenger.toggleAllContacts();});},closeNewConversationUI:function(){$('.conversation-header').removeClass('d-none');$('.new-conversation-header').addClass('d-none');if(messenger.selectizeInstance!==null){messenger.selectizeInstance[0].selectize.clear();}
if(messenger.state.contacts.length===0&&messengerVars.lastContactID===0){$('.conversation-content').html(noMessagesLabel());$('.conversation-writeup').addClass('hidden');$('.conversation-header').addClass('d-none');}
else{messenger.reloadConversation();}
messenger.state.newConversationMode=false;return true;},toggleAllContacts:function(){if(messenger.state.newConversationSelectAllToggle===false){var el=messenger.selectizeInstance[0].selectize;var optKeys=Object.keys(el.options);let i=0;optKeys.forEach(function(key){if(i>50){return false;}
el.addItem(key);i++;});messenger.state.newConversationSelectAllToggle=true;}
else{messenger.selectizeInstance[0].selectize.clear();messenger.state.newConversationSelectAllToggle=false;}},openNewConversationUI:function(){if(messengerVars.availableContacts.length===0){return false;}
messenger.hideEmptyChatElements();$('.conversation-header').addClass('d-none');$('.new-conversation-header').removeClass('d-none');$('.conversation-content').html('');messenger.state.newConversationMode=true;return true;},disableMesagesRightClick:function(){$(".attachments-holder").unbind('contextmenu');$(".attachments-holder").on("contextmenu",function(){return false;});$(".post-media, .pswp__item").unbind('contextmenu');$(".post-media, .pswp__item").on("contextmenu",function(){return false;});bindNoLongPressEvents();},};"use strict";function contactElement(contact){const avatar=contact.receiverID===user.user_id?contact.senderAvatar:contact.receiverAvatar;const name=contact.receiverID===user.user_id?contact.senderName:contact.receiverName;return`
      <div class="col-12 d-flex pt-2 pb-2 contact-box contact-${contact.contactID}" onclick="messenger.fetchConversation(${contact.contactID})">
        <img src="${ avatar }" class="contact-avatar rounded-circle"/>
        <div class="m-0 ml-md-3 d-none d-lg-flex d-md-flex d-xl-flex justify-content-center flex-column text-truncate">
            <div class="m-0 text-truncate overflow-hidden contact-name ${contact.lastMessageSenderID !== user.user_id && contact.isSeen === 0 ? 'font-weight-bold' : ''}">${filterXSS(name)}</div>
            <small class="message-excerpt-holder d-flex text-truncate">
                <span class="text-muted mr-1 ${contact.lastMessageSenderID !== user.user_id ? 'd-none' : ''}"> ${trans('You')}: </span>
                <div class="m-0 text-muted contact-message text-truncate ${contact.lastMessageSenderID !== user.user_id && contact.isSeen === 0 ? 'font-weight-bold' : ''}" >${filterXSS(contact.lastMessage)}</div>
                <div class="d-flex"> <div class="font-weight-bold ml-1">${(contact.created_at !== null ? '∙' :'')}</div>${(contact.created_at !== null ? '&nbsp;' + contact.created_at : '')}</div>
            </small>
        </div>
      </div>
    `;}
function messageElement(message){let isSender=false;if(parseInt(message.sender_id)===parseInt(user.user_id)){isSender=true;}
let attachmentsHtml='';message.attachments.map(function(file){attachmentsHtml+=messenger.parseMessageAttachment(file);});if(message.hasUserUnlockedMessage===false&&message.price>0&&!isSender){return`
          <div class="col-12 no-gutters pt-1 pb-1 message-box px-0" data-messageid="${message.id}" id="m-${message.id}">
                    <div class="m-0 paid-message-box message-box text-break alert ${isSender ? 'alert-primary text-white' : 'alert-default'}">
                        <div class="col-12 d-flex mb-2 ${isSender ? 'sender d-flex flex-row-reverse pr-1' : 'pl-0'}">
                            ${message.message === null || app.disableTextPreview === true ? '' : messenger.parseMessage(message.message)}
                        </div>
                        <div class="d-flex justify-content-center">
                        ${lockedMessagePreview({'id' : message.id, 'price': message.price},message.sender)}
                        </div>
                    </div>
                </div>
          </div>
        `;}
else{return`
          <div class="col-12 no-gutters pt-1 pb-1 message-box px-0" data-messageid="${message.id}" id="m-${message.id}">
            ${message.message === null ? '' : messageBubble(isSender, message)}
            ${messageAttachments(isSender, attachmentsHtml, message)}
          </div>
    `;}}
function messageBubble(isSender,message){return`
        <div class="d-flex flex-row">
                <div class="col-12 d-flex  ${isSender ? 'sender d-flex flex-row-reverse pr-1' : 'pl-0'}">
                    <div class="m-0 message-bubble text-break alert ${isSender ? 'alert-primary text-white' : 'alert-default'}">${message.hasUserUnlockedMessage === false && message.price > 0 && !isSender && app.disableTextPreview === true ? '' : messenger.parseMessage(message.message)}</div>
                    ${messageActions(isSender, message)}
                </div>
        </div>
    `;}
function messageAttachments(isSender,attachmentsHtml,message){return`
             <div class="col-12 d-flex  ${isSender ? 'sender d-flex flex-row-reverse pr-1' : 'pl-0'}">
                <div class="attachments-holder row no-gutters flex-row-reverse">
                    ${attachmentsHtml}
                </div>
                ${attachmentsHtml.length ? messageActions(isSender, message) : ''}
            </div>
     `;}
function messageActions(isSender,message){return`
        <div class="d-flex message-actions-wrapper ${isSender ? 'mr-2' : 'ml-2'}">

            ${isSender ? `<div class="d-flex justify-content-center align-items-center pointer-cursor"><div class="to-tooltip message-action-button d-flex justify-content-center align-items-center"data-placement="top"title="${trans('Delete')}"onClick="messenger.showMessageDeleteDialog(${message.id})"><ion-icon name="trash-outline"></ion-icon></div></div>` : ``}


             ${isSender === false ? `<div class="d-flex justify-content-center align-items-center pointer-cursor"><div class="to-tooltip message-action-button d-flex justify-content-center align-items-center"data-placement="top"title="${trans('Report')}"onClick="Lists.showReportBox(${message.sender_id}, null, ${message.id}, null);"><ion-icon name="flag-outline"></ion-icon></div></div>` : ``}

           ${isSender && message.price > 0 ? `<div class="d-flex justify-content-center align-items-center"><div class="to-tooltip message-action-button d-flex justify-content-center align-items-center"data-placement="top"title="${trans('Paid message')}"><ion-icon name="cash-outline"></ion-icon></div></div>` : ``}
      </div>
    `;}
function lockedMessagePreview(messageData,senderData){return`
            <div class="card ${app.theme === 'light' ? 'bg-gradient-faded-light-vertical' : 'bg-gradient-faded-dark-vertical'}">
              <div>
              <div class="lockedPreviewWrapper">
                  <img class="card-img" src="${messengerVars.lockedMessageSVGPath}" >
              </div>
                  <div class="card-img-overlay d-flex flex-column-reverse">
                           ${lockedMessagePaymentButton(messageData, senderData)}
                    </div>
                  </div>
              </div>
            </div>
`;}
function lockedMessagePaymentButton(messageData,senderData){let modalData=`
                        data-toggle="modal"
                        data-target="#checkout-center"
                        data-type="message-unlock"
                        data-recipient-id="${senderData.id}"
                        data-amount="${messageData.price}"
                        data-first-name="${user.billingData.first_name}"
                        data-last-name="${user.billingData.last_name}"
                        data-billing-address="${user.billingData.billing_address}"
                        data-country="${user.billingData.country}"
                        data-city="${user.billingData.city}"
                        data-state="${user.billingData.state}"
                        data-postcode="${user.billingData.postcode}"
                        data-available-credit="${user.billingData.credit}"
                        data-username="${senderData.username}"
                        data-name="${senderData.name}"
                        data-avatar="${senderData.avatar}"
                        data-message-id="${messageData.id}"
    `;if(senderData.canEarnMoney===false){modalData=`
            data-placement="top"
            title="${trans('This creator cannot earn money yet')}"
        `;}
return`
                <button class="btn btn-round btn-primary btn-block d-flex align-items-center justify-content-center justify-content-lg-between mt-2 mb-0 to-tooltip" ${modalData}>
                <span class="d-none d-md-block">${trans('Locked message')}</span>  <span>${trans('Unlock for')} ${getWebsiteFormattedAmount(messageData.price)}</span>
                </button>
    `;}
function noMessagesLabel(){return`
        <div class="d-flex h-100 align-items-center justify-content-center">
            <div class="d-flex"><span>👋 ${trans('You got no messages yet.')} </span><span class="d-none d-md-block d-lg-block d-xl-block">&nbsp;${trans("Say 'Hi!' to someone!")}</span></div>
        </div>
    `;}
function noContactsLabel(){return`<div class="d-flex mt-3 mt-md-2 pl-3 pl-md-0 mb-3 pl-md-0"><span>${trans("Click the text bubble to send a new message.")}</span></div>`;}

/*! selectize.js - v0.13.6 | https://github.com/selectize/selectize.js | Apache License (v2) */!function(root,factory){"function"==typeof define&&define.amd?define("sifter",factory):"object"==typeof exports?module.exports=factory():root.Sifter=factory()}(this,function(){function Sifter(items,settings){this.items=items,this.settings=settings||{diacritics:!0}}Sifter.prototype.tokenize=function(query,respect_word_boundaries){if(!(query=trim(String(query||"").toLowerCase()))||!query.length)return[];for(var regex,letter,tokens=[],words=query.split(/ +/),i=0,n=words.length;i<n;i++){if(regex=escape_regex(words[i]),this.settings.diacritics)for(letter in DIACRITICS)DIACRITICS.hasOwnProperty(letter)&&(regex=regex.replace(new RegExp(letter,"g"),DIACRITICS[letter]));respect_word_boundaries&&(regex="\\b"+regex),tokens.push({string:words[i],regex:new RegExp(regex,"i")})}return tokens},Sifter.prototype.iterator=function(object,callback){var iterator=is_array(object)?Array.prototype.forEach||function(callback){for(var i=0,n=this.length;i<n;i++)callback(this[i],i,this)}:function(callback){for(var key in this)this.hasOwnProperty(key)&&callback(this[key],key,this)};iterator.apply(object,[callback])},Sifter.prototype.getScoreFunction=function(search,options){function scoreValue(value,token){var pos;return!value||-1===(pos=(value=String(value||"")).search(token.regex))?0:(token=token.string.length/value.length,0===pos&&(token+=.5),token)}var field_count,tokens=(search=this.prepareSearch(search,options)).tokens,fields=search.options.fields,token_count=tokens.length,nesting=search.options.nesting,scoreObject=(field_count=fields.length)?1===field_count?function(token,data){return scoreValue(getattr(data,fields[0],nesting),token)}:function(token,data){for(var i=0,sum=0;i<field_count;i++)sum+=scoreValue(getattr(data,fields[i],nesting),token);return sum/field_count}:function(){return 0};return token_count?1===token_count?function(data){return scoreObject(tokens[0],data)}:"and"===search.options.conjunction?function(data){for(var score,i=0,sum=0;i<token_count;i++){if((score=scoreObject(tokens[i],data))<=0)return 0;sum+=score}return sum/token_count}:function(data){for(var i=0,sum=0;i<token_count;i++)sum+=scoreObject(tokens[i],data);return sum/token_count}:function(){return 0}},Sifter.prototype.getSortFunction=function(search,options){var i,n,field,fields_count,multiplier,multipliers,implicit_score,self=this,sort=!(search=self.prepareSearch(search,options)).query&&options.sort_empty||options.sort,get_field=function(name,result){return"$score"===name?result.score:getattr(self.items[result.id],name,options.nesting)},fields=[];if(sort)for(i=0,n=sort.length;i<n;i++)!search.query&&"$score"===sort[i].field||fields.push(sort[i]);if(search.query){for(implicit_score=!0,i=0,n=fields.length;i<n;i++)if("$score"===fields[i].field){implicit_score=!1;break}implicit_score&&fields.unshift({field:"$score",direction:"desc"})}else for(i=0,n=fields.length;i<n;i++)if("$score"===fields[i].field){fields.splice(i,1);break}for(multipliers=[],i=0,n=fields.length;i<n;i++)multipliers.push("desc"===fields[i].direction?-1:1);return(fields_count=fields.length)?1===fields_count?(field=fields[0].field,multiplier=multipliers[0],function(a,b){return multiplier*cmp(get_field(field,a),get_field(field,b))}):function(a,b){for(var field,i=0;i<fields_count;i++)if(field=fields[i].field,field=multipliers[i]*cmp(get_field(field,a),get_field(field,b)))return field;return 0}:null},Sifter.prototype.prepareSearch=function(query,options){if("object"==typeof query)return query;var option_fields=(options=extend({},options)).fields,option_sort=options.sort,option_sort_empty=options.sort_empty;return option_fields&&!is_array(option_fields)&&(options.fields=[option_fields]),option_sort&&!is_array(option_sort)&&(options.sort=[option_sort]),option_sort_empty&&!is_array(option_sort_empty)&&(options.sort_empty=[option_sort_empty]),{options:options,query:String(query||"").toLowerCase(),tokens:this.tokenize(query,options.respect_word_boundaries),total:0,items:[]}},Sifter.prototype.search=function(query,options){var score,fn_score,search=this.prepareSearch(query,options);return options=search.options,query=search.query,fn_score=options.score||this.getScoreFunction(search),query.length?this.iterator(this.items,function(item,id){score=fn_score(item),(!1===options.filter||0<score)&&search.items.push({score:score,id:id})}):this.iterator(this.items,function(item,id){search.items.push({score:1,id:id})}),(query=this.getSortFunction(search,options))&&search.items.sort(query),search.total=search.items.length,"number"==typeof options.limit&&(search.items=search.items.slice(0,options.limit)),search};var cmp=function(a,b){return"number"==typeof a&&"number"==typeof b?b<a?1:a<b?-1:0:(a=asciifold(String(a||"")),(b=asciifold(String(b||"")))<a?1:a<b?-1:0)},extend=function(a,b){for(var k,object,i=1,n=arguments.length;i<n;i++)if(object=arguments[i])for(k in object)object.hasOwnProperty(k)&&(a[k]=object[k]);return a},getattr=function(obj,name,nesting){if(obj&&name){if(!nesting)return obj[name];for(var names=name.split(".");names.length&&(obj=obj[names.shift()]););return obj}},trim=function(str){return(str+"").replace(/^\s+|\s+$|/g,"")},escape_regex=function(str){return(str+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},is_array=Array.isArray||"undefined"!=typeof $&&$.isArray||function(object){return"[object Array]"===Object.prototype.toString.call(object)},DIACRITICS={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄＣｃ]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅＤｄð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇＥｅɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪＩｉ]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟＬｌ]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴＮｎŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},asciifold=function(){var i,n,k,chunk,foreignletters="",lookup={};for(k in DIACRITICS)if(DIACRITICS.hasOwnProperty(k))for(foreignletters+=chunk=DIACRITICS[k].substring(2,DIACRITICS[k].length-1),i=0,n=chunk.length;i<n;i++)lookup[chunk.charAt(i)]=k;var regexp=new RegExp("["+foreignletters+"]","g");return function(str){return str.replace(regexp,function(foreignletter){return lookup[foreignletter]}).toLowerCase()}}();return Sifter}),function(root,factory){"function"==typeof define&&define.amd?define("microplugin",factory):"object"==typeof exports?module.exports=factory():root.MicroPlugin=factory()}(this,function(){var MicroPlugin={mixin:function(Interface){Interface.plugins={},Interface.prototype.initializePlugins=function(plugins){var i,n,key,queue=[];if(this.plugins={names:[],settings:{},requested:{},loaded:{}},utils.isArray(plugins))for(i=0,n=plugins.length;i<n;i++)"string"==typeof plugins[i]?queue.push(plugins[i]):(this.plugins.settings[plugins[i].name]=plugins[i].options,queue.push(plugins[i].name));else if(plugins)for(key in plugins)plugins.hasOwnProperty(key)&&(this.plugins.settings[key]=plugins[key],queue.push(key));for(;queue.length;)this.require(queue.shift())},Interface.prototype.loadPlugin=function(name){var plugins=this.plugins,plugin=Interface.plugins[name];if(!Interface.plugins.hasOwnProperty(name))throw new Error('Unable to find "'+name+'" plugin');plugins.requested[name]=!0,plugins.loaded[name]=plugin.fn.apply(this,[this.plugins.settings[name]||{}]),plugins.names.push(name)},Interface.prototype.require=function(name){var plugins=this.plugins;if(!this.plugins.loaded.hasOwnProperty(name)){if(plugins.requested[name])throw new Error('Plugin has circular dependency ("'+name+'")');this.loadPlugin(name)}return plugins.loaded[name]},Interface.define=function(name,fn){Interface.plugins[name]={name:name,fn:fn}}}},utils={isArray:Array.isArray||function(vArg){return"[object Array]"===Object.prototype.toString.call(vArg)}};return MicroPlugin}),function(root,factory){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],factory):"object"==typeof module&&"object"==typeof module.exports?module.exports=factory(require("jquery"),require("sifter"),require("microplugin")):root.Selectize=factory(root.jQuery,root.Sifter,root.MicroPlugin)}(this,function($,Sifter,MicroPlugin){"use strict";function MicroEvent(){}$.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;var parent=this.parentNode;parent.replaceChild(this.firstChild,this),parent.normalize()}).end()};function uaDetect(platform,re){return navigator.userAgentData?platform===navigator.userAgentData.platform:re.test(navigator.userAgent)}MicroEvent.prototype={on:function(event,fct){this._events=this._events||{},this._events[event]=this._events[event]||[],this._events[event].push(fct)},off:function(event,fct){var n=arguments.length;return 0===n?delete this._events:1===n?delete this._events[event]:(this._events=this._events||{},void(event in this._events!=!1&&this._events[event].splice(this._events[event].indexOf(fct),1)))},trigger:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},MicroEvent.mixin=function(destObject){for(var props=["on","off","trigger"],i=0;i<props.length;i++)destObject.prototype[props[i]]=MicroEvent.prototype[props[i]]};function isset(object){return void 0!==object}function hash_key(value){return null==value?null:"boolean"==typeof value?value?"1":"0":value+""}function escape_html(str){return(str+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function debounce_events(self,types,fn){var type,trigger=self.trigger,event_args={};for(type in self.trigger=function(){var type=arguments[0];if(-1===types.indexOf(type))return trigger.apply(self,arguments);event_args[type]=arguments},fn.apply(self,[]),self.trigger=trigger,event_args)event_args.hasOwnProperty(type)&&trigger.apply(self,event_args[type])}function getSelection(input){var sel,selLen,result={};return void 0===input?console.warn("WARN getSelection cannot locate input control"):"selectionStart"in input?(result.start=input.selectionStart,result.length=input.selectionEnd-result.start):document.selection&&(input.focus(),sel=document.selection.createRange(),selLen=document.selection.createRange().text.length,sel.moveStart("character",-input.value.length),result.start=sel.text.length-selLen,result.length=selLen),result}function measureString(str,$parent){return str?(Selectize.$testInput||(Selectize.$testInput=$("<span />").css({position:"absolute",width:"auto",padding:0,whiteSpace:"pre"}),$("<div />").css({position:"absolute",width:0,height:0,overflow:"hidden"}).append(Selectize.$testInput).appendTo("body")),Selectize.$testInput.text(str),transferStyles($parent,Selectize.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),Selectize.$testInput.width()):0}function autoGrow($input){function update(e,options){var printable,keyCode,selection;options=options||{},(e=e||window.event||{}).metaKey||e.altKey||!options.force&&!1===$input.data("grow")||(options=$input.val(),e.type&&"keydown"===e.type.toLowerCase()&&(printable=48<=(keyCode=e.keyCode)&&keyCode<=57||65<=keyCode&&keyCode<=90||96<=keyCode&&keyCode<=111||186<=keyCode&&keyCode<=222||32===keyCode,46===keyCode||8===keyCode?(selection=getSelection($input[0])).length?options=options.substring(0,selection.start)+options.substring(selection.start+selection.length):8===keyCode&&selection.start?options=options.substring(0,selection.start-1)+options.substring(selection.start+1):46===keyCode&&void 0!==selection.start&&(options=options.substring(0,selection.start)+options.substring(selection.start+1)):printable&&(keyCode=e.shiftKey,selection=String.fromCharCode(e.keyCode),options+=selection=keyCode?selection.toUpperCase():selection.toLowerCase())),e=(printable=$input.attr("placeholder"))?measureString(printable,$input)+4:0,(keyCode=Math.max(measureString(options,$input),e)+4)!==currentWidth&&(currentWidth=keyCode,$input.width(keyCode),$input.triggerHandler("resize")))}var currentWidth=null;$input.on("keydown keyup update blur",update),update()}var options,IS_MAC=uaDetect("macOS",/Mac/),KEY_CMD=IS_MAC?91:17,KEY_CTRL=IS_MAC?18:17,SUPPORTS_VALIDITY_API=!uaDetect("Android",/android/i)&&!!document.createElement("input").validity,hook={before:function(self,method,fn){var original=self[method];self[method]=function(){return fn.apply(self,arguments),original.apply(self,arguments)}},after:function(self,method,fn){var original=self[method];self[method]=function(){var result=original.apply(self,arguments);return fn.apply(self,arguments),result}}},transferStyles=function($from,$to,properties){var i,n,styles={};if(properties)for(i=0,n=properties.length;i<n;i++)styles[properties[i]]=$from.css(properties[i]);else styles=$from.css();$to.css(styles)},Selectize=function($input,settings){var i,n,fn,delay,timeout,input=$input[0],computedStyle=(input.selectize=this,window.getComputedStyle&&window.getComputedStyle(input,null));if(computedStyle=(computedStyle?computedStyle.getPropertyValue("direction"):input.currentStyle&&input.currentStyle.direction)||$input.parents("[dir]:first").attr("dir")||"",$.extend(this,{order:0,settings:settings,$input:$input,tabIndex:$input.attr("tabindex")||"",tagType:"select"===input.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(computedStyle),eventNS:".selectize"+ ++Selectize.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:$input.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",lastValidValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===settings.loadThrottle?this.onSearchChange:(fn=this.onSearchChange,delay=settings.loadThrottle,function(){var self=this,args=arguments;window.clearTimeout(timeout),timeout=window.setTimeout(function(){fn.apply(self,args)},delay)})}),this.sifter=new Sifter(this.options,{diacritics:settings.diacritics}),this.settings.options){for(i=0,n=this.settings.options.length;i<n;i++)this.registerOption(this.settings.options[i]);delete this.settings.options}if(this.settings.optgroups){for(i=0,n=this.settings.optgroups.length;i<n;i++)this.registerOptionGroup(this.settings.optgroups[i]);delete this.settings.optgroups}this.settings.mode=this.settings.mode||(1===this.settings.maxItems?"single":"multi"),"boolean"!=typeof this.settings.hideSelected&&(this.settings.hideSelected="multi"===this.settings.mode),this.initializePlugins(this.settings.plugins),this.setupCallbacks(),this.setupTemplates(),this.setup()};return MicroEvent.mixin(Selectize),void 0!==MicroPlugin?MicroPlugin.mixin(Selectize):(MicroPlugin="Dependency MicroPlugin is missing",options=(options={explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'})||{},console.error("Selectize: "+MicroPlugin),options.explanation&&(console.group&&console.group(),console.error(options.explanation),console.group&&console.groupEnd())),$.extend(Selectize.prototype,{setup:function(){var $parent,inputId,fn,self=this,settings=self.settings,eventNS=self.eventNS,$window=$(window),$document=$(document),$input=self.$input,inputMode=self.settings.mode,classes=$input.attr("class")||"",$wrapper=$("<div>").addClass(settings.wrapperClass).addClass(classes).addClass(inputMode),$control=$("<div>").addClass(settings.inputClass).addClass("items").appendTo($wrapper),$control_input=$('<input type="text" autocomplete="new-password" autofill="no" />').appendTo($control).attr("tabindex",$input.is(":disabled")?"-1":self.tabIndex),$dropdown_parent=$(settings.dropdownParent||$wrapper),inputMode=$("<div>").addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent),$dropdown_parent=$("<div>").addClass(settings.dropdownContentClass).attr("tabindex","-1").appendTo(inputMode);(inputId=$input.attr("id"))&&($control_input.attr("id",inputId+"-selectized"),$("label[for='"+inputId+"']").attr("for",inputId+"-selectized")),self.settings.copyClassesToDropdown&&inputMode.addClass(classes),$wrapper.css({width:$input[0].style.width}),self.plugins.names.length&&(inputId="plugin-"+self.plugins.names.join(" plugin-"),$wrapper.addClass(inputId),inputMode.addClass(inputId)),(null===settings.maxItems||1<settings.maxItems)&&1===self.tagType&&$input.attr("multiple","multiple"),self.settings.placeholder&&$control_input.attr("placeholder",settings.placeholder),!self.settings.splitOn&&self.settings.delimiter&&(classes=self.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),self.settings.splitOn=new RegExp("\\s*"+classes+"+\\s*")),$input.attr("autocorrect")&&$control_input.attr("autocorrect",$input.attr("autocorrect")),$input.attr("autocapitalize")&&$control_input.attr("autocapitalize",$input.attr("autocapitalize")),$input.is("input")&&($control_input[0].type=$input[0].type),self.$wrapper=$wrapper,self.$control=$control,self.$control_input=$control_input,self.$dropdown=inputMode,self.$dropdown_content=$dropdown_parent,inputMode.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",function(e){e.stopImmediatePropagation()}),inputMode.on("mouseenter","[data-selectable]",function(){return self.onOptionHover.apply(self,arguments)}),inputMode.on("mousedown click","[data-selectable]",function(){return self.onOptionSelect.apply(self,arguments)}),inputId="mousedown",classes="*:not(input)",fn=function(){return self.onItemSelect.apply(self,arguments)},($parent=$control).on(inputId,classes,function(e){for(var child=e.target;child&&child.parentNode!==$parent[0];)child=child.parentNode;return e.currentTarget=child,fn.apply(this,[e])}),autoGrow($control_input),$control.on({mousedown:function(){return self.onMouseDown.apply(self,arguments)},click:function(){return self.onClick.apply(self,arguments)}}),$control_input.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return self.onKeyDown.apply(self,arguments)},keypress:function(){return self.onKeyPress.apply(self,arguments)},input:function(){return self.onInput.apply(self,arguments)},resize:function(){self.positionDropdown.apply(self,[])},blur:function(){return self.onBlur.apply(self,arguments)},focus:function(){return self.ignoreBlur=!1,self.onFocus.apply(self,arguments)},paste:function(){return self.onPaste.apply(self,arguments)}}),$document.on("keydown"+eventNS,function(e){self.isCmdDown=e[IS_MAC?"metaKey":"ctrlKey"],self.isCtrlDown=e[IS_MAC?"altKey":"ctrlKey"],self.isShiftDown=e.shiftKey}),$document.on("keyup"+eventNS,function(e){e.keyCode===KEY_CTRL&&(self.isCtrlDown=!1),16===e.keyCode&&(self.isShiftDown=!1),e.keyCode===KEY_CMD&&(self.isCmdDown=!1)}),$document.on("mousedown"+eventNS,function(e){if(self.isFocused){if(e.target===self.$dropdown[0]||e.target.parentNode===self.$dropdown[0])return!1;self.$control.has(e.target).length||e.target===self.$control[0]||self.blur(e.target)}}),$window.on(["scroll"+eventNS,"resize"+eventNS].join(" "),function(){self.isOpen&&self.positionDropdown.apply(self,arguments)}),$window.on("mousemove"+eventNS,function(){self.ignoreHover=!1}),this.revertSettings={$children:$input.children().detach(),tabindex:$input.attr("tabindex")},$input.attr("tabindex",-1).hide().after(self.$wrapper),Array.isArray(settings.items)&&(self.lastValidValue=settings.items,self.setValue(settings.items),delete settings.items),SUPPORTS_VALIDITY_API&&$input.on("invalid"+eventNS,function(e){e.preventDefault(),self.isInvalid=!0,self.refreshState()}),self.updateOriginalInput(),self.refreshItems(),self.refreshState(),self.updatePlaceholder(),self.isSetup=!0,$input.is(":disabled")&&self.disable(),self.on("change",this.onChange),$input.data("selectize",self),$input.addClass("selectized"),self.trigger("initialize"),!0===settings.preload&&self.onSearchChange("")},setupTemplates:function(){var field_label=this.settings.labelField,field_value=this.settings.valueField,field_optgroup=this.settings.optgroupLabelField;this.settings.render=$.extend({},{optgroup:function(data){return'<div class="optgroup">'+data.html+"</div>"},optgroup_header:function(data,escape){return'<div class="optgroup-header">'+escape(data[field_optgroup])+"</div>"},option:function(data,escape){return'<div class="option '+(""===data[field_value]?"selectize-dropdown-emptyoptionlabel":"")+'">'+escape(data[field_label])+"</div>"},item:function(data,escape){return'<div class="item">'+escape(data[field_label])+"</div>"},option_create:function(data,escape){return'<div class="create">Add <strong>'+escape(data.input)+"</strong>&#x2026;</div>"}},this.settings.render)},setupCallbacks:function(){var key,fn,callbacks={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur",dropdown_item_activate:"onDropdownItemActivate",dropdown_item_deactivate:"onDropdownItemDeactivate"};for(key in callbacks)callbacks.hasOwnProperty(key)&&(fn=this.settings[callbacks[key]])&&this.on(key,fn)},onClick:function(e){this.isFocused&&this.isOpen||(this.focus(),e.preventDefault())},onMouseDown:function(e){var self=this,defaultPrevented=e.isDefaultPrevented();$(e.target);if(self.isFocused){if(e.target!==self.$control_input[0])return"single"===self.settings.mode?self.isOpen?self.close():self.open():defaultPrevented||self.setActiveItem(null),!1}else defaultPrevented||window.setTimeout(function(){self.focus()},0)},onChange:function(){""!==this.getValue()&&(this.lastValidValue=this.getValue()),this.$input.trigger("input"),this.$input.trigger("change")},onPaste:function(e){var self=this;self.isFull()||self.isInputHidden||self.isLocked?e.preventDefault():self.settings.splitOn&&setTimeout(function(){var pastedText=self.$control_input.val();if(pastedText.match(self.settings.splitOn))for(var splitInput=pastedText.trim().split(self.settings.splitOn),i=0,n=splitInput.length;i<n;i++)self.createItem(splitInput[i])},0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var character=String.fromCharCode(e.keyCode||e.which);return this.settings.create&&"multi"===this.settings.mode&&character===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){var $next;e.target,this.$control_input[0];if(this.isLocked)9!==e.keyCode&&e.preventDefault();else{switch(e.keyCode){case 65:if(this.isCmdDown)return void this.selectAll();break;case 27:return void(this.isOpen&&(e.preventDefault(),e.stopPropagation(),this.close()));case 78:if(!e.ctrlKey||e.altKey)break;case 40:return!this.isOpen&&this.hasOptions?this.open():this.$activeOption&&(this.ignoreHover=!0,($next=this.getAdjacentOption(this.$activeOption,1)).length&&this.setActiveOption($next,!0,!0)),void e.preventDefault();case 80:if(!e.ctrlKey||e.altKey)break;case 38:return this.$activeOption&&(this.ignoreHover=!0,($next=this.getAdjacentOption(this.$activeOption,-1)).length&&this.setActiveOption($next,!0,!0)),void e.preventDefault();case 13:return void(this.isOpen&&this.$activeOption&&(this.onOptionSelect({currentTarget:this.$activeOption}),e.preventDefault()));case 37:return void this.advanceSelection(-1,e);case 39:return void this.advanceSelection(1,e);case 9:return this.settings.selectOnTab&&this.isOpen&&this.$activeOption&&(this.onOptionSelect({currentTarget:this.$activeOption}),this.isFull()||e.preventDefault()),void(this.settings.create&&this.createItem()&&this.settings.showAddOptionOnCreate&&e.preventDefault());case 8:case 46:return void this.deleteSelection(e)}!this.isFull()&&!this.isInputHidden||(IS_MAC?e.metaKey:e.ctrlKey)||e.preventDefault()}},onInput:function(e){var value=this.$control_input.val()||"";this.lastValue!==value&&(this.lastValue=value,this.onSearchChange(value),this.refreshOptions(),this.trigger("type",value))},onSearchChange:function(value){var self=this,fn=self.settings.load;fn&&!self.loadedSearches.hasOwnProperty(value)&&(self.loadedSearches[value]=!0,self.load(function(callback){fn.apply(self,[value,callback])}))},onFocus:function(e){var wasFocused=this.isFocused;if(this.isDisabled)return this.blur(),e&&e.preventDefault(),!1;this.ignoreFocus||(this.isFocused=!0,"focus"===this.settings.preload&&this.onSearchChange(""),wasFocused||this.trigger("focus"),this.$activeItems.length||(this.showInput(),this.setActiveItem(null),this.refreshOptions(!!this.settings.openOnFocus)),this.refreshState())},onBlur:function(e,dest){var self=this;if(self.isFocused&&(self.isFocused=!1,!self.ignoreFocus)){if(!self.ignoreBlur&&document.activeElement===self.$dropdown_content[0])return self.ignoreBlur=!0,void self.onFocus(e);e=function(){self.close(),self.setTextboxValue(""),self.setActiveItem(null),self.setActiveOption(null),self.setCaret(self.items.length),self.refreshState(),dest&&dest.focus&&dest.focus(),self.isBlurring=!1,self.ignoreFocus=!1,self.trigger("blur")};self.isBlurring=!0,self.ignoreFocus=!0,self.settings.create&&self.settings.createOnBlur?self.createItem(null,!1,e):e()}},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(e){var $target,self=this;e.preventDefault&&(e.preventDefault(),e.stopPropagation()),($target=$(e.currentTarget)).hasClass("create")?self.createItem(null,function(){self.settings.closeAfterSelect&&self.close()}):void 0!==($target=$target.attr("data-value"))&&(self.lastQuery=null,self.setTextboxValue(""),self.addItem($target),self.settings.closeAfterSelect?self.close():!self.settings.hideSelected&&e.type&&/mouse/.test(e.type)&&self.setActiveOption(self.getOption($target)))},onItemSelect:function(e){this.isLocked||"multi"===this.settings.mode&&(e.preventDefault(),this.setActiveItem(e.currentTarget,e))},load:function(fn){var self=this,$wrapper=self.$wrapper.addClass(self.settings.loadingClass);self.loading++,fn.apply(self,[function(results){self.loading=Math.max(self.loading-1,0),results&&results.length&&(self.addOption(results),self.refreshOptions(self.isFocused&&!self.isInputHidden)),self.loading||$wrapper.removeClass(self.settings.loadingClass),self.trigger("load",results)}])},getTextboxValue:function(){return this.$control_input.val()},setTextboxValue:function(value){var $input=this.$control_input;$input.val()!==value&&($input.val(value).triggerHandler("update"),this.lastValue=value)},getValue:function(){return 1===this.tagType&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(value,silent){debounce_events(this,silent?[]:["change"],function(){this.clear(silent),this.addItems(value,silent)})},setMaxItems:function(value){this.settings.maxItems=value=0===value?null:value,this.settings.mode=this.settings.mode||(1===this.settings.maxItems?"single":"multi"),this.refreshState()},setActiveItem:function($item,e){var eventName,i,end,item,swap,$last;if("single"!==this.settings.mode){if(!($item=$($item)).length)return $(this.$activeItems).removeClass("active"),this.$activeItems=[],void(this.isFocused&&this.showInput());if("mousedown"===(eventName=e&&e.type.toLowerCase())&&this.isShiftDown&&this.$activeItems.length){for($last=this.$control.children(".active:last"),$last=Array.prototype.indexOf.apply(this.$control[0].childNodes,[$last[0]]),(end=Array.prototype.indexOf.apply(this.$control[0].childNodes,[$item[0]]))<$last&&(swap=$last,$last=end,end=swap),i=$last;i<=end;i++)item=this.$control[0].childNodes[i],-1===this.$activeItems.indexOf(item)&&($(item).addClass("active"),this.$activeItems.push(item));e.preventDefault()}else"mousedown"===eventName&&this.isCtrlDown||"keydown"===eventName&&this.isShiftDown?$item.hasClass("active")?(swap=this.$activeItems.indexOf($item[0]),this.$activeItems.splice(swap,1),$item.removeClass("active")):this.$activeItems.push($item.addClass("active")[0]):($(this.$activeItems).removeClass("active"),this.$activeItems=[$item.addClass("active")[0]]);this.hideInput(),this.isFocused||this.focus()}},setActiveOption:function($option,scroll,animate){var height_item,y,scroll_top,scroll_bottom;this.$activeOption&&(this.$activeOption.removeClass("active"),this.trigger("dropdown_item_deactivate",this.$activeOption.attr("data-value"))),this.$activeOption=null,($option=$($option)).length&&(this.$activeOption=$option.addClass("active"),this.isOpen&&this.trigger("dropdown_item_activate",this.$activeOption.attr("data-value")),!scroll&&isset(scroll)||($option=this.$dropdown_content.height(),height_item=this.$activeOption.outerHeight(!0),scroll=this.$dropdown_content.scrollTop()||0,scroll_bottom=(scroll_top=y=this.$activeOption.offset().top-this.$dropdown_content.offset().top+scroll)-$option+height_item,$option+scroll<y+height_item?this.$dropdown_content.stop().animate({scrollTop:scroll_bottom},animate?this.settings.scrollDuration:0):y<scroll&&this.$dropdown_content.stop().animate({scrollTop:scroll_top},animate?this.settings.scrollDuration:0)))},selectAll:function(){"single"!==this.settings.mode&&(this.$activeItems=Array.prototype.slice.apply(this.$control.children(":not(input)").addClass("active")),this.$activeItems.length&&(this.hideInput(),this.close()),this.focus())},hideInput:function(){this.setTextboxValue(""),this.$control_input.css({opacity:0,position:"absolute",left:this.rtl?1e4:-1e4}),this.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var self=this;return self.isDisabled||(self.ignoreFocus=!0,self.$control_input[0].focus(),window.setTimeout(function(){self.ignoreFocus=!1,self.onFocus()},0)),self},blur:function(dest){return this.$control_input[0].blur(),this.onBlur(null,dest),this},getScoreFunction:function(query){return this.sifter.getScoreFunction(query,this.getSearchOptions())},getSearchOptions:function(){var settings=this.settings,sort=settings.sortField;return{fields:settings.searchField,conjunction:settings.searchConjunction,sort:sort="string"==typeof sort?[{field:sort}]:sort,nesting:settings.nesting}},search:function(query){var i,result,calculateScore,settings=this.settings,options=this.getSearchOptions();if(settings.score&&"function"!=typeof(calculateScore=this.settings.score.apply(this,[query])))throw new Error('Selectize "score" setting must be a function that returns a function');if(query!==this.lastQuery?(this.lastQuery=query,result=this.sifter.search(query,$.extend(options,{score:calculateScore})),this.currentResults=result):result=$.extend(!0,{},this.currentResults),settings.hideSelected)for(i=result.items.length-1;0<=i;i--)-1!==this.items.indexOf(hash_key(result.items[i].id))&&result.items.splice(i,1);return result},refreshOptions:function(triggerDropdown){void 0===triggerDropdown&&(triggerDropdown=!0);var i,j,k,groups,groups_order,option,option_html,optgroup,optgroups,html,html_children,has_create_option,$active,$create,d,tmp,self=this,query=self.$control_input.val().trim(),results=self.search(query),$dropdown_content=self.$dropdown_content,active_before=self.$activeOption&&hash_key(self.$activeOption.attr("data-value")),n=results.items.length;for("number"==typeof self.settings.maxOptions&&(n=Math.min(n,self.settings.maxOptions)),groups={},groups_order=[],i=0;i<n;i++)for(option=self.options[results.items[i].id],option_html=self.render("option",option),optgroup=option[self.settings.optgroupField]||"",j=0,k=(optgroups=Array.isArray(optgroup)?optgroup:[optgroup])&&optgroups.length;j<k;j++)optgroup=optgroups[j],self.optgroups.hasOwnProperty(optgroup)||(optgroup=""),groups.hasOwnProperty(optgroup)||(groups[optgroup]=document.createDocumentFragment(),groups_order.push(optgroup)),groups[optgroup].appendChild(option_html);for(this.settings.lockOptgroupOrder&&groups_order.sort(function(a,b){return(self.optgroups[a]&&self.optgroups[a].$order||0)-(self.optgroups[b]&&self.optgroups[b].$order||0)}),html=document.createDocumentFragment(),i=0,n=groups_order.length;i<n;i++)optgroup=groups_order[i],self.optgroups.hasOwnProperty(optgroup)&&groups[optgroup].childNodes.length?((html_children=document.createDocumentFragment()).appendChild(self.render("optgroup_header",self.optgroups[optgroup])),html_children.appendChild(groups[optgroup]),html.appendChild(self.render("optgroup",$.extend({},self.optgroups[optgroup],{html:(d=html_children,tmp=void 0,(tmp=document.createElement("div")).appendChild(d.cloneNode(!0)),tmp.innerHTML),dom:html_children})))):html.appendChild(groups[optgroup]);if($dropdown_content.html(html),self.settings.highlight&&($dropdown_content.removeHighlight(),results.query.length&&results.tokens.length))for(i=0,n=results.tokens.length;i<n;i++)!function($element,pattern){var regex,highlight;if("string"!=typeof pattern||pattern.length)regex="string"==typeof pattern?new RegExp(pattern,"i"):pattern,highlight=function(node){var skip=0;if(3===node.nodeType){var spannode,match,pos=node.data.search(regex);0<=pos&&0<node.data.length&&(match=node.data.match(regex),(spannode=document.createElement("span")).className="highlight",(pos=node.splitText(pos)).splitText(match[0].length),match=pos.cloneNode(!0),spannode.appendChild(match),pos.parentNode.replaceChild(spannode,pos),skip=1)}else if(1===node.nodeType&&node.childNodes&&!/(script|style)/i.test(node.tagName)&&("highlight"!==node.className||"SPAN"!==node.tagName))for(var i=0;i<node.childNodes.length;++i)i+=highlight(node.childNodes[i]);return skip},$element.each(function(){highlight(this)})}($dropdown_content,results.tokens[i].regex);if(!self.settings.hideSelected)for(self.$dropdown.find(".selected").removeClass("selected"),i=0,n=self.items.length;i<n;i++)self.getOption(self.items[i]).addClass("selected");(has_create_option=self.canCreate(query))&&self.settings.showAddOptionOnCreate&&($dropdown_content.prepend(self.render("option_create",{input:query})),$create=$($dropdown_content[0].childNodes[0])),self.hasOptions=0<results.items.length||has_create_option&&self.settings.showAddOptionOnCreate,self.hasOptions?(0<results.items.length?(query=active_before&&self.getOption(active_before),""!==results.query&&query&&query.length?$active=query:"single"===self.settings.mode&&self.items.length&&($active=self.getOption(self.items[0])),$active&&$active.length||($active=$create&&!self.settings.addPrecedence?self.getAdjacentOption($create,1):$dropdown_content.find("[data-selectable]:first"))):$active=$create,self.setActiveOption($active),triggerDropdown&&!self.isOpen&&self.open()):(self.setActiveOption(null),triggerDropdown&&self.isOpen&&self.close())},addOption:function(data){var i,n,value;if(Array.isArray(data))for(i=0,n=data.length;i<n;i++)this.addOption(data[i]);else(value=this.registerOption(data))&&(this.userOptions[value]=!0,this.lastQuery=null,this.trigger("option_add",value,data))},registerOption:function(data){var key=hash_key(data[this.settings.valueField]);return null!=key&&!this.options.hasOwnProperty(key)&&(data.$order=data.$order||++this.order,this.options[key]=data,key)},registerOptionGroup:function(data){var key=hash_key(data[this.settings.optgroupValueField]);return!!key&&(data.$order=data.$order||++this.order,this.optgroups[key]=data,key)},addOptionGroup:function(id,data){data[this.settings.optgroupValueField]=id,(id=this.registerOptionGroup(data))&&this.trigger("optgroup_add",id,data)},removeOptionGroup:function(id){this.optgroups.hasOwnProperty(id)&&(delete this.optgroups[id],this.renderCache={},this.trigger("optgroup_remove",id))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(value,data){var value_new,index_item,order_old;if(value=hash_key(value),value_new=hash_key(data[this.settings.valueField]),null!==value&&this.options.hasOwnProperty(value)){if("string"!=typeof value_new)throw new Error("Value must be set in option data");order_old=this.options[value].$order,value_new!==value&&(delete this.options[value],-1!==(index_item=this.items.indexOf(value))&&this.items.splice(index_item,1,value_new)),data.$order=data.$order||order_old,this.options[value_new]=data,index_item=this.renderCache.item,order_old=this.renderCache.option,index_item&&(delete index_item[value],delete index_item[value_new]),order_old&&(delete order_old[value],delete order_old[value_new]),-1!==this.items.indexOf(value_new)&&(index_item=this.getItem(value),order_old=$(this.render("item",data)),index_item.hasClass("active")&&order_old.addClass("active"),index_item.replaceWith(order_old)),this.lastQuery=null,this.isOpen&&this.refreshOptions(!1)}},removeOption:function(value,silent){value=hash_key(value);var cache_items=this.renderCache.item,cache_options=this.renderCache.option;cache_items&&delete cache_items[value],cache_options&&delete cache_options[value],delete this.userOptions[value],delete this.options[value],this.lastQuery=null,this.trigger("option_remove",value),this.removeItem(value,silent)},clearOptions:function(silent){var self=this,options=(self.loadedSearches={},self.userOptions={},self.renderCache={},self.options);$.each(self.options,function(key,value){-1==self.items.indexOf(key)&&delete options[key]}),self.options=self.sifter.items=options,self.lastQuery=null,self.trigger("option_clear"),self.clear(silent)},getOption:function(value){return this.getElementWithValue(value,this.$dropdown_content.find("[data-selectable]"))},getFirstOption:function(){var $options=this.$dropdown.find("[data-selectable]");return 0<$options.length?$options.eq(0):$()},getAdjacentOption:function($option,direction){var $options=this.$dropdown.find("[data-selectable]"),$option=$options.index($option)+direction;return 0<=$option&&$option<$options.length?$options.eq($option):$()},getElementWithValue:function(value,$els){if(null!=(value=hash_key(value)))for(var i=0,n=$els.length;i<n;i++)if($els[i].getAttribute("data-value")===value)return $($els[i]);return $()},getElementWithTextContent:function(textContent,ignoreCase,$els){if(null!=(textContent=hash_key(textContent)))for(var i=0,n=$els.length;i<n;i++){var eleTextContent=$els[i].textContent;if(1==ignoreCase&&(eleTextContent=null!==eleTextContent?eleTextContent.toLowerCase():null,textContent=textContent.toLowerCase()),eleTextContent===textContent)return $($els[i])}return $()},getItem:function(value){return this.getElementWithValue(value,this.$control.children())},getFirstItemMatchedByTextContent:function(textContent,ignoreCase){return this.getElementWithTextContent(textContent,ignoreCase=null!==ignoreCase&&!0===ignoreCase,this.$dropdown_content.find("[data-selectable]"))},addItems:function(values,silent){this.buffer=document.createDocumentFragment();for(var childNodes=this.$control[0].childNodes,i=0;i<childNodes.length;i++)this.buffer.appendChild(childNodes[i]);for(var items=Array.isArray(values)?values:[values],i=0,n=items.length;i<n;i++)this.isPending=i<n-1,this.addItem(items[i],silent);values=this.$control[0];values.insertBefore(this.buffer,values.firstChild),this.buffer=null},addItem:function(value,silent){debounce_events(this,silent?[]:["change"],function(){var $item,$option,wasFull,inputMode=this.settings.mode;value=hash_key(value),-1!==this.items.indexOf(value)?"single"===inputMode&&this.close():this.options.hasOwnProperty(value)&&("single"===inputMode&&this.clear(silent),"multi"===inputMode&&this.isFull()||($item=$(this.render("item",this.options[value])),wasFull=this.isFull(),this.items.splice(this.caretPos,0,value),this.insertAtCaret($item),this.isPending&&(wasFull||!this.isFull())||this.refreshState(),this.isSetup&&(wasFull=this.$dropdown_content.find("[data-selectable]"),this.isPending||($option=this.getOption(value),$option=this.getAdjacentOption($option,1).attr("data-value"),this.refreshOptions(this.isFocused&&"single"!==inputMode),$option&&this.setActiveOption(this.getOption($option))),!wasFull.length||this.isFull()?this.close():this.isPending||this.positionDropdown(),this.updatePlaceholder(),this.trigger("item_add",value,$item),this.isPending||this.updateOriginalInput({silent:silent}))))})},removeItem:function(value,silent){var i,idx,$item=value instanceof $?value:this.getItem(value);value=hash_key($item.attr("data-value")),-1!==(i=this.items.indexOf(value))&&(this.trigger("item_before_remove",value,$item),$item.remove(),$item.hasClass("active")&&(idx=this.$activeItems.indexOf($item[0]),this.$activeItems.splice(idx,1)),this.items.splice(i,1),this.lastQuery=null,!this.settings.persist&&this.userOptions.hasOwnProperty(value)&&this.removeOption(value,silent),i<this.caretPos&&this.setCaret(this.caretPos-1),this.refreshState(),this.updatePlaceholder(),this.updateOriginalInput({silent:silent}),this.positionDropdown(),this.trigger("item_remove",value,$item))},createItem:function(input,triggerDropdown){var self=this,caret=self.caretPos,callback=(input=input||(self.$control_input.val()||"").trim(),arguments[arguments.length-1]);if("function"!=typeof callback&&(callback=function(){}),"boolean"!=typeof triggerDropdown&&(triggerDropdown=!0),!self.canCreate(input))return callback(),!1;self.lock();var fn,called,setup="function"==typeof self.settings.create?this.settings.create:function(input){var data={},input=data[self.settings.labelField]=input;if(!self.settings.formatValueToKey||"function"!=typeof self.settings.formatValueToKey||null!=(input=self.settings.formatValueToKey.apply(this,[input]))&&"object"!=typeof input&&"function"!=typeof input)return data[self.settings.valueField]=input,data;throw new Error('Selectize "formatValueToKey" setting must be a function that returns a value other than object or function.')},create=(called=!(fn=function(data){return self.unlock(),!data||"object"!=typeof data||"string"!=typeof(value=hash_key(data[self.settings.valueField]))?callback():(self.setTextboxValue(""),self.addOption(data),self.setCaret(caret),self.addItem(value),self.refreshOptions(triggerDropdown&&"single"!==self.settings.mode),void callback(data));var value}),function(){called||(called=!0,fn.apply(this,arguments))}),setup=setup.apply(this,[input,create]);return void 0!==setup&&create(setup),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var invalid=!this.items.length;this.isInvalid=invalid,this.$control_input.prop("required",invalid),this.$input.prop("required",!invalid)},refreshClasses:function(){var isFull=this.isFull(),isLocked=this.isLocked;this.$wrapper.toggleClass("rtl",this.rtl),this.$control.toggleClass("focus",this.isFocused).toggleClass("disabled",this.isDisabled).toggleClass("required",this.isRequired).toggleClass("invalid",this.isInvalid).toggleClass("locked",isLocked).toggleClass("full",isFull).toggleClass("not-full",!isFull).toggleClass("input-active",this.isFocused&&!this.isInputHidden).toggleClass("dropdown-active",this.isOpen).toggleClass("has-options",!$.isEmptyObject(this.options)).toggleClass("has-items",0<this.items.length),this.$control_input.data("grow",!isFull&&!isLocked)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(opts){var i,n,options,label;if(opts=opts||{},1===this.tagType){for(options=[],i=0,n=this.items.length;i<n;i++)label=this.options[this.items[i]][this.settings.labelField]||"",options.push('<option value="'+escape_html(this.items[i])+'" selected="selected">'+escape_html(label)+"</option>");options.length||this.$input.attr("multiple")||options.push('<option value="" selected="selected"></option>'),this.$input.html(options.join(""))}else this.$input.val(this.getValue()),this.$input.attr("value",this.$input.val());this.isSetup&&!opts.silent&&this.trigger("change",this.$input.val())},updatePlaceholder:function(){var $input;this.settings.placeholder&&($input=this.$control_input,this.items.length?$input.removeAttr("placeholder"):$input.attr("placeholder",this.settings.placeholder),$input.triggerHandler("update",{force:!0}))},open:function(){this.isLocked||this.isOpen||"multi"===this.settings.mode&&this.isFull()||(this.focus(),this.isOpen=!0,this.refreshState(),this.$dropdown.css({visibility:"hidden",display:"block"}),this.positionDropdown(),this.$dropdown.css({visibility:"visible"}),this.trigger("dropdown_open",this.$dropdown))},close:function(){var trigger=this.isOpen;"single"===this.settings.mode&&this.items.length&&(this.hideInput(),this.isBlurring&&this.$control_input.blur()),this.isOpen=!1,this.$dropdown.hide(),this.setActiveOption(null),this.refreshState(),trigger&&this.trigger("dropdown_close",this.$dropdown)},positionDropdown:function(){var $control=this.$control,offset="body"===this.settings.dropdownParent?$control.offset():$control.position();offset.top+=$control.outerHeight(!0),this.$dropdown.css({width:$control[0].getBoundingClientRect().width,top:offset.top,left:offset.left})},clear:function(silent){this.items.length&&(this.$control.children(":not(input)").remove(),this.items=[],this.lastQuery=null,this.setCaret(0),this.setActiveItem(null),this.updatePlaceholder(),this.updateOriginalInput({silent:silent}),this.refreshState(),this.showInput(),this.trigger("clear"))},insertAtCaret:function($el){var caret=Math.min(this.caretPos,this.items.length),$el=$el[0],target=this.buffer||this.$control[0];0===caret?target.insertBefore($el,target.firstChild):target.insertBefore($el,target.childNodes[caret]),this.setCaret(caret+1)},deleteSelection:function(e){var i,n,values,option_select,$tail,direction=e&&8===e.keyCode?-1:1,selection=getSelection(this.$control_input[0]);if(this.$activeOption&&!this.settings.hideSelected&&(option_select=("string"==typeof this.settings.deselectBehavior&&"top"===this.settings.deselectBehavior?this.getFirstOption():this.getAdjacentOption(this.$activeOption,-1)).attr("data-value")),values=[],this.$activeItems.length){for($tail=this.$control.children(".active:"+(0<direction?"last":"first")),$tail=this.$control.children(":not(input)").index($tail),0<direction&&$tail++,i=0,n=this.$activeItems.length;i<n;i++)values.push($(this.$activeItems[i]).attr("data-value"));e&&(e.preventDefault(),e.stopPropagation())}else(this.isFocused||"single"===this.settings.mode)&&this.items.length&&(direction<0&&0===selection.start&&0===selection.length?values.push(this.items[this.caretPos-1]):0<direction&&selection.start===this.$control_input.val().length&&values.push(this.items[this.caretPos]));if(!values.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete.apply(this,[values]))return!1;for(void 0!==$tail&&this.setCaret($tail);values.length;)this.removeItem(values.pop());return this.showInput(),this.positionDropdown(),this.refreshOptions(!0),option_select&&(e=this.getOption(option_select)).length&&this.setActiveOption(e),!0},advanceSelection:function(direction,e){var tail,valueLength,selection;0!==direction&&(this.rtl&&(direction*=-1),tail=0<direction?"last":"first",selection=getSelection(this.$control_input[0]),this.isFocused&&!this.isInputHidden?(valueLength=this.$control_input.val().length,(direction<0?0!==selection.start||0!==selection.length:selection.start!==valueLength)||valueLength||this.advanceCaret(direction,e)):(selection=this.$control.children(".active:"+tail)).length&&(valueLength=this.$control.children(":not(input)").index(selection),this.setActiveItem(null),this.setCaret(0<direction?valueLength+1:valueLength)))},advanceCaret:function(direction,e){var $adj;0!==direction&&(this.isShiftDown?($adj=this.$control_input[0<direction?"next":"prev"]()).length&&(this.hideInput(),this.setActiveItem($adj),e&&e.preventDefault()):this.setCaret(this.caretPos+direction))},setCaret:function(i){if(i="single"===this.settings.mode?this.items.length:Math.max(0,Math.min(this.items.length,i)),!this.isPending)for(var $child,$children=this.$control.children(":not(input)"),j=0,n=$children.length;j<n;j++)$child=$($children[j]).detach(),j<i?this.$control_input.before($child):this.$control.append($child);this.caretPos=i},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){this.$input.prop("disabled",!0),this.$control_input.prop("disabled",!0).prop("tabindex",-1),this.isDisabled=!0,this.lock()},enable:function(){this.$input.prop("disabled",!1),this.$control_input.prop("disabled",!1).prop("tabindex",this.tabIndex),this.isDisabled=!1,this.unlock()},destroy:function(){var eventNS=this.eventNS,revertSettings=this.revertSettings;this.trigger("destroy"),this.off(),this.$wrapper.remove(),this.$dropdown.remove(),this.$input.html("").append(revertSettings.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:revertSettings.tabindex}).show(),this.$control_input.removeData("grow"),this.$input.removeData("selectize"),0==--Selectize.count&&Selectize.$testInput&&(Selectize.$testInput.remove(),Selectize.$testInput=void 0),$(window).off(eventNS),$(document).off(eventNS),$(document.body).off(eventNS),delete this.$input[0].selectize},render:function(templateName,data){var value,id,html="",cache=!1;return(cache="option"!==templateName&&"item"!==templateName?cache:!!(value=hash_key(data[this.settings.valueField])))&&(isset(this.renderCache[templateName])||(this.renderCache[templateName]={}),this.renderCache[templateName].hasOwnProperty(value))?this.renderCache[templateName][value]:(html=$(this.settings.render[templateName].apply(this,[data,escape_html])),"option"===templateName||"option_create"===templateName?data[this.settings.disabledField]||html.attr("data-selectable",""):"optgroup"===templateName&&(id=data[this.settings.optgroupValueField]||"",html.attr("data-group",id),data[this.settings.disabledField]&&html.attr("data-disabled","")),"option"!==templateName&&"item"!==templateName||html.attr("data-value",value||""),cache&&(this.renderCache[templateName][value]=html[0]),html[0])},clearCache:function(templateName){void 0===templateName?this.renderCache={}:delete this.renderCache[templateName]},canCreate:function(input){if(!this.settings.create)return!1;var filter=this.settings.createFilter;return input.length&&("function"!=typeof filter||filter.apply(this,[input]))&&("string"!=typeof filter||new RegExp(filter).test(input))&&(!(filter instanceof RegExp)||filter.test(input))}}),Selectize.count=0,Selectize.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,showAddOptionOnCreate:!0,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!0,preload:!1,allowEmptyOption:!1,showEmptyOptionInDropdown:!1,emptyOptionLabel:"--",closeAfterSelect:!1,scrollDuration:60,deselectBehavior:"previous",loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},$.fn.selectize=function(settings_user){function init_select($input,settings_element){function addOption($option,group){$option=$($option);var arr,value=hash_key($option.val());(value||settings.allowEmptyOption)&&(optionsMap.hasOwnProperty(value)?group&&((arr=optionsMap[value][field_optgroup])?$.isArray(arr)?arr.push(group):optionsMap[value][field_optgroup]=[arr,group]:optionsMap[value][field_optgroup]=group):((arr=readData($option)||{})[field_label]=arr[field_label]||$option.text(),arr[field_value]=arr[field_value]||value,arr[field_disabled]=arr[field_disabled]||$option.prop("disabled"),arr[field_optgroup]=arr[field_optgroup]||group,optionsMap[value]=arr,options.push(arr),$option.is(":selected")&&settings_element.items.push(value)))}var i,n,tagName,$children,options=settings_element.options,optionsMap={},readData=function($el){$el=attr_data&&$el.attr(attr_data);return"string"==typeof $el&&$el.length?JSON.parse($el):null};for(settings_element.maxItems=$input.attr("multiple")?null:1,i=0,n=($children=$input.children()).length;i<n;i++)"optgroup"===(tagName=$children[i].tagName.toLowerCase())?function($optgroup){var i,n,id,optgroup,$options;for((id=($optgroup=$($optgroup)).attr("label"))&&((optgroup=readData($optgroup)||{})[field_optgroup_label]=id,optgroup[field_optgroup_value]=id,optgroup[field_disabled]=$optgroup.prop("disabled"),settings_element.optgroups.push(optgroup)),i=0,n=($options=$("option",$optgroup)).length;i<n;i++)addOption($options[i],id)}($children[i]):"option"===tagName&&addOption($children[i])}var defaults=$.fn.selectize.defaults,settings=$.extend({},defaults,settings_user),attr_data=settings.dataAttr,field_label=settings.labelField,field_value=settings.valueField,field_disabled=settings.disabledField,field_optgroup=settings.optgroupField,field_optgroup_label=settings.optgroupLabelField,field_optgroup_value=settings.optgroupValueField;return this.each(function(){var $input,tag_name,placeholder,input_html;this.selectize||($input=$(this),tag_name=this.tagName.toLowerCase(),(placeholder=$input.attr("placeholder")||$input.attr("data-placeholder"))||settings.allowEmptyOption||(placeholder=$input.children('option[value=""]').text()),settings.allowEmptyOption&&settings.showEmptyOptionInDropdown&&!$input.children('option[value=""]').length&&(input_html=$input.html(),$input.html('<option value="">'+settings.emptyOptionLabel+"</option>"+input_html)),("select"===tag_name?init_select:function($input,settings_element){var i,n,values,option,data_raw=$input.attr(attr_data);if(data_raw)for(settings_element.options=JSON.parse(data_raw),i=0,n=settings_element.options.length;i<n;i++)settings_element.items.push(settings_element.options[i][field_value]);else{data_raw=$.trim($input.val()||"");if(settings.allowEmptyOption||data_raw.length){for(i=0,n=(values=data_raw.split(settings.delimiter)).length;i<n;i++)(option={})[field_label]=values[i],option[field_value]=values[i],settings_element.options.push(option);settings_element.items=values}}})($input,input_html={placeholder:placeholder,options:[],optgroups:[],items:[]}),new Selectize($input,$.extend(!0,{},defaults,input_html,settings_user)).settings_user=settings_user)})},$.fn.selectize.defaults=Selectize.defaults,$.fn.selectize.support={validity:SUPPORTS_VALIDITY_API},Selectize.define("auto_position",function(){const POSITION={top:"top",bottom:"bottom"};this.positionDropdown=function(){const $control=this.$control,offset="body"===this.settings.dropdownParent?$control.offset():$control.position();offset.top+=$control.outerHeight(!0);var dropdownHeight=this.$dropdown.prop("scrollHeight")+5,dropdownHeight=this.$control.get(0).getBoundingClientRect().top+dropdownHeight+this.$wrapper.height()>window.innerHeight?POSITION.top:POSITION.bottom,styles={width:$control.outerWidth(),left:offset.left};dropdownHeight===POSITION.top?(Object.assign(styles,{bottom:offset.top,top:"unset",margin:"0 0 5px 0"}),this.$dropdown.addClass("selectize-position-top")):(Object.assign(styles,{top:offset.top,bottom:"unset",margin:"5px 0 0 0"}),this.$dropdown.removeClass("selectize-position-top")),this.$dropdown.css(styles)}}),Selectize.define("auto_select_on_type",function(options){var originalBlur,self=this;self.onBlur=(originalBlur=self.onBlur,function(e){var $matchedItem=self.getFirstItemMatchedByTextContent(self.lastValue,!0);return void 0!==$matchedItem.attr("data-value")&&self.getValue()!==$matchedItem.attr("data-value")&&self.setValue($matchedItem.attr("data-value")),originalBlur.apply(this,arguments)})}),Selectize.define("autofill_disable",function(options){var original,self=this;self.setup=(original=self.setup,function(){original.apply(self,arguments),self.$control_input.attr({autocomplete:"new-password",autofill:"no"})})}),Selectize.define("drag_drop",function(options){if(!$.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');var self,original;"multi"===this.settings.mode&&((self=this).lock=(original=self.lock,function(){var sortable=self.$control.data("sortable");return sortable&&sortable.disable(),original.apply(self,arguments)}),self.unlock=function(){var original=self.unlock;return function(){var sortable=self.$control.data("sortable");return sortable&&sortable.enable(),original.apply(self,arguments)}}(),self.setup=function(){var original=self.setup;return function(){original.apply(this,arguments);var $control=self.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:self.isLocked,start:function(e,ui){ui.placeholder.css("width",ui.helper.css("width")),$control.addClass("dragging")},stop:function(){$control.removeClass("dragging");var active=self.$activeItems?self.$activeItems.slice():null,values=[];$control.children("[data-value]").each(function(){values.push($(this).attr("data-value"))}),self.isFocused=!1,self.setValue(values),self.isFocused=!0,self.setActiveItem(active),self.positionDropdown()}})}}())}),Selectize.define("dropdown_header",function(options){var original,self=this;options=$.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(data){return'<div class="'+data.headerClass+'"><div class="'+data.titleRowClass+'"><span class="'+data.labelClass+'">'+data.title+'</span><a href="javascript:void(0)" class="'+data.closeClass+'">&#xd7;</a></div></div>'}},options),self.setup=(original=self.setup,function(){original.apply(self,arguments),self.$dropdown_header=$(options.html(options)),self.$dropdown.prepend(self.$dropdown_header)})}),Selectize.define("optgroup_columns",function(options){function equalizeSizes(){var i,height_max,width,width_parent,$optgroups=$("[data-group]",self.$dropdown_content),n=$optgroups.length;if(n&&self.$dropdown_content.width()){if(options.equalizeHeight){for(i=height_max=0;i<n;i++)height_max=Math.max(height_max,$optgroups.eq(i).height());$optgroups.css({height:height_max})}options.equalizeWidth&&(width_parent=self.$dropdown_content.innerWidth()-getScrollbarWidth(),width=Math.round(width_parent/n),$optgroups.css({width:width}),1<n&&(width_parent=width_parent-width*(n-1),$optgroups.eq(n-1).css({width:width_parent})))}}var original,self=this,getScrollbarWidth=(options=$.extend({equalizeWidth:!0,equalizeHeight:!0},options),this.getAdjacentOption=function($option,direction){var $options=$option.closest("[data-group]").find("[data-selectable]"),$option=$options.index($option)+direction;return 0<=$option&&$option<$options.length?$options.eq($option):$()},this.onKeyDown=(original=self.onKeyDown,function(e){var index,$optgroup;if(!this.isOpen||37!==e.keyCode&&39!==e.keyCode)return original.apply(this,arguments);self.ignoreHover=!0,index=($optgroup=this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption),($optgroup=(e=($optgroup=37===e.keyCode?$optgroup.prev("[data-group]"):$optgroup.next("[data-group]")).find("[data-selectable]")).eq(Math.min(e.length-1,index))).length&&this.setActiveOption($optgroup)}),function(){var div,width=getScrollbarWidth.width,doc=document;return void 0===width&&((div=doc.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',div=div.firstChild,doc.body.appendChild(div),width=getScrollbarWidth.width=div.offsetWidth-div.clientWidth,doc.body.removeChild(div)),width});(options.equalizeHeight||options.equalizeWidth)&&(hook.after(this,"positionDropdown",equalizeSizes),hook.after(this,"refreshOptions",equalizeSizes))}),Selectize.define("remove_button",function(options){options=$.extend({label:"&#xd7;",title:"Remove",className:"remove",append:!0},options),("single"===this.settings.mode?function(thisRef,options){options.className="remove-single";var original,self=thisRef,html='<a href="javascript:void(0)" class="'+options.className+'" tabindex="-1" title="'+escape_html(options.title)+'">'+options.label+"</a>";thisRef.setup=(original=self.setup,function(){var id,render_item;options.append&&(id=$(self.$input.context).attr("id"),$("#"+id),render_item=self.settings.render.item,self.settings.render.item=function(data){return html_container=render_item.apply(thisRef,arguments),html_element=html,$("<span>").append(html_container).append(html_element);var html_container,html_element}),original.apply(thisRef,arguments),thisRef.$control.on("click","."+options.className,function(e){e.preventDefault(),self.isLocked||self.clear()})})}:function(thisRef,options){var original,self=thisRef,html='<a href="javascript:void(0)" class="'+options.className+'" tabindex="-1" title="'+escape_html(options.title)+'">'+options.label+"</a>";thisRef.setup=(original=self.setup,function(){var render_item;options.append&&(render_item=self.settings.render.item,self.settings.render.item=function(data){return html_container=render_item.apply(thisRef,arguments),html_element=html,pos=html_container.search(/(<\/[^>]+>\s*)$/),html_container.substring(0,pos)+html_element+html_container.substring(pos);var html_container,html_element,pos}),original.apply(thisRef,arguments),thisRef.$control.on("click","."+options.className,function(e){if(e.preventDefault(),!self.isLocked)return e=$(e.currentTarget).parent(),self.setActiveItem(e),self.deleteSelection()&&self.setCaret(self.items.length),!1})})})(this,options)}),Selectize.define("restore_on_backspace",function(options){var original,self=this;options.text=options.text||function(option){return option[this.settings.labelField]},this.onKeyDown=(original=self.onKeyDown,function(e){var index;return 8===e.keyCode&&""===this.$control_input.val()&&!this.$activeItems.length&&0<=(index=this.caretPos-1)&&index<this.items.length?(index=this.options[this.items[index]],this.deleteSelection(e)&&(this.setTextboxValue(options.text.apply(this,[index])),this.refreshOptions(!0)),void e.preventDefault()):original.apply(this,arguments)})}),Selectize.define("select_on_focus",function(options){var originalFocus,originalBlur,self=this;self.on("focus",(originalFocus=self.onFocus,function(e){var value=self.getItem(self.getValue()).text();return self.clear(),self.setTextboxValue(value),self.$control_input.select(),setTimeout(function(){self.settings.selectOnTab&&self.setActiveOption(self.getFirstItemMatchedByTextContent(value)),self.settings.score=null},0),originalFocus.apply(this,arguments)})),self.onBlur=(originalBlur=self.onBlur,function(e){return""===self.getValue()&&self.lastValidValue!==self.getValue()&&self.setValue(self.lastValidValue),setTimeout(function(){self.settings.score=function(){return function(){return 1}}},0),originalBlur.apply(this,arguments)}),self.settings.score=function(){return function(){return 1}}}),Selectize.define("tag_limit",function(options){const self=this;options.tagLimit=options.tagLimit,this.onBlur=function(){const original=self.onBlur;return function(e){if(original.apply(this,e),e){const $control=this.$control,$items=$control.find(".item"),limit=options.tagLimit;void 0===limit||$items.length<=limit||($items.toArray().forEach(function(item,index){index<limit||$(item).hide()}),$control.append("<span><b>"+($items.length-limit)+"</b></span>"))}}}(),this.onFocus=function(){const original=self.onFocus;return function(e){if(original.apply(this,e),e){const $control=this.$control,$items=$control.find(".item");$items.show(),$control.find("span").remove()}}}()}),Selectize});(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==='object'&&typeof module==='object')
module.exports=factory();else if(typeof define==='function'&&define.amd)
define([],factory);else{var a=factory();for(var i in a)(typeof exports==='object'?exports:root)[i]=a[i];}})(self,function(){return(function(){var __webpack_modules__=({3099:(function(module){module.exports=function(it){if(typeof it!='function'){throw TypeError(String(it)+' is not a function');}return it;};}),6077:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);module.exports=function(it){if(!isObject(it)&&it!==null){throw TypeError("Can't set "+String(it)+' as a prototype');}return it;};}),1223:(function(module,__unused_webpack_exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(5112);var create=__webpack_require__(30);var definePropertyModule=__webpack_require__(3070);var UNSCOPABLES=wellKnownSymbol('unscopables');var ArrayPrototype=Array.prototype;if(ArrayPrototype[UNSCOPABLES]==undefined){definePropertyModule.f(ArrayPrototype,UNSCOPABLES,{configurable:true,value:create(null)});}
module.exports=function(key){ArrayPrototype[UNSCOPABLES][key]=true;};}),1530:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var charAt=__webpack_require__(8710).charAt;module.exports=function(S,index,unicode){return index+(unicode?charAt(S,index).length:1);};}),5787:(function(module){module.exports=function(it,Constructor,name){if(!(it instanceof Constructor)){throw TypeError('Incorrect '+(name?name+' ':'')+'invocation');}return it;};}),9670:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);module.exports=function(it){if(!isObject(it)){throw TypeError(String(it)+' is not an object');}return it;};}),4019:(function(module){module.exports=typeof ArrayBuffer!=='undefined'&&typeof DataView!=='undefined';}),260:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var NATIVE_ARRAY_BUFFER=__webpack_require__(4019);var DESCRIPTORS=__webpack_require__(9781);var global=__webpack_require__(7854);var isObject=__webpack_require__(111);var has=__webpack_require__(6656);var classof=__webpack_require__(648);var createNonEnumerableProperty=__webpack_require__(8880);var redefine=__webpack_require__(1320);var defineProperty=__webpack_require__(3070).f;var getPrototypeOf=__webpack_require__(9518);var setPrototypeOf=__webpack_require__(7674);var wellKnownSymbol=__webpack_require__(5112);var uid=__webpack_require__(9711);var Int8Array=global.Int8Array;var Int8ArrayPrototype=Int8Array&&Int8Array.prototype;var Uint8ClampedArray=global.Uint8ClampedArray;var Uint8ClampedArrayPrototype=Uint8ClampedArray&&Uint8ClampedArray.prototype;var TypedArray=Int8Array&&getPrototypeOf(Int8Array);var TypedArrayPrototype=Int8ArrayPrototype&&getPrototypeOf(Int8ArrayPrototype);var ObjectPrototype=Object.prototype;var isPrototypeOf=ObjectPrototype.isPrototypeOf;var TO_STRING_TAG=wellKnownSymbol('toStringTag');var TYPED_ARRAY_TAG=uid('TYPED_ARRAY_TAG');var NATIVE_ARRAY_BUFFER_VIEWS=NATIVE_ARRAY_BUFFER&&!!setPrototypeOf&&classof(global.opera)!=='Opera';var TYPED_ARRAY_TAG_REQIRED=false;var NAME;var TypedArrayConstructorsList={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};var BigIntArrayConstructorsList={BigInt64Array:8,BigUint64Array:8};var isView=function isView(it){if(!isObject(it))return false;var klass=classof(it);return klass==='DataView'||has(TypedArrayConstructorsList,klass)||has(BigIntArrayConstructorsList,klass);};var isTypedArray=function(it){if(!isObject(it))return false;var klass=classof(it);return has(TypedArrayConstructorsList,klass)||has(BigIntArrayConstructorsList,klass);};var aTypedArray=function(it){if(isTypedArray(it))return it;throw TypeError('Target is not a typed array');};var aTypedArrayConstructor=function(C){if(setPrototypeOf){if(isPrototypeOf.call(TypedArray,C))return C;}else for(var ARRAY in TypedArrayConstructorsList)if(has(TypedArrayConstructorsList,NAME)){var TypedArrayConstructor=global[ARRAY];if(TypedArrayConstructor&&(C===TypedArrayConstructor||isPrototypeOf.call(TypedArrayConstructor,C))){return C;}}throw TypeError('Target is not a typed array constructor');};var exportTypedArrayMethod=function(KEY,property,forced){if(!DESCRIPTORS)return;if(forced)for(var ARRAY in TypedArrayConstructorsList){var TypedArrayConstructor=global[ARRAY];if(TypedArrayConstructor&&has(TypedArrayConstructor.prototype,KEY)){delete TypedArrayConstructor.prototype[KEY];}}
if(!TypedArrayPrototype[KEY]||forced){redefine(TypedArrayPrototype,KEY,forced?property:NATIVE_ARRAY_BUFFER_VIEWS&&Int8ArrayPrototype[KEY]||property);}};var exportTypedArrayStaticMethod=function(KEY,property,forced){var ARRAY,TypedArrayConstructor;if(!DESCRIPTORS)return;if(setPrototypeOf){if(forced)for(ARRAY in TypedArrayConstructorsList){TypedArrayConstructor=global[ARRAY];if(TypedArrayConstructor&&has(TypedArrayConstructor,KEY)){delete TypedArrayConstructor[KEY];}}
if(!TypedArray[KEY]||forced){try{return redefine(TypedArray,KEY,forced?property:NATIVE_ARRAY_BUFFER_VIEWS&&Int8Array[KEY]||property);}catch(error){}}else return;}
for(ARRAY in TypedArrayConstructorsList){TypedArrayConstructor=global[ARRAY];if(TypedArrayConstructor&&(!TypedArrayConstructor[KEY]||forced)){redefine(TypedArrayConstructor,KEY,property);}}};for(NAME in TypedArrayConstructorsList){if(!global[NAME])NATIVE_ARRAY_BUFFER_VIEWS=false;}
if(!NATIVE_ARRAY_BUFFER_VIEWS||typeof TypedArray!='function'||TypedArray===Function.prototype){TypedArray=function TypedArray(){throw TypeError('Incorrect invocation');};if(NATIVE_ARRAY_BUFFER_VIEWS)for(NAME in TypedArrayConstructorsList){if(global[NAME])setPrototypeOf(global[NAME],TypedArray);}}
if(!NATIVE_ARRAY_BUFFER_VIEWS||!TypedArrayPrototype||TypedArrayPrototype===ObjectPrototype){TypedArrayPrototype=TypedArray.prototype;if(NATIVE_ARRAY_BUFFER_VIEWS)for(NAME in TypedArrayConstructorsList){if(global[NAME])setPrototypeOf(global[NAME].prototype,TypedArrayPrototype);}}
if(NATIVE_ARRAY_BUFFER_VIEWS&&getPrototypeOf(Uint8ClampedArrayPrototype)!==TypedArrayPrototype){setPrototypeOf(Uint8ClampedArrayPrototype,TypedArrayPrototype);}
if(DESCRIPTORS&&!has(TypedArrayPrototype,TO_STRING_TAG)){TYPED_ARRAY_TAG_REQIRED=true;defineProperty(TypedArrayPrototype,TO_STRING_TAG,{get:function(){return isObject(this)?this[TYPED_ARRAY_TAG]:undefined;}});for(NAME in TypedArrayConstructorsList)if(global[NAME]){createNonEnumerableProperty(global[NAME],TYPED_ARRAY_TAG,NAME);}}
module.exports={NATIVE_ARRAY_BUFFER_VIEWS:NATIVE_ARRAY_BUFFER_VIEWS,TYPED_ARRAY_TAG:TYPED_ARRAY_TAG_REQIRED&&TYPED_ARRAY_TAG,aTypedArray:aTypedArray,aTypedArrayConstructor:aTypedArrayConstructor,exportTypedArrayMethod:exportTypedArrayMethod,exportTypedArrayStaticMethod:exportTypedArrayStaticMethod,isView:isView,isTypedArray:isTypedArray,TypedArray:TypedArray,TypedArrayPrototype:TypedArrayPrototype};}),3331:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var global=__webpack_require__(7854);var DESCRIPTORS=__webpack_require__(9781);var NATIVE_ARRAY_BUFFER=__webpack_require__(4019);var createNonEnumerableProperty=__webpack_require__(8880);var redefineAll=__webpack_require__(2248);var fails=__webpack_require__(7293);var anInstance=__webpack_require__(5787);var toInteger=__webpack_require__(9958);var toLength=__webpack_require__(7466);var toIndex=__webpack_require__(7067);var IEEE754=__webpack_require__(1179);var getPrototypeOf=__webpack_require__(9518);var setPrototypeOf=__webpack_require__(7674);var getOwnPropertyNames=__webpack_require__(8006).f;var defineProperty=__webpack_require__(3070).f;var arrayFill=__webpack_require__(1285);var setToStringTag=__webpack_require__(8003);var InternalStateModule=__webpack_require__(9909);var getInternalState=InternalStateModule.get;var setInternalState=InternalStateModule.set;var ARRAY_BUFFER='ArrayBuffer';var DATA_VIEW='DataView';var PROTOTYPE='prototype';var WRONG_LENGTH='Wrong length';var WRONG_INDEX='Wrong index';var NativeArrayBuffer=global[ARRAY_BUFFER];var $ArrayBuffer=NativeArrayBuffer;var $DataView=global[DATA_VIEW];var $DataViewPrototype=$DataView&&$DataView[PROTOTYPE];var ObjectPrototype=Object.prototype;var RangeError=global.RangeError;var packIEEE754=IEEE754.pack;var unpackIEEE754=IEEE754.unpack;var packInt8=function(number){return[number&0xFF];};var packInt16=function(number){return[number&0xFF,number>>8&0xFF];};var packInt32=function(number){return[number&0xFF,number>>8&0xFF,number>>16&0xFF,number>>24&0xFF];};var unpackInt32=function(buffer){return buffer[3]<<24|buffer[2]<<16|buffer[1]<<8|buffer[0];};var packFloat32=function(number){return packIEEE754(number,23,4);};var packFloat64=function(number){return packIEEE754(number,52,8);};var addGetter=function(Constructor,key){defineProperty(Constructor[PROTOTYPE],key,{get:function(){return getInternalState(this)[key];}});};var get=function(view,count,index,isLittleEndian){var intIndex=toIndex(index);var store=getInternalState(view);if(intIndex+count>store.byteLength)throw RangeError(WRONG_INDEX);var bytes=getInternalState(store.buffer).bytes;var start=intIndex+store.byteOffset;var pack=bytes.slice(start,start+count);return isLittleEndian?pack:pack.reverse();};var set=function(view,count,index,conversion,value,isLittleEndian){var intIndex=toIndex(index);var store=getInternalState(view);if(intIndex+count>store.byteLength)throw RangeError(WRONG_INDEX);var bytes=getInternalState(store.buffer).bytes;var start=intIndex+store.byteOffset;var pack=conversion(+value);for(var i=0;i<count;i++)bytes[start+i]=pack[isLittleEndian?i:count-i-1];};if(!NATIVE_ARRAY_BUFFER){$ArrayBuffer=function ArrayBuffer(length){anInstance(this,$ArrayBuffer,ARRAY_BUFFER);var byteLength=toIndex(length);setInternalState(this,{bytes:arrayFill.call(new Array(byteLength),0),byteLength:byteLength});if(!DESCRIPTORS)this.byteLength=byteLength;};$DataView=function DataView(buffer,byteOffset,byteLength){anInstance(this,$DataView,DATA_VIEW);anInstance(buffer,$ArrayBuffer,DATA_VIEW);var bufferLength=getInternalState(buffer).byteLength;var offset=toInteger(byteOffset);if(offset<0||offset>bufferLength)throw RangeError('Wrong offset');byteLength=byteLength===undefined?bufferLength-offset:toLength(byteLength);if(offset+byteLength>bufferLength)throw RangeError(WRONG_LENGTH);setInternalState(this,{buffer:buffer,byteLength:byteLength,byteOffset:offset});if(!DESCRIPTORS){this.buffer=buffer;this.byteLength=byteLength;this.byteOffset=offset;}};if(DESCRIPTORS){addGetter($ArrayBuffer,'byteLength');addGetter($DataView,'buffer');addGetter($DataView,'byteLength');addGetter($DataView,'byteOffset');}
redefineAll($DataView[PROTOTYPE],{getInt8:function getInt8(byteOffset){return get(this,1,byteOffset)[0]<<24>>24;},getUint8:function getUint8(byteOffset){return get(this,1,byteOffset)[0];},getInt16:function getInt16(byteOffset){var bytes=get(this,2,byteOffset,arguments.length>1?arguments[1]:undefined);return(bytes[1]<<8|bytes[0])<<16>>16;},getUint16:function getUint16(byteOffset){var bytes=get(this,2,byteOffset,arguments.length>1?arguments[1]:undefined);return bytes[1]<<8|bytes[0];},getInt32:function getInt32(byteOffset){return unpackInt32(get(this,4,byteOffset,arguments.length>1?arguments[1]:undefined));},getUint32:function getUint32(byteOffset){return unpackInt32(get(this,4,byteOffset,arguments.length>1?arguments[1]:undefined))>>>0;},getFloat32:function getFloat32(byteOffset){return unpackIEEE754(get(this,4,byteOffset,arguments.length>1?arguments[1]:undefined),23);},getFloat64:function getFloat64(byteOffset){return unpackIEEE754(get(this,8,byteOffset,arguments.length>1?arguments[1]:undefined),52);},setInt8:function setInt8(byteOffset,value){set(this,1,byteOffset,packInt8,value);},setUint8:function setUint8(byteOffset,value){set(this,1,byteOffset,packInt8,value);},setInt16:function setInt16(byteOffset,value){set(this,2,byteOffset,packInt16,value,arguments.length>2?arguments[2]:undefined);},setUint16:function setUint16(byteOffset,value){set(this,2,byteOffset,packInt16,value,arguments.length>2?arguments[2]:undefined);},setInt32:function setInt32(byteOffset,value){set(this,4,byteOffset,packInt32,value,arguments.length>2?arguments[2]:undefined);},setUint32:function setUint32(byteOffset,value){set(this,4,byteOffset,packInt32,value,arguments.length>2?arguments[2]:undefined);},setFloat32:function setFloat32(byteOffset,value){set(this,4,byteOffset,packFloat32,value,arguments.length>2?arguments[2]:undefined);},setFloat64:function setFloat64(byteOffset,value){set(this,8,byteOffset,packFloat64,value,arguments.length>2?arguments[2]:undefined);}});}else{if(!fails(function(){NativeArrayBuffer(1);})||!fails(function(){new NativeArrayBuffer(-1);})||fails(function(){new NativeArrayBuffer();new NativeArrayBuffer(1.5);new NativeArrayBuffer(NaN);return NativeArrayBuffer.name!=ARRAY_BUFFER;})){$ArrayBuffer=function ArrayBuffer(length){anInstance(this,$ArrayBuffer);return new NativeArrayBuffer(toIndex(length));};var ArrayBufferPrototype=$ArrayBuffer[PROTOTYPE]=NativeArrayBuffer[PROTOTYPE];for(var keys=getOwnPropertyNames(NativeArrayBuffer),j=0,key;keys.length>j;){if(!((key=keys[j++])in $ArrayBuffer)){createNonEnumerableProperty($ArrayBuffer,key,NativeArrayBuffer[key]);}}
ArrayBufferPrototype.constructor=$ArrayBuffer;}
if(setPrototypeOf&&getPrototypeOf($DataViewPrototype)!==ObjectPrototype){setPrototypeOf($DataViewPrototype,ObjectPrototype);}
var testView=new $DataView(new $ArrayBuffer(2));var nativeSetInt8=$DataViewPrototype.setInt8;testView.setInt8(0,2147483648);testView.setInt8(1,2147483649);if(testView.getInt8(0)||!testView.getInt8(1))redefineAll($DataViewPrototype,{setInt8:function setInt8(byteOffset,value){nativeSetInt8.call(this,byteOffset,value<<24>>24);},setUint8:function setUint8(byteOffset,value){nativeSetInt8.call(this,byteOffset,value<<24>>24);}},{unsafe:true});}
setToStringTag($ArrayBuffer,ARRAY_BUFFER);setToStringTag($DataView,DATA_VIEW);module.exports={ArrayBuffer:$ArrayBuffer,DataView:$DataView};}),1048:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var toObject=__webpack_require__(7908);var toAbsoluteIndex=__webpack_require__(1400);var toLength=__webpack_require__(7466);var min=Math.min;module.exports=[].copyWithin||function copyWithin(target,start){var O=toObject(this);var len=toLength(O.length);var to=toAbsoluteIndex(target,len);var from=toAbsoluteIndex(start,len);var end=arguments.length>2?arguments[2]:undefined;var count=min((end===undefined?len:toAbsoluteIndex(end,len))-from,len-to);var inc=1;if(from<to&&to<from+count){inc=-1;from+=count-1;to+=count-1;}
while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc;}return O;};}),1285:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var toObject=__webpack_require__(7908);var toAbsoluteIndex=__webpack_require__(1400);var toLength=__webpack_require__(7466);module.exports=function fill(value){var O=toObject(this);var length=toLength(O.length);var argumentsLength=arguments.length;var index=toAbsoluteIndex(argumentsLength>1?arguments[1]:undefined,length);var end=argumentsLength>2?arguments[2]:undefined;var endPos=end===undefined?length:toAbsoluteIndex(end,length);while(endPos>index)O[index++]=value;return O;};}),8533:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var $forEach=__webpack_require__(2092).forEach;var arrayMethodIsStrict=__webpack_require__(9341);var STRICT_METHOD=arrayMethodIsStrict('forEach');module.exports=!STRICT_METHOD?function forEach(callbackfn){return $forEach(this,callbackfn,arguments.length>1?arguments[1]:undefined);}:[].forEach;}),8457:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var bind=__webpack_require__(9974);var toObject=__webpack_require__(7908);var callWithSafeIterationClosing=__webpack_require__(3411);var isArrayIteratorMethod=__webpack_require__(7659);var toLength=__webpack_require__(7466);var createProperty=__webpack_require__(6135);var getIteratorMethod=__webpack_require__(1246);module.exports=function from(arrayLike){var O=toObject(arrayLike);var C=typeof this=='function'?this:Array;var argumentsLength=arguments.length;var mapfn=argumentsLength>1?arguments[1]:undefined;var mapping=mapfn!==undefined;var iteratorMethod=getIteratorMethod(O);var index=0;var length,result,step,iterator,next,value;if(mapping)mapfn=bind(mapfn,argumentsLength>2?arguments[2]:undefined,2);if(iteratorMethod!=undefined&&!(C==Array&&isArrayIteratorMethod(iteratorMethod))){iterator=iteratorMethod.call(O);next=iterator.next;result=new C();for(;!(step=next.call(iterator)).done;index++){value=mapping?callWithSafeIterationClosing(iterator,mapfn,[step.value,index],true):step.value;createProperty(result,index,value);}}else{length=toLength(O.length);result=new C(length);for(;length>index;index++){value=mapping?mapfn(O[index],index):O[index];createProperty(result,index,value);}}
result.length=index;return result;};}),1318:(function(module,__unused_webpack_exports,__webpack_require__){var toIndexedObject=__webpack_require__(5656);var toLength=__webpack_require__(7466);var toAbsoluteIndex=__webpack_require__(1400);var createMethod=function(IS_INCLUDES){return function($this,el,fromIndex){var O=toIndexedObject($this);var length=toLength(O.length);var index=toAbsoluteIndex(fromIndex,length);var value;if(IS_INCLUDES&&el!=el)while(length>index){value=O[index++];if(value!=value)return true;}else for(;length>index;index++){if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;}return!IS_INCLUDES&&-1;};};module.exports={includes:createMethod(true),indexOf:createMethod(false)};}),2092:(function(module,__unused_webpack_exports,__webpack_require__){var bind=__webpack_require__(9974);var IndexedObject=__webpack_require__(8361);var toObject=__webpack_require__(7908);var toLength=__webpack_require__(7466);var arraySpeciesCreate=__webpack_require__(5417);var push=[].push;var createMethod=function(TYPE){var IS_MAP=TYPE==1;var IS_FILTER=TYPE==2;var IS_SOME=TYPE==3;var IS_EVERY=TYPE==4;var IS_FIND_INDEX=TYPE==6;var IS_FILTER_OUT=TYPE==7;var NO_HOLES=TYPE==5||IS_FIND_INDEX;return function($this,callbackfn,that,specificCreate){var O=toObject($this);var self=IndexedObject(O);var boundFunction=bind(callbackfn,that,3);var length=toLength(self.length);var index=0;var create=specificCreate||arraySpeciesCreate;var target=IS_MAP?create($this,length):IS_FILTER||IS_FILTER_OUT?create($this,0):undefined;var value,result;for(;length>index;index++)if(NO_HOLES||index in self){value=self[index];result=boundFunction(value,index,O);if(TYPE){if(IS_MAP)target[index]=result;else if(result)switch(TYPE){case 3:return true;case 5:return value;case 6:return index;case 2:push.call(target,value);}else switch(TYPE){case 4:return false;case 7:push.call(target,value);}}}
return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:target;};};module.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterOut:createMethod(7)};}),6583:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var toIndexedObject=__webpack_require__(5656);var toInteger=__webpack_require__(9958);var toLength=__webpack_require__(7466);var arrayMethodIsStrict=__webpack_require__(9341);var min=Math.min;var nativeLastIndexOf=[].lastIndexOf;var NEGATIVE_ZERO=!!nativeLastIndexOf&&1 /[1].lastIndexOf(1,-0)<0;var STRICT_METHOD=arrayMethodIsStrict('lastIndexOf');var FORCED=NEGATIVE_ZERO||!STRICT_METHOD;module.exports=FORCED?function lastIndexOf(searchElement){if(NEGATIVE_ZERO)return nativeLastIndexOf.apply(this,arguments)||0;var O=toIndexedObject(this);var length=toLength(O.length);var index=length-1;if(arguments.length>1)index=min(index,toInteger(arguments[1]));if(index<0)index=length+index;for(;index>=0;index--)if(index in O&&O[index]===searchElement)return index||0;return-1;}:nativeLastIndexOf;}),1194:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);var wellKnownSymbol=__webpack_require__(5112);var V8_VERSION=__webpack_require__(7392);var SPECIES=wellKnownSymbol('species');module.exports=function(METHOD_NAME){return V8_VERSION>=51||!fails(function(){var array=[];var constructor=array.constructor={};constructor[SPECIES]=function(){return{foo:1};};return array[METHOD_NAME](Boolean).foo!==1;});};}),9341:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var fails=__webpack_require__(7293);module.exports=function(METHOD_NAME,argument){var method=[][METHOD_NAME];return!!method&&fails(function(){method.call(null,argument||function(){throw 1;},1);});};}),3671:(function(module,__unused_webpack_exports,__webpack_require__){var aFunction=__webpack_require__(3099);var toObject=__webpack_require__(7908);var IndexedObject=__webpack_require__(8361);var toLength=__webpack_require__(7466);var createMethod=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction(callbackfn);var O=toObject(that);var self=IndexedObject(O);var length=toLength(O.length);var index=IS_RIGHT?length-1:0;var i=IS_RIGHT?-1:1;if(argumentsLength<2)while(true){if(index in self){memo=self[index];index+=i;break;}
index+=i;if(IS_RIGHT?index<0:length<=index){throw TypeError('Reduce of empty array with no initial value');}}
for(;IS_RIGHT?index>=0:length>index;index+=i)if(index in self){memo=callbackfn(memo,self[index],index,O);}
return memo;};};module.exports={left:createMethod(false),right:createMethod(true)};}),5417:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);var isArray=__webpack_require__(3157);var wellKnownSymbol=__webpack_require__(5112);var SPECIES=wellKnownSymbol('species');module.exports=function(originalArray,length){var C;if(isArray(originalArray)){C=originalArray.constructor;if(typeof C=='function'&&(C===Array||isArray(C.prototype)))C=undefined;else if(isObject(C)){C=C[SPECIES];if(C===null)C=undefined;}}return new(C===undefined?Array:C)(length===0?0:length);};}),3411:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);var iteratorClose=__webpack_require__(9212);module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value);}catch(error){iteratorClose(iterator);throw error;}};}),7072:(function(module,__unused_webpack_exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(5112);var ITERATOR=wellKnownSymbol('iterator');var SAFE_CLOSING=false;try{var called=0;var iteratorWithReturn={next:function(){return{done:!!called++};},'return':function(){SAFE_CLOSING=true;}};iteratorWithReturn[ITERATOR]=function(){return this;};Array.from(iteratorWithReturn,function(){throw 2;});}catch(error){}
module.exports=function(exec,SKIP_CLOSING){if(!SKIP_CLOSING&&!SAFE_CLOSING)return false;var ITERATION_SUPPORT=false;try{var object={};object[ITERATOR]=function(){return{next:function(){return{done:ITERATION_SUPPORT=true};}};};exec(object);}catch(error){}
return ITERATION_SUPPORT;};}),4326:(function(module){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1);};}),648:(function(module,__unused_webpack_exports,__webpack_require__){var TO_STRING_TAG_SUPPORT=__webpack_require__(1694);var classofRaw=__webpack_require__(4326);var wellKnownSymbol=__webpack_require__(5112);var TO_STRING_TAG=wellKnownSymbol('toStringTag');var CORRECT_ARGUMENTS=classofRaw(function(){return arguments;}())=='Arguments';var tryGet=function(it,key){try{return it[key];}catch(error){}};module.exports=TO_STRING_TAG_SUPPORT?classofRaw:function(it){var O,tag,result;return it===undefined?'Undefined':it===null?'Null':typeof(tag=tryGet(O=Object(it),TO_STRING_TAG))=='string'?tag:CORRECT_ARGUMENTS?classofRaw(O):(result=classofRaw(O))=='Object'&&typeof O.callee=='function'?'Arguments':result;};}),9920:(function(module,__unused_webpack_exports,__webpack_require__){var has=__webpack_require__(6656);var ownKeys=__webpack_require__(3887);var getOwnPropertyDescriptorModule=__webpack_require__(1236);var definePropertyModule=__webpack_require__(3070);module.exports=function(target,source){var keys=ownKeys(source);var defineProperty=definePropertyModule.f;var getOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f;for(var i=0;i<keys.length;i++){var key=keys[i];if(!has(target,key))defineProperty(target,key,getOwnPropertyDescriptor(source,key));}};}),8544:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);module.exports=!fails(function(){function F(){}
F.prototype.constructor=null;return Object.getPrototypeOf(new F())!==F.prototype;});}),4994:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var IteratorPrototype=__webpack_require__(3383).IteratorPrototype;var create=__webpack_require__(30);var createPropertyDescriptor=__webpack_require__(9114);var setToStringTag=__webpack_require__(8003);var Iterators=__webpack_require__(7497);var returnThis=function(){return this;};module.exports=function(IteratorConstructor,NAME,next){var TO_STRING_TAG=NAME+' Iterator';IteratorConstructor.prototype=create(IteratorPrototype,{next:createPropertyDescriptor(1,next)});setToStringTag(IteratorConstructor,TO_STRING_TAG,false,true);Iterators[TO_STRING_TAG]=returnThis;return IteratorConstructor;};}),8880:(function(module,__unused_webpack_exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var definePropertyModule=__webpack_require__(3070);var createPropertyDescriptor=__webpack_require__(9114);module.exports=DESCRIPTORS?function(object,key,value){return definePropertyModule.f(object,key,createPropertyDescriptor(1,value));}:function(object,key,value){object[key]=value;return object;};}),9114:(function(module){module.exports=function(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value};};}),6135:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var toPrimitive=__webpack_require__(7593);var definePropertyModule=__webpack_require__(3070);var createPropertyDescriptor=__webpack_require__(9114);module.exports=function(object,key,value){var propertyKey=toPrimitive(key);if(propertyKey in object)definePropertyModule.f(object,propertyKey,createPropertyDescriptor(0,value));else object[propertyKey]=value;};}),654:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var createIteratorConstructor=__webpack_require__(4994);var getPrototypeOf=__webpack_require__(9518);var setPrototypeOf=__webpack_require__(7674);var setToStringTag=__webpack_require__(8003);var createNonEnumerableProperty=__webpack_require__(8880);var redefine=__webpack_require__(1320);var wellKnownSymbol=__webpack_require__(5112);var IS_PURE=__webpack_require__(1913);var Iterators=__webpack_require__(7497);var IteratorsCore=__webpack_require__(3383);var IteratorPrototype=IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS;var ITERATOR=wellKnownSymbol('iterator');var KEYS='keys';var VALUES='values';var ENTRIES='entries';var returnThis=function(){return this;};module.exports=function(Iterable,NAME,IteratorConstructor,next,DEFAULT,IS_SET,FORCED){createIteratorConstructor(IteratorConstructor,NAME,next);var getIterationMethod=function(KIND){if(KIND===DEFAULT&&defaultIterator)return defaultIterator;if(!BUGGY_SAFARI_ITERATORS&&KIND in IterablePrototype)return IterablePrototype[KIND];switch(KIND){case KEYS:return function keys(){return new IteratorConstructor(this,KIND);};case VALUES:return function values(){return new IteratorConstructor(this,KIND);};case ENTRIES:return function entries(){return new IteratorConstructor(this,KIND);};}return function(){return new IteratorConstructor(this);};};var TO_STRING_TAG=NAME+' Iterator';var INCORRECT_VALUES_NAME=false;var IterablePrototype=Iterable.prototype;var nativeIterator=IterablePrototype[ITERATOR]||IterablePrototype['@@iterator']||DEFAULT&&IterablePrototype[DEFAULT];var defaultIterator=!BUGGY_SAFARI_ITERATORS&&nativeIterator||getIterationMethod(DEFAULT);var anyNativeIterator=NAME=='Array'?IterablePrototype.entries||nativeIterator:nativeIterator;var CurrentIteratorPrototype,methods,KEY;if(anyNativeIterator){CurrentIteratorPrototype=getPrototypeOf(anyNativeIterator.call(new Iterable()));if(IteratorPrototype!==Object.prototype&&CurrentIteratorPrototype.next){if(!IS_PURE&&getPrototypeOf(CurrentIteratorPrototype)!==IteratorPrototype){if(setPrototypeOf){setPrototypeOf(CurrentIteratorPrototype,IteratorPrototype);}else if(typeof CurrentIteratorPrototype[ITERATOR]!='function'){createNonEnumerableProperty(CurrentIteratorPrototype,ITERATOR,returnThis);}}
setToStringTag(CurrentIteratorPrototype,TO_STRING_TAG,true,true);if(IS_PURE)Iterators[TO_STRING_TAG]=returnThis;}}
if(DEFAULT==VALUES&&nativeIterator&&nativeIterator.name!==VALUES){INCORRECT_VALUES_NAME=true;defaultIterator=function values(){return nativeIterator.call(this);};}
if((!IS_PURE||FORCED)&&IterablePrototype[ITERATOR]!==defaultIterator){createNonEnumerableProperty(IterablePrototype,ITERATOR,defaultIterator);}
Iterators[NAME]=defaultIterator;if(DEFAULT){methods={values:getIterationMethod(VALUES),keys:IS_SET?defaultIterator:getIterationMethod(KEYS),entries:getIterationMethod(ENTRIES)};if(FORCED)for(KEY in methods){if(BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME||!(KEY in IterablePrototype)){redefine(IterablePrototype,KEY,methods[KEY]);}}else $({target:NAME,proto:true,forced:BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME},methods);}
return methods;};}),9781:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);module.exports=!fails(function(){return Object.defineProperty({},1,{get:function(){return 7;}})[1]!=7;});}),317:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var isObject=__webpack_require__(111);var document=global.document;var EXISTS=isObject(document)&&isObject(document.createElement);module.exports=function(it){return EXISTS?document.createElement(it):{};};}),8324:(function(module){module.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};}),8113:(function(module,__unused_webpack_exports,__webpack_require__){var getBuiltIn=__webpack_require__(5005);module.exports=getBuiltIn('navigator','userAgent')||'';}),7392:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var userAgent=__webpack_require__(8113);var process=global.process;var versions=process&&process.versions;var v8=versions&&versions.v8;var match,version;if(v8){match=v8.split('.');version=match[0]+match[1];}else if(userAgent){match=userAgent.match(/Edge\/(\d+)/);if(!match||match[1]>=74){match=userAgent.match(/Chrome\/(\d+)/);if(match)version=match[1];}}
module.exports=version&&+version;}),748:(function(module){module.exports=['constructor','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toLocaleString','toString','valueOf'];}),2109:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var getOwnPropertyDescriptor=__webpack_require__(1236).f;var createNonEnumerableProperty=__webpack_require__(8880);var redefine=__webpack_require__(1320);var setGlobal=__webpack_require__(3505);var copyConstructorProperties=__webpack_require__(9920);var isForced=__webpack_require__(4705);module.exports=function(options,source){var TARGET=options.target;var GLOBAL=options.global;var STATIC=options.stat;var FORCED,target,key,targetProperty,sourceProperty,descriptor;if(GLOBAL){target=global;}else if(STATIC){target=global[TARGET]||setGlobal(TARGET,{});}else{target=(global[TARGET]||{}).prototype;}
if(target)for(key in source){sourceProperty=source[key];if(options.noTargetGet){descriptor=getOwnPropertyDescriptor(target,key);targetProperty=descriptor&&descriptor.value;}else targetProperty=target[key];FORCED=isForced(GLOBAL?key:TARGET+(STATIC?'.':'#')+key,options.forced);if(!FORCED&&targetProperty!==undefined){if(typeof sourceProperty===typeof targetProperty)continue;copyConstructorProperties(sourceProperty,targetProperty);}
if(options.sham||(targetProperty&&targetProperty.sham)){createNonEnumerableProperty(sourceProperty,'sham',true);}
redefine(target,key,sourceProperty,options);}};}),7293:(function(module){module.exports=function(exec){try{return!!exec();}catch(error){return true;}};}),7007:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";__webpack_require__(4916);var redefine=__webpack_require__(1320);var fails=__webpack_require__(7293);var wellKnownSymbol=__webpack_require__(5112);var regexpExec=__webpack_require__(2261);var createNonEnumerableProperty=__webpack_require__(8880);var SPECIES=wellKnownSymbol('species');var REPLACE_SUPPORTS_NAMED_GROUPS=!fails(function(){var re=/./;re.exec=function(){var result=[];result.groups={a:'7'};return result;};return''.replace(re,'$<a>')!=='7';});var REPLACE_KEEPS_$0=(function(){return'a'.replace(/./,'$0')==='$0';})();var REPLACE=wellKnownSymbol('replace');var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=(function(){if(/./[REPLACE]){return/./[REPLACE]('a','$0')==='';}
return false;})();var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails(function(){var re=/(?:)/;var originalExec=re.exec;re.exec=function(){return originalExec.apply(this,arguments);};var result='ab'.split(re);return result.length!==2||result[0]!=='a'||result[1]!=='b';});module.exports=function(KEY,length,exec,sham){var SYMBOL=wellKnownSymbol(KEY);var DELEGATES_TO_SYMBOL=!fails(function(){var O={};O[SYMBOL]=function(){return 7;};return''[KEY](O)!=7;});var DELEGATES_TO_EXEC=DELEGATES_TO_SYMBOL&&!fails(function(){var execCalled=false;var re=/a/;if(KEY==='split'){re={};re.constructor={};re.constructor[SPECIES]=function(){return re;};re.flags='';re[SYMBOL]=/./[SYMBOL];}
re.exec=function(){execCalled=true;return null;};re[SYMBOL]('');return!execCalled;});if(!DELEGATES_TO_SYMBOL||!DELEGATES_TO_EXEC||(KEY==='replace'&&!(REPLACE_SUPPORTS_NAMED_GROUPS&&REPLACE_KEEPS_$0&&!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE))||(KEY==='split'&&!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)){var nativeRegExpMethod=/./[SYMBOL];var methods=exec(SYMBOL,''[KEY],function(nativeMethod,regexp,str,arg2,forceStringMethod){if(regexp.exec===regexpExec){if(DELEGATES_TO_SYMBOL&&!forceStringMethod){return{done:true,value:nativeRegExpMethod.call(regexp,str,arg2)};}
return{done:true,value:nativeMethod.call(str,regexp,arg2)};}
return{done:false};},{REPLACE_KEEPS_$0:REPLACE_KEEPS_$0,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE});var stringMethod=methods[0];var regexMethod=methods[1];redefine(String.prototype,KEY,stringMethod);redefine(RegExp.prototype,SYMBOL,length==2?function(string,arg){return regexMethod.call(string,this,arg);}:function(string){return regexMethod.call(string,this);});}
if(sham)createNonEnumerableProperty(RegExp.prototype[SYMBOL],'sham',true);};}),9974:(function(module,__unused_webpack_exports,__webpack_require__){var aFunction=__webpack_require__(3099);module.exports=function(fn,that,length){aFunction(fn);if(that===undefined)return fn;switch(length){case 0:return function(){return fn.call(that);};case 1:return function(a){return fn.call(that,a);};case 2:return function(a,b){return fn.call(that,a,b);};case 3:return function(a,b,c){return fn.call(that,a,b,c);};}
return function(){return fn.apply(that,arguments);};};}),5005:(function(module,__unused_webpack_exports,__webpack_require__){var path=__webpack_require__(857);var global=__webpack_require__(7854);var aFunction=function(variable){return typeof variable=='function'?variable:undefined;};module.exports=function(namespace,method){return arguments.length<2?aFunction(path[namespace])||aFunction(global[namespace]):path[namespace]&&path[namespace][method]||global[namespace]&&global[namespace][method];};}),1246:(function(module,__unused_webpack_exports,__webpack_require__){var classof=__webpack_require__(648);var Iterators=__webpack_require__(7497);var wellKnownSymbol=__webpack_require__(5112);var ITERATOR=wellKnownSymbol('iterator');module.exports=function(it){if(it!=undefined)return it[ITERATOR]||it['@@iterator']||Iterators[classof(it)];};}),8554:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);var getIteratorMethod=__webpack_require__(1246);module.exports=function(it){var iteratorMethod=getIteratorMethod(it);if(typeof iteratorMethod!='function'){throw TypeError(String(it)+' is not iterable');}return anObject(iteratorMethod.call(it));};}),647:(function(module,__unused_webpack_exports,__webpack_require__){var toObject=__webpack_require__(7908);var floor=Math.floor;var replace=''.replace;var SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g;var SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;module.exports=function(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length;var m=captures.length;var symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;if(namedCaptures!==undefined){namedCaptures=toObject(namedCaptures);symbols=SUBSTITUTION_SYMBOLS;}
return replace.call(replacement,symbols,function(match,ch){var capture;switch(ch.charAt(0)){case'$':return'$';case'&':return matched;case'`':return str.slice(0,position);case"'":return str.slice(tailPos);case'<':capture=namedCaptures[ch.slice(1,-1)];break;default:var n=+ch;if(n===0)return match;if(n>m){var f=floor(n / 10);if(f===0)return match;if(f<=m)return captures[f-1]===undefined?ch.charAt(1):captures[f-1]+ch.charAt(1);return match;}
capture=captures[n-1];}
return capture===undefined?'':capture;});};}),7854:(function(module,__unused_webpack_exports,__webpack_require__){var check=function(it){return it&&it.Math==Math&&it;};module.exports=check(typeof globalThis=='object'&&globalThis)||check(typeof window=='object'&&window)||check(typeof self=='object'&&self)||check(typeof __webpack_require__.g=='object'&&__webpack_require__.g)||(function(){return this;})()||Function('return this')();}),6656:(function(module){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key);};}),3501:(function(module){module.exports={};}),490:(function(module,__unused_webpack_exports,__webpack_require__){var getBuiltIn=__webpack_require__(5005);module.exports=getBuiltIn('document','documentElement');}),4664:(function(module,__unused_webpack_exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var fails=__webpack_require__(7293);var createElement=__webpack_require__(317);module.exports=!DESCRIPTORS&&!fails(function(){return Object.defineProperty(createElement('div'),'a',{get:function(){return 7;}}).a!=7;});}),1179:(function(module){var abs=Math.abs;var pow=Math.pow;var floor=Math.floor;var log=Math.log;var LN2=Math.LN2;var pack=function(number,mantissaLength,bytes){var buffer=new Array(bytes);var exponentLength=bytes*8-mantissaLength-1;var eMax=(1<<exponentLength)-1;var eBias=eMax>>1;var rt=mantissaLength===23?pow(2,-24)-pow(2,-77):0;var sign=number<0||number===0&&1 / number<0?1:0;var index=0;var exponent,mantissa,c;number=abs(number);if(number!=number||number===Infinity){mantissa=number!=number?1:0;exponent=eMax;}else{exponent=floor(log(number)/ LN2);if(number*(c=pow(2,-exponent))<1){exponent--;c*=2;}
if(exponent+eBias>=1){number+=rt / c;}else{number+=rt*pow(2,1-eBias);}
if(number*c>=2){exponent++;c /=2;}
if(exponent+eBias>=eMax){mantissa=0;exponent=eMax;}else if(exponent+eBias>=1){mantissa=(number*c-1)*pow(2,mantissaLength);exponent=exponent+eBias;}else{mantissa=number*pow(2,eBias-1)*pow(2,mantissaLength);exponent=0;}}
for(;mantissaLength>=8;buffer[index++]=mantissa&255,mantissa /=256,mantissaLength-=8);exponent=exponent<<mantissaLength|mantissa;exponentLength+=mantissaLength;for(;exponentLength>0;buffer[index++]=exponent&255,exponent /=256,exponentLength-=8);buffer[--index]|=sign*128;return buffer;};var unpack=function(buffer,mantissaLength){var bytes=buffer.length;var exponentLength=bytes*8-mantissaLength-1;var eMax=(1<<exponentLength)-1;var eBias=eMax>>1;var nBits=exponentLength-7;var index=bytes-1;var sign=buffer[index--];var exponent=sign&127;var mantissa;sign>>=7;for(;nBits>0;exponent=exponent*256+buffer[index],index--,nBits-=8);mantissa=exponent&(1<<-nBits)-1;exponent>>=-nBits;nBits+=mantissaLength;for(;nBits>0;mantissa=mantissa*256+buffer[index],index--,nBits-=8);if(exponent===0){exponent=1-eBias;}else if(exponent===eMax){return mantissa?NaN:sign?-Infinity:Infinity;}else{mantissa=mantissa+pow(2,mantissaLength);exponent=exponent-eBias;}return(sign?-1:1)*mantissa*pow(2,exponent-mantissaLength);};module.exports={pack:pack,unpack:unpack};}),8361:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);var classof=__webpack_require__(4326);var split=''.split;module.exports=fails(function(){return!Object('z').propertyIsEnumerable(0);})?function(it){return classof(it)=='String'?split.call(it,''):Object(it);}:Object;}),9587:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);var setPrototypeOf=__webpack_require__(7674);module.exports=function($this,dummy,Wrapper){var NewTarget,NewTargetPrototype;if(setPrototypeOf&&typeof(NewTarget=dummy.constructor)=='function'&&NewTarget!==Wrapper&&isObject(NewTargetPrototype=NewTarget.prototype)&&NewTargetPrototype!==Wrapper.prototype)setPrototypeOf($this,NewTargetPrototype);return $this;};}),2788:(function(module,__unused_webpack_exports,__webpack_require__){var store=__webpack_require__(5465);var functionToString=Function.toString;if(typeof store.inspectSource!='function'){store.inspectSource=function(it){return functionToString.call(it);};}
module.exports=store.inspectSource;}),9909:(function(module,__unused_webpack_exports,__webpack_require__){var NATIVE_WEAK_MAP=__webpack_require__(8536);var global=__webpack_require__(7854);var isObject=__webpack_require__(111);var createNonEnumerableProperty=__webpack_require__(8880);var objectHas=__webpack_require__(6656);var shared=__webpack_require__(5465);var sharedKey=__webpack_require__(6200);var hiddenKeys=__webpack_require__(3501);var WeakMap=global.WeakMap;var set,get,has;var enforce=function(it){return has(it)?get(it):set(it,{});};var getterFor=function(TYPE){return function(it){var state;if(!isObject(it)||(state=get(it)).type!==TYPE){throw TypeError('Incompatible receiver, '+TYPE+' required');}return state;};};if(NATIVE_WEAK_MAP){var store=shared.state||(shared.state=new WeakMap());var wmget=store.get;var wmhas=store.has;var wmset=store.set;set=function(it,metadata){metadata.facade=it;wmset.call(store,it,metadata);return metadata;};get=function(it){return wmget.call(store,it)||{};};has=function(it){return wmhas.call(store,it);};}else{var STATE=sharedKey('state');hiddenKeys[STATE]=true;set=function(it,metadata){metadata.facade=it;createNonEnumerableProperty(it,STATE,metadata);return metadata;};get=function(it){return objectHas(it,STATE)?it[STATE]:{};};has=function(it){return objectHas(it,STATE);};}
module.exports={set:set,get:get,has:has,enforce:enforce,getterFor:getterFor};}),7659:(function(module,__unused_webpack_exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(5112);var Iterators=__webpack_require__(7497);var ITERATOR=wellKnownSymbol('iterator');var ArrayPrototype=Array.prototype;module.exports=function(it){return it!==undefined&&(Iterators.Array===it||ArrayPrototype[ITERATOR]===it);};}),3157:(function(module,__unused_webpack_exports,__webpack_require__){var classof=__webpack_require__(4326);module.exports=Array.isArray||function isArray(arg){return classof(arg)=='Array';};}),4705:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);var replacement=/#|\.prototype\./;var isForced=function(feature,detection){var value=data[normalize(feature)];return value==POLYFILL?true:value==NATIVE?false:typeof detection=='function'?fails(detection):!!detection;};var normalize=isForced.normalize=function(string){return String(string).replace(replacement,'.').toLowerCase();};var data=isForced.data={};var NATIVE=isForced.NATIVE='N';var POLYFILL=isForced.POLYFILL='P';module.exports=isForced;}),111:(function(module){module.exports=function(it){return typeof it==='object'?it!==null:typeof it==='function';};}),1913:(function(module){module.exports=false;}),7850:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);var classof=__webpack_require__(4326);var wellKnownSymbol=__webpack_require__(5112);var MATCH=wellKnownSymbol('match');module.exports=function(it){var isRegExp;return isObject(it)&&((isRegExp=it[MATCH])!==undefined?!!isRegExp:classof(it)=='RegExp');};}),9212:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);module.exports=function(iterator){var returnMethod=iterator['return'];if(returnMethod!==undefined){return anObject(returnMethod.call(iterator)).value;}};}),3383:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var fails=__webpack_require__(7293);var getPrototypeOf=__webpack_require__(9518);var createNonEnumerableProperty=__webpack_require__(8880);var has=__webpack_require__(6656);var wellKnownSymbol=__webpack_require__(5112);var IS_PURE=__webpack_require__(1913);var ITERATOR=wellKnownSymbol('iterator');var BUGGY_SAFARI_ITERATORS=false;var returnThis=function(){return this;};var IteratorPrototype,PrototypeOfArrayIteratorPrototype,arrayIterator;if([].keys){arrayIterator=[].keys();if(!('next'in arrayIterator))BUGGY_SAFARI_ITERATORS=true;else{PrototypeOfArrayIteratorPrototype=getPrototypeOf(getPrototypeOf(arrayIterator));if(PrototypeOfArrayIteratorPrototype!==Object.prototype)IteratorPrototype=PrototypeOfArrayIteratorPrototype;}}
var NEW_ITERATOR_PROTOTYPE=IteratorPrototype==undefined||fails(function(){var test={};return IteratorPrototype[ITERATOR].call(test)!==test;});if(NEW_ITERATOR_PROTOTYPE)IteratorPrototype={};if((!IS_PURE||NEW_ITERATOR_PROTOTYPE)&&!has(IteratorPrototype,ITERATOR)){createNonEnumerableProperty(IteratorPrototype,ITERATOR,returnThis);}
module.exports={IteratorPrototype:IteratorPrototype,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS};}),7497:(function(module){module.exports={};}),133:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);module.exports=!!Object.getOwnPropertySymbols&&!fails(function(){return!String(Symbol());});}),590:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);var wellKnownSymbol=__webpack_require__(5112);var IS_PURE=__webpack_require__(1913);var ITERATOR=wellKnownSymbol('iterator');module.exports=!fails(function(){var url=new URL('b?a=1&b=2&c=3','http://a');var searchParams=url.searchParams;var result='';url.pathname='c%20d';searchParams.forEach(function(value,key){searchParams['delete']('b');result+=key+value;});return(IS_PURE&&!url.toJSON)||!searchParams.sort||url.href!=='http://a/c%20d?a=1&c=3'||searchParams.get('c')!=='3'||String(new URLSearchParams('?a=1'))!=='a=1'||!searchParams[ITERATOR]||new URL('https://a@b').username!=='a'||new URLSearchParams(new URLSearchParams('a=b')).get('a')!=='b'||new URL('http://тест').host!=='xn--e1aybc'||new URL('http://a#б').hash!=='#%D0%B1'||result!=='a1c3'||new URL('http://x',undefined).host!=='x';});}),8536:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var inspectSource=__webpack_require__(2788);var WeakMap=global.WeakMap;module.exports=typeof WeakMap==='function'&&/native code/.test(inspectSource(WeakMap));}),1574:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var DESCRIPTORS=__webpack_require__(9781);var fails=__webpack_require__(7293);var objectKeys=__webpack_require__(1956);var getOwnPropertySymbolsModule=__webpack_require__(5181);var propertyIsEnumerableModule=__webpack_require__(5296);var toObject=__webpack_require__(7908);var IndexedObject=__webpack_require__(8361);var nativeAssign=Object.assign;var defineProperty=Object.defineProperty;module.exports=!nativeAssign||fails(function(){if(DESCRIPTORS&&nativeAssign({b:1},nativeAssign(defineProperty({},'a',{enumerable:true,get:function(){defineProperty(this,'b',{value:3,enumerable:false});}}),{b:2})).b!==1)return true;var A={};var B={};var symbol=Symbol();var alphabet='abcdefghijklmnopqrst';A[symbol]=7;alphabet.split('').forEach(function(chr){B[chr]=chr;});return nativeAssign({},A)[symbol]!=7||objectKeys(nativeAssign({},B)).join('')!=alphabet;})?function assign(target,source){var T=toObject(target);var argumentsLength=arguments.length;var index=1;var getOwnPropertySymbols=getOwnPropertySymbolsModule.f;var propertyIsEnumerable=propertyIsEnumerableModule.f;while(argumentsLength>index){var S=IndexedObject(arguments[index++]);var keys=getOwnPropertySymbols?objectKeys(S).concat(getOwnPropertySymbols(S)):objectKeys(S);var length=keys.length;var j=0;var key;while(length>j){key=keys[j++];if(!DESCRIPTORS||propertyIsEnumerable.call(S,key))T[key]=S[key];}}return T;}:nativeAssign;}),30:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);var defineProperties=__webpack_require__(6048);var enumBugKeys=__webpack_require__(748);var hiddenKeys=__webpack_require__(3501);var html=__webpack_require__(490);var documentCreateElement=__webpack_require__(317);var sharedKey=__webpack_require__(6200);var GT='>';var LT='<';var PROTOTYPE='prototype';var SCRIPT='script';var IE_PROTO=sharedKey('IE_PROTO');var EmptyConstructor=function(){};var scriptTag=function(content){return LT+SCRIPT+GT+content+LT+'/'+SCRIPT+GT;};var NullProtoObjectViaActiveX=function(activeXDocument){activeXDocument.write(scriptTag(''));activeXDocument.close();var temp=activeXDocument.parentWindow.Object;activeXDocument=null;return temp;};var NullProtoObjectViaIFrame=function(){var iframe=documentCreateElement('iframe');var JS='java'+SCRIPT+':';var iframeDocument;iframe.style.display='none';html.appendChild(iframe);iframe.src=String(JS);iframeDocument=iframe.contentWindow.document;iframeDocument.open();iframeDocument.write(scriptTag('document.F=Object'));iframeDocument.close();return iframeDocument.F;};var activeXDocument;var NullProtoObject=function(){try{activeXDocument=document.domain&&new ActiveXObject('htmlfile');}catch(error){}
NullProtoObject=activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame();var length=enumBugKeys.length;while(length--)delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];return NullProtoObject();};hiddenKeys[IE_PROTO]=true;module.exports=Object.create||function create(O,Properties){var result;if(O!==null){EmptyConstructor[PROTOTYPE]=anObject(O);result=new EmptyConstructor();EmptyConstructor[PROTOTYPE]=null;result[IE_PROTO]=O;}else result=NullProtoObject();return Properties===undefined?result:defineProperties(result,Properties);};}),6048:(function(module,__unused_webpack_exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var definePropertyModule=__webpack_require__(3070);var anObject=__webpack_require__(9670);var objectKeys=__webpack_require__(1956);module.exports=DESCRIPTORS?Object.defineProperties:function defineProperties(O,Properties){anObject(O);var keys=objectKeys(Properties);var length=keys.length;var index=0;var key;while(length>index)definePropertyModule.f(O,key=keys[index++],Properties[key]);return O;};}),3070:(function(__unused_webpack_module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var IE8_DOM_DEFINE=__webpack_require__(4664);var anObject=__webpack_require__(9670);var toPrimitive=__webpack_require__(7593);var nativeDefineProperty=Object.defineProperty;exports.f=DESCRIPTORS?nativeDefineProperty:function defineProperty(O,P,Attributes){anObject(O);P=toPrimitive(P,true);anObject(Attributes);if(IE8_DOM_DEFINE)try{return nativeDefineProperty(O,P,Attributes);}catch(error){}
if('get'in Attributes||'set'in Attributes)throw TypeError('Accessors not supported');if('value'in Attributes)O[P]=Attributes.value;return O;};}),1236:(function(__unused_webpack_module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var propertyIsEnumerableModule=__webpack_require__(5296);var createPropertyDescriptor=__webpack_require__(9114);var toIndexedObject=__webpack_require__(5656);var toPrimitive=__webpack_require__(7593);var has=__webpack_require__(6656);var IE8_DOM_DEFINE=__webpack_require__(4664);var nativeGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;exports.f=DESCRIPTORS?nativeGetOwnPropertyDescriptor:function getOwnPropertyDescriptor(O,P){O=toIndexedObject(O);P=toPrimitive(P,true);if(IE8_DOM_DEFINE)try{return nativeGetOwnPropertyDescriptor(O,P);}catch(error){}
if(has(O,P))return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O,P),O[P]);};}),8006:(function(__unused_webpack_module,exports,__webpack_require__){var internalObjectKeys=__webpack_require__(6324);var enumBugKeys=__webpack_require__(748);var hiddenKeys=enumBugKeys.concat('length','prototype');exports.f=Object.getOwnPropertyNames||function getOwnPropertyNames(O){return internalObjectKeys(O,hiddenKeys);};}),5181:(function(__unused_webpack_module,exports){exports.f=Object.getOwnPropertySymbols;}),9518:(function(module,__unused_webpack_exports,__webpack_require__){var has=__webpack_require__(6656);var toObject=__webpack_require__(7908);var sharedKey=__webpack_require__(6200);var CORRECT_PROTOTYPE_GETTER=__webpack_require__(8544);var IE_PROTO=sharedKey('IE_PROTO');var ObjectPrototype=Object.prototype;module.exports=CORRECT_PROTOTYPE_GETTER?Object.getPrototypeOf:function(O){O=toObject(O);if(has(O,IE_PROTO))return O[IE_PROTO];if(typeof O.constructor=='function'&&O instanceof O.constructor){return O.constructor.prototype;}return O instanceof Object?ObjectPrototype:null;};}),6324:(function(module,__unused_webpack_exports,__webpack_require__){var has=__webpack_require__(6656);var toIndexedObject=__webpack_require__(5656);var indexOf=__webpack_require__(1318).indexOf;var hiddenKeys=__webpack_require__(3501);module.exports=function(object,names){var O=toIndexedObject(object);var i=0;var result=[];var key;for(key in O)!has(hiddenKeys,key)&&has(O,key)&&result.push(key);while(names.length>i)if(has(O,key=names[i++])){~indexOf(result,key)||result.push(key);}
return result;};}),1956:(function(module,__unused_webpack_exports,__webpack_require__){var internalObjectKeys=__webpack_require__(6324);var enumBugKeys=__webpack_require__(748);module.exports=Object.keys||function keys(O){return internalObjectKeys(O,enumBugKeys);};}),5296:(function(__unused_webpack_module,exports){"use strict";var nativePropertyIsEnumerable={}.propertyIsEnumerable;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var NASHORN_BUG=getOwnPropertyDescriptor&&!nativePropertyIsEnumerable.call({1:2},1);exports.f=NASHORN_BUG?function propertyIsEnumerable(V){var descriptor=getOwnPropertyDescriptor(this,V);return!!descriptor&&descriptor.enumerable;}:nativePropertyIsEnumerable;}),7674:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);var aPossiblePrototype=__webpack_require__(6077);module.exports=Object.setPrototypeOf||('__proto__'in{}?function(){var CORRECT_SETTER=false;var test={};var setter;try{setter=Object.getOwnPropertyDescriptor(Object.prototype,'__proto__').set;setter.call(test,[]);CORRECT_SETTER=test instanceof Array;}catch(error){}
return function setPrototypeOf(O,proto){anObject(O);aPossiblePrototype(proto);if(CORRECT_SETTER)setter.call(O,proto);else O.__proto__=proto;return O;};}():undefined);}),288:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var TO_STRING_TAG_SUPPORT=__webpack_require__(1694);var classof=__webpack_require__(648);module.exports=TO_STRING_TAG_SUPPORT?{}.toString:function toString(){return'[object '+classof(this)+']';};}),3887:(function(module,__unused_webpack_exports,__webpack_require__){var getBuiltIn=__webpack_require__(5005);var getOwnPropertyNamesModule=__webpack_require__(8006);var getOwnPropertySymbolsModule=__webpack_require__(5181);var anObject=__webpack_require__(9670);module.exports=getBuiltIn('Reflect','ownKeys')||function ownKeys(it){var keys=getOwnPropertyNamesModule.f(anObject(it));var getOwnPropertySymbols=getOwnPropertySymbolsModule.f;return getOwnPropertySymbols?keys.concat(getOwnPropertySymbols(it)):keys;};}),857:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);module.exports=global;}),2248:(function(module,__unused_webpack_exports,__webpack_require__){var redefine=__webpack_require__(1320);module.exports=function(target,src,options){for(var key in src)redefine(target,key,src[key],options);return target;};}),1320:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var createNonEnumerableProperty=__webpack_require__(8880);var has=__webpack_require__(6656);var setGlobal=__webpack_require__(3505);var inspectSource=__webpack_require__(2788);var InternalStateModule=__webpack_require__(9909);var getInternalState=InternalStateModule.get;var enforceInternalState=InternalStateModule.enforce;var TEMPLATE=String(String).split('String');(module.exports=function(O,key,value,options){var unsafe=options?!!options.unsafe:false;var simple=options?!!options.enumerable:false;var noTargetGet=options?!!options.noTargetGet:false;var state;if(typeof value=='function'){if(typeof key=='string'&&!has(value,'name')){createNonEnumerableProperty(value,'name',key);}
state=enforceInternalState(value);if(!state.source){state.source=TEMPLATE.join(typeof key=='string'?key:'');}}
if(O===global){if(simple)O[key]=value;else setGlobal(key,value);return;}else if(!unsafe){delete O[key];}else if(!noTargetGet&&O[key]){simple=true;}
if(simple)O[key]=value;else createNonEnumerableProperty(O,key,value);})(Function.prototype,'toString',function toString(){return typeof this=='function'&&getInternalState(this).source||inspectSource(this);});}),7651:(function(module,__unused_webpack_exports,__webpack_require__){var classof=__webpack_require__(4326);var regexpExec=__webpack_require__(2261);module.exports=function(R,S){var exec=R.exec;if(typeof exec==='function'){var result=exec.call(R,S);if(typeof result!=='object'){throw TypeError('RegExp exec method returned something other than an Object or null');}
return result;}
if(classof(R)!=='RegExp'){throw TypeError('RegExp#exec called on incompatible receiver');}
return regexpExec.call(R,S);};}),2261:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var regexpFlags=__webpack_require__(7066);var stickyHelpers=__webpack_require__(2999);var nativeExec=RegExp.prototype.exec;var nativeReplace=String.prototype.replace;var patchedExec=nativeExec;var UPDATES_LAST_INDEX_WRONG=(function(){var re1=/a/;var re2=/b*/g;nativeExec.call(re1,'a');nativeExec.call(re2,'a');return re1.lastIndex!==0||re2.lastIndex!==0;})();var UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y||stickyHelpers.BROKEN_CARET;var NPCG_INCLUDED=/()??/.exec('')[1]!==undefined;var PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y;if(PATCH){patchedExec=function exec(str){var re=this;var lastIndex,reCopy,match,i;var sticky=UNSUPPORTED_Y&&re.sticky;var flags=regexpFlags.call(re);var source=re.source;var charsAdded=0;var strCopy=str;if(sticky){flags=flags.replace('y','');if(flags.indexOf('g')===-1){flags+='g';}
strCopy=String(str).slice(re.lastIndex);if(re.lastIndex>0&&(!re.multiline||re.multiline&&str[re.lastIndex-1]!=='\n')){source='(?: '+source+')';strCopy=' '+strCopy;charsAdded++;}
reCopy=new RegExp('^(?:'+source+')',flags);}
if(NPCG_INCLUDED){reCopy=new RegExp('^'+source+'$(?!\\s)',flags);}
if(UPDATES_LAST_INDEX_WRONG)lastIndex=re.lastIndex;match=nativeExec.call(sticky?reCopy:re,strCopy);if(sticky){if(match){match.input=match.input.slice(charsAdded);match[0]=match[0].slice(charsAdded);match.index=re.lastIndex;re.lastIndex+=match[0].length;}else re.lastIndex=0;}else if(UPDATES_LAST_INDEX_WRONG&&match){re.lastIndex=re.global?match.index+match[0].length:lastIndex;}
if(NPCG_INCLUDED&&match&&match.length>1){nativeReplace.call(match[0],reCopy,function(){for(i=1;i<arguments.length-2;i++){if(arguments[i]===undefined)match[i]=undefined;}});}
return match;};}
module.exports=patchedExec;}),7066:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var anObject=__webpack_require__(9670);module.exports=function(){var that=anObject(this);var result='';if(that.global)result+='g';if(that.ignoreCase)result+='i';if(that.multiline)result+='m';if(that.dotAll)result+='s';if(that.unicode)result+='u';if(that.sticky)result+='y';return result;};}),2999:(function(__unused_webpack_module,exports,__webpack_require__){"use strict";var fails=__webpack_require__(7293);function RE(s,f){return RegExp(s,f);}
exports.UNSUPPORTED_Y=fails(function(){var re=RE('a','y');re.lastIndex=2;return re.exec('abcd')!=null;});exports.BROKEN_CARET=fails(function(){var re=RE('^r','gy');re.lastIndex=2;return re.exec('str')!=null;});}),4488:(function(module){module.exports=function(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it;};}),3505:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var createNonEnumerableProperty=__webpack_require__(8880);module.exports=function(key,value){try{createNonEnumerableProperty(global,key,value);}catch(error){global[key]=value;}return value;};}),6340:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var getBuiltIn=__webpack_require__(5005);var definePropertyModule=__webpack_require__(3070);var wellKnownSymbol=__webpack_require__(5112);var DESCRIPTORS=__webpack_require__(9781);var SPECIES=wellKnownSymbol('species');module.exports=function(CONSTRUCTOR_NAME){var Constructor=getBuiltIn(CONSTRUCTOR_NAME);var defineProperty=definePropertyModule.f;if(DESCRIPTORS&&Constructor&&!Constructor[SPECIES]){defineProperty(Constructor,SPECIES,{configurable:true,get:function(){return this;}});}};}),8003:(function(module,__unused_webpack_exports,__webpack_require__){var defineProperty=__webpack_require__(3070).f;var has=__webpack_require__(6656);var wellKnownSymbol=__webpack_require__(5112);var TO_STRING_TAG=wellKnownSymbol('toStringTag');module.exports=function(it,TAG,STATIC){if(it&&!has(it=STATIC?it:it.prototype,TO_STRING_TAG)){defineProperty(it,TO_STRING_TAG,{configurable:true,value:TAG});}};}),6200:(function(module,__unused_webpack_exports,__webpack_require__){var shared=__webpack_require__(2309);var uid=__webpack_require__(9711);var keys=shared('keys');module.exports=function(key){return keys[key]||(keys[key]=uid(key));};}),5465:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var setGlobal=__webpack_require__(3505);var SHARED='__core-js_shared__';var store=global[SHARED]||setGlobal(SHARED,{});module.exports=store;}),2309:(function(module,__unused_webpack_exports,__webpack_require__){var IS_PURE=__webpack_require__(1913);var store=__webpack_require__(5465);(module.exports=function(key,value){return store[key]||(store[key]=value!==undefined?value:{});})('versions',[]).push({version:'3.9.0',mode:IS_PURE?'pure':'global',copyright:'© 2021 Denis Pushkarev (zloirock.ru)'});}),6707:(function(module,__unused_webpack_exports,__webpack_require__){var anObject=__webpack_require__(9670);var aFunction=__webpack_require__(3099);var wellKnownSymbol=__webpack_require__(5112);var SPECIES=wellKnownSymbol('species');module.exports=function(O,defaultConstructor){var C=anObject(O).constructor;var S;return C===undefined||(S=anObject(C)[SPECIES])==undefined?defaultConstructor:aFunction(S);};}),8710:(function(module,__unused_webpack_exports,__webpack_require__){var toInteger=__webpack_require__(9958);var requireObjectCoercible=__webpack_require__(4488);var createMethod=function(CONVERT_TO_STRING){return function($this,pos){var S=String(requireObjectCoercible($this));var position=toInteger(pos);var size=S.length;var first,second;if(position<0||position>=size)return CONVERT_TO_STRING?'':undefined;first=S.charCodeAt(position);return first<0xD800||first>0xDBFF||position+1===size||(second=S.charCodeAt(position+1))<0xDC00||second>0xDFFF?CONVERT_TO_STRING?S.charAt(position):first:CONVERT_TO_STRING?S.slice(position,position+2):(first-0xD800<<10)+(second-0xDC00)+0x10000;};};module.exports={codeAt:createMethod(false),charAt:createMethod(true)};}),3197:(function(module){"use strict";var maxInt=2147483647;var base=36;var tMin=1;var tMax=26;var skew=38;var damp=700;var initialBias=72;var initialN=128;var delimiter='-';var regexNonASCII=/[^\0-\u007E]/;var regexSeparators=/[.\u3002\uFF0E\uFF61]/g;var OVERFLOW_ERROR='Overflow: input needs wider integers to process';var baseMinusTMin=base-tMin;var floor=Math.floor;var stringFromCharCode=String.fromCharCode;var ucs2decode=function(string){var output=[];var counter=0;var length=string.length;while(counter<length){var value=string.charCodeAt(counter++);if(value>=0xD800&&value<=0xDBFF&&counter<length){var extra=string.charCodeAt(counter++);if((extra&0xFC00)==0xDC00){output.push(((value&0x3FF)<<10)+(extra&0x3FF)+0x10000);}else{output.push(value);counter--;}}else{output.push(value);}}
return output;};var digitToBasic=function(digit){return digit+22+75*(digit<26);};var adapt=function(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta / damp):delta>>1;delta+=floor(delta / numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta / baseMinusTMin);}
return floor(k+(baseMinusTMin+1)*delta /(delta+skew));};var encode=function(input){var output=[];input=ucs2decode(input);var inputLength=input.length;var n=initialN;var delta=0;var bias=initialBias;var i,currentValue;for(i=0;i<input.length;i++){currentValue=input[i];if(currentValue<0x80){output.push(stringFromCharCode(currentValue));}}
var basicLength=output.length;var handledCPCount=basicLength;if(basicLength){output.push(delimiter);}
while(handledCPCount<inputLength){var m=maxInt;for(i=0;i<input.length;i++){currentValue=input[i];if(currentValue>=n&&currentValue<m){m=currentValue;}}
var handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/ handledCPCountPlusOne)){throw RangeError(OVERFLOW_ERROR);}
delta+=(m-n)*handledCPCountPlusOne;n=m;for(i=0;i<input.length;i++){currentValue=input[i];if(currentValue<n&&++delta>maxInt){throw RangeError(OVERFLOW_ERROR);}
if(currentValue==n){var q=delta;for(var k=base;;k+=base){var t=k<=bias?tMin:(k>=bias+tMax?tMax:k-bias);if(q<t)break;var qMinusT=q-t;var baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT)));q=floor(qMinusT / baseMinusT);}
output.push(stringFromCharCode(digitToBasic(q)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}
++delta;++n;}
return output.join('');};module.exports=function(input){var encoded=[];var labels=input.toLowerCase().replace(regexSeparators,'\u002E').split('.');var i,label;for(i=0;i<labels.length;i++){label=labels[i];encoded.push(regexNonASCII.test(label)?'xn--'+encode(label):label);}
return encoded.join('.');};}),6091:(function(module,__unused_webpack_exports,__webpack_require__){var fails=__webpack_require__(7293);var whitespaces=__webpack_require__(1361);var non='\u200B\u0085\u180E';module.exports=function(METHOD_NAME){return fails(function(){return!!whitespaces[METHOD_NAME]()||non[METHOD_NAME]()!=non||whitespaces[METHOD_NAME].name!==METHOD_NAME;});};}),3111:(function(module,__unused_webpack_exports,__webpack_require__){var requireObjectCoercible=__webpack_require__(4488);var whitespaces=__webpack_require__(1361);var whitespace='['+whitespaces+']';var ltrim=RegExp('^'+whitespace+whitespace+'*');var rtrim=RegExp(whitespace+whitespace+'*$');var createMethod=function(TYPE){return function($this){var string=String(requireObjectCoercible($this));if(TYPE&1)string=string.replace(ltrim,'');if(TYPE&2)string=string.replace(rtrim,'');return string;};};module.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)};}),1400:(function(module,__unused_webpack_exports,__webpack_require__){var toInteger=__webpack_require__(9958);var max=Math.max;var min=Math.min;module.exports=function(index,length){var integer=toInteger(index);return integer<0?max(integer+length,0):min(integer,length);};}),7067:(function(module,__unused_webpack_exports,__webpack_require__){var toInteger=__webpack_require__(9958);var toLength=__webpack_require__(7466);module.exports=function(it){if(it===undefined)return 0;var number=toInteger(it);var length=toLength(number);if(number!==length)throw RangeError('Wrong length or index');return length;};}),5656:(function(module,__unused_webpack_exports,__webpack_require__){var IndexedObject=__webpack_require__(8361);var requireObjectCoercible=__webpack_require__(4488);module.exports=function(it){return IndexedObject(requireObjectCoercible(it));};}),9958:(function(module){var ceil=Math.ceil;var floor=Math.floor;module.exports=function(argument){return isNaN(argument=+argument)?0:(argument>0?floor:ceil)(argument);};}),7466:(function(module,__unused_webpack_exports,__webpack_require__){var toInteger=__webpack_require__(9958);var min=Math.min;module.exports=function(argument){return argument>0?min(toInteger(argument),0x1FFFFFFFFFFFFF):0;};}),7908:(function(module,__unused_webpack_exports,__webpack_require__){var requireObjectCoercible=__webpack_require__(4488);module.exports=function(argument){return Object(requireObjectCoercible(argument));};}),4590:(function(module,__unused_webpack_exports,__webpack_require__){var toPositiveInteger=__webpack_require__(3002);module.exports=function(it,BYTES){var offset=toPositiveInteger(it);if(offset%BYTES)throw RangeError('Wrong offset');return offset;};}),3002:(function(module,__unused_webpack_exports,__webpack_require__){var toInteger=__webpack_require__(9958);module.exports=function(it){var result=toInteger(it);if(result<0)throw RangeError("The argument can't be less than 0");return result;};}),7593:(function(module,__unused_webpack_exports,__webpack_require__){var isObject=__webpack_require__(111);module.exports=function(input,PREFERRED_STRING){if(!isObject(input))return input;var fn,val;if(PREFERRED_STRING&&typeof(fn=input.toString)=='function'&&!isObject(val=fn.call(input)))return val;if(typeof(fn=input.valueOf)=='function'&&!isObject(val=fn.call(input)))return val;if(!PREFERRED_STRING&&typeof(fn=input.toString)=='function'&&!isObject(val=fn.call(input)))return val;throw TypeError("Can't convert object to primitive value");};}),1694:(function(module,__unused_webpack_exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(5112);var TO_STRING_TAG=wellKnownSymbol('toStringTag');var test={};test[TO_STRING_TAG]='z';module.exports=String(test)==='[object z]';}),9843:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var global=__webpack_require__(7854);var DESCRIPTORS=__webpack_require__(9781);var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS=__webpack_require__(3832);var ArrayBufferViewCore=__webpack_require__(260);var ArrayBufferModule=__webpack_require__(3331);var anInstance=__webpack_require__(5787);var createPropertyDescriptor=__webpack_require__(9114);var createNonEnumerableProperty=__webpack_require__(8880);var toLength=__webpack_require__(7466);var toIndex=__webpack_require__(7067);var toOffset=__webpack_require__(4590);var toPrimitive=__webpack_require__(7593);var has=__webpack_require__(6656);var classof=__webpack_require__(648);var isObject=__webpack_require__(111);var create=__webpack_require__(30);var setPrototypeOf=__webpack_require__(7674);var getOwnPropertyNames=__webpack_require__(8006).f;var typedArrayFrom=__webpack_require__(7321);var forEach=__webpack_require__(2092).forEach;var setSpecies=__webpack_require__(6340);var definePropertyModule=__webpack_require__(3070);var getOwnPropertyDescriptorModule=__webpack_require__(1236);var InternalStateModule=__webpack_require__(9909);var inheritIfRequired=__webpack_require__(9587);var getInternalState=InternalStateModule.get;var setInternalState=InternalStateModule.set;var nativeDefineProperty=definePropertyModule.f;var nativeGetOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f;var round=Math.round;var RangeError=global.RangeError;var ArrayBuffer=ArrayBufferModule.ArrayBuffer;var DataView=ArrayBufferModule.DataView;var NATIVE_ARRAY_BUFFER_VIEWS=ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;var TYPED_ARRAY_TAG=ArrayBufferViewCore.TYPED_ARRAY_TAG;var TypedArray=ArrayBufferViewCore.TypedArray;var TypedArrayPrototype=ArrayBufferViewCore.TypedArrayPrototype;var aTypedArrayConstructor=ArrayBufferViewCore.aTypedArrayConstructor;var isTypedArray=ArrayBufferViewCore.isTypedArray;var BYTES_PER_ELEMENT='BYTES_PER_ELEMENT';var WRONG_LENGTH='Wrong length';var fromList=function(C,list){var index=0;var length=list.length;var result=new(aTypedArrayConstructor(C))(length);while(length>index)result[index]=list[index++];return result;};var addGetter=function(it,key){nativeDefineProperty(it,key,{get:function(){return getInternalState(this)[key];}});};var isArrayBuffer=function(it){var klass;return it instanceof ArrayBuffer||(klass=classof(it))=='ArrayBuffer'||klass=='SharedArrayBuffer';};var isTypedArrayIndex=function(target,key){return isTypedArray(target)&&typeof key!='symbol'&&key in target&&String(+key)==String(key);};var wrappedGetOwnPropertyDescriptor=function getOwnPropertyDescriptor(target,key){return isTypedArrayIndex(target,key=toPrimitive(key,true))?createPropertyDescriptor(2,target[key]):nativeGetOwnPropertyDescriptor(target,key);};var wrappedDefineProperty=function defineProperty(target,key,descriptor){if(isTypedArrayIndex(target,key=toPrimitive(key,true))&&isObject(descriptor)&&has(descriptor,'value')&&!has(descriptor,'get')&&!has(descriptor,'set')&&!descriptor.configurable&&(!has(descriptor,'writable')||descriptor.writable)&&(!has(descriptor,'enumerable')||descriptor.enumerable)){target[key]=descriptor.value;return target;}return nativeDefineProperty(target,key,descriptor);};if(DESCRIPTORS){if(!NATIVE_ARRAY_BUFFER_VIEWS){getOwnPropertyDescriptorModule.f=wrappedGetOwnPropertyDescriptor;definePropertyModule.f=wrappedDefineProperty;addGetter(TypedArrayPrototype,'buffer');addGetter(TypedArrayPrototype,'byteOffset');addGetter(TypedArrayPrototype,'byteLength');addGetter(TypedArrayPrototype,'length');}
$({target:'Object',stat:true,forced:!NATIVE_ARRAY_BUFFER_VIEWS},{getOwnPropertyDescriptor:wrappedGetOwnPropertyDescriptor,defineProperty:wrappedDefineProperty});module.exports=function(TYPE,wrapper,CLAMPED){var BYTES=TYPE.match(/\d+$/)[0]/ 8;var CONSTRUCTOR_NAME=TYPE+(CLAMPED?'Clamped':'')+'Array';var GETTER='get'+TYPE;var SETTER='set'+TYPE;var NativeTypedArrayConstructor=global[CONSTRUCTOR_NAME];var TypedArrayConstructor=NativeTypedArrayConstructor;var TypedArrayConstructorPrototype=TypedArrayConstructor&&TypedArrayConstructor.prototype;var exported={};var getter=function(that,index){var data=getInternalState(that);return data.view[GETTER](index*BYTES+data.byteOffset,true);};var setter=function(that,index,value){var data=getInternalState(that);if(CLAMPED)value=(value=round(value))<0?0:value>0xFF?0xFF:value&0xFF;data.view[SETTER](index*BYTES+data.byteOffset,value,true);};var addElement=function(that,index){nativeDefineProperty(that,index,{get:function(){return getter(this,index);},set:function(value){return setter(this,index,value);},enumerable:true});};if(!NATIVE_ARRAY_BUFFER_VIEWS){TypedArrayConstructor=wrapper(function(that,data,offset,$length){anInstance(that,TypedArrayConstructor,CONSTRUCTOR_NAME);var index=0;var byteOffset=0;var buffer,byteLength,length;if(!isObject(data)){length=toIndex(data);byteLength=length*BYTES;buffer=new ArrayBuffer(byteLength);}else if(isArrayBuffer(data)){buffer=data;byteOffset=toOffset(offset,BYTES);var $len=data.byteLength;if($length===undefined){if($len%BYTES)throw RangeError(WRONG_LENGTH);byteLength=$len-byteOffset;if(byteLength<0)throw RangeError(WRONG_LENGTH);}else{byteLength=toLength($length)*BYTES;if(byteLength+byteOffset>$len)throw RangeError(WRONG_LENGTH);}
length=byteLength / BYTES;}else if(isTypedArray(data)){return fromList(TypedArrayConstructor,data);}else{return typedArrayFrom.call(TypedArrayConstructor,data);}
setInternalState(that,{buffer:buffer,byteOffset:byteOffset,byteLength:byteLength,length:length,view:new DataView(buffer)});while(index<length)addElement(that,index++);});if(setPrototypeOf)setPrototypeOf(TypedArrayConstructor,TypedArray);TypedArrayConstructorPrototype=TypedArrayConstructor.prototype=create(TypedArrayPrototype);}else if(TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS){TypedArrayConstructor=wrapper(function(dummy,data,typedArrayOffset,$length){anInstance(dummy,TypedArrayConstructor,CONSTRUCTOR_NAME);return inheritIfRequired(function(){if(!isObject(data))return new NativeTypedArrayConstructor(toIndex(data));if(isArrayBuffer(data))return $length!==undefined?new NativeTypedArrayConstructor(data,toOffset(typedArrayOffset,BYTES),$length):typedArrayOffset!==undefined?new NativeTypedArrayConstructor(data,toOffset(typedArrayOffset,BYTES)):new NativeTypedArrayConstructor(data);if(isTypedArray(data))return fromList(TypedArrayConstructor,data);return typedArrayFrom.call(TypedArrayConstructor,data);}(),dummy,TypedArrayConstructor);});if(setPrototypeOf)setPrototypeOf(TypedArrayConstructor,TypedArray);forEach(getOwnPropertyNames(NativeTypedArrayConstructor),function(key){if(!(key in TypedArrayConstructor)){createNonEnumerableProperty(TypedArrayConstructor,key,NativeTypedArrayConstructor[key]);}});TypedArrayConstructor.prototype=TypedArrayConstructorPrototype;}
if(TypedArrayConstructorPrototype.constructor!==TypedArrayConstructor){createNonEnumerableProperty(TypedArrayConstructorPrototype,'constructor',TypedArrayConstructor);}
if(TYPED_ARRAY_TAG){createNonEnumerableProperty(TypedArrayConstructorPrototype,TYPED_ARRAY_TAG,CONSTRUCTOR_NAME);}
exported[CONSTRUCTOR_NAME]=TypedArrayConstructor;$({global:true,forced:TypedArrayConstructor!=NativeTypedArrayConstructor,sham:!NATIVE_ARRAY_BUFFER_VIEWS},exported);if(!(BYTES_PER_ELEMENT in TypedArrayConstructor)){createNonEnumerableProperty(TypedArrayConstructor,BYTES_PER_ELEMENT,BYTES);}
if(!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)){createNonEnumerableProperty(TypedArrayConstructorPrototype,BYTES_PER_ELEMENT,BYTES);}
setSpecies(CONSTRUCTOR_NAME);};}else module.exports=function(){};}),3832:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var fails=__webpack_require__(7293);var checkCorrectnessOfIteration=__webpack_require__(7072);var NATIVE_ARRAY_BUFFER_VIEWS=__webpack_require__(260).NATIVE_ARRAY_BUFFER_VIEWS;var ArrayBuffer=global.ArrayBuffer;var Int8Array=global.Int8Array;module.exports=!NATIVE_ARRAY_BUFFER_VIEWS||!fails(function(){Int8Array(1);})||!fails(function(){new Int8Array(-1);})||!checkCorrectnessOfIteration(function(iterable){new Int8Array();new Int8Array(null);new Int8Array(1.5);new Int8Array(iterable);},true)||fails(function(){return new Int8Array(new ArrayBuffer(2),1,undefined).length!==1;});}),3074:(function(module,__unused_webpack_exports,__webpack_require__){var aTypedArrayConstructor=__webpack_require__(260).aTypedArrayConstructor;var speciesConstructor=__webpack_require__(6707);module.exports=function(instance,list){var C=speciesConstructor(instance,instance.constructor);var index=0;var length=list.length;var result=new(aTypedArrayConstructor(C))(length);while(length>index)result[index]=list[index++];return result;};}),7321:(function(module,__unused_webpack_exports,__webpack_require__){var toObject=__webpack_require__(7908);var toLength=__webpack_require__(7466);var getIteratorMethod=__webpack_require__(1246);var isArrayIteratorMethod=__webpack_require__(7659);var bind=__webpack_require__(9974);var aTypedArrayConstructor=__webpack_require__(260).aTypedArrayConstructor;module.exports=function from(source){var O=toObject(source);var argumentsLength=arguments.length;var mapfn=argumentsLength>1?arguments[1]:undefined;var mapping=mapfn!==undefined;var iteratorMethod=getIteratorMethod(O);var i,length,result,step,iterator,next;if(iteratorMethod!=undefined&&!isArrayIteratorMethod(iteratorMethod)){iterator=iteratorMethod.call(O);next=iterator.next;O=[];while(!(step=next.call(iterator)).done){O.push(step.value);}}
if(mapping&&argumentsLength>2){mapfn=bind(mapfn,arguments[2],2);}
length=toLength(O.length);result=new(aTypedArrayConstructor(this))(length);for(i=0;length>i;i++){result[i]=mapping?mapfn(O[i],i):O[i];}
return result;};}),9711:(function(module){var id=0;var postfix=Math.random();module.exports=function(key){return'Symbol('+String(key===undefined?'':key)+')_'+(++id+postfix).toString(36);};}),3307:(function(module,__unused_webpack_exports,__webpack_require__){var NATIVE_SYMBOL=__webpack_require__(133);module.exports=NATIVE_SYMBOL&&!Symbol.sham&&typeof Symbol.iterator=='symbol';}),5112:(function(module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var shared=__webpack_require__(2309);var has=__webpack_require__(6656);var uid=__webpack_require__(9711);var NATIVE_SYMBOL=__webpack_require__(133);var USE_SYMBOL_AS_UID=__webpack_require__(3307);var WellKnownSymbolsStore=shared('wks');var Symbol=global.Symbol;var createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol:Symbol&&Symbol.withoutSetter||uid;module.exports=function(name){if(!has(WellKnownSymbolsStore,name)){if(NATIVE_SYMBOL&&has(Symbol,name))WellKnownSymbolsStore[name]=Symbol[name];else WellKnownSymbolsStore[name]=createWellKnownSymbol('Symbol.'+name);}return WellKnownSymbolsStore[name];};}),1361:(function(module){module.exports='\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002'+'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';}),8264:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var global=__webpack_require__(7854);var arrayBufferModule=__webpack_require__(3331);var setSpecies=__webpack_require__(6340);var ARRAY_BUFFER='ArrayBuffer';var ArrayBuffer=arrayBufferModule[ARRAY_BUFFER];var NativeArrayBuffer=global[ARRAY_BUFFER];$({global:true,forced:NativeArrayBuffer!==ArrayBuffer},{ArrayBuffer:ArrayBuffer});setSpecies(ARRAY_BUFFER);}),2222:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var fails=__webpack_require__(7293);var isArray=__webpack_require__(3157);var isObject=__webpack_require__(111);var toObject=__webpack_require__(7908);var toLength=__webpack_require__(7466);var createProperty=__webpack_require__(6135);var arraySpeciesCreate=__webpack_require__(5417);var arrayMethodHasSpeciesSupport=__webpack_require__(1194);var wellKnownSymbol=__webpack_require__(5112);var V8_VERSION=__webpack_require__(7392);var IS_CONCAT_SPREADABLE=wellKnownSymbol('isConcatSpreadable');var MAX_SAFE_INTEGER=0x1FFFFFFFFFFFFF;var MAXIMUM_ALLOWED_INDEX_EXCEEDED='Maximum allowed index exceeded';var IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION>=51||!fails(function(){var array=[];array[IS_CONCAT_SPREADABLE]=false;return array.concat()[0]!==array;});var SPECIES_SUPPORT=arrayMethodHasSpeciesSupport('concat');var isConcatSpreadable=function(O){if(!isObject(O))return false;var spreadable=O[IS_CONCAT_SPREADABLE];return spreadable!==undefined?!!spreadable:isArray(O);};var FORCED=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;$({target:'Array',proto:true,forced:FORCED},{concat:function concat(arg){var O=toObject(this);var A=arraySpeciesCreate(O,0);var n=0;var i,k,length,len,E;for(i=-1,length=arguments.length;i<length;i++){E=i===-1?O:arguments[i];if(isConcatSpreadable(E)){len=toLength(E.length);if(n+len>MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);for(k=0;k<len;k++,n++)if(k in E)createProperty(A,n,E[k]);}else{if(n>=MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);createProperty(A,n++,E);}}
A.length=n;return A;}});}),7327:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var $filter=__webpack_require__(2092).filter;var arrayMethodHasSpeciesSupport=__webpack_require__(1194);var HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport('filter');$({target:'Array',proto:true,forced:!HAS_SPECIES_SUPPORT},{filter:function filter(callbackfn){return $filter(this,callbackfn,arguments.length>1?arguments[1]:undefined);}});}),2772:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var $indexOf=__webpack_require__(1318).indexOf;var arrayMethodIsStrict=__webpack_require__(9341);var nativeIndexOf=[].indexOf;var NEGATIVE_ZERO=!!nativeIndexOf&&1 /[1].indexOf(1,-0)<0;var STRICT_METHOD=arrayMethodIsStrict('indexOf');$({target:'Array',proto:true,forced:NEGATIVE_ZERO||!STRICT_METHOD},{indexOf:function indexOf(searchElement){return NEGATIVE_ZERO?nativeIndexOf.apply(this,arguments)||0:$indexOf(this,searchElement,arguments.length>1?arguments[1]:undefined);}});}),6992:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";var toIndexedObject=__webpack_require__(5656);var addToUnscopables=__webpack_require__(1223);var Iterators=__webpack_require__(7497);var InternalStateModule=__webpack_require__(9909);var defineIterator=__webpack_require__(654);var ARRAY_ITERATOR='Array Iterator';var setInternalState=InternalStateModule.set;var getInternalState=InternalStateModule.getterFor(ARRAY_ITERATOR);module.exports=defineIterator(Array,'Array',function(iterated,kind){setInternalState(this,{type:ARRAY_ITERATOR,target:toIndexedObject(iterated),index:0,kind:kind});},function(){var state=getInternalState(this);var target=state.target;var kind=state.kind;var index=state.index++;if(!target||index>=target.length){state.target=undefined;return{value:undefined,done:true};}
if(kind=='keys')return{value:index,done:false};if(kind=='values')return{value:target[index],done:false};return{value:[index,target[index]],done:false};},'values');Iterators.Arguments=Iterators.Array;addToUnscopables('keys');addToUnscopables('values');addToUnscopables('entries');}),1249:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var $map=__webpack_require__(2092).map;var arrayMethodHasSpeciesSupport=__webpack_require__(1194);var HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport('map');$({target:'Array',proto:true,forced:!HAS_SPECIES_SUPPORT},{map:function map(callbackfn){return $map(this,callbackfn,arguments.length>1?arguments[1]:undefined);}});}),7042:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var isObject=__webpack_require__(111);var isArray=__webpack_require__(3157);var toAbsoluteIndex=__webpack_require__(1400);var toLength=__webpack_require__(7466);var toIndexedObject=__webpack_require__(5656);var createProperty=__webpack_require__(6135);var wellKnownSymbol=__webpack_require__(5112);var arrayMethodHasSpeciesSupport=__webpack_require__(1194);var HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport('slice');var SPECIES=wellKnownSymbol('species');var nativeSlice=[].slice;var max=Math.max;$({target:'Array',proto:true,forced:!HAS_SPECIES_SUPPORT},{slice:function slice(start,end){var O=toIndexedObject(this);var length=toLength(O.length);var k=toAbsoluteIndex(start,length);var fin=toAbsoluteIndex(end===undefined?length:end,length);var Constructor,result,n;if(isArray(O)){Constructor=O.constructor;if(typeof Constructor=='function'&&(Constructor===Array||isArray(Constructor.prototype))){Constructor=undefined;}else if(isObject(Constructor)){Constructor=Constructor[SPECIES];if(Constructor===null)Constructor=undefined;}
if(Constructor===Array||Constructor===undefined){return nativeSlice.call(O,k,fin);}}
result=new(Constructor===undefined?Array:Constructor)(max(fin-k,0));for(n=0;k<fin;k++,n++)if(k in O)createProperty(result,n,O[k]);result.length=n;return result;}});}),561:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var toAbsoluteIndex=__webpack_require__(1400);var toInteger=__webpack_require__(9958);var toLength=__webpack_require__(7466);var toObject=__webpack_require__(7908);var arraySpeciesCreate=__webpack_require__(5417);var createProperty=__webpack_require__(6135);var arrayMethodHasSpeciesSupport=__webpack_require__(1194);var HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport('splice');var max=Math.max;var min=Math.min;var MAX_SAFE_INTEGER=0x1FFFFFFFFFFFFF;var MAXIMUM_ALLOWED_LENGTH_EXCEEDED='Maximum allowed length exceeded';$({target:'Array',proto:true,forced:!HAS_SPECIES_SUPPORT},{splice:function splice(start,deleteCount){var O=toObject(this);var len=toLength(O.length);var actualStart=toAbsoluteIndex(start,len);var argumentsLength=arguments.length;var insertCount,actualDeleteCount,A,k,from,to;if(argumentsLength===0){insertCount=actualDeleteCount=0;}else if(argumentsLength===1){insertCount=0;actualDeleteCount=len-actualStart;}else{insertCount=argumentsLength-2;actualDeleteCount=min(max(toInteger(deleteCount),0),len-actualStart);}
if(len+insertCount-actualDeleteCount>MAX_SAFE_INTEGER){throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);}
A=arraySpeciesCreate(O,actualDeleteCount);for(k=0;k<actualDeleteCount;k++){from=actualStart+k;if(from in O)createProperty(A,k,O[from]);}
A.length=actualDeleteCount;if(insertCount<actualDeleteCount){for(k=actualStart;k<len-actualDeleteCount;k++){from=k+actualDeleteCount;to=k+insertCount;if(from in O)O[to]=O[from];else delete O[to];}
for(k=len;k>len-actualDeleteCount+insertCount;k--)delete O[k-1];}else if(insertCount>actualDeleteCount){for(k=len-actualDeleteCount;k>actualStart;k--){from=k+actualDeleteCount-1;to=k+insertCount-1;if(from in O)O[to]=O[from];else delete O[to];}}
for(k=0;k<insertCount;k++){O[k+actualStart]=arguments[k+2];}
O.length=len-actualDeleteCount+insertCount;return A;}});}),8309:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(9781);var defineProperty=__webpack_require__(3070).f;var FunctionPrototype=Function.prototype;var FunctionPrototypeToString=FunctionPrototype.toString;var nameRE=/^\s*function ([^ (]*)/;var NAME='name';if(DESCRIPTORS&&!(NAME in FunctionPrototype)){defineProperty(FunctionPrototype,NAME,{configurable:true,get:function(){try{return FunctionPrototypeToString.call(this).match(nameRE)[1];}catch(error){return'';}}});}}),489:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var $=__webpack_require__(2109);var fails=__webpack_require__(7293);var toObject=__webpack_require__(7908);var nativeGetPrototypeOf=__webpack_require__(9518);var CORRECT_PROTOTYPE_GETTER=__webpack_require__(8544);var FAILS_ON_PRIMITIVES=fails(function(){nativeGetPrototypeOf(1);});$({target:'Object',stat:true,forced:FAILS_ON_PRIMITIVES,sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function getPrototypeOf(it){return nativeGetPrototypeOf(toObject(it));}});}),1539:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var TO_STRING_TAG_SUPPORT=__webpack_require__(1694);var redefine=__webpack_require__(1320);var toString=__webpack_require__(288);if(!TO_STRING_TAG_SUPPORT){redefine(Object.prototype,'toString',toString,{unsafe:true});}}),4916:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var exec=__webpack_require__(2261);$({target:'RegExp',proto:true,forced:/./.exec!==exec},{exec:exec});}),9714:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var redefine=__webpack_require__(1320);var anObject=__webpack_require__(9670);var fails=__webpack_require__(7293);var flags=__webpack_require__(7066);var TO_STRING='toString';var RegExpPrototype=RegExp.prototype;var nativeToString=RegExpPrototype[TO_STRING];var NOT_GENERIC=fails(function(){return nativeToString.call({source:'a',flags:'b'})!='/a/b';});var INCORRECT_NAME=nativeToString.name!=TO_STRING;if(NOT_GENERIC||INCORRECT_NAME){redefine(RegExp.prototype,TO_STRING,function toString(){var R=anObject(this);var p=String(R.source);var rf=R.flags;var f=String(rf===undefined&&R instanceof RegExp&&!('flags'in RegExpPrototype)?flags.call(R):rf);return'/'+p+'/'+f;},{unsafe:true});}}),8783:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var charAt=__webpack_require__(8710).charAt;var InternalStateModule=__webpack_require__(9909);var defineIterator=__webpack_require__(654);var STRING_ITERATOR='String Iterator';var setInternalState=InternalStateModule.set;var getInternalState=InternalStateModule.getterFor(STRING_ITERATOR);defineIterator(String,'String',function(iterated){setInternalState(this,{type:STRING_ITERATOR,string:String(iterated),index:0});},function next(){var state=getInternalState(this);var string=state.string;var index=state.index;var point;if(index>=string.length)return{value:undefined,done:true};point=charAt(string,index);state.index+=point.length;return{value:point,done:false};});}),4723:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(7007);var anObject=__webpack_require__(9670);var toLength=__webpack_require__(7466);var requireObjectCoercible=__webpack_require__(4488);var advanceStringIndex=__webpack_require__(1530);var regExpExec=__webpack_require__(7651);fixRegExpWellKnownSymbolLogic('match',1,function(MATCH,nativeMatch,maybeCallNative){return[function match(regexp){var O=requireObjectCoercible(this);var matcher=regexp==undefined?undefined:regexp[MATCH];return matcher!==undefined?matcher.call(regexp,O):new RegExp(regexp)[MATCH](String(O));},function(regexp){var res=maybeCallNative(nativeMatch,regexp,this);if(res.done)return res.value;var rx=anObject(regexp);var S=String(this);if(!rx.global)return regExpExec(rx,S);var fullUnicode=rx.unicode;rx.lastIndex=0;var A=[];var n=0;var result;while((result=regExpExec(rx,S))!==null){var matchStr=String(result[0]);A[n]=matchStr;if(matchStr==='')rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode);n++;}
return n===0?null:A;}];});}),5306:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(7007);var anObject=__webpack_require__(9670);var toLength=__webpack_require__(7466);var toInteger=__webpack_require__(9958);var requireObjectCoercible=__webpack_require__(4488);var advanceStringIndex=__webpack_require__(1530);var getSubstitution=__webpack_require__(647);var regExpExec=__webpack_require__(7651);var max=Math.max;var min=Math.min;var maybeToString=function(it){return it===undefined?it:String(it);};fixRegExpWellKnownSymbolLogic('replace',2,function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;var REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0;var UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?'$':'$0';return[function replace(searchValue,replaceValue){var O=requireObjectCoercible(this);var replacer=searchValue==undefined?undefined:searchValue[REPLACE];return replacer!==undefined?replacer.call(searchValue,O,replaceValue):nativeReplace.call(String(O),searchValue,replaceValue);},function(regexp,replaceValue){if((!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE&&REPLACE_KEEPS_$0)||(typeof replaceValue==='string'&&replaceValue.indexOf(UNSAFE_SUBSTITUTE)===-1)){var res=maybeCallNative(nativeReplace,regexp,this,replaceValue);if(res.done)return res.value;}
var rx=anObject(regexp);var S=String(this);var functionalReplace=typeof replaceValue==='function';if(!functionalReplace)replaceValue=String(replaceValue);var global=rx.global;if(global){var fullUnicode=rx.unicode;rx.lastIndex=0;}
var results=[];while(true){var result=regExpExec(rx,S);if(result===null)break;results.push(result);if(!global)break;var matchStr=String(result[0]);if(matchStr==='')rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode);}
var accumulatedResult='';var nextSourcePosition=0;for(var i=0;i<results.length;i++){result=results[i];var matched=String(result[0]);var position=max(min(toInteger(result.index),S.length),0);var captures=[];for(var j=1;j<result.length;j++)captures.push(maybeToString(result[j]));var namedCaptures=result.groups;if(functionalReplace){var replacerArgs=[matched].concat(captures,position,S);if(namedCaptures!==undefined)replacerArgs.push(namedCaptures);var replacement=String(replaceValue.apply(undefined,replacerArgs));}else{replacement=getSubstitution(matched,S,position,captures,namedCaptures,replaceValue);}
if(position>=nextSourcePosition){accumulatedResult+=S.slice(nextSourcePosition,position)+replacement;nextSourcePosition=position+matched.length;}}
return accumulatedResult+S.slice(nextSourcePosition);}];});}),3123:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(7007);var isRegExp=__webpack_require__(7850);var anObject=__webpack_require__(9670);var requireObjectCoercible=__webpack_require__(4488);var speciesConstructor=__webpack_require__(6707);var advanceStringIndex=__webpack_require__(1530);var toLength=__webpack_require__(7466);var callRegExpExec=__webpack_require__(7651);var regexpExec=__webpack_require__(2261);var fails=__webpack_require__(7293);var arrayPush=[].push;var min=Math.min;var MAX_UINT32=0xFFFFFFFF;var SUPPORTS_Y=!fails(function(){return!RegExp(MAX_UINT32,'y');});fixRegExpWellKnownSymbolLogic('split',2,function(SPLIT,nativeSplit,maybeCallNative){var internalSplit;if('abbc'.split(/(b)*/)[1]=='c'||'test'.split(/(?:)/,-1).length!=4||'ab'.split(/(?:ab)*/).length!=2||'.'.split(/(.?)(.?)/).length!=4||'.'.split(/()()/).length>1||''.split(/.?/).length){internalSplit=function(separator,limit){var string=String(requireObjectCoercible(this));var lim=limit===undefined?MAX_UINT32:limit>>>0;if(lim===0)return[];if(separator===undefined)return[string];if(!isRegExp(separator)){return nativeSplit.call(string,separator,lim);}
var output=[];var flags=(separator.ignoreCase?'i':'')+
(separator.multiline?'m':'')+
(separator.unicode?'u':'')+
(separator.sticky?'y':'');var lastLastIndex=0;var separatorCopy=new RegExp(separator.source,flags+'g');var match,lastIndex,lastLength;while(match=regexpExec.call(separatorCopy,string)){lastIndex=separatorCopy.lastIndex;if(lastIndex>lastLastIndex){output.push(string.slice(lastLastIndex,match.index));if(match.length>1&&match.index<string.length)arrayPush.apply(output,match.slice(1));lastLength=match[0].length;lastLastIndex=lastIndex;if(output.length>=lim)break;}
if(separatorCopy.lastIndex===match.index)separatorCopy.lastIndex++;}
if(lastLastIndex===string.length){if(lastLength||!separatorCopy.test(''))output.push('');}else output.push(string.slice(lastLastIndex));return output.length>lim?output.slice(0,lim):output;};}else if('0'.split(undefined,0).length){internalSplit=function(separator,limit){return separator===undefined&&limit===0?[]:nativeSplit.call(this,separator,limit);};}else internalSplit=nativeSplit;return[function split(separator,limit){var O=requireObjectCoercible(this);var splitter=separator==undefined?undefined:separator[SPLIT];return splitter!==undefined?splitter.call(separator,O,limit):internalSplit.call(String(O),separator,limit);},function(regexp,limit){var res=maybeCallNative(internalSplit,regexp,this,limit,internalSplit!==nativeSplit);if(res.done)return res.value;var rx=anObject(regexp);var S=String(this);var C=speciesConstructor(rx,RegExp);var unicodeMatching=rx.unicode;var flags=(rx.ignoreCase?'i':'')+
(rx.multiline?'m':'')+
(rx.unicode?'u':'')+
(SUPPORTS_Y?'y':'g');var splitter=new C(SUPPORTS_Y?rx:'^(?:'+rx.source+')',flags);var lim=limit===undefined?MAX_UINT32:limit>>>0;if(lim===0)return[];if(S.length===0)return callRegExpExec(splitter,S)===null?[S]:[];var p=0;var q=0;var A=[];while(q<S.length){splitter.lastIndex=SUPPORTS_Y?q:0;var z=callRegExpExec(splitter,SUPPORTS_Y?S:S.slice(q));var e;if(z===null||(e=min(toLength(splitter.lastIndex+(SUPPORTS_Y?0:q)),S.length))===p){q=advanceStringIndex(S,q,unicodeMatching);}else{A.push(S.slice(p,q));if(A.length===lim)return A;for(var i=1;i<=z.length-1;i++){A.push(z[i]);if(A.length===lim)return A;}
q=p=e;}}
A.push(S.slice(p));return A;}];},!SUPPORTS_Y);}),3210:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var $=__webpack_require__(2109);var $trim=__webpack_require__(3111).trim;var forcedStringTrimMethod=__webpack_require__(6091);$({target:'String',proto:true,forced:forcedStringTrimMethod('trim')},{trim:function trim(){return $trim(this);}});}),2990:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $copyWithin=__webpack_require__(1048);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('copyWithin',function copyWithin(target,start){return $copyWithin.call(aTypedArray(this),target,start,arguments.length>2?arguments[2]:undefined);});}),8927:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $every=__webpack_require__(2092).every;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('every',function every(callbackfn){return $every(aTypedArray(this),callbackfn,arguments.length>1?arguments[1]:undefined);});}),3105:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $fill=__webpack_require__(1285);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('fill',function fill(value){return $fill.apply(aTypedArray(this),arguments);});}),5035:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $filter=__webpack_require__(2092).filter;var fromSpeciesAndList=__webpack_require__(3074);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('filter',function filter(callbackfn){var list=$filter(aTypedArray(this),callbackfn,arguments.length>1?arguments[1]:undefined);return fromSpeciesAndList(this,list);});}),7174:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $findIndex=__webpack_require__(2092).findIndex;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('findIndex',function findIndex(predicate){return $findIndex(aTypedArray(this),predicate,arguments.length>1?arguments[1]:undefined);});}),4345:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $find=__webpack_require__(2092).find;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('find',function find(predicate){return $find(aTypedArray(this),predicate,arguments.length>1?arguments[1]:undefined);});}),2846:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $forEach=__webpack_require__(2092).forEach;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('forEach',function forEach(callbackfn){$forEach(aTypedArray(this),callbackfn,arguments.length>1?arguments[1]:undefined);});}),4731:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $includes=__webpack_require__(1318).includes;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('includes',function includes(searchElement){return $includes(aTypedArray(this),searchElement,arguments.length>1?arguments[1]:undefined);});}),7209:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $indexOf=__webpack_require__(1318).indexOf;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('indexOf',function indexOf(searchElement){return $indexOf(aTypedArray(this),searchElement,arguments.length>1?arguments[1]:undefined);});}),6319:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var global=__webpack_require__(7854);var ArrayBufferViewCore=__webpack_require__(260);var ArrayIterators=__webpack_require__(6992);var wellKnownSymbol=__webpack_require__(5112);var ITERATOR=wellKnownSymbol('iterator');var Uint8Array=global.Uint8Array;var arrayValues=ArrayIterators.values;var arrayKeys=ArrayIterators.keys;var arrayEntries=ArrayIterators.entries;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var nativeTypedArrayIterator=Uint8Array&&Uint8Array.prototype[ITERATOR];var CORRECT_ITER_NAME=!!nativeTypedArrayIterator&&(nativeTypedArrayIterator.name=='values'||nativeTypedArrayIterator.name==undefined);var typedArrayValues=function values(){return arrayValues.call(aTypedArray(this));};exportTypedArrayMethod('entries',function entries(){return arrayEntries.call(aTypedArray(this));});exportTypedArrayMethod('keys',function keys(){return arrayKeys.call(aTypedArray(this));});exportTypedArrayMethod('values',typedArrayValues,!CORRECT_ITER_NAME);exportTypedArrayMethod(ITERATOR,typedArrayValues,!CORRECT_ITER_NAME);}),8867:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var $join=[].join;exportTypedArrayMethod('join',function join(separator){return $join.apply(aTypedArray(this),arguments);});}),7789:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $lastIndexOf=__webpack_require__(6583);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('lastIndexOf',function lastIndexOf(searchElement){return $lastIndexOf.apply(aTypedArray(this),arguments);});}),3739:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $map=__webpack_require__(2092).map;var speciesConstructor=__webpack_require__(6707);var aTypedArray=ArrayBufferViewCore.aTypedArray;var aTypedArrayConstructor=ArrayBufferViewCore.aTypedArrayConstructor;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('map',function map(mapfn){return $map(aTypedArray(this),mapfn,arguments.length>1?arguments[1]:undefined,function(O,length){return new(aTypedArrayConstructor(speciesConstructor(O,O.constructor)))(length);});});}),4483:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $reduceRight=__webpack_require__(3671).right;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('reduceRight',function reduceRight(callbackfn){return $reduceRight(aTypedArray(this),callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);});}),9368:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $reduce=__webpack_require__(3671).left;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('reduce',function reduce(callbackfn){return $reduce(aTypedArray(this),callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);});}),2056:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var floor=Math.floor;exportTypedArrayMethod('reverse',function reverse(){var that=this;var length=aTypedArray(that).length;var middle=floor(length / 2);var index=0;var value;while(index<middle){value=that[index];that[index++]=that[--length];that[length]=value;}return that;});}),3462:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var toLength=__webpack_require__(7466);var toOffset=__webpack_require__(4590);var toObject=__webpack_require__(7908);var fails=__webpack_require__(7293);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var FORCED=fails(function(){new Int8Array(1).set({});});exportTypedArrayMethod('set',function set(arrayLike){aTypedArray(this);var offset=toOffset(arguments.length>1?arguments[1]:undefined,1);var length=this.length;var src=toObject(arrayLike);var len=toLength(src.length);var index=0;if(len+offset>length)throw RangeError('Wrong length');while(index<len)this[offset+index]=src[index++];},FORCED);}),678:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var speciesConstructor=__webpack_require__(6707);var fails=__webpack_require__(7293);var aTypedArray=ArrayBufferViewCore.aTypedArray;var aTypedArrayConstructor=ArrayBufferViewCore.aTypedArrayConstructor;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var $slice=[].slice;var FORCED=fails(function(){new Int8Array(1).slice();});exportTypedArrayMethod('slice',function slice(start,end){var list=$slice.call(aTypedArray(this),start,end);var C=speciesConstructor(this,this.constructor);var index=0;var length=list.length;var result=new(aTypedArrayConstructor(C))(length);while(length>index)result[index]=list[index++];return result;},FORCED);}),7462:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var $some=__webpack_require__(2092).some;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('some',function some(callbackfn){return $some(aTypedArray(this),callbackfn,arguments.length>1?arguments[1]:undefined);});}),3824:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var $sort=[].sort;exportTypedArrayMethod('sort',function sort(comparefn){return $sort.call(aTypedArray(this),comparefn);});}),5021:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var ArrayBufferViewCore=__webpack_require__(260);var toLength=__webpack_require__(7466);var toAbsoluteIndex=__webpack_require__(1400);var speciesConstructor=__webpack_require__(6707);var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;exportTypedArrayMethod('subarray',function subarray(begin,end){var O=aTypedArray(this);var length=O.length;var beginIndex=toAbsoluteIndex(begin,length);return new(speciesConstructor(O,O.constructor))(O.buffer,O.byteOffset+beginIndex*O.BYTES_PER_ELEMENT,toLength((end===undefined?length:toAbsoluteIndex(end,length))-beginIndex));});}),2974:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var global=__webpack_require__(7854);var ArrayBufferViewCore=__webpack_require__(260);var fails=__webpack_require__(7293);var Int8Array=global.Int8Array;var aTypedArray=ArrayBufferViewCore.aTypedArray;var exportTypedArrayMethod=ArrayBufferViewCore.exportTypedArrayMethod;var $toLocaleString=[].toLocaleString;var $slice=[].slice;var TO_LOCALE_STRING_BUG=!!Int8Array&&fails(function(){$toLocaleString.call(new Int8Array(1));});var FORCED=fails(function(){return[1,2].toLocaleString()!=new Int8Array([1,2]).toLocaleString();})||!fails(function(){Int8Array.prototype.toLocaleString.call([1,2]);});exportTypedArrayMethod('toLocaleString',function toLocaleString(){return $toLocaleString.apply(TO_LOCALE_STRING_BUG?$slice.call(aTypedArray(this)):aTypedArray(this),arguments);},FORCED);}),5016:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var exportTypedArrayMethod=__webpack_require__(260).exportTypedArrayMethod;var fails=__webpack_require__(7293);var global=__webpack_require__(7854);var Uint8Array=global.Uint8Array;var Uint8ArrayPrototype=Uint8Array&&Uint8Array.prototype||{};var arrayToString=[].toString;var arrayJoin=[].join;if(fails(function(){arrayToString.call({});})){arrayToString=function toString(){return arrayJoin.call(this);};}
var IS_NOT_ARRAY_METHOD=Uint8ArrayPrototype.toString!=arrayToString;exportTypedArrayMethod('toString',arrayToString,IS_NOT_ARRAY_METHOD);}),2472:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var createTypedArrayConstructor=__webpack_require__(9843);createTypedArrayConstructor('Uint8',function(init){return function Uint8Array(data,byteOffset,length){return init(this,data,byteOffset,length);};});}),4747:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var DOMIterables=__webpack_require__(8324);var forEach=__webpack_require__(8533);var createNonEnumerableProperty=__webpack_require__(8880);for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME];var CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype&&CollectionPrototype.forEach!==forEach)try{createNonEnumerableProperty(CollectionPrototype,'forEach',forEach);}catch(error){CollectionPrototype.forEach=forEach;}}}),3948:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var global=__webpack_require__(7854);var DOMIterables=__webpack_require__(8324);var ArrayIteratorMethods=__webpack_require__(6992);var createNonEnumerableProperty=__webpack_require__(8880);var wellKnownSymbol=__webpack_require__(5112);var ITERATOR=wellKnownSymbol('iterator');var TO_STRING_TAG=wellKnownSymbol('toStringTag');var ArrayValues=ArrayIteratorMethods.values;for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME];var CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype){if(CollectionPrototype[ITERATOR]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype,ITERATOR,ArrayValues);}catch(error){CollectionPrototype[ITERATOR]=ArrayValues;}
if(!CollectionPrototype[TO_STRING_TAG]){createNonEnumerableProperty(CollectionPrototype,TO_STRING_TAG,COLLECTION_NAME);}
if(DOMIterables[COLLECTION_NAME])for(var METHOD_NAME in ArrayIteratorMethods){if(CollectionPrototype[METHOD_NAME]!==ArrayIteratorMethods[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype,METHOD_NAME,ArrayIteratorMethods[METHOD_NAME]);}catch(error){CollectionPrototype[METHOD_NAME]=ArrayIteratorMethods[METHOD_NAME];}}}}}),1637:(function(module,__unused_webpack_exports,__webpack_require__){"use strict";__webpack_require__(6992);var $=__webpack_require__(2109);var getBuiltIn=__webpack_require__(5005);var USE_NATIVE_URL=__webpack_require__(590);var redefine=__webpack_require__(1320);var redefineAll=__webpack_require__(2248);var setToStringTag=__webpack_require__(8003);var createIteratorConstructor=__webpack_require__(4994);var InternalStateModule=__webpack_require__(9909);var anInstance=__webpack_require__(5787);var hasOwn=__webpack_require__(6656);var bind=__webpack_require__(9974);var classof=__webpack_require__(648);var anObject=__webpack_require__(9670);var isObject=__webpack_require__(111);var create=__webpack_require__(30);var createPropertyDescriptor=__webpack_require__(9114);var getIterator=__webpack_require__(8554);var getIteratorMethod=__webpack_require__(1246);var wellKnownSymbol=__webpack_require__(5112);var $fetch=getBuiltIn('fetch');var Headers=getBuiltIn('Headers');var ITERATOR=wellKnownSymbol('iterator');var URL_SEARCH_PARAMS='URLSearchParams';var URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+'Iterator';var setInternalState=InternalStateModule.set;var getInternalParamsState=InternalStateModule.getterFor(URL_SEARCH_PARAMS);var getInternalIteratorState=InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);var plus=/\+/g;var sequences=Array(4);var percentSequence=function(bytes){return sequences[bytes-1]||(sequences[bytes-1]=RegExp('((?:%[\\da-f]{2}){'+bytes+'})','gi'));};var percentDecode=function(sequence){try{return decodeURIComponent(sequence);}catch(error){return sequence;}};var deserialize=function(it){var result=it.replace(plus,' ');var bytes=4;try{return decodeURIComponent(result);}catch(error){while(bytes){result=result.replace(percentSequence(bytes--),percentDecode);}
return result;}};var find=/[!'()~]|%20/g;var replace={'!':'%21',"'":'%27','(':'%28',')':'%29','~':'%7E','%20':'+'};var replacer=function(match){return replace[match];};var serialize=function(it){return encodeURIComponent(it).replace(find,replacer);};var parseSearchParams=function(result,query){if(query){var attributes=query.split('&');var index=0;var attribute,entry;while(index<attributes.length){attribute=attributes[index++];if(attribute.length){entry=attribute.split('=');result.push({key:deserialize(entry.shift()),value:deserialize(entry.join('='))});}}}};var updateSearchParams=function(query){this.entries.length=0;parseSearchParams(this.entries,query);};var validateArgumentsLength=function(passed,required){if(passed<required)throw TypeError('Not enough arguments');};var URLSearchParamsIterator=createIteratorConstructor(function Iterator(params,kind){setInternalState(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(params).entries),kind:kind});},'Iterator',function next(){var state=getInternalIteratorState(this);var kind=state.kind;var step=state.iterator.next();var entry=step.value;if(!step.done){step.value=kind==='keys'?entry.key:kind==='values'?entry.value:[entry.key,entry.value];}return step;});var URLSearchParamsConstructor=function URLSearchParams(){anInstance(this,URLSearchParamsConstructor,URL_SEARCH_PARAMS);var init=arguments.length>0?arguments[0]:undefined;var that=this;var entries=[];var iteratorMethod,iterator,next,step,entryIterator,entryNext,first,second,key;setInternalState(that,{type:URL_SEARCH_PARAMS,entries:entries,updateURL:function(){},updateSearchParams:updateSearchParams});if(init!==undefined){if(isObject(init)){iteratorMethod=getIteratorMethod(init);if(typeof iteratorMethod==='function'){iterator=iteratorMethod.call(init);next=iterator.next;while(!(step=next.call(iterator)).done){entryIterator=getIterator(anObject(step.value));entryNext=entryIterator.next;if((first=entryNext.call(entryIterator)).done||(second=entryNext.call(entryIterator)).done||!entryNext.call(entryIterator).done)throw TypeError('Expected sequence with length 2');entries.push({key:first.value+'',value:second.value+''});}}else for(key in init)if(hasOwn(init,key))entries.push({key:key,value:init[key]+''});}else{parseSearchParams(entries,typeof init==='string'?init.charAt(0)==='?'?init.slice(1):init:init+'');}}};var URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;redefineAll(URLSearchParamsPrototype,{append:function append(name,value){validateArgumentsLength(arguments.length,2);var state=getInternalParamsState(this);state.entries.push({key:name+'',value:value+''});state.updateURL();},'delete':function(name){validateArgumentsLength(arguments.length,1);var state=getInternalParamsState(this);var entries=state.entries;var key=name+'';var index=0;while(index<entries.length){if(entries[index].key===key)entries.splice(index,1);else index++;}
state.updateURL();},get:function get(name){validateArgumentsLength(arguments.length,1);var entries=getInternalParamsState(this).entries;var key=name+'';var index=0;for(;index<entries.length;index++){if(entries[index].key===key)return entries[index].value;}
return null;},getAll:function getAll(name){validateArgumentsLength(arguments.length,1);var entries=getInternalParamsState(this).entries;var key=name+'';var result=[];var index=0;for(;index<entries.length;index++){if(entries[index].key===key)result.push(entries[index].value);}
return result;},has:function has(name){validateArgumentsLength(arguments.length,1);var entries=getInternalParamsState(this).entries;var key=name+'';var index=0;while(index<entries.length){if(entries[index++].key===key)return true;}
return false;},set:function set(name,value){validateArgumentsLength(arguments.length,1);var state=getInternalParamsState(this);var entries=state.entries;var found=false;var key=name+'';var val=value+'';var index=0;var entry;for(;index<entries.length;index++){entry=entries[index];if(entry.key===key){if(found)entries.splice(index--,1);else{found=true;entry.value=val;}}}
if(!found)entries.push({key:key,value:val});state.updateURL();},sort:function sort(){var state=getInternalParamsState(this);var entries=state.entries;var slice=entries.slice();var entry,entriesIndex,sliceIndex;entries.length=0;for(sliceIndex=0;sliceIndex<slice.length;sliceIndex++){entry=slice[sliceIndex];for(entriesIndex=0;entriesIndex<sliceIndex;entriesIndex++){if(entries[entriesIndex].key>entry.key){entries.splice(entriesIndex,0,entry);break;}}
if(entriesIndex===sliceIndex)entries.push(entry);}
state.updateURL();},forEach:function forEach(callback){var entries=getInternalParamsState(this).entries;var boundFunction=bind(callback,arguments.length>1?arguments[1]:undefined,3);var index=0;var entry;while(index<entries.length){entry=entries[index++];boundFunction(entry.value,entry.key,this);}},keys:function keys(){return new URLSearchParamsIterator(this,'keys');},values:function values(){return new URLSearchParamsIterator(this,'values');},entries:function entries(){return new URLSearchParamsIterator(this,'entries');}},{enumerable:true});redefine(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries);redefine(URLSearchParamsPrototype,'toString',function toString(){var entries=getInternalParamsState(this).entries;var result=[];var index=0;var entry;while(index<entries.length){entry=entries[index++];result.push(serialize(entry.key)+'='+serialize(entry.value));}return result.join('&');},{enumerable:true});setToStringTag(URLSearchParamsConstructor,URL_SEARCH_PARAMS);$({global:true,forced:!USE_NATIVE_URL},{URLSearchParams:URLSearchParamsConstructor});if(!USE_NATIVE_URL&&typeof $fetch=='function'&&typeof Headers=='function'){$({global:true,enumerable:true,forced:true},{fetch:function fetch(input){var args=[input];var init,body,headers;if(arguments.length>1){init=arguments[1];if(isObject(init)){body=init.body;if(classof(body)===URL_SEARCH_PARAMS){headers=init.headers?new Headers(init.headers):new Headers();if(!headers.has('content-type')){headers.set('content-type','application/x-www-form-urlencoded;charset=UTF-8');}
init=create(init,{body:createPropertyDescriptor(0,String(body)),headers:createPropertyDescriptor(0,headers)});}}
args.push(init);}return $fetch.apply(this,args);}});}
module.exports={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState};}),285:(function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";__webpack_require__(8783);var $=__webpack_require__(2109);var DESCRIPTORS=__webpack_require__(9781);var USE_NATIVE_URL=__webpack_require__(590);var global=__webpack_require__(7854);var defineProperties=__webpack_require__(6048);var redefine=__webpack_require__(1320);var anInstance=__webpack_require__(5787);var has=__webpack_require__(6656);var assign=__webpack_require__(1574);var arrayFrom=__webpack_require__(8457);var codeAt=__webpack_require__(8710).codeAt;var toASCII=__webpack_require__(3197);var setToStringTag=__webpack_require__(8003);var URLSearchParamsModule=__webpack_require__(1637);var InternalStateModule=__webpack_require__(9909);var NativeURL=global.URL;var URLSearchParams=URLSearchParamsModule.URLSearchParams;var getInternalSearchParamsState=URLSearchParamsModule.getState;var setInternalState=InternalStateModule.set;var getInternalURLState=InternalStateModule.getterFor('URL');var floor=Math.floor;var pow=Math.pow;var INVALID_AUTHORITY='Invalid authority';var INVALID_SCHEME='Invalid scheme';var INVALID_HOST='Invalid host';var INVALID_PORT='Invalid port';var ALPHA=/[A-Za-z]/;var ALPHANUMERIC=/[\d+-.A-Za-z]/;var DIGIT=/\d/;var HEX_START=/^(0x|0X)/;var OCT=/^[0-7]+$/;var DEC=/^\d+$/;var HEX=/^[\dA-Fa-f]+$/;var FORBIDDEN_HOST_CODE_POINT=/[\u0000\t\u000A\u000D #%/:?@[\\]]/;var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\u0000\t\u000A\u000D #/:?@[\\]]/;var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;var TAB_AND_NEW_LINE=/[\t\u000A\u000D]/g;var EOF;var parseHost=function(url,input){var result,codePoints,index;if(input.charAt(0)=='['){if(input.charAt(input.length-1)!=']')return INVALID_HOST;result=parseIPv6(input.slice(1,-1));if(!result)return INVALID_HOST;url.host=result;}else if(!isSpecial(url)){if(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input))return INVALID_HOST;result='';codePoints=arrayFrom(input);for(index=0;index<codePoints.length;index++){result+=percentEncode(codePoints[index],C0ControlPercentEncodeSet);}
url.host=result;}else{input=toASCII(input);if(FORBIDDEN_HOST_CODE_POINT.test(input))return INVALID_HOST;result=parseIPv4(input);if(result===null)return INVALID_HOST;url.host=result;}};var parseIPv4=function(input){var parts=input.split('.');var partsLength,numbers,index,part,radix,number,ipv4;if(parts.length&&parts[parts.length-1]==''){parts.pop();}
partsLength=parts.length;if(partsLength>4)return input;numbers=[];for(index=0;index<partsLength;index++){part=parts[index];if(part=='')return input;radix=10;if(part.length>1&&part.charAt(0)=='0'){radix=HEX_START.test(part)?16:8;part=part.slice(radix==8?1:2);}
if(part===''){number=0;}else{if(!(radix==10?DEC:radix==8?OCT:HEX).test(part))return input;number=parseInt(part,radix);}
numbers.push(number);}
for(index=0;index<partsLength;index++){number=numbers[index];if(index==partsLength-1){if(number>=pow(256,5-partsLength))return null;}else if(number>255)return null;}
ipv4=numbers.pop();for(index=0;index<numbers.length;index++){ipv4+=numbers[index]*pow(256,3-index);}
return ipv4;};var parseIPv6=function(input){var address=[0,0,0,0,0,0,0,0];var pieceIndex=0;var compress=null;var pointer=0;var value,length,numbersSeen,ipv4Piece,number,swaps,swap;var char=function(){return input.charAt(pointer);};if(char()==':'){if(input.charAt(1)!=':')return;pointer+=2;pieceIndex++;compress=pieceIndex;}
while(char()){if(pieceIndex==8)return;if(char()==':'){if(compress!==null)return;pointer++;pieceIndex++;compress=pieceIndex;continue;}
value=length=0;while(length<4&&HEX.test(char())){value=value*16+parseInt(char(),16);pointer++;length++;}
if(char()=='.'){if(length==0)return;pointer-=length;if(pieceIndex>6)return;numbersSeen=0;while(char()){ipv4Piece=null;if(numbersSeen>0){if(char()=='.'&&numbersSeen<4)pointer++;else return;}
if(!DIGIT.test(char()))return;while(DIGIT.test(char())){number=parseInt(char(),10);if(ipv4Piece===null)ipv4Piece=number;else if(ipv4Piece==0)return;else ipv4Piece=ipv4Piece*10+number;if(ipv4Piece>255)return;pointer++;}
address[pieceIndex]=address[pieceIndex]*256+ipv4Piece;numbersSeen++;if(numbersSeen==2||numbersSeen==4)pieceIndex++;}
if(numbersSeen!=4)return;break;}else if(char()==':'){pointer++;if(!char())return;}else if(char())return;address[pieceIndex++]=value;}
if(compress!==null){swaps=pieceIndex-compress;pieceIndex=7;while(pieceIndex!=0&&swaps>0){swap=address[pieceIndex];address[pieceIndex--]=address[compress+swaps-1];address[compress+ --swaps]=swap;}}else if(pieceIndex!=8)return;return address;};var findLongestZeroSequence=function(ipv6){var maxIndex=null;var maxLength=1;var currStart=null;var currLength=0;var index=0;for(;index<8;index++){if(ipv6[index]!==0){if(currLength>maxLength){maxIndex=currStart;maxLength=currLength;}
currStart=null;currLength=0;}else{if(currStart===null)currStart=index;++currLength;}}
if(currLength>maxLength){maxIndex=currStart;maxLength=currLength;}
return maxIndex;};var serializeHost=function(host){var result,index,compress,ignore0;if(typeof host=='number'){result=[];for(index=0;index<4;index++){result.unshift(host%256);host=floor(host / 256);}return result.join('.');}else if(typeof host=='object'){result='';compress=findLongestZeroSequence(host);for(index=0;index<8;index++){if(ignore0&&host[index]===0)continue;if(ignore0)ignore0=false;if(compress===index){result+=index?':':'::';ignore0=true;}else{result+=host[index].toString(16);if(index<7)result+=':';}}
return'['+result+']';}return host;};var C0ControlPercentEncodeSet={};var fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{' ':1,'"':1,'<':1,'>':1,'`':1});var pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{'#':1,'?':1,'{':1,'}':1});var userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{'/':1,':':1,';':1,'=':1,'@':1,'[':1,'\\':1,']':1,'^':1,'|':1});var percentEncode=function(char,set){var code=codeAt(char,0);return code>0x20&&code<0x7F&&!has(set,char)?char:encodeURIComponent(char);};var specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443};var isSpecial=function(url){return has(specialSchemes,url.scheme);};var includesCredentials=function(url){return url.username!=''||url.password!='';};var cannotHaveUsernamePasswordPort=function(url){return!url.host||url.cannotBeABaseURL||url.scheme=='file';};var isWindowsDriveLetter=function(string,normalized){var second;return string.length==2&&ALPHA.test(string.charAt(0))&&((second=string.charAt(1))==':'||(!normalized&&second=='|'));};var startsWithWindowsDriveLetter=function(string){var third;return string.length>1&&isWindowsDriveLetter(string.slice(0,2))&&(string.length==2||((third=string.charAt(2))==='/'||third==='\\'||third==='?'||third==='#'));};var shortenURLsPath=function(url){var path=url.path;var pathSize=path.length;if(pathSize&&(url.scheme!='file'||pathSize!=1||!isWindowsDriveLetter(path[0],true))){path.pop();}};var isSingleDot=function(segment){return segment==='.'||segment.toLowerCase()==='%2e';};var isDoubleDot=function(segment){segment=segment.toLowerCase();return segment==='..'||segment==='%2e.'||segment==='.%2e'||segment==='%2e%2e';};var SCHEME_START={};var SCHEME={};var NO_SCHEME={};var SPECIAL_RELATIVE_OR_AUTHORITY={};var PATH_OR_AUTHORITY={};var RELATIVE={};var RELATIVE_SLASH={};var SPECIAL_AUTHORITY_SLASHES={};var SPECIAL_AUTHORITY_IGNORE_SLASHES={};var AUTHORITY={};var HOST={};var HOSTNAME={};var PORT={};var FILE={};var FILE_SLASH={};var FILE_HOST={};var PATH_START={};var PATH={};var CANNOT_BE_A_BASE_URL_PATH={};var QUERY={};var FRAGMENT={};var parseURL=function(url,input,stateOverride,base){var state=stateOverride||SCHEME_START;var pointer=0;var buffer='';var seenAt=false;var seenBracket=false;var seenPasswordToken=false;var codePoints,char,bufferCodePoints,failure;if(!stateOverride){url.scheme='';url.username='';url.password='';url.host=null;url.port=null;url.path=[];url.query=null;url.fragment=null;url.cannotBeABaseURL=false;input=input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,'');}
input=input.replace(TAB_AND_NEW_LINE,'');codePoints=arrayFrom(input);while(pointer<=codePoints.length){char=codePoints[pointer];switch(state){case SCHEME_START:if(char&&ALPHA.test(char)){buffer+=char.toLowerCase();state=SCHEME;}else if(!stateOverride){state=NO_SCHEME;continue;}else return INVALID_SCHEME;break;case SCHEME:if(char&&(ALPHANUMERIC.test(char)||char=='+'||char=='-'||char=='.')){buffer+=char.toLowerCase();}else if(char==':'){if(stateOverride&&((isSpecial(url)!=has(specialSchemes,buffer))||(buffer=='file'&&(includesCredentials(url)||url.port!==null))||(url.scheme=='file'&&!url.host)))return;url.scheme=buffer;if(stateOverride){if(isSpecial(url)&&specialSchemes[url.scheme]==url.port)url.port=null;return;}
buffer='';if(url.scheme=='file'){state=FILE;}else if(isSpecial(url)&&base&&base.scheme==url.scheme){state=SPECIAL_RELATIVE_OR_AUTHORITY;}else if(isSpecial(url)){state=SPECIAL_AUTHORITY_SLASHES;}else if(codePoints[pointer+1]=='/'){state=PATH_OR_AUTHORITY;pointer++;}else{url.cannotBeABaseURL=true;url.path.push('');state=CANNOT_BE_A_BASE_URL_PATH;}}else if(!stateOverride){buffer='';state=NO_SCHEME;pointer=0;continue;}else return INVALID_SCHEME;break;case NO_SCHEME:if(!base||(base.cannotBeABaseURL&&char!='#'))return INVALID_SCHEME;if(base.cannotBeABaseURL&&char=='#'){url.scheme=base.scheme;url.path=base.path.slice();url.query=base.query;url.fragment='';url.cannotBeABaseURL=true;state=FRAGMENT;break;}
state=base.scheme=='file'?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if(char=='/'&&codePoints[pointer+1]=='/'){state=SPECIAL_AUTHORITY_IGNORE_SLASHES;pointer++;}else{state=RELATIVE;continue;}break;case PATH_OR_AUTHORITY:if(char=='/'){state=AUTHORITY;break;}else{state=PATH;continue;}
case RELATIVE:url.scheme=base.scheme;if(char==EOF){url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;url.path=base.path.slice();url.query=base.query;}else if(char=='/'||(char=='\\'&&isSpecial(url))){state=RELATIVE_SLASH;}else if(char=='?'){url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;url.path=base.path.slice();url.query='';state=QUERY;}else if(char=='#'){url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;url.path=base.path.slice();url.query=base.query;url.fragment='';state=FRAGMENT;}else{url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;url.path=base.path.slice();url.path.pop();state=PATH;continue;}break;case RELATIVE_SLASH:if(isSpecial(url)&&(char=='/'||char=='\\')){state=SPECIAL_AUTHORITY_IGNORE_SLASHES;}else if(char=='/'){state=AUTHORITY;}else{url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;state=PATH;continue;}break;case SPECIAL_AUTHORITY_SLASHES:state=SPECIAL_AUTHORITY_IGNORE_SLASHES;if(char!='/'||buffer.charAt(pointer+1)!='/')continue;pointer++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if(char!='/'&&char!='\\'){state=AUTHORITY;continue;}break;case AUTHORITY:if(char=='@'){if(seenAt)buffer='%40'+buffer;seenAt=true;bufferCodePoints=arrayFrom(buffer);for(var i=0;i<bufferCodePoints.length;i++){var codePoint=bufferCodePoints[i];if(codePoint==':'&&!seenPasswordToken){seenPasswordToken=true;continue;}
var encodedCodePoints=percentEncode(codePoint,userinfoPercentEncodeSet);if(seenPasswordToken)url.password+=encodedCodePoints;else url.username+=encodedCodePoints;}
buffer='';}else if(char==EOF||char=='/'||char=='?'||char=='#'||(char=='\\'&&isSpecial(url))){if(seenAt&&buffer=='')return INVALID_AUTHORITY;pointer-=arrayFrom(buffer).length+1;buffer='';state=HOST;}else buffer+=char;break;case HOST:case HOSTNAME:if(stateOverride&&url.scheme=='file'){state=FILE_HOST;continue;}else if(char==':'&&!seenBracket){if(buffer=='')return INVALID_HOST;failure=parseHost(url,buffer);if(failure)return failure;buffer='';state=PORT;if(stateOverride==HOSTNAME)return;}else if(char==EOF||char=='/'||char=='?'||char=='#'||(char=='\\'&&isSpecial(url))){if(isSpecial(url)&&buffer=='')return INVALID_HOST;if(stateOverride&&buffer==''&&(includesCredentials(url)||url.port!==null))return;failure=parseHost(url,buffer);if(failure)return failure;buffer='';state=PATH_START;if(stateOverride)return;continue;}else{if(char=='[')seenBracket=true;else if(char==']')seenBracket=false;buffer+=char;}break;case PORT:if(DIGIT.test(char)){buffer+=char;}else if(char==EOF||char=='/'||char=='?'||char=='#'||(char=='\\'&&isSpecial(url))||stateOverride){if(buffer!=''){var port=parseInt(buffer,10);if(port>0xFFFF)return INVALID_PORT;url.port=(isSpecial(url)&&port===specialSchemes[url.scheme])?null:port;buffer='';}
if(stateOverride)return;state=PATH_START;continue;}else return INVALID_PORT;break;case FILE:url.scheme='file';if(char=='/'||char=='\\')state=FILE_SLASH;else if(base&&base.scheme=='file'){if(char==EOF){url.host=base.host;url.path=base.path.slice();url.query=base.query;}else if(char=='?'){url.host=base.host;url.path=base.path.slice();url.query='';state=QUERY;}else if(char=='#'){url.host=base.host;url.path=base.path.slice();url.query=base.query;url.fragment='';state=FRAGMENT;}else{if(!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))){url.host=base.host;url.path=base.path.slice();shortenURLsPath(url);}
state=PATH;continue;}}else{state=PATH;continue;}break;case FILE_SLASH:if(char=='/'||char=='\\'){state=FILE_HOST;break;}
if(base&&base.scheme=='file'&&!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))){if(isWindowsDriveLetter(base.path[0],true))url.path.push(base.path[0]);else url.host=base.host;}
state=PATH;continue;case FILE_HOST:if(char==EOF||char=='/'||char=='\\'||char=='?'||char=='#'){if(!stateOverride&&isWindowsDriveLetter(buffer)){state=PATH;}else if(buffer==''){url.host='';if(stateOverride)return;state=PATH_START;}else{failure=parseHost(url,buffer);if(failure)return failure;if(url.host=='localhost')url.host='';if(stateOverride)return;buffer='';state=PATH_START;}continue;}else buffer+=char;break;case PATH_START:if(isSpecial(url)){state=PATH;if(char!='/'&&char!='\\')continue;}else if(!stateOverride&&char=='?'){url.query='';state=QUERY;}else if(!stateOverride&&char=='#'){url.fragment='';state=FRAGMENT;}else if(char!=EOF){state=PATH;if(char!='/')continue;}break;case PATH:if(char==EOF||char=='/'||(char=='\\'&&isSpecial(url))||(!stateOverride&&(char=='?'||char=='#'))){if(isDoubleDot(buffer)){shortenURLsPath(url);if(char!='/'&&!(char=='\\'&&isSpecial(url))){url.path.push('');}}else if(isSingleDot(buffer)){if(char!='/'&&!(char=='\\'&&isSpecial(url))){url.path.push('');}}else{if(url.scheme=='file'&&!url.path.length&&isWindowsDriveLetter(buffer)){if(url.host)url.host='';buffer=buffer.charAt(0)+':';}
url.path.push(buffer);}
buffer='';if(url.scheme=='file'&&(char==EOF||char=='?'||char=='#')){while(url.path.length>1&&url.path[0]===''){url.path.shift();}}
if(char=='?'){url.query='';state=QUERY;}else if(char=='#'){url.fragment='';state=FRAGMENT;}}else{buffer+=percentEncode(char,pathPercentEncodeSet);}break;case CANNOT_BE_A_BASE_URL_PATH:if(char=='?'){url.query='';state=QUERY;}else if(char=='#'){url.fragment='';state=FRAGMENT;}else if(char!=EOF){url.path[0]+=percentEncode(char,C0ControlPercentEncodeSet);}break;case QUERY:if(!stateOverride&&char=='#'){url.fragment='';state=FRAGMENT;}else if(char!=EOF){if(char=="'"&&isSpecial(url))url.query+='%27';else if(char=='#')url.query+='%23';else url.query+=percentEncode(char,C0ControlPercentEncodeSet);}break;case FRAGMENT:if(char!=EOF)url.fragment+=percentEncode(char,fragmentPercentEncodeSet);break;}
pointer++;}};var URLConstructor=function URL(url){var that=anInstance(this,URLConstructor,'URL');var base=arguments.length>1?arguments[1]:undefined;var urlString=String(url);var state=setInternalState(that,{type:'URL'});var baseState,failure;if(base!==undefined){if(base instanceof URLConstructor)baseState=getInternalURLState(base);else{failure=parseURL(baseState={},String(base));if(failure)throw TypeError(failure);}}
failure=parseURL(state,urlString,null,baseState);if(failure)throw TypeError(failure);var searchParams=state.searchParams=new URLSearchParams();var searchParamsState=getInternalSearchParamsState(searchParams);searchParamsState.updateSearchParams(state.query);searchParamsState.updateURL=function(){state.query=String(searchParams)||null;};if(!DESCRIPTORS){that.href=serializeURL.call(that);that.origin=getOrigin.call(that);that.protocol=getProtocol.call(that);that.username=getUsername.call(that);that.password=getPassword.call(that);that.host=getHost.call(that);that.hostname=getHostname.call(that);that.port=getPort.call(that);that.pathname=getPathname.call(that);that.search=getSearch.call(that);that.searchParams=getSearchParams.call(that);that.hash=getHash.call(that);}};var URLPrototype=URLConstructor.prototype;var serializeURL=function(){var url=getInternalURLState(this);var scheme=url.scheme;var username=url.username;var password=url.password;var host=url.host;var port=url.port;var path=url.path;var query=url.query;var fragment=url.fragment;var output=scheme+':';if(host!==null){output+='//';if(includesCredentials(url)){output+=username+(password?':'+password:'')+'@';}
output+=serializeHost(host);if(port!==null)output+=':'+port;}else if(scheme=='file')output+='//';output+=url.cannotBeABaseURL?path[0]:path.length?'/'+path.join('/'):'';if(query!==null)output+='?'+query;if(fragment!==null)output+='#'+fragment;return output;};var getOrigin=function(){var url=getInternalURLState(this);var scheme=url.scheme;var port=url.port;if(scheme=='blob')try{return new URL(scheme.path[0]).origin;}catch(error){return'null';}
if(scheme=='file'||!isSpecial(url))return'null';return scheme+'://'+serializeHost(url.host)+(port!==null?':'+port:'');};var getProtocol=function(){return getInternalURLState(this).scheme+':';};var getUsername=function(){return getInternalURLState(this).username;};var getPassword=function(){return getInternalURLState(this).password;};var getHost=function(){var url=getInternalURLState(this);var host=url.host;var port=url.port;return host===null?'':port===null?serializeHost(host):serializeHost(host)+':'+port;};var getHostname=function(){var host=getInternalURLState(this).host;return host===null?'':serializeHost(host);};var getPort=function(){var port=getInternalURLState(this).port;return port===null?'':String(port);};var getPathname=function(){var url=getInternalURLState(this);var path=url.path;return url.cannotBeABaseURL?path[0]:path.length?'/'+path.join('/'):'';};var getSearch=function(){var query=getInternalURLState(this).query;return query?'?'+query:'';};var getSearchParams=function(){return getInternalURLState(this).searchParams;};var getHash=function(){var fragment=getInternalURLState(this).fragment;return fragment?'#'+fragment:'';};var accessorDescriptor=function(getter,setter){return{get:getter,set:setter,configurable:true,enumerable:true};};if(DESCRIPTORS){defineProperties(URLPrototype,{href:accessorDescriptor(serializeURL,function(href){var url=getInternalURLState(this);var urlString=String(href);var failure=parseURL(url,urlString);if(failure)throw TypeError(failure);getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);}),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,function(protocol){var url=getInternalURLState(this);parseURL(url,String(protocol)+':',SCHEME_START);}),username:accessorDescriptor(getUsername,function(username){var url=getInternalURLState(this);var codePoints=arrayFrom(String(username));if(cannotHaveUsernamePasswordPort(url))return;url.username='';for(var i=0;i<codePoints.length;i++){url.username+=percentEncode(codePoints[i],userinfoPercentEncodeSet);}}),password:accessorDescriptor(getPassword,function(password){var url=getInternalURLState(this);var codePoints=arrayFrom(String(password));if(cannotHaveUsernamePasswordPort(url))return;url.password='';for(var i=0;i<codePoints.length;i++){url.password+=percentEncode(codePoints[i],userinfoPercentEncodeSet);}}),host:accessorDescriptor(getHost,function(host){var url=getInternalURLState(this);if(url.cannotBeABaseURL)return;parseURL(url,String(host),HOST);}),hostname:accessorDescriptor(getHostname,function(hostname){var url=getInternalURLState(this);if(url.cannotBeABaseURL)return;parseURL(url,String(hostname),HOSTNAME);}),port:accessorDescriptor(getPort,function(port){var url=getInternalURLState(this);if(cannotHaveUsernamePasswordPort(url))return;port=String(port);if(port=='')url.port=null;else parseURL(url,port,PORT);}),pathname:accessorDescriptor(getPathname,function(pathname){var url=getInternalURLState(this);if(url.cannotBeABaseURL)return;url.path=[];parseURL(url,pathname+'',PATH_START);}),search:accessorDescriptor(getSearch,function(search){var url=getInternalURLState(this);search=String(search);if(search==''){url.query=null;}else{if('?'==search.charAt(0))search=search.slice(1);url.query='';parseURL(url,search,QUERY);}
getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);}),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,function(hash){var url=getInternalURLState(this);hash=String(hash);if(hash==''){url.fragment=null;return;}
if('#'==hash.charAt(0))hash=hash.slice(1);url.fragment='';parseURL(url,hash,FRAGMENT);})});}
redefine(URLPrototype,'toJSON',function toJSON(){return serializeURL.call(this);},{enumerable:true});redefine(URLPrototype,'toString',function toString(){return serializeURL.call(this);},{enumerable:true});if(NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL;var nativeRevokeObjectURL=NativeURL.revokeObjectURL;if(nativeCreateObjectURL)redefine(URLConstructor,'createObjectURL',function createObjectURL(blob){return nativeCreateObjectURL.apply(NativeURL,arguments);});if(nativeRevokeObjectURL)redefine(URLConstructor,'revokeObjectURL',function revokeObjectURL(url){return nativeRevokeObjectURL.apply(NativeURL,arguments);});}
setToStringTag(URLConstructor,'URL');$({global:true,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor});})});var __webpack_module_cache__={};function __webpack_require__(moduleId){if(__webpack_module_cache__[moduleId]){return __webpack_module_cache__[moduleId].exports;}
var module=__webpack_module_cache__[moduleId]={exports:{}};__webpack_modules__[moduleId](module,module.exports,__webpack_require__);return module.exports;}!function(){__webpack_require__.d=function(exports,definition){for(var key in definition){if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)){Object.defineProperty(exports,key,{enumerable:true,get:definition[key]});}}};}();!function(){__webpack_require__.g=(function(){if(typeof globalThis==='object')return globalThis;try{return this||new Function('return this')();}catch(e){if(typeof window==='object')return window;}})();}();!function(){__webpack_require__.o=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}}();!function(){__webpack_require__.r=function(exports){if(typeof Symbol!=='undefined'&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});}
Object.defineProperty(exports,'__esModule',{value:true});};}();var __webpack_exports__={};!function(){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{"Dropzone":function(){return Dropzone;},"default":function(){return dropzone_dist;}});var es_array_concat=__webpack_require__(2222);var es_array_filter=__webpack_require__(7327);var es_array_index_of=__webpack_require__(2772);var es_array_iterator=__webpack_require__(6992);var es_array_map=__webpack_require__(1249);var es_array_slice=__webpack_require__(7042);var es_array_splice=__webpack_require__(561);var es_array_buffer_constructor=__webpack_require__(8264);var es_function_name=__webpack_require__(8309);var es_object_get_prototype_of=__webpack_require__(489);var es_object_to_string=__webpack_require__(1539);var es_regexp_exec=__webpack_require__(4916);var es_regexp_to_string=__webpack_require__(9714);var es_string_iterator=__webpack_require__(8783);var es_string_match=__webpack_require__(4723);var es_string_replace=__webpack_require__(5306);var es_string_split=__webpack_require__(3123);var es_string_trim=__webpack_require__(3210);var es_typed_array_uint8_array=__webpack_require__(2472);var es_typed_array_copy_within=__webpack_require__(2990);var es_typed_array_every=__webpack_require__(8927);var es_typed_array_fill=__webpack_require__(3105);var es_typed_array_filter=__webpack_require__(5035);var es_typed_array_find=__webpack_require__(4345);var es_typed_array_find_index=__webpack_require__(7174);var es_typed_array_for_each=__webpack_require__(2846);var es_typed_array_includes=__webpack_require__(4731);var es_typed_array_index_of=__webpack_require__(7209);var es_typed_array_iterator=__webpack_require__(6319);var es_typed_array_join=__webpack_require__(8867);var es_typed_array_last_index_of=__webpack_require__(7789);var es_typed_array_map=__webpack_require__(3739);var es_typed_array_reduce=__webpack_require__(9368);var es_typed_array_reduce_right=__webpack_require__(4483);var es_typed_array_reverse=__webpack_require__(2056);var es_typed_array_set=__webpack_require__(3462);var es_typed_array_slice=__webpack_require__(678);var es_typed_array_some=__webpack_require__(7462);var es_typed_array_sort=__webpack_require__(3824);var es_typed_array_subarray=__webpack_require__(5021);var es_typed_array_to_locale_string=__webpack_require__(2974);var es_typed_array_to_string=__webpack_require__(5016);var web_dom_collections_for_each=__webpack_require__(4747);var web_dom_collections_iterator=__webpack_require__(3948);var web_url=__webpack_require__(285);;function _createForOfIteratorHelper(o,allowArrayLike){var it;if(typeof Symbol==="undefined"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e){throw _e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=o[Symbol.iterator]();},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e2){didErr=true;err=_e2;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}
function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
function _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);}}
function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
var Emitter=function(){function Emitter(){_classCallCheck(this,Emitter);}
_createClass(Emitter,[{key:"on",value:function on(event,fn){this._callbacks=this._callbacks||{};if(!this._callbacks[event]){this._callbacks[event]=[];}
this._callbacks[event].push(fn);return this;}},{key:"emit",value:function emit(event){this._callbacks=this._callbacks||{};var callbacks=this._callbacks[event];for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}
if(callbacks){var _iterator=_createForOfIteratorHelper(callbacks,true),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var callback=_step.value;callback.apply(this,args);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}
if(this.element){this.element.dispatchEvent(this.makeEvent("dropzone:"+event,{args:args}));}
return this;}},{key:"makeEvent",value:function makeEvent(eventName,detail){var params={bubbles:true,cancelable:true,detail:detail};if(typeof window.CustomEvent==="function"){return new CustomEvent(eventName,params);}else{var evt=document.createEvent("CustomEvent");evt.initCustomEvent(eventName,params.bubbles,params.cancelable,params.detail);return evt;}}},{key:"off",value:function off(event,fn){if(!this._callbacks||arguments.length===0){this._callbacks={};return this;}
var callbacks=this._callbacks[event];if(!callbacks){return this;}
if(arguments.length===1){delete this._callbacks[event];return this;}
for(var i=0;i<callbacks.length;i++){var callback=callbacks[i];if(callback===fn){callbacks.splice(i,1);break;}}
return this;}}]);return Emitter;}();;var code="<div class=\"dz-preview dz-file-preview\"> <div class=\"dz-image\"><img data-dz-thumbnail/></div> <div class=\"dz-details\"> <div class=\"dz-size\"><span data-dz-size></span></div> <div class=\"dz-filename\"><span data-dz-name></span></div> </div> <div class=\"dz-progress\"> <span class=\"dz-upload\" data-dz-uploadprogress></span> </div> <div class=\"dz-error-message\"><span data-dz-errormessage></span></div> <div class=\"dz-success-mark\"> <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>Check</title> <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\"></path> </g> </svg> </div> <div class=\"dz-error-mark\"> <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>Error</title> <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <g stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\"> <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\"></path> </g> </g> </svg> </div> </div> ";var preview_template=(code);;function options_createForOfIteratorHelper(o,allowArrayLike){var it;if(typeof Symbol==="undefined"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=options_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e){throw _e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=o[Symbol.iterator]();},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e2){didErr=true;err=_e2;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}
function options_unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return options_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return options_arrayLikeToArray(o,minLen);}
function options_arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}
var defaultOptions={url:null,method:"post",withCredentials:false,timeout:null,parallelUploads:2,uploadMultiple:false,chunking:false,forceChunking:false,chunkSize:2000000,parallelChunkUploads:false,retryChunks:false,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:true,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:0.8,resizeMethod:"contain",filesizeBase:1000,maxFiles:null,headers:null,clickable:true,ignoreHiddenFiles:true,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:true,autoQueue:true,addRemoveLinks:false,previewsContainer:null,disablePreviews:false,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:false,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function init(){},params:function params(files,xhr,chunk){if(chunk){return{dzuuid:chunk.file.upload.uuid,dzchunkindex:chunk.index,dztotalfilesize:chunk.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:chunk.file.upload.totalChunkCount,dzchunkbyteoffset:chunk.index*this.options.chunkSize};}},accept:function accept(file,done){return done();},chunksUploaded:function chunksUploaded(file,done){done();},fallback:function fallback(){var messageElement;this.element.className="".concat(this.element.className," dz-browser-not-supported");var _iterator=options_createForOfIteratorHelper(this.element.getElementsByTagName("div"),true),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var child=_step.value;if(/(^| )dz-message($| )/.test(child.className)){messageElement=child;child.className="dz-message";break;}}}catch(err){_iterator.e(err);}finally{_iterator.f();}
if(!messageElement){messageElement=Dropzone.createElement('<div class="dz-message"><span></span></div>');this.element.appendChild(messageElement);}
var span=messageElement.getElementsByTagName("span")[0];if(span){if(span.textContent!=null){span.textContent=this.options.dictFallbackMessage;}else if(span.innerText!=null){span.innerText=this.options.dictFallbackMessage;}}
return this.element.appendChild(this.getFallbackForm());},resize:function resize(file,width,height,resizeMethod){var info={srcX:0,srcY:0,srcWidth:file.width,srcHeight:file.height};var srcRatio=file.width / file.height;if(width==null&&height==null){width=info.srcWidth;height=info.srcHeight;}else if(width==null){width=height*srcRatio;}else if(height==null){height=width / srcRatio;}
width=Math.min(width,info.srcWidth);height=Math.min(height,info.srcHeight);var trgRatio=width / height;if(info.srcWidth>width||info.srcHeight>height){if(resizeMethod==="crop"){if(srcRatio>trgRatio){info.srcHeight=file.height;info.srcWidth=info.srcHeight*trgRatio;}else{info.srcWidth=file.width;info.srcHeight=info.srcWidth / trgRatio;}}else if(resizeMethod==="contain"){if(srcRatio>trgRatio){height=width / srcRatio;}else{width=height*srcRatio;}}else{throw new Error("Unknown resizeMethod '".concat(resizeMethod,"'"));}}
info.srcX=(file.width-info.srcWidth)/ 2;info.srcY=(file.height-info.srcHeight)/ 2;info.trgWidth=width;info.trgHeight=height;return info;},transformFile:function transformFile(file,done){if((this.options.resizeWidth||this.options.resizeHeight)&&file.type.match(/image.*/)){return this.resizeImage(file,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,done);}else{return done(file);}},previewTemplate:preview_template,drop:function drop(e){return this.element.classList.remove("dz-drag-hover");},dragstart:function dragstart(e){},dragend:function dragend(e){return this.element.classList.remove("dz-drag-hover");},dragenter:function dragenter(e){return this.element.classList.add("dz-drag-hover");},dragover:function dragover(e){return this.element.classList.add("dz-drag-hover");},dragleave:function dragleave(e){return this.element.classList.remove("dz-drag-hover");},paste:function paste(e){},reset:function reset(){return this.element.classList.remove("dz-started");},addedfile:function addedfile(file){var _this=this;if(this.element===this.previewsContainer){this.element.classList.add("dz-started");}
if(this.previewsContainer&&!this.options.disablePreviews){file.previewElement=Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;this.previewsContainer.appendChild(file.previewElement);var _iterator2=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-name]"),true),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var node=_step2.value;node.textContent=file.name;}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}
var _iterator3=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-size]"),true),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){node=_step3.value;node.innerHTML=this.filesize(file.size);}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}
if(this.options.addRemoveLinks){file._removeLink=Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>".concat(this.options.dictRemoveFile,"</a>"));file.previewElement.appendChild(file._removeLink);}
var removeFileEvent=function removeFileEvent(e){e.preventDefault();e.stopPropagation();if(file.status===Dropzone.UPLOADING){return Dropzone.confirm(_this.options.dictCancelUploadConfirmation,function(){return _this.removeFile(file);});}else{if(_this.options.dictRemoveFileConfirmation){return Dropzone.confirm(_this.options.dictRemoveFileConfirmation,function(){return _this.removeFile(file);});}else{return _this.removeFile(file);}}};var _iterator4=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-remove]"),true),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var removeLink=_step4.value;removeLink.addEventListener("click",removeFileEvent);}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}},removedfile:function removedfile(file){if(file.previewElement!=null&&file.previewElement.parentNode!=null){file.previewElement.parentNode.removeChild(file.previewElement);}
return this._updateMaxFilesReachedClass();},thumbnail:function thumbnail(file,dataUrl){if(file.previewElement){file.previewElement.classList.remove("dz-file-preview");var _iterator5=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-thumbnail]"),true),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var thumbnailElement=_step5.value;thumbnailElement.alt=file.name;thumbnailElement.src=dataUrl;}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}
return setTimeout(function(){return file.previewElement.classList.add("dz-image-preview");},1);}},error:function error(file,message){if(file.previewElement){file.previewElement.classList.add("dz-error");if(typeof message!=="string"&&message.error){message=message.error;}
var _iterator6=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-errormessage]"),true),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var node=_step6.value;node.textContent=message;}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}},errormultiple:function errormultiple(){},processing:function processing(file){if(file.previewElement){file.previewElement.classList.add("dz-processing");if(file._removeLink){return file._removeLink.innerHTML=this.options.dictCancelUpload;}}},processingmultiple:function processingmultiple(){},uploadprogress:function uploadprogress(file,progress,bytesSent){if(file.previewElement){var _iterator7=options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-uploadprogress]"),true),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var node=_step7.value;node.nodeName==="PROGRESS"?node.value=progress:node.style.width="".concat(progress,"%");}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}},totaluploadprogress:function totaluploadprogress(){},sending:function sending(){},sendingmultiple:function sendingmultiple(){},success:function success(file){if(file.previewElement){return file.previewElement.classList.add("dz-success");}},successmultiple:function successmultiple(){},canceled:function canceled(file){return this.emit("error",file,this.options.dictUploadCanceled);},canceledmultiple:function canceledmultiple(){},complete:function complete(file){if(file._removeLink){file._removeLink.innerHTML=this.options.dictRemoveFile;}
if(file.previewElement){return file.previewElement.classList.add("dz-complete");}},completemultiple:function completemultiple(){},maxfilesexceeded:function maxfilesexceeded(){},maxfilesreached:function maxfilesreached(){},queuecomplete:function queuecomplete(){},addedfiles:function addedfiles(){}};var src_options=(defaultOptions);;function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}
function dropzone_createForOfIteratorHelper(o,allowArrayLike){var it;if(typeof Symbol==="undefined"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=dropzone_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e){throw _e;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=o[Symbol.iterator]();},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e2){didErr=true;err=_e2;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}
function dropzone_unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return dropzone_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dropzone_arrayLikeToArray(o,minLen);}
function dropzone_arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}
function dropzone_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
function dropzone_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);}}
function dropzone_createClass(Constructor,protoProps,staticProps){if(protoProps)dropzone_defineProperties(Constructor.prototype,protoProps);if(staticProps)dropzone_defineProperties(Constructor,staticProps);return Constructor;}
function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}
function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}
function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}
function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
var Dropzone=function(_Emitter){_inherits(Dropzone,_Emitter);var _super=_createSuper(Dropzone);function Dropzone(el,options){var _this;dropzone_classCallCheck(this,Dropzone);_this=_super.call(this);var fallback,left;_this.element=el;_this.version=Dropzone.version;_this.clickableElements=[];_this.listeners=[];_this.files=[];if(typeof _this.element==="string"){_this.element=document.querySelector(_this.element);}
if(!_this.element||_this.element.nodeType==null){throw new Error("Invalid dropzone element.");}
if(_this.element.dropzone){throw new Error("Dropzone already attached.");}
Dropzone.instances.push(_assertThisInitialized(_this));_this.element.dropzone=_assertThisInitialized(_this);var elementOptions=(left=Dropzone.optionsForElement(_this.element))!=null?left:{};_this.options=Dropzone.extend({},src_options,elementOptions,options!=null?options:{});_this.options.previewTemplate=_this.options.previewTemplate.replace(/\n*/g,"");if(_this.options.forceFallback||!Dropzone.isBrowserSupported()){return _possibleConstructorReturn(_this,_this.options.fallback.call(_assertThisInitialized(_this)));}
if(_this.options.url==null){_this.options.url=_this.element.getAttribute("action");}
if(!_this.options.url){throw new Error("No URL provided.");}
if(_this.options.acceptedFiles&&_this.options.acceptedMimeTypes){throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");}
if(_this.options.uploadMultiple&&_this.options.chunking){throw new Error("You cannot set both: uploadMultiple and chunking.");}
if(_this.options.acceptedMimeTypes){_this.options.acceptedFiles=_this.options.acceptedMimeTypes;delete _this.options.acceptedMimeTypes;}
if(_this.options.renameFilename!=null){_this.options.renameFile=function(file){return _this.options.renameFilename.call(_assertThisInitialized(_this),file.name,file);};}
if(typeof _this.options.method==="string"){_this.options.method=_this.options.method.toUpperCase();}
if((fallback=_this.getExistingFallback())&&fallback.parentNode){fallback.parentNode.removeChild(fallback);}
if(_this.options.previewsContainer!==false){if(_this.options.previewsContainer){_this.previewsContainer=Dropzone.getElement(_this.options.previewsContainer,"previewsContainer");}else{_this.previewsContainer=_this.element;}}
if(_this.options.clickable){if(_this.options.clickable===true){_this.clickableElements=[_this.element];}else{_this.clickableElements=Dropzone.getElements(_this.options.clickable,"clickable");}}
_this.init();return _this;}
dropzone_createClass(Dropzone,[{key:"getAcceptedFiles",value:function getAcceptedFiles(){return this.files.filter(function(file){return file.accepted;}).map(function(file){return file;});}},{key:"getRejectedFiles",value:function getRejectedFiles(){return this.files.filter(function(file){return!file.accepted;}).map(function(file){return file;});}},{key:"getFilesWithStatus",value:function getFilesWithStatus(status){return this.files.filter(function(file){return file.status===status;}).map(function(file){return file;});}},{key:"getQueuedFiles",value:function getQueuedFiles(){return this.getFilesWithStatus(Dropzone.QUEUED);}},{key:"getUploadingFiles",value:function getUploadingFiles(){return this.getFilesWithStatus(Dropzone.UPLOADING);}},{key:"getAddedFiles",value:function getAddedFiles(){return this.getFilesWithStatus(Dropzone.ADDED);}},{key:"getActiveFiles",value:function getActiveFiles(){return this.files.filter(function(file){return file.status===Dropzone.UPLOADING||file.status===Dropzone.QUEUED;}).map(function(file){return file;});}},{key:"init",value:function init(){var _this2=this;if(this.element.tagName==="form"){this.element.setAttribute("enctype","multipart/form-data");}
if(this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")){this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><button class=\"dz-button\" type=\"button\">".concat(this.options.dictDefaultMessage,"</button></div>")));}
if(this.clickableElements.length){var setupHiddenFileInput=function setupHiddenFileInput(){if(_this2.hiddenFileInput){_this2.hiddenFileInput.parentNode.removeChild(_this2.hiddenFileInput);}
_this2.hiddenFileInput=document.createElement("input");_this2.hiddenFileInput.setAttribute("type","file");if(_this2.options.maxFiles===null||_this2.options.maxFiles>1){_this2.hiddenFileInput.setAttribute("multiple","multiple");}
_this2.hiddenFileInput.className="dz-hidden-input";if(_this2.options.acceptedFiles!==null){_this2.hiddenFileInput.setAttribute("accept",_this2.options.acceptedFiles);}
if(_this2.options.capture!==null){_this2.hiddenFileInput.setAttribute("capture",_this2.options.capture);}
_this2.hiddenFileInput.setAttribute("tabindex","-1");_this2.hiddenFileInput.style.visibility="hidden";_this2.hiddenFileInput.style.position="absolute";_this2.hiddenFileInput.style.top="0";_this2.hiddenFileInput.style.left="0";_this2.hiddenFileInput.style.height="0";_this2.hiddenFileInput.style.width="0";Dropzone.getElement(_this2.options.hiddenInputContainer,"hiddenInputContainer").appendChild(_this2.hiddenFileInput);_this2.hiddenFileInput.addEventListener("change",function(){var files=_this2.hiddenFileInput.files;if(files.length){var _iterator=dropzone_createForOfIteratorHelper(files,true),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var file=_step.value;_this2.addFile(file);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}
_this2.emit("addedfiles",files);setupHiddenFileInput();});};setupHiddenFileInput();}
this.URL=window.URL!==null?window.URL:window.webkitURL;var _iterator2=dropzone_createForOfIteratorHelper(this.events,true),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var eventName=_step2.value;this.on(eventName,this.options[eventName]);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}
this.on("uploadprogress",function(){return _this2.updateTotalUploadProgress();});this.on("removedfile",function(){return _this2.updateTotalUploadProgress();});this.on("canceled",function(file){return _this2.emit("complete",file);});this.on("complete",function(file){if(_this2.getAddedFiles().length===0&&_this2.getUploadingFiles().length===0&&_this2.getQueuedFiles().length===0){return setTimeout(function(){return _this2.emit("queuecomplete");},0);}});var containsFiles=function containsFiles(e){if(e.dataTransfer.types){for(var i=0;i<e.dataTransfer.types.length;i++){if(e.dataTransfer.types[i]==="Files")return true;}}
return false;};var noPropagation=function noPropagation(e){if(!containsFiles(e))return;e.stopPropagation();if(e.preventDefault){return e.preventDefault();}else{return e.returnValue=false;}};this.listeners=[{element:this.element,events:{dragstart:function dragstart(e){return _this2.emit("dragstart",e);},dragenter:function dragenter(e){noPropagation(e);return _this2.emit("dragenter",e);},dragover:function dragover(e){var efct;try{efct=e.dataTransfer.effectAllowed;}catch(error){}
e.dataTransfer.dropEffect="move"===efct||"linkMove"===efct?"move":"copy";noPropagation(e);return _this2.emit("dragover",e);},dragleave:function dragleave(e){return _this2.emit("dragleave",e);},drop:function drop(e){noPropagation(e);return _this2.drop(e);},dragend:function dragend(e){return _this2.emit("dragend",e);}}}];this.clickableElements.forEach(function(clickableElement){return _this2.listeners.push({element:clickableElement,events:{click:function click(evt){if(clickableElement!==_this2.element||evt.target===_this2.element||Dropzone.elementInside(evt.target,_this2.element.querySelector(".dz-message"))){_this2.hiddenFileInput.click();}
return true;}}});});this.enable();return this.options.init.call(this);}},{key:"destroy",value:function destroy(){this.disable();this.removeAllFiles(true);if(this.hiddenFileInput!=null?this.hiddenFileInput.parentNode:undefined){this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);this.hiddenFileInput=null;}
delete this.element.dropzone;return Dropzone.instances.splice(Dropzone.instances.indexOf(this),1);}},{key:"updateTotalUploadProgress",value:function updateTotalUploadProgress(){var totalUploadProgress;var totalBytesSent=0;var totalBytes=0;var activeFiles=this.getActiveFiles();if(activeFiles.length){var _iterator3=dropzone_createForOfIteratorHelper(this.getActiveFiles(),true),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var file=_step3.value;totalBytesSent+=file.upload.bytesSent;totalBytes+=file.upload.total;}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}
totalUploadProgress=100*totalBytesSent / totalBytes;}else{totalUploadProgress=100;}
return this.emit("totaluploadprogress",totalUploadProgress,totalBytes,totalBytesSent);}},{key:"_getParamName",value:function _getParamName(n){if(typeof this.options.paramName==="function"){return this.options.paramName(n);}else{return"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(n,"]"):"");}}},{key:"_renameFile",value:function _renameFile(file){if(typeof this.options.renameFile!=="function"){return file.name;}
return this.options.renameFile(file);}},{key:"getFallbackForm",value:function getFallbackForm(){var existingFallback,form;if(existingFallback=this.getExistingFallback()){return existingFallback;}
var fieldsString='<div class="dz-fallback">';if(this.options.dictFallbackText){fieldsString+="<p>".concat(this.options.dictFallbackText,"</p>");}
fieldsString+="<input type=\"file\" name=\"".concat(this._getParamName(0),"\" ").concat(this.options.uploadMultiple?'multiple="multiple"':undefined," /><input type=\"submit\" value=\"Upload!\"></div>");var fields=Dropzone.createElement(fieldsString);if(this.element.tagName!=="FORM"){form=Dropzone.createElement("<form action=\"".concat(this.options.url,"\" enctype=\"multipart/form-data\" method=\"").concat(this.options.method,"\"></form>"));form.appendChild(fields);}else{this.element.setAttribute("enctype","multipart/form-data");this.element.setAttribute("method",this.options.method);}
return form!=null?form:fields;}},{key:"getExistingFallback",value:function getExistingFallback(){var getFallback=function getFallback(elements){var _iterator4=dropzone_createForOfIteratorHelper(elements,true),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var el=_step4.value;if(/(^| )fallback($| )/.test(el.className)){return el;}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}};for(var _i=0,_arr=["div","form"];_i<_arr.length;_i++){var tagName=_arr[_i];var fallback;if(fallback=getFallback(this.element.getElementsByTagName(tagName))){return fallback;}}}},{key:"setupEventListeners",value:function setupEventListeners(){return this.listeners.map(function(elementListeners){return function(){var result=[];for(var event in elementListeners.events){var listener=elementListeners.events[event];result.push(elementListeners.element.addEventListener(event,listener,false));}
return result;}();});}},{key:"removeEventListeners",value:function removeEventListeners(){return this.listeners.map(function(elementListeners){return function(){var result=[];for(var event in elementListeners.events){var listener=elementListeners.events[event];result.push(elementListeners.element.removeEventListener(event,listener,false));}
return result;}();});}},{key:"disable",value:function disable(){var _this3=this;this.clickableElements.forEach(function(element){return element.classList.remove("dz-clickable");});this.removeEventListeners();this.disabled=true;return this.files.map(function(file){return _this3.cancelUpload(file);});}},{key:"enable",value:function enable(){delete this.disabled;this.clickableElements.forEach(function(element){return element.classList.add("dz-clickable");});return this.setupEventListeners();}},{key:"filesize",value:function filesize(size){var selectedSize=0;var selectedUnit="b";if(size>0){var units=["tb","gb","mb","kb","b"];for(var i=0;i<units.length;i++){var unit=units[i];var cutoff=Math.pow(this.options.filesizeBase,4-i)/ 10;if(size>=cutoff){selectedSize=size / Math.pow(this.options.filesizeBase,4-i);selectedUnit=unit;break;}}
selectedSize=Math.round(10*selectedSize)/ 10;}
return"<strong>".concat(selectedSize,"</strong> ").concat(this.options.dictFileSizeUnits[selectedUnit]);}},{key:"_updateMaxFilesReachedClass",value:function _updateMaxFilesReachedClass(){if(this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles){if(this.getAcceptedFiles().length===this.options.maxFiles){this.emit("maxfilesreached",this.files);}
return this.element.classList.add("dz-max-files-reached");}else{return this.element.classList.remove("dz-max-files-reached");}}},{key:"drop",value:function drop(e){if(!e.dataTransfer){return;}
this.emit("drop",e);var files=[];for(var i=0;i<e.dataTransfer.files.length;i++){files[i]=e.dataTransfer.files[i];}
if(files.length){var items=e.dataTransfer.items;if(items&&items.length&&items[0].webkitGetAsEntry!=null){this._addFilesFromItems(items);}else{this.handleFiles(files);}}
this.emit("addedfiles",files);}},{key:"paste",value:function paste(e){if(__guard__(e!=null?e.clipboardData:undefined,function(x){return x.items;})==null){return;}
this.emit("paste",e);var items=e.clipboardData.items;if(items.length){return this._addFilesFromItems(items);}}},{key:"handleFiles",value:function handleFiles(files){var _iterator5=dropzone_createForOfIteratorHelper(files,true),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var file=_step5.value;this.addFile(file);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}},{key:"_addFilesFromItems",value:function _addFilesFromItems(items){var _this4=this;return function(){var result=[];var _iterator6=dropzone_createForOfIteratorHelper(items,true),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var item=_step6.value;var entry;if(item.webkitGetAsEntry!=null&&(entry=item.webkitGetAsEntry())){if(entry.isFile){result.push(_this4.addFile(item.getAsFile()));}else if(entry.isDirectory){result.push(_this4._addFilesFromDirectory(entry,entry.name));}else{result.push(undefined);}}else if(item.getAsFile!=null){if(item.kind==null||item.kind==="file"){result.push(_this4.addFile(item.getAsFile()));}else{result.push(undefined);}}else{result.push(undefined);}}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}
return result;}();}},{key:"_addFilesFromDirectory",value:function _addFilesFromDirectory(directory,path){var _this5=this;var dirReader=directory.createReader();var errorHandler=function errorHandler(error){return __guardMethod__(console,"log",function(o){return o.log(error);});};var readEntries=function readEntries(){return dirReader.readEntries(function(entries){if(entries.length>0){var _iterator7=dropzone_createForOfIteratorHelper(entries,true),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var entry=_step7.value;if(entry.isFile){entry.file(function(file){if(_this5.options.ignoreHiddenFiles&&file.name.substring(0,1)==="."){return;}
file.fullPath="".concat(path,"/").concat(file.name);return _this5.addFile(file);});}else if(entry.isDirectory){_this5._addFilesFromDirectory(entry,"".concat(path,"/").concat(entry.name));}}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}
readEntries();}
return null;},errorHandler);};return readEntries();}},{key:"accept",value:function accept(file,done){if(this.options.maxFilesize&&file.size>this.options.maxFilesize*1024*1024){done(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(file.size / 1024 / 10.24)/ 100).replace("{{maxFilesize}}",this.options.maxFilesize));}else if(!Dropzone.isValidFile(file,this.options.acceptedFiles)){done(this.options.dictInvalidFileType);}else if(this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles){done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles));this.emit("maxfilesexceeded",file);}else{this.options.accept.call(this,file,done);}}},{key:"addFile",value:function addFile(file){var _this6=this;file.upload={uuid:Dropzone.uuidv4(),progress:0,total:file.size,bytesSent:0,filename:this._renameFile(file)};this.files.push(file);file.status=Dropzone.ADDED;this.emit("addedfile",file);this._enqueueThumbnail(file);this.accept(file,function(error){if(error){file.accepted=false;_this6._errorProcessing([file],error);}else{file.accepted=true;if(_this6.options.autoQueue){_this6.enqueueFile(file);}}
_this6._updateMaxFilesReachedClass();});}},{key:"enqueueFiles",value:function enqueueFiles(files){var _iterator8=dropzone_createForOfIteratorHelper(files,true),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var file=_step8.value;this.enqueueFile(file);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}
return null;}},{key:"enqueueFile",value:function enqueueFile(file){var _this7=this;if(file.status===Dropzone.ADDED&&file.accepted===true){file.status=Dropzone.QUEUED;if(this.options.autoProcessQueue){return setTimeout(function(){return _this7.processQueue();},0);}}else{throw new Error("This file can't be queued because it has already been processed or was rejected.");}}},{key:"_enqueueThumbnail",value:function _enqueueThumbnail(file){var _this8=this;if(this.options.createImageThumbnails&&file.type.match(/image.*/)&&file.size<=this.options.maxThumbnailFilesize*1024*1024){this._thumbnailQueue.push(file);return setTimeout(function(){return _this8._processThumbnailQueue();},0);}}},{key:"_processThumbnailQueue",value:function _processThumbnailQueue(){var _this9=this;if(this._processingThumbnail||this._thumbnailQueue.length===0){return;}
this._processingThumbnail=true;var file=this._thumbnailQueue.shift();return this.createThumbnail(file,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,true,function(dataUrl){_this9.emit("thumbnail",file,dataUrl);_this9._processingThumbnail=false;return _this9._processThumbnailQueue();});}},{key:"removeFile",value:function removeFile(file){if(file.status===Dropzone.UPLOADING){this.cancelUpload(file);}
this.files=without(this.files,file);this.emit("removedfile",file);if(this.files.length===0){return this.emit("reset");}}},{key:"removeAllFiles",value:function removeAllFiles(cancelIfNecessary){if(cancelIfNecessary==null){cancelIfNecessary=false;}
var _iterator9=dropzone_createForOfIteratorHelper(this.files.slice(),true),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var file=_step9.value;if(file.status!==Dropzone.UPLOADING||cancelIfNecessary){this.removeFile(file);}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}
return null;}},{key:"resizeImage",value:function resizeImage(file,width,height,resizeMethod,callback){var _this10=this;return this.createThumbnail(file,width,height,resizeMethod,true,function(dataUrl,canvas){if(canvas==null){return callback(file);}else{var resizeMimeType=_this10.options.resizeMimeType;if(resizeMimeType==null){resizeMimeType=file.type;}
var resizedDataURL=canvas.toDataURL(resizeMimeType,_this10.options.resizeQuality);if(resizeMimeType==="image/jpeg"||resizeMimeType==="image/jpg"){resizedDataURL=ExifRestore.restore(file.dataURL,resizedDataURL);}
return callback(Dropzone.dataURItoBlob(resizedDataURL));}});}},{key:"createThumbnail",value:function createThumbnail(file,width,height,resizeMethod,fixOrientation,callback){var _this11=this;var fileReader=new FileReader();fileReader.onload=function(){file.dataURL=fileReader.result;if(file.type==="image/svg+xml"){if(callback!=null){callback(fileReader.result);}
return;}
_this11.createThumbnailFromUrl(file,width,height,resizeMethod,fixOrientation,callback);};fileReader.readAsDataURL(file);}},{key:"displayExistingFile",value:function displayExistingFile(mockFile,imageUrl,callback,crossOrigin){var _this12=this;var resizeThumbnail=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;this.emit("addedfile",mockFile);this.emit("complete",mockFile);if(!resizeThumbnail){this.emit("thumbnail",mockFile,imageUrl);if(callback)callback();}else{var onDone=function onDone(thumbnail){_this12.emit("thumbnail",mockFile,thumbnail);if(callback)callback();};mockFile.dataURL=imageUrl;this.createThumbnailFromUrl(mockFile,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,onDone,crossOrigin);}}},{key:"createThumbnailFromUrl",value:function createThumbnailFromUrl(file,width,height,resizeMethod,fixOrientation,callback,crossOrigin){var _this13=this;var img=document.createElement("img");if(crossOrigin){img.crossOrigin=crossOrigin;}
fixOrientation=getComputedStyle(document.body)["imageOrientation"]=="from-image"?false:fixOrientation;img.onload=function(){var loadExif=function loadExif(callback){return callback(1);};if(typeof EXIF!=="undefined"&&EXIF!==null&&fixOrientation){loadExif=function loadExif(callback){return EXIF.getData(img,function(){return callback(EXIF.getTag(this,"Orientation"));});};}
return loadExif(function(orientation){file.width=img.width;file.height=img.height;var resizeInfo=_this13.options.resize.call(_this13,file,width,height,resizeMethod);var canvas=document.createElement("canvas");var ctx=canvas.getContext("2d");canvas.width=resizeInfo.trgWidth;canvas.height=resizeInfo.trgHeight;if(orientation>4){canvas.width=resizeInfo.trgHeight;canvas.height=resizeInfo.trgWidth;}
switch(orientation){case 2:ctx.translate(canvas.width,0);ctx.scale(-1,1);break;case 3:ctx.translate(canvas.width,canvas.height);ctx.rotate(Math.PI);break;case 4:ctx.translate(0,canvas.height);ctx.scale(1,-1);break;case 5:ctx.rotate(0.5*Math.PI);ctx.scale(1,-1);break;case 6:ctx.rotate(0.5*Math.PI);ctx.translate(0,-canvas.width);break;case 7:ctx.rotate(0.5*Math.PI);ctx.translate(canvas.height,-canvas.width);ctx.scale(-1,1);break;case 8:ctx.rotate(-0.5*Math.PI);ctx.translate(-canvas.height,0);break;}
drawImageIOSFix(ctx,img,resizeInfo.srcX!=null?resizeInfo.srcX:0,resizeInfo.srcY!=null?resizeInfo.srcY:0,resizeInfo.srcWidth,resizeInfo.srcHeight,resizeInfo.trgX!=null?resizeInfo.trgX:0,resizeInfo.trgY!=null?resizeInfo.trgY:0,resizeInfo.trgWidth,resizeInfo.trgHeight);var thumbnail=canvas.toDataURL("image/png");if(callback!=null){return callback(thumbnail,canvas);}});};if(callback!=null){img.onerror=callback;}
return img.src=file.dataURL;}},{key:"processQueue",value:function processQueue(){var parallelUploads=this.options.parallelUploads;var processingLength=this.getUploadingFiles().length;var i=processingLength;if(processingLength>=parallelUploads){return;}
var queuedFiles=this.getQueuedFiles();if(!(queuedFiles.length>0)){return;}
if(this.options.uploadMultiple){return this.processFiles(queuedFiles.slice(0,parallelUploads-processingLength));}else{while(i<parallelUploads){if(!queuedFiles.length){return;}
this.processFile(queuedFiles.shift());i++;}}}},{key:"processFile",value:function processFile(file){return this.processFiles([file]);}},{key:"processFiles",value:function processFiles(files){var _iterator10=dropzone_createForOfIteratorHelper(files,true),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var file=_step10.value;file.processing=true;file.status=Dropzone.UPLOADING;this.emit("processing",file);}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}
if(this.options.uploadMultiple){this.emit("processingmultiple",files);}
return this.uploadFiles(files);}},{key:"_getFilesWithXhr",value:function _getFilesWithXhr(xhr){var files;return files=this.files.filter(function(file){return file.xhr===xhr;}).map(function(file){return file;});}},{key:"cancelUpload",value:function cancelUpload(file){if(file.status===Dropzone.UPLOADING){var groupedFiles=this._getFilesWithXhr(file.xhr);var _iterator11=dropzone_createForOfIteratorHelper(groupedFiles,true),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var groupedFile=_step11.value;groupedFile.status=Dropzone.CANCELED;}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}
if(typeof file.xhr!=="undefined"){file.xhr.abort();}
var _iterator12=dropzone_createForOfIteratorHelper(groupedFiles,true),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var _groupedFile=_step12.value;this.emit("canceled",_groupedFile);}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}
if(this.options.uploadMultiple){this.emit("canceledmultiple",groupedFiles);}}else if(file.status===Dropzone.ADDED||file.status===Dropzone.QUEUED){file.status=Dropzone.CANCELED;this.emit("canceled",file);if(this.options.uploadMultiple){this.emit("canceledmultiple",[file]);}}
if(this.options.autoProcessQueue){return this.processQueue();}}},{key:"resolveOption",value:function resolveOption(option){if(typeof option==="function"){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}
return option.apply(this,args);}
return option;}},{key:"uploadFile",value:function uploadFile(file){return this.uploadFiles([file]);}},{key:"uploadFiles",value:function uploadFiles(files){var _this14=this;this._transformFiles(files,function(transformedFiles){if(_this14.options.chunking){var transformedFile=transformedFiles[0];files[0].upload.chunked=_this14.options.chunking&&(_this14.options.forceChunking||transformedFile.size>_this14.options.chunkSize);files[0].upload.totalChunkCount=Math.ceil(transformedFile.size / _this14.options.chunkSize);}
if(files[0].upload.chunked){var file=files[0];var _transformedFile=transformedFiles[0];var startedChunkCount=0;file.upload.chunks=[];var handleNextChunk=function handleNextChunk(){var chunkIndex=0;while(file.upload.chunks[chunkIndex]!==undefined){chunkIndex++;}
if(chunkIndex>=file.upload.totalChunkCount)return;startedChunkCount++;var start=chunkIndex*_this14.options.chunkSize;var end=Math.min(start+_this14.options.chunkSize,_transformedFile.size);var dataBlock={name:_this14._getParamName(0),data:_transformedFile.webkitSlice?_transformedFile.webkitSlice(start,end):_transformedFile.slice(start,end),filename:file.upload.filename,chunkIndex:chunkIndex};file.upload.chunks[chunkIndex]={file:file,index:chunkIndex,dataBlock:dataBlock,status:Dropzone.UPLOADING,progress:0,retries:0};_this14._uploadData(files,[dataBlock]);};file.upload.finishedChunkUpload=function(chunk,response){var allFinished=true;chunk.status=Dropzone.SUCCESS;chunk.dataBlock=null;chunk.xhr=null;for(var i=0;i<file.upload.totalChunkCount;i++){if(file.upload.chunks[i]===undefined){return handleNextChunk();}
if(file.upload.chunks[i].status!==Dropzone.SUCCESS){allFinished=false;}}
if(allFinished){_this14.options.chunksUploaded(file,function(){_this14._finished(files,response,null);});}};if(_this14.options.parallelChunkUploads){for(var i=0;i<file.upload.totalChunkCount;i++){handleNextChunk();}}else{handleNextChunk();}}else{var dataBlocks=[];for(var _i2=0;_i2<files.length;_i2++){dataBlocks[_i2]={name:_this14._getParamName(_i2),data:transformedFiles[_i2],filename:files[_i2].upload.filename};}
_this14._uploadData(files,dataBlocks);}});}},{key:"_getChunk",value:function _getChunk(file,xhr){for(var i=0;i<file.upload.totalChunkCount;i++){if(file.upload.chunks[i]!==undefined&&file.upload.chunks[i].xhr===xhr){return file.upload.chunks[i];}}}},{key:"_uploadData",value:function _uploadData(files,dataBlocks){var _this15=this;var xhr=new XMLHttpRequest();var _iterator13=dropzone_createForOfIteratorHelper(files,true),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var file=_step13.value;file.xhr=xhr;}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}
if(files[0].upload.chunked){files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr=xhr;}
var method=this.resolveOption(this.options.method,files);var url=this.resolveOption(this.options.url,files);xhr.open(method,url,true);var timeout=this.resolveOption(this.options.timeout,files);if(timeout)xhr.timeout=this.resolveOption(this.options.timeout,files);xhr.withCredentials=!!this.options.withCredentials;xhr.onload=function(e){_this15._finishedUploading(files,xhr,e);};xhr.ontimeout=function(){_this15._handleUploadError(files,xhr,"Request timedout after ".concat(_this15.options.timeout / 1000," seconds"));};xhr.onerror=function(){_this15._handleUploadError(files,xhr);};var progressObj=xhr.upload!=null?xhr.upload:xhr;progressObj.onprogress=function(e){return _this15._updateFilesUploadProgress(files,xhr,e);};var headers={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};if(this.options.headers){Dropzone.extend(headers,this.options.headers);}
for(var headerName in headers){var headerValue=headers[headerName];if(headerValue){xhr.setRequestHeader(headerName,headerValue);}}
var formData=new FormData();if(this.options.params){var additionalParams=this.options.params;if(typeof additionalParams==="function"){additionalParams=additionalParams.call(this,files,xhr,files[0].upload.chunked?this._getChunk(files[0],xhr):null);}
for(var key in additionalParams){var value=additionalParams[key];if(Array.isArray(value)){for(var i=0;i<value.length;i++){formData.append(key,value[i]);}}else{formData.append(key,value);}}}
var _iterator14=dropzone_createForOfIteratorHelper(files,true),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _file=_step14.value;this.emit("sending",_file,xhr,formData);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}
if(this.options.uploadMultiple){this.emit("sendingmultiple",files,xhr,formData);}
this._addFormElementData(formData);for(var _i3=0;_i3<dataBlocks.length;_i3++){var dataBlock=dataBlocks[_i3];formData.append(dataBlock.name,dataBlock.data,dataBlock.filename);}
this.submitRequest(xhr,formData,files);}},{key:"_transformFiles",value:function _transformFiles(files,done){var _this16=this;var transformedFiles=[];var doneCounter=0;var _loop=function _loop(i){_this16.options.transformFile.call(_this16,files[i],function(transformedFile){transformedFiles[i]=transformedFile;if(++doneCounter===files.length){done(transformedFiles);}});};for(var i=0;i<files.length;i++){_loop(i);}}},{key:"_addFormElementData",value:function _addFormElementData(formData){if(this.element.tagName==="FORM"){var _iterator15=dropzone_createForOfIteratorHelper(this.element.querySelectorAll("input, textarea, select, button"),true),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var input=_step15.value;var inputName=input.getAttribute("name");var inputType=input.getAttribute("type");if(inputType)inputType=inputType.toLowerCase();if(typeof inputName==="undefined"||inputName===null)continue;if(input.tagName==="SELECT"&&input.hasAttribute("multiple")){var _iterator16=dropzone_createForOfIteratorHelper(input.options,true),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var option=_step16.value;if(option.selected){formData.append(inputName,option.value);}}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}else if(!inputType||inputType!=="checkbox"&&inputType!=="radio"||input.checked){formData.append(inputName,input.value);}}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}}},{key:"_updateFilesUploadProgress",value:function _updateFilesUploadProgress(files,xhr,e){if(!files[0].upload.chunked){var _iterator17=dropzone_createForOfIteratorHelper(files,true),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var file=_step17.value;if(file.upload.total&&file.upload.bytesSent&&file.upload.bytesSent==file.upload.total){continue;}
if(e){file.upload.progress=100*e.loaded / e.total;file.upload.total=e.total;file.upload.bytesSent=e.loaded;}else{file.upload.progress=100;file.upload.bytesSent=file.upload.total;}
this.emit("uploadprogress",file,file.upload.progress,file.upload.bytesSent);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}else{var _file2=files[0];var chunk=this._getChunk(_file2,xhr);if(e){chunk.progress=100*e.loaded / e.total;chunk.total=e.total;chunk.bytesSent=e.loaded;}else{chunk.progress=100;chunk.bytesSent=chunk.total;}
_file2.upload.progress=0;_file2.upload.total=0;_file2.upload.bytesSent=0;for(var i=0;i<_file2.upload.totalChunkCount;i++){if(_file2.upload.chunks[i]&&typeof _file2.upload.chunks[i].progress!=="undefined"){_file2.upload.progress+=_file2.upload.chunks[i].progress;_file2.upload.total+=_file2.upload.chunks[i].total;_file2.upload.bytesSent+=_file2.upload.chunks[i].bytesSent;}}
_file2.upload.progress=_file2.upload.progress / _file2.upload.totalChunkCount;this.emit("uploadprogress",_file2,_file2.upload.progress,_file2.upload.bytesSent);}}},{key:"_finishedUploading",value:function _finishedUploading(files,xhr,e){var response;if(files[0].status===Dropzone.CANCELED){return;}
if(xhr.readyState!==4){return;}
if(xhr.responseType!=="arraybuffer"&&xhr.responseType!=="blob"){response=xhr.responseText;if(xhr.getResponseHeader("content-type")&&~xhr.getResponseHeader("content-type").indexOf("application/json")){try{response=JSON.parse(response);}catch(error){e=error;response="Invalid JSON response from server.";}}}
this._updateFilesUploadProgress(files,xhr);if(!(200<=xhr.status&&xhr.status<300)){this._handleUploadError(files,xhr,response);}else{if(files[0].upload.chunked){files[0].upload.finishedChunkUpload(this._getChunk(files[0],xhr),response);}else{this._finished(files,response,e);}}}},{key:"_handleUploadError",value:function _handleUploadError(files,xhr,response){if(files[0].status===Dropzone.CANCELED){return;}
if(files[0].upload.chunked&&this.options.retryChunks){var chunk=this._getChunk(files[0],xhr);if(chunk.retries++<this.options.retryChunksLimit){this._uploadData(files,[chunk.dataBlock]);return;}else{console.warn("Retried this chunk too often. Giving up.");}}
this._errorProcessing(files,response||this.options.dictResponseError.replace("{{statusCode}}",xhr.status),xhr);}},{key:"submitRequest",value:function submitRequest(xhr,formData,files){if(xhr.readyState!=1){console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");return;}
xhr.send(formData);}},{key:"_finished",value:function _finished(files,responseText,e){var _iterator18=dropzone_createForOfIteratorHelper(files,true),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var file=_step18.value;file.status=Dropzone.SUCCESS;this.emit("success",file,responseText,e);this.emit("complete",file);}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}
if(this.options.uploadMultiple){this.emit("successmultiple",files,responseText,e);this.emit("completemultiple",files);}
if(this.options.autoProcessQueue){return this.processQueue();}}},{key:"_errorProcessing",value:function _errorProcessing(files,message,xhr){var _iterator19=dropzone_createForOfIteratorHelper(files,true),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var file=_step19.value;file.status=Dropzone.ERROR;this.emit("error",file,message,xhr);this.emit("complete",file);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}
if(this.options.uploadMultiple){this.emit("errormultiple",files,message,xhr);this.emit("completemultiple",files);}
if(this.options.autoProcessQueue){return this.processQueue();}}}],[{key:"initClass",value:function initClass(){this.prototype.Emitter=Emitter;this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"];this.prototype._thumbnailQueue=[];this.prototype._processingThumbnail=false;}},{key:"extend",value:function extend(target){for(var _len2=arguments.length,objects=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){objects[_key2-1]=arguments[_key2];}
for(var _i4=0,_objects=objects;_i4<_objects.length;_i4++){var object=_objects[_i4];for(var key in object){var val=object[key];target[key]=val;}}
return target;}},{key:"uuidv4",value:function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==="x"?r:r&0x3|0x8;return v.toString(16);});}}]);return Dropzone;}(Emitter);Dropzone.initClass();Dropzone.version="5.9.3";Dropzone.options={};Dropzone.optionsForElement=function(element){if(element.getAttribute("id")){return Dropzone.options[camelize(element.getAttribute("id"))];}else{return undefined;}};Dropzone.instances=[];Dropzone.forElement=function(element){if(typeof element==="string"){element=document.querySelector(element);}
if((element!=null?element.dropzone:undefined)==null){throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");}
return element.dropzone;};Dropzone.autoDiscover=true;Dropzone.discover=function(){var dropzones;if(document.querySelectorAll){dropzones=document.querySelectorAll(".dropzone");}else{dropzones=[];var checkElements=function checkElements(elements){return function(){var result=[];var _iterator20=dropzone_createForOfIteratorHelper(elements,true),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var el=_step20.value;if(/(^| )dropzone($| )/.test(el.className)){result.push(dropzones.push(el));}else{result.push(undefined);}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}
return result;}();};checkElements(document.getElementsByTagName("div"));checkElements(document.getElementsByTagName("form"));}
return function(){var result=[];var _iterator21=dropzone_createForOfIteratorHelper(dropzones,true),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var dropzone=_step21.value;if(Dropzone.optionsForElement(dropzone)!==false){result.push(new Dropzone(dropzone));}else{result.push(undefined);}}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}
return result;}();};Dropzone.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i];Dropzone.isBrowserSupported=function(){var capableBrowser=true;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector){if(!("classList"in document.createElement("a"))){capableBrowser=false;}else{if(Dropzone.blacklistedBrowsers!==undefined){Dropzone.blockedBrowsers=Dropzone.blacklistedBrowsers;}
var _iterator22=dropzone_createForOfIteratorHelper(Dropzone.blockedBrowsers,true),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var regex=_step22.value;if(regex.test(navigator.userAgent)){capableBrowser=false;continue;}}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}else{capableBrowser=false;}
return capableBrowser;};Dropzone.dataURItoBlob=function(dataURI){var byteString=atob(dataURI.split(",")[1]);var mimeString=dataURI.split(",")[0].split(":")[1].split(";")[0];var ab=new ArrayBuffer(byteString.length);var ia=new Uint8Array(ab);for(var i=0,end=byteString.length,asc=0<=end;asc?i<=end:i>=end;asc?i++:i--){ia[i]=byteString.charCodeAt(i);}
return new Blob([ab],{type:mimeString});};var without=function without(list,rejectedItem){return list.filter(function(item){return item!==rejectedItem;}).map(function(item){return item;});};var camelize=function camelize(str){return str.replace(/[\-_](\w)/g,function(match){return match.charAt(1).toUpperCase();});};Dropzone.createElement=function(string){var div=document.createElement("div");div.innerHTML=string;return div.childNodes[0];};Dropzone.elementInside=function(element,container){if(element===container){return true;}
while(element=element.parentNode){if(element===container){return true;}}
return false;};Dropzone.getElement=function(el,name){var element;if(typeof el==="string"){element=document.querySelector(el);}else if(el.nodeType!=null){element=el;}
if(element==null){throw new Error("Invalid `".concat(name,"` option provided. Please provide a CSS selector or a plain HTML element."));}
return element;};Dropzone.getElements=function(els,name){var el,elements;if(els instanceof Array){elements=[];try{var _iterator23=dropzone_createForOfIteratorHelper(els,true),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){el=_step23.value;elements.push(this.getElement(el,name));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}}catch(e){elements=null;}}else if(typeof els==="string"){elements=[];var _iterator24=dropzone_createForOfIteratorHelper(document.querySelectorAll(els),true),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){el=_step24.value;elements.push(el);}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}}else if(els.nodeType!=null){elements=[els];}
if(elements==null||!elements.length){throw new Error("Invalid `".concat(name,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));}
return elements;};Dropzone.confirm=function(question,accepted,rejected){if(window.confirm(question)){return accepted();}else if(rejected!=null){return rejected();}};Dropzone.isValidFile=function(file,acceptedFiles){if(!acceptedFiles){return true;}
acceptedFiles=acceptedFiles.split(",");var mimeType=file.type;var baseMimeType=mimeType.replace(/\/.*$/,"");var _iterator25=dropzone_createForOfIteratorHelper(acceptedFiles,true),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var validType=_step25.value;validType=validType.trim();if(validType.charAt(0)==="."){if(file.name.toLowerCase().indexOf(validType.toLowerCase(),file.name.length-validType.length)!==-1){return true;}}else if(/\/\*$/.test(validType)){if(baseMimeType===validType.replace(/\/.*$/,"")){return true;}}else{if(mimeType===validType){return true;}}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}
return false;};if(typeof jQuery!=="undefined"&&jQuery!==null){jQuery.fn.dropzone=function(options){return this.each(function(){return new Dropzone(this,options);});};}
Dropzone.ADDED="added";Dropzone.QUEUED="queued";Dropzone.ACCEPTED=Dropzone.QUEUED;Dropzone.UPLOADING="uploading";Dropzone.PROCESSING=Dropzone.UPLOADING;Dropzone.CANCELED="canceled";Dropzone.ERROR="error";Dropzone.SUCCESS="success";var detectVerticalSquash=function detectVerticalSquash(img){var iw=img.naturalWidth;var ih=img.naturalHeight;var canvas=document.createElement("canvas");canvas.width=1;canvas.height=ih;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);var _ctx$getImageData=ctx.getImageData(1,0,1,ih),data=_ctx$getImageData.data;var sy=0;var ey=ih;var py=ih;while(py>sy){var alpha=data[(py-1)*4+3];if(alpha===0){ey=py;}else{sy=py;}
py=ey+sy>>1;}
var ratio=py / ih;if(ratio===0){return 1;}else{return ratio;}};var drawImageIOSFix=function drawImageIOSFix(ctx,img,sx,sy,sw,sh,dx,dy,dw,dh){var vertSquashRatio=detectVerticalSquash(img);return ctx.drawImage(img,sx,sy,sw,sh,dx,dy,dw,dh / vertSquashRatio);};var ExifRestore=function(){function ExifRestore(){dropzone_classCallCheck(this,ExifRestore);}
dropzone_createClass(ExifRestore,null,[{key:"initClass",value:function initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";}},{key:"encode64",value:function encode64(input){var output="";var chr1=undefined;var chr2=undefined;var chr3="";var enc1=undefined;var enc2=undefined;var enc3=undefined;var enc4="";var i=0;while(true){chr1=input[i++];chr2=input[i++];chr3=input[i++];enc1=chr1>>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
output=output+this.KEY_STR.charAt(enc1)+this.KEY_STR.charAt(enc2)+this.KEY_STR.charAt(enc3)+this.KEY_STR.charAt(enc4);chr1=chr2=chr3="";enc1=enc2=enc3=enc4="";if(!(i<input.length)){break;}}
return output;}},{key:"restore",value:function restore(origFileBase64,resizedFileBase64){if(!origFileBase64.match("data:image/jpeg;base64,")){return resizedFileBase64;}
var rawImage=this.decode64(origFileBase64.replace("data:image/jpeg;base64,",""));var segments=this.slice2Segments(rawImage);var image=this.exifManipulation(resizedFileBase64,segments);return"data:image/jpeg;base64,".concat(this.encode64(image));}},{key:"exifManipulation",value:function exifManipulation(resizedFileBase64,segments){var exifArray=this.getExifArray(segments);var newImageArray=this.insertExif(resizedFileBase64,exifArray);var aBuffer=new Uint8Array(newImageArray);return aBuffer;}},{key:"getExifArray",value:function getExifArray(segments){var seg=undefined;var x=0;while(x<segments.length){seg=segments[x];if(seg[0]===255&seg[1]===225){return seg;}
x++;}
return[];}},{key:"insertExif",value:function insertExif(resizedFileBase64,exifArray){var imageData=resizedFileBase64.replace("data:image/jpeg;base64,","");var buf=this.decode64(imageData);var separatePoint=buf.indexOf(255,3);var mae=buf.slice(0,separatePoint);var ato=buf.slice(separatePoint);var array=mae;array=array.concat(exifArray);array=array.concat(ato);return array;}},{key:"slice2Segments",value:function slice2Segments(rawImageArray){var head=0;var segments=[];while(true){var length;if(rawImageArray[head]===255&rawImageArray[head+1]===218){break;}
if(rawImageArray[head]===255&rawImageArray[head+1]===216){head+=2;}else{length=rawImageArray[head+2]*256+rawImageArray[head+3];var endPoint=head+length+2;var seg=rawImageArray.slice(head,endPoint);segments.push(seg);head=endPoint;}
if(head>rawImageArray.length){break;}}
return segments;}},{key:"decode64",value:function decode64(input){var output="";var chr1=undefined;var chr2=undefined;var chr3="";var enc1=undefined;var enc2=undefined;var enc3=undefined;var enc4="";var i=0;var buf=[];var base64test=/[^A-Za-z0-9\+\/\=]/g;if(base64test.exec(input)){console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.");}
input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(true){enc1=this.KEY_STR.indexOf(input.charAt(i++));enc2=this.KEY_STR.indexOf(input.charAt(i++));enc3=this.KEY_STR.indexOf(input.charAt(i++));enc4=this.KEY_STR.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;buf.push(chr1);if(enc3!==64){buf.push(chr2);}
if(enc4!==64){buf.push(chr3);}
chr1=chr2=chr3="";enc1=enc2=enc3=enc4="";if(!(i<input.length)){break;}}
return buf;}}]);return ExifRestore;}();ExifRestore.initClass();var contentLoaded=function contentLoaded(win,fn){var done=false;var top=true;var doc=win.document;var root=doc.documentElement;var add=doc.addEventListener?"addEventListener":"attachEvent";var rem=doc.addEventListener?"removeEventListener":"detachEvent";var pre=doc.addEventListener?"":"on";var init=function init(e){if(e.type==="readystatechange"&&doc.readyState!=="complete"){return;}
(e.type==="load"?win:doc)[rem](pre+e.type,init,false);if(!done&&(done=true)){return fn.call(win,e.type||e);}};var poll=function poll(){try{root.doScroll("left");}catch(e){setTimeout(poll,50);return;}
return init("poll");};if(doc.readyState!=="complete"){if(doc.createEventObject&&root.doScroll){try{top=!win.frameElement;}catch(error){}
if(top){poll();}}
doc[add](pre+"DOMContentLoaded",init,false);doc[add](pre+"readystatechange",init,false);return win[add](pre+"load",init,false);}};Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover){return Dropzone.discover();}};contentLoaded(window,Dropzone._autoDiscoverFunction);function __guard__(value,transform){return typeof value!=="undefined"&&value!==null?transform(value):undefined;}
function __guardMethod__(obj,methodName,transform){if(typeof obj!=="undefined"&&obj!==null&&typeof obj[methodName]==="function"){return transform(obj,methodName);}else{return undefined;}};window.Dropzone=Dropzone;var dropzone_dist=(Dropzone);}();return __webpack_exports__;})();});"use strict";Dropzone.autoDiscover=false;var FileUpload={attachaments:[],myDropzone:null,isLoading:false,isTranscodingVideo:false,state:{},initDropZone:function(selector,url,isChunkUpload=false){let chunkSize=1024;if(isChunkUpload){chunkSize=mediaSettings.upload_chunk_size*1000000;url=url.replace('/upload/','/uploadChunked/');}
FileUpload.myDropzone=new Dropzone(selector,{paramName:"file",previewTemplate:document.querySelector('#tpl').innerHTML,url:app.baseUrl+url,headers:{'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')},clickable:['.file-upload-button'],previewsContainer:".dropzone-previews",maxFilesize:mediaSettings.max_file_upload_size,addRemoveLinks:true,dictRemoveFile:"x",acceptedFiles:mediaSettings.allowed_file_extensions,chunking:isChunkUpload,forceChunking:isChunkUpload,chunkSize:chunkSize,parallelChunkUploads:false,retryChunks:false,retryChunksLimit:2,init:function(){FileUpload.attachaments.map((element)=>{var mockFile={name:element.attachmentID,upload:{attachmentID:element.attachmentID},type:element.type,thumbnail:element.thumbnail};this.emit("addedfile",mockFile);this.emit("thumbnail",mockFile,element.thumbnail);this.emit("complete",mockFile);FileUpload.updatePreviewElement(mockFile,false,element);});var _this=this;$(".draft-clear-button").on("click",function(){_this.removeAllFiles(true);});},dictInvalidFileType:trans("You can't upload files of this type."),});FileUpload.myDropzone.on("addedfile",file=>{FileUpload.updatePreviewElement(file,true);FileUpload.isLoading=true;});FileUpload.myDropzone.on("success",(file,response)=>{if(response.coconut_id!==null){FileUpload.isTranscodingVideo=true;}
if(response.success){file.upload.attachmentID=response.attachmentID;FileUpload.attachaments.push({attachmentID:response.attachmentID,path:response.path,type:response.type,thumbnail:response.thumbnail});switch(file.type){case'video/mp4':case'video/avi':case'video/quicktime':case'video/x-m4v':case'video/mpeg':case'video/wmw':case'video/x-matroska':case'video/x-ms-asf':case'video/x-ms-wmv':case'video/x-ms-wmx':case'video/x-ms-wvx':case'video':FileUpload.updatePreviewElement(file,false,response);break;}}
FileUpload.isLoading=false;});FileUpload.myDropzone.on("removedfile",function(file){FileUpload.attachaments=FileUpload.attachaments.filter((attachment)=>{if(attachment.attachmentID!==file.upload.attachmentID){return attachment;}
else{FileUpload.removeAttachment(attachment);}});});FileUpload.myDropzone.on("error",(file,errorMessage)=>{if(typeof errorMessage.errors!=='undefined'){launchToast('danger',trans('Error'),errorMessage.message);}
else{if(typeof errorMessage.message!=='undefined'){launchToast('danger',trans('Error'),errorMessage.message);}
else{launchToast('danger',trans('Error'),errorMessage);}}
FileUpload.myDropzone.removeFile(file);FileUpload.isLoading=false;});},updatePreviewElement:function(file,localFile,attachment=false){let filePreview=$(file.previewElement);filePreview.find('.dz-image').remove();switch(file.type){case'video/mp4':case'video/avi':case'video/quicktime':case'video/x-m4v':case'video/mpeg':case'video/wmw':case'video/x-matroska':case'video/x-ms-asf':case'video/x-ms-wmv':case'video/x-ms-wmx':case'video/x-ms-wvx':case'video':filePreview.find('.video-preview-item').remove();filePreview.prepend(videoPreview());var videoPreviewEl=filePreview.find('video').get(0);if(localFile){FileUpload.setMediaSourceForPreviewByElementAndFile(videoPreviewEl,file);}
else{FileUpload.setPreviewSource(videoPreviewEl,file,attachment);}
break;case'audio/mpeg':case'audio/ogg':case'audio':filePreview.prepend(audioPreview());filePreview.addClass("w-100");filePreview.find('audio').addClass("w-100");filePreview.find(".audio-preview-item").addClass("w-100");var audioPreviewEl=filePreview.find('audio').get(0);filePreview.addClass("w-100");if(localFile){FileUpload.setMediaSourceForPreviewByElementAndFile(audioPreviewEl,file);}
else{FileUpload.setPreviewSource(audioPreviewEl,file,attachment);}
break;case'application/vnd.ms-excel':case'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':filePreview.prepend(excelPreview());break;case'application/pdf':filePreview.prepend(pdfPreview());break;default:filePreview.prepend(imagePreview());if(!localFile){let previewElement=filePreview.find('img').get(0);FileUpload.setPreviewSource(previewElement,file,attachment);}
break;}},setMediaSourceForPreviewByElementAndFile:function(element,file){if(typeof element==='undefined'){return false;}
if(element.canPlayType(file.type).length&&element.canPlayType(file.type)!=="no"){const fileURL=window.URL.createObjectURL(file);$(element).on('loadeddata',function(){window.URL.revokeObjectURL(fileURL);});$(element).attr('src',fileURL);$(element).attr('type',file.type);}
else{$(element).attr('src',app.baseUrl+'/img/video-loading-spinner.mp4');$(element).attr('loop',true);}},setPreviewSource:function(element,file,attachment){if(attachment.coconut_id!==null&&attachment.path.indexOf('videos/tmp/')>=0){$(element).attr('src',app.baseUrl+'/img/video-loading-spinner.mp4');}
else{let fileSrc=attachment.path;if(attachment.type==='image'){fileSrc=typeof attachment.thumbnail!=='undefined'?attachment.thumbnail:attachment.path;}
$(element).attr('src',fileSrc);}},removeAttachment:function(attachmentID){$.ajax({type:'POST',data:{'attachmentId':attachmentID,},url:app.baseUrl+'/attachment/remove',success:function(){launchToast('success',trans('Success'),trans('Attachment removed.'));},error:function(){launchToast('danger',trans('Error'),trans('Failed to remove the attachment.'));}});},};function videoPreview(){return`<div class="video-preview-item shadow">
                <span data-dz-name></span>
                <span data-dz-size></span>
            <video class="video-preview" controls autoplay muted loop></video>
        </div>`;}
function imagePreview(){return`<div class="dz-image shadow">
            <img data-dz-thumbnail/>
        </div>
        <div class="dz-details">
            <div class="dz-filename"><span data-dz-name></span></div>
            <div class="dz-size" data-dz-size></div>
        </div>`;}
function audioPreview(){return`<div class="audio-preview-item">
                    <span data-dz-name></span>
                    <span data-dz-size></span>
                <audio id="audio-preview" controls type="audio/mpeg" autoplay muted></audio>
        </div>`;}
function pdfPreview(){return`<div class="pdf-preview-item">
                    <div class="dz-image shadow p-4">
                        <img data-dz-thumbnail src="${mediaSettings.manual_payments_pdf_icon}"/>
                    </div>
                    <span data-dz-name></span>
                    <span data-dz-size></span>
        </div>`;}
function excelPreview(){return`<div class="xls-preview-item">
                    <div class="dz-image shadow p-4">
                        <img data-dz-thumbnail src="${mediaSettings.manual_payments_excel_icon}"/>
                    </div>
                    <span data-dz-name></span>
                    <span data-dz-size></span>
        </div>`;}

/*! PhotoSwipe - v4.1.3 - 2019-01-08
* http://photoswipe.com
* Copyright (c) 2019 Dmitry Semenov; */
(function(root,factory){if(typeof define==='function'&&define.amd){define(factory);}else if(typeof exports==='object'){module.exports=factory();}else{root.PhotoSwipe=factory();}})(this,function(){'use strict';var PhotoSwipe=function(template,UiClass,items,options){var framework={features:null,bind:function(target,type,listener,unbind){var methodName=(unbind?'remove':'add')+'EventListener';type=type.split(' ');for(var i=0;i<type.length;i++){if(type[i]){target[methodName](type[i],listener,false);}}},isArray:function(obj){return(obj instanceof Array);},createEl:function(classes,tag){var el=document.createElement(tag||'div');if(classes){el.className=classes;}
return el;},getScrollY:function(){var yOffset=window.pageYOffset;return yOffset!==undefined?yOffset:document.documentElement.scrollTop;},unbind:function(target,type,listener){framework.bind(target,type,listener,true);},removeClass:function(el,className){var reg=new RegExp('(\\s|^)'+className+'(\\s|$)');el.className=el.className.replace(reg,' ').replace(/^\s\s*/,'').replace(/\s\s*$/,'');},addClass:function(el,className){if(!framework.hasClass(el,className)){el.className+=(el.className?' ':'')+className;}},hasClass:function(el,className){return el.className&&new RegExp('(^|\\s)'+className+'(\\s|$)').test(el.className);},getChildByClass:function(parentEl,childClassName){var node=parentEl.firstChild;while(node){if(framework.hasClass(node,childClassName)){return node;}
node=node.nextSibling;}},arraySearch:function(array,value,key){var i=array.length;while(i--){if(array[i][key]===value){return i;}}
return-1;},extend:function(o1,o2,preventOverwrite){for(var prop in o2){if(o2.hasOwnProperty(prop)){if(preventOverwrite&&o1.hasOwnProperty(prop)){continue;}
o1[prop]=o2[prop];}}},easing:{sine:{out:function(k){return Math.sin(k*(Math.PI / 2));},inOut:function(k){return-(Math.cos(Math.PI*k)-1)/ 2;}},cubic:{out:function(k){return--k*k*k+1;}}},detectFeatures:function(){if(framework.features){return framework.features;}
var helperEl=framework.createEl(),helperStyle=helperEl.style,vendor='',features={};features.oldIE=document.all&&!document.addEventListener;features.touch='ontouchstart'in window;if(window.requestAnimationFrame){features.raf=window.requestAnimationFrame;features.caf=window.cancelAnimationFrame;}
features.pointerEvent=!!(window.PointerEvent)||navigator.msPointerEnabled;if(!features.pointerEvent){var ua=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var v=(navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);if(v&&v.length>0){v=parseInt(v[1],10);if(v>=1&&v<8){features.isOldIOSPhone=true;}}}
var match=ua.match(/Android\s([0-9\.]*)/);var androidversion=match?match[1]:0;androidversion=parseFloat(androidversion);if(androidversion>=1){if(androidversion<4.4){features.isOldAndroid=true;}
features.androidVersion=androidversion;}
features.isMobileOpera=/opera mini|opera mobi/i.test(ua);}
var styleChecks=['transform','perspective','animationName'],vendors=['','webkit','Moz','ms','O'],styleCheckItem,styleName;for(var i=0;i<4;i++){vendor=vendors[i];for(var a=0;a<3;a++){styleCheckItem=styleChecks[a];styleName=vendor+(vendor?styleCheckItem.charAt(0).toUpperCase()+styleCheckItem.slice(1):styleCheckItem);if(!features[styleCheckItem]&&styleName in helperStyle){features[styleCheckItem]=styleName;}}
if(vendor&&!features.raf){vendor=vendor.toLowerCase();features.raf=window[vendor+'RequestAnimationFrame'];if(features.raf){features.caf=window[vendor+'CancelAnimationFrame']||window[vendor+'CancelRequestAnimationFrame'];}}}
if(!features.raf){var lastTime=0;features.raf=function(fn){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){fn(currTime+timeToCall);},timeToCall);lastTime=currTime+timeToCall;return id;};features.caf=function(id){clearTimeout(id);};}
features.svg=!!document.createElementNS&&!!document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect;framework.features=features;return features;}};framework.detectFeatures();if(framework.features.oldIE){framework.bind=function(target,type,listener,unbind){type=type.split(' ');var methodName=(unbind?'detach':'attach')+'Event',evName,_handleEv=function(){listener.handleEvent.call(listener);};for(var i=0;i<type.length;i++){evName=type[i];if(evName){if(typeof listener==='object'&&listener.handleEvent){if(!unbind){listener['oldIE'+evName]=_handleEv;}else{if(!listener['oldIE'+evName]){return false;}}
target[methodName]('on'+evName,listener['oldIE'+evName]);}else{target[methodName]('on'+evName,listener);}}}};}
var self=this;var DOUBLE_TAP_RADIUS=25,NUM_HOLDERS=3;var _options={allowPanToNext:true,spacing:0.12,bgOpacity:1,mouseUsed:false,loop:true,pinchToClose:true,closeOnScroll:true,closeOnVerticalDrag:true,verticalDragRange:0.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:false,focus:true,escKey:true,arrowKeys:true,mainScrollEndFriction:0.35,panEndFriction:0.35,isClickableElement:function(el){return el.tagName==='A';},getDoubleTapZoom:function(isMouseClick,item){if(isMouseClick){return 1;}else{return item.initialZoomLevel<0.7?1:1.33;}},maxSpreadZoom:1.33,modal:true,scaleMode:'fit'};framework.extend(_options,options);var _getEmptyPoint=function(){return{x:0,y:0};};var _isOpen,_isDestroying,_closedByScroll,_currentItemIndex,_containerStyle,_containerShiftIndex,_currPanDist=_getEmptyPoint(),_startPanOffset=_getEmptyPoint(),_panOffset=_getEmptyPoint(),_upMoveEvents,_downEvents,_globalEventHandlers,_viewportSize={},_currZoomLevel,_startZoomLevel,_translatePrefix,_translateSufix,_updateSizeInterval,_itemsNeedUpdate,_currPositionIndex=0,_offset={},_slideSize=_getEmptyPoint(),_itemHolders,_prevItemIndex,_indexDiff=0,_dragStartEvent,_dragMoveEvent,_dragEndEvent,_dragCancelEvent,_transformKey,_pointerEventEnabled,_isFixedPosition=true,_likelyTouchDevice,_modules=[],_requestAF,_cancelAF,_initalClassName,_initalWindowScrollY,_oldIE,_currentWindowScrollY,_features,_windowVisibleSize={},_renderMaxResolution=false,_orientationChangeTimeout,_registerModule=function(name,module){framework.extend(self,module.publicMethods);_modules.push(name);},_getLoopedId=function(index){var numSlides=_getNumItems();if(index>numSlides-1){return index-numSlides;}else if(index<0){return numSlides+index;}
return index;},_listeners={},_listen=function(name,fn){if(!_listeners[name]){_listeners[name]=[];}
return _listeners[name].push(fn);},_shout=function(name){var listeners=_listeners[name];if(listeners){var args=Array.prototype.slice.call(arguments);args.shift();for(var i=0;i<listeners.length;i++){listeners[i].apply(self,args);}}},_getCurrentTime=function(){return new Date().getTime();},_applyBgOpacity=function(opacity){_bgOpacity=opacity;self.bg.style.opacity=opacity*_options.bgOpacity;},_applyZoomTransform=function(styleObj,x,y,zoom,item){if(typeof item!=='undefined'){if(/\.(mp3|wav)$/i.test(item.src)||/\.(mp4|ogg|webm)$/i.test(item.src)){styleObj['display']='flex';styleObj['justifyContent']='center';styleObj['alignItems']='center';return true;}}
if(!_renderMaxResolution||(item&&item!==self.currItem)){zoom=zoom /(item?item.fitRatio:self.currItem.fitRatio);}
styleObj[_transformKey]=_translatePrefix+x+'px, '+y+'px'+_translateSufix+' scale('+zoom+')';},_applyCurrentZoomPan=function(allowRenderResolution){if(_currZoomElementStyle){if(allowRenderResolution){if(_currZoomLevel>self.currItem.fitRatio){if(!_renderMaxResolution){_setImageSize(self.currItem,false,true);_renderMaxResolution=true;}}else{if(_renderMaxResolution){_setImageSize(self.currItem);_renderMaxResolution=false;}}}
_applyZoomTransform(_currZoomElementStyle,_panOffset.x,_panOffset.y,_currZoomLevel,self.currItem);}},_applyZoomPanToItem=function(item){if(item.container){_applyZoomTransform(item.container.style,item.initialPosition.x,item.initialPosition.y,item.initialZoomLevel,item);}},_setTranslateX=function(x,elStyle){elStyle[_transformKey]=_translatePrefix+x+'px, 0px'+_translateSufix;},_moveMainScroll=function(x,dragging){if(!_options.loop&&dragging){var newSlideIndexOffset=_currentItemIndex+(_slideSize.x*_currPositionIndex-x)/ _slideSize.x,delta=Math.round(x-_mainScrollPos.x);if((newSlideIndexOffset<0&&delta>0)||(newSlideIndexOffset>=_getNumItems()-1&&delta<0)){x=_mainScrollPos.x+delta*_options.mainScrollEndFriction;}}
_mainScrollPos.x=x;_setTranslateX(x,_containerStyle);},_calculatePanOffset=function(axis,zoomLevel){var m=_midZoomPoint[axis]-_offset[axis];return _startPanOffset[axis]+_currPanDist[axis]+m-m*(zoomLevel / _startZoomLevel);},_equalizePoints=function(p1,p2){p1.x=p2.x;p1.y=p2.y;if(p2.id){p1.id=p2.id;}},_roundPoint=function(p){p.x=Math.round(p.x);p.y=Math.round(p.y);},_mouseMoveTimeout=null,_onFirstMouseMove=function(){if(_mouseMoveTimeout){framework.unbind(document,'mousemove',_onFirstMouseMove);framework.addClass(template,'pswp--has_mouse');_options.mouseUsed=true;_shout('mouseUsed');}
_mouseMoveTimeout=setTimeout(function(){_mouseMoveTimeout=null;},100);},_bindEvents=function(){framework.bind(document,'keydown',self);if(_features.transform){framework.bind(self.scrollWrap,'click',self);}
if(!_options.mouseUsed){framework.bind(document,'mousemove',_onFirstMouseMove);}
framework.bind(window,'resize scroll orientationchange',self);_shout('bindEvents');},_unbindEvents=function(){framework.unbind(window,'resize scroll orientationchange',self);framework.unbind(window,'scroll',_globalEventHandlers.scroll);framework.unbind(document,'keydown',self);framework.unbind(document,'mousemove',_onFirstMouseMove);if(_features.transform){framework.unbind(self.scrollWrap,'click',self);}
if(_isDragging){framework.unbind(window,_upMoveEvents,self);}
clearTimeout(_orientationChangeTimeout);_shout('unbindEvents');},_calculatePanBounds=function(zoomLevel,update){var bounds=_calculateItemSize(self.currItem,_viewportSize,zoomLevel);if(update){_currPanBounds=bounds;}
return bounds;},_getMinZoomLevel=function(item){if(!item){item=self.currItem;}
return item.initialZoomLevel;},_getMaxZoomLevel=function(item){if(!item){item=self.currItem;}
return item.w>0?_options.maxSpreadZoom:1;},_modifyDestPanOffset=function(axis,destPanBounds,destPanOffset,destZoomLevel){if(destZoomLevel===self.currItem.initialZoomLevel){destPanOffset[axis]=self.currItem.initialPosition[axis];return true;}else{destPanOffset[axis]=_calculatePanOffset(axis,destZoomLevel);if(destPanOffset[axis]>destPanBounds.min[axis]){destPanOffset[axis]=destPanBounds.min[axis];return true;}else if(destPanOffset[axis]<destPanBounds.max[axis]){destPanOffset[axis]=destPanBounds.max[axis];return true;}}
return false;},_setupTransforms=function(){if(_transformKey){var allow3dTransform=_features.perspective&&!_likelyTouchDevice;_translatePrefix='translate'+(allow3dTransform?'3d(':'(');_translateSufix=_features.perspective?', 0px)':')';return;}
_transformKey='left';framework.addClass(template,'pswp--ie');_setTranslateX=function(x,elStyle){elStyle.left=x+'px';};_applyZoomPanToItem=function(item){var zoomRatio=item.fitRatio>1?1:item.fitRatio,s=item.container.style,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=item.initialPosition.x+'px';s.top=item.initialPosition.y+'px';};_applyCurrentZoomPan=function(){if(_currZoomElementStyle){var s=_currZoomElementStyle,item=self.currItem,zoomRatio=item.fitRatio>1?1:item.fitRatio,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=_panOffset.x+'px';s.top=_panOffset.y+'px';}};},_onKeyDown=function(e){var keydownAction='';if(_options.escKey&&e.keyCode===27){keydownAction='close';}else if(_options.arrowKeys){if(e.keyCode===37){keydownAction='prev';}else if(e.keyCode===39){keydownAction='next';}}
if(keydownAction){if(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}
self[keydownAction]();}}},_onGlobalClick=function(e){if(!e){return;}
if(_moved||_zoomStarted||_mainScrollAnimating||_verticalDragInitiated){e.preventDefault();e.stopPropagation();}},_updatePageScrollOffset=function(){self.setScrollOffset(0,framework.getScrollY());};var _animations={},_numAnimations=0,_stopAnimation=function(name){if(_animations[name]){if(_animations[name].raf){_cancelAF(_animations[name].raf);}
_numAnimations--;delete _animations[name];}},_registerStartAnimation=function(name){if(_animations[name]){_stopAnimation(name);}
if(!_animations[name]){_numAnimations++;_animations[name]={};}},_stopAllAnimations=function(){for(var prop in _animations){if(_animations.hasOwnProperty(prop)){_stopAnimation(prop);}}},_animateProp=function(name,b,endProp,d,easingFn,onUpdate,onComplete){var startAnimTime=_getCurrentTime(),t;_registerStartAnimation(name);var animloop=function(){if(_animations[name]){t=_getCurrentTime()-startAnimTime;if(t>=d){_stopAnimation(name);onUpdate(endProp);if(onComplete){onComplete();}
return;}
onUpdate((endProp-b)*easingFn(t/d)+b);_animations[name].raf=_requestAF(animloop);}};animloop();};var publicMethods={shout:_shout,listen:_listen,viewportSize:_viewportSize,options:_options,isMainScrollAnimating:function(){return _mainScrollAnimating;},getZoomLevel:function(){return _currZoomLevel;},getCurrentIndex:function(){return _currentItemIndex;},isDragging:function(){return _isDragging;},isZooming:function(){return _isZooming;},setScrollOffset:function(x,y){_offset.x=x;_currentWindowScrollY=_offset.y=y;_shout('updateScrollOffset',_offset);},applyZoomPan:function(zoomLevel,panX,panY,allowRenderResolution){_panOffset.x=panX;_panOffset.y=panY;_currZoomLevel=zoomLevel;_applyCurrentZoomPan(allowRenderResolution);},init:function(){if(_isOpen||_isDestroying){return;}
var i;self.framework=framework;self.template=template;self.bg=framework.getChildByClass(template,'pswp__bg');_initalClassName=template.className;_isOpen=true;_features=framework.detectFeatures();_requestAF=_features.raf;_cancelAF=_features.caf;_transformKey=_features.transform;_oldIE=_features.oldIE;self.scrollWrap=framework.getChildByClass(template,'pswp__scroll-wrap');self.container=framework.getChildByClass(self.scrollWrap,'pswp__container');_containerStyle=self.container.style;self.itemHolders=_itemHolders=[{el:self.container.children[0],wrap:0,index:-1},{el:self.container.children[1],wrap:0,index:-1},{el:self.container.children[2],wrap:0,index:-1}];_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='none';_setupTransforms();_globalEventHandlers={resize:self.updateSize,orientationchange:function(){clearTimeout(_orientationChangeTimeout);_orientationChangeTimeout=setTimeout(function(){if(_viewportSize.x!==self.scrollWrap.clientWidth){self.updateSize();}},500);},scroll:_updatePageScrollOffset,keydown:_onKeyDown,click:_onGlobalClick};var oldPhone=_features.isOldIOSPhone||_features.isOldAndroid||_features.isMobileOpera;if(!_features.animationName||!_features.transform||oldPhone){_options.showAnimationDuration=_options.hideAnimationDuration=0;}
for(i=0;i<_modules.length;i++){self['init'+_modules[i]]();}
if(UiClass){var ui=self.ui=new UiClass(self,framework);ui.init();}
_shout('firstUpdate');_currentItemIndex=_currentItemIndex||_options.index||0;if(isNaN(_currentItemIndex)||_currentItemIndex<0||_currentItemIndex>=_getNumItems()){_currentItemIndex=0;}
self.currItem=_getItemAt(_currentItemIndex);if(_features.isOldIOSPhone||_features.isOldAndroid){_isFixedPosition=false;}
template.setAttribute('aria-hidden','false');if(_options.modal){if(!_isFixedPosition){template.style.position='absolute';template.style.top=framework.getScrollY()+'px';}else{template.style.position='fixed';}}
if(_currentWindowScrollY===undefined){_shout('initialLayout');_currentWindowScrollY=_initalWindowScrollY=framework.getScrollY();}
var rootClasses='pswp--open ';if(_options.mainClass){rootClasses+=_options.mainClass+' ';}
if(_options.showHideOpacity){rootClasses+='pswp--animate_opacity ';}
rootClasses+=_likelyTouchDevice?'pswp--touch':'pswp--notouch';rootClasses+=_features.animationName?' pswp--css_animation':'';rootClasses+=_features.svg?' pswp--svg':'';framework.addClass(template,rootClasses);self.updateSize();_containerShiftIndex=-1;_indexDiff=null;for(i=0;i<NUM_HOLDERS;i++){_setTranslateX((i+_containerShiftIndex)*_slideSize.x,_itemHolders[i].el.style);}
if(!_oldIE){framework.bind(self.scrollWrap,_downEvents,self);}
_listen('initialZoomInEnd',function(){self.setContent(_itemHolders[0],_currentItemIndex-1);self.setContent(_itemHolders[2],_currentItemIndex+1);_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='block';if(_options.focus){template.focus();}
_bindEvents();});self.setContent(_itemHolders[1],_currentItemIndex);self.updateCurrItem();_shout('afterInit');if(!_isFixedPosition){_updateSizeInterval=setInterval(function(){if(!_numAnimations&&!_isDragging&&!_isZooming&&(_currZoomLevel===self.currItem.initialZoomLevel)){self.updateSize();}},1000);}
framework.addClass(template,'pswp--visible');},close:function(){if(!_isOpen){return;}
_isOpen=false;_isDestroying=true;_shout('close');_unbindEvents();_showOrHide(self.currItem,null,true,self.destroy);},destroy:function(){_shout('destroy');if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);}
template.setAttribute('aria-hidden','true');template.className=_initalClassName;if(_updateSizeInterval){clearInterval(_updateSizeInterval);}
framework.unbind(self.scrollWrap,_downEvents,self);framework.unbind(window,'scroll',self);_stopDragUpdateLoop();_stopAllAnimations();_listeners=null;},panTo:function(x,y,force){if(!force){if(x>_currPanBounds.min.x){x=_currPanBounds.min.x;}else if(x<_currPanBounds.max.x){x=_currPanBounds.max.x;}
if(y>_currPanBounds.min.y){y=_currPanBounds.min.y;}else if(y<_currPanBounds.max.y){y=_currPanBounds.max.y;}}
_panOffset.x=x;_panOffset.y=y;_applyCurrentZoomPan();},handleEvent:function(e){e=e||window.event;if(_globalEventHandlers[e.type]){_globalEventHandlers[e.type](e);}},goTo:function(index){index=_getLoopedId(index);var diff=index-_currentItemIndex;_indexDiff=diff;_currentItemIndex=index;self.currItem=_getItemAt(_currentItemIndex);_currPositionIndex-=diff;_moveMainScroll(_slideSize.x*_currPositionIndex);_stopAllAnimations();_mainScrollAnimating=false;self.updateCurrItem();},next:function(){self.goTo(_currentItemIndex+1);},prev:function(){self.goTo(_currentItemIndex-1);},updateCurrZoomItem:function(emulateSetContent){if(emulateSetContent){_shout('beforeChange',0);}
if(_itemHolders[1].el.children.length){var zoomElement=_itemHolders[1].el.children[0];if(framework.hasClass(zoomElement,'pswp__zoom-wrap')){_currZoomElementStyle=zoomElement.style;}else{_currZoomElementStyle=null;}}else{_currZoomElementStyle=null;}
_currPanBounds=self.currItem.bounds;_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;if(emulateSetContent){_shout('afterChange');}},invalidateCurrItems:function(){_itemsNeedUpdate=true;for(var i=0;i<NUM_HOLDERS;i++){if(_itemHolders[i].item){_itemHolders[i].item.needsUpdate=true;}}},updateCurrItem:function(beforeAnimation){if(_indexDiff===0){return;}
var diffAbs=Math.abs(_indexDiff),tempHolder;if(beforeAnimation&&diffAbs<2){return;}
self.currItem=_getItemAt(_currentItemIndex);_renderMaxResolution=false;_shout('beforeChange',_indexDiff);if(diffAbs>=NUM_HOLDERS){_containerShiftIndex+=_indexDiff+(_indexDiff>0?-NUM_HOLDERS:NUM_HOLDERS);diffAbs=NUM_HOLDERS;}
for(var i=0;i<diffAbs;i++){if(_indexDiff>0){tempHolder=_itemHolders.shift();_itemHolders[NUM_HOLDERS-1]=tempHolder;_containerShiftIndex++;_setTranslateX((_containerShiftIndex+2)*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex-diffAbs+i+1+1);}else{tempHolder=_itemHolders.pop();_itemHolders.unshift(tempHolder);_containerShiftIndex--;_setTranslateX(_containerShiftIndex*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex+diffAbs-i-1-1);}}
if(_currZoomElementStyle&&Math.abs(_indexDiff)===1){var prevItem=_getItemAt(_prevItemIndex);if(prevItem.initialZoomLevel!==_currZoomLevel){_calculateItemSize(prevItem,_viewportSize);_setImageSize(prevItem);_applyZoomPanToItem(prevItem);}}
_indexDiff=0;self.updateCurrZoomItem();_prevItemIndex=_currentItemIndex;_shout('afterChange');},updateSize:function(force){if(!_isFixedPosition&&_options.modal){var windowScrollY=framework.getScrollY();if(_currentWindowScrollY!==windowScrollY){template.style.top=windowScrollY+'px';_currentWindowScrollY=windowScrollY;}
if(!force&&_windowVisibleSize.x===window.innerWidth&&_windowVisibleSize.y===window.innerHeight){return;}
_windowVisibleSize.x=window.innerWidth;_windowVisibleSize.y=window.innerHeight;template.style.height=_windowVisibleSize.y+'px';}
_viewportSize.x=self.scrollWrap.clientWidth;_viewportSize.y=self.scrollWrap.clientHeight;_updatePageScrollOffset();_slideSize.x=_viewportSize.x+Math.round(_viewportSize.x*_options.spacing);_slideSize.y=_viewportSize.y;_moveMainScroll(_slideSize.x*_currPositionIndex);_shout('beforeResize');if(_containerShiftIndex!==undefined){var holder,item,hIndex;for(var i=0;i<NUM_HOLDERS;i++){holder=_itemHolders[i];_setTranslateX((i+_containerShiftIndex)*_slideSize.x,holder.el.style);hIndex=_currentItemIndex+i-1;if(_options.loop&&_getNumItems()>2){hIndex=_getLoopedId(hIndex);}
item=_getItemAt(hIndex);if(item&&(_itemsNeedUpdate||item.needsUpdate||!item.bounds)){self.cleanSlide(item);self.setContent(holder,hIndex);if(i===1){self.currItem=item;self.updateCurrZoomItem(true);}
item.needsUpdate=false;}else if(holder.index===-1&&hIndex>=0){self.setContent(holder,hIndex);}
if(item&&item.container){_calculateItemSize(item,_viewportSize);_setImageSize(item);_applyZoomPanToItem(item);}}
_itemsNeedUpdate=false;}
_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_currPanBounds=self.currItem.bounds;if(_currPanBounds){_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;_applyCurrentZoomPan(true);}
_shout('resize');},zoomTo:function(destZoomLevel,centerPoint,speed,easingFn,updateFn){if(centerPoint){_startZoomLevel=_currZoomLevel;_midZoomPoint.x=Math.abs(centerPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(centerPoint.y)-_panOffset.y;_equalizePoints(_startPanOffset,_panOffset);}
var destPanBounds=_calculatePanBounds(destZoomLevel,false),destPanOffset={};_modifyDestPanOffset('x',destPanBounds,destPanOffset,destZoomLevel);_modifyDestPanOffset('y',destPanBounds,destPanOffset,destZoomLevel);var initialZoomLevel=_currZoomLevel;var initialPanOffset={x:_panOffset.x,y:_panOffset.y};_roundPoint(destPanOffset);var onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=destPanOffset.x;_panOffset.y=destPanOffset.y;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(destPanOffset.x-initialPanOffset.x)*now+initialPanOffset.x;_panOffset.y=(destPanOffset.y-initialPanOffset.y)*now+initialPanOffset.y;}
if(updateFn){updateFn(now);}
_applyCurrentZoomPan(now===1);};if(speed){_animateProp('customZoomTo',0,1,speed,easingFn||framework.easing.sine.inOut,onUpdate);}else{onUpdate(1);}}};var MIN_SWIPE_DISTANCE=30,DIRECTION_CHECK_OFFSET=10;var _gestureStartTime,_gestureCheckSpeedTime,p={},p2={},delta={},_currPoint={},_startPoint={},_currPointers=[],_startMainScrollPos={},_releaseAnimData,_posPoints=[],_tempPoint={},_isZoomingIn,_verticalDragInitiated,_oldAndroidTouchEndTimeout,_currZoomedItemIndex=0,_centerPoint=_getEmptyPoint(),_lastReleaseTime=0,_isDragging,_isMultitouch,_zoomStarted,_moved,_dragAnimFrame,_mainScrollShifted,_currentPoints,_isZooming,_currPointsDistance,_startPointsDistance,_currPanBounds,_mainScrollPos=_getEmptyPoint(),_currZoomElementStyle,_mainScrollAnimating,_midZoomPoint=_getEmptyPoint(),_currCenterPoint=_getEmptyPoint(),_direction,_isFirstMove,_opacityChanged,_bgOpacity,_wasOverInitialZoom,_isEqualPoints=function(p1,p2){return p1.x===p2.x&&p1.y===p2.y;},_isNearbyPoints=function(touch0,touch1){return Math.abs(touch0.x-touch1.x)<DOUBLE_TAP_RADIUS&&Math.abs(touch0.y-touch1.y)<DOUBLE_TAP_RADIUS;},_calculatePointsDistance=function(p1,p2){_tempPoint.x=Math.abs(p1.x-p2.x);_tempPoint.y=Math.abs(p1.y-p2.y);return Math.sqrt(_tempPoint.x*_tempPoint.x+_tempPoint.y*_tempPoint.y);},_stopDragUpdateLoop=function(){if(_dragAnimFrame){_cancelAF(_dragAnimFrame);_dragAnimFrame=null;}},_dragUpdateLoop=function(){if(_isDragging){_dragAnimFrame=_requestAF(_dragUpdateLoop);_renderMovement();}},_canPan=function(){return!(_options.scaleMode==='fit'&&_currZoomLevel===self.currItem.initialZoomLevel);},_closestElement=function(el,fn){if(!el||el===document){return false;}
if(el.getAttribute('class')&&el.getAttribute('class').indexOf('pswp__scroll-wrap')>-1){return false;}
if(fn(el)){return el;}
return _closestElement(el.parentNode,fn);},_preventObj={},_preventDefaultEventBehaviour=function(e,isDown){_preventObj.prevent=!_closestElement(e.target,_options.isClickableElement);_shout('preventDragEvent',e,isDown,_preventObj);return _preventObj.prevent;},_convertTouchToPoint=function(touch,p){p.x=touch.pageX;p.y=touch.pageY;p.id=touch.identifier;return p;},_findCenterOfPoints=function(p1,p2,pCenter){pCenter.x=(p1.x+p2.x)*0.5;pCenter.y=(p1.y+p2.y)*0.5;},_pushPosPoint=function(time,x,y){if(time-_gestureCheckSpeedTime>50){var o=_posPoints.length>2?_posPoints.shift():{};o.x=x;o.y=y;_posPoints.push(o);_gestureCheckSpeedTime=time;}},_calculateVerticalDragOpacityRatio=function(){var yOffset=_panOffset.y-self.currItem.initialPosition.y;return 1-Math.abs(yOffset /(_viewportSize.y / 2));},_ePoint1={},_ePoint2={},_tempPointsArr=[],_tempCounter,_getTouchPoints=function(e){while(_tempPointsArr.length>0){_tempPointsArr.pop();}
if(!_pointerEventEnabled){if(e.type.indexOf('touch')>-1){if(e.touches&&e.touches.length>0){_tempPointsArr[0]=_convertTouchToPoint(e.touches[0],_ePoint1);if(e.touches.length>1){_tempPointsArr[1]=_convertTouchToPoint(e.touches[1],_ePoint2);}}}else{_ePoint1.x=e.pageX;_ePoint1.y=e.pageY;_ePoint1.id='';_tempPointsArr[0]=_ePoint1;}}else{_tempCounter=0;_currPointers.forEach(function(p){if(_tempCounter===0){_tempPointsArr[0]=p;}else if(_tempCounter===1){_tempPointsArr[1]=p;}
_tempCounter++;});}
return _tempPointsArr;},_panOrMoveMainScroll=function(axis,delta){var panFriction,overDiff=0,newOffset=_panOffset[axis]+delta[axis],startOverDiff,dir=delta[axis]>0,newMainScrollPosition=_mainScrollPos.x+delta.x,mainScrollDiff=_mainScrollPos.x-_startMainScrollPos.x,newPanPos,newMainScrollPos;if(newOffset>_currPanBounds.min[axis]||newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;}else{panFriction=1;}
newOffset=_panOffset[axis]+delta[axis]*panFriction;if(_options.allowPanToNext||_currZoomLevel===self.currItem.initialZoomLevel){if(!_currZoomElementStyle){newMainScrollPos=newMainScrollPosition;}else if(_direction==='h'&&axis==='x'&&!_zoomStarted){if(dir){if(newOffset>_currPanBounds.min[axis]){panFriction=_options.panEndFriction;overDiff=_currPanBounds.min[axis]-newOffset;startOverDiff=_currPanBounds.min[axis]-_startPanOffset[axis];}
if((startOverDiff<=0||mainScrollDiff<0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff<0&&newMainScrollPosition>_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}else{if(newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;overDiff=newOffset-_currPanBounds.max[axis];startOverDiff=_startPanOffset[axis]-_currPanBounds.max[axis];}
if((startOverDiff<=0||mainScrollDiff>0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff>0&&newMainScrollPosition<_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}}
if(axis==='x'){if(newMainScrollPos!==undefined){_moveMainScroll(newMainScrollPos,true);if(newMainScrollPos===_startMainScrollPos.x){_mainScrollShifted=false;}else{_mainScrollShifted=true;}}
if(_currPanBounds.min.x!==_currPanBounds.max.x){if(newPanPos!==undefined){_panOffset.x=newPanPos;}else if(!_mainScrollShifted){_panOffset.x+=delta.x*panFriction;}}
return newMainScrollPos!==undefined;}}
if(!_mainScrollAnimating){if(!_mainScrollShifted){if(_currZoomLevel>self.currItem.fitRatio){_panOffset[axis]+=delta[axis]*panFriction;}}}},_onDragStart=function(e){if(e.type==='mousedown'&&e.button>0){return;}
if(_initialZoomRunning){e.preventDefault();return;}
if(_oldAndroidTouchEndTimeout&&e.type==='mousedown'){return;}
if(_preventDefaultEventBehaviour(e,true)){e.preventDefault();}
_shout('pointerDown');if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex<0){pointerIndex=_currPointers.length;}
_currPointers[pointerIndex]={x:e.pageX,y:e.pageY,id:e.pointerId};}
var startPointsList=_getTouchPoints(e),numPoints=startPointsList.length;_currentPoints=null;_stopAllAnimations();if(!_isDragging||numPoints===1){_isDragging=_isFirstMove=true;framework.bind(window,_upMoveEvents,self);_isZoomingIn=_wasOverInitialZoom=_opacityChanged=_verticalDragInitiated=_mainScrollShifted=_moved=_isMultitouch=_zoomStarted=false;_direction=null;_shout('firstTouchStart',startPointsList);_equalizePoints(_startPanOffset,_panOffset);_currPanDist.x=_currPanDist.y=0;_equalizePoints(_currPoint,startPointsList[0]);_equalizePoints(_startPoint,_currPoint);_startMainScrollPos.x=_slideSize.x*_currPositionIndex;_posPoints=[{x:_currPoint.x,y:_currPoint.y}];_gestureCheckSpeedTime=_gestureStartTime=_getCurrentTime();_calculatePanBounds(_currZoomLevel,true);_stopDragUpdateLoop();_dragUpdateLoop();}
if(!_isZooming&&numPoints>1&&!_mainScrollAnimating&&!_mainScrollShifted){_startZoomLevel=_currZoomLevel;_zoomStarted=false;_isZooming=_isMultitouch=true;_currPanDist.y=_currPanDist.x=0;_equalizePoints(_startPanOffset,_panOffset);_equalizePoints(p,startPointsList[0]);_equalizePoints(p2,startPointsList[1]);_findCenterOfPoints(p,p2,_currCenterPoint);_midZoomPoint.x=Math.abs(_currCenterPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(_currCenterPoint.y)-_panOffset.y;_currPointsDistance=_startPointsDistance=_calculatePointsDistance(p,p2);}},_onDragMove=function(e){e.preventDefault();if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){var p=_currPointers[pointerIndex];p.x=e.pageX;p.y=e.pageY;}}
if(_isDragging){var touchesList=_getTouchPoints(e);if(!_direction&&!_moved&&!_isZooming){if(_mainScrollPos.x!==_slideSize.x*_currPositionIndex){_direction='h';}else{var diff=Math.abs(touchesList[0].x-_currPoint.x)-Math.abs(touchesList[0].y-_currPoint.y);if(Math.abs(diff)>=DIRECTION_CHECK_OFFSET){_direction=diff>0?'h':'v';_currentPoints=touchesList;}}}else{_currentPoints=touchesList;}}},_renderMovement=function(){if(!_currentPoints){return;}
var numPoints=_currentPoints.length;if(numPoints===0){return;}
_equalizePoints(p,_currentPoints[0]);delta.x=p.x-_currPoint.x;delta.y=p.y-_currPoint.y;if(_isZooming&&numPoints>1){_currPoint.x=p.x;_currPoint.y=p.y;if(!delta.x&&!delta.y&&_isEqualPoints(_currentPoints[1],p2)){return;}
_equalizePoints(p2,_currentPoints[1]);if(!_zoomStarted){_zoomStarted=true;_shout('zoomGestureStarted');}
var pointsDistance=_calculatePointsDistance(p,p2);var zoomLevel=_calculateZoomLevel(pointsDistance);if(zoomLevel>self.currItem.initialZoomLevel+self.currItem.initialZoomLevel / 15){_wasOverInitialZoom=true;}
var zoomFriction=1,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(zoomLevel<minZoomLevel){if(_options.pinchToClose&&!_wasOverInitialZoom&&_startZoomLevel<=self.currItem.initialZoomLevel){var minusDiff=minZoomLevel-zoomLevel;var percent=1-minusDiff /(minZoomLevel / 1.2);_applyBgOpacity(percent);_shout('onPinchClose',percent);_opacityChanged=true;}else{zoomFriction=(minZoomLevel-zoomLevel)/ minZoomLevel;if(zoomFriction>1){zoomFriction=1;}
zoomLevel=minZoomLevel-zoomFriction*(minZoomLevel / 3);}}else if(zoomLevel>maxZoomLevel){zoomFriction=(zoomLevel-maxZoomLevel)/(minZoomLevel*6);if(zoomFriction>1){zoomFriction=1;}
zoomLevel=maxZoomLevel+zoomFriction*minZoomLevel;}
if(zoomFriction<0){zoomFriction=0;}
_currPointsDistance=pointsDistance;_findCenterOfPoints(p,p2,_centerPoint);_currPanDist.x+=_centerPoint.x-_currCenterPoint.x;_currPanDist.y+=_centerPoint.y-_currCenterPoint.y;_equalizePoints(_currCenterPoint,_centerPoint);_panOffset.x=_calculatePanOffset('x',zoomLevel);_panOffset.y=_calculatePanOffset('y',zoomLevel);_isZoomingIn=zoomLevel>_currZoomLevel;_currZoomLevel=zoomLevel;_applyCurrentZoomPan();}else{if(!_direction){return;}
if(_isFirstMove){_isFirstMove=false;if(Math.abs(delta.x)>=DIRECTION_CHECK_OFFSET){delta.x-=_currentPoints[0].x-_startPoint.x;}
if(Math.abs(delta.y)>=DIRECTION_CHECK_OFFSET){delta.y-=_currentPoints[0].y-_startPoint.y;}}
_currPoint.x=p.x;_currPoint.y=p.y;if(delta.x===0&&delta.y===0){return;}
if(_direction==='v'&&_options.closeOnVerticalDrag){if(!_canPan()){_currPanDist.y+=delta.y;_panOffset.y+=delta.y;var opacityRatio=_calculateVerticalDragOpacityRatio();_verticalDragInitiated=true;_shout('onVerticalDrag',opacityRatio);_applyBgOpacity(opacityRatio);_applyCurrentZoomPan();return;}}
_pushPosPoint(_getCurrentTime(),p.x,p.y);_moved=true;_currPanBounds=self.currItem.bounds;var mainScrollChanged=_panOrMoveMainScroll('x',delta);if(!mainScrollChanged){_panOrMoveMainScroll('y',delta);_roundPoint(_panOffset);_applyCurrentZoomPan();}}},_onDragRelease=function(e){if(_features.isOldAndroid){if(_oldAndroidTouchEndTimeout&&e.type==='mouseup'){return;}
if(e.type.indexOf('touch')>-1){clearTimeout(_oldAndroidTouchEndTimeout);_oldAndroidTouchEndTimeout=setTimeout(function(){_oldAndroidTouchEndTimeout=0;},600);}}
_shout('pointerUp');if(_preventDefaultEventBehaviour(e,false)){e.preventDefault();}
var releasePoint;if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){releasePoint=_currPointers.splice(pointerIndex,1)[0];if(navigator.msPointerEnabled){var MSPOINTER_TYPES={4:'mouse',2:'touch',3:'pen'};releasePoint.type=MSPOINTER_TYPES[e.pointerType];if(!releasePoint.type){releasePoint.type=e.pointerType||'mouse';}}else{releasePoint.type=e.pointerType||'mouse';}}}
var touchList=_getTouchPoints(e),gestureType,numPoints=touchList.length;if(e.type==='mouseup'){numPoints=0;}
if(numPoints===2){_currentPoints=null;return true;}
if(numPoints===1){_equalizePoints(_startPoint,touchList[0]);}
if(numPoints===0&&!_direction&&!_mainScrollAnimating){if(!releasePoint){if(e.type==='mouseup'){releasePoint={x:e.pageX,y:e.pageY,type:'mouse'};}else if(e.changedTouches&&e.changedTouches[0]){releasePoint={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:'touch'};}}
_shout('touchRelease',e,releasePoint);}
var releaseTimeDiff=-1;if(numPoints===0){_isDragging=false;framework.unbind(window,_upMoveEvents,self);_stopDragUpdateLoop();if(_isZooming){releaseTimeDiff=0;}else if(_lastReleaseTime!==-1){releaseTimeDiff=_getCurrentTime()-_lastReleaseTime;}}
_lastReleaseTime=numPoints===1?_getCurrentTime():-1;if(releaseTimeDiff!==-1&&releaseTimeDiff<150){gestureType='zoom';}else{gestureType='swipe';}
if(_isZooming&&numPoints<2){_isZooming=false;if(numPoints===1){gestureType='zoomPointerUp';}
_shout('zoomGestureEnded');}
_currentPoints=null;if(!_moved&&!_zoomStarted&&!_mainScrollAnimating&&!_verticalDragInitiated){return;}
_stopAllAnimations();if(!_releaseAnimData){_releaseAnimData=_initDragReleaseAnimationData();}
_releaseAnimData.calculateSwipeSpeed('x');if(_verticalDragInitiated){var opacityRatio=_calculateVerticalDragOpacityRatio();if(opacityRatio<_options.verticalDragRange){self.close();}else{var initalPanY=_panOffset.y,initialBgOpacity=_bgOpacity;_animateProp('verticalDrag',0,1,300,framework.easing.cubic.out,function(now){_panOffset.y=(self.currItem.initialPosition.y-initalPanY)*now+initalPanY;_applyBgOpacity((1-initialBgOpacity)*now+initialBgOpacity);_applyCurrentZoomPan();});_shout('onVerticalDrag',1);}
return;}
if((_mainScrollShifted||_mainScrollAnimating)&&numPoints===0){var itemChanged=_finishSwipeMainScrollGesture(gestureType,_releaseAnimData);if(itemChanged){return;}
gestureType='zoomPointerUp';}
if(_mainScrollAnimating){return;}
if(gestureType!=='swipe'){_completeZoomGesture();return;}
if(!_mainScrollShifted&&_currZoomLevel>self.currItem.fitRatio){_completePanGesture(_releaseAnimData);}},_initDragReleaseAnimationData=function(){var lastFlickDuration,tempReleasePos;var s={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(axis){if(_posPoints.length>1){lastFlickDuration=_getCurrentTime()-_gestureCheckSpeedTime+50;tempReleasePos=_posPoints[_posPoints.length-2][axis];}else{lastFlickDuration=_getCurrentTime()-_gestureStartTime;tempReleasePos=_startPoint[axis];}
s.lastFlickOffset[axis]=_currPoint[axis]-tempReleasePos;s.lastFlickDist[axis]=Math.abs(s.lastFlickOffset[axis]);if(s.lastFlickDist[axis]>20){s.lastFlickSpeed[axis]=s.lastFlickOffset[axis]/ lastFlickDuration;}else{s.lastFlickSpeed[axis]=0;}
if(Math.abs(s.lastFlickSpeed[axis])<0.1){s.lastFlickSpeed[axis]=0;}
s.slowDownRatio[axis]=0.95;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];s.speedDecelerationRatio[axis]=1;},calculateOverBoundsAnimOffset:function(axis,speed){if(!s.backAnimStarted[axis]){if(_panOffset[axis]>_currPanBounds.min[axis]){s.backAnimDestination[axis]=_currPanBounds.min[axis];}else if(_panOffset[axis]<_currPanBounds.max[axis]){s.backAnimDestination[axis]=_currPanBounds.max[axis];}
if(s.backAnimDestination[axis]!==undefined){s.slowDownRatio[axis]=0.7;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];if(s.speedDecelerationRatioAbs[axis]<0.05){s.lastFlickSpeed[axis]=0;s.backAnimStarted[axis]=true;_animateProp('bounceZoomPan'+axis,_panOffset[axis],s.backAnimDestination[axis],speed||300,framework.easing.sine.out,function(pos){_panOffset[axis]=pos;_applyCurrentZoomPan();});}}}},calculateAnimOffset:function(axis){if(!s.backAnimStarted[axis]){s.speedDecelerationRatio[axis]=s.speedDecelerationRatio[axis]*(s.slowDownRatio[axis]+
s.slowDownRatioReverse[axis]-
s.slowDownRatioReverse[axis]*s.timeDiff / 10);s.speedDecelerationRatioAbs[axis]=Math.abs(s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]);s.distanceOffset[axis]=s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]*s.timeDiff;_panOffset[axis]+=s.distanceOffset[axis];}},panAnimLoop:function(){if(_animations.zoomPan){_animations.zoomPan.raf=_requestAF(s.panAnimLoop);s.now=_getCurrentTime();s.timeDiff=s.now-s.lastNow;s.lastNow=s.now;s.calculateAnimOffset('x');s.calculateAnimOffset('y');_applyCurrentZoomPan();s.calculateOverBoundsAnimOffset('x');s.calculateOverBoundsAnimOffset('y');if(s.speedDecelerationRatioAbs.x<0.05&&s.speedDecelerationRatioAbs.y<0.05){_panOffset.x=Math.round(_panOffset.x);_panOffset.y=Math.round(_panOffset.y);_applyCurrentZoomPan();_stopAnimation('zoomPan');return;}}}};return s;},_completePanGesture=function(animData){animData.calculateSwipeSpeed('y');_currPanBounds=self.currItem.bounds;animData.backAnimDestination={};animData.backAnimStarted={};if(Math.abs(animData.lastFlickSpeed.x)<=0.05&&Math.abs(animData.lastFlickSpeed.y)<=0.05){animData.speedDecelerationRatioAbs.x=animData.speedDecelerationRatioAbs.y=0;animData.calculateOverBoundsAnimOffset('x');animData.calculateOverBoundsAnimOffset('y');return true;}
_registerStartAnimation('zoomPan');animData.lastNow=_getCurrentTime();animData.panAnimLoop();},_finishSwipeMainScrollGesture=function(gestureType,_releaseAnimData){var itemChanged;if(!_mainScrollAnimating){_currZoomedItemIndex=_currentItemIndex;}
var itemsDiff;if(gestureType==='swipe'){var totalShiftDist=_currPoint.x-_startPoint.x,isFastLastFlick=_releaseAnimData.lastFlickDist.x<10;if(totalShiftDist>MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x>20)){itemsDiff=-1;}else if(totalShiftDist<-MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x<-20)){itemsDiff=1;}}
var nextCircle;if(itemsDiff){_currentItemIndex+=itemsDiff;if(_currentItemIndex<0){_currentItemIndex=_options.loop?_getNumItems()-1:0;nextCircle=true;}else if(_currentItemIndex>=_getNumItems()){_currentItemIndex=_options.loop?0:_getNumItems()-1;nextCircle=true;}
if(!nextCircle||_options.loop){_indexDiff+=itemsDiff;_currPositionIndex-=itemsDiff;itemChanged=true;}}
var animateToX=_slideSize.x*_currPositionIndex;var animateToDist=Math.abs(animateToX-_mainScrollPos.x);var finishAnimDuration;if(!itemChanged&&animateToX>_mainScrollPos.x!==_releaseAnimData.lastFlickSpeed.x>0){finishAnimDuration=333;}else{finishAnimDuration=Math.abs(_releaseAnimData.lastFlickSpeed.x)>0?animateToDist / Math.abs(_releaseAnimData.lastFlickSpeed.x):333;finishAnimDuration=Math.min(finishAnimDuration,400);finishAnimDuration=Math.max(finishAnimDuration,250);}
if(_currZoomedItemIndex===_currentItemIndex){itemChanged=false;}
_mainScrollAnimating=true;_shout('mainScrollAnimStart');_animateProp('mainScroll',_mainScrollPos.x,animateToX,finishAnimDuration,framework.easing.cubic.out,_moveMainScroll,function(){_stopAllAnimations();_mainScrollAnimating=false;_currZoomedItemIndex=-1;if(itemChanged||_currZoomedItemIndex!==_currentItemIndex){self.updateCurrItem();}
_shout('mainScrollAnimComplete');});if(itemChanged){self.updateCurrItem(true);}
return itemChanged;},_calculateZoomLevel=function(touchesDistance){return 1 / _startPointsDistance*touchesDistance*_startZoomLevel;},_completeZoomGesture=function(){var destZoomLevel=_currZoomLevel,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(_currZoomLevel<minZoomLevel){destZoomLevel=minZoomLevel;}else if(_currZoomLevel>maxZoomLevel){destZoomLevel=maxZoomLevel;}
var destOpacity=1,onUpdate,initialOpacity=_bgOpacity;if(_opacityChanged&&!_isZoomingIn&&!_wasOverInitialZoom&&_currZoomLevel<minZoomLevel){self.close();return true;}
if(_opacityChanged){onUpdate=function(now){_applyBgOpacity((destOpacity-initialOpacity)*now+initialOpacity);};}
self.zoomTo(destZoomLevel,0,200,framework.easing.cubic.out,onUpdate);return true;};_registerModule('Gestures',{publicMethods:{initGestures:function(){var addEventNames=function(pref,down,move,up,cancel){_dragStartEvent=pref+down;_dragMoveEvent=pref+move;_dragEndEvent=pref+up;if(cancel){_dragCancelEvent=pref+cancel;}else{_dragCancelEvent='';}};_pointerEventEnabled=_features.pointerEvent;if(_pointerEventEnabled&&_features.touch){_features.touch=false;}
if(_pointerEventEnabled){if(navigator.msPointerEnabled){addEventNames('MSPointer','Down','Move','Up','Cancel');}else{addEventNames('pointer','down','move','up','cancel');}}else if(_features.touch){addEventNames('touch','start','move','end','cancel');_likelyTouchDevice=true;}else{addEventNames('mouse','down','move','up');}
_upMoveEvents=_dragMoveEvent+' '+_dragEndEvent+' '+_dragCancelEvent;_downEvents=_dragStartEvent;if(_pointerEventEnabled&&!_likelyTouchDevice){_likelyTouchDevice=(navigator.maxTouchPoints>1)||(navigator.msMaxTouchPoints>1);}
self.likelyTouchDevice=_likelyTouchDevice;_globalEventHandlers[_dragStartEvent]=_onDragStart;_globalEventHandlers[_dragMoveEvent]=_onDragMove;_globalEventHandlers[_dragEndEvent]=_onDragRelease;if(_dragCancelEvent){_globalEventHandlers[_dragCancelEvent]=_globalEventHandlers[_dragEndEvent];}
if(_features.touch){_downEvents+=' mousedown';_upMoveEvents+=' mousemove mouseup';_globalEventHandlers.mousedown=_globalEventHandlers[_dragStartEvent];_globalEventHandlers.mousemove=_globalEventHandlers[_dragMoveEvent];_globalEventHandlers.mouseup=_globalEventHandlers[_dragEndEvent];}
if(!_likelyTouchDevice){_options.allowPanToNext=false;}}}});var _showOrHideTimeout,_showOrHide=function(item,img,out,completeFn){if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);}
_initialZoomRunning=true;_initialContentSet=true;var thumbBounds;if(item.initialLayout){thumbBounds=item.initialLayout;item.initialLayout=null;}else{thumbBounds=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);}
var duration=out?_options.hideAnimationDuration:_options.showAnimationDuration;var onComplete=function(){_stopAnimation('initialZoom');if(!out){_applyBgOpacity(1);if(img){img.style.display='block';}
framework.addClass(template,'pswp--animated-in');_shout('initialZoom'+(out?'OutEnd':'InEnd'));}else{self.template.removeAttribute('style');self.bg.removeAttribute('style');}
if(completeFn){completeFn();}
_initialZoomRunning=false;};if(!duration||!thumbBounds||thumbBounds.x===undefined){_shout('initialZoom'+(out?'Out':'In'));_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();template.style.opacity=out?0:1;_applyBgOpacity(1);if(duration){setTimeout(function(){onComplete();},duration);}else{onComplete();}
return;}
var startAnimation=function(){var closeWithRaf=_closedByScroll,fadeEverything=!self.currItem.src||self.currItem.loadError||_options.showHideOpacity;if(item.miniImg){item.miniImg.style.webkitBackfaceVisibility='hidden';}
if(!out){_currZoomLevel=thumbBounds.w / item.w;_panOffset.x=thumbBounds.x;_panOffset.y=thumbBounds.y-_initalWindowScrollY;self[fadeEverything?'template':'bg'].style.opacity=0.001;_applyCurrentZoomPan();}
_registerStartAnimation('initialZoom');if(out&&!closeWithRaf){framework.removeClass(template,'pswp--animated-in');}
if(fadeEverything){if(out){framework[(closeWithRaf?'remove':'add')+'Class'](template,'pswp--animate_opacity');}else{setTimeout(function(){framework.addClass(template,'pswp--animate_opacity');},30);}}
_showOrHideTimeout=setTimeout(function(){_shout('initialZoom'+(out?'Out':'In'));if(!out){_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();_applyBgOpacity(1);if(fadeEverything){template.style.opacity=1;}else{_applyBgOpacity(1);}
_showOrHideTimeout=setTimeout(onComplete,duration+20);}else{var destZoomLevel=thumbBounds.w / item.w,initialPanOffset={x:_panOffset.x,y:_panOffset.y},initialZoomLevel=_currZoomLevel,initalBgOpacity=_bgOpacity,onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=thumbBounds.x;_panOffset.y=thumbBounds.y-_currentWindowScrollY;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(thumbBounds.x-initialPanOffset.x)*now+initialPanOffset.x;_panOffset.y=(thumbBounds.y-_currentWindowScrollY-initialPanOffset.y)*now+initialPanOffset.y;}
_applyCurrentZoomPan();if(fadeEverything){template.style.opacity=1-now;}else{_applyBgOpacity(initalBgOpacity-now*initalBgOpacity);}};if(closeWithRaf){_animateProp('initialZoom',0,1,duration,framework.easing.cubic.out,onUpdate,onComplete);}else{onUpdate(1);_showOrHideTimeout=setTimeout(onComplete,duration+20);}}},out?25:90);};startAnimation();};var _items,_tempPanAreaSize={},_imagesToAppendPool=[],_initialContentSet,_initialZoomRunning,_controllerDefaultOptions={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:false,preload:[1,1],getNumItemsFn:function(){return _items.length;}};var _getItemAt,_getNumItems,_initialIsLoop,_getZeroBounds=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}};},_calculateSingleItemPanBounds=function(item,realPanElementW,realPanElementH){var bounds=item.bounds;bounds.center.x=Math.round((_tempPanAreaSize.x-realPanElementW)/ 2);bounds.center.y=Math.round((_tempPanAreaSize.y-realPanElementH)/ 2)+item.vGap.top;bounds.max.x=(realPanElementW>_tempPanAreaSize.x)?Math.round(_tempPanAreaSize.x-realPanElementW):bounds.center.x;bounds.max.y=(realPanElementH>_tempPanAreaSize.y)?Math.round(_tempPanAreaSize.y-realPanElementH)+item.vGap.top:bounds.center.y;bounds.min.x=(realPanElementW>_tempPanAreaSize.x)?0:bounds.center.x;bounds.min.y=(realPanElementH>_tempPanAreaSize.y)?item.vGap.top:bounds.center.y;},_calculateItemSize=function(item,viewportSize,zoomLevel){if(item.src&&!item.loadError){var isInitial=!zoomLevel;if(isInitial){if(!item.vGap){item.vGap={top:0,bottom:0};}
_shout('parseVerticalMargin',item);}
_tempPanAreaSize.x=viewportSize.x;_tempPanAreaSize.y=viewportSize.y-item.vGap.top-item.vGap.bottom;if(isInitial){var hRatio=_tempPanAreaSize.x / item.w;var vRatio=_tempPanAreaSize.y / item.h;item.fitRatio=hRatio<vRatio?hRatio:vRatio;var scaleMode=_options.scaleMode;if(scaleMode==='orig'){zoomLevel=1;}else if(scaleMode==='fit'){zoomLevel=item.fitRatio;}
if(zoomLevel>1){zoomLevel=1;}
item.initialZoomLevel=zoomLevel;if(!item.bounds){item.bounds=_getZeroBounds();}}
if(!zoomLevel){return;}
_calculateSingleItemPanBounds(item,item.w*zoomLevel,item.h*zoomLevel);if(isInitial&&zoomLevel===item.initialZoomLevel){item.initialPosition=item.bounds.center;}
return item.bounds;}else{item.w=item.h=0;item.initialZoomLevel=item.fitRatio=1;item.bounds=_getZeroBounds();item.initialPosition=item.bounds.center;return item.bounds;}},_appendImage=function(index,item,baseDiv,img,preventAnimation,keepPlaceholder){if(item.loadError){return;}
if(img){item.imageAppended=true;_setImageSize(item,img,(item===self.currItem&&_renderMaxResolution));baseDiv.appendChild(img);if(keepPlaceholder){setTimeout(function(){if(item&&item.loaded&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}},500);}}},_createImage=function(item,classes,onload,onerror){var img=framework.createEl(classes,'img');if(onload)img.onload=onload;if(onerror)img.onerror=onerror;img.src=item.src;return img;},_preloadImage=function(item){var onComplete=function(){item.loading=false;item.loaded=true;if(item.loadComplete){item.loadComplete(item);}else{item.img=null;}};var onError=function(){item.loadError=true;onComplete();};item.loading=true;item.loaded=false;item.img=_createImage(item,'pswp__img',onComplete,onError);return item.img;},_checkForError=function(item,cleanUp){if(item.src&&item.loadError&&item.container){if(cleanUp){item.container.innerHTML='';}
item.container.innerHTML=_options.errorMsg.replace('%url%',item.src);return true;}},_setImageSize=function(item,img,maxRes){if(!item.src){return;}
if(!img){img=item.container.lastChild;}
var w=maxRes?item.w:Math.round(item.w*item.fitRatio),h=maxRes?item.h:Math.round(item.h*item.fitRatio);if(item.placeholder&&!item.loaded){item.placeholder.style.width=w+'px';item.placeholder.style.height=h+'px';}
img.style.width=w+'px';img.style.height=h+'px';},_appendImagesPool=function(){if(_imagesToAppendPool.length){var poolItem;for(var i=0;i<_imagesToAppendPool.length;i++){poolItem=_imagesToAppendPool[i];if(poolItem.holder.index===poolItem.index){_appendImage(poolItem.index,poolItem.item,poolItem.baseDiv,poolItem.img,false,poolItem.clearPlaceholder);}}
_imagesToAppendPool=[];}};_registerModule('Controller',{publicMethods:{lazyLoadItem:function(index){index=_getLoopedId(index);var item=_getItemAt(index);if(!item||((item.loaded||item.loading)&&!_itemsNeedUpdate)){return;}
_shout('gettingData',index,item);if(!item.src){return;}
_preloadImage(item);},initController:function(){framework.extend(_options,_controllerDefaultOptions,true);self.items=_items=items;_getItemAt=self.getItemAt;_getNumItems=_options.getNumItemsFn;_initialIsLoop=_options.loop;if(_getNumItems()<3){_options.loop=false;}
_listen('beforeChange',function(diff){var p=_options.preload,isNext=diff===null?true:(diff>=0),preloadBefore=Math.min(p[0],_getNumItems()),preloadAfter=Math.min(p[1],_getNumItems()),i;for(i=1;i<=(isNext?preloadAfter:preloadBefore);i++){self.lazyLoadItem(_currentItemIndex+i);}
for(i=1;i<=(isNext?preloadBefore:preloadAfter);i++){self.lazyLoadItem(_currentItemIndex-i);}});_listen('initialLayout',function(){self.currItem.initialLayout=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);});_listen('mainScrollAnimComplete',_appendImagesPool);_listen('initialZoomInEnd',_appendImagesPool);_listen('destroy',function(){var item;for(var i=0;i<_items.length;i++){item=_items[i];if(item.container){item.container=null;}
if(item.placeholder){item.placeholder=null;}
if(item.img){item.img=null;}
if(item.preloader){item.preloader=null;}
if(item.loadError){item.loaded=item.loadError=false;}}
_imagesToAppendPool=null;});},getItemAt:function(index){if(index>=0){return _items[index]!==undefined?_items[index]:false;}
return false;},allowProgressiveImg:function(){return _options.forceProgressiveLoading||!_likelyTouchDevice||_options.mouseUsed||screen.width>1200;},setContent:function(holder,index){if(_options.loop){index=_getLoopedId(index);}
var prevItem=self.getItemAt(holder.index);if(prevItem){prevItem.container=null;}
var item=self.getItemAt(index),img;if(!item){holder.el.innerHTML='';return;}
_shout('gettingData',index,item);holder.index=index;holder.item=item;var wrapper=framework.createEl('pswp__zoom-wrap');var baseDiv=item.container=wrapper;if(!item.src&&item.html){if(item.html.tagName){baseDiv.appendChild(item.html);}else{baseDiv.innerHTML=item.html;}}
_checkForError(item);_calculateItemSize(item,_viewportSize);if(item.src&&!item.loadError&&!item.loaded){item.loadComplete=function(item){if(!_isOpen){return;}
if(holder&&holder.index===index){if(_checkForError(item,true)){item.loadComplete=item.img=null;_calculateItemSize(item,_viewportSize);_applyZoomPanToItem(item);if(holder.index===_currentItemIndex){self.updateCurrZoomItem();}
return;}
if(!item.imageAppended){if(_features.transform&&(_mainScrollAnimating||_initialZoomRunning)){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder,clearPlaceholder:true});}else{_appendImage(index,item,baseDiv,item.img,_mainScrollAnimating||_initialZoomRunning,true);}}else{if(!_initialZoomRunning&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}}}
item.loadComplete=null;item.img=null;_shout('imageLoadComplete',index,item);};if(framework.features.transform){var placeholderClassName='pswp__img pswp__img--placeholder';placeholderClassName+=(item.msrc?'':' pswp__img--placeholder--blank');var placeholder=framework.createEl(placeholderClassName,item.msrc?'img':'');if(item.msrc){placeholder.src=item.msrc;}
_setImageSize(item,placeholder);baseDiv.appendChild(placeholder);item.placeholder=placeholder;}
if(!item.loading){_preloadImage(item);}
if(self.allowProgressiveImg()){if(!_initialContentSet&&_features.transform){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder});}else{_appendImage(index,item,baseDiv,item.img,true,true);}}}else if(item.src&&!item.loadError){img=_createImage(item,'pswp__img');img.style.opacity=1;_setImageSize(item,img);_appendImage(index,item,baseDiv,img,true);}
if(!_initialContentSet&&index===_currentItemIndex){_currZoomElementStyle=baseDiv.style;_showOrHide(item,(img||item.img));}else{_applyZoomPanToItem(item);}
holder.el.innerHTML='';holder.el.appendChild(baseDiv);},cleanSlide:function(item){if(item.img){item.img.onload=item.img.onerror=null;}
item.loaded=item.loading=item.img=item.imageAppended=false;},setCustomMedia:function(custom){_createImage=custom;}}});var tapTimer,tapReleasePoint={},_dispatchTapEvent=function(origEvent,releasePoint,pointerType){var e=document.createEvent('CustomEvent'),eDetail={origEvent:origEvent,target:origEvent.target,releasePoint:releasePoint,pointerType:pointerType||'touch'};e.initCustomEvent('pswpTap',true,true,eDetail);origEvent.target.dispatchEvent(e);};_registerModule('Tap',{publicMethods:{initTap:function(){_listen('firstTouchStart',self.onTapStart);_listen('touchRelease',self.onTapRelease);_listen('destroy',function(){tapReleasePoint={};tapTimer=null;});},onTapStart:function(touchList){if(touchList.length>1){clearTimeout(tapTimer);tapTimer=null;}},onTapRelease:function(e,releasePoint){if(!releasePoint){return;}
if(!_moved&&!_isMultitouch&&!_numAnimations){var p0=releasePoint;if(tapTimer){clearTimeout(tapTimer);tapTimer=null;if(_isNearbyPoints(p0,tapReleasePoint)){_shout('doubleTap',p0);return;}}
if(releasePoint.type==='mouse'){_dispatchTapEvent(e,releasePoint,'mouse');return;}
var clickedTagName=e.target.tagName.toUpperCase();if(clickedTagName==='BUTTON'||framework.hasClass(e.target,'pswp__single-tap')){_dispatchTapEvent(e,releasePoint);return;}
_equalizePoints(tapReleasePoint,p0);tapTimer=setTimeout(function(){_dispatchTapEvent(e,releasePoint);tapTimer=null;},300);}}}});var _wheelDelta;_registerModule('DesktopZoom',{publicMethods:{initDesktopZoom:function(){if(_oldIE){return;}
if(_likelyTouchDevice){_listen('mouseUsed',function(){self.setupDesktopZoom();});}else{self.setupDesktopZoom(true);}},setupDesktopZoom:function(onInit){_wheelDelta={};var events='wheel mousewheel DOMMouseScroll';_listen('bindEvents',function(){framework.bind(template,events,self.handleMouseWheel);});_listen('unbindEvents',function(){if(_wheelDelta){framework.unbind(template,events,self.handleMouseWheel);}});self.mouseZoomedIn=false;var hasDraggingClass,updateZoomable=function(){if(self.mouseZoomedIn){framework.removeClass(template,'pswp--zoomed-in');self.mouseZoomedIn=false;}
if(_currZoomLevel<1){framework.addClass(template,'pswp--zoom-allowed');}else{framework.removeClass(template,'pswp--zoom-allowed');}
removeDraggingClass();},removeDraggingClass=function(){if(hasDraggingClass){framework.removeClass(template,'pswp--dragging');hasDraggingClass=false;}};_listen('resize',updateZoomable);_listen('afterChange',updateZoomable);_listen('pointerDown',function(){if(self.mouseZoomedIn){hasDraggingClass=true;framework.addClass(template,'pswp--dragging');}});_listen('pointerUp',removeDraggingClass);if(!onInit){updateZoomable();}},handleMouseWheel:function(e){if(_currZoomLevel<=self.currItem.fitRatio){if(_options.modal){if(!_options.closeOnScroll||_numAnimations||_isDragging){e.preventDefault();}else if(_transformKey&&Math.abs(e.deltaY)>2){_closedByScroll=true;self.close();}}
return true;}
e.stopPropagation();_wheelDelta.x=0;if('deltaX'in e){if(e.deltaMode===1){_wheelDelta.x=e.deltaX*18;_wheelDelta.y=e.deltaY*18;}else{_wheelDelta.x=e.deltaX;_wheelDelta.y=e.deltaY;}}else if('wheelDelta'in e){if(e.wheelDeltaX){_wheelDelta.x=-0.16*e.wheelDeltaX;}
if(e.wheelDeltaY){_wheelDelta.y=-0.16*e.wheelDeltaY;}else{_wheelDelta.y=-0.16*e.wheelDelta;}}else if('detail'in e){_wheelDelta.y=e.detail;}else{return;}
_calculatePanBounds(_currZoomLevel,true);var newPanX=_panOffset.x-_wheelDelta.x,newPanY=_panOffset.y-_wheelDelta.y;if(_options.modal||(newPanX<=_currPanBounds.min.x&&newPanX>=_currPanBounds.max.x&&newPanY<=_currPanBounds.min.y&&newPanY>=_currPanBounds.max.y)){e.preventDefault();}
self.panTo(newPanX,newPanY);},toggleDesktopZoom:function(centerPoint){centerPoint=centerPoint||{x:_viewportSize.x/2+_offset.x,y:_viewportSize.y/2+_offset.y};var doubleTapZoomLevel=_options.getDoubleTapZoom(true,self.currItem);var zoomOut=_currZoomLevel===doubleTapZoomLevel;self.mouseZoomedIn=!zoomOut;self.zoomTo(zoomOut?self.currItem.initialZoomLevel:doubleTapZoomLevel,centerPoint,333);framework[(!zoomOut?'add':'remove')+'Class'](template,'pswp--zoomed-in');}}});var _historyDefaultOptions={history:true,galleryUID:1};var _historyUpdateTimeout,_hashChangeTimeout,_hashAnimCheckTimeout,_hashChangedByScript,_hashChangedByHistory,_hashReseted,_initialHash,_historyChanged,_closedFromURL,_urlChangedOnce,_windowLoc,_supportsPushState,_getHash=function(){return _windowLoc.hash.substring(1);},_cleanHistoryTimeouts=function(){if(_historyUpdateTimeout){clearTimeout(_historyUpdateTimeout);}
if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);}},_parseItemIndexFromURL=function(){var hash=_getHash(),params={};if(hash.length<5){return params;}
var i,vars=hash.split('&');for(i=0;i<vars.length;i++){if(!vars[i]){continue;}
var pair=vars[i].split('=');if(pair.length<2){continue;}
params[pair[0]]=pair[1];}
if(_options.galleryPIDs){var searchfor=params.pid;params.pid=0;for(i=0;i<_items.length;i++){if(_items[i].pid===searchfor){params.pid=i;break;}}}else{params.pid=parseInt(params.pid,10)-1;}
if(params.pid<0){params.pid=0;}
return params;},_updateHash=function(){if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);}
if(_numAnimations||_isDragging){_hashAnimCheckTimeout=setTimeout(_updateHash,500);return;}
if(_hashChangedByScript){clearTimeout(_hashChangeTimeout);}else{_hashChangedByScript=true;}
var pid=(_currentItemIndex+1);var item=_getItemAt(_currentItemIndex);if(item.hasOwnProperty('pid')){pid=item.pid;}
var newHash=_initialHash+'&'+'gid='+_options.galleryUID+'&'+'pid='+pid;if(!_historyChanged){if(_windowLoc.hash.indexOf(newHash)===-1){_urlChangedOnce=true;}}
var newURL=_windowLoc.href.split('#')[0]+'#'+newHash;if(_supportsPushState){if('#'+newHash!==window.location.hash){history[_historyChanged?'replaceState':'pushState']('',document.title,newURL);}}else{if(_historyChanged){_windowLoc.replace(newURL);}else{_windowLoc.hash=newHash;}}
_historyChanged=true;_hashChangeTimeout=setTimeout(function(){_hashChangedByScript=false;},60);};_registerModule('History',{publicMethods:{initHistory:function(){framework.extend(_options,_historyDefaultOptions,true);if(!_options.history){return;}
_windowLoc=window.location;_urlChangedOnce=false;_closedFromURL=false;_historyChanged=false;_initialHash=_getHash();_supportsPushState=('pushState'in history);if(_initialHash.indexOf('gid=')>-1){_initialHash=_initialHash.split('&gid=')[0];_initialHash=_initialHash.split('?gid=')[0];}
_listen('afterChange',self.updateURL);_listen('unbindEvents',function(){framework.unbind(window,'hashchange',self.onHashChange);});var returnToOriginal=function(){_hashReseted=true;if(!_closedFromURL){if(_urlChangedOnce){history.back();}else{if(_initialHash){_windowLoc.hash=_initialHash;}else{if(_supportsPushState){history.pushState('',document.title,_windowLoc.pathname+_windowLoc.search);}else{_windowLoc.hash='';}}}}
_cleanHistoryTimeouts();};_listen('unbindEvents',function(){if(_closedByScroll){returnToOriginal();}});_listen('destroy',function(){if(!_hashReseted){returnToOriginal();}});_listen('firstUpdate',function(){_currentItemIndex=_parseItemIndexFromURL().pid;});var index=_initialHash.indexOf('pid=');if(index>-1){_initialHash=_initialHash.substring(0,index);if(_initialHash.slice(-1)==='&'){_initialHash=_initialHash.slice(0,-1);}}
setTimeout(function(){if(_isOpen){framework.bind(window,'hashchange',self.onHashChange);}},40);},onHashChange:function(){if(_getHash()===_initialHash){_closedFromURL=true;self.close();return;}
if(!_hashChangedByScript){_hashChangedByHistory=true;self.goTo(_parseItemIndexFromURL().pid);_hashChangedByHistory=false;}},updateURL:function(){_cleanHistoryTimeouts();if(_hashChangedByHistory){return;}
if(!_historyChanged){_updateHash();}else{_historyUpdateTimeout=setTimeout(_updateHash,800);}}}});framework.extend(self,publicMethods);};return PhotoSwipe;});
/*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08
* http://photoswipe.com
* Copyright (c) 2019 Dmitry Semenov; */!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g<S.length;g++)c=S[g],c.onTap&&f.indexOf("pswp__"+c.name)>-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!!c.href&&(!!c.hasAttribute("download")||(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1))},H=function(){for(var a,b,c,d,e,f="",g=0;g<q.shareButtons.length;g++)a=q.shareButtons[g],c=q.getImageURLForShare(a),d=q.getPageURLForShare(a),e=q.getTextForShare(a),b=a.url.replace("{{url}}",encodeURIComponent(d)).replace("{{image_url}}",encodeURIComponent(c)).replace("{{raw_image_url}}",c).replace("{{text}}",encodeURIComponent(e)),f+='<a href="'+b+'" target="_blank" class="pswp__share--'+a.id+'"'+(a.download?"download":"")+">"+a.label+"</a>",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c<q.closeElClasses.length;c++)if(b.hasClass(a,"pswp__"+q.closeElClasses[c]))return!0},J=0,K=function(){clearTimeout(u),J=0,k&&v.setIdle(!1)},L=function(a){a=a?a:window.event;var b=a.relatedTarget||a.toElement;b&&"HTML"!==b.nodeName||(clearTimeout(u),u=setTimeout(function(){v.setIdle(!0)},q.timeToIdleOutside))},M=function(){q.fullscreenEl&&!b.features.isOldAndroid&&(c||(c=v.getFullscreenAPI()),c?(b.bind(document,c.eventK,v.updateFullscreen),v.updateFullscreen(),b.addClass(a.template,"pswp--supports-fs")):b.removeClass(a.template,"pswp--supports-fs"))},N=function(){q.preloaderEl&&(O(!0),l("beforeChange",function(){clearTimeout(o),o=setTimeout(function(){a.currItem&&a.currItem.loading?(!a.allowProgressiveImg()||a.currItem.img&&!a.currItem.img.naturalWidth)&&O(!1):O(!0)},q.loadingIndicatorDelay)}),l("imageLoadComplete",function(b,c){a.currItem===c&&O(!0)}))},O=function(a){n!==a&&(C(m,"preloader--active",!a),n=a)},P=function(a){var c=a.vGap;if(B()){var g=q.barsSize;if(q.captionEl&&"auto"===g.bottom)if(f||(f=b.createEl("pswp__caption pswp__caption--fake"),f.appendChild(b.createEl("pswp__caption__center")),d.insertBefore(f,e),b.addClass(d,"pswp__ui--fit")),q.addCaptionHTMLFn(a,f,!0)){var h=f.clientHeight;c.bottom=parseInt(h,10)||44}else c.bottom=g.top;else c.bottom="auto"===g.bottom?0:g.bottom;c.top=g.top}else c.top=c.bottom=0},Q=function(){q.timeToIdle&&l("mouseUsed",function(){b.bind(document,"mousemove",K),b.bind(document,"mouseout",L),t=setInterval(function(){J++,2===J&&v.setIdle(!0)},q.timeToIdle/2)})},R=function(){l("onVerticalDrag",function(a){x&&a<.95?v.hideControls():!x&&a>=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&b<.9?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){a=!1,a&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;g<f;g++){a=d[g],c=a.className;for(var h=0;h<S.length;h++)e=S[h],c.indexOf("pswp__"+e.name)>-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}};return a});"use strict";function MediaSwipe(element,options,items,params){var log=function(img,str,param){if(debug){if(param)console.log(img.id+' '+str,param);else console.log(img.id+' '+str);}};var createElement=function(item,type,prefix,classes,params){var img=pswp.framework.createEl(classes,type);img.id=prefix+'-'+(1+pswp.items.indexOf(item));if(params){for(var prop in params){img[prop]=params[prop];}}
return img;};var createImage=function(item,classes,onload,onerror){classes+=' no-long-press';var img=createElement(item,'img','image',classes);if((item.w<1)||(item.h<1)){var photo=null;photo=new Image();photo.onload=function(){item.w=photo.width;item.h=photo.height;log(img,'Dynamic size '+item.w+'x'+item.h);pswp.updateSize();};photo.onerror=function(){log(img,'Load error');};photo.src=item.src;}else{log(img,'Size '+item.w+'x'+item.h);}
if(onload)img.onload=onload;if(onerror)img.onerror=onerror;img.src=item.src;this.img=img;};var createYouTubeVideo=function(item,classes,onload,onerror){var img=createElement(item,'iframe','youtube',classes,{type:'text/html',frameborder:0,height:item.h,width:item.w});var player=null;img.onload=function(){var onPlayerReady=function(event){log(img,'Ready');if((pswp.currItem.content)&&(item===pswp.currItem))pswp.currItem.content.start();};var onPlayerStateChange=function(event){var label="Unknown state";switch(event.data){case-1:label="Not started";break;case 0:label="Stopped";break;case 1:label="Reading";break;case 2:label="Paused";break;case 3:label="Loaded";break;case 5:label="In the queue";break;}
log(img,'State Change ('+label+')');};var onPlayerError=function(event){log(img,'Error');if(onerror)onerror();};player=new YT.Player(img.id,{events:{'onReady':onPlayerReady,'onStateChange':onPlayerStateChange,'onError':onPlayerError}});if(onload)onload();};this.start=function(){if((player)&&(player.playVideo)){try{player.playVideo();}catch(exception){}}};this.stop=function(){if((player)&&(player.pauseVideo)){try{player.pauseVideo();}catch(exception){}}};if(/^(http|https)\:\/\//i.test(item.src)===false){item.src='https://'+item.src;}
img.src=item.src+'?enablejsapi=1&origin='+window.location.origin+'&autohide=1&controls=1&modestbranding=1';this.img=img;};var createVideo=function(item,classes,onload,onerror){classes+=' pswp_video no-long-press';var img=createElement(item,'video','video',classes,{preload:'auto',controls:1,controlsList:"nodownload"});img.oncanplay=function(){log(img,'Player ready');if((item.w<1)||(item.h<1)){item.w=img.videoWidth;item.h=img.videoHeight;log(img,'Dynamic size '+item.w+'x'+item.h);pswp.updateSize();}else{log(img,'Size '+item.w+'x'+item.h);}
if(onload)setTimeout(function(){onload();},500);};img.onerror=function(){log(img,'Error');if(onerror)onerror();};this.start=function(){img.play();};this.stop=function(){img.pause();};img.src=item.src;this.img=img;};var createAudio=function(item,classes,onload,onerror){classes+=' pswp_audio no-long-press';var img=createElement(item,'audio','audio',classes,{preload:'auto',controls:1,controlsList:"nodownload"});img.oncanplay=function(){log(img,'Player ready');item.w='200';item.h='50';log(img,'Dynamic size '+item.w+'x'+item.h);pswp.updateSize();log(img,'Size '+item.w+'x'+item.h);if(onload)setTimeout(function(){onload();},500);};img.onerror=function(){log(img,'Error');if(onerror)onerror();};this.start=function(){img.play();};this.stop=function(){img.pause();};img.src=item.src;this.img=img;};var execute=function(pos,fct){if(pswp.items.length>(2*(pos-1)+1)){var id=pswp.items.indexOf(pswp.currItem);var idx=[((id+pos)%pswp.items.length),((id+pswp.items.length-pos)%pswp.items.length)];idx.forEach(function(id){if(pswp.items[id].content)fct(id);});}};var start=function(item){if(item.content){log(item.content.img,'Start');item.content.start();}};var stop=function(item){if(item.content){log(item.content.img,'Stop');item.content.stop();}};var clear=function(item){if(item.content){log(item.content.img,'Cleared');item.content=null;}};var _createMedia=function(item,classes,onload,onerror){var media=item.content||null;if(media){log(media.img,'Returned');if(onload)setTimeout(function(){onload();},500);}else{if(/\.(mp4|ogg|webm)$/i.test(item.src)){media=new createVideo(item,classes,onload,onerror);}
else if(/\.(mp3|wav)$/i.test(item.src)){media=new createAudio(item,classes,onload,onerror);}
else{if(/www\.youtube\.com\/embed\//i.test(item.src)){media=new createYouTubeVideo(item,classes,onload,onerror);}else{media=new createImage(item,classes,onload,onerror);}}
if(!media.start)media.start=function(){};if(!media.stop)media.stop=function(){};log(media.img,'Created'+(onload?' with callback':' without callback'));item.content=media;}
return media.img;};this.listen=function(evt,fct){return pswp.listen(evt,fct);};this.init=function(){return pswp.init();};if(debug)console.log('MediaSwipe Starts');var pswp=new PhotoSwipe(element,options,items,params);pswp.setCustomMedia(_createMedia);pswp.listen('close',function(){stop(pswp.currItem);clear(pswp.currItem);execute(1,function(id){clear(pswp.items[id]);});pswp=null;if(debug)console.log('MediaSwipe Closed');});pswp.listen('afterChange',function(param){execute(2,function(id){clear(pswp.items[id]);});execute(1,function(id){stop(pswp.items[id]);});if(!param){let a=pswp.currItem.container.childNodes;start(pswp.currItem);}});}"use strict";var url=new URL(location.href);var debug=0;if(debug)console.log('Debug level '+debug);var mswpScanPage=function(selector,tag='mswp'){if(debug)console.log('Scan page using tag "'+tag+'"');var items=new Array();jQuery(function($){$(selector).find(" a[rel*='"+tag+"']").each(function(){var exp=new RegExp('('+tag+'|\[|\])','g');var rel=$(this).attr('rel').replace(exp,'')||0;if(!items[rel]){if(debug)console.log('Create list '+rel);items[rel]=new Array();}
let width=$(this).attr('width')||0;let height=$(this).attr('height')||0;var idx=items[rel].length;items[rel][idx]={src:this.href,title:this.title,w:width,h:height,html:""};$(this).unbind("click").on('click',function(){if(debug)console.log('Items from list '+rel,items[rel]);var element=document.querySelectorAll('.pswp')[0];let swiperSettings={index:idx,bgOpacity:0.8,showHideOpacity:true,shareEl:false,fullscreenEl:false,captionEl:false,counterEl:true,barsSize:{top:0,bottom:'auto'},maxSpreadZoom:1,};if(appSettings.feed.allow_gallery_zoom===true){swiperSettings.zoomEl=true;}
else{swiperSettings.zoomEl=false;swiperSettings.getDoubleTapZoom=function(isMouseClick,item){return item.initialZoomLevel;};}
var mswp=new MediaSwipe(element,PhotoSwipeUI_Default,items[rel],swiperSettings);mswp.init();return false;});});});};mswpScanPage('.a-swiper','mswp');"use strict";$(function(){});var Lists={state:{listMemberToDelete:null,},showListClearConfirmation:function(){$('#list-clear-dialog').modal('show');},clearList:function(){$.ajax({type:'POST',data:{list_id:listVars.list_id},dataType:'json',url:app.baseUrl+'/my/lists/members/clear',success:function(result){let element=$('*[data-memberuserid="'+Lists.state.listMemberToDelete+'"]');if(result.success){redirect(app.baseUrl+'/my/lists');}
else{launchToast('danger',trans('Error'),result.errors[0]);}},error:function(result){launchToast('danger',trans('Error'),result.responseJSON.message);}});},removeListMember:function(){const requestMethod='DELETE';const requestUrl=app.baseUrl+'/my/lists/members/delete';let data={'list_id':listVars.list_id,'user_id':Lists.state.listMemberToDelete};$('#list-member-delete-dialog').modal('show');$.ajax({type:requestMethod,data:data,dataType:'json',url:requestUrl,success:function(result){if(result.success){let element=$('*[data-memberuserid="'+Lists.state.listMemberToDelete+'"]');launchToast('success',trans('Success'),result.message);$('#list-member-delete-dialog').modal('hide');element.parent().fadeOut(300,function(){$(this).remove();if($('.suggestion-box').length===0){$('.list-wrapper').html(`<p class="pl-0 pt-2">${trans('No profiles available')}</p>`);}});}
else{$('#list-member-delete-dialog').modal('hide');launchToast('danger',trans('Error'),result.message);}},error:function(result){$('#list-member-delete-dialog').modal('hide');launchToast('danger',trans('Error'),result.responseJSON.message);}});},showListMemberRemoveModal:function(member_id){$('#list-member-delete-dialog').modal('show');Lists.state.listMemberToDelete=member_id;},showListAddModal:function(){$('#list-add-user-dialog').modal('show');Lists.initListsCheckboxes();},initListsCheckboxes:function(){let listCheckboxes=$('input[type=checkbox]');listCheckboxes.unbind('click');listCheckboxes.on('click',function(){let type='add';if(!$(this).is(':checked')){type='remove';}
Lists.updateListMember($(this).data('listid'),profileVars.user_id,type);});},updateListMember:function(list_id,user_id,type,showMessages=true){let data={'list_id':list_id,'user_id':user_id};let requestMethod='POST';let requestUrl=app.baseUrl+'/my/lists/members/save';if(type!=='add'){requestMethod='DELETE';requestUrl=app.baseUrl+'/my/lists/members/delete';}
data.returnData=showMessages;let element=$('*[data-listid="'+list_id+'"]');$.ajax({type:requestMethod,data:data,url:requestUrl,success:function(result){if(type==='add'){if(showMessages){$('.lists-wrapper').append(result.data);launchToast('success',trans('Success'),result.message);element.parent().find('.list-subtitle').html(` ${trans_choice('members',result.data.members_count,{number:result.data.members_count.toString()})} - `+` ${trans_choice('posts', result.data.posts_count,{number:result.data.posts_count.toString()})}`);}}
else{if(showMessages){launchToast('success',trans('Success'),result.message);element.parent().find('.list-subtitle').html(` ${trans_choice('members',result.data.members_count,{number:result.data.members_count.toString()})} - `+` ${trans_choice('posts', result.data.posts_count,{number:result.data.posts_count.toString()})}`);}}
if(!showMessages){window.reload();}},error:function(result){let checkInputState=true;if(type==='add'){checkInputState=false;}
element.prop('checked',checkInputState);launchToast('danger',trans('Error'),result.responseJSON.message);}});return true;},postReport:function(user_id,post_id,message_id,stream_id,type,details){$.ajax({type:'POST',data:{user_id,post_id,message_id,stream_id,type,details,},url:app.baseUrl+'/report/content',success:function(){launchToast('success',trans('Success'),trans('Report submitted'));$('#report-user-post').modal('hide');$('#post_report_details').val('');},error:function(result){launchToast('danger',trans('Error'),result.responseJSON.message);}});},showReportBox:function(user_id,post_id=null,message_id=null,stream_id=null){let dialogElement=$('#report-user-post');dialogElement.modal('show');$('.submit-report-button').unbind();$('.submit-report-button').on('click',function(){Lists.postReport(user_id,post_id,message_id,stream_id,$('#reasonExamples').val(),$('#post_report_details').val());});},showListManagementConfirmation:function(type,user_id){let dialogElement=$('#post-lists-management-dialog');dialogElement.modal('show');$('.post-list-management-btn').unbind();if(type==='unfollow'){dialogElement.find('.block-user-label').addClass('d-none');dialogElement.find('.unfollow-user-label').removeClass('d-none');$('.post-list-management-btn').on('click',function(){Lists.manageList(user.lists['following'],user_id,'unfollow');});}
else if(type==='block'){dialogElement.find('.block-user-label').removeClass('d-none');dialogElement.find('.unfollow-user-label').addClass('d-none');$('.post-list-management-btn').on('click',function(){Lists.manageList(user.lists['blocked'],user_id,'block');});}},manageList:function(list_id,user_id,type){let innerType='';switch(type){case'unfollow':innerType='remove';break;case'block':innerType='add';break;}
Lists.updateListMember(list_id,user_id,innerType,false);},removeList:function(){$.ajax({type:'DELETE',data:{'id':listVars.list_id},dataType:'json',url:app.baseUrl+'/my/lists/delete',success:function(result){if(result.success){redirect(app.baseUrl+'/my/lists');}
else{launchToast('danger',trans('Error'),result.errors[0]);}},error:function(result){launchToast('danger',trans('Error'),result.responseJSON.message);}});},showListDeleteConfirmation:function(){$('#list-delete-dialog').modal('show');},showListEditDialog:function(mode){$('#list-update-dialog').modal('show');if(mode==='edit'&&$('#list-name').val().length===0){$('#list-name').val(listVars.name);}},updateList:function(type){let data={'name':$('#list-name').val(),'type':type};if(type==='edit'){data.list_id=listVars.list_id;}
$.ajax({type:'POST',data:data,url:app.baseUrl+'/my/lists/save',success:function(result){if(type==='create'){let listItems=$('.lists-wrapper .list-item');if(listItems.length>=3){listItems.eq(2).after(result.data);listItems.eq(2).after('<hr class="my-2">');}else{$('.lists-wrapper').append('<hr class="my-2">');$('.lists-wrapper').append(result.data);}
$('#list-update-dialog').modal('hide');launchToast('success',trans('Success'),trans('List added')+'.');$('#list-name').val('');}
else{$('.list-name-label').html($('#list-name').val());$('#list-update-dialog').modal('hide');launchToast('success',trans('Success'),trans('List renamed')+'.');}},error:function(result){$.each(result.responseJSON.errors,function(field){if(field==='name'){$('#list-name').addClass('is-invalid');$('#list-name').focus();}});}});},manageFollowsAction:function(userId){$.ajax({type:'POST',data:{user_id:userId,},url:app.baseUrl+'/my/lists/manage/follows',success:function(result){$('.manage-follows-text').text(result.text);window.reload();}});}};"use strict";$(function(){$('#checkout-amount').on('change',function(){$(".credit-payment-provider").css("pointer-events","auto");if(!checkout.checkoutAmountValidation()){return false;}
checkout.paymentData.amount=parseFloat($('#checkout-amount').val());checkout.updatePaymentSummaryData();});$('.checkout-continue-btn').on('click',function(){checkout.initPayment();});$('.custom-control').on('change',function(){$('.error-message').hide();});$('#headingOne').on('click',function(){if($('#headingOne').hasClass('collapsed')){$('.card-header .label-icon').html('<ion-icon name="chevron-up-outline"></ion-icon>');}else{$('.card-header .label-icon').html('<ion-icon name="chevron-down-outline"></ion-icon>');}});$('#checkout-center').on('show.bs.modal',function(e){var postId=$(e.relatedTarget).data('post-id');var recipientId=$(e.relatedTarget).data('recipient-id');var amount=$(e.relatedTarget).data('amount');var type=$(e.relatedTarget).data('type');var username=$(e.relatedTarget).data('username');var firstName=$(e.relatedTarget).data('first-name');var lastName=$(e.relatedTarget).data('last-name');var billingAddress=$(e.relatedTarget).data('billing-address');var name=$(e.relatedTarget).data('name');var avatar=$(e.relatedTarget).data('avatar');var country=$(e.relatedTarget).data('country');var city=$(e.relatedTarget).data('city');var state=$(e.relatedTarget).data('state');var postcode=$(e.relatedTarget).data('postcode');var availableCredit=$(e.relatedTarget).data('available-credit');var streamId=$(e.relatedTarget).data('stream-id');var userMessageId=$(e.relatedTarget).data('message-id');checkout.initiatePaymentData(type,amount,postId,recipientId,firstName,lastName,billingAddress,country,city,state,postcode,availableCredit,streamId,userMessageId);checkout.updateUserDetails(avatar,username,name);checkout.fillCountrySelectOptions();checkout.updatePaymentSummaryData();checkout.prefillBillingDetails();let paymentTitle='';let paymentDescription='';if(type==='tip'||type==='chat-tip'){$('.payment-body .checkout-amount-input').removeClass('d-none');paymentTitle=trans("Send a tip");paymentDescription=trans("Send a tip to this user");checkout.togglePaymentProviders(true,checkout.oneTimePaymentProcessorClasses);}else if(type==='one-month-subscription'||type==='three-months-subscription'||type==='six-months-subscription'||type==='yearly-subscription'){let numberOfMonths=1;let showStripeProvider=!app.stripeRecurringDisabled;let showPaypalProvider=!app.paypalRecurringDisabled;let showCCBillProvider=!app.ccBillRecurringDisabled;let showCreditProvider=!app.localWalletRecurringDisabled;if(showCCBillProvider){if(type==='three-months-subscription'){numberOfMonths=3;}else if(type==='six-months-subscription'){numberOfMonths=6;showCCBillProvider=false;}else if(type==='yearly-subscription'){numberOfMonths=12;showCCBillProvider=false;}}
checkout.togglePaymentProviders(false,checkout.oneTimePaymentProcessorClasses);checkout.togglePaymentProvider(showCCBillProvider,'.ccbill-payment-method');checkout.togglePaymentProvider(showStripeProvider,'.stripe-payment-method');checkout.togglePaymentProvider(showPaypalProvider,'.paypal-payment-method');checkout.togglePaymentProvider(showCreditProvider,'.credit-payment-method');$('.payment-body .checkout-amount-input').addClass('d-none');paymentTitle=trans(type);let subscriptionInterval=trans_choice('months',numberOfMonths,{'number':numberOfMonths});let key=app.currencyPosition==='left'?'Subscribe to':'Subscribe to rightAligned';paymentDescription=trans(key,{'amount':amount,'currency':app.currencySymbol,'username':name,'subscription_interval':subscriptionInterval});checkout.toggleCryptoPaymentProviders(false);}else if(type==='post-unlock'){$('.payment-body .checkout-amount-input').addClass('d-none');paymentTitle=trans('Unlock post');paymentDescription=trans('Unlock post for')+' '+getWebsiteFormattedAmount(amount);checkout.togglePaymentProviders(true,checkout.oneTimePaymentProcessorClasses);}else if(type==='stream-access'){$('.payment-body .checkout-amount-input').addClass('d-none');paymentTitle=trans('Join streaming');paymentDescription=trans('Join streaming now for')+' '+getWebsiteFormattedAmount(amount);checkout.togglePaymentProviders(true,checkout.oneTimePaymentProcessorClasses);}else if(type==='message-unlock'){$('.payment-body .checkout-amount-input').addClass('d-none');paymentTitle=trans('Unlock message');paymentDescription=trans('Unlock message for')+' '+getWebsiteFormattedAmount(amount);checkout.togglePaymentProviders(true,checkout.oneTimePaymentProcessorClasses);}
if(paymentTitle!==''||paymentDescription!==''){$('#payment-title').text(paymentTitle);$('.payment-body .payment-description').removeClass('d-none');$('.payment-body .payment-description').text(paymentDescription);}
if(!firstName||!lastName||!billingAddress||!city||!state||!postcode||!country){$('#billingInformation').collapse('show');}else{$('#billingInformation').collapse('hide');}
$('#checkout-amount').val(amount);});$('#checkout-center').on('hidden.bs.modal',function(){$(this).find('#billing-agreement-form').trigger('reset');$('.payment-error').addClass('d-none');});$('.radio-group .radio').on('click',function(){$(this).parent().parent().find('.radio').removeClass('selected');$(this).addClass('selected');$('.payment-error').addClass('d-none');});$('.country-select').on('change',function(){checkout.updatePaymentSummaryData();});});var checkout={allowedPaymentProcessors:['stripe','paypal','credit','coinbase','nowpayments','ccbill','paystack','oxxo','mercado'],paymentData:{},oneTimePaymentProcessorClasses:['.nowpayments-payment-method','.coinbase-payment-method','.ccbill-payment-method','.stripe-payment-method','.paypal-payment-method','.paystack-payment-method','.oxxo-payment-method','.mercado-payment-method','.credit-payment-method'],initiatePaymentData:function(type,amount,post,recipient,firstName,lastName,billingAddress,country,city,state,postcode,availableCredit,streamId,messageId){checkout.paymentData={type:type,amount:amount,post:post,recipient:recipient,firstName:firstName,lastName:lastName,billingAddress:billingAddress,country:country,city:city,state:state,postcode:postcode,availableCredit:availableCredit,stream:streamId,messageId:messageId};},updatePaymentForm:function(){$('#payment-type').val(checkout.paymentData.type);$('#post').val(checkout.paymentData.post);$('#recipient').val(checkout.paymentData.recipient);$('#provider').val(checkout.paymentData.provider);$('#paymentFirstName').val(checkout.paymentData.firstName);$('#paymentLastName').val(checkout.paymentData.lastName);$('#paymentBillingAddress').val(checkout.paymentData.billingAddress);$('#paymentCountry').val(checkout.paymentData.country);$('#paymentState').val(checkout.paymentData.state);$('#paymentPostcode').val(checkout.paymentData.postcode);$('#paymentCity').val(checkout.paymentData.city);$('#payment-deposit-amount').val(checkout.paymentData.totalAmount);$('#paymentTaxes').val(JSON.stringify(checkout.paymentData.taxes));$('#stream').val(checkout.paymentData.stream);$('#userMessage').val(checkout.paymentData.messageId);},stripe:null,initPayment:function(){if(!checkout.checkoutAmountValidation()){return false;}
let processor=checkout.getSelectedPaymentMethod();if(!processor){$('.payment-error').removeClass('d-none');}
if(processor){$('.paymentProcessorError').hide();$('.error-message').hide();if(checkout.allowedPaymentProcessors.includes(processor)){checkout.updatePaymentForm();$('.checkout-continue-btn .spinner-border').removeClass('d-none');checkout.validateAllFields(()=>{$('.payment-button').trigger('click');});}}},validateAllFields:function(callback){checkout.clearFormErrors();$.ajax({type:'POST',data:$('#pp-buyItem').serialize(),url:app.baseUrl+'/payment/initiate/validate',success:function(){callback();},error:function(result){$('.checkout-continue-btn .spinner-border').addClass('d-none');if(result.status===500){launchToast('danger',trans('Error'),result.responseJSON.message);}
$.each(result.responseJSON.errors,function(field,error){let fieldElement=$('.uifield-'+field);fieldElement.addClass('is-invalid');fieldElement.parent().append(`
                            <span class="invalid-feedback" role="alert">
                                <strong>${error}</strong>
                            </span>
                        `);});}});},clearFormErrors:function(){$('.invalid-feedback').remove();$('input').removeClass('is-invalid');},getSelectedPaymentMethod:function(){const paypalProvider=$('.paypal-payment-provider').hasClass('selected');const stripeProvider=$('.stripe-payment-provider').hasClass('selected');const creditProvider=$('.credit-payment-provider').hasClass('selected');const coinbaseProvider=$('.coinbase-payment-provider').hasClass('selected');const nowPaymentsProvider=$('.nowpayments-payment-provider').hasClass('selected');const ccbillProvider=$('.ccbill-payment-provider').hasClass('selected');const paystackProvider=$('.paystack-payment-provider').hasClass('selected');const oxxoProvider=$('.oxxo-payment-provider').hasClass('selected');const mercadoProvider=$('.mercado-payment-provider').hasClass('selected');let val=null;if(paypalProvider){val='paypal';}else if(stripeProvider){val='stripe';}else if(creditProvider){val='credit';}else if(coinbaseProvider){val='coinbase';}else if(nowPaymentsProvider){val='nowpayments';}else if(ccbillProvider){val='ccbill';}else if(paystackProvider){val='paystack';}else if(oxxoProvider){val='oxxo';}else if(mercadoProvider){val='mercado';}
if(val){checkout.paymentData.provider=val;return val;}
return false;},checkoutAmountValidation:function(){const checkoutAmount=$('#checkout-amount').val();if(checkout.paymentData.type==='tip'){if((checkoutAmount.length>0&&checkoutAmount>=app.tipMinAmount&&checkoutAmount<=app.tipMaxAmount)){$('#checkout-amount').removeClass('is-invalid');$('#paypal-deposit-amount').val(checkoutAmount);if(checkout.paymentData.availableCredit<checkoutAmount){$(".credit-payment-provider").css("pointer-events","none");}
return true;}else{$('#checkout-amount').addClass('is-invalid');return false;}}
return true;},validateFirstNameField:function(){let firstNameField=$('input[name="firstName"]');checkout.paymentData.firstName=firstNameField.val();},validateLastNameField:function(){let lastNameField=$('input[name="lastName"]');checkout.paymentData.lastName=lastNameField.val();},validateBillingAddressField:function(){let billingAddressField=$('textarea[name="billingAddress"]');checkout.paymentData.billingAddress=billingAddressField.val();},validateCityField:function(){let cityField=$('input[name="billingCity"]');checkout.paymentData.city=cityField.val();},validateStateField:function(){let stateField=$('input[name="billingState"]');checkout.paymentData.state=stateField.val();},validatePostcodeField:function(){let postcodeField=$('input[name="billingPostcode"]');checkout.paymentData.postcode=postcodeField.val();},validateCountryField:function(){let countryField=$('.country-select');let countryValidation=$('.country-select').find(':selected').val().length;let selectedCountry=$('.country-select').find(':selected');if(countryValidation){countryField.removeClass('is-invalid');checkout.paymentData.country=selectedCountry.text();}
else{checkout.paymentData.country='';}},prefillBillingDetails:function(){$('input[name="firstName"]').val(checkout.paymentData.firstName);$('input[name="lastName"]').val(checkout.paymentData.lastName);$('input[name="billingCity"]').val(checkout.paymentData.city);$('input[name="billingState"]').val(checkout.paymentData.state);$('input[name="billingPostcode"]').val(checkout.paymentData.postcode);$('textarea[name="billingAddress"]').val(checkout.paymentData.billingAddress);},updateUserDetails:function(userAvatar,username,name){$('.payment-body .user-avatar').attr('src',userAvatar);$('.payment-body .name').text(name);$('.payment-body .username').text('@'+username);},fillCountrySelectOptions:function(){$.ajax({type:'GET',url:app.baseUrl+'/countries',success:function(result){if(result!==null&&typeof result.countries!=='undefined'&&result.countries.length>0){$('.country-select').find('option').remove().end().append('<option value="">'+trans("Select a country")+'</option>');$.each(result.countries,function(i,item){let selected=checkout.paymentData.country!==null&&checkout.paymentData.country===item.name;$('.country-select').append($('<option>',{value:item.id,text:item.name,selected:selected}).data({taxes:item.taxes}));if(selected){checkout.updatePaymentSummaryData();}});}}});},updatePaymentSummaryData:function(){let subtotalAmount=typeof checkout.paymentData.amount!=='undefined'?parseFloat(checkout.paymentData.amount):0.00;let countryInclusiveTaxesPercentage=0.00;let countryExclusiveTaxesPercentage=0.00;let taxesAmount=0.00;let totalAmount=subtotalAmount;let inclusiveTaxesAmount=0.00;let exclusiveTaxesAmount=0.00;let fixedTaxesAmount=0.00;checkout.paymentData.totalAmount=subtotalAmount;let taxes=[];$('.taxes-details').html("");let selectedCountry=$('.country-select').find(':selected');if(selectedCountry!==null&&selectedCountry.val()>0){let countryTaxes=selectedCountry.data('taxes');if(countryTaxes!==null){if(countryTaxes.length>0){for(let i=0;i<countryTaxes.length;i++){let countryTaxAmount=0.00;if(countryTaxes[i].type==='exclusive'){countryExclusiveTaxesPercentage+=parseFloat(countryTaxes[i].percentage);taxes.push({countryTaxName:countryTaxes[i].name,type:'exclusive',countryTaxPercentage:parseFloat(countryTaxes[i].percentage),hidden:countryTaxes[i].hidden});}
if(countryTaxes[i].type==='inclusive'){countryInclusiveTaxesPercentage+=parseFloat(countryTaxes[i].percentage);taxes.push({countryTaxAmount:countryTaxAmount,countryTaxName:countryTaxes[i].name,type:'inclusive',countryTaxPercentage:parseFloat(countryTaxes[i].percentage),hidden:countryTaxes[i].hidden});}
if(countryTaxes[i].type==='fixed'){fixedTaxesAmount+=parseFloat(countryTaxes[i].percentage);taxes.push({countryTaxAmount:countryTaxes[i].percentage,countryTaxName:countryTaxes[i].name,type:'fixed',hidden:countryTaxes[i].hidden});}}}}}
let formattedTaxes={data:[],taxesTotalAmount:0.00,subtotal:subtotalAmount.toFixed(2)};if(subtotalAmount>0){for(let j=0;j<taxes.length;j++){let taxAmount=0.00;let inclusiveTaxesAmount=subtotalAmount-subtotalAmount /(1+countryInclusiveTaxesPercentage.toFixed(2)/ 100);if(taxes[j].type==='inclusive'){let countryTaxAmount=subtotalAmount-subtotalAmount /(1+taxes[j].countryTaxPercentage.toFixed(2)/ 100);let remainingFees=inclusiveTaxesAmount-countryTaxAmount;let amountWithoutRemainingFees=subtotalAmount-remainingFees;taxAmount=amountWithoutRemainingFees-amountWithoutRemainingFees /(1+taxes[j].countryTaxPercentage.toFixed(2)/ 100);try{taxAmount=taxAmount.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0];}catch(e){taxAmount=taxAmount.toFixed(2);}}
if(taxes[j].type==='exclusive'){let amountWithInclusiveFeesDeducted=subtotalAmount-inclusiveTaxesAmount;taxAmount=(taxes[j].countryTaxPercentage.toFixed(2)/ 100)*amountWithInclusiveFeesDeducted;taxAmount=taxAmount.toFixed(2);}
if(taxes[j].type==='fixed'){taxAmount=taxes[j].countryTaxAmount;}
formattedTaxes.data.push({taxName:taxes[j].countryTaxName,taxAmount:taxAmount,taxPercentage:taxes[j].countryTaxPercentage,taxType:taxes[j].type});if(!taxes[j].hidden){let item="<div class=\"row ml-2\">\n"+"<span class=\"col-sm left\">"+getTaxDescription(taxes[j].countryTaxName,taxes[j].countryTaxPercentage,taxes[j].type)+"</span>\n"+"<span class=\"country-tax col-sm right text-right\">\n"+"    <b>"+getWebsiteFormattedAmount(taxAmount)+"</b>\n"+"</span>\n"+"</div>";$('.taxes-details').append(item);}}
let subtotal=subtotalAmount;if(countryInclusiveTaxesPercentage>0){inclusiveTaxesAmount=subtotalAmount-subtotalAmount /(1+countryInclusiveTaxesPercentage.toFixed(2)/ 100);if(inclusiveTaxesAmount>0){subtotal=subtotalAmount-inclusiveTaxesAmount;}}
if(countryExclusiveTaxesPercentage>0){exclusiveTaxesAmount=(countryExclusiveTaxesPercentage.toFixed(2)/ 100)*subtotal;totalAmount=totalAmount+exclusiveTaxesAmount;}
if(fixedTaxesAmount>0){totalAmount+=fixedTaxesAmount;}
if(formattedTaxes.data&&formattedTaxes.data.length>0){for(let i=0;i<formattedTaxes.data.length;i++){if(formattedTaxes.data[i]['taxAmount']!==undefined){taxesAmount=taxesAmount+parseFloat(formattedTaxes.data[i]['taxAmount']);}}}
formattedTaxes.taxesTotalAmount=taxesAmount.toFixed(2);checkout.paymentData.totalAmount=totalAmount.toFixed(2);}
checkout.paymentData.taxes=formattedTaxes;$('.available-credit').html('('+getWebsiteFormattedAmount(checkout.paymentData.availableCredit)+')');if(checkout.paymentData.availableCredit<totalAmount){$(".credit-payment-provider").css("pointer-events","none");}
$('.subtotal-amount b').html(getWebsiteFormattedAmount(subtotalAmount.toFixed(2)));$('.total-amount b').html(getWebsiteFormattedAmount(totalAmount.toFixed(2)));},toggleCryptoPaymentProviders:function(toggle){let coinbasePaymentMethod=$('.coinbase-payment-method');let nowPaymentsPaymentMethod=$('.nowpayments-payment-method');if(toggle){if(coinbasePaymentMethod.hasClass('d-none')){coinbasePaymentMethod.removeClass('d-none');}
if(nowPaymentsPaymentMethod.hasClass('d-none')){nowPaymentsPaymentMethod.removeClass('d-none');}}else{if(!coinbasePaymentMethod.hasClass('d-none')){coinbasePaymentMethod.addClass('d-none');}
if(!nowPaymentsPaymentMethod.hasClass('d-none')){nowPaymentsPaymentMethod.addClass('d-none');}}},togglePaymentProvider:function(toggle,paymentMethodClass){let paymentMethod=$(paymentMethodClass);if(toggle){if(paymentMethod.hasClass('d-none')){paymentMethod.removeClass('d-none');}}else{if(!paymentMethod.hasClass('d-none')){paymentMethod.addClass('d-none');}}},togglePaymentProviders:function(toggle,paymentMethodClasses){paymentMethodClasses.forEach(function(paymentMethodClass){checkout.togglePaymentProvider(toggle,paymentMethodClass);});},};
/*!
 * Autolinker.js
 * v4.0.0
 *
 * Copyright(c) 2022 Gregory Jacobs <greg@greg-jacobs.com>
 * MIT License
 *
 * https://github.com/gregjacobs/Autolinker.js
 */!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Autolinker=e()}(this,(function(){"use strict";function t(t){return"boolean"==typeof t}function e(t,e){for(var u=t.length-1;u>=0;u--)t[u]===e&&t.splice(u,1)}function u(t,e){for(var u=t.length-1;u>=0;u--)!0===e(t[u])&&t.splice(u,1)}function n(t){throw new Error("Unhandled case for value: '".concat(t,"'"))}var a=/[A-Za-z]/,r=/[\d]/,s=/\s/,i=/['"]/,o=/[\x00-\x1F\x7F]/,c=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source+/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,h=new RegExp("[".concat(c,"]")),l=function(){function t(t){void 0===t&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return t.prototype.setTagName=function(t){return this.tagName=t,this},t.prototype.getTagName=function(){return this.tagName||""},t.prototype.setAttr=function(t,e){return this.getAttrs()[t]=e,this},t.prototype.getAttr=function(t){return this.getAttrs()[t]},t.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},t.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},t.prototype.setClass=function(t){return this.setAttr("class",t)},t.prototype.addClass=function(t){for(var e,u=this.getClass(),n=u?u.split(s):[],a=t.split(s);e=a.shift();)-1===n.indexOf(e)&&n.push(e);return this.getAttrs().class=n.join(" "),this},t.prototype.removeClass=function(t){for(var e,u=this.getClass(),n=u?u.split(s):[],a=t.split(s);n.length&&(e=a.shift());){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}return this.getAttrs().class=n.join(" "),this},t.prototype.getClass=function(){return this.getAttrs().class||""},t.prototype.hasClass=function(t){return-1!==(" "+this.getClass()+" ").indexOf(" "+t+" ")},t.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},t.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},t.prototype.getInnerHTML=function(){return this.innerHTML||""},t.prototype.getInnerHtml=function(){return this.getInnerHTML()},t.prototype.toAnchorString=function(){var t=this.getTagName(),e=this.buildAttrsStr();return["<",t,e=e?" "+e:"",">",this.getInnerHtml(),"</",t,">"].join("")},t.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),e=[];for(var u in t)t.hasOwnProperty(u)&&e.push(u+'="'+t[u]+'"');return e.join(" ")},t}();var p=function(){function t(t){void 0===t&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return t.prototype.build=function(t){return new l({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},t.prototype.createAttrs=function(t){var e={href:t.getAnchorHref()},u=this.createCssClass(t);return u&&(e.class=u),this.newWindow&&(e.target="_blank",e.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(e.title=t.getAnchorHref()),e},t.prototype.createCssClass=function(t){var e=this.className;if(e){for(var u=[e],n=t.getCssClassSuffixes(),a=0,r=n.length;a<r;a++)u.push(e+"-"+n[a]);return u.join(" ")}return""},t.prototype.processAnchorText=function(t){return t=this.doTruncate(t)},t.prototype.doTruncate=function(t){var e=this.truncate;if(!e||!e.length)return t;var u=e.length,n=e.location;return"smart"===n?function(t,e,u){var n,a;null==u?(u="&hellip;",a=3,n=8):(a=u.length,n=u.length);var r=function(t){var e="";return t.scheme&&t.host&&(e+=t.scheme+"://"),t.host&&(e+=t.host),t.path&&(e+="/"+t.path),t.query&&(e+="?"+t.query),t.fragment&&(e+="#"+t.fragment),e},s=function(t,e){var n=e/2,a=Math.ceil(n),r=-1*Math.floor(n),s="";return r<0&&(s=t.substr(r)),t.substr(0,a)+u+s};if(t.length<=e)return t;var i=e-a,o=function(t){var e={},u=t,n=u.match(/^([a-z]+):\/\//i);return n&&(e.scheme=n[1],u=u.substr(n[0].length)),(n=u.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(e.host=n[1],u=u.substr(n[0].length)),(n=u.match(/^\/(.*?)(?=(\?|#|$))/i))&&(e.path=n[1],u=u.substr(n[0].length)),(n=u.match(/^\?(.*?)(?=(#|$))/i))&&(e.query=n[1],u=u.substr(n[0].length)),(n=u.match(/^#(.*?)$/i))&&(e.fragment=n[1]),e}(t);if(o.query){var c=o.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(o.query=o.query.substr(0,c[1].length),t=r(o))}if(t.length<=e)return t;if(o.host&&(o.host=o.host.replace(/^www\./,""),t=r(o)),t.length<=e)return t;var h="";if(o.host&&(h+=o.host),h.length>=i)return o.host.length==e?(o.host.substr(0,e-a)+u).substr(0,i+n):s(h,i).substr(0,i+n);var l="";if(o.path&&(l+="/"+o.path),o.query&&(l+="?"+o.query),l){if((h+l).length>=i)return(h+l).length==e?(h+l).substr(0,e):(h+s(l,i-h.length)).substr(0,i+n);h+=l}if(o.fragment){var p="#"+o.fragment;if((h+p).length>=i)return(h+p).length==e?(h+p).substr(0,e):(h+s(p,i-h.length)).substr(0,i+n);h+=p}if(o.scheme&&o.host){var f=o.scheme+"://";if((h+f).length<i)return(f+h).substr(0,e)}if(h.length<=e)return h;var g="";return i>0&&(g=h.substr(-1*Math.floor(i/2))),(h.substr(0,Math.ceil(i/2))+u+g).substr(0,i+n)}(t,u):"middle"===n?function(t,e,u){if(t.length<=e)return t;var n,a;null==u?(u="&hellip;",n=8,a=3):(n=u.length,a=u.length);var r=e-a,s="";return r>0&&(s=t.substr(-1*Math.floor(r/2))),(t.substr(0,Math.ceil(r/2))+u+s).substr(0,r+n)}(t,u):function(t,e,u){return function(t,e,u){var n;return t.length>e&&(null==u?(u="&hellip;",n=3):n=u.length,t=t.substring(0,e-n)+u),t}(t,e,u)}(t,u)},t}(),f=function(t,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(t[u]=e[u])},f(t,e)};
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */ function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function u(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(u.prototype=e.prototype,new u)}var d=function(){return d=Object.assign||function(t){for(var e,u=1,n=arguments.length;u<n;u++)for(var a in e=arguments[u])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},d.apply(this,arguments)},m=function(){function t(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return t.prototype.getMatchedText=function(){return this.matchedText},t.prototype.setOffset=function(t){this.offset=t},t.prototype.getOffset=function(){return this.offset},t.prototype.getCssClassSuffixes=function(){return[this.type]},t.prototype.buildTag=function(){return this.tagBuilder.build(this)},t}(),A=new RegExp("^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$"),b=/[\/?#]/,x=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,F=/[?!:,.;^]/,y=/https?:\/\//i,B=new RegExp("^"+y.source,"i"),C=new RegExp(F.source+"$"),v=/^(javascript|vbscript):/i,k=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,w=/^(?:\/\/)?([^/#?:]+)/;function D(t){return a.test(t)}function E(t){return a.test(t)||r.test(t)||"+"===t||"-"===t||"."===t}function T(t){return h.test(t)}function j(t){return"_"===t||T(t)}function M(t){return h.test(t)||x.test(t)||F.test(t)}function q(t){return b.test(t)}function z(t){return A.test(t.toLowerCase())}var S=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,N=/[:/?#]/;var O=/^(https?:\/\/)?(www\.)?/i,P=/^\/\//,R=function(t){function e(e){var u=t.call(this,e)||this;return u.type="url",u.url="",u.urlMatchType="scheme",u.protocolRelativeMatch=!1,u.stripPrefix={scheme:!0,www:!0},u.stripTrailingSlash=!0,u.decodePercentEncoding=!0,u.protocolPrepended=!1,u.urlMatchType=e.urlMatchType,u.url=e.url,u.protocolRelativeMatch=e.protocolRelativeMatch,u.stripPrefix=e.stripPrefix,u.stripTrailingSlash=e.stripTrailingSlash,u.decodePercentEncoding=e.decodePercentEncoding,u}return g(e,t),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||"scheme"===this.urlMatchType||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=t.replace(P,"")),this.stripPrefix.scheme&&(t=t.replace(B,"")),this.stripPrefix.www&&(t=function(t){return t.replace(O,"$1")}(t)),this.stripTrailingSlash&&(t=function(t){"/"===t.charAt(t.length-1)&&(t=t.slice(0,-1));return t}(t)),this.decodePercentEncoding&&(t=function(t){var e=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(e)}catch(t){return e}}(t)),t},e}(m);var H=/^mailto:/i,I=new RegExp("[".concat(c,"!#$%&'*+/=?^_`{|}~-]"));function L(t){return I.test(t)}var $=function(t){function e(e){var u=t.call(this,e)||this;return u.type="email",u.email="",u.email=e.email,u}return g(e,t),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(m);function _(t){return"_"===t||h.test(t)}var U=["twitter","facebook","instagram","tiktok"],V=function(t){function e(e){var u=t.call(this,e)||this;return u.type="hashtag",u.serviceName="twitter",u.hashtag="",u.serviceName=e.serviceName,u.hashtag=e.hashtag,u}return g(e,t),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,e=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+e;case"facebook":return"https://www.facebook.com/hashtag/"+e;case"instagram":return"https://instagram.com/explore/tags/"+e;case"tiktok":return"https://www.tiktok.com/tag/"+e;default:throw n(t),new Error("Invalid hashtag service: ".concat(t))}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e.prototype.getCssClassSuffixes=function(){var e=t.prototype.getCssClassSuffixes.call(this),u=this.getServiceName();return u&&e.push(u),e},e}(m),W={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},Z=/[-\w.]/;function Y(t){return Z.test(t)}var G=["twitter","instagram","soundcloud","tiktok"],J=function(t){function e(e){var u=t.call(this,e)||this;return u.type="mention",u.serviceName="twitter",u.mention="",u.mention=e.mention,u.serviceName=e.serviceName,u}return g(e,t),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var e=t.prototype.getCssClassSuffixes.call(this),u=this.getServiceName();return u&&e.push(u),e},e}(m),K=/[-. ]/,Q=/[-. ()]/,X=/[,;]/,tt=new RegExp("^".concat(/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/.source,"|").concat(/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"$"));function et(t){return K.test(t)}function ut(t){return X.test(t)}var nt=function(t){function e(e){var u=t.call(this,e)||this;return u.type="phone",u.number="",u.plusSign=!1,u.number=e.number,u.plusSign=e.plusSign,u}return g(e,t),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(m);function at(t,u){for(var s=u.tagBuilder,i=u.stripPrefix,o=u.stripTrailingSlash,c=u.decodePercentEncoding,l=u.hashtagServiceName,p=u.mentionServiceName,f=[],g=t.length,d=[],m=0;m<g;m++){var A=t.charAt(m);if(0===d.length)B(A);else for(var b=d.length-1;b>=0;b--){var x=d[b];switch(x.state){case 11:G(x,A);break;case 12:K(x,A);break;case 0:O(x,A);break;case 1:P(x,A);break;case 2:I(x,A);break;case 3:U(x,A);break;case 4:Z(x,A);break;case 5:X(x,A);break;case 6:at(x,A);break;case 7:lt(x,A);break;case 13:pt(x,A);break;case 14:ft(x,A);break;case 8:gt(x,A);break;case 9:dt(x,A);break;case 10:mt(x,A);break;case 15:At(x,A);break;case 16:bt(x,A);break;case 17:xt(x,A);break;case 18:Ft(x,A);break;case 19:yt(x,A);break;case 20:Bt(x,A);break;case 21:Ct(x,A);break;case 22:vt(x,A);break;case 23:kt(x,A);break;case 24:wt(x,A);break;case 25:Dt(x,A);break;case 26:Et(x,A);break;case 27:Tt(x,A);break;case 28:jt(x,A);break;case 29:Mt(x,A);break;case 30:qt(x,A);break;case 31:zt(x,A);break;case 32:Nt(x,A);break;case 33:Ot(x,A);break;case 34:Pt(x,A);break;case 35:Rt(x,A);break;case 36:Ht(x,A);break;case 37:St(x,A);break;case 38:It(x,A);break;case 39:Lt(x,A);break;case 40:$t(x,A);break;case 41:_t(x,A);break;default:n(x.state)}}}for(var F=d.length-1;F>=0;F--)d.forEach((function(t){return Ut(t)}));return f;function B(t){if("#"===t)d.push({type:"hashtag",startIdx:m,state:28,acceptStateReached:!1});else if("@"===t)d.push(function(t,e){return{type:"mention",startIdx:t,state:e,acceptStateReached:!1}}(m,30));else if("/"===t)d.push(ct(m,11));else if("+"===t)d.push(ht(m,37));else if("("===t)d.push(ht(m,32));else{if(r.test(t)&&(d.push(ht(m,38)),d.push(function(t,e){return{type:"url",startIdx:t,state:e,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}(m,13))),function(t){return h.test(t)}(t)){var e="m"===t.toLowerCase()?15:22;d.push(function(t,e){return{type:"email",startIdx:t,state:e,acceptStateReached:!1}}(m,e))}D(t)&&d.push(ot(m,0)),h.test(t)&&d.push(ct(m,5))}}function O(t,u){":"===u?t.state=2:"-"===u?t.state=1:E(u)||e(d,t)}function P(t,u){"-"===u||("/"===u?(e(d,t),d.push(ct(m,11))):E(u)?t.state=0:e(d,t))}function I(t,u){"/"===u?t.state=3:"."===u?e(d,t):T(u)?(t.state=5,D(u)&&d.push(ot(m,0))):e(d,t)}function U(t,e){"/"===e?t.state=4:M(e)?(t.state=10,t.acceptStateReached=!0):Ut(t)}function Z(t,u){"/"===u?t.state=10:T(u)?(t.state=5,t.acceptStateReached=!0):e(d,t)}function G(t,u){"/"===u?t.state=12:e(d,t)}function K(t,u){T(u)?t.state=5:e(d,t)}function X(t,e){"."===e?t.state=7:"-"===e?t.state=6:":"===e?t.state=8:q(e)?t.state=10:j(e)||Ut(t)}function at(t,e){"-"===e||("."===e?Ut(t):T(e)?t.state=5:Ut(t))}function lt(t,e){"."===e?Ut(t):T(e)?(t.state=5,t.acceptStateReached=!0):Ut(t)}function pt(t,u){"."===u?t.state=14:":"===u?t.state=8:r.test(u)||(q(u)?t.state=10:h.test(u)?e(d,t):Ut(t))}function ft(t,e){r.test(e)?(t.octetsEncountered++,4===t.octetsEncountered&&(t.acceptStateReached=!0),t.state=13):Ut(t)}function gt(t,e){r.test(e)?t.state=9:Ut(t)}function dt(t,e){r.test(e)||(q(e)?t.state=10:Ut(t))}function mt(t,e){M(e)||Ut(t)}function At(t,e){"a"===e.toLowerCase()?t.state=16:vt(t,e)}function bt(t,e){"i"===e.toLowerCase()?t.state=17:vt(t,e)}function xt(t,e){"l"===e.toLowerCase()?t.state=18:vt(t,e)}function Ft(t,e){"t"===e.toLowerCase()?t.state=19:vt(t,e)}function yt(t,e){"o"===e.toLowerCase()?t.state=20:vt(t,e)}function Bt(t,e){":"===e.toLowerCase()?t.state=21:vt(t,e)}function Ct(t,u){L(u)?t.state=22:e(d,t)}function vt(t,u){"."===u?t.state=23:"@"===u?t.state=24:L(u)?t.state=22:e(d,t)}function kt(t,u){"."===u||"@"===u?e(d,t):L(u)?t.state=22:e(d,t)}function wt(t,u){T(u)?t.state=25:e(d,t)}function Dt(t,e){"."===e?t.state=27:"-"===e?t.state=26:j(e)||Ut(t)}function Et(t,e){"-"===e||"."===e?Ut(t):j(e)?t.state=25:Ut(t)}function Tt(t,e){"."===e||"-"===e?Ut(t):T(e)?(t.state=25,t.acceptStateReached=!0):Ut(t)}function jt(t,u){_(u)?(t.state=29,t.acceptStateReached=!0):e(d,t)}function Mt(t,e){_(e)||Ut(t)}function qt(t,u){Y(u)?(t.state=31,t.acceptStateReached=!0):e(d,t)}function zt(t,u){Y(u)||(h.test(u)?e(d,t):Ut(t))}function St(t,u){r.test(u)?t.state=38:(e(d,t),B(u))}function Nt(t,u){r.test(u)?t.state=33:e(d,t),B(u)}function Ot(t,u){r.test(u)?t.state=34:e(d,t)}function Pt(t,u){r.test(u)?t.state=35:e(d,t)}function Rt(t,u){")"===u?t.state=36:e(d,t)}function Ht(t,u){r.test(u)?t.state=38:et(u)?t.state=39:e(d,t)}function It(t,e){t.acceptStateReached=!0,ut(e)?t.state=40:"#"===e?t.state=41:r.test(e)||("("===e?t.state=32:et(e)?t.state=39:(Ut(t),D(e)&&d.push(ot(m,0))))}function Lt(t,e){r.test(e)?t.state=38:"("===e?t.state=32:(Ut(t),B(e))}function $t(t,e){ut(e)||("#"===e?t.state=41:r.test(e)?t.state=38:Ut(t))}function _t(t,u){ut(u)?t.state=40:r.test(u)?e(d,t):Ut(t)}function Ut(u){if(e(d,u),u.acceptStateReached){var r,h,g,A=u.startIdx,b=t.slice(u.startIdx,m);if(b=function(t){for(var e={"(":0,"{":0,"[":0},u=0;u<t.length;u++){var n=t.charAt(u);rt.test(n)?e[n]++:st.test(n)&&e[it[n]]--}var a,r=t.length-1;for(;r>=0;)if(a=t.charAt(r),st.test(a)){var s=it[a];if(!(e[s]<0))break;e[s]++,r--}else{if(!C.test(a))break;r--}return t.slice(0,r+1)}(b),"url"===u.type){if("@"===t.charAt(u.startIdx-1))return;var x=u.matchType;if("scheme"===x){var F=y.exec(b);if(F&&(A+=F.index,b=b.slice(F.index)),!function(t){if(v.test(t))return!1;var e=t.match(k);if(!e)return!1;var u=!!e[1],n=e[2];return!!u||!(-1===n.indexOf(".")||!a.test(n))}(b))return}else if("tld"===x){if(!function(t){var e=t.match(w);if(!e)return!1;var u=e[0].split(".");return!(u.length<2||!z(u[u.length-1]))}(b))return}else if("ipV4"===x){if(g=b.split(N,1)[0],!S.test(g))return}else n(x);f.push(new R({tagBuilder:s,matchedText:b,offset:A,urlMatchType:x,url:b,protocolRelativeMatch:"//"===b.slice(0,2),stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:c}))}else if("email"===u.type)z(b.split(".").pop()||"")&&f.push(new $({tagBuilder:s,matchedText:b,offset:A,email:b.replace(H,"")}));else if("hashtag"===u.type)b.length<=140&&f.push(new V({tagBuilder:s,matchedText:b,offset:A,serviceName:l,hashtag:b.slice(1)}));else if("mention"===u.type)h=b,W[p].test(h)&&f.push(new J({tagBuilder:s,matchedText:b,offset:A,serviceName:p,mention:b.slice(1)}));else if("phone"===u.type){if(b=b.replace(/ +$/g,""),("+"===(r=b).charAt(0)||Q.test(r))&&tt.test(r)){var B=b.replace(/[^0-9,;#]/g,"");f.push(new nt({tagBuilder:s,matchedText:b,offset:A,number:B,plusSign:"+"===b.charAt(0)}))}}else n(u)}}}var rt=/[\(\{\[]/,st=/[\)\}\]]/,it={")":"(","}":"{","]":"["};function ot(t,e){return{type:"url",startIdx:t,state:e,acceptStateReached:!1,matchType:"scheme"}}function ct(t,e){return{type:"url",startIdx:t,state:e,acceptStateReached:!1,matchType:"tld"}}function ht(t,e){return{type:"phone",startIdx:t,state:e,acceptStateReached:!1}}function lt(t,e){for(var u,c=e.onOpenTag,h=e.onCloseTag,l=e.onText,p=e.onComment,f=e.onDoctype,g=new pt,m=0,A=t.length,b=0,x=0,F=g;m<A;){var y=t.charAt(m);switch(b){case 0:B(y);break;case 1:C(y);break;case 2:k(y);break;case 3:v(y);break;case 4:w(y);break;case 5:D(y);break;case 6:E(y);break;case 7:T(y);break;case 8:j(y);break;case 9:M(y);break;case 10:q(y);break;case 11:z(y);break;case 12:S(y);break;case 13:N();break;case 14:O(y);break;case 15:P(y);break;case 16:R(y);break;case 17:H(y);break;case 18:I(y);break;case 19:L(y);break;case 20:$(y);break;default:n(b)}m++}function B(t){"<"===t&&U()}function C(t){"!"===t?b=13:"/"===t?(b=2,F=new pt(d(d({},F),{isClosing:!0}))):"<"===t?U():a.test(t)?(b=3,F=new pt(d(d({},F),{isOpening:!0}))):(b=0,F=g)}function v(t){s.test(t)?(F=new pt(d(d({},F),{name:W()})),b=4):"<"===t?U():"/"===t?(F=new pt(d(d({},F),{name:W()})),b=12):">"===t?(F=new pt(d(d({},F),{name:W()})),V()):a.test(t)||r.test(t)||":"===t||_()}function k(t){">"===t?_():a.test(t)?b=3:_()}function w(t){s.test(t)||("/"===t?b=12:">"===t?V():"<"===t?U():"="===t||i.test(t)||o.test(t)?_():b=5)}function D(t){s.test(t)?b=6:"/"===t?b=12:"="===t?b=7:">"===t?V():"<"===t?U():i.test(t)&&_()}function E(t){s.test(t)||("/"===t?b=12:"="===t?b=7:">"===t?V():"<"===t?U():i.test(t)?_():b=5)}function T(t){s.test(t)||('"'===t?b=8:"'"===t?b=9:/[>=`]/.test(t)?_():"<"===t?U():b=10)}function j(t){'"'===t&&(b=11)}function M(t){"'"===t&&(b=11)}function q(t){s.test(t)?b=4:">"===t?V():"<"===t&&U()}function z(t){s.test(t)?b=4:"/"===t?b=12:">"===t?V():"<"===t?U():(b=4,m--)}function S(t){">"===t?(F=new pt(d(d({},F),{isClosing:!0})),V()):b=4}function N(e){"--"===t.substr(m,2)?(m+=2,F=new pt(d(d({},F),{type:"comment"})),b=14):"DOCTYPE"===t.substr(m,7).toUpperCase()?(m+=7,F=new pt(d(d({},F),{type:"doctype"})),b=20):_()}function O(t){"-"===t?b=15:">"===t?_():b=16}function P(t){"-"===t?b=18:">"===t?_():b=16}function R(t){"-"===t&&(b=17)}function H(t){b="-"===t?18:16}function I(t){">"===t?V():"!"===t?b=19:"-"===t||(b=16)}function L(t){"-"===t?b=17:">"===t?V():b=16}function $(t){">"===t?V():"<"===t&&U()}function _(){b=0,F=g}function U(){b=1,F=new pt({idx:m})}function V(){var e=t.slice(x,F.idx);e&&l(e,x),"comment"===F.type?p(F.idx):"doctype"===F.type?f(F.idx):(F.isOpening&&c(F.name,F.idx),F.isClosing&&h(F.name,F.idx)),_(),x=m+1}function W(){var e=F.idx+(F.isClosing?2:1);return t.slice(e,m).toLowerCase()}x<m&&(u=t.slice(x,m),l(u,x),x=m+1)}var pt=function(t){void 0===t&&(t={}),this.idx=void 0!==t.idx?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing};return function(){function e(u){void 0===u&&(u={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=function(e){null==e&&(e=!0);return t(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:!t(e.schemeMatches)||e.schemeMatches,tldMatches:!t(e.tldMatches)||e.tldMatches,ipV4Matches:!t(e.ipV4Matches)||e.ipV4Matches}}(u.urls),this.email=t(u.email)?u.email:this.email,this.phone=t(u.phone)?u.phone:this.phone,this.hashtag=u.hashtag||this.hashtag,this.mention=u.mention||this.mention,this.newWindow=t(u.newWindow)?u.newWindow:this.newWindow,this.stripPrefix=function(e){null==e&&(e=!0);return t(e)?{scheme:e,www:e}:{scheme:!t(e.scheme)||e.scheme,www:!t(e.www)||e.www}}(u.stripPrefix),this.stripTrailingSlash=t(u.stripTrailingSlash)?u.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=t(u.decodePercentEncoding)?u.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=u.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&-1===G.indexOf(n))throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var a,r=this.hashtag;if(!1!==r&&-1===U.indexOf(r))throw new Error("invalid `hashtag` cfg '".concat(r,"' - see docs"));this.truncate="number"==typeof(a=u.truncate)?{length:a,location:"end"}:function(t,e){for(var u in e)e.hasOwnProperty(u)&&void 0===t[u]&&(t[u]=e[u]);return t}(a||{},{length:Number.POSITIVE_INFINITY,location:"end"}),this.className=u.className||this.className,this.replaceFn=u.replaceFn||this.replaceFn,this.context=u.context||this}return e.link=function(t,u){return new e(u).link(t)},e.parse=function(t,u){return new e(u).parse(t)},e.prototype.parse=function(t){var e=this,u=["a","style","script"],n=0,a=[];return lt(t,{onOpenTag:function(t){u.indexOf(t)>=0&&n++},onText:function(t,u){if(0===n){var r=t.split(/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),s=u;r.forEach((function(t,u){if(u%2==0){var n=e.parseText(t,s);a.push.apply(a,n)}s+=t.length}))}},onCloseTag:function(t){u.indexOf(t)>=0&&(n=Math.max(n-1,0))},onComment:function(t){},onDoctype:function(t){}}),a=this.compactMatches(a),a=this.removeUnwantedMatches(a)},e.prototype.compactMatches=function(t){t.sort((function(t,e){return t.getOffset()-e.getOffset()}));for(var e=0;e<t.length-1;){var u=t[e],n=u.getOffset(),a=u.getMatchedText().length,r=n+a;if(e+1<t.length){if(t[e+1].getOffset()===n){var s=t[e+1].getMatchedText().length>a?e:e+1;t.splice(s,1);continue}if(t[e+1].getOffset()<r){t.splice(e+1,1);continue}}e++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||u(t,(function(t){return"hashtag"===t.getType()})),this.email||u(t,(function(t){return"email"===t.getType()})),this.phone||u(t,(function(t){return"phone"===t.getType()})),this.mention||u(t,(function(t){return"mention"===t.getType()})),this.urls.schemeMatches||u(t,(function(t){return"url"===t.getType()&&"scheme"===t.getUrlMatchType()})),this.urls.tldMatches||u(t,(function(t){return"url"===t.getType()&&"tld"===t.getUrlMatchType()})),this.urls.ipV4Matches||u(t,(function(t){return"url"===t.getType()&&"ipV4"===t.getUrlMatchType()})),t},e.prototype.parseText=function(t,e){void 0===e&&(e=0),e=e||0;for(var u=at(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),n=0,a=u.length;n<a;n++)u[n].setOffset(e+u[n].getOffset());return u},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var e=this.parse(t),u=[],n=0,a=0,r=e.length;a<r;a++){var s=e[a];u.push(t.substring(n,s.getOffset())),u.push(this.createMatchReturnVal(s)),n=s.getOffset()+s.getMatchedText().length}return u.push(t.substring(n)),u.join("")},e.prototype.createMatchReturnVal=function(t){var e;return this.replaceFn&&(e=this.replaceFn.call(this.context,t)),"string"==typeof e?e:!1===e?t.getMatchedText():e instanceof l?e.toAnchorString():t.buildTag().toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new p({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version="4.0.0",e}()}));