wagtail 7.2.1__py3-none-any.whl → 7.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wagtail/__init__.py CHANGED
@@ -6,7 +6,7 @@ from wagtail.utils.version import get_semver_version, get_version
6
6
 
7
7
  # major.minor.patch.release.number
8
8
  # release must be one of alpha, beta, rc, or final
9
- VERSION = (7, 2, 1, "final", 1)
9
+ VERSION = (7, 2, 2, "final", 1)
10
10
 
11
11
  __version__ = get_version(VERSION)
12
12
 
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t={2294:(e,t,i)=>{var n=i(6931),s=i.n(n),l=i(2427),a=i.n(l),o=i(4327),r=i(1238),c=i(1002);class d{constructor(e,t,i,n,l,d){this.blockDef=e,this.type=e.name;const h=$(`\n <div class="w-field__wrapper" data-field-wrapper>\n <div class="${(0,o.Z)(this.blockDef.meta.classname)}" data-field>\n <div class="w-field__errors" id="${i}-errors" data-field-errors>\n <svg class="icon icon-warning w-field__errors-icon" aria-hidden="true" hidden><use href="#icon-warning"></use></svg>\n </div>\n <div class="w-field__help" id="${i}-helptext" data-field-help></div>\n <div class="w-field__input" data-field-input>\n <div data-streamfield-widget></div>\n </div>\n </div>\n </div>\n `);$(t).replaceWith(h);const u=h.find("[data-streamfield-widget]").get(0);this.element=h[0],this.field=this.element.querySelector("[data-field]"),this.parentCapabilities=d||new Map,this.prefix=i;const p={attributes:this.getAttributes()};try{this.widget=this.blockDef.widget.render(u,i,i,n,this.parentCapabilities,p)}catch(e){return console.error(e),void this.setError({messages:["This widget failed to render, please check the console for details."]})}if(this.idForLabel=this.widget.idForLabel,this.blockDef.meta.helpText){const e=document.createElement("p");e.classList.add("help"),e.innerHTML=this.blockDef.meta.helpText,this.field.querySelector("[data-field-help]").appendChild(e)}if(window.comments&&this.blockDef.meta.showAddCommentButton){const t=document.createElement("button");t.type="button",t.setAttribute("aria-label",e.meta.strings.ADD_COMMENT),t.setAttribute("data-comment-add",""),t.classList.add("w-field__comment-button","w-field__comment-button--add"),s().render(a().createElement(a().Fragment,null,a().createElement(r.A,{name:"comment-add"}),a().createElement(r.A,{name:"comment-add-reversed"})),t),this.field.classList.add("w-field--commentable"),this.field.querySelector("[data-field-input]").appendChild(t),window.comments.initAddCommentButton(t)}l&&this.setError(l),(0,c.$)(this.field,this.blockDef.meta.attrs||{})}setCapabilityOptions(e,t){Object.assign(this.parentCapabilities.get(e),t),this.widget&&this.widget.setCapabilityOptions&&this.widget.setCapabilityOptions(e,t)}setState(e){this.widget&&this.widget.setState(e)}setError(e){const t=this.field.querySelector("[data-field-errors]");if(t.querySelectorAll(".error-message").forEach(e=>e.remove()),this.widget?.setInvalid?.(!!e),e){this.field.classList.add("w-field--error"),t.querySelector(".icon").removeAttribute("hidden");const i=document.createElement("p");i.classList.add("error-message");const n=document.createTextNode(e.messages.join(" "));i.appendChild(n),t.appendChild(i)}else this.field.classList.remove("w-field--error"),t.querySelector(".icon").setAttribute("hidden","true")}getAttributes(){const e=this.prefix,t={};return this.blockDef.meta.helpText&&(t["aria-describedby"]=`${e}-helptext`),this.blockDef.meta.required&&(t.required=""),this.blockDef.meta.maxLength&&(t.maxLength=this.blockDef.meta.maxLength),t}getState(){return this.widget.getState()}getValue(){return this.widget.getValue()}getTextLabel(e){return this.widget.getTextLabel?this.widget.getTextLabel(e):null}focus(e){this.widget&&this.widget.focus(e)}}class h{constructor(e,t,i){this.name=e,this.widget=t,this.meta=i}render(e,t,i,n,s){return new d(this,e,t,i,n,s)}}class u{constructor(e,t){this.blockDef=e;const i=document.createElement("div");this.blockDef.meta.html?i.innerHTML=this.blockDef.meta.html:i.innerHTML=(0,o.Z)(this.blockDef.meta.text),t.replaceWith(i),(0,c.$)(i,this.blockDef.meta.attrs||{})}setState(e){}setError(e){}getState(){return null}getValue(){return null}focus(){}}class p{constructor(e,t){this.name=e,this.meta=t}render(e){return new u(this,e)}}var m=i(4188),b=i(4545),f=i(2833);class g{constructor(e){this.props=e}render(){const e=document.createElement("template"),{panelId:t,headingId:i,contentId:n,blockDef:s,blockTypeIcon:l,blockTypeLabel:a,collapsed:o}=this.props;return e.innerHTML=`\n <section class="w-panel w-panel--nested${o?" collapsed":""}" id="${t}" aria-labelledby="${i}" data-panel>\n <div class="w-panel__header">\n <a class="w-panel__anchor w-panel__anchor--prefix" href="#${t}" aria-labelledby="${i}" data-panel-anchor>\n <svg class="icon icon-link w-panel__icon" aria-hidden="true">\n <use href="#icon-link"></use>\n </svg>\n </a>\n <button class="w-panel__toggle" type="button" aria-label="${(0,f.AP)("Toggle section")}" aria-describedby="${i}" data-panel-toggle aria-controls="${n}" aria-expanded="true">\n <svg class="icon icon-${l} w-panel__icon" aria-hidden="true">\n <use href="#icon-${l}"></use>\n </svg>\n </button>\n <h2 class="w-panel__heading w-panel__heading--label" aria-level="3" id="${i}" data-panel-heading>\n <span class="c-sf-block__type">${a}</span>\n ${s?.meta.required?'<span class="w-required-mark" data-panel-required>*</span>':""}\n <span data-panel-heading-text class="c-sf-block__title"></span>\n </h2>\n <a class="w-panel__anchor w-panel__anchor--suffix" href="#${t}" aria-labelledby="${i}">\n <svg class="icon icon-link w-panel__icon" aria-hidden="true">\n <use href="#icon-link"></use>\n </svg>\n </a>\n <div class="w-panel__divider"></div>\n <div class="w-panel__controls" data-panel-controls></div>\n </div>\n <div id="${n}" class="w-panel__content">\n ${s?"<div data-streamfield-block></div>":""}\n </div>\n </section>\n `,e.content.firstElementChild}}const k=(e,t=!("true"===e.getAttribute("aria-expanded")))=>{const i=document.querySelector(`#${e.getAttribute("aria-controls")}`);i&&(e.setAttribute("aria-expanded",`${t}`),t?i.removeAttribute("hidden"):"onbeforematch"in document.body?i.setAttribute("hidden","until-found"):i.setAttribute("hidden",""),e.dispatchEvent(new CustomEvent("commentAnchorVisibilityChange",{bubbles:!0})),e.dispatchEvent(new CustomEvent("wagtail:panel-toggle",{bubbles:!0,cancelable:!1,detail:{expanded:t}})))};function v(e){const t=e.closest("[data-panel]"),i=document.querySelector(`#${e.getAttribute("aria-controls")}`);if(!i||!t||t.collapsibleInitialised)return;t.collapsibleInitialised=!0;const n=k.bind(null,e),s=t.classList.contains("collapsed"),l=i.querySelector('[aria-invalid="true"], .error, .w-field--error'),a=s&&!l;a&&n(!1),e.addEventListener("click",n.bind(null,void 0));const o=t.querySelector("[data-panel-heading]");o&&o.addEventListener("click",n.bind(null,void 0)),i.addEventListener("beforematch",n.bind(null,!0)),e.dispatchEvent(new CustomEvent("wagtail:panel-init",{bubbles:!0,cancelable:!1,detail:{expanded:!a}}))}class w{constructor(e,t,i,n,s){const l=n||{};this.blockDef=e,this.type=e.name,this.childBlocks={};let a="";if(this.blockDef.collapsible&&(a=new g({panelId:i+"-section",headingId:i+"-heading",contentId:i+"-content",blockTypeIcon:(0,o.Z)(e.meta.icon),blockTypeLabel:(0,o.Z)(e.meta.label),collapsed:e.meta.collapsed}).render().outerHTML),e.meta.formTemplate){const n=e.meta.formTemplate.replace(/__PREFIX__/g,i);let o;a?(o=$(a),$(t).replaceWith(o),o=this.#e(o,i),o.append(n)):(o=$(n),$(t).replaceWith(o));const r=s?.blockErrors||{};this.blockDef.childBlockDefs.forEach(e=>{const t=o.find('[data-structblock-child="'+e.name+'"]').get(0),n=e.render(t,i+"-"+e.name,l[e.name],r[e.name]);this.childBlocks[e.name]=n}),this.container=o}else{let e=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n </div>\n `);e.append(a),$(t).replaceWith(e),this.blockDef.collapsible&&(e=this.#e(e,i)),this.blockDef.meta.helpText&&e.append(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `),this.blockDef.childBlockDefs.forEach(t=>{let n="";t instanceof this.blockDef.constructor||(n=`<label class="w-field__label">${(0,o.Z)(t.meta.label)}${t.meta.required?'<span class="w-required-mark">*</span>':""}</label>`);const a=$(`\n <div data-contentpath="${t.name}">\n ${n}\n <div data-streamfield-block></div>\n </div>\n `);e.append(a);const r=a.find("[data-streamfield-block]").get(0),c=a.find("label").get(0),d=s?.blockErrors||{},h=t.render(r,i+"-"+t.name,l[t.name],d[t.name],new Map);this.childBlocks[t.name]=h,h.idForLabel&&c.setAttribute("for",h.idForLabel)}),this.container=e}this.blockDef.collapsible&&this.setTextLabel(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}#e(e,t){const i=e.find("[data-panel-toggle]")[0],n=e.find("[data-panel-heading-text]")[0];return v(i),this.setTextLabel=()=>{const e=this.getTextLabel({maxLength:50});n.textContent=e||""},i.addEventListener("wagtail:panel-toggle",this.setTextLabel),e.find(`#${t}-content`)}setState(e){for(const t in e)this.childBlocks[t].setState(e[t])}setError(e){if(!e)return;const t=this.container[0];if((0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors)for(const t in e.blockErrors)(0,m.$)(e.blockErrors,t)&&this.childBlocks[t].setError(e.blockErrors[t])}getState(){const e={};for(const t in this.childBlocks)e[t]=this.childBlocks[t].getState();return e}getDuplicatedState(){const e={};for(const t in this.childBlocks){const i=this.childBlocks[t];e[t]=void 0===i.getDuplicatedState?i.getState():i.getDuplicatedState()}return e}getValue(){const e={};for(const t in this.childBlocks)e[t]=this.childBlocks[t].getValue();return e}getTextLabel(e){if("string"==typeof this.blockDef.meta.labelFormat)return this.blockDef.meta.labelFormat.replace(/\{(\w+)\}/g,(t,i)=>{const n=this.childBlocks[i];return n&&n.getTextLabel?n.getTextLabel(e):""});for(const t of this.blockDef.childBlockDefs){const i=this.childBlocks[t.name];if(i.getTextLabel){const t=i.getTextLabel(e);if(t)return t}}return null}focus(e){if(this.blockDef.childBlockDefs.length){const t=this.blockDef.childBlockDefs[0].name;this.childBlocks[t].focus(e)}}}class D{constructor(e,t,i){this.name=e,this.childBlockDefs=t,this.meta=i,this.collapsible=!0}render(e,t,i,n){return new w(this,e,t,i,n)}}const x={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let y;const C=new Uint8Array(16),E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));const B=function(e,t,i){if(x.randomUUID&&!t&&!e)return x.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!y){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");y=crypto.getRandomValues.bind(crypto)}return y(C)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if((i=i||0)<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+"-"+E[e[t+4]]+E[e[t+5]]+"-"+E[e[t+6]]+E[e[t+7]]+"-"+E[e[t+8]]+E[e[t+9]]+"-"+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}(n)};var _=i(246),S=i(9675);class I{constructor(e){this.sequenceChild=e}render(e){const t=this.sequenceChild.strings[this.labelIdentifier]||this.labelIdentifier;this.dom=$(`\n <button type="button" class="button button--icon text-replace white" data-streamfield-action="${this.labelIdentifier}" title="${(0,o.Z)(t)}">\n <svg class="icon icon-${(0,o.Z)(this.icon)}" aria-hidden="true">\n <use href="#icon-${(0,o.Z)(this.icon)}"></use>\n </svg>\n </button>\n `),this.dom.on("click",()=>(this.onClick&&this.onClick(),!1)),$(e).append(this.dom),this.enableEvent&&this.sequenceChild.addEventListener(this.enableEvent,()=>{this.enable()}),this.disableEvent&&this.sequenceChild.addEventListener(this.disableEvent,()=>{this.disable()}),this.initiallyDisabled&&this.disable()}enable(){this.dom.removeAttr("disabled")}disable(){this.dom.attr("disabled","true")}}class q extends I{enableEvent="enableMoveUp";disableEvent="disableMoveUp";initiallyDisabled=!0;icon="arrow-up";labelIdentifier="MOVE_UP";onClick(){this.sequenceChild.moveUp()}}class L extends I{enableEvent="enableMoveDown";disableEvent="disableMoveDown";initiallyDisabled=!0;icon="arrow-down";labelIdentifier="MOVE_DOWN";onClick(){this.sequenceChild.moveDown()}}class T extends I{enableEvent="enableDrag";disableEvent="disableDrag";initiallyDisabled=!1;icon="grip";labelIdentifier="DRAG"}class A extends I{enableEvent="enableDuplication";disableEvent="disableDuplication";icon="copy";labelIdentifier="DUPLICATE";onClick(){this.sequenceChild.duplicate({animate:!0})}}class M extends I{icon="bin";labelIdentifier="DELETE";onClick(){this.sequenceChild.delete({animate:!0})}}class U extends EventTarget{constructor(e,t,i,n,s,l,a,r){super(),this.blockDef=e,this.type=e.name,this.prefix=i,this.index=n,this.id=s,this.sequence=a;const c=r&&r.animate,d=r&&r.focus,h=r&&r.collapsed;this.strings=r&&r.strings||{};const u=`block-${s}-section`,p=`block-${s}-heading`,m=`block-${s}-content`,b=(0,o.Z)(this.blockDef.meta.icon),f=(0,o.Z)(this.blockDef.meta.label),k=new g({panelId:u,headingId:p,contentId:m,blockDef:e,blockTypeIcon:b,blockTypeLabel:f}).render(),w=$(`\n <div data-streamfield-child ${this.id?`data-contentpath="${(0,o.Z)(this.id)}"`:"data-contentpath-disabled"}>\n <input type="hidden" name="${this.prefix}-deleted" value="">\n <input type="hidden" name="${this.prefix}-order" value="${n}">\n <input type="hidden" name="${this.prefix}-type" value="${(0,o.Z)(this.type||"")}">\n <input type="hidden" name="${this.prefix}-id" value="${(0,o.Z)(this.id||"")}">\n ${k.outerHTML}\n </div>\n `);$(t).replaceWith(w),this.element=w.get(0);const x=w.find("[data-streamfield-block]").get(0);this.actionsContainerElement=w.find("[data-panel-controls]").get(0),this.titleElement=w.find("[data-panel-heading-text]"),this.toggleElement=this.element.querySelector("[data-panel-toggle]"),this.deletedInput=w.find(`input[name="${this.prefix}-deleted"]`),this.indexInput=w.find(`input[name="${this.prefix}-order"]`),this.addActionButton(new q(this)),this.addActionButton(new L(this)),this.addActionButton(new T(this)),this.addActionButton(new A(this)),this.addActionButton(new M(this));const y=new Map;y.set("duplicate",{enabled:!0,fn:this.duplicate}),y.set("split",{enabled:!0,fn:this.split.bind(this)}),y.set("addSibling",{enabled:!0,fn:this.addSibling.bind(this),blockGroups:this.sequence.getBlockGroups(),getBlockCount:this.sequence.getBlockCount.bind(this.sequence),getBlockMax:this.sequence.getBlockMax.bind(this.sequence)}),this.blockDef instanceof D&&(this.blockDef.collapsible=!1),this.block=this.blockDef.render(x,this.prefix+"-value",l,void 0,y),v(this.element.querySelector("[data-panel-toggle]")),h&&this.collapse(),this.toggleElement.addEventListener("wagtail:panel-toggle",()=>{const e=this.getTextLabel({maxLength:70});this.titleElement.text(e||"")});const C=this.getTextLabel({maxLength:70});this.titleElement.text(C||""),c?(w.hide(),setTimeout(()=>{w.slideDown(),d&&this.block.focus({soft:!0})},10)):d&&this.block.focus({soft:!0})}addActionButton(e){e.render(this.actionsContainerElement)}addSibling(e){this.sequence._onRequestInsert(this.index+1,e)}moveUp(){this.sequence.moveBlockUp(this.index)}moveDown(){this.sequence.moveBlockDown(this.index)}duplicate(e){this.sequence.duplicateBlock(this.index,e)}delete(e){this.sequence.deleteBlock(this.index,e)}markDeleted({animate:e=!1}){this.deletedInput.val("1"),e?$(this.element).slideUp().dequeue().fadeOut().attr("aria-hidden","true"):$(this.element).hide().attr("aria-hidden","true");const t=this.getContentPath();t&&window.comments.commentApp&&window.comments.commentApp.invalidateContentPath(t)}getContentPath(){return window.comments?.getContentPath(this.element)}enableDuplication(){this.dispatchEvent(new Event("enableDuplication")),this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("duplicate",{enabled:!0})}disableDuplication(){this.dispatchEvent(new Event("disableDuplication")),this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("duplicate",{enabled:!1})}enableSplit(){this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("split",{enabled:!0})}disableSplit(){this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("split",{enabled:!1})}enableMoveUp(){this.dispatchEvent(new Event("enableMoveUp"))}disableMoveUp(){this.dispatchEvent(new Event("disableMoveUp"))}enableMoveDown(){this.dispatchEvent(new Event("enableMoveDown"))}disableMoveDown(){this.dispatchEvent(new Event("disableMoveDown"))}setIndex(e){this.index=e,this.indexInput.val(e)}setError(e){this.block.setError(e),e&&k(this.toggleElement,!0)}focus(e){this.block.focus(e)}getTextLabel(e){return this.block.getTextLabel?this.block.getTextLabel(e):null}collapse(){k(this.toggleElement,!1)}getDuplicatedState(){return{id:B(),value:void 0===this.block.getDuplicatedState?this.block.getState():this.block.getDuplicatedState()}}}class O{constructor(e,t){this.index=t&&t.index,this.onRequestInsert=t&&t.onRequestInsert}setIndex(e){this.index=e}delete({animate:e=!1}){e?$(this.element).slideUp().attr("aria-hidden","true"):$(this.element).hide().attr("aria-hidden","true")}}class P{_createChild(e,t,i,n,s,l,a,o){throw new Error("not implemented")}_createInsertionControl(e,t){throw new Error("not implemented")}_getChildDataForInsertion(e){throw new Error("not implemented")}getBlockGroups(){throw new Error("not implemented")}clear(){this.countInput.val(0),this.sequenceContainer.empty(),this.children=[],this.blockCounter=0;const e=document.createElement("div");this.sequenceContainer.append(e),this.inserters=[this._createInsertionControl(e,{index:0,onRequestInsert:(e,t)=>{this._onRequestInsert(e,t)},strings:this.blockDef.meta.strings})],this.blockCountChanged()}_onRequestInsert(e,t){const[i,n,s]=this._getChildDataForInsertion(t);this._insert(i,n,s||null,e,{animate:!0,focus:!0})}blockCountChanged(){}_insert(e,t,i,n,s){const l=this.prefix+"-"+this.blockCounter,a=s&&s.animate,o=s&&s.focus,r=s&&s.collapsed;this.blockCounter+=1;const c=this.inserters[n].element,d=document.createElement("div"),h=document.createElement("div");$(d).insertAfter(c),$(h).insertAfter(d),(0,S.y)(n,this.children.length).forEach(e=>{this.children[e].setIndex(e+1)}),(0,S.y)(n+1,this.inserters.length).forEach(e=>{this.inserters[e].setIndex(e+1)});const u=this._createChild(e,d,l,n,i,t,this,{animate:a,focus:o,collapsed:r,strings:this.blockDef.meta.strings});this.children.splice(n,0,u);const p=this._createInsertionControl(h,{index:n+1,onRequestInsert:(e,t)=>{this._onRequestInsert(e,t)},strings:this.blockDef.meta.strings,animate:a});this.inserters.splice(n+1,0,p),this.countInput.val(this.blockCounter);const m=0===n,b=n===this.children.length-1;return m||(u.enableMoveUp(),b&&this.children[n-1].enableMoveDown()),b||(u.enableMoveDown(),m&&this.children[n+1].enableMoveUp()),this.blockCountChanged(),u}deleteBlock(e,t){const i=t&&t.animate;this.children[e].markDeleted({animate:i}),this.inserters[e].delete({animate:i}),this.children.splice(e,1),this.inserters.splice(e,1),(0,S.y)(e,this.children.length).forEach(e=>{this.children[e].setIndex(e)}),(0,S.y)(e,this.inserters.length).forEach(e=>{this.inserters[e].setIndex(e)}),0===e&&this.children.length>0&&this.children[0].disableMoveUp(),e===this.children.length&&this.children.length>0&&this.children[this.children.length-1].disableMoveDown(),this.blockCountChanged()}initDragNDrop(){this.sortable=_.Ay.create(this.sequenceContainer.get(0),{handle:'[data-streamfield-action="DRAG"]',animation:200,draggable:"[data-streamfield-child]",onEnd:e=>{const{oldDraggableIndex:t,newDraggableIndex:i}=e;t!==i&&this.moveBlock(t,i)},setData:e=>{e.setData("application/vnd.wagtail.type","sf-block")}})}moveBlock(e,t){if(e===t)return;const i=this.inserters[e],n=this.children[e];t>e?$(i.element).insertAfter(this.children[t].element):$(i.element).insertBefore(this.inserters[t].element),$(n.element).insertAfter(i.element),this.inserters.splice(e,1),this.inserters.splice(t,0,i),this.children.splice(e,1),this.children.splice(t,0,n),t>e?(0,S.y)(e,t+1).forEach(e=>{this.inserters[e].setIndex(e),this.children[e].setIndex(e)}):(0,S.y)(t,e+1).forEach(e=>{this.inserters[e].setIndex(e),this.children[e].setIndex(e)});const s=this.children.length-1;0===e&&(n.enableMoveUp(),this.children[0].disableMoveUp()),e===s&&(n.enableMoveDown(),this.children[s].disableMoveDown()),0===t&&(n.disableMoveUp(),this.children[1].enableMoveUp()),t===s&&(n.disableMoveDown(),this.children[s-1].enableMoveDown())}moveBlockUp(e){this.moveBlock(e,e-1)}moveBlockDown(e){this.moveBlock(e,e+1)}setState(e){this.clear(),e.forEach((e,t)=>{this.insert(e,t)})}getState(){return this.children.map(e=>e.getState())}getDuplicatedState(){return this.children.map(e=>e.getDuplicatedState())}getValue(){return this.children.map(e=>e.getValue())}getTextLabel(e){const t=e&&e.maxLength;let i="";for(const e of this.children){const n=e.getTextLabel({maxLength:t});if(n)if(i){const e=i+", "+n;if(t&&e.length>t-1)return i.endsWith("…")||(i+="…"),i;i=e}else i=n}return i}focus(e){this.children.length&&this.children[0].focus(e)}}class R extends U{getState(){return{id:this.id||null,value:this.block.getState()}}getValue(){return this.block.getValue()}setState({value:e,id:t}){this.block.setState(e),this.id=void 0===t?null:t}setValue(e){this.block.setState(e)}split(e,t,i,n){this.sequence.splitBlock(this.index,e,t,i,n)}}class F extends O{constructor(e,t){super(e,t),this.onRequestInsert=t&&t.onRequestInsert;const i=t&&t.animate,n=(0,o.Z)(t.strings.ADD),s=$(`\n <button type="button" title="${n}" data-streamfield-list-add class="c-sf-add-button">\n <svg class="icon icon-plus" aria-hidden="true"><use href="#icon-plus"></use></svg>\n </button>\n `);$(e).replaceWith(s),this.element=s.get(0),s.click(()=>{this.onRequestInsert&&this.onRequestInsert(this.index)}),i&&s.hide().slideDown()}enable(){$(this.element).removeAttr("disabled")}disable(){$(this.element).attr("disabled","true")}}class V extends P{constructor(e,t,i,n,s){super(),this.blockDef=e,this.type=e.name,this.prefix=i;const l=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n <input type="hidden" name="${(0,o.Z)(i)}-count" data-streamfield-list-count value="0">\n\n <div data-streamfield-list-container></div>\n </div>\n `);$(t).replaceWith(l),this.blockDef.meta.helpText&&$(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `).insertBefore(l),this.children=[],this.inserters=[],this.blockCounter=0,this.countInput=l.find("[data-streamfield-list-count]"),this.sequenceContainer=l.find("[data-streamfield-list-container]"),this.container=l,this.setState(n||[]),this.blockDef.meta.collapsed&&this.children.forEach(e=>{e.collapse()}),s&&this.setError(s),this.initDragNDrop(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}setState(e){this.clear(),e.forEach(({value:e,id:t},i)=>{const n=void 0===t?B():t;this.insert(e,i,{id:t||n})})}_getChildDataForInsertion(){return[this.blockDef.childBlockDef,this.blockDef.initialChildState,B()]}_createChild(e,t,i,n,s,l,a,o){return new R(e,t,i,n,s,l,a,o)}_createInsertionControl(e,t){return new F(e,t)}blockCountChanged(){super.blockCountChanged();const e=[],t=this.blockDef.meta.maxNum;if("number"==typeof t&&this.children.length>t){const i=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${t}`);e.push(i)}const i=this.blockDef.meta.minNum;if("number"==typeof i&&this.children.length<i){const t=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${i}`);e.push(t)}e.length?this.setError({messages:e}):this.setError({})}insert(e,t,i){return this._insert(this.blockDef.childBlockDef,e,i?.id,t,i)}duplicateBlock(e,t){const i=this.children[e],{id:n,value:s}=i.getDuplicatedState(),l=t&&t.animate;this.insert(s,e+1,{animate:l,focus:!0,collapsed:i.collapsed,id:n})}splitBlock(e,t,i,n,s){const l=this.children[e],a=s&&s.animate;l.setValue(t);const o=this.insert(i,e+1,{animate:a,focus:!0,collapsed:l.collapsed}),r=l.getContentPath(),c=o.getContentPath(),d=window.comments?.commentApp;r&&c&&d&&d.utils.selectCommentsForContentPathFactory(r)(d.store.getState()).forEach(e=>{n(e)&&d.updateContentPath(e.localId,c)})}setError(e){if(!e)return;const t=this.container[0];(0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors&&Object.entries(e.blockErrors).forEach(([e,t])=>{this.children[e].setError(t)})}getBlockGroups(){return[["",[this.blockDef.childBlockDef]]]}getBlockCount(){return this.children.length}getBlockMax(){return this.blockDef.meta.maxNum||0}}class Z{constructor(e,t,i,n){this.name=e,this.childBlockDef=t,this.initialChildState=i,this.meta=n}render(e,t,i,n){return new V(this,e,t,i,n)}}var N=i(7381),j=i(4549),W=i(2891);const H={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(t){"Escape"===t.key&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}};W.Controller;class G extends U{getState(){return{type:this.type,value:this.block.getState(),id:this.id||null}}getDuplicatedState(){return{...super.getDuplicatedState(),type:this.type}}setState({type:e,value:t,id:i}){this.type=e,this.block.setState(t),this.id=void 0===i?null:i}getValue(){return{type:this.type,value:this.block.getValue(),id:this.id||null}}split(e,t,i,n){this.sequence.splitBlock(this.index,e,t,i,n)}}class z extends O{constructor(e,t){super(e,t),this.groupedChildBlockDefs=t.groupedChildBlockDefs;const i=$(`\n <div>\n <button type="button" title="${j.Mn}" class="c-sf-add-button">\n <svg class="icon icon-plus" aria-hidden="true"><use href="#icon-plus"></use></svg>\n </button>\n </div>\n `);$(e).replaceWith(i),this.element=i.get(0),this.addButton=i.find("button");const n=this.blockItems;1!==n.length||1!==n[0].items.length?(this.combobox=document.createElement("div"),this.tooltip=(0,N.Ay)(this.addButton.get(0),{content:this.combobox,trigger:"click",interactive:!0,maxWidth:"none",theme:"dropdown",arrow:!1,placement:"bottom",plugins:[H],onShow:this.renderMenu.bind(this),onHidden:()=>{s().render(null,this.combobox)}})):this.addButton.click(()=>{this.onRequestInsert&&this.onRequestInsert(this.index,n[0].items[0])})}get blockItems(){return this.groupedChildBlockDefs.map(([e,t])=>({label:e||"",type:e||"",items:t.map(e=>({type:e.name,label:e.meta.label,description:e.meta.description,icon:e.meta.icon,blockDefId:e.meta.blockDefId,isPreviewable:e.meta.isPreviewable}))}))}renderMenu(){const e=this.blockItems;s().render(a().createElement(j.Ay,{label:j.qc,placeholder:j.qc,items:e,getItemLabel:(e,t)=>t.label,getItemDescription:e=>e.label,getSearchFields:e=>[e.label,e.type],noResultsText:j.b5,onSelect:this.onSelectBlock.bind(this)}),this.combobox)}onSelectBlock(e){this.onRequestInsert&&this.onRequestInsert(this.index,{type:e.selectedItem.type}),this.close()}open(){this.addButton.attr("aria-expanded","true"),this.tooltip.show()}close(){this.addButton.attr("aria-expanded","false"),this.tooltip.hide()}}class X extends P{constructor(e,t,i,n,s){super(),this.blockDef=e,this.type=e.name,this.prefix=i;const l=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n <input type="hidden" name="${(0,o.Z)(i)}-count" data-streamfield-stream-count value="0">\n <div data-streamfield-stream-container></div>\n </div>\n `);$(t).replaceWith(l),this.blockDef.meta.helpText&&$(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `).insertBefore(l),this.container=l,this.element=l.get(0),this.children=[],this.childBlockCounts=new Map,this.inserters=[],this.blockCounter=0,this.countInput=l.find("[data-streamfield-stream-count]"),this.sequenceContainer=l.find("[data-streamfield-stream-container]"),this.setState(n||[]),this.blockDef.meta.collapsed&&this.children.forEach(e=>{e.collapse()}),s&&this.setError(s),this.initDragNDrop(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}getBlockGroups(){return this.blockDef.groupedChildBlockDefs}getBlockCount(e){return e?(this.childBlockCounts.has(e)||this._updateBlockCount(e),this.childBlockCounts.get(e)||0):this.children.length}getBlockMax(e){return e?this.blockDef.meta.blockCounts[e]?.max_num:this.blockDef.meta.maxNum}_updateBlockCount(e){const t=this.children.filter(t=>t.type===e).length;this.childBlockCounts.set(e,t)}blockCountChanged(){super.blockCountChanged(),this.childBlockCounts.clear();const e=[],t=this.blockDef.meta.maxNum;if("number"==typeof t&&this.children.length>t){const i=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${t}`);e.push(i)}const i=this.blockDef.meta.minNum;if("number"==typeof i&&this.children.length<i){const t=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${i}`);e.push(t)}for(const[t,i]of Object.entries(this.blockDef.meta.blockCounts)){const n=i.max_num;if("number"==typeof n&&this.getBlockCount(t)>n){const i=this.blockDef.childBlockDefsByName[t],s=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${n}`),l=`${i.meta.label}: ${s}`;e.push(l)}const s=i.min_num;if("number"==typeof s&&this.getBlockCount(t)<s){const i=this.blockDef.childBlockDefsByName[t],n=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${s}`),l=`${i.meta.label}: ${n}`;e.push(l)}}e.length?this.setError({messages:e}):this.setError({})}_createChild(e,t,i,n,s,l,a,o){return new G(e,t,i,n,s,l,a,o)}_createInsertionControl(e,t){return t.groupedChildBlockDefs=this.blockDef.groupedChildBlockDefs,new z(e,t)}insert({type:e,value:t,id:i},n,s){const l=this.blockDef.childBlockDefsByName[e];return this._insert(l,t,i,n,s)}_getChildDataForInsertion({type:e}){return[this.blockDef.childBlockDefsByName[e],this.blockDef.initialChildStates[e],B()]}duplicateBlock(e,t){const i=this.children[e],n=i.getDuplicatedState(),s=t&&t.animate;this.insert(n,e+1,{animate:s,focus:!0,collapsed:i.collapsed})}splitBlock(e,t,i,n,s){const l=this.children[e],a=s&&s.animate,o=l.getState(),r=this.insert({type:o.type,id:B(),value:i},e+1,{animate:a,focus:!0,collapsed:l.collapsed});l.setState({type:o.type,id:o.id||null,value:t});const c=l.getContentPath(),d=r.getContentPath(),h=window.comments?.commentApp;c&&d&&h&&h.utils.selectCommentsForContentPathFactory(c)(h.store.getState()).forEach(e=>{n(e)&&h.updateContentPath(e.localId,d)})}setState(e){super.setState(e)}setError(e){if(!e)return;const t=this.container[0];if((0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors)for(const t in e.blockErrors)(0,m.$)(e.blockErrors,t)&&this.children[t].setError(e.blockErrors[t])}}class J{constructor(e,t,i,n){this.name=e,this.groupedChildBlockDefs=t,this.initialChildStates=i,this.childBlockDefsByName={},this.groupedChildBlockDefs.forEach(([e,t])=>{t.forEach(e=>{this.childBlockDefsByName[e.name]=e})}),this.meta=n}render(e,t,i,n){return new X(this,e,t,i,n)}}const K=window.wagtailStreamField||{};K.blocks={FieldBlock:d,FieldBlockDefinition:h,StaticBlock:u,StaticBlockDefinition:p,StructBlock:w,StructBlockDefinition:D,ListBlock:V,ListBlockDefinition:Z,StreamBlock:X,StreamBlockDefinition:J},window.telepath.register("wagtail.blocks.FieldBlock",h),window.telepath.register("wagtail.blocks.StaticBlock",p),window.telepath.register("wagtail.blocks.StructBlock",D),window.telepath.register("wagtail.blocks.ListBlock",Z),window.telepath.register("wagtail.blocks.StreamBlock",J),window.wagtailStreamField=K}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,i,s,l)=>{if(!i){var a=1/0;for(d=0;d<e.length;d++){for(var[i,s,l]=e[d],o=!0,r=0;r<i.length;r++)(!1&l||a>=l)&&Object.keys(n.O).every(e=>n.O[e](i[r]))?i.splice(r--,1):(o=!1,l<a&&(a=l));if(o){e.splice(d--,1);var c=s();void 0!==c&&(t=c)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[i,s,l]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=591,(()=>{var e={591:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var s,l,[a,o,r]=i,c=0;if(a.some(t=>0!==e[t])){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);if(r)var d=r(n)}for(t&&t(i);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(d)},i=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var s=n.O(void 0,[321],()=>n(2294));s=n.O(s)})();
1
+ (()=>{"use strict";var e,t={2294:(e,t,i)=>{var n=i(6931),s=i.n(n),l=i(2427),a=i.n(l),o=i(4327),r=i(1238),c=i(1002);class d{constructor(e,t,i,n,l,d){this.blockDef=e,this.type=e.name;const h=$(`\n <div class="w-field__wrapper" data-field-wrapper>\n <div class="${(0,o.Z)(this.blockDef.meta.classname)}" data-field>\n <div class="w-field__errors" id="${i}-errors" data-field-errors>\n <svg class="icon icon-warning w-field__errors-icon" aria-hidden="true" hidden><use href="#icon-warning"></use></svg>\n </div>\n <div class="w-field__help" id="${i}-helptext" data-field-help></div>\n <div class="w-field__input" data-field-input>\n <div data-streamfield-widget></div>\n </div>\n </div>\n </div>\n `);$(t).replaceWith(h);const u=h.find("[data-streamfield-widget]").get(0);this.element=h[0],this.field=this.element.querySelector("[data-field]"),this.parentCapabilities=d||new Map,this.prefix=i;const p={attributes:this.getAttributes()};try{this.widget=this.blockDef.widget.render(u,i,i,n,this.parentCapabilities,p)}catch(e){return console.error(e),void this.setError({messages:["This widget failed to render, please check the console for details."]})}if(this.idForLabel=this.widget.idForLabel,this.blockDef.meta.helpText){const e=document.createElement("p");e.classList.add("help"),e.innerHTML=this.blockDef.meta.helpText,this.field.querySelector("[data-field-help]").appendChild(e)}if(window.comments&&this.blockDef.meta.showAddCommentButton){const t=document.createElement("button");t.type="button",t.setAttribute("aria-label",e.meta.strings.ADD_COMMENT),t.setAttribute("data-comment-add",""),t.classList.add("w-field__comment-button","w-field__comment-button--add"),s().render(a().createElement(a().Fragment,null,a().createElement(r.A,{name:"comment-add"}),a().createElement(r.A,{name:"comment-add-reversed"})),t),this.field.classList.add("w-field--commentable"),this.field.querySelector("[data-field-input]").appendChild(t),window.comments.initAddCommentButton(t)}l&&this.setError(l),(0,c.$)(this.field,this.blockDef.meta.attrs||{})}setCapabilityOptions(e,t){Object.assign(this.parentCapabilities.get(e),t),this.widget&&this.widget.setCapabilityOptions&&this.widget.setCapabilityOptions(e,t)}setState(e){this.widget&&this.widget.setState(e)}setError(e){const t=this.field.querySelector("[data-field-errors]");if(t.querySelectorAll(".error-message").forEach(e=>e.remove()),this.widget?.setInvalid?.(!!e),e){this.field.classList.add("w-field--error"),t.querySelector(".icon").removeAttribute("hidden");const i=document.createElement("p");i.classList.add("error-message");const n=document.createTextNode(e.messages.join(" "));i.appendChild(n),t.appendChild(i)}else this.field.classList.remove("w-field--error"),t.querySelector(".icon").setAttribute("hidden","true")}getAttributes(){const e=this.prefix,t={};return this.blockDef.meta.helpText&&(t["aria-describedby"]=`${e}-helptext`),this.blockDef.meta.required&&(t.required=""),this.blockDef.meta.maxLength&&(t.maxLength=this.blockDef.meta.maxLength),t}getState(){return this.widget.getState()}getValue(){return this.widget.getValue()}getTextLabel(e){return this.widget.getTextLabel?this.widget.getTextLabel(e):null}focus(e){this.widget&&this.widget.focus(e)}}class h{constructor(e,t,i){this.name=e,this.widget=t,this.meta=i}render(e,t,i,n,s){return new d(this,e,t,i,n,s)}}class u{constructor(e,t){this.blockDef=e;const i=document.createElement("div");this.blockDef.meta.html?i.innerHTML=this.blockDef.meta.html:i.innerHTML=(0,o.Z)(this.blockDef.meta.text),t.replaceWith(i),(0,c.$)(i,this.blockDef.meta.attrs||{})}setState(e){}setError(e){}getState(){return null}getValue(){return null}focus(){}}class p{constructor(e,t){this.name=e,this.meta=t}render(e){return new u(this,e)}}var m=i(4188),b=i(4545),f=i(2833);class g{constructor(e){this.props=e}render(){const e=document.createElement("template"),{panelId:t,headingId:i,contentId:n,blockDef:s,blockTypeIcon:l,blockTypeLabel:a,collapsed:o}=this.props;return e.innerHTML=`\n <section class="w-panel w-panel--nested${o?" collapsed":""}" id="${t}" aria-labelledby="${i}" data-panel>\n <div class="w-panel__header">\n <a class="w-panel__anchor w-panel__anchor--prefix" href="#${t}" aria-labelledby="${i}" data-panel-anchor>\n <svg class="icon icon-link w-panel__icon" aria-hidden="true">\n <use href="#icon-link"></use>\n </svg>\n </a>\n <button class="w-panel__toggle" type="button" aria-label="${(0,f.AP)("Toggle section")}" aria-describedby="${i}" data-panel-toggle aria-controls="${n}" aria-expanded="true">\n <svg class="icon icon-${l} w-panel__icon" aria-hidden="true">\n <use href="#icon-${l}"></use>\n </svg>\n </button>\n <h2 class="w-panel__heading w-panel__heading--label" aria-level="3" id="${i}" data-panel-heading>\n <span class="c-sf-block__type">${a}</span>\n ${s?.meta.required?'<span class="w-required-mark" data-panel-required>*</span>':""}\n <span data-panel-heading-text class="c-sf-block__title"></span>\n </h2>\n <a class="w-panel__anchor w-panel__anchor--suffix" href="#${t}" aria-labelledby="${i}">\n <svg class="icon icon-link w-panel__icon" aria-hidden="true">\n <use href="#icon-link"></use>\n </svg>\n </a>\n <div class="w-panel__divider"></div>\n <div class="w-panel__controls" data-panel-controls></div>\n </div>\n <div id="${n}" class="w-panel__content">\n ${s?"<div data-streamfield-block></div>":""}\n </div>\n </section>\n `,e.content.firstElementChild}}const k=(e,t=!("true"===e.getAttribute("aria-expanded")))=>{const i=document.querySelector(`#${e.getAttribute("aria-controls")}`);i&&(e.setAttribute("aria-expanded",`${t}`),t?i.removeAttribute("hidden"):"onbeforematch"in document.body?i.setAttribute("hidden","until-found"):i.setAttribute("hidden",""),e.dispatchEvent(new CustomEvent("commentAnchorVisibilityChange",{bubbles:!0})),e.dispatchEvent(new CustomEvent("wagtail:panel-toggle",{bubbles:!0,cancelable:!1,detail:{expanded:t}})))};function v(e){const t=e.closest("[data-panel]"),i=document.querySelector(`#${e.getAttribute("aria-controls")}`);if(!i||!t||t.collapsibleInitialised)return;t.collapsibleInitialised=!0;const n=k.bind(null,e),s=t.classList.contains("collapsed"),l=i.querySelector('[aria-invalid="true"], .error, .w-field--error'),a=s&&!l;a&&n(!1),e.addEventListener("click",n.bind(null,void 0));const o=t.querySelector("[data-panel-heading]");o&&o.addEventListener("click",n.bind(null,void 0)),i.addEventListener("beforematch",n.bind(null,!0)),e.dispatchEvent(new CustomEvent("wagtail:panel-init",{bubbles:!0,cancelable:!1,detail:{expanded:!a}}))}class w{constructor(e,t,i,n,s){const l=n||{};this.blockDef=e,this.type=e.name,this.childBlocks={};let a="";if(this.blockDef.collapsible&&(a=new g({panelId:`block_group-${i}-section`,headingId:`block_group-${i}-heading`,contentId:`block_group-${i}-content`,blockTypeIcon:(0,o.Z)(e.meta.icon),blockTypeLabel:(0,o.Z)(e.meta.label),collapsed:e.meta.collapsed}).render().outerHTML),e.meta.formTemplate){const n=e.meta.formTemplate.replace(/__PREFIX__/g,i);let o;a?(o=$(a),$(t).replaceWith(o),o=this.#e(o,i),o.append(n)):(o=$(n),$(t).replaceWith(o));const r=s?.blockErrors||{};this.blockDef.childBlockDefs.forEach(e=>{const t=o.find('[data-structblock-child="'+e.name+'"]').get(0),n=e.render(t,i+"-"+e.name,l[e.name],r[e.name]);this.childBlocks[e.name]=n}),this.container=o}else{let e=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n </div>\n `);e.append(a),$(t).replaceWith(e),this.blockDef.collapsible&&(e=this.#e(e,i)),this.blockDef.meta.helpText&&e.append(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `),this.blockDef.childBlockDefs.forEach(t=>{let n="";t instanceof this.blockDef.constructor||(n=`<label class="w-field__label">${(0,o.Z)(t.meta.label)}${t.meta.required?'<span class="w-required-mark">*</span>':""}</label>`);const a=$(`\n <div data-contentpath="${t.name}">\n ${n}\n <div data-streamfield-block></div>\n </div>\n `);e.append(a);const r=a.find("[data-streamfield-block]").get(0),c=a.find("label").get(0),d=s?.blockErrors||{},h=t.render(r,i+"-"+t.name,l[t.name],d[t.name],new Map);this.childBlocks[t.name]=h,h.idForLabel&&c.setAttribute("for",h.idForLabel)}),this.container=e}this.blockDef.collapsible&&this.setTextLabel(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}#e(e,t){const i=e.find("[data-panel-toggle]")[0],n=e.find("[data-panel-heading-text]")[0];return v(i),this.setTextLabel=()=>{const e=this.getTextLabel({maxLength:50});n.textContent=e||""},i.addEventListener("wagtail:panel-toggle",this.setTextLabel),e.find(`#block_group-${t}-content`)}setState(e){for(const t in e)this.childBlocks[t].setState(e[t])}setError(e){if(!e)return;const t=this.container[0];if((0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors)for(const t in e.blockErrors)(0,m.$)(e.blockErrors,t)&&this.childBlocks[t].setError(e.blockErrors[t])}getState(){const e={};for(const t in this.childBlocks)e[t]=this.childBlocks[t].getState();return e}getDuplicatedState(){const e={};for(const t in this.childBlocks){const i=this.childBlocks[t];e[t]=void 0===i.getDuplicatedState?i.getState():i.getDuplicatedState()}return e}getValue(){const e={};for(const t in this.childBlocks)e[t]=this.childBlocks[t].getValue();return e}getTextLabel(e){if("string"==typeof this.blockDef.meta.labelFormat)return this.blockDef.meta.labelFormat.replace(/\{(\w+)\}/g,(t,i)=>{const n=this.childBlocks[i];return n&&n.getTextLabel?n.getTextLabel(e):""});for(const t of this.blockDef.childBlockDefs){const i=this.childBlocks[t.name];if(i.getTextLabel){const t=i.getTextLabel(e);if(t)return t}}return null}focus(e){if(this.blockDef.childBlockDefs.length){const t=this.blockDef.childBlockDefs[0].name;this.childBlocks[t].focus(e)}}}class D{constructor(e,t,i){this.name=e,this.childBlockDefs=t,this.meta=i,this.collapsible=!0}render(e,t,i,n){return new w(this,e,t,i,n)}}const x={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let y;const C=new Uint8Array(16),E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));const B=function(e,t,i){if(x.randomUUID&&!t&&!e)return x.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!y){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");y=crypto.getRandomValues.bind(crypto)}return y(C)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if((i=i||0)<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+"-"+E[e[t+4]]+E[e[t+5]]+"-"+E[e[t+6]]+E[e[t+7]]+"-"+E[e[t+8]]+E[e[t+9]]+"-"+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}(n)};var _=i(246),S=i(9675);class I{constructor(e){this.sequenceChild=e}render(e){const t=this.sequenceChild.strings[this.labelIdentifier]||this.labelIdentifier;this.dom=$(`\n <button type="button" class="button button--icon text-replace white" data-streamfield-action="${this.labelIdentifier}" title="${(0,o.Z)(t)}">\n <svg class="icon icon-${(0,o.Z)(this.icon)}" aria-hidden="true">\n <use href="#icon-${(0,o.Z)(this.icon)}"></use>\n </svg>\n </button>\n `),this.dom.on("click",()=>(this.onClick&&this.onClick(),!1)),$(e).append(this.dom),this.enableEvent&&this.sequenceChild.addEventListener(this.enableEvent,()=>{this.enable()}),this.disableEvent&&this.sequenceChild.addEventListener(this.disableEvent,()=>{this.disable()}),this.initiallyDisabled&&this.disable()}enable(){this.dom.removeAttr("disabled")}disable(){this.dom.attr("disabled","true")}}class q extends I{enableEvent="enableMoveUp";disableEvent="disableMoveUp";initiallyDisabled=!0;icon="arrow-up";labelIdentifier="MOVE_UP";onClick(){this.sequenceChild.moveUp()}}class L extends I{enableEvent="enableMoveDown";disableEvent="disableMoveDown";initiallyDisabled=!0;icon="arrow-down";labelIdentifier="MOVE_DOWN";onClick(){this.sequenceChild.moveDown()}}class T extends I{enableEvent="enableDrag";disableEvent="disableDrag";initiallyDisabled=!1;icon="grip";labelIdentifier="DRAG"}class A extends I{enableEvent="enableDuplication";disableEvent="disableDuplication";icon="copy";labelIdentifier="DUPLICATE";onClick(){this.sequenceChild.duplicate({animate:!0})}}class M extends I{icon="bin";labelIdentifier="DELETE";onClick(){this.sequenceChild.delete({animate:!0})}}class U extends EventTarget{constructor(e,t,i,n,s,l,a,r){super(),this.blockDef=e,this.type=e.name,this.prefix=i,this.index=n,this.id=s,this.sequence=a;const c=r&&r.animate,d=r&&r.focus,h=r&&r.collapsed;this.strings=r&&r.strings||{};const u=`block-${s}-section`,p=`block-${s}-heading`,m=`block-${s}-content`,b=(0,o.Z)(this.blockDef.meta.icon),f=(0,o.Z)(this.blockDef.meta.label),k=new g({panelId:u,headingId:p,contentId:m,blockDef:e,blockTypeIcon:b,blockTypeLabel:f}).render(),w=$(`\n <div data-streamfield-child ${this.id?`data-contentpath="${(0,o.Z)(this.id)}"`:"data-contentpath-disabled"}>\n <input type="hidden" name="${this.prefix}-deleted" value="">\n <input type="hidden" name="${this.prefix}-order" value="${n}">\n <input type="hidden" name="${this.prefix}-type" value="${(0,o.Z)(this.type||"")}">\n <input type="hidden" name="${this.prefix}-id" value="${(0,o.Z)(this.id||"")}">\n ${k.outerHTML}\n </div>\n `);$(t).replaceWith(w),this.element=w.get(0);const x=w.find("[data-streamfield-block]").get(0);this.actionsContainerElement=w.find("[data-panel-controls]").get(0),this.titleElement=w.find("[data-panel-heading-text]"),this.toggleElement=this.element.querySelector("[data-panel-toggle]"),this.deletedInput=w.find(`input[name="${this.prefix}-deleted"]`),this.indexInput=w.find(`input[name="${this.prefix}-order"]`),this.addActionButton(new q(this)),this.addActionButton(new L(this)),this.addActionButton(new T(this)),this.addActionButton(new A(this)),this.addActionButton(new M(this));const y=new Map;y.set("duplicate",{enabled:!0,fn:this.duplicate}),y.set("split",{enabled:!0,fn:this.split.bind(this)}),y.set("addSibling",{enabled:!0,fn:this.addSibling.bind(this),blockGroups:this.sequence.getBlockGroups(),getBlockCount:this.sequence.getBlockCount.bind(this.sequence),getBlockMax:this.sequence.getBlockMax.bind(this.sequence)}),this.blockDef instanceof D&&(this.blockDef.collapsible=!1),this.block=this.blockDef.render(x,this.prefix+"-value",l,void 0,y),v(this.element.querySelector("[data-panel-toggle]")),h&&this.collapse(),this.toggleElement.addEventListener("wagtail:panel-toggle",()=>{const e=this.getTextLabel({maxLength:70});this.titleElement.text(e||"")});const C=this.getTextLabel({maxLength:70});this.titleElement.text(C||""),c?(w.hide(),setTimeout(()=>{w.slideDown(),d&&this.block.focus({soft:!0})},10)):d&&this.block.focus({soft:!0})}addActionButton(e){e.render(this.actionsContainerElement)}addSibling(e){this.sequence._onRequestInsert(this.index+1,e)}moveUp(){this.sequence.moveBlockUp(this.index)}moveDown(){this.sequence.moveBlockDown(this.index)}duplicate(e){this.sequence.duplicateBlock(this.index,e)}delete(e){this.sequence.deleteBlock(this.index,e)}markDeleted({animate:e=!1}){this.deletedInput.val("1"),e?$(this.element).slideUp().dequeue().fadeOut().attr("aria-hidden","true"):$(this.element).hide().attr("aria-hidden","true");const t=this.getContentPath();t&&window.comments.commentApp&&window.comments.commentApp.invalidateContentPath(t)}getContentPath(){return window.comments?.getContentPath(this.element)}enableDuplication(){this.dispatchEvent(new Event("enableDuplication")),this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("duplicate",{enabled:!0})}disableDuplication(){this.dispatchEvent(new Event("disableDuplication")),this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("duplicate",{enabled:!1})}enableSplit(){this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("split",{enabled:!0})}disableSplit(){this.block&&this.block.setCapabilityOptions&&this.block.setCapabilityOptions("split",{enabled:!1})}enableMoveUp(){this.dispatchEvent(new Event("enableMoveUp"))}disableMoveUp(){this.dispatchEvent(new Event("disableMoveUp"))}enableMoveDown(){this.dispatchEvent(new Event("enableMoveDown"))}disableMoveDown(){this.dispatchEvent(new Event("disableMoveDown"))}setIndex(e){this.index=e,this.indexInput.val(e)}setError(e){this.block.setError(e),e&&k(this.toggleElement,!0)}focus(e){this.block.focus(e)}getTextLabel(e){return this.block.getTextLabel?this.block.getTextLabel(e):null}collapse(){k(this.toggleElement,!1)}getDuplicatedState(){return{id:B(),value:void 0===this.block.getDuplicatedState?this.block.getState():this.block.getDuplicatedState()}}}class O{constructor(e,t){this.index=t&&t.index,this.onRequestInsert=t&&t.onRequestInsert}setIndex(e){this.index=e}delete({animate:e=!1}){e?$(this.element).slideUp().attr("aria-hidden","true"):$(this.element).hide().attr("aria-hidden","true")}}class P{_createChild(e,t,i,n,s,l,a,o){throw new Error("not implemented")}_createInsertionControl(e,t){throw new Error("not implemented")}_getChildDataForInsertion(e){throw new Error("not implemented")}getBlockGroups(){throw new Error("not implemented")}clear(){this.countInput.val(0),this.sequenceContainer.empty(),this.children=[],this.blockCounter=0;const e=document.createElement("div");this.sequenceContainer.append(e),this.inserters=[this._createInsertionControl(e,{index:0,onRequestInsert:(e,t)=>{this._onRequestInsert(e,t)},strings:this.blockDef.meta.strings})],this.blockCountChanged()}_onRequestInsert(e,t){const[i,n,s]=this._getChildDataForInsertion(t);this._insert(i,n,s||null,e,{animate:!0,focus:!0})}blockCountChanged(){}_insert(e,t,i,n,s){const l=this.prefix+"-"+this.blockCounter,a=s&&s.animate,o=s&&s.focus,r=s&&s.collapsed;this.blockCounter+=1;const c=this.inserters[n].element,d=document.createElement("div"),h=document.createElement("div");$(d).insertAfter(c),$(h).insertAfter(d),(0,S.y)(n,this.children.length).forEach(e=>{this.children[e].setIndex(e+1)}),(0,S.y)(n+1,this.inserters.length).forEach(e=>{this.inserters[e].setIndex(e+1)});const u=this._createChild(e,d,l,n,i,t,this,{animate:a,focus:o,collapsed:r,strings:this.blockDef.meta.strings});this.children.splice(n,0,u);const p=this._createInsertionControl(h,{index:n+1,onRequestInsert:(e,t)=>{this._onRequestInsert(e,t)},strings:this.blockDef.meta.strings,animate:a});this.inserters.splice(n+1,0,p),this.countInput.val(this.blockCounter);const m=0===n,b=n===this.children.length-1;return m||(u.enableMoveUp(),b&&this.children[n-1].enableMoveDown()),b||(u.enableMoveDown(),m&&this.children[n+1].enableMoveUp()),this.blockCountChanged(),u}deleteBlock(e,t){const i=t&&t.animate;this.children[e].markDeleted({animate:i}),this.inserters[e].delete({animate:i}),this.children.splice(e,1),this.inserters.splice(e,1),(0,S.y)(e,this.children.length).forEach(e=>{this.children[e].setIndex(e)}),(0,S.y)(e,this.inserters.length).forEach(e=>{this.inserters[e].setIndex(e)}),0===e&&this.children.length>0&&this.children[0].disableMoveUp(),e===this.children.length&&this.children.length>0&&this.children[this.children.length-1].disableMoveDown(),this.blockCountChanged()}initDragNDrop(){this.sortable=_.Ay.create(this.sequenceContainer.get(0),{handle:'[data-streamfield-action="DRAG"]',animation:200,draggable:"[data-streamfield-child]",onEnd:e=>{const{oldDraggableIndex:t,newDraggableIndex:i}=e;t!==i&&this.moveBlock(t,i)},setData:e=>{e.setData("application/vnd.wagtail.type","sf-block")}})}moveBlock(e,t){if(e===t)return;const i=this.inserters[e],n=this.children[e];t>e?$(i.element).insertAfter(this.children[t].element):$(i.element).insertBefore(this.inserters[t].element),$(n.element).insertAfter(i.element),this.inserters.splice(e,1),this.inserters.splice(t,0,i),this.children.splice(e,1),this.children.splice(t,0,n),t>e?(0,S.y)(e,t+1).forEach(e=>{this.inserters[e].setIndex(e),this.children[e].setIndex(e)}):(0,S.y)(t,e+1).forEach(e=>{this.inserters[e].setIndex(e),this.children[e].setIndex(e)});const s=this.children.length-1;0===e&&(n.enableMoveUp(),this.children[0].disableMoveUp()),e===s&&(n.enableMoveDown(),this.children[s].disableMoveDown()),0===t&&(n.disableMoveUp(),this.children[1].enableMoveUp()),t===s&&(n.disableMoveDown(),this.children[s-1].enableMoveDown())}moveBlockUp(e){this.moveBlock(e,e-1)}moveBlockDown(e){this.moveBlock(e,e+1)}setState(e){this.clear(),e.forEach((e,t)=>{this.insert(e,t)})}getState(){return this.children.map(e=>e.getState())}getDuplicatedState(){return this.children.map(e=>e.getDuplicatedState())}getValue(){return this.children.map(e=>e.getValue())}getTextLabel(e){const t=e&&e.maxLength;let i="";for(const e of this.children){const n=e.getTextLabel({maxLength:t});if(n)if(i){const e=i+", "+n;if(t&&e.length>t-1)return i.endsWith("…")||(i+="…"),i;i=e}else i=n}return i}focus(e){this.children.length&&this.children[0].focus(e)}}class R extends U{getState(){return{id:this.id||null,value:this.block.getState()}}getValue(){return this.block.getValue()}setState({value:e,id:t}){this.block.setState(e),this.id=void 0===t?null:t}setValue(e){this.block.setState(e)}split(e,t,i,n){this.sequence.splitBlock(this.index,e,t,i,n)}}class F extends O{constructor(e,t){super(e,t),this.onRequestInsert=t&&t.onRequestInsert;const i=t&&t.animate,n=(0,o.Z)(t.strings.ADD),s=$(`\n <button type="button" title="${n}" data-streamfield-list-add class="c-sf-add-button">\n <svg class="icon icon-plus" aria-hidden="true"><use href="#icon-plus"></use></svg>\n </button>\n `);$(e).replaceWith(s),this.element=s.get(0),s.click(()=>{this.onRequestInsert&&this.onRequestInsert(this.index)}),i&&s.hide().slideDown()}enable(){$(this.element).removeAttr("disabled")}disable(){$(this.element).attr("disabled","true")}}class V extends P{constructor(e,t,i,n,s){super(),this.blockDef=e,this.type=e.name,this.prefix=i;const l=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n <input type="hidden" name="${(0,o.Z)(i)}-count" data-streamfield-list-count value="0">\n\n <div data-streamfield-list-container></div>\n </div>\n `);$(t).replaceWith(l),this.blockDef.meta.helpText&&$(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `).insertBefore(l),this.children=[],this.inserters=[],this.blockCounter=0,this.countInput=l.find("[data-streamfield-list-count]"),this.sequenceContainer=l.find("[data-streamfield-list-container]"),this.container=l,this.setState(n||[]),this.blockDef.meta.collapsed&&this.children.forEach(e=>{e.collapse()}),s&&this.setError(s),this.initDragNDrop(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}setState(e){this.clear(),e.forEach(({value:e,id:t},i)=>{const n=void 0===t?B():t;this.insert(e,i,{id:t||n})})}_getChildDataForInsertion(){return[this.blockDef.childBlockDef,this.blockDef.initialChildState,B()]}_createChild(e,t,i,n,s,l,a,o){return new R(e,t,i,n,s,l,a,o)}_createInsertionControl(e,t){return new F(e,t)}blockCountChanged(){super.blockCountChanged();const e=[],t=this.blockDef.meta.maxNum;if("number"==typeof t&&this.children.length>t){const i=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${t}`);e.push(i)}const i=this.blockDef.meta.minNum;if("number"==typeof i&&this.children.length<i){const t=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${i}`);e.push(t)}e.length?this.setError({messages:e}):this.setError({})}insert(e,t,i){return this._insert(this.blockDef.childBlockDef,e,i?.id,t,i)}duplicateBlock(e,t){const i=this.children[e],{id:n,value:s}=i.getDuplicatedState(),l=t&&t.animate;this.insert(s,e+1,{animate:l,focus:!0,collapsed:i.collapsed,id:n})}splitBlock(e,t,i,n,s){const l=this.children[e],a=s&&s.animate;l.setValue(t);const o=this.insert(i,e+1,{animate:a,focus:!0,collapsed:l.collapsed}),r=l.getContentPath(),c=o.getContentPath(),d=window.comments?.commentApp;r&&c&&d&&d.utils.selectCommentsForContentPathFactory(r)(d.store.getState()).forEach(e=>{n(e)&&d.updateContentPath(e.localId,c)})}setError(e){if(!e)return;const t=this.container[0];(0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors&&Object.entries(e.blockErrors).forEach(([e,t])=>{this.children[e].setError(t)})}getBlockGroups(){return[["",[this.blockDef.childBlockDef]]]}getBlockCount(){return this.children.length}getBlockMax(){return this.blockDef.meta.maxNum||0}}class Z{constructor(e,t,i,n){this.name=e,this.childBlockDef=t,this.initialChildState=i,this.meta=n}render(e,t,i,n){return new V(this,e,t,i,n)}}var N=i(7381),j=i(4549),W=i(2891);const H={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(t){"Escape"===t.key&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}};W.Controller;class G extends U{getState(){return{type:this.type,value:this.block.getState(),id:this.id||null}}getDuplicatedState(){return{...super.getDuplicatedState(),type:this.type}}setState({type:e,value:t,id:i}){this.type=e,this.block.setState(t),this.id=void 0===i?null:i}getValue(){return{type:this.type,value:this.block.getValue(),id:this.id||null}}split(e,t,i,n){this.sequence.splitBlock(this.index,e,t,i,n)}}class z extends O{constructor(e,t){super(e,t),this.groupedChildBlockDefs=t.groupedChildBlockDefs;const i=$(`\n <div>\n <button type="button" title="${j.Mn}" class="c-sf-add-button">\n <svg class="icon icon-plus" aria-hidden="true"><use href="#icon-plus"></use></svg>\n </button>\n </div>\n `);$(e).replaceWith(i),this.element=i.get(0),this.addButton=i.find("button");const n=this.blockItems;1!==n.length||1!==n[0].items.length?(this.combobox=document.createElement("div"),this.tooltip=(0,N.Ay)(this.addButton.get(0),{content:this.combobox,trigger:"click",interactive:!0,maxWidth:"none",theme:"dropdown",arrow:!1,placement:"bottom",plugins:[H],onShow:this.renderMenu.bind(this),onHidden:()=>{s().render(null,this.combobox)}})):this.addButton.click(()=>{this.onRequestInsert&&this.onRequestInsert(this.index,n[0].items[0])})}get blockItems(){return this.groupedChildBlockDefs.map(([e,t])=>({label:e||"",type:e||"",items:t.map(e=>({type:e.name,label:e.meta.label,description:e.meta.description,icon:e.meta.icon,blockDefId:e.meta.blockDefId,isPreviewable:e.meta.isPreviewable}))}))}renderMenu(){const e=this.blockItems;s().render(a().createElement(j.Ay,{label:j.qc,placeholder:j.qc,items:e,getItemLabel:(e,t)=>t.label,getItemDescription:e=>e.label,getSearchFields:e=>[e.label,e.type],noResultsText:j.b5,onSelect:this.onSelectBlock.bind(this)}),this.combobox)}onSelectBlock(e){this.onRequestInsert&&this.onRequestInsert(this.index,{type:e.selectedItem.type}),this.close()}open(){this.addButton.attr("aria-expanded","true"),this.tooltip.show()}close(){this.addButton.attr("aria-expanded","false"),this.tooltip.hide()}}class X extends P{constructor(e,t,i,n,s){super(),this.blockDef=e,this.type=e.name,this.prefix=i;const l=$(`\n <div class="${(0,o.Z)(this.blockDef.meta.classname||"")}">\n <input type="hidden" name="${(0,o.Z)(i)}-count" data-streamfield-stream-count value="0">\n <div data-streamfield-stream-container></div>\n </div>\n `);$(t).replaceWith(l),this.blockDef.meta.helpText&&$(`\n <div class="c-sf-help">\n <div class="help">\n ${this.blockDef.meta.helpText}\n </div>\n </div>\n `).insertBefore(l),this.container=l,this.element=l.get(0),this.children=[],this.childBlockCounts=new Map,this.inserters=[],this.blockCounter=0,this.countInput=l.find("[data-streamfield-stream-count]"),this.sequenceContainer=l.find("[data-streamfield-stream-container]"),this.setState(n||[]),this.blockDef.meta.collapsed&&this.children.forEach(e=>{e.collapse()}),s&&this.setError(s),this.initDragNDrop(),(0,c.$)(this.container[0],this.blockDef.meta.attrs||{})}getBlockGroups(){return this.blockDef.groupedChildBlockDefs}getBlockCount(e){return e?(this.childBlockCounts.has(e)||this._updateBlockCount(e),this.childBlockCounts.get(e)||0):this.children.length}getBlockMax(e){return e?this.blockDef.meta.blockCounts[e]?.max_num:this.blockDef.meta.maxNum}_updateBlockCount(e){const t=this.children.filter(t=>t.type===e).length;this.childBlockCounts.set(e,t)}blockCountChanged(){super.blockCountChanged(),this.childBlockCounts.clear();const e=[],t=this.blockDef.meta.maxNum;if("number"==typeof t&&this.children.length>t){const i=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${t}`);e.push(i)}const i=this.blockDef.meta.minNum;if("number"==typeof i&&this.children.length<i){const t=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${i}`);e.push(t)}for(const[t,i]of Object.entries(this.blockDef.meta.blockCounts)){const n=i.max_num;if("number"==typeof n&&this.getBlockCount(t)>n){const i=this.blockDef.childBlockDefsByName[t],s=(0,f.AP)("The maximum number of items is %(max_num)d").replace("%(max_num)d",`${n}`),l=`${i.meta.label}: ${s}`;e.push(l)}const s=i.min_num;if("number"==typeof s&&this.getBlockCount(t)<s){const i=this.blockDef.childBlockDefsByName[t],n=(0,f.AP)("The minimum number of items is %(min_num)d").replace("%(min_num)d",`${s}`),l=`${i.meta.label}: ${n}`;e.push(l)}}e.length?this.setError({messages:e}):this.setError({})}_createChild(e,t,i,n,s,l,a,o){return new G(e,t,i,n,s,l,a,o)}_createInsertionControl(e,t){return t.groupedChildBlockDefs=this.blockDef.groupedChildBlockDefs,new z(e,t)}insert({type:e,value:t,id:i},n,s){const l=this.blockDef.childBlockDefsByName[e];return this._insert(l,t,i,n,s)}_getChildDataForInsertion({type:e}){return[this.blockDef.childBlockDefsByName[e],this.blockDef.initialChildStates[e],B()]}duplicateBlock(e,t){const i=this.children[e],n=i.getDuplicatedState(),s=t&&t.animate;this.insert(n,e+1,{animate:s,focus:!0,collapsed:i.collapsed})}splitBlock(e,t,i,n,s){const l=this.children[e],a=s&&s.animate,o=l.getState(),r=this.insert({type:o.type,id:B(),value:i},e+1,{animate:a,focus:!0,collapsed:l.collapsed});l.setState({type:o.type,id:o.id||null,value:t});const c=l.getContentPath(),d=r.getContentPath(),h=window.comments?.commentApp;c&&d&&h&&h.utils.selectCommentsForContentPathFactory(c)(h.store.getState()).forEach(e=>{n(e)&&h.updateContentPath(e.localId,d)})}setState(e){super.setState(e)}setError(e){if(!e)return;const t=this.container[0];if((0,b.$)(t),e.messages&&(0,b.U)(t,e.messages),e.blockErrors)for(const t in e.blockErrors)(0,m.$)(e.blockErrors,t)&&this.children[t].setError(e.blockErrors[t])}}class J{constructor(e,t,i,n){this.name=e,this.groupedChildBlockDefs=t,this.initialChildStates=i,this.childBlockDefsByName={},this.groupedChildBlockDefs.forEach(([e,t])=>{t.forEach(e=>{this.childBlockDefsByName[e.name]=e})}),this.meta=n}render(e,t,i,n){return new X(this,e,t,i,n)}}const K=window.wagtailStreamField||{};K.blocks={FieldBlock:d,FieldBlockDefinition:h,StaticBlock:u,StaticBlockDefinition:p,StructBlock:w,StructBlockDefinition:D,ListBlock:V,ListBlockDefinition:Z,StreamBlock:X,StreamBlockDefinition:J},window.telepath.register("wagtail.blocks.FieldBlock",h),window.telepath.register("wagtail.blocks.StaticBlock",p),window.telepath.register("wagtail.blocks.StructBlock",D),window.telepath.register("wagtail.blocks.ListBlock",Z),window.telepath.register("wagtail.blocks.StreamBlock",J),window.wagtailStreamField=K}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,i,s,l)=>{if(!i){var a=1/0;for(d=0;d<e.length;d++){for(var[i,s,l]=e[d],o=!0,r=0;r<i.length;r++)(!1&l||a>=l)&&Object.keys(n.O).every(e=>n.O[e](i[r]))?i.splice(r--,1):(o=!1,l<a&&(a=l));if(o){e.splice(d--,1);var c=s();void 0!==c&&(t=c)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[i,s,l]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=591,(()=>{var e={591:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var s,l,[a,o,r]=i,c=0;if(a.some(t=>0!==e[t])){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);if(r)var d=r(n)}for(t&&t(i);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(d)},i=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var s=n.O(void 0,[321],()=>n(2294));s=n.O(s)})();
@@ -1,6 +1,7 @@
1
1
  import datetime
2
2
  from functools import wraps
3
3
 
4
+ from django.contrib.auth.models import Permission
4
5
  from django.test import TestCase, override_settings
5
6
  from django.urls import reverse
6
7
  from django.utils import timezone
@@ -358,6 +359,47 @@ class TestPreview(WagtailTestUtils, TestCase):
358
359
  self.assertTemplateUsed(response, "tests/event_page.html")
359
360
  self.assertContains(response, "Placeholder title")
360
361
 
362
+ def test_preview_on_create_without_permissions(self):
363
+ # Remove privileges from user
364
+ self.user.is_superuser = False
365
+ self.user.user_permissions.add(
366
+ Permission.objects.get(
367
+ content_type__app_label="wagtailadmin", codename="access_admin"
368
+ )
369
+ )
370
+ self.user.save()
371
+
372
+ preview_url = reverse(
373
+ "wagtailadmin_pages:preview_on_add",
374
+ args=("tests", "eventpage", self.home_page.id),
375
+ )
376
+
377
+ response = self.client.post(
378
+ preview_url,
379
+ self.post_data,
380
+ )
381
+ self.assertEqual(response.status_code, 302)
382
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
383
+
384
+ def test_preview_on_create_get_without_permissions(self):
385
+ # Remove privileges from user
386
+ self.user.is_superuser = False
387
+ self.user.user_permissions.add(
388
+ Permission.objects.get(
389
+ content_type__app_label="wagtailadmin", codename="access_admin"
390
+ )
391
+ )
392
+ self.user.save()
393
+
394
+ preview_url = reverse(
395
+ "wagtailadmin_pages:preview_on_add",
396
+ args=("tests", "eventpage", self.home_page.id),
397
+ )
398
+
399
+ response = self.client.get(preview_url)
400
+ self.assertEqual(response.status_code, 302)
401
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
402
+
361
403
  def test_preview_on_edit_with_m2m_field(self):
362
404
  preview_url = reverse(
363
405
  "wagtailadmin_pages:preview_on_edit", args=(self.event_page.id,)
@@ -587,6 +629,45 @@ class TestPreview(WagtailTestUtils, TestCase):
587
629
  response = self.client.get(preview_url)
588
630
  self.assertEqual(response.status_code, 200)
589
631
 
632
+ def test_preview_on_edit_without_permissions(self):
633
+ # Remove privileges from user
634
+ self.user.is_superuser = False
635
+ self.user.user_permissions.add(
636
+ Permission.objects.get(
637
+ content_type__app_label="wagtailadmin", codename="access_admin"
638
+ )
639
+ )
640
+ self.user.save()
641
+
642
+ preview_url = reverse(
643
+ "wagtailadmin_pages:preview_on_edit", args=(self.event_page.id,)
644
+ )
645
+
646
+ response = self.client.post(
647
+ preview_url,
648
+ self.post_data,
649
+ )
650
+ self.assertEqual(response.status_code, 302)
651
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
652
+
653
+ def test_preview_on_edit_get_without_permissions(self):
654
+ # Remove privileges from user
655
+ self.user.is_superuser = False
656
+ self.user.user_permissions.add(
657
+ Permission.objects.get(
658
+ content_type__app_label="wagtailadmin", codename="access_admin"
659
+ )
660
+ )
661
+ self.user.save()
662
+
663
+ preview_url = reverse(
664
+ "wagtailadmin_pages:preview_on_edit", args=(self.event_page.id,)
665
+ )
666
+
667
+ response = self.client.get(preview_url)
668
+ self.assertEqual(response.status_code, 302)
669
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
670
+
590
671
  def test_preview_on_create_clear_preview_data(self):
591
672
  preview_session_key = "wagtail-preview-tests-eventpage-{}".format(
592
673
  self.home_page.id
@@ -17,13 +17,16 @@ from wagtail.blocks.base import Block
17
17
  from wagtail.models import PreviewableMixin, RevisionMixin
18
18
  from wagtail.utils.decorators import xframe_options_sameorigin_override
19
19
 
20
+ from .permissions import PermissionCheckedMixin
20
21
 
21
- class PreviewOnEdit(View):
22
+
23
+ class PreviewOnEdit(PermissionCheckedMixin, View):
22
24
  model = None
23
25
  form_class = None
24
26
  http_method_names = ("post", "get", "delete")
25
27
  preview_expiration_timeout = 60 * 60 * 24 # seconds
26
28
  session_key_prefix = "wagtail-preview-"
29
+ permission_required = "change"
27
30
 
28
31
  def setup(self, request, *args, **kwargs):
29
32
  super().setup(request, *args, **kwargs)
@@ -54,6 +57,8 @@ class PreviewOnEdit(View):
54
57
 
55
58
  def get_object(self):
56
59
  obj = get_object_or_404(self.model, pk=unquote(str(self.kwargs["pk"])))
60
+ if not self.user_has_permission_for_instance(self.permission_required, obj):
61
+ raise PermissionDenied
57
62
  if isinstance(obj, RevisionMixin):
58
63
  obj = obj.get_latest_revision_as_object()
59
64
  return obj
@@ -136,6 +141,8 @@ class PreviewOnEdit(View):
136
141
 
137
142
 
138
143
  class PreviewOnCreate(PreviewOnEdit):
144
+ permission_required = "add"
145
+
139
146
  @property
140
147
  def session_key(self):
141
148
  app_label = self.model._meta.app_label
@@ -30,9 +30,13 @@ class PreviewOnEdit(GenericPreviewOnEdit):
30
30
  return "{}{}".format(self.session_key_prefix, self.kwargs["page_id"])
31
31
 
32
32
  def get_object(self):
33
- return get_object_or_404(
33
+ page = get_object_or_404(
34
34
  Page, id=self.kwargs["page_id"]
35
35
  ).get_latest_revision_as_object()
36
+ page_perms = page.permissions_for_user(self.request.user)
37
+ if not page_perms.can_edit():
38
+ raise PermissionDenied
39
+ return page
36
40
 
37
41
  def get_form(self, query_dict):
38
42
  form_class = self.object.get_edit_handler().get_form_class()
@@ -87,6 +91,11 @@ class PreviewOnCreate(PreviewOnEdit):
87
91
 
88
92
  page = content_type.model_class()()
89
93
  parent_page = get_object_or_404(Page, id=parent_page_id).specific
94
+
95
+ parent_page_perms = parent_page.permissions_for_user(self.request.user)
96
+ if not parent_page_perms.can_add_subpage():
97
+ raise PermissionDenied
98
+
90
99
  # We need to populate treebeard's path / depth fields in order to
91
100
  # pass validation. We can't make these 100% consistent with the rest
92
101
  # of the tree without making actual database changes (such as
@@ -1,3 +1,4 @@
1
+ from django.contrib.auth.models import Permission
1
2
  from django.test import TestCase
2
3
  from django.urls import reverse
3
4
 
@@ -118,6 +119,34 @@ class TestGenericSiteSettingPreview(WagtailTestUtils, TestCase):
118
119
  )
119
120
  self.assertNotContains(response, versioned_static("wagtailadmin/js/icons.js"))
120
121
 
122
+ def test_preview_on_edit_without_permission(self):
123
+ # Remove privileges from user
124
+ self.user.is_superuser = False
125
+ self.user.user_permissions.add(
126
+ Permission.objects.get(
127
+ content_type__app_label="wagtailadmin", codename="access_admin"
128
+ )
129
+ )
130
+ self.user.save()
131
+
132
+ response = self.client.post(self.preview_on_edit_url, self.post_data)
133
+ self.assertEqual(response.status_code, 302)
134
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
135
+
136
+ def test_preview_on_edit_get_without_permission(self):
137
+ # Remove privileges from user
138
+ self.user.is_superuser = False
139
+ self.user.user_permissions.add(
140
+ Permission.objects.get(
141
+ content_type__app_label="wagtailadmin", codename="access_admin"
142
+ )
143
+ )
144
+ self.user.save()
145
+
146
+ response = self.client.get(self.preview_on_edit_url)
147
+ self.assertEqual(response.status_code, 302)
148
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
149
+
121
150
 
122
151
  class TestSiteSettingPreview(TestGenericSiteSettingPreview):
123
152
  model = PreviewableSiteSetting
@@ -198,6 +198,7 @@ class PreviewOnEdit(preview.PreviewOnEdit):
198
198
  self.app_name = app_name
199
199
  self.model_name = model_name
200
200
  self.model = get_model_from_url_params(app_name, model_name)
201
+ self.permission_policy = self.model.get_permission_policy()
201
202
  self.pk = kwargs.get("pk")
202
203
  super().setup(request, app_name, model_name, *args, **kwargs)
203
204
 
@@ -205,9 +206,14 @@ class PreviewOnEdit(preview.PreviewOnEdit):
205
206
  self.site = None
206
207
  if issubclass(self.model, BaseSiteSetting):
207
208
  self.site = get_object_or_404(Site, pk=self.pk)
208
- return self.model.for_site(self.site)
209
+ obj = self.model.for_site(self.site)
209
210
  else:
210
- return get_object_or_404(self.model, pk=self.pk)
211
+ obj = get_object_or_404(self.model, pk=self.pk)
212
+
213
+ if not self.user_has_permission_for_instance(self.permission_required, obj):
214
+ raise PermissionDenied
215
+
216
+ return obj
211
217
 
212
218
  def get_extra_request_attrs(self):
213
219
  attrs = super().get_extra_request_attrs()
@@ -1,5 +1,6 @@
1
1
  import datetime
2
2
 
3
+ from django.contrib.auth.models import Permission
3
4
  from django.test import TestCase, override_settings
4
5
  from django.urls import reverse
5
6
  from django.utils import timezone
@@ -145,6 +146,32 @@ class TestPreview(WagtailTestUtils, TestCase):
145
146
  self.assertNotContains(response, "<li>Parties</li>")
146
147
  self.assertContains(response, "<li>Holidays</li>")
147
148
 
149
+ def test_preview_on_create_without_permissions(self):
150
+ # Remove privileges from user
151
+ self.user.is_superuser = False
152
+ self.user.user_permissions.add(
153
+ Permission.objects.get(
154
+ content_type__app_label="wagtailadmin", codename="access_admin"
155
+ )
156
+ )
157
+ self.user.save()
158
+ response = self.client.post(self.preview_on_add_url, self.post_data)
159
+ self.assertEqual(response.status_code, 302)
160
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
161
+
162
+ def test_preview_on_create_get_without_permissions(self):
163
+ # Remove privileges from user
164
+ self.user.is_superuser = False
165
+ self.user.user_permissions.add(
166
+ Permission.objects.get(
167
+ content_type__app_label="wagtailadmin", codename="access_admin"
168
+ )
169
+ )
170
+ self.user.save()
171
+ response = self.client.get(self.preview_on_add_url)
172
+ self.assertEqual(response.status_code, 302)
173
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
174
+
148
175
  def test_preview_on_edit_with_m2m_field(self):
149
176
  response = self.client.post(self.preview_on_edit_url, self.post_data)
150
177
 
@@ -262,6 +289,32 @@ class TestPreview(WagtailTestUtils, TestCase):
262
289
  self.client.session,
263
290
  )
264
291
 
292
+ def test_preview_on_edit_without_permissions(self):
293
+ # Remove privileges from user
294
+ self.user.is_superuser = False
295
+ self.user.user_permissions.add(
296
+ Permission.objects.get(
297
+ content_type__app_label="wagtailadmin", codename="access_admin"
298
+ )
299
+ )
300
+ self.user.save()
301
+ response = self.client.post(self.preview_on_edit_url, self.post_data)
302
+ self.assertEqual(response.status_code, 302)
303
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
304
+
305
+ def test_preview_on_edit_get_without_permissions(self):
306
+ # Remove privileges from user
307
+ self.user.is_superuser = False
308
+ self.user.user_permissions.add(
309
+ Permission.objects.get(
310
+ content_type__app_label="wagtailadmin", codename="access_admin"
311
+ )
312
+ )
313
+ self.user.save()
314
+ response = self.client.get(self.preview_on_edit_url)
315
+ self.assertEqual(response.status_code, 302)
316
+ self.assertRedirects(response, reverse("wagtailadmin_home"))
317
+
265
318
  def test_preview_on_create_clear_preview_data(self):
266
319
  # Set a fake preview session data for the page
267
320
  self.client.session[self.session_key_prefix] = "test data"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wagtail
3
- Version: 7.2.1
3
+ Version: 7.2.2
4
4
  Summary: A Django content management system.
5
5
  Author-email: Wagtail core team + contributors <hello@wagtail.org>
6
6
  License-Expression: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- wagtail/__init__.py,sha256=1FW8bfPrm6N4D_v9UOypsbL7QnlxNb24pALni1Soq6A,724
1
+ wagtail/__init__.py,sha256=CwNA11C5REhwt37NM84G9ImMK0evNTGVSf3HsO2Izs0,724
2
2
  wagtail/apps.py,sha256=FXiiXfVWITqUUiZj32q94NMLxYoqcAncdb0tgWAqyms,690
3
3
  wagtail/checks.py,sha256=xz3qVBhqczycNKXG6yi8tTtcHKMBGwVQa1nVmNw5IGE,1195
4
4
  wagtail/compat.py,sha256=5z6X9d-h_VUFt44kuZ-Cw00e9Be5vIXy7yqAdfuv3Mc,1452
@@ -412,7 +412,7 @@ wagtail/admin/static/wagtailadmin/js/vendor.js,sha256=0jW5gA6O45I6eNozKYXm07bgfq
412
412
  wagtail/admin/static/wagtailadmin/js/vendor.js.LICENSE.txt,sha256=JMOL5mls_mVKHmyX-LLI9oBw_bqb0juMVTj9sccwlAM,1608
413
413
  wagtail/admin/static/wagtailadmin/js/wagtailadmin.js,sha256=PJdQN6eYLNBQ4txmpKIRCYrcNXG_YEtgCLI8uZJQteQ,11900
414
414
  wagtail/admin/static/wagtailadmin/js/workflow-action.js,sha256=A31JmTyr5u5z04ApuOEh4kj9K2QxMaoOpCTnUx1ICNs,3570
415
- wagtail/admin/static/wagtailadmin/js/telepath/blocks.js,sha256=qONfyrEvDNVJ5P9w0AlKPnGq2RcRlndduclZsYR5NtY,33422
415
+ wagtail/admin/static/wagtailadmin/js/telepath/blocks.js,sha256=a7keS8hC48nunRaTNDTuR6ibSYIcoWybWTlt0iNUoOM,33476
416
416
  wagtail/admin/static/wagtailadmin/js/telepath/telepath.js,sha256=iAxwHFu7D_gp6baZkEvKkB9JS0dwaQJIDSV8LkZS_cQ,1547
417
417
  wagtail/admin/static/wagtailadmin/js/telepath/widgets.js,sha256=tXVFu6Si4OP-GKP7cUUTfwOGDHsyX0IrbPuLBp6UKzI,5585
418
418
  wagtail/admin/static/wagtailadmin/js/vendor/bootstrap-modal.js,sha256=Bm3OltxbimAPGYgm7l9V44U_xTqM6xexeIs16qO1OcQ,3869
@@ -919,7 +919,7 @@ wagtail/admin/tests/pages/test_page_locking.py,sha256=7CMYaBVzbvSdsLMtXNOoVYnG0i
919
919
  wagtail/admin/tests/pages/test_page_search.py,sha256=VTVOvgIH1IicUsuTCWHnKRKowMJBRWhAX8M7_YK1Tbg,13133
920
920
  wagtail/admin/tests/pages/test_page_usage.py,sha256=5kdKxoffOuz8cnPNPsqQbisT4QwlNdgyJZAXKGZPAdg,5091
921
921
  wagtail/admin/tests/pages/test_parent_page_chooser_view.py,sha256=W_cFg5qmbxdaXvR6hkhvPnbQmmnSWjmu3_I5HoIIHt4,6055
922
- wagtail/admin/tests/pages/test_preview.py,sha256=JX4PSNkUlFo8aj1KKa3-xlTGBZbaJ20QEip4WAAv3x4,41076
922
+ wagtail/admin/tests/pages/test_preview.py,sha256=MZ6VMMsLVFcoBtywzcEpLFjXUvWTgLrsQw6KJeaKR5M,43818
923
923
  wagtail/admin/tests/pages/test_reorder_page.py,sha256=X8bP25_uIr_9z3-ii2N1wdsY5VTO8LfQ7L1uXSGn644,9274
924
924
  wagtail/admin/tests/pages/test_revisions.py,sha256=mmMbazjzfCn644dujr-uGnsJ8UuHb2qM12RwlfyZiqQ,26340
925
925
  wagtail/admin/tests/pages/test_unpublish_page.py,sha256=Vu2zq74xcwYPQeMFI9zN2mXh27Iee13LSwnmiALTQgo,9682
@@ -984,7 +984,7 @@ wagtail/admin/views/generic/models.py,sha256=oCzeZp3EnAk9yiZ8ANWRsSDXTceYAFMaIaZ
984
984
  wagtail/admin/views/generic/multiple_upload.py,sha256=KiE9T9Uv_EuMr2_MbHzSWJ2W3uaw3djwAnUXgxsjJ38,13383
985
985
  wagtail/admin/views/generic/ordering.py,sha256=3SwaYNxpBQOXyhyP7G2LtSonFfngBbcB4FLZJcx8gV8,3464
986
986
  wagtail/admin/views/generic/permissions.py,sha256=LETkWYmN1DjGC8rNYXplkqSZj3TIHEdYf3iWFVZ2jbE,1788
987
- wagtail/admin/views/generic/preview.py,sha256=7-yMGBCeo7pBwsfFQ2i3OudvaX5suN421VQ85nm9ImA,7840
987
+ wagtail/admin/views/generic/preview.py,sha256=BIxEw-lccuNNO6ww_f_WbMWZbFNKXF9mNWGbS5Vz4LI,8101
988
988
  wagtail/admin/views/generic/usage.py,sha256=leJNFgfZ7tXugIFyuuQ-oMlBKmq0xlTCybH3WtozqnA,5085
989
989
  wagtail/admin/views/generic/workflow.py,sha256=wx5EukIJPNNGEGmWFHlP21_hUUNkwiefp6qVd6LZrvY,9947
990
990
  wagtail/admin/views/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -999,7 +999,7 @@ wagtail/admin/views/pages/listing.py,sha256=pGd0M_x6v0JCiTpl0F-QOfAvMw7XVLQAZjCs
999
999
  wagtail/admin/views/pages/lock.py,sha256=Z4FxvYyr0eDJj5kgoCJfk-WgwgXhip6_I2CabaG4J1c,1209
1000
1000
  wagtail/admin/views/pages/move.py,sha256=jsrvHR_rkHXZo3lQOk0SCW98R5H2gfO91v-f-kyoH1k,5941
1001
1001
  wagtail/admin/views/pages/ordering.py,sha256=GPJ4Nv8YN4lI2eM2ftCnoJpDhIus9o1mHmXZLocI-r4,1647
1002
- wagtail/admin/views/pages/preview.py,sha256=MNAqFjHEzq6r05aWV2wziz14Srnzq2LaVTe49mE8e0k,4191
1002
+ wagtail/admin/views/pages/preview.py,sha256=YbZX-VWBeHg9nTrSJBeLDuJVy_mTyvXYu-dms2LqKeM,4519
1003
1003
  wagtail/admin/views/pages/revisions.py,sha256=paEcUjkDDrGgGnQNhwgSM4uanGcLClxb7KlFlEunGEM,4651
1004
1004
  wagtail/admin/views/pages/search.py,sha256=_OUbbXQfKNB6Qq2n1T95CE5liyVJwLFfb018GUPDiRM,5098
1005
1005
  wagtail/admin/views/pages/unpublish.py,sha256=p_lYd6x8k35UlFIhrZzEjQ6m68qbiHAWyvZrgCg4EoY,3716
@@ -1575,7 +1575,7 @@ wagtail/contrib/settings/jinja2tags.py,sha256=-TNRxY9KxB0mpmndp02dGTTRs8XLmGXonH
1575
1575
  wagtail/contrib/settings/models.py,sha256=xNez5kfXd1B7xzLCWPYZtyIJfVM3KDvdgAq6OVw4WU0,6867
1576
1576
  wagtail/contrib/settings/registry.py,sha256=YfUQHUGZYZb-vdzJhYCPqB6ifDbd7OM6EC4vhqtZs-w,4735
1577
1577
  wagtail/contrib/settings/urls.py,sha256=c3es6uw4G2Mv6Auyp7IqByTqd6uI08wT9ubA3myNy9I,505
1578
- wagtail/contrib/settings/views.py,sha256=tYOw_v0_1skRnvQ1jqKyAIjdr0dLAzEK7vxunAL-0cc,7609
1578
+ wagtail/contrib/settings/views.py,sha256=dyYsBiUey33el_ymU__nA2-h8_3K2k2btolwtlglJxQ,7816
1579
1579
  wagtail/contrib/settings/wagtail_hooks.py,sha256=IJynK_Kv3tSTuvUqfN3AmmaogGvzgyKC9n9UUqrZsyc,243
1580
1580
  wagtail/contrib/settings/locale/af/LC_MESSAGES/django.mo,sha256=RUNArieX_RjkKIb2kwGF4KfTlYrfxMi-HTNkhuroQEk,478
1581
1581
  wagtail/contrib/settings/locale/ar/LC_MESSAGES/django.mo,sha256=C_Ql1k1JAEx97xv-oLHzDIG8iIFC7JzKgy-3A9WGjX4,1219
@@ -1709,7 +1709,7 @@ wagtail/contrib/settings/tests/generic/test_admin.py,sha256=eZuhr3VLRcCre1_46oMU
1709
1709
  wagtail/contrib/settings/tests/generic/test_model.py,sha256=OeU6OAt9PFibKFt6kHWTAWCuTr7jDcFyJQplwoGzo7M,5276
1710
1710
  wagtail/contrib/settings/tests/generic/test_templates.py,sha256=Pvm0ZwMBkCf1Z8EYiJ9Xyv_NEY4OScfDawFwU6oTUbc,7250
1711
1711
  wagtail/contrib/settings/tests/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1712
- wagtail/contrib/settings/tests/shared/test_preview.py,sha256=3HGiZqhpRAqqVaTTEJtMNfVfW1QROFj6B84G0QEPw1w,7707
1712
+ wagtail/contrib/settings/tests/shared/test_preview.py,sha256=nTU3JkKXK3oHou5AXjYg8-6FUMDmWGueorZPTHliWY4,8820
1713
1713
  wagtail/contrib/settings/tests/site_specific/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1714
1714
  wagtail/contrib/settings/tests/site_specific/base.py,sha256=F0AGRh-k87W5qaYtX_hOLX9fX_DQn8V1rA3vM5lG9_Q,1186
1715
1715
  wagtail/contrib/settings/tests/site_specific/test_admin.py,sha256=ut7SMzfZAN6GYChL-9TfSNGlu6Dxb-XTRT6NimuSNic,36347
@@ -3560,7 +3560,7 @@ wagtail/snippets/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
3560
3560
  wagtail/snippets/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3561
3561
  wagtail/snippets/tests/test_locking.py,sha256=QdaRVuX47tCbwoA62KYNJm9qxH33ekKs-nai5UeYDp4,25370
3562
3562
  wagtail/snippets/tests/test_management.py,sha256=GQw8HCZSJWny8giAUua_5-RstN7U_QGcsOkVuG72YHM,894
3563
- wagtail/snippets/tests/test_preview.py,sha256=Ntl2sYWA5H0EBSmA9TIgCTYQr9SmpX5hynxLW8Vvf5A,29980
3563
+ wagtail/snippets/tests/test_preview.py,sha256=ni_wHAAK6wKhys9yliNT67RGRTTlT2cVpLDJBhS0V40,32158
3564
3564
  wagtail/snippets/tests/test_reordering.py,sha256=9LOsxVhsKcTlbNDL-hVtzHDZtrzdYp6y6ed369UtyO8,13877
3565
3565
  wagtail/snippets/tests/test_snippets.py,sha256=jqW9BTZDjzrJPP5zQ4yzE5eyaCG4L--sLpwYcjLq8qI,241340
3566
3566
  wagtail/snippets/tests/test_usage.py,sha256=3Re4NCdt0M4WfzvUruJmpYEV0FsZ7lWkyAw7ZLyc6Lw,8642
@@ -4060,9 +4060,9 @@ wagtail/utils/timestamps.py,sha256=wqaIvdtZLUENAYiCP9jN8QPPeud305BlPNJiyTNvxkM,1
4060
4060
  wagtail/utils/urlpatterns.py,sha256=RDhVScxdm-RV4HSMjWElyrbEoTPsXu841_SKMgoFKtY,629
4061
4061
  wagtail/utils/utils.py,sha256=nQhfy-fOiZfUFr67kTX4nF_2VVH7_MDtjTDOzZdpPTE,1407
4062
4062
  wagtail/utils/version.py,sha256=jYCDKIGJD3bZHTpgXMXu14oSBArQnf2WVU979D8V4b0,1552
4063
- wagtail-7.2.1.dist-info/licenses/LICENSE,sha256=0aiL7_RJ2YkOjscmRI7opwmuURrY6h8MR0B24nrdRQU,1512
4064
- wagtail-7.2.1.dist-info/METADATA,sha256=eAt0QwdnWu2KW3XuRgRxtREX0fLbu3UUN61yE3F7zyw,12460
4065
- wagtail-7.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4066
- wagtail-7.2.1.dist-info/entry_points.txt,sha256=R14Z0xKoufNcDaku0EWDKM-K8J4ap0EImO8C-df8HVM,53
4067
- wagtail-7.2.1.dist-info/top_level.txt,sha256=zcKgvuRTi0gSgVzJ1qMoERCwhQ_i0n9bkyxza3oh9as,8
4068
- wagtail-7.2.1.dist-info/RECORD,,
4063
+ wagtail-7.2.2.dist-info/licenses/LICENSE,sha256=0aiL7_RJ2YkOjscmRI7opwmuURrY6h8MR0B24nrdRQU,1512
4064
+ wagtail-7.2.2.dist-info/METADATA,sha256=nlXn0kwy7r6t4Y8kLKXO8mH4GKiw9T-Egb4azHClFBo,12460
4065
+ wagtail-7.2.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
4066
+ wagtail-7.2.2.dist-info/entry_points.txt,sha256=R14Z0xKoufNcDaku0EWDKM-K8J4ap0EImO8C-df8HVM,53
4067
+ wagtail-7.2.2.dist-info/top_level.txt,sha256=zcKgvuRTi0gSgVzJ1qMoERCwhQ_i0n9bkyxza3oh9as,8
4068
+ wagtail-7.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5