ips.templates.set('core.general.loading',"      {{text}}");ips.templates.set('core.general.ajax',"
  {{#lang}}loading{{/lang}}...
");ips.templates.set('core.general.flashMsg',"
");ips.templates.set('core.hovercard.loading'," ");ips.templates.set('core.posts.spoiler'," {{#lang}}spoilerClickToReveal{{/lang}}");ips.templates.set('core.posts.spoilerOpen'," {{#lang}}spoilerClickToHide{{/lang}}");ips.templates.set('core.posts.multiQuoteOff'," ");ips.templates.set('core.posts.multiQuoteOn'," ");ips.templates.set('core.posts.multiQuoter',"
  
");ips.templates.set('core.menus.menuItem',"
  • {{title}}
  • ");ips.templates.set('core.menus.menuSep',"

  • ");ips.templates.set('core.posts.quotedSpoiler',"

    {{#lang}}quotedSpoiler{{/lang}}

    ");ips.templates.set('core.postNotify.single',"    {{{text}}}    {{#lang}}showReply{{/lang}} ");ips.templates.set('core.postNotify.multiple'," {{text}}    {{#lang}}showReplies{{/lang}} ");ips.templates.set('core.postNotify.multipleSpillOver'," {{text}} {{#canLoadNew}}    {{showFirstX}}    {{#lang}}showRepliesOr{{/lang}} {{/canLoadNew}}    {{#lang}}goToNewestPage{{/lang}} ");ips.templates.set('core.notification.flashSingle'," ");ips.templates.set('core.notification.flashMultiple'," ");ips.templates.set('core.alert.box'," ");ips.templates.set('core.alert.subText',"
    {{text}}
    ");ips.templates.set('core.alert.subTextHtml',"
    {{{text}}}
    ");ips.templates.set('core.alert.icon'," ");ips.templates.set('core.alert.button',"
  • ");ips.templates.set('core.alert.prompt',"



    ");ips.templates.set('core.lightbox.meta',"{{title}}");ips.templates.set('core.lightbox.toolsMenu'," ");ips.templates.set('core.dialog.main'," ") ips.templates.set('core.tooltip'," ");ips.templates.set('core.search.loadingPanel',"
     
    ");ips.templates.set('core.editor.panelWrapper',"
    {{content}}
    ");ips.templates.set('core.editor.giphy'," ");ips.templates.set('core.editor.giphyThumb',"
    {{title}}
    ");ips.templates.set('core.editor.giphyRow',"
    {{{gifs}}}
    ");ips.templates.set('core.editor.pixabayThumb',"
    ");ips.templates.set('core.editor.pixabayRow',"
    {{{images}}}
    ");ips.templates.set('core.editor.emoticons'," ");ips.templates.set('core.editor.emoticonSection',"
    {{{content}}}
    ");ips.templates.set('core.editor.emoticonMenu'," ");ips.templates.set('core.editor.emoticonCategory',"
    {{title}}
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonSearch',"
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonRow',"
    {{{emoticons}}}
    ");ips.templates.set('core.editor.emoticonItem',"
    {{{img}}}
    ");ips.templates.set('core.editor.emoji',"
    {{{display}}}
    ");ips.templates.set('core.editor.emojiNotNative',"
    {{{img}}}
    ");ips.templates.set('core.editor.emoticonBlank',"
     
    ");ips.templates.set('core.editor.emoticonNoResults',"
    {{#lang}}no_results{{/lang}}
    ");ips.templates.set('core.editor.emojiResult',"
  • {{{emoji}}} {{short_code}}
  • ");ips.templates.set('core.editor.quote',"
    {{citation}}
    {{{contents}}}
    ");ips.templates.set('core.editor.legacyQuoteUpcast',"
    {{citation}}
    {{{contents}}}
    ");ips.templates.set('core.editor.citation',"
      {{#contenturl}} {{/contenturl}} {{{citation}}}
    ");ips.templates.set('core.editor.citationLink'," {{username}}");ips.templates.set('core.editor.spoiler',"
    {{#lang}}editorSpoiler{{/lang}}
    ");ips.templates.set('core.editor.legacySpoilerUpcast',"
    {{#lang}}editorSpoiler{{/lang}}
    {{{contents}}}
    ");ips.templates.set('core.editor.spoilerHeader',"
      {{#lang}}spoilerClickToReveal{{/lang}}
    ");ips.templates.set('core.editor.initLoading',"
     
    ");ips.templates.set('core.editor.previewLoading',"
     
    ");ips.templates.set('core.editor.stockReplies'," ");ips.templates.set('core.editor.editorStockRepliesWrap',"
    {{{content}}}
    ");ips.templates.set('core.editor.editorStockRepliesRow',"
    {{{title}}}
    ");ips.templates.set('core.attachments.metaInfo'," {{size}} · {{downloads}} ");ips.templates.set('core.attachments.attachmentPreview'," {{title}}{{#lang}}attachmentPending{{/lang}} ");ips.templates.set('core.attachments.fileItemWrapper',"
    {{{content}}}
    ");ips.templates.set('core.attachments.fileItem',"
    {{#thumb}} {{{thumb}}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    {{#status}}{{/status}}
    {{#supportsDelete}}
    ×
    {{/supportsDelete}} {{^supportsDelete}}
    ×
    {{/supportsDelete}}
    ");ips.templates.set('core.attachments.imageItem',"
    {{#thumb}} {{{thumb}}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    {{#status}}{{/status}}
    {{#supportsDelete}}
    ×
    {{/supportsDelete}} {{^supportsDelete}}
    ×
    {{/supportsDelete}}
    ");ips.templates.set('core.attachments.videoItem',"
    {{#thumb}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    {{#status}}{{/status}}
    {{#supportsDelete}}
    ×
    {{/supportsDelete}} {{^supportsDelete}}
    ×
    {{/supportsDelete}}
    ");ips.templates.set('core.attachments.audioItem',"
    {{#thumb}} {{/thumb}}

    {{title}}

    {{size}} {{#statusText}}· {{statusText}}{{/statusText}}

    {{#status}}{{/status}}
    {{#supportsDelete}}
    ×
    {{/supportsDelete}} {{^supportsDelete}}
    ×
    {{/supportsDelete}}
    ");ips.templates.set('core.attachments.imageItemWrapper',"
    {{{content}}}
    ");ips.templates.set('core.autocomplete.field',"
    ");ips.templates.set('core.autocomplete.addToken'," {{text}} ");ips.templates.set('core.autocomplete.resultWrapper'," ");ips.templates.set('core.autocomplete.searchTypeAhead',"
    ");ips.templates.set('core.autocomplete.resultItem',"
  • {{html}}
  • ");ips.templates.set('core.autocomplete.tagsResultItem',"
  • {{html}} {{#recommended}} {{#lang}}tag_recommended{{/lang}} {{/recommended}}
  • ");ips.templates.set('core.autocomplete.token',"
  • {{{title}}} ×
  • ");ips.templates.set('core.autocomplete.memberItem',"
  • {{{name}}}
    {{{extra}}}
  • ");ips.templates.set('core.autocomplete.optional'," {{langString}}...");ips.templates.set('core.forms.toggle'," ");ips.templates.set('core.forms.validationWrapper'," ");ips.templates.set('core.forms.validationItem',"
  • {{message}}
  • ");ips.templates.set('core.forms.advicePopup',"

    {{#lang}}password_advice_title{{/lang}}

    {{#min}} {{min}} {{/min}} {{{text}}}

    ");ips.templates.set('core.forms.validateOk'," ");ips.templates.set('core.forms.validateFail'," ");ips.templates.set('core.forms.validateFailText',"

    {{message}}

    ");ips.templates.set('core.truncate.expand'," {{text}}  ");ips.templates.set('core.selectTree.token',"
  • {{title}}
  • ");ips.templates.set('core.accessibility.border',"
    ");ips.templates.set('core.accessibility.arrow',"
    ");ips.templates.set('core.infScroll.loading',"
  • {{#lang}}loading{{/lang}}...
  • ");ips.templates.set('core.infScroll.pageBreak',"
  • {{#lang}}page{{/lang}} {{page}}
  • ");ips.templates.set('core.pageAction.actionMenuItem',"
  • {{#icon}} {{/icon}} {{^icon}} {{title}} {{/icon}}
  • ");ips.templates.set('core.pageAction.actionItem',"
  • {{#icon}} {{/icon}} {{^icon}} {{title}} {{/icon}}
  • ");ips.templates.set('core.pageAction.wrapper',"
    ");ips.templates.set('core.carousel.bulletWrapper'," ");ips.templates.set('core.carousel.bulletItem',"
  • ");ips.templates.set('core.rating.wrapper',"
    {{status}}") ips.templates.set('core.rating.star',"
  • ");ips.templates.set('core.rating.halfStar',"
  • ");ips.templates.set('core.rating.loading'," ");ips.templates.set('core.sidebar.managerWrapper',"

    {{#lang}}sidebarManager{{/lang}}

    {{#lang}}sidebarManagerDesc{{/lang}}

    {{#lang}}sidebarManagerDesc2{{/lang}}

    ");ips.templates.set('core.sidebar.blockManage',"

    {{title}}

    ");ips.templates.set('core.sidebar.blockManageNoConfig',"

    {{title}}

    ");ips.templates.set('core.sidebar.blockIsEmpty',"
    {{text}}
    ");ips.templates.set('core.follow.loading',"
    ");ips.templates.set('core.statuses.loadingComments',"    {{#lang}}loadingComments{{/lang}}");ips.templates.set('core.forms.stack',"
  • ×
    {{{field}}}
  • ");ips.templates.set('core.pollEditor.question',"
    •  

      {{#lang}}choicesTitle{{/lang}}

      {{#showCounts}}

      {{#lang}}votesTitle{{/lang}}

      {{/showCounts}}

       

    • {{{choices}}}

     

    ");ips.templates.set('core.pollEditor.choice',"
  • {{choiceID}}
  • ");ips.templates.set('core.coverPhoto.controls'," ");ips.templates.set('core.patchwork.imageList'," {{#showThumb}}
  • {{/showThumb}} {{^showThumb}}
  • {{/showThumb}} {{#showThumb}}{{image.title}}{{/showThumb}}
    {{image.caption}} {{#lang}}by{{/lang}} {{image.author.name}}
      {{#image.unread}}
    • {{/image.unread}} {{#image.hasState}}
    • {{#image.state.hidden}} {{/image.state.hidden}} {{#image.state.pending}} {{/image.state.pending}} {{#image.state.pinned}} {{/image.state.pinned}} {{#image.state.featured}} {{/image.state.featured}}
    • {{/image.hasState}} {{#image.allowComments}}
    • {{image.comments}}
    • {{/image.allowComments}}
    {{#image.modActions}} {{/image.modActions}}
  • ");ips.templates.set('core.editor.preferences',"
    {{#lang}}papt_warning{{/lang}}

    ");ips.templates.set('core.pagination'," ");ips.templates.set('core.selection.quote',"
    {{#lang}}quote_selected_text{{/lang}}
    ");ips.templates.set('core.contentItem.resultItem',"
  • {{{html}}}
  • ");ips.templates.set('core.contentItem.field',"
    ");ips.templates.set('core.contentItem.resultWrapper'," ");ips.templates.set('core.contentItem.item',"
  • × {{{html}}}
  • ");ips.templates.set('promote.imageUpload',"
    {{#thumbnail}}{{/thumbnail}}
    ");ips.templates.set('table.row.loading',"
  • ");ips.templates.set('licenseRenewal.wrapper',"

    {{#lang}}licenseRenewalTitle{{/lang}}

    {{#lang}}licenseRenewalText{{/lang}}

    ");ips.templates.set('core.browserNotification.prompt',"
    ×

    {{#lang}}notificationsCallout{{/lang}}

    {{#lang}}notificationsDefaultBlurb{{/lang}}

    {{#lang}}notificationsAllowPrompt{{/lang}}

    ");ips.templates.set('core.browserNotification.missingSubscription',"
    ×

    {{#lang}}notificationsCalloutPush{{/lang}}

    {{#lang}}notificationsDefaultBlurb{{/lang}}

    {{#lang}}notificationsUpgradeBlurb{{/lang}}

    {{#lang}}notificationsAllowPrompt{{/lang}}

    ");ips.templates.set('core.notifications.pending'," {{#lang}}notificationsEnabling{{/lang}}");ips.templates.set('core.notifications.success'," {{#lang}}notificationsEnabled{{/lang}}");ips.templates.set('core.notifications.fail'," {{#lang}}notificationsFailed{{/lang}}");ips.templates.set('core.notifications.notSupported'," {{#lang}}notificationsNotSupported{{/lang}}");ips.templates.set('core.notifications.checking'," {{#lang}}notificationsChecking{{/lang}}");ips.templates.set('system.warningpenalty.nomodify'," ");ips.templates.set('core.edittags.default',"
     {{#lang}}loading{{/lang}}
    ");ips.templates.set('core.onlineUser.linked',"
  • {{{formattedName}}}
  • ");; ;(function($,_,undefined){"use strict";ips.createModule('ips.controller',function(){var _controllers={},_autoMixins={},_manualMixins={},_mixins={},_beingLoaded=[],_queue={},_prototypes={},instanceID=1,_controllerCaseMap={'core.front.core.autosizeiframe':'core.front.core.autoSizeIframe'};var register=function(id,definition){_controllers[id]=definition;_checkQueue(id);},isRegistered=function(id){return!_.isUndefined(_controllers[id]);},init=function(){$(document).on('contentChange',function(e,newNode){initializeControllers(newNode);});initializeControllers();},mixin=function(mixinName,controller,auto,mixinFunc){if(_.isFunction(auto)){mixinFunc=auto;auto=false;} var obj=(auto)?_autoMixins:_manualMixins;if(_.isUndefined(obj[controller])){obj[controller]={};} obj[controller][mixinName]=mixinFunc;},initializeControllers=function(node){var controllers=_findControllers(node);var needsLoading={};for(var controller in controllers){if(isRegistered(controller)){for(var i=0;i{try{_fn(...args)}catch(e){Debug.error(e);}} if(delegate){elem.on(ev,delegate,fn);this._eventListeners.push({elem:elem,event:ev,delegate:delegate,fn:fn});}else{elem.on(ev,fn);this._eventListeners.push({elem:elem,event:ev,fn:fn});}});baseController.method('triggerOn',function(controller,ev,data){var toTrigger=_findSubControllers(controller,this.scope);if(!toTrigger.length){return;} data=data||{};if(!data.stack){data.stack=[];} data.stack.push('controllers.'+this.controllerType+'.'+this.controllerID);toTrigger.trigger(ev,data);});return baseController;};return{initControllerOnElem:initControllerOnElem,register:register,mixin:mixin,isRegistered:isRegistered,init:init,cleanContentsOf:cleanContentsOf};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.loader',function(){var _loadedScripts=[],_loadingScripts=[];var init=function(){var scripts=$('script[type="text/javascript"][src][data-ips]');scripts.each(function(){var scriptInfo=ips.utils.url.getURIObject($(this).attr('src'));if(scriptInfo.queryKey.src){var paths=_getPathScripts(scriptInfo.queryKey.src);_.each(paths,function(value){_loadedScripts.push(value);});}else if(scriptInfo.path.indexOf('interface/')!==-1){var interfaces=_getInterfaceScript(scriptInfo.path);if(interfaces){_loadedScripts.push(interfaces);}}else{var other=_getOtherScript(scriptInfo.source);if(other){_loadedScripts.push(other);}}});},_getOtherScript=function(path){path=path.replace(ips.getSetting('baseURL'),'');if(path.startsWith('/')){path=path.substring(1);} if(path.startsWith('applications/')){path=path.replace(/^applications\//i,'')} return path;},_getInterfaceScript=function(path){var pieces=_.compact(path.split('/').reverse());var path=[];for(var i=0;i').addClass('ipsModal').hide().appendTo($('body')).identify();},init=function(){$(document).on('contentChange',function(e,newContent){if(newContent instanceof jQuery){newContent.each(function(){if(Debug.isEnabled){Debug.info("contentChange event, reinitializing widgets in "+$(this).identify().attr('id'));} _initializeWidgets(this);});}else{if(Debug.isEnabled){Debug.info("contentChange event, reinitializing widgets in "+$(newContent).identify().attr('id'));} _initializeWidgets(newContent);} if(typeof PR!='undefined'){PR.prettyPrint();}});_initializeWidgets(document);};return{registerWidget:registerWidget,init:init,zIndex:zIndex,getModal:getModal,getAcceptedOptions:getAcceptedOptions,key:key,destructAllWidgets:destructAllWidgets};});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.addressForm',function(){const defaults={minimize:false,country:"",requireFullAddress:true};function respond(elem,options,e){if(!_.isUndefined(elem.data('initialized'))){return;} options=_.defaults(options,defaults);if(options.minimize){minimizeAddress(elem,options);}else{init(elem,options,e);} elem.data('initialized',true);} function init(elem,options,e){elem.on('change','[data-role="countrySelect"]',_.bind(countryChange,e,elem,options));$(elem).find('[data-role="countrySelect"]').change();recalculateAddAddressLineButton(elem);} function minimizeAddress(elem,options){const tempInput=$('').attr('type','text').attr('data-role','minimizedVersion').attr('placeholder',ips.getString('specifyLocation')).on('focus',function(e){$(this).hide();if(options.country){$(elem).find('[data-role="countrySelect"]').val(options.country);} init(elem,options,e);elem.show().find('input').first().focus();});const value=[];elem.find('input, select').each(function(){if($(this).val()){if($(this).is('select')){value.push($(this).find('option[value="'+$(this).val()+'"]').text().trim());}else{value.push($(this).val().trim());}}});if(value.length){tempInput.val(value.join(', '));} elem.hide().after(tempInput);} function countryChange(elem,options,e){ips.getAjax()(ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=ajax&do=states&country='+$(e.target).val()).done(function(response){let regionSelect;let regionText;if(response.length){if(!$(elem).find('[data-role="regionSelect"]').length){regionText=$(elem).find('[data-role="regionText"]');} else {regionText=$(elem).find('[data-role="regionSelect"]');} regionSelect=$('');regionText.attr('name',regionSelect.attr('name')).val("");regionSelect.replaceWith(regionText);}}});if(typeof elem.attr('data-ipsAddressForm-googlePlaces')==='string'){ips.ui.map.afterGoogleMapsLoaded(()=>googlePlacesInit(elem))}} function addAddressLine(elem,value){const lastLine=elem.find('[data-role="addressLine"]').closest('li').last();const newLine=lastLine.clone();if(value){newLine.find('input').focus().val(value);} lastLine.after(newLine);} function recalculateAddAddressLineButton(elem){elem.find('[data-role="addAddressLine"]').remove();const button=$('');button.click(function(){addAddressLine(elem,'');recalculateAddAddressLineButton(elem);});elem.find('[data-role="addressLine"]').last().after(button);} function googlePlacesInit(elem){const googlePlacesInput=$(elem).find('[data-role="addressLine"]').first();const options={types:['geocode'],componentRestrictions:{country:$(elem).find('[data-role="countrySelect"]').val()}};if(!options.componentRestrictions.country){delete options.componentRestrictions} const autocomplete=new google.maps.places.Autocomplete(googlePlacesInput.get(0),options);googlePlacesInput.on('focus',function(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(position){const geolocation=new google.maps.LatLng(position.coords.latitude,position.coords.longitude);autocomplete.setBounds(new google.maps.LatLngBounds(geolocation,geolocation));});}});googlePlacesInput.on('keypress',function(e){if((e.which&&e.which==13)||(e.keyCode&&e.keyCode==13)){return false;}});google.maps.event.addListener(autocomplete,'place_changed',function(){const place=autocomplete.getPlace();for(let i=0;i<$(elem).find('[data-role="addressLine"]').length;i++){$(elem).find('[data-role="addressLine"]').val('');} const parsedAddress=$('
    '+place.adr_address+'
    ');const addressLines=[];let existingAddressLines=$(elem).find('[data-role="addressLine"]').length;if(parsedAddress.find('.post-office-box').length){addressLines.push(parsedAddress.find('.post-office-box').text());} if(parsedAddress.find('.street-address').length){addressLines.push(parsedAddress.find('.street-address').text());} if(parsedAddress.find('.extended-address').length){addressLines.push(parsedAddress.find('.extended-address').text());} for(let i=0;i
    ');}else if(count.length===0){elem.find('.cAutoCheckIcon').html('');}else{elem.find('.cAutoCheckIcon').html('');} var countToDisplay=count.length+initialCount;if(countToDisplay){elem.find('[data-role="autoCheckCount"]').text(countToDisplay).show();}else if(elem.find('[data-role="autoCheckCount"]').is(':visible')){setTimeout(function(){if(!initialCount){ips.utils.anim.go('fadeOut',elem.find('[data-role="autoCheckCount"]'));}},300);} return count.length;};init();return{destruct:destruct,refresh:refresh};};}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.createModule('ips.ui.autocomplete',function(){var defaults={multiValues:true,freeChoice:true,itemSep:{chr:',',keycode:188,charcode:44},disallowedCharacters:JSON.stringify(["<",">","'","\""]),unique:false,customValues:true,fieldTemplate:'core.autocomplete.field',resultsTemplate:'core.autocomplete.resultWrapper',resultItemTemplate:'core.autocomplete.resultItem',tokenTemplate:'core.autocomplete.token',addTokenTemplate:'core.autocomplete.addToken',addTokenText:ips.getString('add_tag'),queryParam:'q',forceLower:false,minLength:1,minAjaxLength:1,commaTrigger:true,searchFieldThreshold:20};var respond=function(elem,options){if(!$(elem).data('_autocomplete')){$(elem).data('_autocomplete',autocompleteObj(elem,_.defaults(options,defaults)));}},destruct=function(elem){var obj=getObj(elem);if(!_.isUndefined(obj)){obj.destruct();}},getObj=function(elem){elem=$(elem);if(elem.data('_autocomplete')){return elem.data('_autocomplete');}else if($('[name="'+elem.attr('name')+'_original'+'"]').length&&$('[name="'+elem.attr('name')+'_original'+'"]').data('_autocomplete')){return $('[name="'+elem.attr('name')+'_original'+'"]').data('_autocomplete');} return undefined;};ips.ui.registerWidget('autocomplete',ips.ui.autocomplete,['multiValues','freeChoice','dataSource','maxItems','itemSep','resultsElem','unique','commaTrigger','fieldTemplate','resultsTemplate','resultItemTemplate','tokenTemplate','addTokenTemplate','addTokenText','queryParam','minLength','maxLength','forceLower','disallowedCharacters','minAjaxLength']);return{respond:respond,destruct:destruct,getObj:getObj};});var autocompleteObj=function(elem,options,e){var timer,blurTimer,lastValue='',originalTextField,valueField,textField,dataSource,elemID=$(elem).identify().attr('id'),wrapper,inputItem,resultsElem,selectedToken,disabled=false,required=false,tooltip=null,tooltipTimer=null,mouseOverResults=false,hasError=false;var init=function(){if($(elem).is('textarea, input[type="text"], input[type="search"]')){originalTextField=$(elem);}else{originalTextField=$(elem).find('textarea, input[type="text"], input[type="search"]').first();} try{options.disallowedCharacters=$.parseJSON(options.disallowedCharacters);}catch(err){Debug.error("Couldn't parse disallowed characters option");} _buildWrapper();_getDataSource();originalTextField.removeAttr('list');if(dataSource.type!='none'){_buildResultsList();if(dataSource.type=='local'){_initAutocomplete();}} if(originalTextField.is(':disabled')){disabled=true;} if(originalTextField.is('[required]')){required=true;originalTextField.removeProp('required').removeAttr('aria-required');} textField.prop('autocomplete','off').prop('spellcheck',false).prop('disabled',disabled).attr('aria-autocomplete','list').attr('aria-haspopup','true').attr('tabindex',originalTextField.attr('tabindex')||'');if(options.maxLength){textField.attr('maxlength',options.maxLength+1);} $(document).on('click',_documentClick);wrapper.click(function(e){e.stopPropagation();return false;});textField.on('focus',_focusField).on('blur',_blurField).on('keydown',_keydownField).on('keyup',_keyupField).on('input',_expandField).on('keypress',_keypressField);wrapper.on('click',_clickWrapper).on('click','[data-action="addToken"]',_clickAddToken).on('keydown',_keydownWrapper).on('propChanged',_propChanged).toggleClass('ipsField_autocompleteDisabled',disabled);_buildInitialTokens();elem.on('blur',function(){if(textField!==elem){textField.trigger('blur');}}).trigger('autoCompleteReady',{elemID:elemID,elem:elem,currentValues:tokens.getValues()});elem.on('reissueReady',function(){elem.trigger('autoCompleteReady',{elemID:elemID,elem:elem,currentValues:tokens.getValues()});});},destruct=function(){$(document).off('click',_documentClick);},hasErrors=function(){return hasError;},_propChanged=function(e){disabled=originalTextField.is(':disabled');wrapper.toggleClass('ipsField_autocompleteDisabled',disabled);},_buildInitialTokens=function(){var value=_getOriginalValue();if(!value){return;} var splitValues=_.without(value.split("\n"),'');var itemCount=0;itemCount=splitValues.length;originalTextField.val('');if(splitValues.length){for(var i=0;ioptions.searchFieldThreshold&&!options.freeChoice){var searchField=ips.templates.render('core.autocomplete.searchTypeAhead',{});$('#'+elemID+'_results').prepend(searchField);$('#'+elemID+'_results').on('keyup','input[type="search"]',_keyupAutocomplete);}},_keyupAutocomplete=function(e){_loadResults($(this).val());return true;},_buildWrapper=function(){var existingClasses=elem[0].className;$(elem).after(ips.templates.render(options.fieldTemplate,{id:elemID})).removeClass(existingClasses);wrapper=$('#'+elemID+'_wrapper');inputItem=$('#'+elemID+'_inputItem');if(!options.freeChoice){var insertElem=ips.templates.render('core.autocomplete.addToken',{text:options.addTokenText});textField=elem;}else{var insertElem=$('').attr({type:'text',id:elemID+'_dummyInput'}).prop('autocomplete','off');textField=insertElem;} var name=originalTextField.attr('name');originalTextField.attr('name',originalTextField.attr('name')+'_original');valueField=$('