function get_query_string(){return function(e){if(""==e)return{};for(var t={},s=0;s-1!==e.tag.indexOf(t)))&&(e=null);else if(e instanceof Error){const{name:t,message:s,stack:r}=e;e.error_reported=!0,e={type:"Exception",name:t,message:s||"No message provided",stack:r},a.some((t=>-1!==e.message.indexOf(t)))&&(e=null)}else e instanceof HTMLElement&&(e={type:"HTMLElement",tag:e.outerHTML});try{JSON.stringify(e)}catch(t){console.warn("Could not JSON.stringify error, using normal String constructor",e,t),e=String(e)}return e}finally{s&&i.delete(t)}}function u(e){n.indexOf("+http")>-1||self.__FF_pageHiding||e&&r<5&&(r++,"object"!=typeof e&&(e={message:e}),jQuery.post(FFConstants.FRONTEND_ERROR_REPORTER_PATH,{message:JSON.stringify(e),page:o,userAgent:n}).fail((t=>console.warn("Unable to post diagnostic data.",t,e))))}self.__FF_pageHiding=!1,self.addEventListener("beforeunload",(e=>{self.__FF_pageHiding=!0,c=setTimeout((()=>{self.__FF_pageHiding=!1}),2500)})),self.addEventListener("pagehide",(()=>{self.__FF_pageHiding=!0,c&&(clearTimeout(c),c=void 0)})),self.addEventListener("pageshow",(function(){self.__FF_pageHiding=!1,c&&(clearTimeout(c),c=void 0)})),console.filmfreeway_error=console.error,console.error=(...e)=>{let t;t=1===e.length?e[0]:[...e],t=l(t),t&&u({"console.error":t}),console.filmfreeway_error(...e)},self.addEventListener("error",(function(e){const{error:t,target:s}=e;let r;r=null!=t&&t.error_reported||s instanceof Element&&s.onerror?void 0:l(e),r&&u({"Unhandled Error":r})}),!0),self.addEventListener("unhandledrejection",(function(e){const{reason:t}=e,s=l(t);s&&u({"Unhandled Promise Rejection":s})})),self.errorReporter.doNotReportError=e=>{}}(),self.setup=Object.freeze({require:async function(e,t=void 0){const s=await Promise.all(e.map((e=>System.import(e))));return t&&t.apply(void 0,s),s},preload:function(e){return this.require(e)}}),function(e,t){"undefined"!=typeof module?module.exports=t():"object"==typeof exports?exports.FFPolyglot=t():e.FFPolyglot=t()}(this,(function(){const e=Object.freeze({});return class{constructor(e){if(!e.phrases)throw new Error('Must be instantiated with an object with property "phrases"');try{const t=babelHelpers.objectSpread2({onMissingKey:this.onMissingKey,allowMissing:!1},e);this._polyglot=new Polyglot(t)}catch(e){throw new Error("Problem instantiating polyglot: "+e)}}t(){switch(arguments.length){case 1:return this._polyglot.t(arguments[0]);case 2:return arguments[1]instanceof Object?this._polyglot.t(arguments[0],this._escapeData(arguments[1])):new Error("Second argument must be an object to interpolate data.");default:throw new Error("Must have One or Two arguments")}}raw(t){return{type:e,payload:t}}_escapeData(t){return Object.keys(t).reduce(((s,r)=>{if(t[r]&&t[r].type)t[r].type===e?s[r]=t[r].payload:new Error("Interpolation must be string or number.");else{const e=t[r],i="number"==typeof e;e instanceof Object&&(e.toString=function(){const t=JSON.stringify(e);return console.error(`Interpolation data must be a string or number. \n You gave: ${t}`),t}),s[r]=i?e:escapeHtml(e.toString())}return s}),{})}onMissingKey(e){return console.error("The Polyglot key given was not found:",e),e}}})),function(e){"function"==typeof module?module.exports=e(this.jQuery||require("jquery")):this.NProgress=e(this.jQuery)}((function(e){var t={version:"0.1.2"},s=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,template:'
'};function r(e,t,s){return es?s:e}function i(e){return 100*(-1+e)}return t.configure=function(t){return e.extend(s,t),this},t.status=null,t.set=function(e){var a=t.isStarted();e=r(e,s.minimum,1),t.status=1===e?null:e;var n=t.render(!a),o=n.find('[role="bar"]'),c=s.speed,l=s.easing;return n[0].offsetWidth,n.queue((function(r){""===s.positionUsing&&(s.positionUsing=t.getPositioningCSS()),o.css(function(e,t,r){var a;return(a="translate3d"===s.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===s.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+r,a}(e,c,l)),1===e?(n.css({transition:"none",opacity:1}),n[0].offsetWidth,setTimeout((function(){n.css({transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){t.remove(),r()}),c)}),c)):setTimeout(r,c)})),this},t.isStarted=function(){return"number"==typeof t.status},t.start=function(){t.status||t.set(0);return s.trickle&&function e(){setTimeout((function(){t.status&&(t.trickle(),e())}),s.trickleSpeed)}(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var s=t.status;return s?("number"!=typeof e&&(e=(1-s)*r(Math.random()*s,.1,.95)),s=r(s+e,0,.994),t.set(s)):t.start()},t.trickle=function(){return t.inc(Math.random()*s.trickleRate)},t.render=function(r){if(t.isRendered())return e("#nprogress");e("html").addClass("nprogress-busy");var a=e("
").html(s.template),n=r?"-100":i(t.status||0);return a.find('[role="bar"]').css({transition:"all 0 linear",transform:"translate3d("+n+"%,0,0)"}),s.showSpinner||a.find('[role="spinner"]').remove(),a.appendTo(document.body),a},t.remove=function(){e("html").removeClass("nprogress-busy"),e("#nprogress").remove()},t.isRendered=function(){return e("#nprogress").length>0},t.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"},t})),window.facebook_events_controller=new class{constructor(){this.setupComplete=!1,window.facebookTrack=this.facebookTrack.bind(this)}facebookTrack(...e){this.setupComplete||(this.setup(),this.setupComplete=!0);const t=[...e];"track"===t[0]&&(t[0]="trackSingle",t.splice(1,0,"355511341502056")),window.fbq(...t)}setup(){var e,t;(e=window).fbq||(t=e.fbq=function(){t.callMethod?t.callMethod.apply(t,arguments):t.queue.push(arguments)},e._fbq||(e._fbq=t),t.push=t,t.loaded=!0,t.version="2.0",t.queue=[],setup.require(["facebook"])),window.fbq("init","355511341502056")}},function(e){function t(e,t){var o,c,l,u,d,_,h,m,p="",f=0;if(isNaN(e))throw Error("Invalid arguments");return c=!0===(t=t||{}).bits,_=!0===t.unix,f=void 0!==t.base?t.base:_?2:10,d=void 0!==t.round?t.round:_?1:2,h=void 0!==t.spacer?t.spacer:_?"":" ",m=void 0!==t.suffixes?t.suffixes:{},p=2(u=Number(e)))&&(u=-u),0===u?p=_?"0":"0"+h+(m[o="B"]||o):(8<(o=Math.floor(Math.log(u)/Math.log(1e3)))&&(o=8),f=2===f?u/Math.pow(2,10*o):u/Math.pow(1e3,o),c&&(f*=8)>p&&(f/=p,o++),p=f.toFixed(0"+(t=(t=(t=t.replace(simpleFormatRE1,"\n")).replace(simpleFormatRE2,"

\n\n

")).replace(simpleFormatRE3,"$1
"))+"

"}function simpleFormatDiv(e,t){var s=e;return void 0===t&&(t="Paragraph-primary"),'
'+(s=(s=(s=s.replace(simpleFormatRE1,"\n")).replace(simpleFormatRE2,'
\n\n
')).replace(simpleFormatRE3,"$1
"))+"
"}function escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function safeSimpleFormat(e){return simpleFormat(escapeHtml(e))}function safeSimpleFormatDiv(e,t){return simpleFormatDiv(escapeHtml(e),t)}function array_find(e,t){var s,r,i=e.length;for(s=0;s1;)e=e[r.shift()];e[r[0]]=s}function bindAndListen(e,t){for(var s in t){var r=t[s],i=r[3]+"Bound";e[i]||(e[i]=e[r[3]].bind(e)),jQuery(r[0]).on(r[1],r[2],e[i])}}function unListen(e,t){for(var s in t){var r=t[s],i=r[3]+"Bound";e[i]&&jQuery(r[0]).off(r[1],r[2],e[i])}}function visibilityChangeEvent(){var e;return void 0!==document.hidden?e="visibilitychange":void 0!==document.msHidden?e="msvisibilitychange":void 0!==document.webkitHidden&&(e="webkitvisibilitychange"),e}function pageIsHidden(){var e;return void 0!==document.hidden?e="hidden":void 0!==document.msHidden?e="msHidden":void 0!==document.webkitHidden&&(e="webkitHidden"),!e||document[e]}function getScrollbarWidth(){if("undefined"!=typeof window){if(jQuery(document).height()<=jQuery(window).height())return 0;var e=jQuery('
').appendTo("body"),t=e[0].offsetWidth-e[0].clientWidth;return e.remove(),t}return 0}function festival_is_sundance(e){return-1!=[47271,60218].indexOf(e)}function util_visit(e,t=!0){NProgress.start(),t||SafeStorage.SESSION.setItem("emulatedPagePosition",JSON.stringify({x:window.scrollX,y:window.scrollY})),window.location.href=e}function jqueryEscapeId(e){return e.length>0&&"#"===e[0]&&(e=e.substr(1)),"#"+e.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,(function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}))}function deferUntilIdle(e){"undefined"!=typeof requestIdleCallback?requestIdleCallback(e,{timeout:2500}):setTimeout(e,50)}function deferAfterShow(e){jQuery(document).one("page:change",(()=>{setTimeout((()=>deferUntilIdle(e)),15)}))}function deferAfterShowPromise(e){return new Promise(((t,s)=>{deferAfterShow((()=>{try{t(e())}catch(e){s(e)}}))}))}async function retryableThenable(e,t){for(;e-- >0;)try{return await t()}catch(e){console.warn("Failure in retryable",e)}return await t()}"undefined"!=typeof module&&(module.exports={escapeHtml,getScrollbarWidth}),function(e,t){(e=self).SafeStorage||(e.SafeStorage=(t=class{constructor(e){this.callSessionStorage=(e,...t)=>{try{return self[this.baseObject][e](...t)}catch(e){console.warn(`Couldn't access ${this.baseObject}`,e)}},this.methodProxy=e=>(...t)=>this.callSessionStorage(e,...t),this.baseObject=e,this.getItem=this.methodProxy("getItem"),this.setItem=this.methodProxy("setItem"),this.removeItem=this.methodProxy("removeItem"),this.key=this.methodProxy("key"),this.clear=this.methodProxy("clear")}get length(){try{return self[this.baseObject].length}catch(e){return console.warn(`Couldn't access ${this.baseObject}`,e),0}}},t.SESSION=new t("sessionStorage"),t.LOCAL=new t("localStorage"),t.logErrorOnce=(e,...t)=>{self.SafeStorage.SESSION.getItem(e)?console.warn(...t):(console.error(...t),self.SafeStorage.SESSION.setItem(e,"true"))},t)),NProgress.configure({showSpinner:!1}),self.nativeAlert=self.alert,self.alert=function(e){setup.require(["vex_dialog"],(function(t){t.alert(e)}))},self.alertWithPromise=function(e){let t;const s=new Promise((e=>{t=e}));return self.alert({message:e,callback:t}),s},jQuery(self).on("page:change",(function(){NProgress.done(),NProgress.remove()})),jQuery.fn.serializeObject=function(){let e,t;return e=this.serializeArray(),t={},jQuery.each(e,(function(){let e;e=null!=this.value?this.value:"",null!=t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(e)):t[this.name]=e})),t},jQuery.globalEval=System.eval,Object.array_unique=function(e){const t=[];for(let s=0;s!0)),jQuery(document).on("click","[data-nav-toggle]",this.show_nav_main),jQuery(document).on("click","[data-tab-target]",this.select_tab),jQuery(document).on("change","[data-block-checkbox] input",this.ui_block_checkbox_changed),jQuery(document).on("click","[data-form-clear-and-submit]",this.form_clear_and_submit),jQuery(window).scroll(this.collective_window_scroll),jQuery(document).on("blur",'[parsley-type="digits"]',this.input_force_digits_only),jQuery(document).on("blur",'[parsley-type="number"]',this.input_force_numbers_only),jQuery(document).on("click","[data-check-all]",this.check_all),jQuery(document).on("click","[data-uncheck-all]",this.uncheck_all),jQuery(document).on("click","[data-toggle-check-all]",this.toggle_check_all),jQuery(document).on("submit","form[data-disable-submit-on-submit]",this.disable_submit_on_submit),jQuery(document).on("change","[data-submit-on-change]",this.submit_parent_form),jQuery(document).on("click",'[data-toggle="row-expand"]',this.toggle_accordion_row),jQuery(document).on("mouseenter","li.has-submenu",this.show_submenu),jQuery(document).on("mouseleave","li.has-submenu",this.hide_submenu),jQuery(document).on("click","[data-vex-confirm]",this.vex_confirm_dialog),jQuery(document).on("click","[data-toggle-js-hide]",this.toggle_js_hide),jQuery(document).on("change","[data-change-js-hide]",this.change_js_hide),jQuery(document).on("click","[data-add-js-hide]",this.add_js_hide),jQuery(document).on("click","[data-remove-js-hide]",this.remove_js_hide),jQuery(document).on("keyup keydown change","[data-text-counter]",this.text_counter_input_text_updated),jQuery(document).on("keyup keydown change","[data-word-counter]",this.word_counter_input_text_updated),jQuery(document).on("trix-change trix-focus trix-initialize","[data-trix-text-counter]",this.text_counter_trix_input_text_updated),jQuery(document).on("page:change",this.collective_page_change),jQuery(document).on("keypress","[data-disable-enter-key]",this.disable_enter_key),jQuery(document).on("change","[data-separate-datetime-inputs][data-datepick]",this.separate_datetime_inputs_date_changed),jQuery(document).on("change","[data-separate-datetime-inputs][data-timepick]",this.separate_datetime_inputs_time_changed),jQuery(document).on("change","[data-select-navigate-on-change]",this.select_navigate_on_change),jQuery(document).on("change","[data-three-part-date-picker]",this.three_part_date_picker_changed),jQuery(document).on("click","[data-load-url-into-element]",this.load_url_into_element),jQuery(document).on("change","[data-date-update-sibling-date]",this.update_sibling_date),jQuery(document).on("click","[data-js-confirm]",this.click_js_confirm),jQuery(document).on("focus","[data-clear-placeholder]",this.clear_placeholder_focused),jQuery(document).on("blur","[data-clear-placeholder]",this.clear_placeholder_blurred),jQuery(document).on("mouseenter","[data-bodyfreeze]",this.bodyFreezeScroll),jQuery(document).on("mouseleave","[data-bodyfreeze]",this.bodyUnfreezeScroll),jQuery(document).on("click","[data-trigger-submit-if-present]",this.submit_element_and_prevent_default_if_present),jQuery(document).on("focus mouseenter",".sortable [draggable] input, .sortable [draggable] textarea",this.focus_sortable_input),jQuery(document).on("blur mouseleave",".sortable [draggable] input, .sortable [draggable] textarea",this.blur_sortable_input),jQuery(document).on("click","[data-expand-read-more]",this.expand_read_more),jQuery(document).on("click","[data-gallery]",this.clicked_generic_gallery_link),jQuery(document).on("click","[data-scroll-to-anchor]",this.scroll_to_anchor),jQuery(document).on("change initialize","[data-select][data-show-dropdown]",this.select2_dropdown_changed),jQuery(document).on("click","[data-ff-visit]",this.ff_visit),jQuery(document).on("click","[data-owner-lists-for-festival-facade]",this.add_to_list_facade_clicked),jQuery(document).on("click","a[href='#ff_javascript']",(e=>{e.preventDefault()})),jQuery(document).on("click","[data-select-all-click]",(({currentTarget:e})=>{e.setSelectionRange(0,e.value.length)})),jQuery(document).on("submit","[data-form-has-manual-validation]",this.submit_form_with_manual_validation)}focus_sortable_input(e){return jQuery(e.currentTarget).closest("[draggable]").prop("draggable",!1)}blur_sortable_input(e){return jQuery(e.currentTarget).closest("[draggable]").prop("draggable",!0)}click_alert_attribute(e){const t=jQuery(e.currentTarget).attr("data-alert");if(t)return alert(t)}apply_jquery_datepicker(){jQuery("[data-datepick]").length>0&&setup.require(["datepicker"],(function(){jQuery("[data-datepick]").datepicker({autoclose:!0,clearBtn:!0,disableTouchKeyboard:!0,assumeNearbyYear:!0}).attr("autocomplete","off"),jQuery("[data-enforce-start-date], [data-enforce-end-date]").trigger("change")}))}datepicker_enforce_start_date(e){return jQuery(jQuery(e.currentTarget).attr("data-enforce-start-date")).datepicker("setStartDate",jQuery(e.currentTarget).val())}datepicker_enforce_end_date(e){return jQuery(jQuery(e.currentTarget).attr("data-enforce-end-date")).datepicker("setEndDate",jQuery(e.currentTarget).val())}apply_timepicker(){const e=jQuery("[data-timepick]");e.length>0&&setup.require(["timepicker"],(()=>e.timepicker()))}apply_jquery_tooltipster(){if(window.skip_tooltipster)return void(window.skip_tooltipster=!1);const e=jQuery("[data-tooltip]");return e.length>0?setup.require(["tooltipster"],(()=>{e.tooltipster?e.tooltipster(self.TOOLTIPSTER_DEFAULTS):self.SafeStorage.logErrorOnce("tooltipsterLoadError","Tooltipster not present")})):void 0}apply_input_managers(){const e=jQuery("[data-tagmanager]");0!==e.length&&setup.require(["tagmanager"],(()=>e.each((function(e,t){const s=jQuery(t),r=parseInt(s.attr("data-max-tags"),10)||0;s.tagsManager({prefilled:s.val().split(","),maxTags:r}),s.trigger("keyup")}))));const t=jQuery('[data-select="multiple"]');0!==t.length&&setup.require(["select2"],(()=>t.each((function(e){const t=jQuery(this);t.filter("[data-select-tags]").length?t.select2({tags:!0}):t.select2(),this.hasAttribute("data-show-dropdown")&&t.trigger("initialize")}))))}focus_tagmanager_input(e){return jQuery(e.currentTarget).find("input[type=text]").focus()}tagmanager_input_changed(e){const t=jQuery(e.currentTarget),s=t.attr("name");return jQuery(`input[name='hidden-${s}']`).val()&&t.attr("placeholder")?(t.attr("data-placeholder",t.attr("placeholder")),t.attr("placeholder","")):!jQuery(`input[name='hidden-${s}']`).val()&&t.attr("data-placeholder")?(t.attr("placeholder",t.attr("data-placeholder")),t.attr("data-placeholder","")):void 0}reapply_sortable(){const e=jQuery(".sortable");e.length&&setup.require(["sortable"],(()=>(e.each(((e,t)=>jQuery(t).sortable("destroy"))),this.apply_sortable())))}apply_sortable(){const e=jQuery(".sortable");if(e.length>0)return setup.require(["sortable"],(()=>e.each(((e,t)=>jQuery(t).sortable({handle:".sortable-handle",items:":not(.sortable-disabled)"})))))}apply_sortable_block(){const e=jQuery(".sortable-block");if(e.length)return setup.require(["sortable"],(()=>e.each(((e,t)=>jQuery(t).sortable({items:":not(.disabled)"})))))}show_nav_main(e){return e.preventDefault(),jQuery(".nav-toggle").closest(".Content").toggleClass("nav--is-open")}set_document_sticky_subnav_height(){return this.header_height=jQuery("header").height()}enforce_meta_viewport(e){}collective_page_change(){return this.apply_sortable(),this.apply_sortable_block(),this.apply_parsleyjs(),this.apply_jquery_datepicker(),this.apply_jquery_tooltipster(),this.apply_input_managers(),this.ui_block_checkbox_setup(),this.set_document_sticky_subnav_height(),this.apply_custom_select(),this.open_modal_on_page_change(),this.apply_trix_editor(),this.apply_timepicker(),this.apply_readmore_labels(),this.auto_submit_forms()}collective_window_scroll(){const e=$(window).scrollTop(),t=jQuery("#nav-main-subnav"),s=jQuery("body");e>this.header_height&&0!==t.length&&!s.hasClass("no-sticky-nav")?s.addClass("subnav-fixed"):s.removeClass("subnav-fixed");const r=jQuery("#pages-how-it-works-sticky-nav");0!==r.length&&e>r.offset().top?s.addClass("sticky-nav-fixed"):s.removeClass("sticky-nav-fixed");const i=jQuery("#testimonials_background");0!==i.length&&i.css("bottom",-.75*e);const a=jQuery(".profile-body");if(0===t.length&&a.length){var n;e>a.position().top-92?s.addClass("festival-profile--fixed"):s.removeClass("festival-profile--fixed");const t=130;if(null==(n=jQuery("#about").offset())?void 0:n.top){var o,c,l;let s;const r=null==(o=jQuery("#awards").offset())?void 0:o.top,i=null==(c=jQuery("#rules").offset())?void 0:c.top,a=null==(l=jQuery("#reviews").offset())?void 0:l.top;s=a&&a-t0?setup.require(["parsley"],(()=>e.each((function(e,t){return jQuery(t).parsley()})))):void 0}click_modal_link(e){e.preventDefault(),e.stopPropagation();const t=jQuery(e.currentTarget);return this.modal_named(t.data("modal"),(()=>{if(void 0!==t.data("callback-tooltipster"))return filmfreeway.apply_jquery_tooltipster()}))}modal_named(e,t){let s=jQuery("[data-modal-"+e+"]");if(s.length)return s=s.html(),this.modal(s,(()=>{if(t&&t(),(this.apply_parsleyjs_after_modals.includes(e)||-1!==s.indexOf("parsley-validate"))&&this.apply_parsleyjs(),"sign-up"===e&&self.dynamicReactMount("[data-strong-password-react]"),("log-in"===e||"sign-up"===e||"welcome-back-log-in"===e)&&null!=window.override_redirect_path)return jQuery("[data-login-override-redirect-path]").val(window.override_redirect_path),jQuery("[data-external-login-link]").each((function(e,t){const s=jQuery(t);let r=s.attr("href");return r+="?override_redirect_path=",r+=encodeURIComponent(window.override_redirect_path),s.attr("href",r)}))}))}modal(e,t,s){"object"==typeof e&&"function"==typeof e.clone&&(e=e.clone().addClass("current"));let r=0;return setup.require(["vex","vex_dialog"],(function(i){return i.close(),i.open({content:e,onSubmit(e){if(!jQuery(e.currentTarget).find("form").length)return e.preventDefault()&&e.stopPropagation()},afterClose(){if(document.body.style.overflow="",document.body.style.height="",document.body.style.width="",document.body.style.position="",r>0)return jQuery(window).scrollTop(r)},afterOpen(){if(document.body.style.overflow="hidden",document.body.style.height="100%",document.body.style.width="100%",-1!==window.navigator.userAgent.indexOf("iPhone OS 11_")&&(r=jQuery(window).scrollTop(),document.body.style.position="fixed"),t)return t()},beforeClose(){if(s)return s()}})}))}modal_close(){return setup.require(["vex","vex_dialog"],(e=>e.close()))}remove_table_row(e){return e.preventDefault(),e.stopPropagation(),jQuery(e.currentTarget).closest("tr").remove()}remove_list_item(e){return e.preventDefault(),e.stopPropagation(),jQuery(e.currentTarget).closest("li").remove()}destroy_alert(e){return jQuery(e.currentTarget).closest(".alert").remove()}check_auth(){if("undefined"==typeof user_signed_in||null===user_signed_in||!user_signed_in)throw this.modal_named("sign-up"),"Authentication required"}check_role(e,t){if(this.check_auth(),"string"==typeof e&&(e=[e]),-1===e.indexOf(user_role))throw null!=t&&alert(t),"Insufficient user role"}select_tab(e){const t=jQuery(e.currentTarget),s=t.data("tab-target");return jQuery("[data-tab]").removeClass("active").filter(`[data-tab=${s}]`).addClass("active"),jQuery("[data-tab-target]").removeClass("active").filter(t).addClass("active")}ui_block_checkbox_setup(){const e=jQuery("[data-block-checkbox] input:checked");if(e.length)return e.each((function(){return jQuery(this).closest("[data-block-checkbox]").addClass("checked")}))}ui_block_checkbox_changed(e){const t=jQuery(e.currentTarget).closest("[data-block-checkbox]");if(t.length)return jQuery(e.currentTarget).is(":checked")?t.addClass("checked"):t.removeClass("checked")}form_clear_and_submit(e){const t=jQuery(e.currentTarget).closest("form");return t.find(".input input").val(""),t.submit()}input_force_digits_only(e){const t=jQuery(e.currentTarget);let s=parseInt(t.val().replace(/[^\d\.]/g,""),10);return isNaN(s)&&(s=""),t.val(s)}input_force_numbers_only(e){const t=jQuery(e.currentTarget);let s=parseFloat(t.val().replace(/[^\d\.]/g,""));if(isNaN(s))s="";else{const e=parseInt(t.attr("data-precision"),10);e&&(s=s.toFixed(e))}return t.val(s)}check_all(e){const t=jQuery(e.currentTarget).data("check-all");return jQuery(t).prop("checked",!0).trigger("change")}uncheck_all(e){const t=jQuery(e.currentTarget).data("uncheck-all");return jQuery(t).prop("checked",!1).trigger("change")}toggle_check_all(e){const t=jQuery(e.currentTarget),s=t.data("toggle-check-all"),r=t.is(":checked");return jQuery(s).prop("checked",r)}disable_submit_on_submit(e){return jQuery(e.currentTarget).find('input[type="submit"]').attr("disabled",!0)}submit_parent_form(e){return jQuery(e.currentTarget).closest("form").submit()}send_ajax_contact(e,t){return jQuery.post("/pages/contact",{page:{subject:e,message:t}})}toggle_accordion_row(e){return"collapse"===jQuery(e.currentTarget).attr("class")?this.collapse_accordion_rows():(this.collapse_accordion_rows(),jQuery(e.currentTarget).attr("class","collapse").closest(".accordion-row").addClass("is-expanded"))}collapse_accordion_rows(){return jQuery(".accordion-row.is-expanded").each(((e,t)=>jQuery(t).removeClass("is-expanded").find('[data-toggle="row-expand"]').attr("class","expand")))}show_submenu(e){return jQuery(e.currentTarget).addClass("active")}hide_submenu(e){return jQuery(e.currentTarget).removeClass("active")}vex_confirm_dialog(e){e.preventDefault(),e.stopPropagation();const t=jQuery(e.currentTarget),s=t.attr("data-vex-confirm").replace(/\n/g,"
"),r=t.attr("data-vex-method");return setup.require(["vex_dialog"],(()=>vex.dialog.confirm({message:s,callback:e=>{if(e)return t.removeAttr("data-vex-confirm"),null!=r&&0!==r.length&&t.attr("data-method",r),t.trigger("click")}})))}toggle_js_hide(e){const t=jQuery(e.currentTarget),s=t.attr("data-toggle-js-hide");if(jQuery(s).toggleClass("js-hide"),".signup-form-1, .signup-form-2"===s)return t.trigger("ff-signup")}change_js_hide(e){const t=jQuery(e.currentTarget);return jQuery(t.attr("data-change-js-hide")).toggleClass("js-hide")}add_js_hide(e){const t=jQuery(e.currentTarget);return jQuery(t.attr("data-add-js-hide")).addClass("js-hide")}remove_js_hide(e){const t=jQuery(e.currentTarget);return jQuery(t.attr("data-remove-js-hide")).removeClass("js-hide")}text_counter_input_text_updated(e){const t=jQuery(e.currentTarget),s=t.val();let{length:r}=s;return r+=s.split("\n").length-1,t.siblings(".caption-counter").find(".caption-length").text(r)}word_counter_input_text_updated(e){let t;const s=jQuery(e.currentTarget),r=s.val().trim();return""===r?t=0:({length:t}=r.replace(/\s+/g," ").split(" ")),s.siblings(".caption-counter").find(".caption-length").text(t)}text_counter_trix_input_text_updated(e){const t=jQuery(e.currentTarget),s=t.text();let{length:r}=s;const i=t.html().match(/
/g);if(i&&(r+=i.length),t.siblings(".caption-counter").find(".caption-length").text(r),"trix-change"===e.type||"trix-focus"===e.type){let e=t.attr("data-max-length");if(e)return 0===r?t.removeClass("parsley-validated parsley-error parsley-success").removeAttr("data-manual-validation"):(t.addClass("parsley-validated").attr("data-manual-validation",!0),e=parseInt(e,10),r>e?t.removeClass("parsley-success").addClass("parsley-error"):t.removeClass("parsley-error").addClass("parsley-success"))}}slugify_text(e){return e.trim().toLowerCase().replace(/\s{1,}/g,"-").replace(/[^a-zA-Z0-9\-]/g,"")}apply_custom_select(){if(jQuery("[data-custom-select]:not(.hasCustomSelect)").length>0)return setup.require(["customselect"],(()=>jQuery("[data-custom-select]:not(.hasCustomSelect)").customSelect()))}open_modal_on_page_change(){const e=jQuery("#open_modal_on_page_change");e.length&&this.modal_named(e.attr("data-modal-name"))}bodyFreezeScroll(){const e=jQuery(window.document.body),t=e.innerWidth();e.css({overflow:"hidden",boxSizing:"border-box"});const s=(e.css("paddingRight")?"+=":"")+(e.innerWidth()-t);return e.css({paddingRight:s})}bodyUnfreezeScroll(){return jQuery(window.document.body).css({overflow:"auto",boxSizing:"",paddingRight:""})}galleryBodyFreezeScroll(){const e=jQuery(window.document.body),t=e.innerWidth();e.addClass("freeze-body-scroll");const s=(e.css("paddingRight")?"+=":"")+(e.innerWidth()-t);return e.css({paddingRight:s})}galleryBodyUnfreezeScroll(){return jQuery(window.document.body).removeClass("freeze-body-scroll")}disable_enter_key(e){if(13===e.keyCode)return!1}apply_trix_editor(){const e=jQuery("trix-editor-placeholder");if(0!==e.length)return setup.require(["trix"],(()=>e.each((function(e,t){const s=jQuery(t);let r=s[0].outerHTML;return r=r.replace(/r[0].innerHTML=e))}update_sibling_date(e){let t,s;const r=jQuery(e.currentTarget),i=jQuery(r.attr("data-date-update-sibling-date"));if(!r.length||!i.length)return;const a=r.attr("data-date-update-sibling-type");if("start"===a?(s=i,t=r):"end"===a&&(s=r,t=i),!s.val()||!t.val())return;const n=s.datepicker("getDate"),o=t.datepicker("getDate");if("start"===a){if(oo)return t.datepicker("setDate",n).trigger("change")}click_js_confirm(e){const t=jQuery(e.currentTarget);if(!t.attr("data-has-confirmed")){e.preventDefault();const s=t.attr("data-js-confirm");return setup.require(["vex_dialog"],(()=>vex.dialog.confirm({message:s,callback(e){if(e)return t.attr("data-has-confirmed",!0),t[0].click()}})))}}clear_placeholder_focused(e){return jQuery(e.currentTarget).attr("placeholder","")}clear_placeholder_blurred(e){const t=jQuery(e.currentTarget);return t.attr("placeholder",t.attr("data-clear-placeholder"))}submit_element_and_prevent_default_if_present(e){const t=jQuery(e.currentTarget).attr("data-trigger-submit-if-present");if(!t)return;const s=jQuery(t);s.length>0&&(e.preventDefault(),s.trigger("submit"))}apply_readmore_labels(){if(window.skip_readmore_labels)return void(window.skip_readmore_labels=!1);const e=jQuery("[data-expandable]");return 0!==e.length?e.each((function(){const e=jQuery(this);if(e.height()jQuery(t).trigger("click")))}}auto_submit_forms(){return jQuery('form[data-auto-submit="true"]').trigger("submit")}scroll_to_anchor(e){e.preventDefault();const t=e.currentTarget.href.substring(e.currentTarget.href.indexOf("#"));if(t){const e=jQuery(t);if(e.length>0){const t=e.offset().top-this.header_height;return jQuery(window).scrollTop(t)}}}select2_dropdown_changed(e){const t=jQuery(e.currentTarget);let s=!1;return t.find(":selected").length&&(s=!0),t.siblings(".select2").find(".select2-selection").toggleClass("has-dropdown",!s)}ff_visit(e){return util_visit(e.currentTarget.getAttribute("data-ff-visit"))}add_to_list_facade_clicked(){return filmfreeway.check_role("filmmaker",filmfreeway.error_text.requires_filmmaker_account),!0}submit_form_with_manual_validation(e){return!(jQuery(e.currentTarget).find("[data-manual-validation].parsley-error").length>0)}}).initClass(),window.filmfreeway=new FilmFreeway,FilmFreeway.Pagination=class{constructor(e,t){this.pagination_click=this.pagination_click.bind(this),this._success_callback=t,this._before_callback=void 0,void 0!==e?jQuery(document).on("click",`[${e}] [data-paginator-page]`,this.pagination_click):jQuery(document).on("click","[data-paginator-page]",this.pagination_click)}set_success_callback(e){return this._success_callback=e}set_before_callback(e){return this._before_callback=e}pagination_click(e){e.preventDefault();const t=jQuery(e.currentTarget),s=t.closest("[data-paginator-url]").data("paginator-url"),r=t.data("paginator-page");if(void 0!==s&&void 0!==r){const e={url:s,data:{page:r}};return void 0!==this._success_callback&&(e.success=this._success_callback),void 0!==this._before_callback&&(e.beforeSend=this._before_callback),jQuery.ajax(e)}}},function(e){const t=null==(e=document.currentScript)?void 0:e.nonce;function s(e){t&&t!==(e.nonce||e.getAttribute("nonce"))?setTimeout((()=>{console.error("Loader script with wrong nonce",e)}),3e3):System.eval(e.textContent)}self._ff_loadGlobals(Array.from(document.querySelectorAll('script[type="loader-globals"]'))),Array.from(document.querySelectorAll('script[type="loader"]')).forEach(s),jQuery(document).one("page:change",(()=>{Array.from(document.querySelectorAll('script[type="late-loader"]')).forEach(s)}))}(),function(e){(e=self).dataLayer||(e.dataLayer=[]),self.gtag=function(){self.dataLayer.push(arguments)},self.gtag("js",new Date),FFConstants.TAG_MANAGER_ID&&self.gtag("config",`AW-${FFConstants.TAG_MANAGER_ID}`),FFConstants.GA4_TRACKING_ID&&self.gtag("config",FFConstants.GA4_TRACKING_ID,{referrer:-1!==document.location.search.indexOf("reset_login_referrer=true")?"https://filmfreeway.com/login":document.referrer,test_dimension:self.__testCasesGA__||""}),self.filmfreeway.fireTwitterPixel=()=>{setup.require(["twitter"],(()=>{var e;null==(e=self.twttr)||e.conversion.trackPid(FFConstants.TWITTER_PIXEL_ID,{tw_sale_amount:0,tw_order_quantity:0})}))},FFConstants.CF_ANALYTICS_TOKEN&&self.deferAfterShow((()=>{setTimeout((()=>{setup.preload(["cloudflare_analytics"])}),2500)})),self.deferAfterShow((()=>{setup.preload(["ga4tagmanager","googletagmanager"])}));const t=(e,t,s,r,i)=>{e||(e="General"),t||(t="Click"),s||(s="Unknown"),r||(r=0);const a=t.replace(/\s/g,"_").toLowerCase(),n={send_to:FFConstants.GA4_TRACKING_ID,event_category:e,event_label:s,event_value:r};self.gtag("event",a,n)};self.purchaseEvent=(e,t,s)=>{s||(s={});const r=Object.entries(s).map((([e,t])=>({item_name:e,item_category:e,item_price:Number(t),item_quantity:1})));self.gtag("event","purchase",{send_to:FFConstants.GA4_TRACKING_ID,transaction_id:String(e),value:Number(t),currency:"USD",items:r})},self.ga=(e,s,r,i,a,n,o)=>{"send"===e?"event"===s?t(r,i,a,n):console.warn("GA Compatibility: Only works with event",e,s,r,i,a,n):console.warn("GA Compatibility: Only works with send",e,s,r,i,a,n)},self.gaCompatibleHash=(e,t)=>{self.ga("send",t.hitType||"event",t.eventCategory,t.eventAction,t.eventLabel,t.eventValue)},jQuery(document).on("click","[data-ga]",(e=>{const s=jQuery(e.currentTarget),r=s.data("ga-category"),i=s.data("ga-action"),a=s.data("ga-label"),n=s.data("ga-value");s.data("ga-conversion"),t(r,i,a,n)}))}(),function(){class e{constructor(){this.pageView=()=>{throw new Error("Implement me")},this.clickEvent=e=>{throw new Error("Implement me")},this.purchase=(e,t)=>{throw new Error("Implement me")},this.eventDataFromElement=e=>{const t=jQuery(e.currentTarget);return{category:t.data("ga-category")||"General",action:t.data("ga-action")||"Click",label:t.data("ga-label")||"Unknown",value:t.data("ga-value")||0}}}}class t extends e{constructor(){super(),this.pageView=()=>{},this.clickEvent=e=>{var t;const{category:s}=this.eventDataFromElement(e);0===(null==s||null==(t=s.indexOf)?void 0:t.call(s,"Submit Button"))&&this.googleAdsClickConversion.forEach((e=>{this.conversion({send_to:e})}))},this.purchase=(e,t)=>{Object.keys(t).forEach((s=>{(this.googleAdsCartConversion[s]||[]).forEach((r=>this.conversion({send_to:r,transaction_id:`${s}-${e}`,value:t[s],currency:"USD"})))}))},this.conversion=e=>{self.gtag("event","conversion",e)},this.remarket=e=>{const[t,s]=e.send_to.split("/");self.gtag("config",t)};const e=self.googleAds;if(this.googleAdsGlobal=new Set,this.googleAdsClickConversion=new Set,this.googleAdsCartConversion={},e){const t=e;Object.keys(t).forEach((e=>{const s=t[e];s.filter((e=>"Global site tag"===e.type)).forEach((e=>this.googleAdsGlobal.add(e.value))),s.filter((e=>"Submit Now"===e.type)).forEach((e=>this.googleAdsClickConversion.add(e.value)));const r=new Set;s.filter((e=>"Purchase"===e.type)).forEach((e=>r.add(e.value))),this.googleAdsCartConversion[e]=r})),this.googleAdsGlobal.forEach((e=>{this.remarket({send_to:e})}))}}}self.external_analytics=new class{constructor(){this.pageView=()=>{this.analyticsManagers.forEach((e=>e.pageView()))},this.clickEvent=e=>{this.analyticsManagers.forEach((t=>t.clickEvent(e)))},this.purchase=(e,t)=>{this.analyticsManagers.forEach((s=>s.purchase(e,t)))},this.analyticsManagers=[new t],self.deferAfterShow(this.pageView),jQuery(document).on("click","[data-external-ga]",this.clickEvent)}}}(),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"object"==typeof exports?exports.Currency=t():e.Currency=t()}(this,(function(){var e;class t{static getCurrencyMap(){return s}static currentCurrency(){const e=__currentCurrency.currency;if(e)return e;{const e="USD";return console.warn("You do not have a currency."),t.setCurrentCurrency(e),e}}static setCurrentCurrency(e){__currentCurrency={currency:e}}static hasDecimal(e){const t=s[e];if(t)return 0!==t.precision;throw new Error(e+" is not a valid currency.")}static decimalWidth(e){let s=0;return t.hasDecimal(e)?(s=2,s):s}static unit(e){const s=t.getCurrencyMap()[e];if(s)return s.unit;throw new Error("Currency does not exist")}static precisionValidationExpression(e){try{return t.hasDecimal(e)?"^\\d+(\\.\\d{1,2})?$":"^\\d+$"}catch(e){console.error(e)}}static precisionFormat(e,s=!1){if(s&&!window.math)throw new Error("Mathjs must be imported to use Mathjs precision");return function(){let r=arguments[0];arguments[1]&&(r=arguments[1]);const i=parseFloat(r);if("number"==typeof r&&0==r)return"";if(isNaN(i)||r instanceof Array)return"";const a=t.decimalWidth(e);if(t.hasDecimal(e)){if(s)return math.round(i,a).toFixed(a);const e=Math.pow(10,a);return(Math.round(i*e)/e).toFixed(a)}return r=s?math.round(i):Math.round(i),r.toFixed(a)}}}e=t,t.BASE="USD",t.format=(t,r,i={})=>{if(isNaN(t)||"string"==typeof t&&0===t.length)return console.error(`${t} is not a number.`),t;let a=babelHelpers.objectSpread2({prettyNumber:!1},i);const n=s[r];if(!n)throw new Error("Invalid currency type");let{precision:o}=n;const{format:c,unit:l}=n;return a.prettyNumber&&t-Math.floor(t)==0&&(o=0),e._number_to_currency(t,{precision:o,unit:l,format:c})},t._number_to_currency=(t,s)=>{try{s=s||{};const a=isNaN(s.precision)?2:s.precision,n=s.unit||"$",o=a>0?s.separator||".":"";let c;c="string"==typeof s.delimiter?s.delimiter:",";var r=parseFloat(t).toFixed(a).split("."),i=e._number_with_delimiter(r[0],c)+(o+(r[1]?r[1].toString():""));return e._formatAll(s.format,n,i)}catch(e){return console.log(e),t}},t._number_with_delimiter=(e,t,s)=>{try{"string"!=typeof t&&(t=t||","),s=s||".";let r=e.toString().split(".");return r[0]=r[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+t),r.join(s)}catch(t){return console.error(t),e}},t._formatAll=(t,s,r)=>{const i=/%u|%n/,a=t.replace(i,(function(e){switch(e){case"%u":return s;case"%n":return r}}));return t.match(i)?e._formatAll(a,s,r):a};const s=Object.freeze({USD:{precision:2,unit:"$",format:"%u%n"},AED:{precision:2,unit:"AED",format:"%u%n"},AUD:{precision:2,unit:"$",format:"%u%n"},BGN:{precision:2,unit:"лв",format:"%u%n"},BRL:{precision:2,unit:"R$",format:"%u%n"},CAD:{precision:2,unit:"$",format:"%u%n"},CHF:{precision:2,unit:"CHF",format:"%n %u"},CLP:{precision:0,unit:"$",format:"%u%n"},CNY:{precision:2,unit:"¥",format:"%u%n"},COP:{precision:0,unit:"$",format:"%u%n"},CRC:{precision:0,unit:"₡",format:"%u%n"},CZK:{precision:0,unit:"Kč",format:"%n %u"},DKK:{precision:2,unit:"kr",format:"%n %u"},EUR:{precision:2,unit:"€",format:"%u%n"},GBP:{precision:2,unit:"£",format:"%u%n"},HKD:{precision:2,unit:"$",format:"%u%n"},HRK:{precision:2,unit:"kn",format:"%n %u",deprecated:!0},HUF:{precision:0,unit:"Ft",format:"%u%n"},ILS:{precision:2,unit:"₪",format:"%u%n"},INR:{precision:0,unit:"₹",format:"%u%n"},JPY:{precision:0,unit:"¥",format:"%u %n"},KRW:{precision:0,unit:"₩",format:"%u%n"},KZT:{precision:0,unit:"₸",format:"%n%u"},MAD:{precision:2,unit:"MAD",format:"%u%n"},MXN:{precision:0,unit:"$",format:"%u%n"},MYR:{precision:2,unit:"RM",format:"%u%n"},NOK:{precision:2,unit:"kr",format:"%n %u"},NZD:{precision:2,unit:"$",format:"%u%n"},PEN:{precision:2,unit:"S/",format:"%u%n"},PHP:{precision:0,unit:"₱",format:"%u%n"},PLN:{precision:2,unit:"zł",format:"%n %u"},RON:{precision:2,unit:"lei",format:"%u%n"},RUB:{precision:0,unit:"₽",format:"%n%u"},SAR:{precision:2,unit:"SR",format:"%u%n"},SEK:{precision:2,unit:"kr",format:"%n %u"},SGD:{precision:2,unit:"$",format:"%u%n"},THB:{precision:0,unit:"฿",format:"%u%n"},TRY:{precision:2,unit:"₺",format:"%n %u"},TWD:{precision:0,unit:"$",format:"%u%n"},UYU:{precision:0,unit:"$U",format:"%u%n"},ZAR:{precision:0,unit:"R",format:"%u%n"}});return Object.keys(s).forEach((e=>Object.freeze(s[e]))),t})),function(){class e extends Error{}class t extends Error{constructor(e,t=!1){if(!e)throw new Error("ErrorResponse requires a message");super(e),this.should_refresh=Boolean(t)}}FilmFreeway.CartsController=class{constructor(){var s=this;this.cart_do_checkout=async function(e){const r="Please select a payment method.",i=jQuery(e.currentTarget),a=jQuery("input[data-cart-checkout-url]:checked");let n;if(0===a.length)return void alert(r);const o=a.attr("data-cart-checkout-url"),c=a.val();if(!o)return void alert(r);if(0!==jQuery("[data-credit-card-expiration-update-form]").length)return void alert("Please update the expiration date of your card before checking out.");const l=jQuery("#DiscountCodeCode");if(1===l.length&&""!==l.val())return void alert("Please apply the Discount / Waiver Code before completing order.");const u=jQuery("#ticket_information_collection_form");if(u.length>0&&!u.parsley("isValid"))return void u.parsley("validate");const d={};if("new-card"===c){n=jQuery("[data-cart-payment-method]");const t=jQuery("#zipform")[0];if(!t.checkValidity())return void self.alertWithPromise("Please provide a billing country and postal code").then((()=>{setTimeout((()=>{t.scrollIntoView(),t.reportValidity()}),400)}));let s=n.find('[name="payment_method_id"]');const r=jQuery("#RememberCard").is(":checked");if(!s.val()){i.attr("disabled",!0),NProgress.start();const t=window.elementsSetup.number;let r="";try{var _;const{paymentMethod:e,error:a}=await stripe.createPaymentMethod({type:"card",card:t,billing_details:{email:String(self.sentryIdentifiers.email||jQuery('input[data-cart-ticket-information-value][type="email"]').val()).trim(),name:self.sentryIdentifiers.username,address:{postal_code:jQuery("#newCardCountryZip").val(),country:null==(_=self.country_hash[jQuery("#newCardCountrySelect").val()])?void 0:_.toUpperCase()}}});if(null!=a&&a.message)throw new Error(a.message);r=e.id,s=n.find('[name="payment_method_id"]'),s.val(r),i.attr("disabled",!1),i.trigger("click")}catch(e){console.error("Error creating payment method",e),i.attr("disabled",!1),NProgress.done(),alert(e.message)}return}d.payment_method_id=s.val(),d.publishable_key=window.STRIPE_PUBLISHABLE_KEY,r&&(d.save_credit_card=!0)}else c.match(/^saved/)&&(d["use-card"]=a.attr("data-saved-credit-card-id"));const h=jQuery("[data-filmfreeway-credit]").data("filmfreeway-credit");null!=h&&(d.filmfreeway_credit=h);const m=jQuery("[data-cart-ticket-information-password]");1===m.length&&(d.password=m.val()),i.attr("disabled",!0),NProgress.start();try{return await s.submit_payment(o,d,e)}catch(e){console.error("Cart submit payment error",e),e instanceof t?(jQuery("input[name=payment-method-mobile]:visible").length>0&&jQuery("#use-none-mobile").prop("checked",!0).trigger("change"),i.attr("disabled",!1),n&&n.find('[name="payment_method_id"]').val(""),alert({message:e.message,callback:()=>{e.should_refresh&&window.location.reload()}})):alert({message:"Unexpected response",callback:()=>window.location.reload()})}finally{NProgress.done()}},this.submit_payment=async function(r,i,a){const n=await jQuery.ajax({type:"POST",url:r,data:i});if("object"==typeof n){if("success"===n.result&&n.url)return window.location.href=n.url;if("requires_action"===n.result&&n.payment_intent_client_secret){let e,o;try{!function(){const e=getScrollbarWidth(),t=$("body");t.toggleClass("stripe-modal",!0),t.get(0).style.setProperty("--stripeScrollbarWidth",`${e}px`)}();const t=await stripe.handleCardAction(n.payment_intent_client_secret);e=t.error,o=t.paymentIntent}finally{!function(){const e=$("body");e.toggleClass("stripe-modal",!1),e.get(0).style.removeProperty("--stripeScrollbarWidth")}()}if(e)throw console.error("Handle card action error",e),new t(e.message);const c=babelHelpers.objectSpread2({"saved-use-card":n["saved-use-card"],payment_intent_id:o.id},i);return void await s.submit_payment(r,c,a)}if("error"===n.result&&n.error)throw new t(n.error,n.should_refresh)}throw new e(n.message)},this.bind_cart_show_functions=this.bind_cart_show_functions.bind(this),this.submit_discount_code_form=this.submit_discount_code_form.bind(this),this.remove_discount=this.remove_discount.bind(this),this.submission_protection_updated=this.submission_protection_updated.bind(this),this.cart_do_checkout=this.cart_do_checkout.bind(this),this.setup_cart_page=this.setup_cart_page.bind(this),this.add_cover_letter=this.add_cover_letter.bind(this),this.edit_cover_letter=this.edit_cover_letter.bind(this),this.clear_cover_letter=this.clear_cover_letter.bind(this),this.update_cover_letter=this.update_cover_letter.bind(this),this.use_credit_card_preference_changed=this.use_credit_card_preference_changed.bind(this),this.save_credit_card_preference_changed=this.save_credit_card_preference_changed.bind(this),this.timer_setup=this.timer_setup.bind(this),this.timer_update=this.timer_update.bind(this),this.bind_cart_show_functions()}bind_cart_show_functions(){return jQuery(document).on("click","[data-apply-discount-code]",this.submit_discount_code_form),jQuery(document).on("click","[data-remove-discount]",this.remove_discount),jQuery(document).on("change","input[type=checkbox][data-submission-protection-add]",this.submission_protection_updated),jQuery(document).on("click","[data-confirm-and-pay]",this.cart_do_checkout),jQuery(document).on("keyup keydown change","#DiscountCodeCode",this.cart_discount_code_change),jQuery(document).on("page:change",this.setup_cart_page),jQuery(document).on("click","[data-cart-add-cover-letter]",this.add_cover_letter),jQuery(document).on("click","[data-cart-edit-cover-letter]",this.edit_cover_letter),jQuery(document).on("click","[data-cart-remove-cover-letter]",this.clear_cover_letter),jQuery(document).on("click","[data-cart-save-cover-letter]",this.update_cover_letter),jQuery(document).on("change",'[name="payment-method-desktop"]',this.use_credit_card_preference_changed),jQuery(document).on("change","[data-cart-save-credit-card]",this.save_credit_card_preference_changed),jQuery(document).on("page:change",this.timer_setup)}submit_discount_code_form(e){const t=jQuery(e.currentTarget).data("apply-discount-code"),s=jQuery("#DiscountCodeCode").val();if(""===s.trim())return;const r={code:s};return NProgress.start(),jQuery.post(t,r,(e=>(jQuery("#DiscountCodeCode").val(""),e.success?self.util_visit(location.href):(NProgress.done(),null!=e.message?e.message.startsWith("This discount code will result in a fee")?self.util_visit(location.href):alert(e.message):alert("The code you entered is invalid or expired. Please check the code and try again.")))))}remove_discount(e){e.preventDefault();const t=jQuery(e.currentTarget).attr("href");return NProgress.start(),jQuery.post(t,{_method:"delete"},(e=>self.util_visit(location.href)))}submission_protection_updated(e){let t;const s=jQuery(e.currentTarget);return t=s.is(":checked")?s.data("submission-protection-add"):s.data("submission-protection-remove"),s.prop("disabled",!0),NProgress.start(),jQuery.post(t,(e=>(jQuery("[data-cart-payment-summary-container]").replaceWith(e),s.prop("disabled",!1),NProgress.done())))}cart_discount_code_change(e){const t=jQuery(e.currentTarget),s=jQuery("[data-apply-discount-code]");if(0===s.length)return;let r=!1;t.val().trim()&&(r=!0),s.toggleClass("js-hide",!r)}setup_cart_page(){if(document.getElementById("cart-cleaned-up-message")&&filmfreeway.modal_named("cart-cleaned-up-message"),!document.getElementById("CartCheckoutPage"))return;jQuery("[data-mobile-payment-method-container]:visible").length>0&&setup.preload(["vex_dialog"]);const e=jQuery("#use-none-mobile:visible:checked");return 1===e.length?e.prop("checked",!1):void 0}add_cover_letter(e){const t=jQuery(e.currentTarget).closest("[data-cart-table]");return t.find("[data-cart-add-cover-letter-container]").addClass("js-hide"),t.find("[data-cover-letter-input-container]").removeClass("js-hide")}edit_cover_letter(e){const t=jQuery(e.currentTarget).closest("[data-cart-table]");return t.find("[data-cart-edit-cover-letter-container]").addClass("js-hide"),t.find("[data-cover-letter-input-container]").removeClass("js-hide")}clear_cover_letter(e){const t=jQuery(e.currentTarget).closest("[data-cart-table]");return t.find("[data-cover-letter-input]").val(""),t.find("[data-cart-save-cover-letter]").trigger("click")}update_cover_letter(e){NProgress.start();const t=jQuery(e.currentTarget).attr("disabled",!0),s=t.closest("[data-cart-table]"),r=t.attr("data-update-cover-letter-path"),i=s.find("[data-cover-letter-input]").val();return jQuery.post(r,{cover_letter:i},(e=>(NProgress.done(),t.attr("disabled",!1),!0===e?(s.find("[data-cover-letter-input-container]").addClass("js-hide"),""===i?s.find("[data-cart-add-cover-letter-container]").removeClass("js-hide"):s.find("[data-cart-edit-cover-letter-container]").removeClass("js-hide")):alert({message:"There was an error saving the cover letter",callback:()=>window.location.reload()}))))}use_credit_card_preference_changed(e){const t=jQuery(e.currentTarget);return jQuery("[data-new-credit-card-form-desktop]").toggleClass("js-hide","credit-card"!==t.val())}save_credit_card_preference_changed(e){const t=jQuery(e.currentTarget),s={on:!1};return t.is(":checked")&&(s.on=!0),jQuery.post(t.data("cart-save-credit-card"),s)}timer_setup(){const e=jQuery("[data-timer-remaining]");if(e.length>0)return clearTimeout(filmfreeway._timer),this.timer_update(e,parseInt(e.data("timer-remaining")))}timer_update(e,t){if(t>=0)return e.text(`${("0"+parseInt(t/60).toString()).slice(-2)}:${("0"+(t%60).toString()).slice(-2)}`),filmfreeway._timer=setTimeout((()=>this.timer_update(e,t-1)),1e3);{let e=null,t=null;if(jQuery("[data-terminate-tickets-url]").length>0?(e=jQuery("[data-terminate-tickets-url]").data("terminate-tickets-url"),t=jQuery("[data-terminate-tickets-return-url]").data("terminate-tickets-return-url")):jQuery("[data-terminate-marketings-url]").length>0&&(e=jQuery("[data-terminate-marketings-url]").data("terminate-marketings-url"),t=jQuery("[data-terminate-marketings-return-url]").data("terminate-marketings-return-url")),null!=e)return jQuery.post(e,(()=>alert({message:"Reservation has expired",callback(){if(null!=t)return location.href=t}})))}}},filmfreeway.carts_controller=new FilmFreeway.CartsController}(),FilmFreeway.FestivalDuplicateSignupCheckController=class{constructor(){this.bind_festival_duplicate_signup_check_functions=this.bind_festival_duplicate_signup_check_functions.bind(this),this.signup_form_submitted=this.signup_form_submitted.bind(this),this.check_for_duplicate_signup=this.check_for_duplicate_signup.bind(this),this.take_user_to_subuser_request_access_page=this.take_user_to_subuser_request_access_page.bind(this),this.recaptcha_render=this.recaptcha_render.bind(this),this.bind_festival_duplicate_signup_check_functions(),this.OK_to_submit=!1}bind_festival_duplicate_signup_check_functions(){jQuery(document).on("submit","#new_user_account",this.signup_form_submitted),jQuery(document).on("ff-signup","[data-toggle-js-hide]",this.recaptcha_render),jQuery(document).on("page:change",(()=>{self.location.search.indexOf("external_signup")>-1&&this.recaptcha_render()}))}signup_form_submitted(e){const t=jQuery(e.currentTarget);jQuery("[data-signup-button]").attr("disabled",!0);const s=jQuery('input[name="ff-signup-token"]').val();return"festival"!==t.find('[name="user_account[signup_role]"]:checked').val()||this.OK_to_submit?s?(t.find("input[name='recaptcha-response-token']").val(s),!0):(this.waiting_for_captcha_result||(this.recaptcha_render(),jQuery("#ff-signup-recaptcha-container").toggleClass("js-hide",!1),this.waiting_for_captcha_result=!0,setTimeout((()=>{jQuery("#ff-signup-recaptcha-container iframe").focus()}),10)),setTimeout((()=>{t.trigger("submit")}),100),!1):(setTimeout((()=>this.check_for_duplicate_signup(t)),1),!1)}check_for_duplicate_signup(e){NProgress.start();const t=e.find("#user_account_signup_festival_name").val();return jQuery.get(`/festivals/find_festival_names_matching.json?q=${encodeURIComponent(t)}`,(t=>t instanceof Array?t.length>0?(NProgress.done(),this.take_user_to_subuser_request_access_page(e)):(this.OK_to_submit=!0,e.trigger("submit")):(NProgress.done(),alert("Unknown error. Please try again."))))}take_user_to_subuser_request_access_page(e){const t={first_name:e.find("#user_account_first_name").val(),last_name:e.find("#user_account_last_name").val(),email:e.find("#user_account_email").val(),q:e.find("#user_account_signup_festival_name").val()};return util_visit(`/users/subuser_signup_request?${jQuery.param(t)}`)}recaptcha_render(){this.have_rendered_recaptcha||(setup.require(["recaptcha"],(()=>{self.turnstile.render("#ff-signup-recaptcha")})),this.have_rendered_recaptcha=!0)}},self.filmfreeway.festival_duplicate_signup_check_controller=new FilmFreeway.FestivalDuplicateSignupCheckController,FilmFreeway.FestivalProfileGalleryController=class{constructor(){this.bind_festival_profile_gallery_functions=this.bind_festival_profile_gallery_functions.bind(this),this.check_if_gallery_should_immediately_load=this.check_if_gallery_should_immediately_load.bind(this),this.festival_photo_gallery_overlay_clicked=this.festival_photo_gallery_overlay_clicked.bind(this),this.close_festival_photo_gallery=this.close_festival_photo_gallery.bind(this),this.open_festival_photo_gallery=this.open_festival_photo_gallery.bind(this),this.state_changed_on_gallery=this.state_changed_on_gallery.bind(this),this.bind_festival_profile_gallery_functions()}bind_festival_profile_gallery_functions(){return jQuery(document).on("click","[data-festival-show-photo-gallery]",this.open_festival_photo_gallery),jQuery(document).on("click","[data-festival-profile-media-gallery-overlay]",this.festival_photo_gallery_overlay_clicked),jQuery(document).on("click","[data-festival-profile-media-gallery-close]",this.close_festival_photo_gallery),jQuery(document).on("page:change",this.check_if_gallery_should_immediately_load)}check_if_gallery_should_immediately_load(){this.immediate_load=!1;const e=jQuery("[data-gallery-immediately-show-id]");if(0!==e.length){this.immediate_load=!0;const t=e.attr("data-gallery-immediately-show-id");return jQuery(`[data-festival-gallery-photo-id=${t}] a`).trigger("click")}}festival_photo_gallery_overlay_clicked(e){const t=jQuery(e.target),s=jQuery("[data-festival-profile-gallery-container]");jQuery.contains(s[0],t[0])||this.close_festival_photo_gallery()}close_festival_photo_gallery(e){return jQuery("#blueimp-gallery-carousel").data("gallery").close()}open_festival_photo_gallery(e){let t=location.pathname;if(this.immediate_load){this.immediate_load=!1;const e=t.split("/");e.pop(),t=e.join("/")}e.preventDefault();const s=jQuery(e.currentTarget);let r=0;const i=parseInt(s.attr("data-festival-show-photo-gallery"),10),a=[];jQuery("[data-profile-gallery-media][data-festival-photo-data]").each((function(e,t){const s=jQuery(t),n=JSON.parse(s.attr("data-festival-photo-data"));n.id===i&&(r=a.length),a.push(n)}));let n=0,o=0,c=0,l=0;const u=jQuery("#festival-profile-gallery"),d=jQuery("#festival-profile-gallery-canvas"),_=jQuery("#festival-profile-gallery-aside"),h=this;jQuery("[data-festival-profile-media-gallery-overlay]").removeClass("js-hide");const m=jQuery("#blueimp-gallery-carousel");return setup.require(["blueimp","jquery_blueimp"],(e=>{var s=e(a,{index:r,carousel:!0,startSlideshow:!1,container:"#blueimp-gallery-carousel",closeOnEscape:!0,enableKeyboardNavigation:!0,closeOnSlideClick:!1,displayTransition:!1,transitionSpeed:0,onslide:(e,r)=>{let i=!1;const a=s.list[e];if(jQuery("#festival-profile-gallery-aside").removeClass("is-editing-caption").attr("data-current-attachment-id",a.id),jQuery("[data-festival-profile-gallery-caption]").html(safeSimpleFormat(a.caption)),a.width>n&&(d.width(a.width),n=a.width,i=!0),a.height>o&&(u.height(a.height),_.height(a.height),o=a.height,i=!0),i&&jQuery(window).trigger("resize"),this.disable_next_gallery_state_push)return this.disable_next_gallery_state_push=!1;{const s={photo_id:a.id,index:e};return history.replaceState(s,document.title,`${t}/${a.id}`)}},onopen:()=>{jQuery(window).off("popstate.gallery",this.state_changed_on_gallery),jQuery(window).on("popstate.gallery",this.state_changed_on_gallery),jQuery(window).on("orientationchange.gallery",(()=>setTimeout((()=>jQuery(window).trigger("resize")),300))),c=d.width(),l=u.height(),filmfreeway.bodyFreezeScroll()},onopened(){const e={rightAfterOpenGallery:!0,photo_id:this.list[this.index].id,index:r};if(h.disable_next_gallery_state_push||history.pushState(e,document.title,t),n=d.width(),o=u.height(),u.height(o-1),_.height(o-1),jQuery("[data-festival-profile-media-gallery-overlay]").on("click.gallery",(function(){})),jQuery("html").hasClass("internetexplorer")&&navigator.userAgent.match(/rv:11\./))return setTimeout((()=>jQuery("textarea").text("")),120)},onclosed:()=>{jQuery(window).off("orientationchange.gallery"),d.width(c),u.height(l),_.height(l),jQuery("[data-festival-profile-media-gallery-overlay]").addClass("js-hide").off("click.gallery"),filmfreeway.bodyUnfreezeScroll(),history.replaceState({},document.title,t)}});return m.data("gallery",s)}))}state_changed_on_gallery(e){let t;const{state:s}=e.originalEvent;if(!s)return;const r=jQuery("#blueimp-gallery-carousel");return s.photo_id&&null!=s.index?(t=r.data("gallery"),this.disable_next_gallery_state_push=!0,r.is(":visible")?t.slide(s.index):(this.immediate_load=!0,jQuery(`[data-festival-gallery-photo-id=${s.photo_id}] a`).trigger("click"))):r.is(":visible")?(t=r.data("gallery"),t.close()):void 0}},window.filmfreeway.festival_profile_gallery_controller=new FilmFreeway.FestivalProfileGalleryController,FilmFreeway.FestivalsController=class{constructor(){this.bind_festival_index_search=this.bind_festival_index_search.bind(this),this.perform_festival_index_search=this.perform_festival_index_search.bind(this),this.submit_festival_search=this.submit_festival_search.bind(this),this.clear_festival_search_indicator=this.clear_festival_search_indicator.bind(this),this.show_advanced_filters=this.show_advanced_filters.bind(this),this.execute_festival_search_setup=this.execute_festival_search_setup.bind(this),this.apply_search_sliders=this.apply_search_sliders.bind(this),this.bind_festival_show_functions=this.bind_festival_show_functions.bind(this),this.scroll_to_anchor=this.scroll_to_anchor.bind(this),this.bind_festival_show_page_load_checker=this.bind_festival_show_page_load_checker.bind(this),this.festival_show_page_loaded=this.festival_show_page_loaded.bind(this),this.festival_profile_jump_to_section=this.festival_profile_jump_to_section.bind(this),this.initiate_slick_slider=this.initiate_slick_slider.bind(this),this.social_media_share_handler=this.social_media_share_handler.bind(this),this.toggle_category_description=this.toggle_category_description.bind(this),this.festival_modal_display=this.festival_modal_display.bind(this),this.bind_festival_reports_page=this.bind_festival_reports_page.bind(this),this.show_custom_date_range_festival_reports=this.show_custom_date_range_festival_reports.bind(this),this.festival_report_type_change=this.festival_report_type_change.bind(this),this.festival_reports_form_submit=this.festival_reports_form_submit.bind(this),this.export_festival_reports=this.export_festival_reports.bind(this),this.apply_search_suggestions=this.apply_search_suggestions.bind(this),this.festival_search_typeahead_selected=this.festival_search_typeahead_selected.bind(this),this.read_festival_contact_info=this.read_festival_contact_info.bind(this),this.bind_festival_index_search(),this.bind_festival_show_functions(),this.bind_festival_show_page_load_checker(),this.bind_festival_reports_page()}bind_festival_index_search(){return jQuery(document).on("click",".festival-search button",this.perform_festival_index_search),jQuery(document).on("click","[data-filter-toggle=advanced-filters]",this.show_advanced_filters),jQuery(document).on("page:change",this.execute_festival_search_setup),jQuery(document).on("change",'[data-festival-search-form] input[type=radio], [data-festival-search-form] input[type=checkbox], [data-festival-search-form] select[name="sort"], [data-festival-search-form] [data-datepick], [data-country-select], [data-country-select-in-or-out], [data-select-completion-date]',this.submit_festival_search),jQuery(document).on("page:change",this.clear_festival_search_indicator),jQuery(document).on("typeahead:selected","#q[data-typeahead]",this.festival_search_typeahead_selected)}perform_festival_index_search(e){return e.preventDefault(),e.stopPropagation(),this.submit_festival_search()}submit_festival_search(){const e=jQuery("[data-festival-search-form]").serialize();return jQuery("html").addClass("nprogress-action"),util_visit([0!==jQuery("#q").val().length?"/festivals":location.pathname,e].join("?"),!1)}clear_festival_search_indicator(){return jQuery("html").removeClass("nprogress-action")}show_advanced_filters(e){return e.preventDefault(),jQuery("#advanced-filters").toggleClass("is-showing")}execute_festival_search_setup(){if(0!==jQuery("#festival-index-search-form").length)return this.apply_search_sliders(),this.apply_search_suggestions(),jQuery.isEmptyObject(get_query_string())?void 0:facebookTrack("track","Search")}apply_search_sliders(){const e=jQuery("[data-festival-search-form] [data-range-slider]");if(0!==e.length)return setup.require(["ionrangeslider"],(()=>{e.each(((e,t)=>jQuery(t).ionRangeSlider({hide_min_max:!0,prettify_separator:",",force_edges:!0,onFinish:this.submit_festival_search})));let t=null;const s=jQuery("[data-range-slider-runtime]").ionRangeSlider({hide_min_max:!0,prettify_separator:",",force_edges:!0,onFinish:this.submit_festival_search,onChange:e=>t.toggleClass("runtime-filter",0===e.from)});t=jQuery("[data-range-slider-runtime-container] .irs-line"),0===parseInt(s.attr("data-integer-value"),10)&&t.addClass("runtime-filter");const r=jQuery("[data-range-slider-entryfee]"),i=r.data("slider-currency");return r.ionRangeSlider({hide_min_max:!0,prettify_separator:",",force_edges:!0,prettify:e=>Currency.format(e,i,{prettyNumber:!0}),onFinish:this.submit_festival_search})}))}bind_festival_show_functions(){return jQuery(document).on("click","[data-media-share]",this.social_media_share_handler),jQuery(document).on("click","[data-toggle-category]",this.toggle_category_description),jQuery(document).on("click","[data-festival-profile-jump]",this.scroll_to_anchor),jQuery(document).on("click contextmenu","[data-festival-public-contact]",this.read_festival_contact_info)}scroll_to_anchor(e){if("profile"===jQuery("[data-festival-navigation-links]").attr("data-festival-navigation-links")){e.preventDefault();const t=jQuery(e.currentTarget).attr("data-festival-profile-jump");if(t){const e=jQuery(window.jqueryEscapeId(t));if(e.length){const t=e.offset().top-100;jQuery(window).scrollTop(t)}}}}bind_festival_show_page_load_checker(){return jQuery(document).on("page:change",this.festival_show_page_loaded)}festival_show_page_loaded(){if($(".festival-profile").length)return this.festival_modal_display(),this.festival_profile_jump_to_section()}festival_profile_jump_to_section(e){const{hash:t}=location;if(t)return setTimeout((function(){const e=jQuery(window.jqueryEscapeId(t));if(e.length){const t=e.offset().top-100;jQuery(window).scrollTop(t)}}),10)}initiate_slick_slider(){const e=jQuery("[data-profile-cover-slider]");if(e.legnth>0)return e.slick({arrows:!1,autoplay:!0,autoplaySpeed:4e3,pauseOnHover:!1})}social_media_share_handler(e){e.preventDefault;const t=jQuery(e.currentTarget),s=encodeURIComponent(t.attr("data-url")||window.location.href),r=encodeURIComponent(t.attr("data-text")),i=t.attr("data-media-share"),a=t.attr("data-facebook-app-id");switch(!0){case"facebook"===i:return window.open(`https://www.facebook.com/dialog/share?app_id=${a}&href=${s}&caption=${r}&display=popup&redirect_uri=${s}`,"facebook-share-dialog","width=626,height=436");case"twitter"===i:return window.open(`https://twitter.com/share?url=${s}&text=${r}`);case"bluesky"===i:return window.open(`https://bsky.app/intent/compose?text=${r}`);case"pinterest"===i:return window.open(`https://www.pinterest.com/pin/create/button/?url=${s}&description=${r}`);case"reddit"===i:return window.open(`http://www.reddit.com/submit?url=${s}&title=${r}`);case"mail"===i:return location.href=`mailto:?subject=${r}&body=${s}`}}toggle_category_description(e){const t=jQuery(e.currentTarget);return t.closest("li").toggleClass("open"),t.find('span[class*="icon-"]').toggleClass("icon-minus").toggleClass("icon-plus")}festival_modal_display(){if(jQuery("[data-modal-festival-first-publish]").length&&filmfreeway.modal_named("festival-first-publish"),jQuery("[data-modal-festival-gold-welcome]").length&&filmfreeway.modal_named("festival-gold-welcome"),jQuery("[data-modal-festival-publish-review]").length)return filmfreeway.modal_named("festival-publish-review")}bind_festival_reports_page(){return jQuery(document).on("page:change",this.show_custom_date_range_festival_reports),jQuery(document).on("change","select#date-range",this.show_custom_date_range_festival_reports),jQuery(document).on("change","select[data-festival-report-type]",this.festival_report_type_change),jQuery(document).on("submit","form[data-festival-reports-form]",this.festival_reports_form_submit),jQuery(document).on("change","[data-export-festival-reports]",this.export_festival_reports)}show_custom_date_range_festival_reports(){const e=jQuery("select#date-range");if(e.length)return"custom"===e.val()?jQuery("#custom-date-range").show():jQuery("#custom-date-range").hide()}festival_report_type_change(e){const t=jQuery(e.currentTarget).closest("form");return t.find("[data-festival-report-detail]").val("all"),t.submit()}festival_reports_form_submit(e){e.preventDefault();const t=jQuery(e.currentTarget).serialize();return util_visit(`${location.pathname}?${t}`,!1)}export_festival_reports(e){const t=jQuery(e.currentTarget).find(":selected").data("href");if(null!=t)return window.location.href=t}apply_search_suggestions(){return setup.require(["mustache","typeahead","bloodhound"],(function(e,t,s){const r=new s({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"/festivals/search_suggestions.json?q=%QUERY",wildcard:"%QUERY",rateLimitWait:200},limit:10});return r.initialize(),jQuery("#festival-index-search-form #q[data-typeahead]").typeahead({highlight:!0,hint:!1},{name:"search-results",limit:20,displayKey:"value",source:r.ttAdapter(),templates:{suggestion:e.compile(jQuery("#search-suggestion-template").html())}})}))}festival_search_typeahead_selected(e,t){return jQuery(e.currentTarget).typeahead("close"),this.submit_festival_search()}read_festival_contact_info(e){const t=jQuery(e.currentTarget);NProgress.start();const s="_blank"===t.attr("target")?window.open("","_blank"):window;return jQuery.get(t.data("festival-public-contact")).done((function(r){if(t.attr({href:r}),t.removeAttr("data-festival-public-contact"),1===e.which)return s.location.href=r})).fail((()=>alert(t.data("contact-error")))).always((()=>NProgress.done()))}},window.filmfreeway.festivals_controller=new FilmFreeway.FestivalsController,FilmFreeway.PagesController=class{constructor(){this.bind_pages_functions=this.bind_pages_functions.bind(this),this.click_benefit_redeem_button=this.click_benefit_redeem_button.bind(this),this.load_additional_tweets=this.load_additional_tweets.bind(this),this.update_ticket_calculator_price=this.update_ticket_calculator_price.bind(this),this.submit_site_contact_form=this.submit_site_contact_form.bind(this),this.bind_pages_functions()}bind_pages_functions(){return jQuery(document).on("click",".benefit-partner__action",this.click_benefit_redeem_button),jQuery(document).on("click","#load-additional-tweets",this.load_additional_tweets),jQuery(document).on("keyup change","#how-it-works-ticket-price-calculator-input, #how-it-works-ticket-price-calculator-absorb-fees",this.update_ticket_calculator_price),jQuery(document).on("submit","[data-site-contact-form]",this.submit_site_contact_form)}click_benefit_redeem_button(e){let t=!1;try{filmfreeway.check_auth(),t=!0}catch(t){e.preventDefault()}try{let s;const r=jQuery(e.currentTarget).closest("li").find("h5").text();s=t?"Click":"Sign Up",ga("send","event","Benefits Redeem",s,r)}catch(e){}}load_additional_tweets(e){const t=jQuery(e.currentTarget),s=t.attr("id"),r=t.text();t.attr("id",null).text(t.data("loading-msg")),setTimeout((function(){const e=jQuery("#additional-tweets-container"),i=[],a=additional_tweets.splice(0,100);for(;a.length;){const e=a.shift(),t=a.shift();i.push('
'),e&&i.push(e),t&&i.push(t),i.push("
")}return e.append(i.join("")),additional_tweets.length?t.attr("id",s).text(r):t.remove(),setTimeout((()=>twttr.widgets.load()),10)}),10)}ticket_fee_calculator(e,t,s=null){let r,i,a,n;if(s?(({filmfreeway_fee:r}=s),({filmfreeway_flat:i}=s),({processing_fee:a}=s),({processing_flat:n}=s)):(r=0,i=.79,a=.03,n=.3),e=parseFloat(e),isNaN(e))return!1;const o={price:e,absorb_fee:t,processing_fees:0,filmfreeway_fees:0,total_fees:0,festival_receives:0,total:0};if(0===e)return o;let c=Math.round(e*a*100)/100;c+=n;let l=Math.round(e*r*100)/100;l>15&&(l=15);const u=i+l;return o.processing_fees=c,o.filmfreeway_fees=u,o.total_fees=c+u,o.total=e,t?o.festival_receives=o.total-o.total_fees:(o.festival_receives=o.total,o.total+=o.total_fees),o}update_ticket_calculator_price(){let e=parseFloat(jQuery("#how-it-works-ticket-price-calculator-input").val());const t=jQuery("#how-it-works-ticket-price-calculator-absorb-fees").is(":checked");if(isNaN(e)&&(e=parseFloat(jQuery("#how-it-works-ticket-price-calculator-input").attr("placeholder"))),isNaN(e))return;const s=this.ticket_fee_calculator(e,t);return s?(jQuery("[data-filmfreeway-fees]").text(`$${s.filmfreeway_fees.toFixed(2)}`),jQuery("[data-processing-fees]").text(`$${s.processing_fees.toFixed(2)}`),jQuery("[data-buyer-pays]").text(`$${s.total.toFixed(2)}`),jQuery("[data-festival-receives]").text(`$${s.festival_receives.toFixed(2)}`)):void 0}submit_site_contact_form(e){return!(!self.user_signed_in&&!jQuery('input[name="cf-turnstile-response"]').val()&&(alert(jQuery(e.currentTarget).data("retry-captcha-msg")),1))}},filmfreeway.pages_controller=new FilmFreeway.PagesController,window.FilmFreeway.PressKitsController=class{constructor(){this.bind_press_kit_functions=this.bind_press_kit_functions.bind(this),this.play_project_trailer_video=this.play_project_trailer_video.bind(this),this.download_still_zip=this.download_still_zip.bind(this),this.bind_press_kit_functions()}bind_press_kit_functions(){jQuery(document).on("click","[data-press-kit-play-trailer-video]",this.play_project_trailer_video),jQuery(document).on("click","[data-download-still-zip]",this.download_still_zip)}play_project_trailer_video(e){let t;e.preventDefault();const s=jQuery(e.currentTarget),r=1===parseInt(s.attr("data-embed"),10);let i;const a=s.attr("data-poster")||"";return r?(t=jQuery("#press_kit_trailer_modal_embed_template").html(),i=s.attr("data-embed-url")):(t=jQuery("#press_kit_trailer_modal_hosted_template").html(),i=s.attr("data-url")),setup.require(["mustache"],(function(e){const s=e.render(t,{url:i,poster:a});return filmfreeway.modal(s,(function(){window.dynamicReactMount("[data-press-kit-trailer-react]")}))}))}download_still_zip(e){const t=jQuery(e.currentTarget);if(!t.attr("data-disabled-url"))return t.attr("data-disabled-url",t.attr("href")),t.attr("href","#ff_javascript"),setTimeout((function(){return t.attr("href",t.attr("data-disabled-url")),t.removeAttr("data-disabled-url")}),5e3)}},filmfreeway.press_kits_controller=new window.FilmFreeway.PressKitsController,FilmFreeway.ProjectPhotosController=class{constructor(){this.bind_project_photos_functions=this.bind_project_photos_functions.bind(this),this.initialize_gallery=this.initialize_gallery.bind(this),this.get_gallery=this.get_gallery.bind(this),this.fullscreen=this.fullscreen.bind(this),this.bind_project_photos_functions()}bind_project_photos_functions(){return jQuery(document).on("click","[data-project-photo-gallery-fullscreen]",this.fullscreen)}initialize_gallery(){let e=jQuery("#project-photo-media-gallery");const t={container:e,carousel:!0,continuous:!1,startSlideshow:!1,emulateTouchEvents:!1,transitionSpeed:0,titleElement:"#photo_gallery_caption",indicatorContainer:"#photo_gallery_indicator",onslide(t,s){e=jQuery(s).closest(".blueimp-gallery");const r=e.data("gallery");return jQuery("[data-project-photo-media-gallery-download-link]").attr("href",r.list[t].original)}},s=JSON.parse(e.attr("data-gallery-content"));return setup.require(["blueimp","jquery_blueimp"],(function(r){const i=r(s,t);return e.data("gallery",i)}))}get_gallery(){return jQuery("#project-photo-media-gallery").data("gallery")}fullscreen(){const e=this.get_gallery(),{list:t}=e,s={index:e.getIndex(),fullscreen:!0};return setup.require(["blueimp","jquery_blueimp"],(e=>e(t,s)))}},filmfreeway.project_photos_controller=new FilmFreeway.ProjectPhotosController,FilmFreeway.PublicProjectsController=class{constructor(){this.bind_project_show_functions=this.bind_project_show_functions.bind(this),this.public_project_page_load_check=this.public_project_page_load_check.bind(this),this.check_project_password=this.check_project_password.bind(this),this.choose_script_to_download=this.choose_script_to_download.bind(this),this.bind_project_show_functions()}bind_project_show_functions(){return jQuery(document).on("page:change",this.public_project_page_load_check),jQuery(document).on("submit","form[data-private-project-password-check]",this.check_project_password),jQuery(document).on("change","#project_media_script_download_select",this.choose_script_to_download)}public_project_page_load_check(){if(jQuery("#project-photo-media-gallery").length)return filmfreeway.project_photos_controller.initialize_gallery()}check_project_password(e){e.preventDefault();const t=jQuery(e.currentTarget),s=t.find("[type=submit]");s.prop("disabled",!0);const r=t.find("[data-password-help-text]");r.text("");const i=t.attr("data-project-id"),a={password:t.find("[data-password]").val().trim()};return null!=get_query_string().preview&&(a.is_preview=!0,a.preview_password=get_query_string().password),NProgress.start(),jQuery.post(`/projects/${i}/check_project_password.json`,a,(e=>(NProgress.done(),"success"===(null!=e?e.response:void 0)?window.location.reload():(s.prop("disabled",!1),r.text("Incorrect password. Please try again.")))))}choose_script_to_download(e){const t=jQuery(e.currentTarget).find("option:selected").attr("data-script-id");return jQuery("[data-project-media-script-download-link]").addClass("js-hide"),jQuery(`[data-project-media-script-download-link=${t}]`).removeClass("js-hide")}},filmfreeway.public_projects_controller=new FilmFreeway.PublicProjectsController,FilmFreeway.ReviewsController=class{constructor(){this.reviews_initial_bind=this.reviews_initial_bind.bind(this),this.before_reviews_submit=this.before_reviews_submit.bind(this),this.before_reviews_send=this.before_reviews_send.bind(this),this.success_reviews_send=this.success_reviews_send.bind(this),this.helpful_button_click=this.helpful_button_click.bind(this),this.dynamic_star_click=this.dynamic_star_click.bind(this),this.unlock_respond_button=this.unlock_respond_button.bind(this),this.reviews_pagination_callback=this.reviews_pagination_callback.bind(this),this.reviews_pagination_before_callback=this.reviews_pagination_before_callback.bind(this),this.deliver_festival_review_form=this.deliver_festival_review_form.bind(this),this.reviews_initial_bind();const e=new FilmFreeway.Pagination("data-reviews-festival-paginator");e.set_success_callback(this.reviews_pagination_callback),e.set_before_callback(this.reviews_pagination_before_callback)}reviews_initial_bind(){return jQuery(document).on("ajax:before","form[data-reviews-update-form]",this.before_reviews_submit),jQuery(document).on("ajax:beforeSend","form[data-reviews-update-form]",this.before_reviews_send),jQuery(document).on("ajax:success","form[data-reviews-update-form]",this.success_reviews_send),jQuery(document).on("click","a[data-reviews-helpful-url]",this.helpful_button_click),jQuery(document).on("click",'[data-reviews-dynamic-stars] input[type="radio"]',this.dynamic_star_click),jQuery(document).on("keyup","[data-reviews-response-text]",this.unlock_respond_button),jQuery(document).on("click","[data-reviews-review-festival]",this.deliver_festival_review_form)}before_reviews_submit(e){if(jQuery("[data-reviews-section]").length&&!jQuery(e.target).filter('[data-reviews-form-button="delete"]').length)return jQuery(e.currentTarget).find("[data-reviews-sync-field]").val("true")}before_reviews_send(e,t,s){const r=jQuery(e.currentTarget),i=jQuery(e.target).filter('[data-reviews-form-button="delete"]').length>0;if(!i){if(!r.find('[data-reviews-rating="overall_rating"]').val())return alert("Please add an Overall Rating."),!1;const e=r.find("textarea[data-reviews-review-text]");if(!e.length||""===e.first().val().trim())return alert("Please write a review."),!1;let t=0;if(jQuery.each(e.first().val().replace(/\n/g," ").replace(/\r/g," ").split(" "),(function(e,s){if(s.length>1)return t++})),t<5)return alert("Reviews must be at least 5 words."),!1}r.find('[data-reviews-form-button="save"]').prop("disabled","disabled"),r.find('[data-reviews-form-button="delete"]').addClass("opacity-disable");const a=jQuery("[data-reviews-section]");return a.length&&(a.addClass("opacity-disable"),i&&(s.url+="?sync=true")),NProgress.start(),!0}success_reviews_send(e,t,s,r){if(null!=t.success){const e=jQuery("[data-reviews-section]");return e.length?setTimeout((()=>jQuery.get(e.data("reviews-section"),{page:1},((t,s,r)=>(null!=t.success&&(e.replaceWith(t.success),filmfreeway.apply_readmore_labels(),this.scroll_to_reviews()),vex.close(),NProgress.done())))),1500):util_visit(window.location.href)}}helpful_button_click(e){e.preventDefault();const t=jQuery(e.currentTarget);if(!t.filter("[data-reviews-helpful-marked]").length)return jQuery.post(t.data("reviews-helpful-url"),(function(e,s,r){return null!=(null!=e.success?e.success.button:void 0)&&t.text(e.success.button),t.attr("data-reviews-helpful-marked",!0)}))}dynamic_star_click(e){const t=jQuery(e.currentTarget),s=jQuery(`input[data-reviews-rating="${t.attr("name")}"]`);return t.val()!==s.val()?s.val(t.val()):(s.val(""),t.prop("checked",!1))}unlock_respond_button(e){return jQuery(e.currentTarget).closest("form").find("[data-reviews-response-button]").removeAttr("disabled")}reviews_pagination_callback(e,t,s){if(null!=e.success)return jQuery("[data-reviews-section]").replaceWith(e.success),this.scroll_to_reviews(),filmfreeway.apply_readmore_labels()}reviews_pagination_before_callback(e,t){return jQuery("[data-reviews-section]").addClass("opacity-disable")}deliver_festival_review_form(e){filmfreeway.check_auth("filmmaker");const t=jQuery(e.currentTarget);return t.prop("disabled",!0),NProgress.start(),jQuery.get(t.data("reviews-review-festival"),(function(e,s,r){return t.prop("disabled",!1),null!=e.success?filmfreeway.modal(e.success,(()=>filmfreeway.apply_parsleyjs())):e.error?alert(e.error):alert("Please refresh the page and try again."),NProgress.done()}))}scroll_to_reviews(){return jQuery(window).scrollTop(jQuery("[data-reviews-section]").offset().top-99)}},filmfreeway.reviews_controller=new FilmFreeway.ReviewsController,FilmFreeway.SubmissionsController=class{constructor(){this.bind_submission_modal_links=this.bind_submission_modal_links.bind(this),this.submission_modal_close_callback=this.submission_modal_close_callback.bind(this),this.open_submission_dialog=this.open_submission_dialog.bind(this),this.render_submission_modal_category_fees=this.render_submission_modal_category_fees.bind(this),this.project_selector_changed=this.project_selector_changed.bind(this),this.update_custom_fields=this.update_custom_fields.bind(this),this.field_value_should_allow_free_input=this.field_value_should_allow_free_input.bind(this),this.custom_field_value=this.custom_field_value.bind(this),this.submission_form_inputs_changed=this.submission_form_inputs_changed.bind(this),this.disable_submission_buttons=this.disable_submission_buttons.bind(this),this.enable_submission_buttons=this.enable_submission_buttons.bind(this),this.submit_project_to_festival=this.submit_project_to_festival.bind(this),this.bind_festival_submission_index_functions=this.bind_festival_submission_index_functions.bind(this),this.submission_index_loaded=this.submission_index_loaded.bind(this),this.populate_assigned_users_in_dropdown=this.populate_assigned_users_in_dropdown.bind(this),this.assign_or_unassign_submission=this.assign_or_unassign_submission.bind(this),this.disable_show_all_button=this.disable_show_all_button.bind(this),this.submission_status_changing=this.submission_status_changing.bind(this),this.new_submission_status_selected=this.new_submission_status_selected.bind(this),this.submission_disqualification_form_submitted=this.submission_disqualification_form_submitted.bind(this),this.bulk_email_submitters=this.bulk_email_submitters.bind(this),this.show_export_options_modal=this.show_export_options_modal.bind(this),this.export_submissions_with_options=this.export_submissions_with_options.bind(this),this.do_export_submissions_with_params=this.do_export_submissions_with_params.bind(this),this.update_the_submission_export_status=this.update_the_submission_export_status.bind(this),this.email_me_when_done_with_export=this.email_me_when_done_with_export.bind(this),this.export_ratings=this.export_ratings.bind(this),this.submissions_clear_advanced_filters=this.submissions_clear_advanced_filters.bind(this),this.advanced_filters_changed=this.advanced_filters_changed.bind(this),this.has_advanced_filters=this.has_advanced_filters.bind(this),this.bulk_action_change=this.bulk_action_change.bind(this),this.check_all_submissions=this.check_all_submissions.bind(this),this.check_submission=this.check_submission.bind(this),this.check_bulk_action_state=this.check_bulk_action_state.bind(this),this.tally_submissions_runtime=this.tally_submissions_runtime.bind(this),this.batch_download=this.batch_download.bind(this),this.submission_index_filter_change=this.submission_index_filter_change.bind(this),this.submission_index_form_submit=this.submission_index_form_submit.bind(this),this.bulk_assign_submissions=this.bulk_assign_submissions.bind(this),this.bulk_unassign_submissions=this.bulk_unassign_submissions.bind(this),this.bulk_assign_submissions_all=this.bulk_assign_submissions_all.bind(this),this.bulk_unassign_submissions_all=this.bulk_unassign_submissions_all.bind(this),this.add_or_remove_user_ids_from_submission_ids=this.add_or_remove_user_ids_from_submission_ids.bind(this),this.name_from_id=this.name_from_id.bind(this),this.assigned_judges_changed=this.assigned_judges_changed.bind(this),this.bind_my_submissions_functions=this.bind_my_submissions_functions.bind(this),this.my_submissions_form_submit=this.my_submissions_form_submit.bind(this),this.stop_propagation_my_submission_accordion_content=this.stop_propagation_my_submission_accordion_content.bind(this),this.toggle_my_submission_row=this.toggle_my_submission_row.bind(this),this.collapse_my_submission_rows=this.collapse_my_submission_rows.bind(this),this.edit_cover_letter=this.edit_cover_letter.bind(this),this.clear_cover_letter=this.clear_cover_letter.bind(this),this.update_cover_letter=this.update_cover_letter.bind(this),this.choose_status_filter=this.choose_status_filter.bind(this),this.bind_submission_show_functions=this.bind_submission_show_functions.bind(this),this.add_submission_note=this.add_submission_note.bind(this),this.delete_submission_note=this.delete_submission_note.bind(this),this.submission_note_changed=this.submission_note_changed.bind(this),this.submission_category_changing=this.submission_category_changing.bind(this),this.change_submission_category_selected=this.change_submission_category_selected.bind(this),this.bind_submission_track_functions=this.bind_submission_track_functions.bind(this),this.batch_type_changed=this.batch_type_changed.bind(this),this.batch_download_progress_update_checker=this.batch_download_progress_update_checker.bind(this),this.batch_download_progress_updater=this.batch_download_progress_updater.bind(this),this.show_waiver_required_fees=this.show_waiver_required_fees.bind(this),this.waiver_toggle=this.waiver_toggle.bind(this),this.bind_submission_modal_links(),this.bind_festival_submission_index_functions(),this.bind_my_submissions_functions(),this.bind_submission_show_functions(),this.bind_submission_track_functions()}bind_submission_modal_links(){return jQuery(document).on("click","[data-festival-submission-url]",this.open_submission_dialog),jQuery(document).on("change",".festival-deadlines",this.render_submission_modal_category_fees),jQuery(document).on("change","select#submit-project-selector",this.project_selector_changed),jQuery(document).on("change","[data-submission-form] select",this.submission_form_inputs_changed),jQuery(document).on("change keyup","[data-submission-form] input, [data-submission-form] textarea",this.submission_form_inputs_changed),jQuery(document).on("click","[data-festival-submit-project]",this.submit_project_to_festival),jQuery(document).on("click","[data-requires-waiver-button]",this.show_waiver_required_fees)}submission_modal_close_callback(){return!0}open_submission_dialog(e){const t=jQuery(e.currentTarget);e.preventDefault(),filmfreeway.check_role(["filmmaker","admin"],filmfreeway.error_text.requires_filmmaker_account),setup.preload(["sha256","vex_dialog","parsley"]);const s=t.data("festival-submission-url"),r=parseInt(t.attr("data-preselect-category"),10);return NProgress.start(),jQuery.get(s,(e=>(NProgress.done(),setup.require(["sha256","vex_dialog","parsley"],(t=>filmfreeway.modal(e,(()=>{if(this.last_project_id=0,0!==jQuery("[data-festival-submit-project]").length)return this.render_submission_modal_category_fees((function(){let e;jQuery("[data-submission-form]").parsley({validators:{passwordhash:()=>({validate(e,s){const r=new t("SHA-256","TEXT");return r.update(e),r.getHash("HEX")===s},priority:2})}});const s=jQuery("[data-category-aware-question]");if(s.hide(),s.each(((e,t)=>jQuery(t).parsley("removeConstraint","required"))),r)e=jQuery(`[data-category-id=${r}] [data-festival-category-fee-id]`).first(),e.is(":disabled")&&(e=jQuery(`[data-category-id=${r}] [data-festival-category-fee-id][data-is-gold-fee]`).first()),e.trigger("click");else if(1===jQuery("[data-festival-category]").length){const t=jQuery("[data-festival-category-fee-id]");e=t.first(),e.is(":disabled")&&(e=t.filter("[data-is-gold-fee]")),e.trigger("click")}if(1===jQuery("#submit-project-selector option").length)return jQuery("#magic_hidden_input").trigger("change")}))}),this.submission_modal_close_callback))))))}render_submission_modal_category_fees(e){const t=jQuery("#submission_modal_categories_template").html(),s=jQuery("#submission_modal_fees_template").html();jQuery.each(categories_and_enabled_fees.festival_categories,(function(e,t){const s=[];return categories_and_enabled_fees.fees[t.id]&&jQuery.each(categories_and_enabled_fees.fees[t.id],(function(e,r){const i=parseFloat(r.price);return r.is_standard_fee="Standard Fee"===r.name,r.is_gold_fee="Gold Fee"===r.name,r.striked_out=!1,gold_fees_mode?r.is_gold_fee?t.default_fee_id=r.id:r.is_standard_fee&&0!==i&&(r.striked_out=!0):r.is_standard_fee&&(t.default_fee_id=r.id),s.push(r)})),s.sort(((e,t)=>e.order-t.order)),t.valid_code_category=discounted_categories_ids.includes(t.id.toString()),t.festival_category_fees=s,t.has_fees=s.length>0,t.requires_waiver_notice=t.has_fees&&!festival_only_accepting_waivers&&s[0].past_deadline,!0}));const r={festival_categories:categories_and_enabled_fees.festival_categories,gold_monthly},i={festival_category_fee:s};return setup.require(["mustache"],(function(s){const a=s.render(t,r,i);if(jQuery("[data-submission-form] [data-submission-modal-populate-fees]").html(a),"function"==typeof e)return e()}))}project_selector_changed(e){const t=parseInt(jQuery(e.currentTarget).val(),10);return jQuery("#duplicate-submission-message").toggleClass("js-hide",-1===projects_already_submitted.indexOf(t))}update_custom_fields(e){if(!e||e===this.last_project_id)return;const t=this.last_project_id;let s;if(this.last_project_id=e,filmmaker_custom_field_data[e])s=filmmaker_custom_field_data[e].data;else{let t=0;for(let e in filmmaker_custom_field_data)filmmaker_custom_field_data[e].updated_at>t&&(s=filmmaker_custom_field_data[e].data,t=filmmaker_custom_field_data[e].updated_at);s=jQuery.extend(!0,[],s),filmmaker_custom_field_data[e]={data:s,updated_at:t+1}}return jQuery("[data-custom-field-type]").each(((e,r)=>{let i;const a=jQuery(r),n=a.attr("name"),o=this.custom_field_value(s,n);switch(a.data("custom-field-type")){case"text":if(t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,a.val()),o)return a.val(o),a.trigger("change");break;case"boolean":if("SUNDANCE"===custom_submission_festival&&/.*?Opt in to receive future communications.*?/.test(n))return t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,a.prop("checked")),a.prop("checked","Yes"===o);if(t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,a.val()),o)return a.val(o);break;case"string":if(t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,a.val()),o)return a.val(o);break;case"multiple":var c=a.closest("[data-custom-field-container]"),l=c.find('input[type="checkbox"]');if(t){const e=l.filter(":checked").map(((e,t)=>jQuery(t).val())).get();i=c.find("[data-custom-field-type-other]:visible"),i.length&&e.push(i.val()),this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,e)}if(o){const e=o.slice(0);let t=null;return l.each(((s,r)=>{const i=jQuery(r),a=i.val();return this.field_value_should_allow_free_input(a)&&(t=i),o.indexOf(a)>-1?(e.splice(e.indexOf(a),1),i.prop("checked",!0)):i.prop("checked",!1)})),i=c.find("[data-custom-field-type-other]"),(()=>{const s=[];for(let r of Array.from(e))i.val(r),t?s.push(t.prop("checked",!0)):s.push(void 0);return s})()}break;case"pickone":if(a.is("[data-custom-field-type-country-state-input]")){const e=`${n} - State`,r=a.closest("[data-custom-field-container]").find("[data-custom-field-type-state]");t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,e,r.val());const i=this.custom_field_value(s,e);i&&r.val(i)}if(t&&this.set_custom_field_value(filmmaker_custom_field_data[t].data,n,a.val()),o&&(a.val(o),null===a.val())){let e;return e=a.find("option").each(((e,t)=>{const s=jQuery(t).attr("value");return!this.field_value_should_allow_free_input(s)||(a.val(s),a.closest("[data-custom-field-container]").find("[data-custom-field-type-other]").val(o),!1)}))}}}))}field_value_should_allow_free_input(e){return-1!==["other","prefer to self-describe","answer not listed"].indexOf(e.toLocaleLowerCase())}custom_field_value(e,t){const s=e.find((e=>e.key===t));return s?s.value:s}set_custom_field_value(e,t,s){const r=e.find((e=>e.key===t));return r?r.value=s:e.push({key:t,value:s})}submission_form_inputs_changed(e){let t;const s={video:"Video",script:"Script",audio:"Audio",photo:"Photo / Image"},r=jQuery(e.currentTarget),i=r.closest("[data-submission-form]").data("festival-id"),a=parseInt(jQuery("[data-submit-project-selector]").val(),10);if(r.is("[data-festival-category-fee-id]")){const e=r.closest("[data-festival-category-group]").find("[data-festival-category-fee-id]:checked");e.length>1&&(e.prop("checked",!1),r.prop("checked",!0));const t=r.closest("[data-submission-fees-wrapper]").find("[data-requires-waiver-button]:visible");1===t.length&&t.trigger("click")}if("undefined"!=typeof category_entry_limits&&null!==category_entry_limits){const e=[];jQuery("[data-submission-form] [data-festival-category-fee-id]:checked").each((function(){return e.push(jQuery(this).data("festival-category-fee-id"))}));let t=0;if(null!=category_entry_limits.category_fee_ids[a]&&null!=category_entry_limits.category_fee_ids[a][i]){t=category_entry_limits.category_fee_ids[a][i].length;for(let t of Array.from(category_entry_limits.category_fee_ids[a][i]))jQuery(`[data-festival-category-fee-id="${t}"]`).closest("[data-festival-category-group]").find("[data-festival-category-fee-id]").each((function(){if(jQuery(this).prop("checked"))return t=jQuery(this).data("festival-category-fee-id"),!1})),-1!==e.indexOf(t)&&e.splice(e.indexOf(t),1)}let s=e.length+t-category_entry_limits.count;s>0&&(r.is("[data-festival-category-fee-id]")?r.prop("checked",!1):r.is("[data-submit-project-selector]")&&jQuery("[data-festival-category-fee-id]:checked").each((function(){return!(s<=0)&&(jQuery(this).prop("checked",!1),s-=1)})),alert(category_entry_limits.message))}const n=a&&window.festival_requires_attachment&&-1===window.projects_containing_attachment.indexOf(a);let o=a&&window.festival_requires_attachment&&-1===window.projects_containing_video.indexOf(a);o=!1,n&&jQuery("[data-project-requires-press-kit-visit-link]").attr("href",`/projects/${a}#files-and-attachments`),jQuery("#press-kit-file-required-message").toggleClass("js-hide",!n),jQuery("#project-both-videos-required-message").toggleClass("js-hide",!0),jQuery("[data-category-id] [data-validation-errors]").addClass("js-hide"),jQuery("[data-category-id]").removeClass("category--is-disabled no-hover"),jQuery("[data-category-id] [data-validation-password]").addClass("js-hide").find("input").each((function(){const e=jQuery(this);return e.parsley("removeConstraint","required").parsley("removeConstraint","passwordhash").parsley("validate"),jQuery("[data-submission-form]").parsley("addItem",`#${e.attr("id")}`)}));let c=null;43395===i&&(c=18);const l=[],u=jQuery("[data-submission-form] [data-festival-category-fee-id]:checked").map((function(){const e=jQuery(this),t=parseInt(e.closest("[data-category-id]").attr("data-category-id"),10);return e.attr("data-is-gold-fee")&&l.push(t),t}));window.show_gold_auto_add_message&&(r.is("[data-festival-category-fee-id][data-is-gold-fee]:checked")?(0===jQuery("[data-gold-upgrade-message]:visible").length&&ga("send","event","Gold","Show","Submission Modal Gold Auto-Upgrade Fee Selected"),jQuery("[data-gold-upgrade-message]").addClass("js-hide"),r.closest("[data-category-id]").find("[data-gold-upgrade-message]").removeClass("js-hide")):0===jQuery("[data-is-gold-fee]:checked").length&&(0!==jQuery("[data-gold-upgrade-message]:visible").length&&ga("send","event","Gold","Hide","Submission Modal Gold Auto-Upgrade Fee Deselected"),jQuery("[data-gold-upgrade-message]").addClass("js-hide"))),this.update_custom_fields(a);const d=u.toArray(),_=jQuery("[data-category-aware-question]").filter((function(){const e=jQuery(this).data("category-aware-question");return d.filter((t=>e.indexOf(t)>-1)).length>0}));_.show(),_.find("[parsley-required]").each(((e,t)=>(jQuery(t).parsley("addConstraint",{required:!0}),!0)));const h=jQuery("[data-category-aware-question]").filter((function(){const e=jQuery(this).data("category-aware-question");return 0===d.filter((t=>e.indexOf(t)>-1)).length}));h.hide(),h.find("[parsley-required]").each(((e,t)=>(jQuery(t).parsley("removeConstraint","required"),!0)));const m=function(e,t,s){const r=e.closest("[data-custom-field-container]").find("[data-custom-field-type-other-container]");if(!r.length)return!0;const i=r.find("[data-custom-field-type-other]");return t?(r.find("[data-custom-field-type-other-label]").text(s),r.removeClass("js-hide"),i.parsley("addConstraint",{required:!0})):(r.addClass("js-hide"),i.parsley("removeConstraint","required"))};if(jQuery('[data-custom-field-type="multiple"]').each(((e,t)=>{const s=jQuery(t);s.attr("name");let r=!1,i="";return s.closest("[data-custom-field-container]").find('input[type="checkbox"]:checked').each(((e,t)=>{const s=jQuery(t).val();return!this.field_value_should_allow_free_input(s)||(r=!0,i=s,!1)})),m(s,r,i),!0})),jQuery('[data-custom-field-type="pickone"]').each(((e,t)=>{const s=jQuery(t),r=(s.attr("name"),s.val()),i=r&&this.field_value_should_allow_free_input(r);return m(s,i,r),!0})),jQuery("[data-custom-field-type-country-state-input]:visible").each(((e,t)=>{const s=jQuery(t);let r=!1;return"United States"===s.val()&&(r=!0),function(e,t){const s=e.closest("[data-custom-field-container]").find("[data-custom-field-type-state-container]");if(!s.length)return!0;const r=s.find("[data-custom-field-type-state]");return t?(s.removeClass("js-hide"),r.parsley("addConstraint",{required:!0})):(s.addClass("js-hide"),r.parsley("removeConstraint","required"))}(s,r)})),"checkbox"===e.target.getAttribute("type")){const t=$(e.target).siblings("[type=hidden]")[0];if(t){const s=Number(t.getAttribute("min")),r=Number(t.getAttribute("max")),i=s===r?1:0;$(e.target).parent().children("input[type=checkbox]:checked").length===s-1-i&&(e.target.checked=!0),$(e.target).parent().children("input[type=checkbox]:checked").length>r+i&&(e.target.checked=!1)}}for(let e of Array.from(u)){const r=category_settings[e];if(r){const i=[],n=jQuery(`[data-category-id=${e}] [data-validation-errors]`).addClass("js-hide");if(a){var p,f,g,y,b;if(t=project_attributes[a],c&&(t.total_runtime_seconds?t.total_runtime_seconds>c&&i.push(`Project must not exceed a maximum runtime of ${c} seconds to be eligible for this category.`):i.push("Please add a runtime for this project.")),"between"===r.duration_mode&&(!r.duration_to&&r.duration?r.duration_mode="over":!r.duration&&r.duration_to?(r.duration=r.duration_to,r.duration_mode="under"):r.duration||r.duration_to?parseInt(r.duration,10)>parseInt(r.duration_to,10)&&(({duration:p}=r),r.duration=r.duration_to,r.duration_to=p):r.duration_mode=""),"script"!==t.project_type&&r.completion_date&&"none"!==r.completion_date){let e,s,a=new Date;switch(r.completion_date){case"less_than_3_months":e=3,s="3 months";break;case"less_than_6_months":e=6,s="6 months";break;case"less_than_1_year":e=12,s="1 year";break;case"less_than_2_years":e=24,s="2 years";break;case"less_than_5_years":e=60,s="5 years"}a=a.setMonth(a.getMonth()-e);let n=new Date(t.completion_date);t.completion_date?a>n&&i.push(`Project must been completed a maximum of ${s} ago to be eligible for this category.`):i.push(`Project must have a completion date, and must been completed a maximum of ${s} ago to be eligible for this category.`)}if("video"!==t.project_type||"video"!==r.require_project_type&&r.require_project_type||r.duration&&(y=60*(f=parseInt(r.duration,10)),"over"===r.duration_mode&&t.total_runtime_secondsy?i.push(`Project must not exceed a maximum runtime of ${f} minutes to be eligible for this category.`):"between"===r.duration_mode&&(b=60*(g=parseInt(r.duration_to,10)),(t.total_runtime_secondsb)&&i.push(`Project must have a runtime between ${f} and ${g} minutes to be eligible for this category.`))),"audio"===t.project_type&&"audio"===r.require_project_type&&r.duration&&(y=60*(f=parseInt(r.duration,10)),"over"===r.duration_mode&&t.total_runtime_secondsy?i.push(`Project must not exceed a maximum runtime of ${f} minutes to be eligible for this category.`):"between"===r.duration_mode&&(b=60*(g=parseInt(r.duration_to,10)),(t.total_runtime_secondsb)&&i.push(`Project must have a runtime between ${f} and ${g} minutes to be eligible for this category.`))),"script"===t.project_type&&"script"===r.require_project_type&&r.duration){const e=parseInt(r.duration,10);if("over"===r.duration_mode&&t.number_of_pagese)i.push(`Script must not exceed ${e} pages to be eligible for this category.`);else if("between"===r.duration_mode){const s=parseInt(r.duration_to,10);(t.number_of_pagess)&&i.push(`Project must be between ${e} and ${s} pages to be eligible for this category.`)}}if(r.student_project&&!t.student_project&&i.push("Project must be a Student Project to be eligible for this category."),r.location){let e=!1;const s=jQuery.map(r.location,(e=>e.toLocaleLowerCase()));"country"===r.location_mode?(t.country||t.countries_of_origin_names)&&(t.country&&-1!==s.indexOf(t.country.toLocaleLowerCase())||t.countries_of_origin_names&&t.countries_of_origin_names.every((e=>s.includes(e.toLocaleLowerCase()))))||(e=!0):"state"===r.location_mode?t.state&&-1!==s.indexOf(t.state.toLocaleLowerCase())||(e=!0):"city"===r.location_mode&&(t.city&&-1!==s.indexOf(t.city.toLocaleLowerCase())||(e=!0)),e&&i.push(`Only projects from ${r.location.join(", ")} are eligible for this category.`)}r.require_project_type&&r.require_project_type!==t.project_type&&i.push(`Only ${s[r.require_project_type]} Projects are eligible for this category.`),jQuery(`[data-category-id=${e}]`).toggleClass("category--is-disabled no-hover",0!==i.length),0!==i.length&&(jQuery(`[data-category-id=${e}] input[type=checkbox]:checked`).prop("checked",!1),n.removeClass("js-hide").find("ul").html(`
  • ${i.join("
  • ")}
  • `),n.find("a").attr("href",`/projects/${a}/edit`))}if(0===i.length&&r.password_hash){const t=jQuery(`[data-category-id=${e}] [data-validation-password]`).removeClass("js-hide").find("input");t.parsley("addConstraint",{passwordhash:t.attr("parsley-passwordhash")}).parsley("addConstraint",{required:!0}).parsley("validate"),jQuery("[data-submission-form]").parsley("addItem",`#${t.attr("id")}`)}}}if(festival_is_sundance(i)&&a){t=window.project_attributes[a];const{director_count:e}=t;jQuery("[data-submission-modal-director-field]").each(((s,r)=>{const i=jQuery(r),a=i.is("[data-submission-modal-optional-director-field]"),n=parseInt(i.attr("data-submission-modal-director-field"),10),o=i.find("[data-custom-submission-question-extra-information]");if(o.addClass("js-hide"),n<=e){const e=t.directors[n-1];if(e){const t=`Director ${n}: ${e}`;o.text(t).removeClass("js-hide")}}if(a)return n<=e?(i.removeClass("js-hide"),i.find("[parsley-required]").each(((e,t)=>jQuery(t).parsley("addConstraint",{required:!0})))):(i.addClass("js-hide"),i.find("[parsley-required]").each(((e,t)=>jQuery(t).parsley("removeConstraint","required"))))}))}else if(47850==i&&a){t=window.project_attributes[a];const{director_count:e}=t;jQuery("[data-submission-modal-director-field]").each(((s,r)=>{const i=jQuery(r),a=parseInt(i.attr("data-submission-modal-director-field"),10),n=i.find("[data-custom-submission-question-extra-information]");if(n.addClass("js-hide"),a<=e){const e=t.directors[a-1];if(e){const t=`Director: ${e}`;n.text(t).removeClass("js-hide")}}}))}else if(64280==i&&a){const e="No"!==jQuery('[name="Are you applying with a co-creator/co-writer?"]').val();jQuery("[data-submission-modal-optional-director-field]").each(((t,s)=>{const r=jQuery(s);return e?(r.removeClass("js-hide"),r.find("[parsley-required]").each(((e,t)=>jQuery(t).parsley("addConstraint",{required:!0})))):(r.addClass("js-hide"),r.find("[parsley-required]").each(((e,t)=>jQuery(t).parsley("removeConstraint","required"))))}))}this.waiver_toggle();let v=jQuery("[data-submission-form]").parsley("isValid");return v&=$('input[type="hidden"][data-custom-field-type="multiple"]').toArray().map((e=>[Number(e.attributes.min.value)||0,$(e).siblings("input:checked").length,Number(e.attributes.max.value)||1e3])).map((e=>e[0]<=e[1]&&e[1]<=e[2])).reduce(((e,t)=>e&t),!0),n&&(v=!1),jQuery("[data-festival-submit-project]").prop("disabled",!v)}disable_submission_buttons(){return jQuery("[data-festival-submit-project]").prop("disabled",!0)}enable_submission_buttons(){return jQuery("[data-festival-submit-project]").prop("disabled",!1)}submit_project_to_festival(e){let t,s;const r=jQuery(e.currentTarget).attr("data-redirect-url")||location.href,i=r!==location.href,a=[],n=jQuery("#add-protection").is(":checked")?1:0;if(jQuery("[data-submission-form] input[type=checkbox]:checked").each(((e,t)=>a.push(jQuery(t).attr("data-festival-category-fee-id")))),!a.length)return;const o=jQuery("[data-submission-custom-fields-inputs]").find('input[type="text"]:not([data-custom-field-type-other]), select, input[type="hidden"], textarea').filter((function(){return jQuery(this).closest("[data-category-aware-question]").toArray().every((e=>jQuery(e).is(":visible")))})).serializeArray(),c=jQuery("[data-submission-custom-fields-inputs]").find('input[type="checkbox"]').filter((function(){return jQuery(this).closest("[data-category-aware-question]").toArray().every((e=>jQuery(e).is(":visible")))})).serializeArray(),l={};for(let e of Array.from(c))({name:t}=e),({value:s}=e),this.field_value_should_allow_free_input(s)||(l[t]?l[t].push(s):l[t]=[s]);jQuery('[data-custom-field-type-other="multiple"]:visible').each((function(e,r){const i=jQuery(r);return t=i.attr("name"),s=i.val(),l[t]?l[t].push(s):l[t]=[s]})),jQuery('[data-custom-field-type-other="pickone"]:visible').each((function(e,r){const i=jQuery(r);return t=i.attr("name"),s=i.val(),(()=>{const e=[];for(let r of Array.from(o))r.name===t?e.push(r.value=s):e.push(void 0);return e})()}));for(let e of Array.from(o))l[e.name]&&(e.value=l[e.name]);const u={project_id:jQuery("#submit-project-selector").val(),festival_category_fee_ids:a,protection:n,custom_fields:o,waiver_code:jQuery("#submit-project-waiver-code").length?jQuery("#submit-project-waiver-code").val():""};return jQuery("[data-gold-upgrade-message]:visible").length>0&&ga("send","event","Gold","Upsell","Submission Modal"),this.disable_submission_buttons(),NProgress.start(),jQuery.post("/cart/add_submission",u,(e=>(NProgress.done(),null!=(null!=e?e.error:void 0)?(null!=e.alert?alert(e.error):jQuery(".waiver-error-message").show().find("[data-waiver-error-message]").text(e.error),this.enable_submission_buttons()):(this.submission_modal_close_callback(),window.facebookTrack("track","AddToCart"),util_visit(r,i)))))}bind_festival_submission_index_functions(){return jQuery(document).on("page:change",this.submission_index_loaded),jQuery(document).on("click",'[data-dropdown="#dropdown-assign-user"]',this.populate_assigned_users_in_dropdown),jQuery(document).on("change","#dropdown-assign-user input[type=checkbox]",this.assign_or_unassign_submission),jQuery(document).on("change","#submission-index select[name=season]",this.disable_show_all_button),jQuery(document).on("click","table.festival-submissions tr [data-status-type], [data-submission-id] [data-status-type]",this.submission_status_changing),jQuery(document).on("click","[data-submission-status-type] [data-status-id]",this.new_submission_status_selected),jQuery(document).on("change","#disqualification_message_template",this.submission_disqualification_template_selected),jQuery(document).on("submit","[data-submission-disqualification-reason-form]",this.submission_disqualification_form_submitted),jQuery(document).on("click","#dropdown-bulk-actions [data-status-id]",this.bulk_action_change),jQuery(document).on("change","[data-submissions-check-all]",this.check_all_submissions),jQuery(document).on("change","[data-submission-check]",this.check_submission),jQuery(document).on("click","[data-submission-batch-download]",this.batch_download),jQuery(document).on("change","form#submission-index [data-submission-index-filters] input, form#submission-index [data-submission-index-filters] select",this.submission_index_filter_change),jQuery(document).on("submit","form#submission-index",this.submission_index_form_submit),jQuery(document).on("click","[data-bulk-assign]",this.bulk_assign_submissions),jQuery(document).on("click","[data-bulk-unassign]",this.bulk_unassign_submissions),jQuery(document).on("click","[data-bulk-assign-all]",this.bulk_assign_submissions_all),jQuery(document).on("click","[data-bulk-unassign-all]",this.bulk_unassign_submissions_all),jQuery(document).on("click","[data-email-submitters-button]",this.bulk_email_submitters),jQuery(document).on("click","[data-submission-export-dropdown]",this.show_export_options_modal),jQuery(document).on("submit","[data-submission-export-options-form]",this.export_submissions_with_options),jQuery(document).on("change","[data-submission-advanced-filters] input, [data-submission-advanced-filters] select",this.advanced_filters_changed),jQuery(document).on("click","[data-clear-advanced-filters]",this.submissions_clear_advanced_filters),jQuery(document).on("click","[data-submission-judging-export-params]",this.export_ratings),jQuery(document).on("click","[data-submission-export-email-me-url]",this.email_me_when_done_with_export)}submission_index_loaded(){document.getElementById("submission-index")&&(this.tally_submissions_runtime(),setup.preload(["vex_dialog"]),this.polyglot=new FFPolyglot(submission_polyglot_data))}populate_assigned_users_in_dropdown(e){let t;const s=jQuery(e.currentTarget);if(!s.hasClass("dropdown-open"))return;const r=jQuery("#dropdown-assign-user");r.find("input[type=checkbox]").prop("checked",!1).prop("disabled",!1);const i=JSON.parse(s.attr("data-assigned-users")),a=s.attr("data-submission-id");for(t of(r.attr("data-submission-id",a),Array.from(i)))r.find(`#assign_user_${t}`).prop("checked",!0);const n=JSON.parse(s.attr("data-category-ids"));for(t in judges_and_assigned_categories){const e=judges_and_assigned_categories[t];let s=!1;for(let t of Array.from(n))if(Array.from(e).includes(t)){s=!0;break}s&&r.find(`#assign_user_${t}`).prop("checked",!0).prop("disabled",!0)}}assign_or_unassign_submission(e){let t;const s=jQuery(e.currentTarget),r=jQuery("#dropdown-assign-user"),i=s.is(":checked"),a=r.attr("data-submission-id"),n=parseInt(s.attr("value"),10);return t=i?`/submissions/${a}/assign_subuser/${n}`:`/submissions/${a}/unassign_subuser/${n}`,NProgress.start(),jQuery.post(t,(e=>{NProgress.done();const t=jQuery(`[data-dropdown="#dropdown-assign-user"][data-submission-id="${a}"]`),s=JSON.parse(t.attr("data-assigned-users"));i?s.push(n):s.splice(s.indexOf(n),1),t.attr("data-assigned-users",JSON.stringify(s));const r=t.find("span.icon");0!==s.length||"true"===t.attr("data-has-users-assigned-categories")?r.removeClass("icon-user-add").addClass("icon-users"):r.removeClass("icon-users").addClass("icon-user-add");let o=parseInt(jQuery("[data-assigned-user-count]").text(),10);return isNaN(o)||(i?o+=1:o-=1,jQuery("[data-assigned-user-count]").text(o)),this.assigned_judges_changed([a])}))}disable_show_all_button(){return jQuery("[data-show-all-button]").attr("disabled",!0).attr("href","#ff_javascript")}submission_status_changing(e){return this.submission_id=jQuery(e.currentTarget).closest("[data-submission-id]").data("submission-id"),null==this.submission_id&&(this.submission_id=parseInt(jQuery(e.currentTarget).closest("tr").attr("id").match(/\d+$/)[0],10)),this.update_status_type=jQuery(e.currentTarget).data("status-type"),this.current_status_id=jQuery(e.currentTarget).data("current-status-id"),this.can_send_status_update=!0,this.confirmed_status_update=!1,this.disqualification_message=""}new_submission_status_selected(e){const t=jQuery(e.currentTarget),s=parseInt(t.attr("data-status-id"),10);if(this.current_status_id===s)return;const r=jQuery(`#submission_${this.submission_id} [data-status-type=${this.update_status_type}]`);let i="";if(""===r.text().trim()){const e=t.find("span.status span").clone().wrap("

    ").parent().html();i=t.find("span").clone().html(e).wrap("

    ").parent().html()}else i=t.html();const a={};if(a[`${this.update_status_type}_status_id`]=s,this.disqualification_message.length>0&&(a.disqualification_message=this.disqualification_message),"acceptance"===this.update_status_type&&1!==s){if(!this.confirmed_status_update)return setup.require(["vex_dialog"],(()=>vex.dialog.confirm({message:"Are you sure you wish to change the Judging Status of this submission?

    This is meant to be your final decision whether the project will be included in your event as an official selection.",callback:e=>{if(e)return this.confirmed_status_update=!0,t.trigger("click")}}))),!0}else if("submission"===this.update_status_type&&4===s&&0===this.disqualification_message.length)return filmfreeway.modal(jQuery("#modal_submission_disqualification_reason").html(),(()=>(filmfreeway.apply_parsleyjs(),jQuery("#disqualified-message").trigger("focus"))),(()=>{if(this.disqualification_message.length>0)return t.trigger("click")})),!0;return this.disqualification_message="",NProgress.start(),jQuery.post(`/submissions/${this.submission_id}/update_${this.update_status_type}_status`,a,(e=>(NProgress.done(),r.html(i).data("current-status-id",s))))}submission_disqualification_template_selected(e){const t=jQuery(e.currentTarget).val(),s=jQuery("#disqualified-message");return s.val(t),s.attr("rows",15),!0}submission_disqualification_form_submitted(e){return this.disqualification_message=jQuery("#disqualified-message").val(),filmfreeway.modal_close(),e.preventDefault(),!1}bulk_email_submitters(e){const t=jQuery("[data-email-submitters-form]"),s=jQuery("tr [data-submission-check]:checked").map(((e,t)=>jQuery(t).closest("tr").attr("id").match(/\d+$/)[0])).get();return t.find("[data-email-submitters-submission-ids]").val(JSON.stringify(s)),NProgress.start(),t.submit()}show_export_options_modal(e){return filmfreeway.modal_named("export-options",(function(){return jQuery("[data-submission-check]:checked:enabled").length>0?jQuery("#selected").prop("checked",!0):jQuery("#selected").prop("disabled",!0)}))}export_submissions_with_options(e){e.preventDefault();const t=jQuery(e.currentTarget);t.find("button").attr("disabled",!0);const s=JSON.parse(jQuery("[data-submission-export-params]").attr("data-submission-export-params")),r=t.serializeObject(),i=jQuery.extend(s,r);if(i.do_export=!0,"selected"===r.export_selection){const e=jQuery("tr [data-submission-check]:checked").map(((e,t)=>jQuery(t).closest("tr").attr("id").match(/\d+$/)[0])).get();return jQuery.post("/submissions/submit_ids_for_export",{submission_ids:e},(()=>(i.use_submitted_ids_for_export=!0,this.do_export_submissions_with_params(i))))}return this.do_export_submissions_with_params(i)}do_export_submissions_with_params(e){const t=jQuery.param(e),s=`${location.pathname}.${e.format}?${t}`;return NProgress.start(),this.submission_export_pending=!0,jQuery.get(s).done((e=>{const t=vex.getAllVexes().last().data().vex.id;vex.closeByID(t);const s=jQuery.extend(!0,{},vex.dialog.buttons);return s.YES.text=e.messages.email,s.NO.text=e.messages.cancel,vex.dialog.confirm({message:e.messages.export_in_progress,buttons:s,callback:t=>{if(NProgress.done(),this.submission_export_pending=!1,t)return jQuery.post(e.add_email_url)}}),setTimeout((()=>this.update_the_submission_export_status(e.status_url)),1e3)}))}update_the_submission_export_status(e){if(this.submission_export_pending)return jQuery.get(e).done((t=>{if(t.ready){const e=t.files[0];return filmfreeway.modal_close(),location.href=e.download}if(this.submission_export_pending)return setTimeout((()=>this.update_the_submission_export_status(e)),5e3)}))}email_me_when_done_with_export(){const e=jQuery("[data-submission-export-email-me-url]").attr("data-submission-export-email-me-url");return jQuery.post(e).done((()=>(NProgress.done(),filmfreeway.modal_close())))}export_ratings(e){const t=jQuery(e.currentTarget),s=JSON.parse(t.attr("data-submission-judging-export-params")),r=jQuery("tr [data-submission-check]:checked").map(((e,t)=>jQuery(t).closest("tr").attr("id").match(/\d+$/)[0])).get();return r.length>0?jQuery.post("/submissions/submit_ids_for_export",{submission_ids:r},(()=>(s.use_submitted_ids_for_export=!0,this.do_export_ratings_with_params(s)))):this.do_export_ratings_with_params(s)}do_export_ratings_with_params(e){const t=jQuery.param(e),s=`${location.pathname}.${e.format}?${t}`;return window.location=s}submissions_clear_advanced_filters(){return jQuery('[data-submission-advanced-filters] input[type="text"]').val(""),jQuery('[data-submission-advanced-filters] input[type="number"]').val(""),jQuery("[data-submission-advanced-filters] select").val(""),jQuery('[data-submission-advanced-filters] input[type="checkbox"]').prop("checked",!1),jQuery("[data-submission-advanced-filters] [data-submission-advanced-filter-hidden]").remove(),this.advanced_filters_changed(),jQuery("form#submission-index").trigger("submit")}advanced_filters_changed(){return jQuery('[name="advanced_filters"]').prop("disabled",!this.has_advanced_filters())}has_advanced_filters(){return jQuery("[data-submission-advanced-filters] [data-submission-advanced-filter-hidden]").length>0||(jQuery('[data-submission-advanced-filters] input[type="checkbox"]:checked').length>0||jQuery('[data-submission-advanced-filters] input[type="text"], [data-submission-advanced-filters] input[type="number"], [data-submission-advanced-filters] [data-submission-advanced-filter-value]').filter((function(){return!!this.value})).length>0)}bulk_action_change(e){const t=jQuery(e.currentTarget);return setup.require(["vex_dialog"],(()=>{const e=t.data("submission-status-type"),s=parseInt(t.data("status-id"),10),r=t.closest("[data-url]").data("url"),i=jQuery("tr [data-submission-check]:checked").map(((e,t)=>jQuery(t).closest("tr").attr("id").match(/\d+$/)[0])).get();if(!i.length)return;const a={submission_ids:i,update_status_type:e,status_id:s};if(this.disqualification_message&&this.disqualification_message.length>0&&(a.disqualification_message=this.disqualification_message),"acceptance"===e&&1!==s){if(!this.bulk_action_change_answered)return void vex.dialog.confirm({message:"Are you sure you wish to change the Judging Status of these submissions?

    This is meant to be your final decision whether the project will be included in your event as an official selection.",callback:e=>{if(e)return this.bulk_action_change_answered=!0,t.trigger("click")}})}else if("submission"===e&&4===s&&(!this.disqualification_message||0===this.disqualification_message.length))return filmfreeway.modal(jQuery("#modal_submission_disqualification_reason").html(),(()=>(filmfreeway.apply_parsleyjs(),jQuery("#disqualified-message").trigger("focus"))),(()=>{if((null!=this.disqualification_message?this.disqualification_message.length:void 0)>0)return t.trigger("click")})),!0;return this.bulk_action_change_answered=!1,this.disqualification_message="",NProgress.start(),jQuery.post(r,a,(r=>(alert("Your submissions have been updated successfully."),NProgress.done(),jQuery.each(i,((r,i)=>{const a=jQuery(`#submission_${i} [data-status-type=${e}]`);let n="";if(""===a.text().trim()){const e=t.find("span.status span").clone().wrap("

    ").parent().html();n=t.find("span").clone().html(e).wrap("

    ").parent().html()}else n=t.html();return a.html(n).data("current-status-id",s)})))))}))}check_all_submissions(e){return jQuery("[data-submission-check]:enabled").prop("checked",jQuery(e.currentTarget).is(":checked")),this.check_bulk_action_state()}check_submission(e){return this.check_bulk_action_state()}check_bulk_action_state(){const e=jQuery("[data-submission-check]:checked:enabled").length;return jQuery('label[for="batch_type_selected"] span').text(e),e&&("undefined"!=typeof SubmissionActionStateModule&&null!==SubmissionActionStateModule?SubmissionActionStateModule.initialized:void 0)?(jQuery("[data-submission-bulk-action]").removeClass("disabled"),jQuery('label[for="batch_type_selected"] span').text(e),jQuery("[data-submissions-rows-selected]").text(e).closest("[data-submissions-rows-selected-container]").show(),jQuery("[data-submission-index-export-all-text]").addClass("js-hide"),jQuery("[data-submission-index-export-selected-text]").removeClass("js-hide")):(jQuery("[data-submission-bulk-action]").addClass("disabled"),jQuery("[data-submissions-rows-selected-container]").hide(),jQuery("[data-submission-index-export-all-text]").removeClass("js-hide"),jQuery("[data-submission-index-export-selected-text]").addClass("js-hide")),this.tally_submissions_runtime()}tally_submissions_runtime(){let e=0;const t=jQuery("[data-submission-check]:checked");if(0===t.length)return void jQuery("[data-submission-selected-runtime]").addClass("js-hide");t.each(((t,s)=>{const r=jQuery(s).closest("tr").find(".col-runtime").text().trim();if(0===r.length)return;const i=r.split(":");return i.length&&(e+=parseInt(i.pop(),10)),i.length&&(e+=60*parseInt(i.pop(),10)),i.length?e+=3600*parseInt(i.pop(),10):void 0}));const s=Math.floor(e/3600),r=Math.floor((e-3600*s)/60),i=e-3600*s-60*r;if(0===e)jQuery("[data-submission-selected-runtime-text]").addClass("js-hide"),jQuery("[data-submission-selected-no-runtime-text]").removeClass("js-hide");else{const e=(s<10?`0${s}`:s)+":"+(r<10?`0${r}`:r)+":"+(i<10?`0${i}`:i);jQuery("[data-submission-selected-runtime-text]").removeClass("js-hide").text(e),jQuery("[data-submission-selected-no-runtime-text]").addClass("js-hide")}jQuery("[data-submission-selected-runtime]").removeClass("js-hide")}batch_download(e){e.preventDefault();const t=jQuery(e.currentTarget).data("batch-url"),s=jQuery('[name="batch_type"]:checked').val()||"date_range",r={_method:"create",submission_ids:jQuery("tr [data-submission-check]:checked").map(((e,t)=>jQuery(t).closest("tr").attr("id").match(/\d+$/)[0])).get(),batch_type:s,start_date:jQuery('#batch-custom-date-range [name="batch_start_date"]').val(),end_date:jQuery('#batch-custom-date-range [name="batch_end_date"]').val(),festival_category_id:jQuery("[data-batch-submissions-category-id]").val()};return NProgress.start(),jQuery.post(t,r,(e=>location.href=location.href))}submission_index_filter_change(e){return jQuery(e.currentTarget).closest("form").trigger("submit")}submission_index_form_submit(e){return e.preventDefault(),util_visit([jQuery(e.currentTarget).attr("action"),jQuery(e.currentTarget).serialize()].join("?"),!1)}bulk_assign_submissions(e){e.stopPropagation();const t=jQuery(e.currentTarget),s=(t.find("[data-bulk-flag-action-state]"),parseInt(t.attr("data-bulk-assign"),10));if(SubmissionActionStateModule.actionStateCache[s]===SubmissionActionStateModule.actionTypes.ASSIGN)return;const r=jQuery("tr [data-submission-check]:checked").map(((e,t)=>parseInt(jQuery(t).closest("tr").attr("id").match(/\d+$/)[0],10))).get();if(!r.length)return;const i={submission_ids:r,user_id:s};return NProgress.start(),jQuery.post("/submissions/bulk_assign",i,(()=>(NProgress.done(),SubmissionActionStateModule.updateActionState(s,SubmissionActionStateModule.actionTypes.ASSIGN),SubmissionActionStateModule.updateActionState("judges_all",null),this.add_or_remove_user_ids_from_submission_ids([s],r,!0))))}bulk_unassign_submissions(e){e.stopPropagation();const t=jQuery(e.currentTarget),s=t.find("[data-bulk-action-state]"),r=parseInt(t.attr("data-bulk-unassign"),10);if(SubmissionActionStateModule.actionStateCache[r]===SubmissionActionStateModule.actionTypes.UNASSIGN)return;const i=jQuery("tr [data-submission-check]:checked").map(((e,t)=>parseInt(jQuery(t).closest("tr").attr("id").match(/\d+$/)[0],10))).get();if(!i.length)return;const a={submission_ids:i,user_id:r};return NProgress.start(),jQuery.post("/submissions/bulk_unassign",a,(()=>(NProgress.done(),s.addClass("icon-checkmark-flat"),SubmissionActionStateModule.updateActionState(r,SubmissionActionStateModule.actionTypes.UNASSIGN),SubmissionActionStateModule.updateActionState("judges_all",null),this.add_or_remove_user_ids_from_submission_ids([r],i,!1))))}bulk_assign_submissions_all(e){if(e.stopPropagation(),SubmissionActionStateModule.actionStateCache.judges_all===SubmissionActionStateModule.actionTypes.ASSIGN)return;let t=jQuery(e.currentTarget).attr("data-bulk-assign-all").split(",");t=jQuery.map(t,(e=>parseInt(e,10)));const s=jQuery("tr [data-submission-check]:checked").map(((e,t)=>parseInt(jQuery(t).closest("tr").attr("id").match(/\d+$/)[0],10))).get();if(!s.length)return;const r={submission_ids:s,user_ids:t};return NProgress.start(),jQuery.post("/submissions/bulk_assign_all",r,(()=>(NProgress.done(),SubmissionActionStateModule.updateActionStates(t,SubmissionActionStateModule.actionTypes.ASSIGN),SubmissionActionStateModule.updateActionState("judges_all",SubmissionActionStateModule.actionTypes.ASSIGN),this.add_or_remove_user_ids_from_submission_ids(t,s,!0))))}bulk_unassign_submissions_all(e){if(e.stopPropagation(),SubmissionActionStateModule.actionStateCache.judges_all===SubmissionActionStateModule.actionTypes.UNASSIGN)return;let t=jQuery(e.currentTarget).attr("data-bulk-unassign-all").split(",");t=jQuery.map(t,(e=>parseInt(e,10)));const s=jQuery("tr [data-submission-check]:checked").map(((e,t)=>parseInt(jQuery(t).closest("tr").attr("id").match(/\d+$/)[0],10))).get();if(!s.length)return;const r={submission_ids:s,user_ids:t};return NProgress.start(),jQuery.post("/submissions/bulk_unassign_all",r,(()=>(NProgress.done(),SubmissionActionStateModule.updateActionStates(t,SubmissionActionStateModule.actionTypes.UNASSIGN),SubmissionActionStateModule.updateActionState("judges_all",SubmissionActionStateModule.actionTypes.UNASSIGN),this.add_or_remove_user_ids_from_submission_ids(t,s,!1))))}add_or_remove_user_ids_from_submission_ids(e,t,s){null==s&&(s=!0);for(let r of Array.from(t)){const t=jQuery(`[data-assigned-users][data-submission-id=${r}]`),i=JSON.parse(t.attr("data-assigned-users"));for(let t of Array.from(e))s&&-1===i.indexOf(t)?i.push(t):s||-1===i.indexOf(t)||i.splice(i.indexOf(t),1);const a=JSON.stringify(i);t.attr("data-assigned-users",a);const n=t.find("span.icon").removeClass("icon-user-add icon-users");0!==i.length||"true"===t.attr("data-has-users-assigned-categories")?n.addClass("icon-users"):n.addClass("icon-user-add")}this.assigned_judges_changed(t)}name_from_id(e){return jQuery(`label[for="assign_user_${e}"]`).text()}assigned_judges_changed(e){if(jQuery("[data-assigned-judges-for-submission]").length)return e.forEach((e=>{let t=jQuery(`#submission_${e} [data-assigned-users]`).attr("data-assigned-users");t&&(t=JSON.parse(t)),t=(t||[]).map(this.name_from_id);const s=`").replace(/"/g,""")}" data-tooltip>`,r=this.polyglot.t("submissions.index.assigned_by_judges_html",{preposition_start:this.polyglot.raw(''),preposition_end:this.polyglot.raw(""),name_start:this.polyglot.raw(''),name_end:this.polyglot.raw(""),judge_start:this.polyglot.raw(s),judge_end:this.polyglot.raw(""),smart_count:t.length});return jQuery(`[data-assigned-judges-for-submission=${e}]`).html(r+"
    ").toggleClass("js-hide",!t.length),filmfreeway.apply_jquery_tooltipster()}))}bind_my_submissions_functions(){return jQuery(document).on("click",".submission.accordion-row",this.toggle_my_submission_row),jQuery(document).on("click",".submission.accordion-row .accordion-content",this.stop_propagation_my_submission_accordion_content),jQuery(document).on("click","[data-submission-edit-cover-letter], [data-submission-add-cover-letter]",this.edit_cover_letter),jQuery(document).on("click","[data-submission-remove-cover-letter]",this.clear_cover_letter),jQuery(document).on("click","[data-submission-save-cover-letter]",this.update_cover_letter),jQuery(document).on("click","#dropdown-my-submissions-status-filters [data-status-id]",this.choose_status_filter),jQuery(document).on("submit","#my-submissions-index",this.my_submissions_form_submit)}my_submissions_form_submit(e){return e.preventDefault(),ga("send","event","My Submissions","Search Form","Submit"),util_visit([jQuery(e.currentTarget).attr("action"),jQuery(e.currentTarget).serialize()].join("?"),!1)}stop_propagation_my_submission_accordion_content(e){return e.stopPropagation()}toggle_my_submission_row(e){return jQuery(e.currentTarget).hasClass("is-expanded")?(this.collapse_my_submission_rows(),ga("send","event","My Submissions","Collapse Submission")):(this.collapse_my_submission_rows(),jQuery(e.currentTarget).addClass("is-expanded"),ga("send","event","My Submissions","Expand Submission"))}collapse_my_submission_rows(){return jQuery(".submission.accordion-row").removeClass("is-expanded")}edit_cover_letter(e){const t=jQuery(e.currentTarget);return filmfreeway.modal(t.closest("[data-submission]").find("[data-cover-letter-form]"))}clear_cover_letter(e){const t=jQuery(e.currentTarget).closest("[data-cover-letter-form]");return t.find("[data-cover-letter-input]").val(""),t.find("[data-submission-save-cover-letter]").trigger("click")}update_cover_letter(e){NProgress.start();const t=jQuery(e.currentTarget).attr("disabled",!0),s=t.attr("data-update-cover-letter-path"),r=t.closest("[data-cover-letter-form]").find("[data-cover-letter-input]").val(),i=""===r,a=jQuery(`[data-submission=${t.closest("[data-cover-letter-form]").attr("data-cover-letter-form")}]`);return jQuery.post(s,{cover_letter:r},(e=>(NProgress.done(),t.attr("disabled",!1),!0===e?(a.find("[data-cover-letter-input]").html(r),a.find("[data-submission-add-cover-letter]").toggleClass("js-hide",!i),a.find("[data-submission-edit-cover-letter]").toggleClass("js-hide",i),filmfreeway.modal_close()):alert("There was an error saving the cover letter"))))}choose_status_filter(e){const t=jQuery(e.currentTarget),s=t.attr("data-status-type"),r=t.attr("data-status-id"),i=t.html();return jQuery('[data-dropdown="#dropdown-my-submissions-status-filters"]').html(i),jQuery("[data-submission-or-acceptance-status-filter]").attr("name",s).val(r).closest("form").trigger("submit")}bind_submission_show_functions(){return jQuery(document).on("click","[data-add-submission-note]",this.add_submission_note),jQuery(document).on("click","[data-delete-submission-note-url]",this.delete_submission_note),jQuery(document).on("change keyup","[data-submission-note-field]",this.submission_note_changed),jQuery(document).on("click","[data-submission-category-change-id]",this.submission_category_changing),jQuery(document).on("click","[data-submission-change-category-id]",this.change_submission_category_selected)}add_submission_note(e){const t=jQuery(e.currentTarget).data("add-submission-note-url"),s=jQuery("[data-submission-note-field]"),r=s.val(),i=jQuery("[data-submission-note-share-with-submitter]"),a=i.is(":checked");return NProgress.start(),jQuery.post(t,{note:r,share_with_submitter:a},(e=>(NProgress.done(),s.before(e).val("").trigger("change"),i.prop("checked",!1))))}delete_submission_note(e){if(!confirm("Delete note?"))return;const t=jQuery(e.currentTarget),s=t.data("delete-submission-note-url");return NProgress.start(),jQuery.post(s,{_method:"delete"},(e=>(NProgress.done(),t.closest(".submission-note").remove())))}submission_note_changed(e){return jQuery("[data-add-submission-note]").prop("disabled",""===jQuery(e.currentTarget).val().trim())}submission_category_changing(e){const t=jQuery(e.currentTarget),s=t.attr("data-submission-category-change-id"),r=t.attr("data-category-id");return jQuery("#dropdown-category-list").attr("data-submission-category-id",s).attr("data-category-id",r).find("li.active").removeClass("active"),jQuery(`#dropdown-category-list [data-submission-change-category-id=${r}]`).closest("li").addClass("active"),setup.preload(["vex_dialog"])}change_submission_category_selected(e){const t=jQuery(e.currentTarget),s=t.closest("[data-submission-category-change-url]").attr("data-submission-category-change-url"),r=t.closest("[data-submission-category-id]").attr("data-submission-category-id"),i=t.closest("[data-category-id]").attr("data-category-id"),a=t.attr("data-submission-change-category-id"),n={category_id:a,submission_category_id:r};i!==a&&setup.require(["vex_dialog"],(()=>vex.dialog.confirm({message:"Are you sure you want to change the entry category of this submission?

    Note: This will not affect the entry fee. Only the category will be changed.",callback(e){if(e)return NProgress.start(),jQuery.post(s,n,(e=>{NProgress.done(),jQuery(`[data-submission-category-label=${r}]`).text(t.text());const s=jQuery("#festival-refund-entry-fee-modal-content").find(`input[type=checkbox][value=${r}]`);s.next("label").text(t.text());let n=s.parent().html();const o=new RegExp(`\b${i}\b`,"g");return n=n.replace(o,a),s.parent().html(n),jQuery(`[data-submission-category-change-id=${r}]`).attr("data-category-id",a)}))}})))}bind_submission_track_functions(){return jQuery(document).on("change",'[name="batch_type"]',this.batch_type_changed),jQuery(document).on("page:change",this.batch_type_changed),jQuery(document).on("page:change",this.batch_download_progress_update_checker)}batch_type_changed(){if(!jQuery(".batch-form").length)return;let e=jQuery('[name="batch_type"]:checked').val();return jQuery("#batch-option-only-date-range").length?(jQuery("#batch-custom-date-range").show(),jQuery("[data-submission-batch-download]").prop("disabled",!1)):(e=jQuery('[name="batch_type"]:checked').val(),e?(jQuery("[data-submission-batch-download]").prop("disabled",!1),"date_range"===e?jQuery("#batch-custom-date-range").show():jQuery("#batch-custom-date-range").hide(),"category"===e?jQuery("[data-batch-submissions-category-id-container]").removeClass("js-hide"):jQuery("[data-batch-submissions-category-id-container]").addClass("js-hide")):void 0)}batch_download_progress_update_checker(){if(jQuery("[data-batches] .spinner-icon").length)return setTimeout(this.batch_download_progress_updater,5e3)}batch_download_progress_updater(){if(jQuery("[data-batches] .spinner-icon").length)return jQuery.get(`/batches?${Math.random()}`,(e=>(jQuery("[data-batches] tbody").html(e),this.batch_download_progress_update_checker())))}show_waiver_required_fees(e){const t=jQuery(e.currentTarget).closest("[data-submission-requires-waiver]"),s=t.closest("[data-submission-fees-wrapper]").find("[data-submission-category-fee-container]");return t.toggleClass("js-hide"),s.toggleClass("js-hide")}waiver_toggle(){if(festival_only_accepting_waivers)return;const e=jQuery("[data-waiver-entry-field]");if(0===e.length)return;const t=jQuery('[data-requires-waiver="true"]:checked'),s=jQuery("[data-waiver-required-section]"),r=t.length>0;return s.toggleClass("js-hide",!r),r?e.data("is-validating")?void 0:(e.data("is-validating",!0),jQuery("[data-submission-form]").parsley("addItem",`#${e.attr("id")}`),e.parsley("addConstraint",{required:!0})):(e.data("is-validating",!1),e.parsley("removeConstraint","required"),jQuery("[data-submission-form]").parsley("removeItem",`#${e.attr("id")}`))}},filmfreeway.submissions_controller=new FilmFreeway.SubmissionsController,FilmFreeway.StripeJsController=class{constructor(){this.setup_stripe_js=this.setup_stripe_js.bind(this),this.set_stripe_key=this.set_stripe_key.bind(this)}async setup_stripe_js(e){this.stripe_setup_promise||(this.stripe_setup_promise=setup.require(["stripe"]).then(this.set_stripe_key)),e&&(await this.stripe_setup_promise,e())}set_stripe_key(){if(!FFConstants.STRIPE_PUBLISHABLE_KEY)throw"FFConstants.STRIPE_PUBLISHABLE_KEY not found - cannot setup Stripe.js";self.stripe=self.Stripe(FFConstants.STRIPE_PUBLISHABLE_KEY)}},self.filmfreeway.stripe_js_controller=new FilmFreeway.StripeJsController,self.deferAfterShow((()=>setup.preload(["stripe"]))),FilmFreeway.TicketsBuyController=class{constructor(){this.bind_tickets_buy_functions=this.bind_tickets_buy_functions.bind(this),this.submit_add_tickets_to_cart_form=this.submit_add_tickets_to_cart_form.bind(this),this.cart_registration_information_updated=this.cart_registration_information_updated.bind(this),this.copy_attendee_information=this.copy_attendee_information.bind(this),this.bind_tickets_buy_functions()}bind_tickets_buy_functions(){return jQuery(document).on("change","[data-cart-ticket-information-value]",this.cart_registration_information_updated),jQuery(document).on("submit","[data-festival-event-add-tickets-to-cart-form]",this.submit_add_tickets_to_cart_form),jQuery(document).on("change","[data-cart-attendee-information-section-copy-selector]",this.copy_attendee_information)}submit_add_tickets_to_cart_form(e){let t=0;return jQuery("[data-event-ticket-buy-quantity]").each(((e,s)=>{const r=jQuery(s),i=parseInt(r.val(),10);if(!isNaN(i)&&0!==i)return t+=i})),0===t?(alert(filmfreeway.error_text.select_ticket_quantity),void e.preventDefault()):(jQuery("[data-add-tickets-button]").attr("disabled",!0),jQuery('[data-trigger-submit-if-present="[data-festival-event-add-tickets-to-cart-form]"]').attr("data-trigger-submit-if-present",""),!0)}cart_registration_information_updated(){if(0===jQuery("[data-cart-table]").length)return;if(this.currently_updating_information)return clearTimeout(this.update_information_timeout),void(this.update_information_timeout=setTimeout((()=>(this.update_information_timeout=null,this.cart_registration_information_updated())),1e3));const e=jQuery("[data-cart-ticket-information-value]").serializeObject();if(jQuery.isEmptyObject(e))return;this.currently_updating_information=!0;const t=jQuery("[data-cart-update-event-ticket-information-url]").attr("data-cart-update-event-ticket-information-url")+"?"+Math.random();return jQuery.post(t,e).done((e=>setTimeout((()=>this.currently_updating_information=!1),400)))}copy_attendee_information(e){const t=jQuery(e.currentTarget);return setup.require(["parsley"],(()=>{const e=parseInt(t.val(),10);if(isNaN(e))return!1;const s=jQuery(`[data-cart-attendee-information-section=${e}]`),r=t.closest("[data-cart-attendee-information-section]"),i="[data-cart-ticket-information-value], [data-three-part-date-picker]",a=s.find(i),n=r.find(i);return a.each((function(e,t){const s=jQuery(t),r=jQuery(n[e]);if("checkbox"===s.attr("type"))r.prop("checked",s.is(":checked"));else{const e=s.val();r.val(e).parsley("validate")}return!0})),this.cart_registration_information_updated()}))}},window.filmfreeway.tickets_buy_controller=new FilmFreeway.TicketsBuyController,FilmFreeway.UsersController=class{constructor(){this.bindSendConfirmationEmail=()=>{jQuery(document).on("click","[data-send-confirmation-email]",this.sendConfirmationEmail)},this.sendConfirmationEmail=async function(){NProgress.start();try{await jQuery.post(FFConstants.REQUEST_CONFIRMATION_PATH),alert(`An account confirmation email was sent to: ${self.sentryIdentifiers.email} and should arrive in a few minutes`)}catch(e){alert("Sorry, an unknown error occured. Please contact support or try again later.")}finally{NProgress.done()}},this.bind_signup_form=this.bind_signup_form.bind(this),this.bind_account_form=this.bind_account_form.bind(this),this.bind_user_menu_loader=this.bind_user_menu_loader.bind(this),this.bind_change_project_email=this.bind_change_project_email.bind(this),this.bind_change_gender=this.bind_change_gender.bind(this),this.bind_change_pronouns=this.bind_change_pronouns.bind(this),this.user_email_changed=this.user_email_changed.bind(this),this.show_other_gender_input=this.show_other_gender_input.bind(this),this.show_custom_pronouns_input=this.show_custom_pronouns_input.bind(this),this.load_user_menu=this.load_user_menu.bind(this),this.signup_choose_account_type_changed=this.signup_choose_account_type_changed.bind(this),this.toggle_password_change_fields=this.toggle_password_change_fields.bind(this),this.delete_user_button_pressed=this.delete_user_button_pressed.bind(this),this.show_user_menu=this.show_user_menu.bind(this),this.leave_user_menu=this.leave_user_menu.bind(this),this.bind_signup_form(),this.bind_account_form(),this.bind_user_menu_loader(),this.bind_change_project_email(),this.bindSendConfirmationEmail(),this.bind_change_gender(),this.bind_change_pronouns()}bind_signup_form(){return jQuery(document).on("change",'[name="user_account[signup_role]"]',this.signup_choose_account_type_changed)}bind_account_form(){return jQuery(document).on("click","[data-user-account-change-password]",this.toggle_password_change_fields),jQuery(document).on("click","[data-delete-user-url]",this.delete_user_button_pressed)}bind_user_menu_loader(){return jQuery(document).on("click",'[data-dropdown="#user-menu"], [data-nav-toggle="#nav-main"]',this.load_user_menu),jQuery(document).on("mouseenter",'[data-dropdown="#user-menu"]',this.show_user_menu),jQuery(document).on("mouseleave",'[data-dropdown="#user-menu"], #user-menu',this.leave_user_menu)}bind_change_project_email(){return jQuery(document).on("input","[data-user-account-email]",this.user_email_changed)}bind_change_gender(){return jQuery(document).on("change load","#gender-selector-combobox",this.show_other_gender_input)}bind_change_pronouns(){return jQuery(document).on("change load","#pronouns-selector-combobox",this.show_custom_pronouns_input)}user_email_changed(){return jQuery("[data-change-project-email]").removeClass("js-hide")}show_other_gender_input(){return"Other"===jQuery("#gender-selector-combobox")[0].value?jQuery("[data-other-gender-input]").removeClass("js-hide"):jQuery("[data-other-gender-input]").addClass("js-hide")}show_custom_pronouns_input(){return"Custom"===jQuery("#pronouns-selector-combobox")[0].value?jQuery("[data-custom-pronouns-input]").removeClass("js-hide"):jQuery("[data-custom-pronouns-input]").addClass("js-hide")}load_user_menu(){const e=jQuery("[data-user-menu-pending-load]");if(e.length>0)return e.removeAttr("data-user-menu-pending-load"),jQuery.get("/user_accounts/render_user_menu.json",(e=>{if("success"===(null!=e?e.response:void 0))return jQuery("[data-user-list-component]").replaceWith(e.content)}))}signup_choose_account_type_changed(e){const t=jQuery(e.currentTarget);let s=t.val();t.is(":checked")||(s="filmmaker");const r=jQuery("#user_account_signup_festival_name");return"festival"===s?r.parsley("addConstraint",{required:!0}):r.parsley("removeConstraint","required"),jQuery(".js-target-festival-name").toggleClass("js-hide","festival"!==s)}toggle_password_change_fields(e){return e.preventDefault(),jQuery(e.currentTarget).data("cancel")?jQuery('[data-change="password"]').show():jQuery('[data-change="password"]').hide(),jQuery(".passwords").toggle()}delete_user_button_pressed(e){const t=jQuery(e.currentTarget),s=t.attr("data-delete-user-url"),r=t.attr("data-role");return filmfreeway.modal_named(`delete-account-${r}`,(()=>jQuery("[data-do-delete-user-button]").attr("href",s)))}show_user_menu(e){const t=jQuery(e.currentTarget);if(!t.hasClass("dropdown-open"))return t.click()}leave_user_menu(){return clearTimeout(this.mouseout_timeout),this.mouseout_timeout=setTimeout((()=>{this.mouseout_timeout=!1;const e=jQuery('[data-dropdown="#user-menu"]'),t=jQuery("#user-menu");if(e.hasClass("dropdown-open")&&!e.is(":hover")&&!t.is(":hover"))return e.trigger("click")}),280)}},filmfreeway.users_controller=new FilmFreeway.UsersController,function(e){const t=System.import("ImportDependencies").then((e=>e.default)),s=null==(e=document.currentScript)?void 0:e.nonce;function r(e){try{if(!e.match(/^[A-Za-z]+$/))throw new Error(`Bad class name: ${e}`);return System.eval(`self._ff_current_react_class = ${e};`),self._ff_current_react_class}finally{self._ff_current_react_class=null}}function i(e,t){this._container=e,this._render=Boolean(t)}function a(e,t){i.call(this,e,t)}function n(e){i.call(this,e)}function o(){this._mounted=!0,this._nodes=[]}function c(){o.call(this)}function l(){o.call(this)}i.prototype.process=function(){throw"Implement process() function"},i.prototype.pushLibraries=function(e){this._container.stack.push(e)},i.prototype.popLibraries=function(){return this._container.stack.shift()},a.prototype=Object.create(i.prototype),a.prototype.process=function(e){var i=new c,a=this._render;this.pushLibraries(i),e=e||"[data-react-class]",jQuery(e).each((function(e,s){var n=jQuery(s),o=n.data("react-class"),c=n.data("react-props"),l=n.data("react-requires"),u=n.data("react-modern-requires");self._ff_supportsModule&&u&&(l=u);const d=(e,t)=>{let s;return a?(s=ReactDomClient.createRoot(t),s.render(e)):s=ReactDomClient.hydrateRoot(t,e),i.pushNode(s),s};if(u){const e=l[0],r=n.data("react-lazy-css")||[];t.then((t=>Promise.all([...t[e].map((e=>System.import(e))),...r.map((e=>System.prepareImport().then((()=>new Promise(((t,s)=>{const r=document.createElement("link");r.rel="stylesheet",r.href=System.resolve(e),r.media="all",r.onload=t,r.onerror=s,document.head.appendChild(r)}))))))]))).then((()=>System.import(e))).then((({default:e})=>{i.canAcceptNodes()&&d(self.React.createElement(e,c),s)}))}else setup.require(l,(()=>{i.canAcceptNodes()&&d(self.React.createElement(r(o),c),s)}))}));var o=new l;return this.pushLibraries(o),jQuery("[data-module-class]").each(function(e,t,i){if(s&&s!==(i.nonce||i.getAttribute("nonce")))setTimeout((()=>{console.error("Module with wrong nonce",i)}),3e3);else{var a=jQuery(i),n=a.data("module-class"),o=JSON.parse(a[0].textContent||"null");setup.require([n],function(e,t,s){e.canAcceptNodes()&&e.pushNode(new(r(t))(s))}.bind(null,e,n,o))}}.bind(this,o)),new n(this._container)},n.prototype=Object.create(i.prototype),n.prototype.process=function(){for(var e;void 0!==(e=this.popLibraries());)for(var t;void 0!==(t=e.popNode());)e instanceof c?t.unmount():e instanceof l&&t.unMount();return new a(this._container,!0)},o.prototype.canAcceptNodes=function(){return this._mounted},o.prototype.pushNode=function(e){this._nodes.push(e)},o.prototype.popNode=function(){var e=this._nodes.shift();return this._nodes.length||(this._mounted=!1),e},c.prototype=Object.create(o.prototype),l.prototype=Object.create(o.prototype);var u={stack:[]};self.dynamicReactMount=function(e){new a(u).process(e)}.bind(this),jQuery(self).on("pagehide",function(){new n(u).process()}.bind(this)),jQuery(self).on("page:change",function(e){e?new n(u).process().process():new a(u).process()}.bind(this)),jQuery("[data-server-side-log]").each(((e,t)=>{t=jQuery(t),JSON.parse(atob(t.data("server-side-log"))).forEach((e=>{console[e.level](JSON.stringify(e.arguments))})),t.remove()}))}(),self.Sentry?deferAfterShow(self.Sentry.forceLoad):self.SafeStorage.logErrorOnce("sentryLoadError","Sentry was not loaded (possibly due to ad blocker)"); //# sourceURL=https://static-assets.filmfreeway.com/assets/module_public-07df6b23023a95ddd864839389bb1e00ef003289d77a2b4f2483951518887bbc.js