1"use strict";(self.webpackChunkkms=self.webpackChunkkms||[]).push([[830,1903,3992,4729],{76885(e,t,i){i.d(t,{p:()=>r});var s=i(23151),n=i(90462);function r(e){(0,n.e)(e),(0,s.R)(e)}},23151(e,t,i){function s(e){var t=e.indexOf("?"),i="";-1!=t&&(i=e.substring(t));var s=(e=e.replace(/<\/?obs>/g,"")).match(/<obs_c>[^>]*<\/obs_c>/g);return"mailto:"+(e=(e=(e=s.join("@")).replace(/<\/?obs_c>/g,"")).replace(/\[dot\]/g,"."))+i}function n(e){e||(e=document.documentElement),function(e){!function(e){[...e.querySelectorAll("obs")].forEach(function(e){var t="",i=0;[...e.querySelectorAll("obs_c")].forEach(function(e){i>0&&(t+="@"),t+=e.innerText.replace(/\[dot\]/gi,"."),i++}),e.insertAdjacentHTML("afterEnd",t),e.remove()})}(e),function(e){[...e.querySelectorAll("*[href^='mailto:<obs>']")].forEach(function(e){if(e.href){var t=decodeURIComponent(e.href);e.href=s(t)}})}(e),function(e){[...e.querySelectorAll("*[href^='mailto:%3Cobs%3E']")].forEach(function(e){var t=decodeURIComponent(e.href);e.href=s(t)})}(e)}(e)}i.d(t,{R:()=>n})},65641(e,t,i){i.d(t,{FB:()=>l,hq:()=>a,oO:()=>o});var s=i(85804),n=i(28974),r=["/vendor/ckeditor/plugins/kmsgallery/styles/gallery.css","/static/build/css/kms_css.css"];class o{constructor(e){this.element=e,this.editorReady=!1,this.loadTasks=[],e.classList.contains("rich-text-full-uploads")?(this._mode="full",this._secure_uploads=!0):e.classList.contains("rich-text-full")?(this._mode="full",this._secure_uploads=!1):e.classList.contains("rich-text-basic")?(this._mode="form",this._secure_uploads=!1):(this._mode=this.element.dataset.editorMode||"full",this._uploads=this.element.hasAttribute("data-editor-uploads")),this._secure_uploads=this.element.hasAttribute("data-editor-secure-uploads"),(0,s.u)().then(e=>{this.csrf_token=e,this.initialise()})}initialise(){this.loadTasks.forEach(e=>e())}get uploads(){return this._uploads}get secure_uploads(){return this._secure_uploads}set secure_uploads(e){this._secure_uploads=e}get mode(){return this._mode}getData(){return this.element.value}getHTML(){return this.element.value}setContent(e,t){this.editorReady?(this.element.style.display="none",this.setEditorContent(e,t)):this.loadTasks.push(()=>{this.element.style.display="none",this.setEditorContent(e,t)})}setEditorContent(){throw new Error("Child class must implement the method setEditorContent!")}destroy(){this.element.style.display=null,this.removeEditor()}removeEditor(){throw new Error("Child class must implement the method removeEditor!")}}class l{constructor(e,t){this.element=e,this.element.style.display="none",this.editorType=t,this.is_inline=!1,this.initialise()}getStyleSheetUrls(){var e=r;return this.element.dataset.editorStylesUrl?e.push(this.element.dataset.editorStylesUrl):e.push("/app/css/editor.css"),e}initialise(){this.createWrapper(),(0,n.R)(this.wrap.id,this.getStyleSheetUrls(),this.createEditor.bind(this))}createEditor(){this.editor=new this.editorType(this.element,this),this.editor.setContent(this.element.value,()=>{this.loader.remove()}),this.element.form.addEventListener("submit",()=>{this.element.value=this.editor.getData()})}createWrapper(){this.wrap||(this.wrap=document.createElement("div"),this.wrap.classList.add("console-edit-wrap"),this.wrap.id=Date.now().toString(36)+Math.random().toString(36).substring(2),this.element.parentNode.insertBefore(this.wrap,this.element),this.wrap.appendChild(this.element),this.editor_el=document.createElement("div"),this.wrap.appendChild(this.editor_el),this.loader=document.createElement("div"),this.loader.classList.add("light-bg
1-loader"),this.wrap.appendChild(this.loader))}}class a{constructor(e,t,i){this.element=e,this.editorType=t,this.editing=!1,this.is_inline=!0,this.content_processor=i,this.initialise()}getStyleSheetUrls(){return r}initialise(){this.wrapperHoverOn=this.wrapperHoverOn.bind(this),this.wrapperHoverOff=this.wrapperHoverOff.bind(this),this.edit=this.edit.bind(this),this.save=this.save.bind(this),this.cancel=this.cancel.bind(this),this.closeEdit=this.closeEdit.bind(this),this.createWrapper(),(0,n.R)(this.wrap.id,this.getStyleSheetUrls())}wrapperHoverOn(){this.editing||(this.wrap.style.boxShadow="0px 0px 10px 0px #000000",this.editControls.style.opacity=1)}wrapperHoverOff(){this.editing||(this.wrap.style.boxShadow="none",this.editControls.style.opacity=0)}createWrapper(){this.wrap||(this.wrap=document.createElement("div"),this.wrap.id=Date.now().toString(36)+Math.random().toString(36).substring(2),this.wrap.classList.add("inline-edit-wrap"),this.element.parentNode.insertBefore(this.wrap,this.element),this.wrap.appendChild(this.element),this.wrap.insertAdjacentHTML("beforeend",'<div class=\'inline-edit-controls\'><span class="edit"><img alt="editor edit icon" src="/static/frontend/img/edit.svg"/></span><span class="save" style="display:none">Save</span> <span class="cancel" style="display:none">Cancel</span></div>'),this.editControls=this.wrap.querySelector(".inline-edit-controls"),this.wrap.querySelector(".inline-edit-controls .edit").addEventListener("click",this.edit),this.wrap.querySelector(".inline-edit-controls .save").addEventListener("click",this.save),this.wrap.querySelector(".inline-edit-controls .cancel").addEventListener("click",this.cancel),this.wrap.addEventListener("mouseenter",this.wrapperHoverOn),this.wrap.addEventListener("mouseleave",this.wrapperHoverOff))}displayEditUI(){this.wrap.style.boxShadow="0px 0px 10px 0px #000000",this.editControls.style.opacity=1,this.editControls.querySelector(".edit").style.display="none",this.editControls.querySelector(".save").style.display="inline",this.editControls.querySelector(".cancel").style.display="inline"}hideEditUI(){this.wrap.style.boxShadow="none",this.editControls.style.opacity=0,this.element.contentEditable="false",this.editControls.querySelector(".edit").style.display="inline",this.editControls.querySelector(".save").style.display="none",this.editControls.querySelector(".cancel").style.display="none"}cancel(){this.closeEdit(),this.element.innerHTML=this.element.origHTML,this.content_processor(this.element)}closeEdit(){this.wrap.querySelector(".inline-edit-save")&&this.wrap.querySelector(".inline-edit-save").remove(),this.editor.destroy(),this.hideEditUI(),this.wrap.style.boxShadow="0px 0px 10px 0px #00cc00",setTimeout(()=>{this.wrap.style.boxShadow="none"},1e3),this.editing=!1}get content_url(){return`/console/content/${this.element.dataset.content_type}/update/${this.element.dataset.id}`}edit(){this.editing=!0,this.element.origHTML=this.element.innerHTML,this.displayEditUI(),fetch(this.content_url,{method:"get",headers:{Accept:"application/json"}}).then(e=>{if(e.ok)return e.json();throw new Error("Something went wrong")}).then(e=>{let t=e.content_version.content,i=e.content_version.content_src||t;this.edit_content_loaded(t,i)}).catch(function(e){console.log(e),alert("error loading content, please try again")})}save(){let e=new FormData;e.append("content_src",this.editor.getData()),e.append("content",this.editor.getHTML()),e.append("editor",this.element.dataset.editor),fetch(this.content_url,{method:"post",body:e,headers:{Accept:"application/json","X-CSRF":this.editor.csrf_token}}).then(e=>{if(e.ok)return e.json();throw new Error("Something went wrong")}).then(e=>{this.closeEdit(),this.element.innerHTML=e.processed_content,this.element.origsrc=e.content,this.content_processor(this.element)}).catch(function(e){console.log(e),alert("error saving content, please try again")})}edit_content_loaded(e,t){this.editor=new this.editorType(this.element,this),this.editor.setContent(t),console.debug(e,t)}}},47707(e,t,i){i.r(t);var s=i(76885),n=i(65641);function r(e,t,i){return"TEXTAREA"==e.tagName?new n.FB(e,t):new n.hq(e,t,i)}document.querySelectorAll(".rich-text,.rich-text-full-uploads,.rich-text-full,.rich-text-basic,div[data-edit='true']").forEach(e
1=>{"prose"==e.dataset.editor?Promise.all([i.e(330),i.e(603)]).then(i.bind(i,78685)).then(t=>{r(e,t.RichEditorProse,s.p)}):"textarea"==e.dataset.editor?i.e(4072).then(i.bind(i,70190)).then(t=>{r(e,t.EditorTextarea,s.p)}):"editorjs"==e.dataset.editor?Promise.all([i.e(5452),i.e(8397),i.e(7411),i.e(3616)]).then(i.bind(i,99246)).then(t=>{r(e,t.RichEditorJS,s.p)}):"tinymce"==e.dataset.editor?Promise.all([i.e(5452),i.e(8397),i.e(7411),i.e(3616)]).then(i.bind(i,87411)).then(t=>{r(e,t.RichEditorTinyMCE,s.p)}):i.e(1924).then(i.bind(i,72692)).then(t=>{r(e,t.RichEditorCKEditor4,s.p)})})},34605(e,t,i){i.d(t,{X:()=>n});var s=i(38945);function n(e){var t=e.querySelector(".kmsgallery-stage");e.querySelectorAll(".kmsgallery-thumbnail-image").forEach(i=>{i.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation();var r=e.querySelectorAll(".kmsgallery-stage-image"),o=`<div class="kmsgallery-stage-image" style="opacity:0; background-image:url('${i.dataset.imageUrl.replace("'","'")}');"></div>`,l=document.createElement("div");l.innerHTML=o,l=l.firstChild,t.insertAdjacentElement("beforeend",l),(0,s.qG)(l),r.forEach(e=>{(0,s.Xn)(e),setTimeout(()=>{e.remove()},500)})})});var i=e.querySelector(".kmsgallery-filmstrip");function n(){i.children.length>0&&i.scrollWidth>e.clientWidth?(0,s.YL)(i,".kmsgallery-filmstrip-click.next").style.opacity=1:(0,s.YL)(i,".kmsgallery-filmstrip-click.next").style.opacity=0}n(),window.addEventListener("resize",n),window.addEventListener("load",n),document.documentElement.classList.contains("no-touch")||(i.style.overflowX="scroll"),(0,s.zy)(i,".kmsgallery-filmstrip-click").forEach(e=>{e.addEventListener("click",()=>{var t,i,n;t=e,n=(i=(0,s.HW)(t,".kmsgallery-filmstrip")[0]).clientWidth/2,t.classList.contains("prev")?(i.scrollLeft>0&&(i.scrollLeft=i.scrollLeft-n,(0,s.qG)((0,s.zy)(i,".kmsgallery-filmstrip-click.next")[0])),i.scrollLeft<=0&&(i.scrollLeft=0,(0,s.Xn)(t))):(i.scrollLeft+i.clientWidth<i.scrollWidth&&(i.scrollLeft=i.scrollLeft+n,(0,s.qG)((0,s.zy)(i,".kmsgallery-filmstrip-click.prev")[0])),i.scrollLeft+i.clientWidth>=i.scrollWidth&&(i.scrollLeft=i.scrollWidth,(0,s.Xn)(t)))})})}},90462(e,t,i){i.d(t,{e:()=>n});var s=i(34605);function n(e){[...(e=e||document).querySelectorAll(".kmsgallery")].forEach(function(e){e.classList.contains("display-default")?"function"==typeof $&&$(e).magnificPopup({delegate:".kmsgallery-thumbnail-image",type:"image",gallery:{enabled:!0}}):e.classList.contains("display-filmstrip")?(0,s.X)(e):e.classList.contains("display-slider")?"function"==typeof $?$(e).flexslider({prevText:"",nextText:"",smoothHeight:!0,slideshow:!1,directionNav:!0,controlNav:!1,animation:"slide"}):console.error("Flexslider requires jquery to be loaded."):e.classList.contains("display-rotate")&&r(e)})}function r(e){if("function"!=typeof $)return void console.error("Filmstrip gallery requires jquery to be loaded.");let t=$(e);var i=null,s=t.find(".kmsgallery-image"),n=$('<div class="kmsgallery-nav"></div>');t.append(n),s.each(function(e,t){var i=$('<span class="kmsgallery-nav-item"></span>'),s=$(t);n.append(i),i.data("image",s),s.data("nav",i),s.hasClass("active")&&i.addClass("active")});var r=n.children();function o(e){r.removeClass("active"),s.removeClass("active"),e.addClass("active").data("image").addClass("active")}function l(){var e=r.filter(".active").next();e.length||(e=r.first()),o(e)}function a(){i=setInterval(l,7e3)}n.on("click",".kmsgallery-nav-item",function(){clearInterval(i),a(),o($(this))}),a()}window.createFilmStripGallery=s.X,window.createRotateGallery=r},28974(e,t,i){function s(e,t){if(e instanceof CSSStyleRule){var i=e.selectorText.split(",").map(e=>function(e,t){var i=e.split(" ");return e.startsWith(":root")?i[0]="#"+t:i.unshift("#"+t),(i=i.filter(e=>
1!e.match(/^(html|body)$/i))).join(" ")}(e,t));return i.join(", ")+" {"+e.style.cssText+"}\r\n"}if(e instanceof CSSMediaRule){var n=[...e.cssRules].map(e=>s(e,t));return"@media "+e.media.mediaText+" {"+n.join(" ")+"}"}if(e instanceof CSSFontFaceRule)return e.cssText}i.d(t,{R:()=>o});let n=0;function r(e,t,i){var r=document.createElement("link");function o(){var t=r.sheet;if(t.cssRules){var o=[...t.cssRules].map(t=>s(t,e)).join(" ");r.remove();var l=document.createElement("style");l.innerHTML=o,l.id=e+"-"+n+"-styles",n++,document.head.appendChild(l)}document.getElementById(e).clientHeight,i&&i()}r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("media","(max-width: 0)"),r.setAttribute("href",t),r.setAttribute("crossorigin","anonymous"),document.head.appendChild(r),r.onload=o,r.onerror=function(){o(),alert("Error loading editor stylesheet. The editor display may not be correct."),console.error("Error loading stylesheet '"+t+"'.")}}function o(e,t,i){if(document.getElementById(e)){for(var s=i,n=t.length-1;n>0;n--)s=o(n,s);r(e,t[0],s)}else console.error("Element with ID '"+e+"' not found.");function o(i,s){return()=>{r(e,t[i],s)}}}},38945(e,t,i){function s(e){var t=1024;if(Math.abs(e)<t)return e+" B";var i=["kB","MB","GB","TB","PB","EB","ZB","YB"],s=-1;do{e/=t,++s}while(Math.abs(e)>=t&&s<i.length-1);return e.toFixed(1)+" "+i[s]}function n(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),i=window.atob(t),s=new Uint8Array(i.length);for(let e=0;e<i.length;++e)s[e]=i.charCodeAt(e);return s}function r(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return i;i=i.previousElementSibling}return null}function o(e,t){for(var i=[];e=e.nextElementSibling;)t&&!e.matches(t)||i.push(e);return i}function l(e,t){for(var i=[];e=e.previousElementSibling;)t&&!e.matches(t)||i.push(e);return i}function a(e){e.style.opacity="0",window.getComputedStyle(e).opacity,e.style.transition="opacity 0.5s ease-in",e.style.opacity="1"}function c(e){e.style.opacity="1",window.getComputedStyle(e).opacity,e.style.transition="opacity 0.5s ease-out",e.style.opacity="0"}i.d(t,{HW:()=>o,O7:()=>s,Xn:()=>c,YL:()=>r,qG:()=>a,we:()=>n,zy:()=>l})}}]); 2//# sourceMappingURL=chunk-inline_edit.d471d98788a66146.build.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.