diff --git a/passbook/core/forms/applications.py b/passbook/core/forms/applications.py index 1e78f88ed..f2cc801de 100644 --- a/passbook/core/forms/applications.py +++ b/passbook/core/forms/applications.py @@ -31,6 +31,7 @@ class ApplicationForm(forms.ModelForm): "name": forms.TextInput(), "meta_launch_url": forms.TextInput(), "meta_publisher": forms.TextInput(), + "meta_icon": forms.FileInput(), } help_texts = { "meta_launch_url": _( diff --git a/passbook/core/templates/partials/form_horizontal.html b/passbook/core/templates/partials/form_horizontal.html index d2a88fb63..4bc2bff41 100644 --- a/passbook/core/templates/partials/form_horizontal.html +++ b/passbook/core/templates/partials/form_horizontal.html @@ -57,7 +57,7 @@ {% endif %} - {% elif field.field.widget|fieldtype == "ClearableFileInput" %} + {% elif field.field.widget|fieldtype == "FileInput" %}
{{ field.help_text|safe }}
+ {% endif %} + {% if field.value %} + + {% blocktrans with current=field.value %} + Currently set to {{current}}. + {% endblocktrans %} + + {% endif %}e.length-1?null:this.getPixelForValue(e[n])}}),Fo=So;Wo._defaults=Fo;var Do=ln.valueOrDefault,Oo=ln.math.log10;function Eo(n,e){var t,o,a=[],r=Do(n.min,Math.pow(10,Math.floor(Oo(e.min)))),i=Math.floor(Oo(e.max)),l=Math.ceil(e.max/Math.pow(10,i));0===r?(t=Math.floor(Oo(e.minNotZero)),o=Math.floor(e.minNotZero/Math.pow(10,t)),a.push(r),r=o*Math.pow(10,t)):(t=Math.floor(Oo(r)),o=Math.floor(r/Math.pow(10,t)));var f=t<0?Math.pow(10,Math.abs(t)):1;do{a.push(r),10==++o&&(o=1,f=++t>=0?1:f),r=Math.round(o*Math.pow(10,t)*f)/f}while(t=0?n:e}var Ho=ho.extend({determineDataLimits:function(){var n,e,t,o,a,r,i=this,l=i.options,f=i.chart,c=f.data.datasets,p=i.isHorizontal();function d(n){return p?n.xAxisID===i.id:n.yAxisID===i.id}i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY,i.minNotZero=Number.POSITIVE_INFINITY;var s=l.stacked;if(void 0===s)for(n=0;n -1&&(o[e]=a.slice(0,r).concat(a.slice(r+1)))}}}function hn(n,e){var t=un(n,e);if(t.length)for(var o=Array.prototype.slice.call(arguments,2),a=0;a \n ${n.message}\n e.length-1?null:this.getPixelForValue(e[n])}}),Fo=So;Wo._defaults=Fo;var Do=ln.valueOrDefault,Oo=ln.math.log10;function Eo(n,e){var t,o,a=[],r=Do(n.min,Math.pow(10,Math.floor(Oo(e.min)))),i=Math.floor(Oo(e.max)),l=Math.ceil(e.max/Math.pow(10,i));0===r?(t=Math.floor(Oo(e.minNotZero)),o=Math.floor(e.minNotZero/Math.pow(10,t)),a.push(r),r=o*Math.pow(10,t)):(t=Math.floor(Oo(r)),o=Math.floor(r/Math.pow(10,t)));var f=t<0?Math.pow(10,Math.abs(t)):1;do{a.push(r),10==++o&&(o=1,f=++t>=0?1:f),r=Math.round(o*Math.pow(10,t)*f)/f}while(t=0?n:e}var Ho=ho.extend({determineDataLimits:function(){var n,e,t,o,a,r,i=this,l=i.options,f=i.chart,c=f.data.datasets,p=i.isHorizontal();function d(n){return p?n.xAxisID===i.id:n.yAxisID===i.id}i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY,i.minNotZero=Number.POSITIVE_INFINITY;var s=l.stacked;if(void 0===s)for(n=0;nm+s-3&&(i.scrollLeft=e.right+(g?0:10)-m),i}function la(n,e){null!=e&&(da(n),n.curOp.scrollTop=(null==n.curOp.scrollTop?n.doc.scrollTop:n.curOp.scrollTop)+e)}function fa(n){da(n);var e=n.getCursor();n.curOp.scrollToPos={from:e,to:e,margin:n.options.cursorScrollMargin}}function ca(n,e,t){null==e&&null==t||da(n),null!=e&&(n.curOp.scrollLeft=e),null!=t&&(n.curOp.scrollTop=t)}function pa(n,e){da(n),n.curOp.scrollToPos=e}function da(n){var e=n.curOp.scrollToPos;e&&(n.curOp.scrollToPos=null,sa(n,wo(n,e.from),wo(n,e.to),e.margin))}function sa(n,e,t,o){var a=ia(n,{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top)-o,right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)+o});ca(n,a.scrollLeft,a.scrollTop)}function ma(n,e){Math.abs(n.doc.scrollTop-e)<2||(t||Ya(n,{top:e}),ga(n,e,!0),t&&Ya(n),Oa(n,100))}function ga(n,e,t){e=Math.max(0,Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,e)),(n.display.scroller.scrollTop!=e||t)&&(n.doc.scrollTop=e,n.display.scrollbars.setScrollTop(e),n.display.scroller.scrollTop!=e&&(n.display.scroller.scrollTop=e))}function ba(n,e,t,o){e=Math.max(0,Math.min(e,n.display.scroller.scrollWidth-n.display.scroller.clientWidth)),(t?e==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-e)<2)&&!o||(n.doc.scrollLeft=e,Xa(n),n.display.scroller.scrollLeft!=e&&(n.display.scroller.scrollLeft=e),n.display.scrollbars.setScrollLeft(e))}function ua(n){var e=n.display,t=e.gutters.offsetWidth,o=Math.round(n.doc.height+Vt(n.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:n.options.fixedGutter?t:0,docHeight:o,scrollHeight:o+Xt(n)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:t}}var _a=function(n,e,t){this.cm=t;var o=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=a.tabIndex=-1,n(o),n(a),bn(o,"scroll",(function(){o.clientHeight&&e(o.scrollTop,"vertical")})),bn(a,"scroll",(function(){a.clientWidth&&e(a.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,i&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_a.prototype.update=function(n){var e=n.scrollWidth>n.clientWidth+1,t=n.scrollHeight>n.clientHeight+1,o=n.nativeBarWidth;if(t){this.vert.style.display="block",this.vert.style.bottom=e?o+"px":"0";var a=n.viewHeight-(e?o:0);this.vert.firstChild.style.height=Math.max(0,n.scrollHeight-n.clientHeight+a)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=t?o+"px":"0",this.horiz.style.left=n.barLeft+"px";var r=n.viewWidth-n.barLeft-(t?o:0);this.horiz.firstChild.style.width=Math.max(0,n.scrollWidth-n.clientWidth+r)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&n.clientHeight>0&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:t?o:0,bottom:e?o:0}},_a.prototype.setScrollLeft=function(n){this.horiz.scrollLeft!=n&&(this.horiz.scrollLeft=n),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_a.prototype.setScrollTop=function(n){this.vert.scrollTop!=n&&(this.vert.scrollTop=n),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_a.prototype.zeroWidthHack=function(){var n=h&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=n,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new A,this.disableVert=new A},_a.prototype.enableZeroWidthBar=function(n,e,t){function o(){var a=n.getBoundingClientRect();("vert"==t?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1))!=n?n.style.pointerEvents="none":e.set(1e3,o)}n.style.pointerEvents="auto",e.set(1e3,o)},_a.prototype.clear=function(){var n=this.horiz.parentNode;n.removeChild(this.horiz),n.removeChild(this.vert)};var ha=function(){};function va(n,e){e||(e=ua(n));var t=n.display.barWidth,o=n.display.barHeight;xa(n,e);for(var a=0;a<4&&t!=n.display.barWidth||o!=n.display.barHeight;a++)t!=n.display.barWidth&&n.options.lineWrapping&&na(n),xa(n,ua(n)),t=n.display.barWidth,o=n.display.barHeight}function xa(n,e){var t=n.display,o=t.scrollbars.update(e);t.sizer.style.paddingRight=(t.barWidth=o.right)+"px",t.sizer.style.paddingBottom=(t.barHeight=o.bottom)+"px",t.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=o.bottom+"px",t.scrollbarFiller.style.width=o.right+"px"):t.scrollbarFiller.style.display="",o.bottom&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(t.gutterFiller.style.display="block",t.gutterFiller.style.height=o.bottom+"px",t.gutterFiller.style.width=e.gutterWidth+"px"):t.gutterFiller.style.display=""}ha.prototype.update=function(){return{bottom:0,right:0}},ha.prototype.setScrollLeft=function(){},ha.prototype.setScrollTop=function(){},ha.prototype.clear=function(){};var wa={native:_a,null:ha};function ya(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&P(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new wa[n.options.scrollbarStyle]((function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),bn(e,"mousedown",(function(){n.state.focused&&setTimeout((function(){return n.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,t){"horizontal"==t?ba(n,e):ma(n,e)}),n),n.display.scrollbars.addClass&&W(n.display.wrapper,n.display.scrollbars.addClass)}var ka=0;function Ca(n){n.curOp={cm:n,viewChanged:!1,startHeight:n.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ka},Bt(n.curOp)}function Ba(n){var e=n.curOp;e&&St(e,(function(n){for(var e=0;e`}};o([tn()],Pn.prototype,"url",void 0),Pn=o([nn("pb-messages")],Pn);const Sn=new CSSStyleSheet;Sn.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const Tn=new CSSStyleSheet;Tn.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const Mn=new CSSStyleSheet;Mn.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");const Ln=new CSSStyleSheet;Ln.replaceSync('/*!\n * Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n */\n@font-face {\n font-family: \'Font Awesome 5 Free\';\n font-style: normal;\n font-weight: 900;\n font-display: block;\n src: url("../webfonts/fa-solid-900.eot");\n src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); }\n\n.fa,\n.fas {\n font-family: \'Font Awesome 5 Free\';\n font-weight: 900; }\n');let zn=class extends cn{constructor(){super(),this.open=!1,window.addEventListener("keyup",(n=>{"Escape"===n.code&&(this.open=!1)}))}static get styles(){return[ln`:host{text-align:left}::slotted(*){overflow-y:auto}`,Sn,Tn,Mn,sn,Ln]}updateHandlers(){this.querySelectorAll("[slot=modal] a").forEach((n=>{n.addEventListener("click",(n=>{n.preventDefault(),this.open=!1}))})),this.querySelectorAll("input[name=name]").forEach((n=>{n.addEventListener("input",(e=>{const t=n.closest("form");if(null===t)return;const o=t.querySelector("input[name=slug]");o&&(o.value=n.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,""))}))})),this.querySelectorAll("[slot=modal] form").forEach((n=>{n.addEventListener("submit",(e=>{e.preventDefault();let t=new FormData(n);fetch(this.href?this.href:n.action,{method:n.method,body:t,redirect:"manual"}).then((n=>n.text())).then((n=>{-1!==n.indexOf("csrfmiddlewaretoken")?(this.querySelector("[slot=modal]").innerHTML=n,console.debug("passbook/modalbutton: re-showing form"),this.updateHandlers()):(this.open=!1,console.debug("passbook/modalbutton: successful submit"),this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})))})).catch((n=>{console.error(n)}))}))}))}onClick(n){if(this.href){const n=new Request(this.href);fetch(n,{mode:"same-origin"}).then((n=>n.text())).then((n=>{this.querySelector("[slot=modal]").innerHTML=n,this.updateHandlers(),this.open=!0,this.querySelectorAll("pb-spinner-button").forEach((n=>{n.setDone("pf-m-primary")}))})).catch((n=>{console.error(n)}))}else this.updateHandlers(),this.open=!0}renderModal(){return G`
no tabs defined
`;this.currentPage=n[0].attributes.getNamedItem("slot")?.value}return G`${n.map((n=>{const e=n.attributes.getNamedItem("slot")?.value;return G``}))}
t.length){for(i=0;i