(()=>{"use strict";var e,t={1669:e=>{e.exports=jQuery},3188:(e,t,o)=>{var r=o(1669),a=o.n(r),n=o(2614);class i extends n.C4{ajaxifyLinks(e,t){super.ajaxifyLinks(e,t),a()("a.upload-one-now").on("click",e=>{const t=a()("#id_collection_id").val();t&&a()("#id_image-chooser-upload-collection").val(t),e.preventDefault()})}onLoadChooseStep(e){super.onLoadChooseStep(e),a()("a.suggested-tag").on("click",e=>(a()("#id_q").val(""),this.searchController.search({tag:a()(e.currentTarget).text(),collection_id:a()("#id_collection_id").val()}),!1))}onLoadDuplicateFoundStep(e,t){a()("#tab-upload",e.body).replaceWith(t.htmlFragment),a()(".use-new-image",e.body).on("click",t=>(e.loadUrl(t.currentTarget.href),!1)),a()(".use-existing-image",e.body).on("click",t=>{var o=a()(t.currentTarget).closest("form"),r=a()('input[name="csrfmiddlewaretoken"]',o).val();return e.postForm(t.currentTarget.href,{csrfmiddlewaretoken:r}),!1})}onLoadSelectFormatStep(e){var t=document.querySelector("#id_image-chooser-insertion-image_is_decorative"),o=document.querySelector("#id_image-chooser-insertion-alt_text"),r=document.querySelector('[for="id_image-chooser-insertion-alt_text"]');function n(){o.setAttribute("disabled","disabled"),r.classList.remove("required")}function i(){o.removeAttribute("disabled"),r.classList.add("required")}t.checked?n():i(),t.addEventListener("change",e=>{e.target.checked?n():i()}),a()("form",e.body).on("submit",t=>(a().post(t.currentTarget.action,a()(t.currentTarget).serialize(),e.loadResponseText,"text"),!1))}getOnLoadHandlers(){const e=super.getOnLoadHandlers();return e.duplicate_found=(e,t)=>{this.onLoadDuplicateFoundStep(e,t)},e.select_format=(e,t)=>{this.onLoadSelectFormatStep(e,t)},e}}window.IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS=new i({creationFormTabSelector:"#tab-upload"}).getOnLoadHandlers();class l extends n.ZZ{onloadHandlers=window.IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS}window.ImageChooserModal=l}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.m=t,e=[],r.O=(t,o,a,n)=>{if(!o){var i=1/0;for(c=0;c<e.length;c++){for(var[o,a,n]=e[c],l=!0,d=0;d<o.length;d++)(!1&n||i>=n)&&Object.keys(r.O).every(e=>r.O[e](o[d]))?o.splice(d--,1):(l=!1,n<i&&(i=n));if(l){e.splice(c--,1);var s=a();void 0!==s&&(t=s)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[o,a,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=678,(()=>{var e={678:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var a,n,[i,l,d]=o,s=0;if(i.some(t=>0!==e[t])){for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(d)var c=d(r)}for(t&&t(o);s<i.length;s++)n=i[s],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(c)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=r.O(void 0,[321],()=>r(3188));a=r.O(a)})();