1"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[9896],{9896(e,t,n){n.d(t,{default:()=>_});var s=n(2891),i=class{constructor(e,t,n){this.isResolved=!1,this.promise=e,this.promise.then(e=>(this.isResolved=!0,e)),this.actions=t,this.updatedModels=n}containsOneOfActions(e){return this.actions.filter(t=>e.includes(t)).length>0}areAnyModelsUpdated(e){return this.updatedModels.filter(t=>e.includes(t)).length>0}},r=class{constructor(e,t="post",n="same-origin"){this.url=e,this.method=t,this.credentials=n}buildRequest(e,t,n,s,i,r){const o=this.url.split("?");let[a]=o;const[,l]=o,d=new URLSearchParams(l||""),c={};c.credentials=this.credentials,c.headers={Accept:"application/vnd.live-component+html","X-Requested-With":"XMLHttpRequest","X-Live-Url":window.location.pathname+window.location.search};const h=Object.entries(r).reduce((e,t)=>e+t.length,0),u=Object.keys(s).length>0;if(0===t.length&&0===h&&"get"===this.method&&this.willDataFitInUrl(JSON.stringify(e),JSON.stringify(n),d,JSON.stringify(s),JSON.stringify(i)))d.set("props",JSON.stringify(e)),d.set("updated",JSON.stringify(n)),Object.keys(i).length>0&&d.set("propsFromParent",JSON.stringify(i)),u&&d.set("children",JSON.stringify(s)),c.method="GET";else{c.method="POST";const o={props:e,updated:n};Object.keys(i).length>0&&(o.propsFromParent=i),u&&(o.children=s),t.length>0&&(1===t.length?(o.args=t[0].args,a+=`/${encodeURIComponent(t[0].name)}`):(a+="/_batch",o.actions=t));const l=new FormData;l.append("data",JSON.stringify(o));for(const[e,t]of Object.entries(r)){const n=t.length;for(let s=0;s<n;++s)l.append(e,t[s])}c.body=l}const m=d.toString();return{url:`${a}${m.length>0?`?${m}`:""}`,fetchOptions:c}}willDataFitInUrl(e,t,n,s,i){return(new URLSearchParams(e+t+s+i).toString()+n.toString()).length<1500}},o=class{constructor(e,t="post",n="same-origin"){this.requestBuilder=new r(e,t,n)}makeRequest(e,t,n,s,r,o){const{url:a,fetchOptions:l}=this.requestBuilder.buildRequest(e,t,n,s,r,o);return new i(fetch(a,l),t.map(e=>e.name),Object.keys(n))}},a=class{constructor(e){this.response=e}async getBody(){return this.body||(this.body=await this.response.text()),this.body}getLiveUrl(){return void 0===this.liveUrl&&(this.liveUrl=this.response.headers.get("X-Live-Url")),this.liveUrl}};function l(e){return e.innerHTML?e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML)):e.outerHTML}let d=new WeakMap,c=new Map;function h(e){const t=[];if(!e)return t;let n="",s="",i=[],r=[],o="action";const a=()=>{if(n)return n;if(0===t.length)throw new Error("Could not find any directives");return t[t.length-1].action},l=()=>{t.push({action:n,args:i,modifiers:r,getString:()=>e}),n="",s="",i=[],r=[],o="action"},d=()=>{i.push(s.trim()),s=""},c=()=>{if(i.length>1)throw new Error(`The modifier "${n}()" does not support multiple arguments.`);r.push({name:n,value:i.length>0?i[0]:null}),n="",i=[],o="action"};for(let t=0;t<e.length;t++){const i=e[t];switch(o){case"action":if("("===i){o="arguments";break}if(" "===i){n&&l();break}if("|"===i){c();break}n+=i;break;case"arguments":if(")"===i){d(),o="after_arguments";break}if(","===i){d();break}s+=i;break;case"after_arguments":if("|"===i){c();break}if(" "!==i)throw new Error(`Missing space after ${a()}()`);l()}}switch(o){case"action":case"after_arguments":n&&l();break;default:throw new Error(`Did you forget to add a closing ")" after "${n}"?`)}return t}function u(e){const t=[];return e.forEach(e=>{var n;t.push(...(n=e,n.replace(/[\s]+/g," ").trim()).split(" "))}),t}function m(e){return e.replace(/\[]$/,"").split("[").map(e=>e.replace("]","")).join(".")}function p(e,t){if(e instanceof HTMLInputElement){if("checkbox"===e.type){const n=v(e,!1);if(null!==n){const s=t.get(n.action);if(Array.isArray(s))return y(e,s);if(Object(s)===s)return y(e,Object.values(s))}return e.hasAttribute("value")?e.checked?e.getAttribute("value"):null:e.checked}return w(e)}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value:e.hasAttribute("data-value")?e.dataset.value:"value"in e?e.value:e.hasAttribute("value")?e.getAttribute("value"):null}function f(e,t){if(e instanceof HTMLInputElement){if("file"===e.type)return;if("radio"===e.type)return void(e.checked=e.value==t);if("checkbox"===e.type)return void(Array.isArray(t)?e.checked=t.some(t=>t==e.value):e.hasAttribute("value")?e.checked=e.value==t:e.checked=t)}if(e instanceof HTMLSelectElement){const n=[].concat(t).map(e=>`${e}`);
1return void Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}t=void 0===t?"":t,e.value=t}function g(e){if(!e.dataset.model)return[];const t=h(e.dataset.model);return t.forEach(t=>{if(t.args.length>0)throw new Error(`The data-model="${e.dataset.model}" format is invalid: it does not support passing arguments to the model.`);t.action=m(t.action)}),t}function v(e,t=!0){const n=g(e);if(n.length>0)return n[0];if(e.getAttribute("name")){const t=e.closest("form");if(t&&"model"in t.dataset){const n=h(t.dataset.model||"*")[0];if(n.args.length>0)throw new Error(`The data-model="${t.dataset.model}" format is invalid: it does not support passing arguments to the model.`);return n.action=m(e.getAttribute("name")),n}}if(!t)return null;throw new Error(`Cannot determine the model name for "${l(e)}": the element must either have a "data-model" (or "name" attribute living inside a <form data-model="*">).`)}function b(e,t){return t.element===e||!!t.element.contains(e)&&e.closest('[data-controller~="live"]')===t.element}function E(e){const t=e.cloneNode(!0);if(!(t instanceof HTMLElement))throw new Error("Could not clone element");return t}const y=(e,t)=>{const n=[...t],s=w(e),i=t.indexOf(s);return e.checked?(-1===i&&n.push(s),n):(i>-1&&n.splice(i,1),n)},w=e=>e.dataset.value?e.dataset.value:e.value;var k=class{constructor(){this.hooks=new Map}register(e,t){const n=this.hooks.get(e)||[];n.push(t),this.hooks.set(e,n)}unregister(e,t){const n=this.hooks.get(e)||[],s=n.indexOf(t);-1!==s&&(n.splice(s,1),this.hooks.set(e,n))}triggerHook(e,...t){(this.hooks.get(e)||[]).forEach(e=>{e(...t)})}},M=function(){let e=new Set,t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:c,afterNodeAdded:c,beforeNodeMorphed:c,afterNodeMorphed:c,beforeNodeRemoved:c,afterNodeRemoved:c,beforeAttributeUpdated:c},head:{style:"merge",shouldPreserve:function(e){return"true"===e.getAttribute("im-preserve")},shouldReAppend:function(e){return"true"===e.getAttribute("im-re-append")},shouldRemove:c,afterHeadMorphed:c}};function n(e,t,s){if(s.head.block){let i=e.querySelector("head"),r=t.querySelector("head");if(i&&r){let o=l(r,i,s);return void Promise.all(o).then(function(){n(e,t,Object.assign(s,{head:{block:!1,ignore:!0}}))})}}if("innerHTML"===s.morphStyle)return r(t,e,s),e.children;if("outerHTML"===s.morphStyle||null==s.morphStyle){let n=function(e,t,n){let s;s=e.firstChild;let i=s,r=0;for(;s;){let e=g(s,t,n);e>r&&(i=s,r=e),s=s.nextSibling}return i}(t,e,s),r=n?.previousSibling,o=n?.nextSibling,a=i(e,n,s);return n?function(e,t,n){let s=[],i=[];for(;null!=e;)s.push(e),e=e.previousSibling;for(;s.length>0;){let e=s.pop();i.push(e),t.parentElement.insertBefore(e,t)}i.push(t);for(;null!=n;)s.push(n),i.push(n),n=n.nextSibling;for(;s.length>0;)t.parentElement.insertBefore(s.pop(),t.nextSibling);return i}(r,a,o):[]}throw"Do not understand how to morph style "+s.morphStyle}function s(e,t){return t.ignoreActiveValue&&e===document.activeElement}function i(e,t,n){if(!n.ignoreActive||e!==document.activeElement)return null==t?!1===n.callbacks.beforeNodeRemoved(e)?e:(e.remove(),n.callbacks.afterNodeRemoved(e),null):u(e,t)?(!1===n.callbacks.beforeNodeMorphed(e,t)||(e instanceof HTMLHeadElement&&n.head.ignore||(e instanceof HTMLHeadElement&&"morph"!==n.head.style?l(t,e,n):(!function(e,t,n){let i=e.nodeType;if(1===i){const s=e.attributes,i=t.attributes;for(const e of s)o(e.name,t,"update",n)||t.getAttribute(e.name)!==e.value&&t.setAttribute(e.name,e.value);for(let s=i.length-1;0<=s;s--){const r=i[s];o(r.name,t,"remove",n)||(e.hasAttribute(r.name)||t.removeAttribute(r.name))}}8!==i&&3!==i||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue);s(t,n)||function(e,t,n){if(e instanceof HTMLInputElement&&t instanceof HTMLInputElement&&"file"!==e.type){let s=e.value,i=t.value;a(e,t,"checked",n),a(e,t,"disabled",n),e.hasAttribute("value")?s!==i&&(o("value",t,"update",n)||(t.setAttribute("value",s),t.value=s)):o("value",t,"remove",n)||(t.value="",t.removeAttribute("value"))}else if(e instanceof HTMLOptionElement)a(e,t,"selected",n);else if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){let s=e.value,i=t.value;if(o("value",t,"update",n))return;s!==i&&(t.value=s),t.firstChild&&t.firstChild.nodeValue!==s&&(t.firstChild.nodeValue=s)}}
1(e,t,n)}(t,e,n),s(e,n)||r(t,e,n))),n.callbacks.afterNodeMorphed(e,t)),e):!1===n.callbacks.beforeNodeRemoved(e)||!1===n.callbacks.beforeNodeAdded(t)?e:(e.parentElement.replaceChild(t,e),n.callbacks.afterNodeAdded(t),n.callbacks.afterNodeRemoved(e),t)}function r(e,t,n){let s,r=e.firstChild,o=t.firstChild;for(;r;){if(s=r,r=s.nextSibling,null==o){if(!1===n.callbacks.beforeNodeAdded(s))return;t.appendChild(s),n.callbacks.afterNodeAdded(s),y(n,s);continue}if(h(s,o,n)){i(o,s,n),o=o.nextSibling,y(n,s);continue}let a=p(e,t,s,o,n);if(a){o=m(o,a,n),i(a,s,n),y(n,s);continue}let l=f(e,t,s,o,n);if(l)o=m(o,l,n),i(l,s,n),y(n,s);else{if(!1===n.callbacks.beforeNodeAdded(s))return;t.insertBefore(s,o),n.callbacks.afterNodeAdded(s),y(n,s)}}for(;null!==o;){let e=o;o=o.nextSibling,v(e,n)}}function o(e,t,n,s){return!("value"!==e||!s.ignoreActiveValue||t!==document.activeElement)||!1===s.callbacks.beforeAttributeUpdated(e,t,n)}function a(e,t,n,s){if(e[n]!==t[n]){let i=o(n,t,"update",s);i||(t[n]=e[n]),e[n]?i||t.setAttribute(n,e[n]):o(n,t,"remove",s)||t.removeAttribute(n)}}function l(e,t,n){let s=[],i=[],r=[],o=[],a=n.head.style,l=new Map;for(const t of e.children)l.set(t.outerHTML,t);for(const e of t.children){let t=l.has(e.outerHTML),s=n.head.shouldReAppend(e),d=n.head.shouldPreserve(e);t||d?s?i.push(e):(l.delete(e.outerHTML),r.push(e)):"append"===a?s&&(i.push(e),o.push(e)):!1!==n.head.shouldRemove(e)&&i.push(e)}o.push(...l.values());let c=[];for(const e of o){d();let i=document.createRange().createContextualFragment(e.outerHTML).firstChild;if(d(),!1!==n.callbacks.beforeNodeAdded(i)){if(i.href||i.src){let e=null,t=new Promise(function(t){e=t});i.addEventListener("load",function(){e()}),c.push(t)}t.appendChild(i),n.callbacks.afterNodeAdded(i),s.push(i)}}for(const e of i)!1!==n.callbacks.beforeNodeRemoved(e)&&(t.removeChild(e),n.callbacks.afterNodeRemoved(e));return n.head.afterHeadMorphed(t,{added:s,kept:r,removed:i}),c}function d(){}function c(){}function h(e,t,n){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||w(n,e,t)>0))}function u(e,t){return null!=e&&null!=t&&(e.nodeType===t.nodeType&&e.tagName===t.tagName)}function m(e,t,n){for(;e!==t;){let t=e;e=e.nextSibling,v(t,n)}return y(n,t),t.nextSibling}function p(e,t,n,s,i){let r=w(i,n,t);if(r>0){let t=s,o=0;for(;null!=t;){if(h(n,t,i))return t;if(o+=w(i,t,e),o>r)return null;t=t.nextSibling}}return null}function f(e,t,n,s,i){let r=s,o=n.nextSibling,a=0;for(;null!=r;){if(w(i,r,e)>0)return null;if(u(n,r))return r;if(u(o,r)&&(a++,o=o.nextSibling,a>=2))return null;r=r.nextSibling}return r}function g(e,t,n){return u(e,t)?.5+w(n,e,t):0}function v(e,t){y(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function b(e,t){return!e.deadIds.has(t)}function E(t,n,s){return(t.idMap.get(s)||e).has(n)}function y(t,n){let s=t.idMap.get(n)||e;for(const e of s)t.deadIds.add(e)}function w(t,n,s){let i=t.idMap.get(n)||e,r=0;for(const e of i)b(t,e)&&E(t,e,s)&&++r;return r}function k(e,t){let n=e.parentElement,s=e.querySelectorAll("[id]");for(const e of s){let s=e;for(;s!==n&&null!=s;){let n=t.get(s);null==n&&(n=new Set,t.set(s,n)),n.add(e.id),s=s.parentElement}}}function M(e,t){let n=new Map;return k(e,n),k(t,n),n}return{morph:function(e,s,i={}){e instanceof Document&&(e=e.documentElement),"string"==typeof s&&(s=function(e){let t=new DOMParser,n=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(n.match(/<\/html>/)||n.match(/<\/head>/)||n.match(/<\/body>/)){let s=t.parseFromString(e,"text/html");if(n.match(/<\/html>/))return s.generatedByIdiomorph=!0,s;{let e=s.firstChild;return e?(e.generatedByIdiomorph=!0,e):null}}{let n=t.parseFromString("<body><template>"+e+"</template></body>","text/html").body.querySelector("template").content;return n.generatedByIdiomorph=!0,n}}(s));let r=function(e){if(null==e)return document.createElement("div");if(e.generatedByIdiomorph)return e;if(e instanceof Node){const t=document.createElement("div");return t.append(e),t}{const t=document.createElement("div");for(const n of[...e])t.append(n);return t}}(s),o=function(e,n,s){return s=function(e){let n={};return Object.assign(n,t),Object.assign(n,e),n.callbacks={},Object.assign(n.callbacks,t.callbacks),Object.assign(n.callbacks,e.callbacks),n.head={},Object.assign(n.head,t.head),Object.assign(n.head,e.head),n}(s),{target:e,newContent:n,config:s,morphStyle:s.morphStyle,ignoreActive:s.ignoreActive,ignoreActiveValue:s.ignoreActiveValue,idMap:M(e,n),deadIds:new Set,callbacks:s.callbacks,head:s.head}}(e,r,i);return n(e,r,o)},defaults:t}}();function A(e){e instanceof HTMLInputElement&&"file"===e.type||("value"in e?e.setAttribute("value",e.value):e.hasAttribute("value")&&e.setAttribute("value","")),Array.from(e.children).forEac
1h(e=>{A(e)})}var T=class{constructor(){this.changedItems=new Map,this.removedItems=new Map}setItem(e,t,n){if(this.removedItems.has(e)){const n=this.removedItems.get(e);if(this.removedItems.delete(e),n.original===t)return}if(this.changedItems.has(e)){const n=this.changedItems.get(e);return n.original===t?void this.changedItems.delete(e):void this.changedItems.set(e,{original:n.original,new:t})}this.changedItems.set(e,{original:n,new:t})}removeItem(e,t){let n=t;this.changedItems.has(e)&&(n=this.changedItems.get(e).original,this.changedItems.delete(e),null===n)||this.removedItems.has(e)||this.removedItems.set(e,{original:n})}getChangedItems(){return Array.from(this.changedItems,([e,{new:t}])=>({name:e,value:t}))}getRemovedItems(){return Array.from(this.removedItems.keys())}isEmpty(){return 0===this.changedItems.size&&0===this.removedItems.size}},C=class{constructor(){this.addedClasses=new Set,this.removedClasses=new Set,this.styleChanges=new T,this.attributeChanges=new T}addClass(e){this.removedClasses.delete(e)||this.addedClasses.add(e)}removeClass(e){this.addedClasses.delete(e)||this.removedClasses.add(e)}addStyle(e,t,n){this.styleChanges.setItem(e,t,n)}removeStyle(e,t){this.styleChanges.removeItem(e,t)}addAttribute(e,t,n){this.attributeChanges.setItem(e,t,n)}removeAttribute(e,t){this.attributeChanges.removeItem(e,t)}getAddedClasses(){return[...this.addedClasses]}getRemovedClasses(){return[...this.removedClasses]}getChangedStyles(){return this.styleChanges.getChangedItems()}getRemovedStyles(){return this.styleChanges.getRemovedItems()}getChangedAttributes(){return this.attributeChanges.getChangedItems()}getRemovedAttributes(){return this.attributeChanges.getRemovedItems()}applyToElement(e){e.classList.add(...this.addedClasses),e.classList.remove(...this.removedClasses),this.styleChanges.getChangedItems().forEac
1h(t=>{/!\s*important/i.test(t.value)?e.style.setProperty(t.name,t.value.replace(/!\s*important/i,"").trim(),"important"):e.style.setProperty(t.name,t.value)}),this.styleChanges.getRemovedItems().forEach(t=>{e.style.removeProperty(t)}),this.attributeChanges.getChangedItems().forEach(t=>{e.setAttribute(t.name,t.value)}),this.attributeChanges.getRemovedItems().forEach(t=>{e.removeAttribute(t)})}isEmpty(){return 0===this.addedClasses.size&&0===this.removedClasses.size&&this.styleChanges.isEmpty()&&this.attributeChanges.isEmpty()}},S=class{constructor(e,t){this.changedElements=new WeakMap,this.changedElementsCount=0,this.addedElements=[],this.removedElements=[],this.isStarted=!1,this.element=e,this.shouldTrackChangeCallback=t,this.mutationObserver=new MutationObserver(this.onMutations.bind(this))}start(){this.isStarted||(this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0}),this.isStarted=!0)}stop(){this.isStarted&&(this.mutationObserver.disconnect(),this.isStarted=!1)}getChangedElement(e){return this.changedElements.has(e)?this.changedElements.get(e):null}getAddedElements(){return this.addedElements}wasElementAdded(e){return this.addedElements.includes(e)}handlePendingChanges(){this.onMutations(this.mutationObserver.takeRecords())}onMutations(e){const t=new WeakMap;for(const n of e){const e=n.target;if(!this.shouldTrackChangeCallback(e))continue;if(this.isElementAddedByTranslation(e))continue;let s=!1;for(const t of this.addedElements)if(t.contains(e)){s=!0;break}if(!s)switch(n.type){case"childList":this.handleChildListMutation(n);break;case"attributes":t.has(e)||t.set(e,[]),t.get(e).includes(n.attributeName)||(this.handleAttributeMutation(n),t.set(e,[...t.get(e),n.attributeName]))}}}handleChildListMutation(e){e.addedNodes.forEach(e=>{e instanceof Element&&(this.removedElements.includes(e)?this.removedElements.splice(this.removedElements.indexOf(e),1):this.isElementAddedByTranslation(e)||this.addedElements.push(e))}),e.removedNodes.forEach(e=>{e instanceof Element&&(this.addedElements.includes(e)?this.addedElements.splice(this.addedElements.indexOf(e),1):this.removedElements.push(e))})}handleAttributeMutation(e){const t=e.target;this.changedElements.has(t)||(this.changedElements.set(t,new C),this.changedElementsCount++);const n=this.changedElements.get(t);switch(e.attributeName){case"class":this.handleClassAttributeMutation(e,n);break;case"style":this.handleStyleAttributeMutation(e,n);break;default:this.handleGenericAttributeMutation(e,n)}n.isEmpty()&&(this.changedElements.delete(t),this.changedElementsCount--)}handleClassAttributeMutation(e,t){const n=e.target,s=(e.oldValue||"").match(/(\S+)/gu)||[],i=[].slice.call(n.classList),r=i.filter(e=>!s.includes(e)),o=s.filter(e=>!i.includes(e));r.forEach(e=>{t.addClass(e)}),o.forEach(e=>{t.removeClass(e)})}handleStyleAttributeMutation(e,t){const n=e.target,s=e.oldValue||"",i=this.extractStyles(s),r=n.getAttribute("style")||"",o=this.extractStyles(r),a=Object.keys(o).filter(e=>void 0===i[e]||i[e]!==o[e]),l=Object.keys(i).filter(e=>!o[e]);a.forEach(e=>{t.addStyle(e,o[e],void 0===i[e]?null:i[e])}),l.forEach(e=>{t.removeStyle(e,i[e])})}handleGenericAttributeMutation(e,t){const n=e.attributeName,s=e.target;let i=e.oldValue,r=s.getAttribute(n);if(i===n&&(i=""),r===n&&(r=""),s.hasAttribute(n))r!==i&&t.addAttribute(n,s.getAttribute(n),e.oldValue);else{if(null===i)return;t.removeAttribute(n,e.oldValue)}}extractStyles(e){const t={};return e.split(";").forEach(e=>{const n=e.split(":");if(1===n.length)return;const s=n[0].trim();t[s]=n.slice(1).join(":").trim()}),t}isElementAddedByTranslation(e){return"FONT"===e.tagName&&"vertical-align: inherit;"===e.getAttribute("style")}},P=class{constructor(e,t){this.elementEventListeners=[{event:"input",callback:e=>this.handleInputEvent(e)}],this.component=e,this.modelElementResolver=t,this.unsyncedInputs=new L}activate(){this.elementEventListeners.forEach(({event:e,callback:t})=>{this.component.element.addEventListener(e,t)})}deactivate(){this.elementEventListeners.forEach(({event:e,callback:t})=>{this.component.element.removeEventListener(e,t)})}markModelAsSynced(e){this.unsyncedInputs.markModelAsSynced(e)}handleInputEvent(e){const t=e.target;t&&this.updateModelFromElement(t)}updateModelFromElement(e){if(!b(e,this.component))return;if(!(e instanceof HTMLElement))throw new Error("Could not update model for non HTMLElement");const t=this.modelElementResolver.getModelName(e);this.unsyncedInputs.add(e,t)}getUnsyncedInputs(){return this.unsyncedInputs.allUnsyncedInputs()}getUnsyncedModels(){return Array.from(this.unsyncedInputs.getUnsyncedModelNames())}resetUnsyncedFields(){this.unsyncedInputs.resetUnsyncedFields()}},L=class{constructor(){this.unsyncedNonModelFields=[],this.unsyncedModelNames=[],this.unsyncedModelFields=new Map}add(e,t=null){if(t)return this.unsyncedModelFields.set(t,e),void(this.unsyncedModelNames.includes(t)||this.unsyncedModelNames.push(t));this.unsyncedNonModelFields.push(e)}resetUnsyncedFields(){this.unsyncedModelFields.forEach((e,t)=>{this.unsyncedModelNames.includes(t)||this.unsyncedModelFields.delete(t)})}allUnsyncedInputs(){return[...this.unsyncedNonModelFields,...this.unsyncedModelFields.values()]}markModelAsSynced(e){const t=this.unsyncedModelNames.indexOf(e);-1!==t&&this.unsyncedModelNames.splice(t,1)}getUnsyncedModelNames(){return this.unsyncedModelNames}};const N=(e,t)=>{const n=JSON.parse(JSON.stringify(e));let s=n;const i=t.split(".");for(let e=0;e<i.length-1;e++)s=s[i[e]];return{currentLevelData:s,finalData:n,finalKey:i[i.length-1],parts:i}};var I=class{constructor(e){this.props={},this.dirtyProps={},this.pendingProps={},this.updatedPropsFromParent={},this.props=e}get(e){const t=m(e);return void 0!==this.dirtyProps[t]?this.dirtyProps[t]:void 0!==this.pendingProps[t]?this.pendingProps[t]:void 0!==this.props[t]?this.props[t]:function(e,t){const{currentLevelData:n,finalKey:s}=N(e,t);if(void 0!==n)return n[s]}(this.props,t)}has(e){return void 0!==this.get(e)}set(e,t){const n=m(e);return this.get(n)!==t&&(this.dirtyProps[n]=t,!0)}getOriginalProps(){return{...this.props}}getDirtyProps(){return{...this.dirtyProps}}getUpdatedPropsFromParent(){return{...this.updatedPropsFromParent}}flushDirtyPropsToPending(){this.pendingProps={...this.dirtyProps},this.dirtyProps={}}reinitializeAllProps(e){this.props=e,this.updatedPropsFromParent={},this.pendingProps={}}pushPendingPropsBackToDirty(){this.dirtyProps={...this.pendingProps,...this.dirtyProps},this.pendingProps={}}storeNewPropsFromParent(e){let t=!1;for(const[n,s]of Object.entries(e))this.get(n)!==s&&(t=!0);return t&&(this.updatedPropsFromParent=e),t}},R=class{constructor(e,t,n,s,i,r,o){this.fingerprint="",this.defaultDebounce=150,this.backendRequest=null,this.pendingActions=[],this.pendingFiles={},this.isRequestPending=!1,this.requestDebounceTimeout=null,this.element=e,this.name=t,this.backend=r,this.elementDriver=o,this.id=i,this.listeners=new Map,s.forEac
1h(e=>{this.listeners.has(e.event)||this.listeners.set(e.event,[]),this.listeners.get(e.event)?.push(e.action)}),this.valueStore=new I(n),this.unsyncedInputsTracker=new P(this,o),this.hooks=new k,this.resetPromise(),this.externalMutationTracker=new S(this.element,e=>b(e,this)),this.externalMutationTracker.start()}addPlugin(e){e.attachToComponent(this)}connect(){var e;e=this,d.set(e.element,e),c.set(e,e.name),this.hooks.triggerHook("connect",this),this.unsyncedInputsTracker.activate(),this.externalMutationTracker.start()}disconnect(){var e;e=this,d.delete(e.element),c.delete(e),this.hooks.triggerHook("disconnect",this),this.clearRequestDebounceTimeout(),this.unsyncedInputsTracker.deactivate(),this.externalMutationTracker.stop()}on(e,t){this.hooks.register(e,t)}off(e,t){this.hooks.unregister(e,t)}set(e,t,n=!1,s=!1){const i=this.nextRequestPromise,r=m(e);if(!this.valueStore.has(r))throw new Error(`Invalid model name "${e}".`);const o=this.valueStore.set(r,t);return this.hooks.triggerHook("model:set",e,t,this),this.unsyncedInputsTracker.markModelAsSynced(r),n&&o&&this.debouncedStartRequest(s),i}getData(e){const t=m(e);if(!this.valueStore.has(t))throw new Error(`Invalid model "${e}".`);return this.valueStore.get(t)}action(e,t={},n=!1){const s=this.nextRequestPromise;return this.pendingActions.push({name:e,args:t}),this.debouncedStartRequest(n),s}files(e,t){this.pendingFiles[e]=t}render(){const e=this.nextRequestPromise;return this.tryStartingRequest(),e}getUnsyncedModels(){return this.unsyncedInputsTracker.getUnsyncedModels()}emit(e,t,n=null){this.performEmit(e,t,!1,n)}emitUp(e,t,n=null){this.performEmit(e,t,!0,n)}emitSelf(e,t){this.doEmit(e,t)}performEmit(e,t,n,s){((e,t,n)=>{const s=[];return c.forEach((i,r)=>{(!t||e!==r&&r.element.contains(e.element))&&(n&&i!==n||s.push(r))}),s})(this,n,s).forEach(n=>{n.doEmit(e,t)})}doEmit(e,t){this.listeners.has(e)&&(this.listeners.get(e)||[]).forEach(e=>{this.action(e,t,1)})}isTurboEnabled(){return"undefined"!=typeof Turbo&&!this.element.closest('[data-turbo="false"]')}tryStartingRequest(){this.backendRequest?this.isRequestPending=!0:this.performRequest()}performRequest(){const e=this.nextRequestPromiseResolve;this.resetPromise(),this.unsyncedInputsTracker.resetUnsyncedFields();const t={};for(const[e,n]of Object.entries(this.pendingFiles))n.files&&(t[e]=n.files);const n=this.pendingActions.slice(0,50),s=this.pendingActions.slice(50),i={props:this.valueStore.getOriginalProps(),actions:n,updated:this.valueStore.getDirtyProps(),children:{},updatedPropsFromParent:this.valueStore.getUpdatedPropsFromParent(),files:t};this.hooks.triggerHook("request:started",i),this.backendRequest=this.backend.makeRequest(i.props,i.actions,i.updated,i.children,i.updatedPropsFromParent,i.files),this.hooks.triggerHook("loading.state:started",this.element,this.backendRequest),this.pendingActions=s,this.valueStore.flushDirtyPropsToPending(),this.isRequestPending=s.length>0,this.backendRequest.promise.then(async t=>{const n=new a(t),s=await n.getBody();for(const e of Object.values(this.pendingFiles))e.value="";const i=n.response.headers;if(!i.get("Content-Type")?.includes("application/vnd.live-component+html")&&!i.get("X-Live-Redirect")){const i={displayError:!0};return this.valueStore.pushPendingPropsBackToDirty(),this.hooks.triggerHook("response:error",n,i),i.displayError&&this.renderError(s),this.backendRequest=null,e(n),t}const r=n.getLiveUrl();return r&&history.replaceState(history.state,"",new URL(r+window.location.hash,window.location.origin)),this.processRerender(s,n),this.backendRequest=null,e(n),this.isRequestPending&&(this.isRequestPending=!1,this.performRequest()),t})}processRerender(e,t){const n={shouldRender:!0};if(this.hooks.triggerHook("render:started",e,t,n),!n.shouldRender)return;if(t.response.headers.get("Location"))return void(this.isTurboEnabled()?Turbo.visit(t.response.headers.get("Location")):window.location.href=t.response.headers.get("Location")||"");this.hooks.triggerHook("loading.state:finished",this.element);const s={};let i;Object.keys(this.valueStore.getDirtyProps()).forEach(e=>{s[e]=this.valueStore.get(e)});try{if(i=function(e){const t=document.createElement("template");if(e=e.trim(),t.innerHTML=e,t.content.childElementCount>1)throw new Error(`Component HTML contains ${t.content.childElementCount} elements, but only 1 root element is allowed.`);const n=t.content.firstElementChild;if(!n)throw new Error("Child not found");if(!(n instanceof HTMLElement))throw new Error(`Created element is not an HTMLElement: ${e.trim()}`);return n}(e),!i.matches("[data-controller~=live]"))throw new Error("A live component template must contain a single root controller element.")}catch(e){throw console.error(`There was a problem with the '${this.name}' component HTML returned:`,{id:this.id}),e}this.externalMutationTracker.handlePendingChanges(),this.externalMutationTracker.stop(),function(e,t,n,s,i){const r=[],o=new Map,a=(e,t)=>{const n=o.get(e);if(!(n instanceof HTMLElement))throw new Error(`Original element with id ${e} not found`);if(r.push(e),!t)return null;const s=E(n);return n.replaceWith(s),s};t.querySelectorAll("[data-live-preserve]").forEach(t=>{const n=t.id;if(!n)throw new Error("The data-live-preserve attribute requires an id attribute to be set on the element");const s=e.querySelector(`#${n}`);if(!(s instanceof HTMLElement))throw new Error(`The element with id "${n}" was not found in the original HTML`);t.removeAttribute("data-live-preserve"),o.set(n,s),((e,t)=>{for(let n=0;n<e.attributes.length;n++){const s=e.attributes[n];t.setAttribute(s.name,s.value)}})(t,s)}),M.morph(e,t,{callbacks:{beforeNodeMorphed:(t,r)=>{if(!(t instanceof Element&&r instanceof Element))return!0;
1if(t===e)return!0;if(t.id&&o.has(t.id)){if(t.id===r.id)return!1;const e=a(t.id,!0);if(!e)throw new Error("missing clone");return M.morph(e,r),!1}if(t instanceof HTMLElement&&r instanceof HTMLElement){if(void 0!==t.__x){if(!window.Alpine)throw new Error("Unable to access Alpine.js though the global window.Alpine variable. Please make sure Alpine.js is loaded before Symfony UX LiveComponent.");if("function"!=typeof window.Alpine.morph)throw new Error("Unable to access Alpine.js morph function. Please make sure the Alpine.js Morph plugin is installed and loaded, see https://alpinejs.dev/plugins/morph for more information.");window.Alpine.morph(t.__x,r)}if(i.wasElementAdded(t))return t.insertAdjacentElement("afterend",r),!1;n.includes(t)&&f(r,s(t)),t===document.activeElement&&t!==document.body&&null!==v(t,!1)&&f(r,s(t));const e=i.getChangedElement(t);if(e&&e.applyToElement(r),"OPTION"!==t.nodeName.toUpperCase()&&t.isEqualNode(r)){const e=E(t);A(e);const n=E(r);if(A(n),e.isEqualNode(n))return!1}}return t.hasAttribute("data-skip-morph")||t.id&&t.id!==r.id?(t.innerHTML=r.innerHTML,!0):!t.parentElement?.hasAttribute("data-skip-morph")&&!t.hasAttribute("data-live-ignore")},beforeNodeRemoved:e=>
1!(e instanceof HTMLElement&&(e.id&&o.has(e.id)?(a(e.id,!1),0):i.wasElementAdded(e)||e.hasAttribute("data-live-ignore")))}}),r.forEach(t=>{const n=e.querySelector(`#${t}`),s=o.get(t);if(!(n instanceof HTMLElement&&s instanceof HTMLElement))throw new Error("Missing elements.");n.replaceWith(s)})}(this.element,i,this.unsyncedInputsTracker.getUnsyncedInputs(),e=>p(e,this.valueStore),this.externalMutationTracker),this.externalMutationTracker.start();const r=this.elementDriver.getComponentProps();this.valueStore.reinitializeAllProps(r);const o=this.elementDriver.getEventsToEmit(),a=this.elementDriver.getBrowserEventsToDispatch();Object.keys(s).forEach(e=>{this.valueStore.set(e,s[e])}),o.forEach(({event:e,data:t,target:n,componentName:s})=>{"up"!==n?"self"!==n?this.emit(e,t,s):this.emitSelf(e,t):this.emitUp(e,t,s)}),a.forEach(({event:e,payload:t})=>{this.element.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0}))}),this.hooks.triggerHook("render:finished",this)}calculateDebounce(e){return!0===e?this.defaultDebounce:!1===e?0:e}clearRequestDebounceTimeout(){this.requestDebounceTimeout&&(clearTimeout(this.requestDebounceTimeout),this.requestDebounceTimeout=null)}debouncedStartRequest(e){this.clearRequestDebounceTimeout(),this.requestDebounceTimeout=window.setTimeout(()=>{this.render()},this.calculateDebounce(e))}renderError(e){let t=document.getElementById("live-component-error");t?t.innerHTML="":(t=document.createElement("div"),t.id="live-component-error",t.style.padding="50px",t.style.backgroundColor="rgba(0, 0, 0, .5)",t.style.zIndex="100000",t.style.position="fixed",t.style.top="0px",t.style.bottom="0px",t.style.left="0px",t.style.right="0px",t.style.display="flex",t.style.flexDirection="column");const n=document.createElement("iframe");n.style.borderRadius="5px",n.style.flexGrow="1",t.appendChild(n),document.body.prepend(t),document.body.style.overflow="hidden",n.contentWindow&&(n.contentWindow.document.open(),n.contentWindow.document.write(e),n.contentWindow.document.close());const s=e=>{e&&(e.outerHTML=""),document.body.style.overflow="visible"};t.addEventListener("click",()=>s(t)),t.setAttribute("tabindex","0"),t.addEventListener("keydown",e=>{"Escape"===e.key&&s(t)}),t.focus()}resetPromise(){this.nextRequestPromise=new Promise(e=>{this.nextRequestPromiseResolve=e})}_updateFromParentProps(e){this.valueStore.storeNewPropsFromParent(e)&&this.render()}};var O=class{constructor(e){this.controller=e}getModelName(e){const t=v(e,!1);return t?t.action:null}getComponentProps(){return this.controller.propsValue}getEventsToEmit(){return this.controller.eventsToEmitValue}getBrowserEventsToDispatch(){return this.controller.eventsToDispatchValue}};function x(e){let t=!0,n=null,s=!1,i=null,r=null,o=null,a=null;e.modifiers.forEach(l=>{switch(l.name){case"on":if(!l.value)throw new Error(`The "on" modifier in ${e.getString()} requires a value - e.g. on(change).`);if(!["input","change"].includes(l.value))throw new Error(`The "on" modifier in ${e.getString()} only accepts the arguments "input" or "change".`);n=l.value;break;case"norender":t=!1;break;case"debounce":s=!l.value||Number.parseInt(l.value);break;case"min_length":i=l.value?Number.parseInt(l.value):null;break;case"max_length":r=l.value?Number.parseInt(l.value):null;break;case"min_value":o=l.value?Number.parseFloat(l.value):null;break;case"max_value":a=l.value?Number.parseFloat(l.value):null;break;default:throw new Error(`Unknown modifier "${l.name}" in data-model="${e.getString()}".`)}});const[l,d]=e.action.split(":");return{modelName:l,innerModelName:d||null,shouldRender:t,debounce:s,targetEventName:n,minLength:i,maxLength:r,minValue:o,maxValue:a}}var H=class{constructor(e){this.parentModelBindings=[],this.component=e,this.parentModelBindings=g(this.component.element).map(x)}attachToComponent(e){e.on("request:started",e=>{e.children=this.getChildrenFingerprints()}),e.on("model:set",(e,t)=>{this.notifyParentModelChange(e,t)})}getChildrenFingerprints(){const e={};
1return this.getChildren().forEach(t=>{if(!t.id)throw new Error("missing id");e[t.id]={fingerprint:t.fingerprint,tag:t.element.tagName.toLowerCase()}}),e}notifyParentModelChange(e,t){const n=(e=>{let t=e.element.parentElement;for(;t;){const e=d.get(t);if(e)return e;t=t.parentElement}return null})(this.component);n&&this.parentModelBindings.forEach(s=>{(s.innerModelName||"value")===e&&n.set(s.modelName,t,s.shouldRender,s.debounce)})}getChildren(){return(e=>{const t=[];return c.forEach((n,s)=>{if(e===s)return;if(!e.element.contains(s.element))return;let i=!1;c.forEach((e,t)=>{i||t!==s&&t.element.contains(s.element)&&(i=!0)}),t.push(s)}),t})(this.component)}},F=class{constructor(){this.intersectionObserver=null}attachToComponent(e){"lazy"===e.element.attributes.getNamedItem("loading")?.value&&(e.on("connect",()=>{this.getObserver().observe(e.element)}),e.on("disconnect",()=>{this.intersectionObserver?.unobserve(e.element)}))}getObserver(){return this.intersectionObserver||(this.intersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(e.target.dispatchEvent(new CustomEvent("live:appear")),t.unobserve(e.target))})})),this.intersectionObserver}},q=class{attachToComponent(e){e.on("loading.state:started",(t,n)=>{this.startLoading(e,t,n)}),e.on("loading.state:finished",t=>{this.finishLoading(e,t)}),this.finishLoading(e,e.element)}startLoading(e,t,n){this.handleLoadingToggle(e,!0,t,n)}finishLoading(e,t){this.handleLoadingToggle(e,!1,t,null)}handleLoadingToggle(e,t,n,s){t?this.addAttributes(n,["busy"]):this.removeAttributes(n,["busy"]),this.getLoadingDirectives(e,n).forEach(({element:e,directives:n})=>{t?this.addAttributes(e,["data-live-is-loading"]):this.removeAttributes(e,["data-live-is-loading"]),n.forEach(n=>{this.handleLoadingDirective(e,t,n,s)})})}handleLoadingDirective(e,t,n,s){const i=D(n.action,t),r=[],o=[];let a=0;const l=new Map;if(l.set("delay",e=>{t&&(a=e.value?Number.parseInt(e.value):200)}),l.set("action",e=>{if(!e.value)throw new Error(`The "action" in data-loading must have an action name - e.g. action(foo). It's missing for "${n.getString()}"`);r.push(e.value)}),l.set("model",e=>{if(!e.value)throw new Error(`The "model" in data-loading must have an action name - e.g. model(foo). It's missing for "${n.getString()}"`);o.push(e.value)}),n.modifiers.forEach(e=>{if(!l.has(e.name))throw new Error(`Unknown modifier "${e.name}" used in data-loading="${n.getString()}". Available modifiers are: ${Array.from(l.keys()).join(", ")}.`);(l.get(e.name)??(()=>{}))(e)}),t&&r.length>0&&s&&!s.containsOneOfActions(r))return;if(t&&o.length>0&&s&&!s.areAnyModelsUpdated(o))return;let d;switch(i){case"show":d=()=>this.showElement(e);break;case"hide":d=()=>this.hideElement(e);break;case"addClass":d=()=>this.addClass(e,n.args);break;case"removeClass":d=()=>this.removeClass(e,n.args);break;case"addAttribute":d=()=>this.addAttributes(e,n.args);break;case"removeAttribute":d=()=>this.removeAttributes(e,n.args);break;default:throw new Error(`Unknown data-loading action "${i}"`)}a?window.setTimeout(()=>{s&&!s.isResolved&&d()},a):d()}getLoadingDirectives(e,t){const n=[];let s=Array.from(t.querySelectorAll("[data-loading]"));return s=s.filter(t=>b(t,e)),t.hasAttribute("data-loading")&&(s=[t,...s]),s.forEach(e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))throw new Error("Invalid Element Type");const t=h(e.dataset.loading||"show");n.push({element:e,directives:t})}),n}showElement(e){e.style.display="revert"}hideElement(e){e.style.display="none"}addClass(e,t){e.classList.add(...u(t))}removeClass(e,t){e.classList.remove(...u(t)),0===e.classList.length&&e.removeAttribute("class")}addAttributes(e,t){t.forEach(t=>{e.setAttribute(t,"")})}removeAttributes(e,t){t.forEach(t=>{e.removeAttribute(t)})}};const D=(e,t)=>{switch(e){case"show":return t?"show":"hide";case"hide":return t?"hide":"show";case"addClass":return t?"addClass":"removeClass";case"removeClass":return t?"removeClass":"addClass";case"addAttribute":return t?"addAttribute":"removeAttribute";case"removeAttribute":return t?"removeAttribute":"addAttribute"}throw new Error(`Unknown data-loading action "${e}"`)};var U=class{constructor(){this.isConnected=!1}attachToComponent(e){e.on("render:started",(e,t,n)=>{this.isConnected||(n.shouldRender=!1)}),e.on("connect",()=>{this.isConnected=!0}),e.on("disconnect",()=>{this.isConnected=!1})}},$=class{constructor(e){this.isPollingActive=!0,this.pollingIntervals=[],this.component=e}addPoll(e,t){this.polls.push({actionName:e,duration:t}),this.isPollingActive&&this.initiatePoll(e,t)}startAllPolling(){this.isPollingActive||(this.isPollingActive=!0,this.polls.forEac
1h(({actionName:e,duration:t})=>{this.initiatePoll(e,t)}))}stopAllPolling(){this.isPollingActive=!1,this.pollingIntervals.forEach(e=>{clearInterval(e)})}clearPolling(){this.stopAllPolling(),this.polls=[],this.startAllPolling()}initiatePoll(e,t){let n;n="$render"===e?()=>{this.component.render()}:()=>{this.component.action(e,{},0)};const s=window.setInterval(()=>{n()},t);this.pollingIntervals.push(s)}},V=class{attachToComponent(e){this.element=e.element,this.pollingDirector=new $(e),this.initializePolling(),e.on("connect",()=>{this.pollingDirector.startAllPolling()}),e.on("disconnect",()=>{this.pollingDirector.stopAllPolling()}),e.on("render:finished",()=>{this.initializePolling()})}addPoll(e,t){this.pollingDirector.addPoll(e,t)}clearPolling(){this.pollingDirector.clearPolling()}initializePolling(){if(this.clearPolling(),void 0===this.element.dataset.poll)return;const e=this.element.dataset.poll;h(e||"$render").forEach(t=>{let n=2e3;t.modifiers.forEach(t=>{if("delay"===t.name)t.value&&(n=Number.parseInt(t.value));else console.warn(`Unknown modifier "${t.name}" in data-poll "${e}".`)}),this.addPoll(t.action,n)})}},j=class{attachToComponent(e){this.synchronizeValueOfModelFields(e),e.on("render:finished",()=>{this.synchronizeValueOfModelFields(e)})}synchronizeValueOfModelFields(e){e.element.querySelectorAll("[data-model]").forEach(t=>{if(!(t instanceof HTMLElement))throw new Error("Invalid element using data-model.");if(t instanceof HTMLFormElement)return;if(!b(t,e))return;const n=v(t);if(!n)return;const s=n.action;e.getUnsyncedModels().includes(s)||(e.valueStore.has(s)&&f(t,e.valueStore.get(s)),t instanceof HTMLSelectElement&&!t.multiple&&e.valueStore.set(s,p(t,e.valueStore)))})}},B=class{attachToComponent(e){e.on("model:set",t=>{this.handleModelSet(t,e.valueStore)})}handleModelSet(e,t){if(t.has("validatedFields")){const n=[...t.get("validatedFields")];n.includes(e)||n.push(e),t.set("validatedFields",n)}}},_=class e extends s.xI{constructor(...e){super(...e),this.pendingActionTriggerModelElement=null,this.elementEventListeners=[{event:"input",callback:e=>this.handleInputEvent(e)},{event:"change",callback:e=>this.handleChangeEvent(e)}],this.pendingFiles={}}initialize(){this.mutationObserver=new MutationObserver(this.onMutations.bind(this)),this.createComponent()}connect(){this.connectComponent(),this.mutationObserver.observe(this.element,{attributes:!0})}disconnect(){this.disconnectComponent(),this.mutationObserver.disconnect()}update(e){if("input"===e.type||"change"===e.type)throw new Error(`Since LiveComponents 2.3, you no longer need data-action="live#update" on form elements. Found on element: ${l(e.currentTarget)}`);this.updateModelFromElementEvent(e.currentTarget,null)}action(e){const t=e.params;if(!t.action)throw new Error(`No action name provided on element: ${l(e.currentTarget)}. Did you forget to add the "data-live-action-param" attribute?`);const n=t.action,s={...t};delete s.action;const i=h(n);let r=!1;i.forEach(t=>{let i={};const o=new Map;o.set("stop",()=>{e.stopPropagation()}),o.set("self",()=>{e.target,e.currentTarget}),o.set("debounce",e=>{r=!e.value||Number.parseInt(e.value)}),o.set("files",e=>{e.value?this.pendingFiles[e.value]&&(i[e.value]=this.pendingFiles[e.value]):i=this.pendingFiles}),t.modifiers.forEach(e=>{o.has(e.name)?(o.get(e.name)??(()=>{}))(e):console.warn(`Unknown modifier ${e.name} in action "${n}". Available modifiers are: ${Array.from(o.keys()).join(", ")}.`)});for(const[e,t]of Object.entries(i))t.files&&this.component.files(e,t),delete this.pendingFiles[e];this.component.action(t.action,s,r),v(e.currentTarget,!1)&&(this.pendingActionTriggerModelElement=e.currentTarget)})}$render(){return this.component.render()}emit(e){this.getEmitDirectives(e).forEach(({name:e,data:t,nameMatch:n})=>{this.component.emit(e,t,n)})}emitUp(e){this.getEmitDirectives(e).forEach(({name:e,data:t,nameMatch:n})=>{this.component.emitUp(e,t,n)})}emitSelf(e){this.getEmitDirectives(e).forEach(({name:e,data:t})=>{this.component.emitSelf(e,t)})}$updateModel(e,t,n=!0,s=!0){return this.component.set(e,t,n,s)}propsUpdatedFromParentValueChanged(){this.component._updateFromParentProps(this.propsUpdatedFromParentValue)}fingerprintValueChanged(){this.component.fingerprint=this.fingerprintValue}getEmitDirectives(e){const t=e.params;if(!t.event)throw new Error(`No event name provided on element: ${l(e.currentTarget)}. Did you forget to add the "data-live-event-param" attribute?`);const n=t.event,s={...t};delete s.event;const i=h(n),r=[];
1return i.forEach(e=>{let t=null;e.modifiers.forEach(e=>{if("name"!==e.name)throw new Error(`Unknown modifier ${e.name} in event "${n}".`);t=e.value}),r.push({name:e.action,data:s,nameMatch:t})}),r}createComponent(){const t=this.element.id||null;var n;this.component=new R(this.element,this.nameValue,this.propsValue,this.listenersValue,t,e.backendFactory(this),new O(this)),this.proxiedComponent=(n=this.component,new Proxy(n,{get(e,t){if(t in e||"string"!=typeof t){if("function"==typeof e[t]){const n=e[t];return(...t)=>n.apply(e,t)}return Reflect.get(e,t)}return e.valueStore.has(t)?e.getData(t):n=>e.action.apply(e,[t,n])},set:(e,t,n)=>t in e?(e[t]=n,!0):(e.set(t,n),!0)})),Object.defineProperty(this.element,"__component",{value:this.proxiedComponent,writable:!0}),this.hasDebounceValue&&(this.component.defaultDebounce=this.debounceValue),[new q,new F,new B,new U,new V,new j,new H(this.component)].forEach(e=>{this.component.addPlugin(e)})}connectComponent(){this.component.connect(),this.mutationObserver.observe(this.element,{attributes:!0}),this.elementEventListeners.forEach(({event:e,callback:t})=>{this.component.element.addEventListener(e,t)}),this.dispatchEvent("connect")}disconnectComponent(){this.component.disconnect(),this.elementEventListeners.forEach(({event:e,callback:t})=>{this.component.element.removeEventListener(e,t)}),this.dispatchEvent("disconnect")}handleInputEvent(e){const t=e.target;t&&this.updateModelFromElementEvent(t,"input")}handleChangeEvent(e){const t=e.target;t&&this.updateModelFromElementEvent(t,"change")}updateModelFromElementEvent(e,t){if(!b(e,this.component))return;if(!(e instanceof HTMLElement))throw new Error("Could not update model for non HTMLElement");if(e instanceof HTMLInputElement&&"file"===e.type){const t=e.name;e.files?.length?this.pendingFiles[t]=e:this.pendingFiles[t]&&delete this.pendingFiles[t]}const n=v(e,!1);if(!n)return;const s=x(n);if(s.targetEventName||(s.targetEventName="input"),this.pendingActionTriggerModelElement===e&&(s.shouldRender=!1),"change"===t&&"input"===s.targetEventName&&(s.targetEventName="change"),t&&s.targetEventName!==t)return;!1===s.debounce&&("input"===s.targetEventName?s.debounce=!0:s.debounce=0);const i=p(e,this.component.valueStore),r=""===i||null==i;if((o=e)instanceof HTMLInputElement&&["text","email","password","search","tel","url"].includes(o.type)||function(e){return e instanceof HTMLTextAreaElement}(e)){if(!r&&null!==s.minLength&&"string"==typeof i&&i.length<s.minLength)return;if(!r&&null!==s.maxLength&&"string"==typeof i&&i.length>s.maxLength)return}var o;if(function(e){return e instanceof HTMLInputElement&&["number","range"].includes(e.type)}(e)&&!r){const e=Number(i);if(null!==s.minValue&&e<s.minValue)return;if(null!==s.maxValue&&e>s.maxValue)return}this.component.set(s.modelName,i,s.shouldRender,s.debounce)}dispatchEvent(e,t={},n=!0,s=!1){t.controller=this,t.component=this.proxiedComponent,this.dispatch(e,{detail:t,prefix:"live",cancelable:s,bubbles:n})}onMutations(e){e.forEach(e=>{"attributes"===e.type&&"id"===e.attributeName&&this.element.id!==this.component.id&&(this.disconnectComponent(),this.createComponent(),this.connectComponent())})}};_.values={name:String,url:String,props:{type:Object,default:{}},propsUpdatedFromParent:{type:Object,default:{}},listeners:{type:Array,default:[]},eventsToEmit:{type:Array,default:[]},eventsToDispatch:{type:Array,default:[]},debounce:{type:Number,default:150},fingerprint:{type:String,default:""},requestMethod:{type:String,default:"post"},fetchCredentials:{type:String,default:"same-origin"}},_.backendFactory=e=>new o(e.urlValue,e.requestMethodValue,e.fetchCredentialsValue)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.