cable_ready 5.0.0.pre8 → 5.0.0.pre9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ import e from"morphdom";var t="5.0.0-pre9";const n={INPUT:!0,TEXTAREA:!0,SELECT:!0},o={INPUT:!0,TEXTAREA:!0,OPTION:!0},r={"datetime-local":!0,"select-multiple":!0,"select-one":!0,color:!0,date:!0,datetime:!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,textarea:!0,time:!0,url:!0,week:!0};let s;var a={get element(){return s},set(e){s=e}};const i=e=>n[e.tagName]&&r[e.type],l=e=>{const t=(e&&e.nodeType===Node.ELEMENT_NODE?e:document.querySelector(e))||a.element;t&&t.focus&&t.focus()},c=(e,t,n={})=>{const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(o),window.jQuery&&window.jQuery(e).trigger(t,n)},u=e=>document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,d=e=>Array(e).flat(),m=(e,t)=>{Array.from(e.selectAll?e.element:[e.element]).forEach(t)},h=e=>e.split("").map(((e,t)=>e.toUpperCase()===e?`${0!==t?"-":""}${e.toLowerCase()}`:e)).join(""),p=(e,t)=>!e.cancel&&(e.delay?setTimeout(t,e.delay):t(),!0),f=(e,t)=>c(e,`cable-ready:before-${h(t.operation)}`,t),b=(e,t)=>c(e,`cable-ready:after-${h(t.operation)}`,t);function y(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout((()=>e.apply(this,o)),t)}}function g(e){if(!e.ok)throw Error(e.statusText);return e}async function w(e,t){try{const n=await fetch(e,{headers:{"X-REQUESTED-WITH":"XmlHttpRequest",...t}});if(null==n)return;return g(n),n}catch(t){console.error(`Could not fetch ${e}`)}}var E=Object.freeze({__proto__:null,isTextInput:i,assignFocus:l,dispatch:c,xpathToElement:u,getClassNames:d,processElements:m,operate:p,before:f,after:b,debounce:y,handleErrors:g,graciouslyFetch:w,kebabize:h});const v=e=>(t,n)=>!x.map((o=>"function"!=typeof o||o(e,t,n))).includes(!1),T=e=>t=>{M.forEach((n=>{"function"==typeof n&&n(e,t)}))},A=(e,t,n)=>!(!o[t.tagName]&&t.isEqualNode(n)),S=(e,t,n)=>t!==a.element||!t.isContentEditable,C=(e,t,n)=>{const{permanentAttributeName:o}=e;if(!o)return!0;const r=t.closest(`[${o}]`);if(!r&&t===a.element&&i(t)){const e={value:!0};return Array.from(n.attributes).forEach((n=>{e[n.name]||t.setAttribute(n.name,n.value)})),!1}return!r},x=[A,C,S],M=[];var O=Object.freeze({__proto__:null,shouldMorphCallbacks:x,didMorphCallbacks:M,shouldMorph:v,didMorph:T,verifyNotMutable:A,verifyNotContentEditable:S,verifyNotPermanent:C}),k={append:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{html:n,focusSelector:o}=e;t.insertAdjacentHTML("beforeend",n||""),l(o)})),b(t,e)}))},graft:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{parent:n,focusSelector:o}=e,r=document.querySelector(n);r&&(r.appendChild(t),l(o))})),b(t,e)}))},innerHtml:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{html:n,focusSelector:o}=e;t.innerHTML=n||"",l(o)})),b(t,e)}))},insertAdjacentHtml:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{html:n,position:o,focusSelector:r}=e;t.insertAdjacentHTML(o||"beforeend",n||""),l(r)})),b(t,e)}))},insertAdjacentText:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{text:n,position:o,focusSelector:r}=e;t.insertAdjacentText(o||"beforeend",n||""),l(r)})),b(t,e)}))},morph:t=>{m(t,(n=>{const{html:o}=t,r=document.createElement("template");r.innerHTML=String(o).trim(),t.content=r.content;const s=n.parentElement,a=Array.from(s.children).indexOf(n);f(n,t),p(t,(()=>{const{childrenOnly:o,focusSelector:s}=t;e(n,o?r.content:r.innerHTML,{childrenOnly:!!o,onBeforeElUpdated:v(t),onElUpdated:T(t)}),l(s)})),b(s.children[a],t)}))},outerHtml:e=>{m(e,(t=>{const n=t.parentElement,o=Array.from(n.children).indexOf(t);f(t,e),p(e,(()=>{const{html:n,focusSelector:o}=e;t.outerHTML=n||"",l(o)})),b(n.children[o],e)}))},prepend:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{html:n,focusSelector:o}=e;t.insertAdjacentHTML("afterbegin",n||""),l(o)})),b(t,e)}))},remove:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{focusSelector:n}=e;t.remove(),l(n)})),b(document,e)}))},replace:e=>{m(e,(t=>{const n=t.parentElement,o=Array.from(n.children).indexOf(t);f(t,e),p(e,(()=>{const{html:n,focusSelector:o}=e;t.outerHTML=n||"",l(o)})),b(n.children[o],e)}))},textContent:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{text:n,focusSelector:o}=e;t.textContent=null!=n?n:"",l(o)})),b(t,e)}))},addCssClass:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n}=e;t.classList.add(...d(n||""))})),b(t,e)}))},removeAttribute:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n}=e;t.removeAttribute(n)})),b(t,e)}))},removeCssClass:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n}=e;t.classList.remove(...d(n))})),b(t,e)}))},setAttribute:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n,value:o}=e;t.setAttribute(n,o||"")})),b(t,e)}))},setDatasetProperty:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n,value:o}=e;t.dataset[n]=o||""})),b(t,e)}))},setProperty:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n,value:o}=e;n in t&&(t[n]=o||"")})),b(t,e)}))},setStyle:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n,value:o}=e;t.style[n]=o||""})),b(t,e)}))},setStyles:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{styles:n}=e;for(let[e,o]of Object.entries(n))t.style[e]=o||""})),b(t,e)}))},setValue:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{value:n}=e;t.value=n||""})),b(t,e)}))},dispatchEvent:e=>{m(e,(t=>{f(t,e),p(e,(()=>{const{name:n,detail:o}=e;c(t,n,o)})),b(t,e)}))},setMeta:e=>{f(document,e),p(e,(()=>{const{name:t,content:n}=e;let o=document.head.querySelector(`meta[name='${t}']`);o||(o=document.createElement("meta"),o.name=t,document.head.appendChild(o)),o.content=n})),b(document,e)},clearStorage:e=>{f(document,e),p(e,(()=>{const{type:t}=e;("session"===t?sessionStorage:localStorage).clear()})),b(document,e)},go:e=>{f(window,e),p(e,(()=>{const{delta:t}=e;history.go(t)})),b(window,e)},pushState:e=>{f(window,e),p(e,(()=>{const{state:t,title:n,url:o}=e;history.pushState(t||{},n||"",o)})),b(window,e)},redirectTo:e=>{f(window,e),p(e,(()=>{let{url:t,action:n}=e;n=n||"advance",window.Turbo&&window.Turbo.visit(t,{action:n}),window.Turbolinks&&window.Turbolinks.visit(t,{action:n}),window.Turbo||window.Turbolinks||(window.location.href=t)})),b(window,e)},reload:e=>{f(window,e),p(e,(()=>{window.location.reload()})),b(window,e)},removeStorageItem:e=>{f(document,e),p(e,(()=>{const{key:t,type:n}=e;("session"===n?sessionStorage:localStorage).removeItem(t)})),b(document,e)},replaceState:e=>{f(window,e),p(e,(()=>{const{state:t,title:n,url:o}=e;history.replaceState(t||{},n||"",o)})),b(window,e)},scrollIntoView:e=>{const{element:t}=e;f(t,e),p(e,(()=>{t.scrollIntoView(e)})),b(t,e)},setCookie:e=>{f(document,e),p(e,(()=>{const{cookie:t}=e;document.cookie=t||""})),b(document,e)},setFocus:e=>{const{element:t}=e;f(t,e),p(e,(()=>{l(t)})),b(t,e)},setStorageItem:e=>{f(document,e),p(e,(()=>{const{key:t,value:n,type:o}=e;("session"===o?sessionStorage:localStorage).setItem(t,n||"")})),b(document,e)},consoleLog:e=>{f(document,e),p(e,(()=>{const{message:t,level:n}=e;n&&["warn","info","error"].includes(n)?console[n](t||""):console.log(t||"")})),b(document,e)},consoleTable:e=>{f(document,e),p(e,(()=>{const{data:t,columns:n}=e;console.table(t,n||[])})),b(document,e)},notification:e=>{f(document,e),p(e,(()=>{const{title:t,options:n}=e;Notification.requestPermission().then((o=>{e.permission=o,"granted"===o&&new Notification(t||"",n)}))})),b(document,e)}};let L=k;const R=e=>{L={...L,...e}};var P={get all(){return L}};const q=(e,t={emitMissingElementWarnings:!0})=>{const n={};e.forEach((e=>{e.batch&&(n[e.batch]=n[e.batch]?++n[e.batch]:1)})),e.forEach((e=>{const o=e.operation;try{if(e.selector?e.element=e.xpath?u(e.selector):document[e.selectAll?"querySelectorAll":"querySelector"](e.selector):e.element=document,e.element||t.emitMissingElementWarnings){a.set(document.activeElement);const t=P.all[o];t?(t(e),e.batch&&0==--n[e.batch]&&c(document,"cable-ready:batch-complete",{batch:e.batch})):console.error(`CableReady couldn't find the "${o}" operation. Make sure you use the camelized form when calling an operation method.`)}}catch(t){e.element?(console.error(`CableReady detected an error in ${o||"operation"}: ${t.message}. If you need to support older browsers make sure you've included the corresponding polyfills. https://docs.stimulusreflex.com/setup#polyfills-for-ie11.`),console.error(t)):console.warn(`CableReady ${o||"operation"} failed due to missing DOM element for selector: '${e.selector}'`)}}))};let H;const N=[25,50,75,100,200,250,500,800,1e3,2e3],I=async(e=0)=>{if(H)return H;if(e>=N.length)throw new Error("Couldn't obtain a Action Cable consumer within 5s");var t;return await(t=N[e],new Promise((e=>setTimeout(e,t)))),await I(e+1)};var U={setConsumer(e){H=e},get consumer(){return H},getConsumer:async()=>await I()};class $ extends HTMLElement{disconnectedCallback(){this.channel&&this.channel.unsubscribe()}createSubscription(e,t,n){this.channel=e.subscriptions.create({channel:t,identifier:this.identifier},{received:n})}get preview(){return document.documentElement.hasAttribute("data-turbolinks-preview")||document.documentElement.hasAttribute("data-turbo-preview")}get identifier(){return this.getAttribute("identifier")}}class _ extends ${async connectedCallback(){if(this.preview)return;const e=await U.getConsumer();e?this.createSubscription(e,"CableReady::Stream",this.performOperations):console.error("The `stream_from` helper cannot connect without an ActionCable consumer.\nPlease run `rails generate cable_ready:helpers` to fix this.")}performOperations(e){e.cableReady&&q(e.operations)}}class j extends ${constructor(){super();this.attachShadow({mode:"open"}).innerHTML="\n<style>\n :host {\n display: block;\n }\n</style>\n<slot></slot>\n"}async connectedCallback(){if(this.preview)return;this.update=y(this.update.bind(this),this.debounce);const e=await U.getConsumer();e?this.createSubscription(e,"CableReady::Stream",this.update):console.error("The `updates-for` helper cannot connect without an ActionCable consumer.\nPlease run `rails generate cable_ready:helpers` to fix this.")}async update(e){const t=Array.from(document.querySelectorAll(this.query),(e=>new D(e)));if(t[0].element!==this)return;a.set(document.activeElement),this.html={};const n=[...new Set(t.map((e=>e.url)))];await Promise.all(n.map((async e=>{if(!this.html.hasOwnProperty(e)){const t=await w(e,{"X-Cable-Ready":"update"});this.html[e]=await t.text()}}))),this.index={},t.forEach((t=>{this.index.hasOwnProperty(t.url)?this.index[t.url]++:this.index[t.url]=0,t.process(e,this.html,this.index)}))}get query(){return`updates-for[identifier="${this.identifier}"]`}get identifier(){return this.getAttribute("identifier")}get debounce(){return this.hasAttribute("debounce")?parseInt(this.getAttribute("debounce")):20}}class D{constructor(e){this.element=e}async process(t,n,o){if(!this.shouldUpdate(t))return;const r=o[this.url],s=document.createElement("template");this.element.setAttribute("updating","updating"),s.innerHTML=String(n[this.url]).trim(),await this.resolveTurboFrames(s.content);const a=s.content.querySelectorAll(this.query);if(a.length<=r)return void console.warn(`Update aborted due to insufficient number of elements. The offending url is ${this.url}.`);const i={element:this.element,html:a[r],permanentAttributeName:"data-ignore-updates"};c(this.element,"cable-ready:before-update",i),e(this.element,a[r],{childrenOnly:!0,onBeforeElUpdated:v(i),onElUpdated:e=>{this.element.removeAttribute("updating"),c(this.element,"cable-ready:after-update",i),l(i.focusSelector)}})}async resolveTurboFrames(e){const t=[...e.querySelectorAll('turbo-frame[src]:not([loading="lazy"])')];return Promise.all(t.map((t=>new Promise((async n=>{const o=await w(t.getAttribute("src"),{"Turbo-Frame":t.id,"X-Cable-Ready":"update"}),r=document.createElement("template");r.innerHTML=await o.text(),await this.resolveTurboFrames(r.content),e.querySelector(`turbo-frame#${t.id}`).innerHTML=String(r.content.querySelector(`turbo-frame#${t.id}`).innerHTML).trim(),n()})))))}shouldUpdate(e){return!this.ignoresInnerUpdates&&this.hasChangesSelectedForUpdate(e)}hasChangesSelectedForUpdate(e){const t=this.element.getAttribute("only");return!(t&&e.changed&&!t.split(" ").some((t=>e.changed.includes(t))))}get ignoresInnerUpdates(){return this.element.hasAttribute("ignore-inner-updates")&&this.element.hasAttribute("performing-inner-update")}get url(){return this.element.hasAttribute("url")?this.element.getAttribute("url"):location.href}get identifier(){return this.element.identifier}get query(){return this.element.query}}const F=e=>{const t=e&&e.parentElement.closest("updates-for");t&&(t.setAttribute("performing-inner-update",""),F(t))},z=e=>{const t=e&&e.parentElement.closest("updates-for");t&&(t.removeAttribute("performing-inner-update"),z(t))},X={perform:q,performAsync:(e,t={emitMissingElementWarnings:!0})=>new Promise(((n,o)=>{try{n(q(e,t))}catch(e){o(e)}})),shouldMorphCallbacks:x,didMorphCallbacks:M,initialize:(e={})=>{const{consumer:t}=e;document.addEventListener("stimulus-reflex:before",(e=>{F(e.detail.element)})),document.addEventListener("stimulus-reflex:after",(e=>{setTimeout((()=>{z(e.detail.element)}))})),document.addEventListener("turbo:submit-start",(e=>{F(e.target)})),document.addEventListener("turbo:submit-end",(e=>{setTimeout((()=>{z(e.target)}))})),t?U.setConsumer(t):console.error("CableReady requires a reference to your Action Cable `consumer` for its helpers to function.\nEnsure that you have imported the `CableReady` package as well as `consumer` from your `channels` folder, then call `CableReady.initialize({ consumer })`."),customElements.get("stream-from")||customElements.define("stream-from",_),customElements.get("updates-for")||customElements.define("updates-for",j)},addOperation:(e,t)=>{const n={};n[e]=t,R(n)},addOperations:e=>{R(e)},version:t,cable:U,get DOMOperations(){return console.warn("DEPRECATED: Please use `CableReady.operations` instead of `CableReady.DOMOperations`"),P.all},get operations(){return P.all},get consumer(){return U.consumer}};window.CableReady=X;export{O as MorphCallbacks,_ as StreamFromElement,$ as SubscribingElement,j as UpdatesForElement,E as Utils,X as default};
2
+ //# sourceMappingURL=cable_ready.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cable_ready.min.js","sources":["../../../javascript/enums.js","../../../javascript/active_element.js","../../../javascript/utils.js","../../../javascript/morph_callbacks.js","../../../javascript/operations.js","../../../javascript/operation_store.js","../../../javascript/cable_ready.js","../../../javascript/cable_consumer.js","../../../javascript/elements/subscribing_element.js","../../../javascript/elements/stream_from_element.js","../../../javascript/elements/updates_for_element.js","../../../javascript/updatable/inner_updates_compat.js","../../../javascript/index.js","../../../javascript/elements/index.js"],"sourcesContent":["export const inputTags = {\n INPUT: true,\n TEXTAREA: true,\n SELECT: true\n}\n\nexport const mutableTags = {\n INPUT: true,\n TEXTAREA: true,\n OPTION: true\n}\n\nexport const textInputTypes = {\n 'datetime-local': true,\n 'select-multiple': true,\n 'select-one': true,\n color: true,\n date: true,\n datetime: true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n textarea: true,\n time: true,\n url: true,\n week: true\n}\n","let activeElement\n\nexport default {\n get element () {\n return activeElement\n },\n set (element) {\n activeElement = element\n }\n}\n","import { inputTags, textInputTypes } from './enums'\nimport ActiveElement from './active_element'\n\n// Indicates if the passed element is considered a text input.\n//\nconst isTextInput = element => {\n return inputTags[element.tagName] && textInputTypes[element.type]\n}\n\n// Assigns focus to the appropriate element... preferring the explicitly passed selector\n//\n// * selector - a CSS selector for the element that should have focus\n//\nconst assignFocus = selector => {\n const element =\n selector && selector.nodeType === Node.ELEMENT_NODE\n ? selector\n : document.querySelector(selector)\n const focusElement = element || ActiveElement.element\n if (focusElement && focusElement.focus) focusElement.focus()\n}\n\n// Dispatches an event on the passed element\n//\n// * element - the element\n// * name - the name of the event\n// * detail - the event detail\n//\nconst dispatch = (element, name, detail = {}) => {\n const init = { bubbles: true, cancelable: true, detail: detail }\n const evt = new CustomEvent(name, init)\n element.dispatchEvent(evt)\n if (window.jQuery) window.jQuery(element).trigger(name, detail)\n}\n\n// Accepts an xPath query and returns the element found at that position in the DOM\n//\nconst xpathToElement = xpath => {\n return document.evaluate(\n xpath,\n document,\n null,\n XPathResult.FIRST_ORDERED_NODE_TYPE,\n null\n ).singleNodeValue\n}\n\n// Return an array with the class names to be used\n//\n// * names - could be a string or an array of strings for multiple classes.\n//\nconst getClassNames = names => Array(names).flat()\n\n// Perform operation for either the first or all of the elements returned by CSS selector\n//\n// * operation - the instruction payload from perform\n// * callback - the operation function to run for each element\n//\nconst processElements = (operation, callback) => {\n Array.from(\n operation.selectAll ? operation.element : [operation.element]\n ).forEach(callback)\n}\n\n// camelCase to kebab-case\n//\nconst kebabize = str => {\n return str\n .split('')\n .map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter\n })\n .join('')\n}\n\n// Provide a standardized pipeline of checks and modifications to all operations based on provided options\n// Currently skips execution if cancelled and implements an optional delay\n//\nconst operate = (operation, callback) => {\n if (!operation.cancel) {\n operation.delay ? setTimeout(callback, operation.delay) : callback()\n return true\n }\n return false\n}\n\n// Dispatch life-cycle events with standardized naming\nconst before = (target, operation) =>\n dispatch(\n target,\n `cable-ready:before-${kebabize(operation.operation)}`,\n operation\n )\n\nconst after = (target, operation) =>\n dispatch(\n target,\n `cable-ready:after-${kebabize(operation.operation)}`,\n operation\n )\n\nfunction debounce (func, timeout) {\n let timer\n return (...args) => {\n clearTimeout(timer)\n timer = setTimeout(() => func.apply(this, args), timeout)\n }\n}\n\nfunction handleErrors (response) {\n if (!response.ok) throw Error(response.statusText)\n return response\n}\n\n// A proxy method to wrap a fetch call in error handling\n//\n// * url - the URL to fetch\n// * additionalHeaders - an object of additional headers passed to fetch\n//\nasync function graciouslyFetch (url, additionalHeaders) {\n try {\n const response = await fetch(url, {\n headers: {\n 'X-REQUESTED-WITH': 'XmlHttpRequest',\n ...additionalHeaders\n }\n })\n if (response == undefined) return\n\n handleErrors(response)\n\n return response\n } catch (e) {\n console.error(`Could not fetch ${url}`)\n }\n}\n\nexport {\n isTextInput,\n assignFocus,\n dispatch,\n xpathToElement,\n getClassNames,\n processElements,\n operate,\n before,\n after,\n debounce,\n handleErrors,\n graciouslyFetch,\n kebabize\n}\n","import { mutableTags } from './enums'\nimport { isTextInput } from './utils'\nimport ActiveElement from './active_element'\n\n// Indicates whether or not we should morph an element via onBeforeElUpdated callback\n// SEE: https://github.com/patrick-steele-idem/morphdom#morphdomfromnode-tonode-options--node\n//\nconst shouldMorph = operation => (fromEl, toEl) => {\n return !shouldMorphCallbacks\n .map(callback => {\n return typeof callback === 'function'\n ? callback(operation, fromEl, toEl)\n : true\n })\n .includes(false)\n}\n\n// Execute any pluggable functions that modify elements after morphing via onElUpdated callback\n//\nconst didMorph = operation => el => {\n didMorphCallbacks.forEach(callback => {\n if (typeof callback === 'function') callback(operation, el)\n })\n}\n\nconst verifyNotMutable = (detail, fromEl, toEl) => {\n // Skip nodes that are equal:\n // https://github.com/patrick-steele-idem/morphdom#can-i-make-morphdom-blaze-through-the-dom-tree-even-faster-yes\n if (!mutableTags[fromEl.tagName] && fromEl.isEqualNode(toEl)) return false\n return true\n}\n\nconst verifyNotContentEditable = (detail, fromEl, toEl) => {\n if (fromEl === ActiveElement.element && fromEl.isContentEditable) return false\n return true\n}\n\nconst verifyNotPermanent = (detail, fromEl, toEl) => {\n const { permanentAttributeName } = detail\n if (!permanentAttributeName) return true\n\n const permanent = fromEl.closest(`[${permanentAttributeName}]`)\n\n // only morph attributes on the active non-permanent text input\n if (!permanent && fromEl === ActiveElement.element && isTextInput(fromEl)) {\n const ignore = { value: true }\n Array.from(toEl.attributes).forEach(attribute => {\n if (!ignore[attribute.name])\n fromEl.setAttribute(attribute.name, attribute.value)\n })\n return false\n }\n\n return !permanent\n}\n\nconst shouldMorphCallbacks = [\n verifyNotMutable,\n verifyNotPermanent,\n verifyNotContentEditable\n]\nconst didMorphCallbacks = []\n\nexport {\n shouldMorphCallbacks,\n didMorphCallbacks,\n shouldMorph,\n didMorph,\n verifyNotMutable,\n verifyNotContentEditable,\n verifyNotPermanent\n}\n","import morphdom from 'morphdom'\nimport { shouldMorph, didMorph } from './morph_callbacks'\nimport {\n assignFocus,\n dispatch,\n getClassNames,\n processElements,\n before,\n after,\n operate\n} from './utils'\n\nexport default {\n // DOM Mutations\n\n append: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { html, focusSelector } = operation\n element.insertAdjacentHTML('beforeend', html || '')\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n graft: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { parent, focusSelector } = operation\n const parentElement = document.querySelector(parent)\n if (parentElement) {\n parentElement.appendChild(element)\n assignFocus(focusSelector)\n }\n })\n after(element, operation)\n })\n },\n\n innerHtml: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { html, focusSelector } = operation\n element.innerHTML = html || ''\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n insertAdjacentHtml: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { html, position, focusSelector } = operation\n element.insertAdjacentHTML(position || 'beforeend', html || '')\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n insertAdjacentText: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { text, position, focusSelector } = operation\n element.insertAdjacentText(position || 'beforeend', text || '')\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n morph: operation => {\n processElements(operation, element => {\n const { html } = operation\n const template = document.createElement('template')\n template.innerHTML = String(html).trim()\n operation.content = template.content\n const parent = element.parentElement\n const ordinal = Array.from(parent.children).indexOf(element)\n before(element, operation)\n operate(operation, () => {\n const { childrenOnly, focusSelector } = operation\n morphdom(\n element,\n childrenOnly ? template.content : template.innerHTML,\n {\n childrenOnly: !!childrenOnly,\n onBeforeElUpdated: shouldMorph(operation),\n onElUpdated: didMorph(operation)\n }\n )\n assignFocus(focusSelector)\n })\n after(parent.children[ordinal], operation)\n })\n },\n\n outerHtml: operation => {\n processElements(operation, element => {\n const parent = element.parentElement\n const ordinal = Array.from(parent.children).indexOf(element)\n before(element, operation)\n operate(operation, () => {\n const { html, focusSelector } = operation\n element.outerHTML = html || ''\n assignFocus(focusSelector)\n })\n after(parent.children[ordinal], operation)\n })\n },\n\n prepend: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { html, focusSelector } = operation\n element.insertAdjacentHTML('afterbegin', html || '')\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n remove: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { focusSelector } = operation\n element.remove()\n assignFocus(focusSelector)\n })\n after(document, operation)\n })\n },\n\n replace: operation => {\n processElements(operation, element => {\n const parent = element.parentElement\n const ordinal = Array.from(parent.children).indexOf(element)\n before(element, operation)\n operate(operation, () => {\n const { html, focusSelector } = operation\n element.outerHTML = html || ''\n assignFocus(focusSelector)\n })\n after(parent.children[ordinal], operation)\n })\n },\n\n textContent: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { text, focusSelector } = operation\n element.textContent = (text != null) ? text : ''\n assignFocus(focusSelector)\n })\n after(element, operation)\n })\n },\n\n // Element Property Mutations\n\n addCssClass: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name } = operation\n element.classList.add(...getClassNames(name || ''))\n })\n after(element, operation)\n })\n },\n\n removeAttribute: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name } = operation\n element.removeAttribute(name)\n })\n after(element, operation)\n })\n },\n\n removeCssClass: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name } = operation\n element.classList.remove(...getClassNames(name))\n })\n after(element, operation)\n })\n },\n\n setAttribute: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name, value } = operation\n element.setAttribute(name, value || '')\n })\n after(element, operation)\n })\n },\n\n setDatasetProperty: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name, value } = operation\n element.dataset[name] = value || ''\n })\n after(element, operation)\n })\n },\n\n setProperty: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name, value } = operation\n if (name in element) element[name] = value || ''\n })\n after(element, operation)\n })\n },\n\n setStyle: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name, value } = operation\n element.style[name] = value || ''\n })\n after(element, operation)\n })\n },\n\n setStyles: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { styles } = operation\n for (let [name, value] of Object.entries(styles))\n element.style[name] = value || ''\n })\n after(element, operation)\n })\n },\n\n setValue: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { value } = operation\n element.value = value || ''\n })\n after(element, operation)\n })\n },\n\n // DOM Events\n\n dispatchEvent: operation => {\n processElements(operation, element => {\n before(element, operation)\n operate(operation, () => {\n const { name, detail } = operation\n dispatch(element, name, detail)\n })\n after(element, operation)\n })\n },\n\n setMeta: operation => {\n before(document, operation)\n operate(operation, () => {\n const { name, content } = operation\n let meta = document.head.querySelector(`meta[name='${name}']`)\n if (!meta) {\n meta = document.createElement('meta')\n meta.name = name\n document.head.appendChild(meta)\n }\n meta.content = content\n })\n after(document, operation)\n },\n\n // Browser Manipulations\n\n clearStorage: operation => {\n before(document, operation)\n operate(operation, () => {\n const { type } = operation\n const storage = type === 'session' ? sessionStorage : localStorage\n storage.clear()\n })\n after(document, operation)\n },\n\n go: operation => {\n before(window, operation)\n operate(operation, () => {\n const { delta } = operation\n history.go(delta)\n })\n after(window, operation)\n },\n\n pushState: operation => {\n before(window, operation)\n operate(operation, () => {\n const { state, title, url } = operation\n history.pushState(state || {}, title || '', url)\n })\n after(window, operation)\n },\n\n redirectTo: operation => {\n before(window, operation)\n operate(operation, () => {\n let { url, action } = operation\n action = action || 'advance'\n if (window.Turbo) window.Turbo.visit(url, { action })\n if (window.Turbolinks) window.Turbolinks.visit(url, { action })\n if (!window.Turbo && !window.Turbolinks) window.location.href = url\n })\n after(window, operation)\n },\n\n reload: operation => {\n before(window, operation)\n operate(operation, () => {\n window.location.reload()\n })\n after(window, operation)\n },\n\n removeStorageItem: operation => {\n before(document, operation)\n operate(operation, () => {\n const { key, type } = operation\n const storage = type === 'session' ? sessionStorage : localStorage\n storage.removeItem(key)\n })\n after(document, operation)\n },\n\n replaceState: operation => {\n before(window, operation)\n operate(operation, () => {\n const { state, title, url } = operation\n history.replaceState(state || {}, title || '', url)\n })\n after(window, operation)\n },\n\n scrollIntoView: operation => {\n const { element } = operation\n before(element, operation)\n operate(operation, () => {\n element.scrollIntoView(operation)\n })\n after(element, operation)\n },\n\n setCookie: operation => {\n before(document, operation)\n operate(operation, () => {\n const { cookie } = operation\n document.cookie = cookie || ''\n })\n after(document, operation)\n },\n\n setFocus: operation => {\n const { element } = operation\n before(element, operation)\n operate(operation, () => {\n assignFocus(element)\n })\n after(element, operation)\n },\n\n setStorageItem: operation => {\n before(document, operation)\n operate(operation, () => {\n const { key, value, type } = operation\n const storage = type === 'session' ? sessionStorage : localStorage\n storage.setItem(key, value || '')\n })\n after(document, operation)\n },\n\n // Notifications\n\n consoleLog: operation => {\n before(document, operation)\n operate(operation, () => {\n const { message, level } = operation\n level && ['warn', 'info', 'error'].includes(level)\n ? console[level](message || '')\n : console.log(message || '')\n })\n after(document, operation)\n },\n\n consoleTable: operation => {\n before(document, operation)\n operate(operation, () => {\n const { data, columns } = operation\n console.table(data, columns || [])\n })\n after(document, operation)\n },\n\n notification: operation => {\n before(document, operation)\n operate(operation, () => {\n const { title, options } = operation\n Notification.requestPermission().then(result => {\n operation.permission = result\n if (result === 'granted') new Notification(title || '', options)\n })\n })\n after(document, operation)\n }\n}\n","import Operations from './operations'\n\nlet operations = Operations\n\nconst add = newOperations => {\n operations = { ...operations, ...newOperations }\n}\n\nconst addOperations = operations => {\n add(operations)\n}\n\nconst addOperation = (name, operation) => {\n const operations = {}\n operations[name] = operation\n\n add(operations)\n}\n\nexport { addOperation, addOperations }\n\nexport default {\n get all () {\n return operations\n }\n}\n","import { xpathToElement, dispatch } from './utils'\n\nimport ActiveElement from './active_element'\nimport OperationStore from './operation_store'\n\nconst perform = (\n operations,\n options = { emitMissingElementWarnings: true }\n) => {\n const batches = {}\n operations.forEach(operation => {\n if (!!operation.batch)\n batches[operation.batch] = batches[operation.batch]\n ? ++batches[operation.batch]\n : 1\n })\n operations.forEach(operation => {\n const name = operation.operation\n try {\n if (operation.selector) {\n operation.element = operation.xpath\n ? xpathToElement(operation.selector)\n : document[\n operation.selectAll ? 'querySelectorAll' : 'querySelector'\n ](operation.selector)\n } else {\n operation.element = document\n }\n if (operation.element || options.emitMissingElementWarnings) {\n ActiveElement.set(document.activeElement)\n const cableReadyOperation = OperationStore.all[name]\n\n if (cableReadyOperation) {\n cableReadyOperation(operation)\n if (!!operation.batch && --batches[operation.batch] === 0)\n dispatch(document, 'cable-ready:batch-complete', {\n batch: operation.batch\n })\n } else {\n console.error(\n `CableReady couldn't find the \"${name}\" operation. Make sure you use the camelized form when calling an operation method.`\n )\n }\n }\n } catch (e) {\n if (operation.element) {\n console.error(\n `CableReady detected an error in ${name || 'operation'}: ${\n e.message\n }. If you need to support older browsers make sure you've included the corresponding polyfills. https://docs.stimulusreflex.com/setup#polyfills-for-ie11.`\n )\n console.error(e)\n } else {\n console.warn(\n `CableReady ${name ||\n 'operation'} failed due to missing DOM element for selector: '${\n operation.selector\n }'`\n )\n }\n }\n })\n}\n\nconst performAsync = (\n operations,\n options = { emitMissingElementWarnings: true }\n) => {\n return new Promise((resolve, reject) => {\n try {\n resolve(perform(operations, options))\n } catch (err) {\n reject(err)\n }\n })\n}\n\nexport { perform, performAsync }\n","let consumer\n\nconst BACKOFF = [25, 50, 75, 100, 200, 250, 500, 800, 1000, 2000]\n\nconst wait = (ms) => new Promise(resolve => setTimeout(resolve, ms))\n\nconst getConsumerWithRetry = async (retry = 0) => {\n if (consumer) return consumer\n\n if (retry >= BACKOFF.length) {\n throw new Error(\"Couldn't obtain a Action Cable consumer within 5s\")\n }\n\n await wait(BACKOFF[retry])\n\n return await getConsumerWithRetry(retry + 1)\n}\n\nexport default {\n setConsumer (value) {\n consumer = value\n },\n\n get consumer () {\n return consumer\n },\n\n async getConsumer () {\n return await getConsumerWithRetry()\n }\n}\n","export default class SubscribingElement extends HTMLElement {\n disconnectedCallback () {\n if (this.channel) this.channel.unsubscribe()\n }\n\n createSubscription (consumer, channel, receivedCallback) {\n this.channel = consumer.subscriptions.create(\n {\n channel,\n identifier: this.identifier\n },\n {\n received: receivedCallback\n }\n )\n }\n\n get preview () {\n return (\n document.documentElement.hasAttribute('data-turbolinks-preview') ||\n document.documentElement.hasAttribute('data-turbo-preview')\n )\n }\n\n get identifier () {\n return this.getAttribute('identifier')\n }\n}\n","import { perform } from '../cable_ready'\nimport SubscribingElement from './subscribing_element'\nimport CableConsumer from '../cable_consumer'\n\nexport default class StreamFromElement extends SubscribingElement {\n async connectedCallback () {\n if (this.preview) return\n\n const consumer = await CableConsumer.getConsumer()\n\n if (consumer) {\n this.createSubscription(\n consumer,\n 'CableReady::Stream',\n this.performOperations\n )\n } else {\n console.error(\n 'The `stream_from` helper cannot connect without an ActionCable consumer.\\nPlease run `rails generate cable_ready:helpers` to fix this.'\n )\n }\n }\n\n performOperations (data) {\n if (data.cableReady) perform(data.operations)\n }\n}\n","import morphdom from 'morphdom'\n\nimport SubscribingElement from './subscribing_element'\n\nimport { shouldMorph } from '../morph_callbacks'\nimport { debounce, assignFocus, dispatch, graciouslyFetch } from '../utils'\n\nimport ActiveElement from '../active_element'\nimport CableConsumer from '../cable_consumer'\n\nconst template = `\n<style>\n :host {\n display: block;\n }\n</style>\n<slot></slot>\n`\n\nfunction url (element) {\n return element.hasAttribute('url')\n ? element.getAttribute('url')\n : location.href\n}\n\nexport default class UpdatesForElement extends SubscribingElement {\n constructor () {\n super()\n const shadowRoot = this.attachShadow({ mode: 'open' })\n shadowRoot.innerHTML = template\n }\n\n async connectedCallback () {\n if (this.preview) return\n this.update = debounce(this.update.bind(this), this.debounce)\n\n const consumer = await CableConsumer.getConsumer()\n\n if (consumer) {\n this.createSubscription(consumer, 'CableReady::Stream', this.update)\n } else {\n console.error(\n 'The `updates-for` helper cannot connect without an ActionCable consumer.\\nPlease run `rails generate cable_ready:helpers` to fix this.'\n )\n }\n }\n\n async update (data) {\n const blocks = Array.from(\n document.querySelectorAll(this.query),\n element => new Block(element)\n )\n\n // first updates-for element in the DOM *at any given moment* updates all of the others\n if (blocks[0].element !== this) return\n\n // hold a reference to the active element so that it can be restored after the morph\n ActiveElement.set(document.activeElement)\n\n // store all retrieved HTML in an object keyed by URL to minimize fetch calls\n this.html = {}\n\n const uniqueUrls = [...new Set(blocks.map(block => block.url))]\n\n await Promise.all(\n uniqueUrls.map(async url => {\n if (!this.html.hasOwnProperty(url)) {\n const response = await graciouslyFetch(url, {\n 'X-Cable-Ready': 'update'\n })\n this.html[url] = await response.text()\n }\n })\n )\n\n // track current block index for each URL; referred to as fragments\n this.index = {}\n\n blocks.forEach(block => {\n // if the block's URL is not in the index, initialize it to 0; otherwise, increment it\n this.index.hasOwnProperty(block.url)\n ? this.index[block.url]++\n : (this.index[block.url] = 0)\n\n block.process(data, this.html, this.index)\n })\n }\n\n get query () {\n return `updates-for[identifier=\"${this.identifier}\"]`\n }\n\n get identifier () {\n return this.getAttribute('identifier')\n }\n\n get debounce () {\n return this.hasAttribute('debounce')\n ? parseInt(this.getAttribute('debounce'))\n : 20\n }\n}\n\nclass Block {\n constructor (element) {\n this.element = element\n }\n\n async process (data, html, index) {\n // with the index incremented, we can now safely bail - before a fetch - if there's no work to be done\n if (!this.shouldUpdate(data)) return\n\n const blockIndex = index[this.url]\n const template = document.createElement('template')\n this.element.setAttribute('updating', 'updating')\n\n template.innerHTML = String(html[this.url]).trim()\n\n await this.resolveTurboFrames(template.content)\n\n const fragments = template.content.querySelectorAll(this.query)\n\n if (fragments.length <= blockIndex) {\n console.warn(\n `Update aborted due to insufficient number of elements. The offending url is ${this.url}.`\n )\n return\n }\n\n const operation = {\n element: this.element,\n html: fragments[blockIndex],\n permanentAttributeName: 'data-ignore-updates'\n }\n\n dispatch(this.element, 'cable-ready:before-update', operation)\n morphdom(this.element, fragments[blockIndex], {\n childrenOnly: true,\n onBeforeElUpdated: shouldMorph(operation),\n onElUpdated: _ => {\n this.element.removeAttribute('updating')\n dispatch(this.element, 'cable-ready:after-update', operation)\n assignFocus(operation.focusSelector)\n }\n })\n }\n\n async resolveTurboFrames (documentFragment) {\n const reloadingTurboFrames = [\n ...documentFragment.querySelectorAll(\n 'turbo-frame[src]:not([loading=\"lazy\"])'\n )\n ]\n\n return Promise.all(\n reloadingTurboFrames.map(frame => {\n return new Promise(async resolve => {\n const frameResponse = await graciouslyFetch(\n frame.getAttribute('src'),\n {\n 'Turbo-Frame': frame.id,\n 'X-Cable-Ready': 'update'\n }\n )\n\n const frameTemplate = document.createElement('template')\n frameTemplate.innerHTML = await frameResponse.text()\n\n // recurse here to get all nested eager loaded frames\n await this.resolveTurboFrames(frameTemplate.content)\n\n documentFragment.querySelector(\n `turbo-frame#${frame.id}`\n ).innerHTML = String(\n frameTemplate.content.querySelector(`turbo-frame#${frame.id}`)\n .innerHTML\n ).trim()\n\n resolve()\n })\n })\n )\n }\n\n shouldUpdate (data) {\n // if everything that could prevent an update is false, update this block\n return !this.ignoresInnerUpdates && this.hasChangesSelectedForUpdate(data)\n }\n\n hasChangesSelectedForUpdate (data) {\n // if there's an only attribute, only update if at least one of the attributes changed is in the allow list\n const only = this.element.getAttribute('only')\n\n return !(\n only &&\n data.changed &&\n !only.split(' ').some(attribute => data.changed.includes(attribute))\n )\n }\n\n get ignoresInnerUpdates () {\n // don't update during a Reflex or Turbolinks redraw\n return (\n this.element.hasAttribute('ignore-inner-updates') &&\n this.element.hasAttribute('performing-inner-update')\n )\n }\n\n get url () {\n return this.element.hasAttribute('url')\n ? this.element.getAttribute('url')\n : location.href\n }\n\n get identifier () {\n return this.element.identifier\n }\n\n get query () {\n return this.element.query\n }\n}\n","export const registerInnerUpdates = () => {\n document.addEventListener('stimulus-reflex:before', event => {\n recursiveMarkUpdatesForElements(event.detail.element)\n })\n\n document.addEventListener('stimulus-reflex:after', event => {\n setTimeout(() => {\n recursiveUnmarkUpdatesForElements(event.detail.element)\n })\n })\n\n document.addEventListener('turbo:submit-start', event => {\n recursiveMarkUpdatesForElements(event.target)\n })\n\n document.addEventListener('turbo:submit-end', event => {\n setTimeout(() => {\n recursiveUnmarkUpdatesForElements(event.target)\n })\n })\n}\n\nconst recursiveMarkUpdatesForElements = leaf => {\n const closestUpdatesFor = leaf && leaf.parentElement.closest('updates-for')\n if (closestUpdatesFor) {\n closestUpdatesFor.setAttribute('performing-inner-update', '')\n recursiveMarkUpdatesForElements(closestUpdatesFor)\n }\n}\n\nconst recursiveUnmarkUpdatesForElements = leaf => {\n const closestUpdatesFor = leaf && leaf.parentElement.closest('updates-for')\n if (closestUpdatesFor) {\n closestUpdatesFor.removeAttribute('performing-inner-update')\n recursiveUnmarkUpdatesForElements(closestUpdatesFor)\n }\n}\n","import packageInfo from '../package.json'\nimport { perform, performAsync } from './cable_ready'\nimport { initialize } from './elements'\nimport { shouldMorphCallbacks, didMorphCallbacks } from './morph_callbacks'\n\nimport * as MorphCallbacks from './morph_callbacks'\nimport * as Utils from './utils'\n\nimport OperationStore, { addOperation, addOperations } from './operation_store'\nimport StreamFromElement from './elements/stream_from_element'\nimport UpdatesForElement from './elements/updates_for_element'\nimport SubscribingElement from './elements/subscribing_element'\nimport CableConsumer from './cable_consumer'\n\nexport {\n Utils,\n MorphCallbacks,\n StreamFromElement,\n UpdatesForElement,\n SubscribingElement\n}\n\nconst global = {\n perform,\n performAsync,\n shouldMorphCallbacks,\n didMorphCallbacks,\n initialize,\n addOperation,\n addOperations,\n version: packageInfo.version,\n cable: CableConsumer,\n get DOMOperations () {\n console.warn(\n 'DEPRECATED: Please use `CableReady.operations` instead of `CableReady.DOMOperations`'\n )\n return OperationStore.all\n },\n get operations () {\n return OperationStore.all\n },\n get consumer () {\n return CableConsumer.consumer\n }\n}\n\nwindow.CableReady = global\n\nexport default global\n","import CableConsumer from '../cable_consumer'\n\nimport StreamFromElement from './stream_from_element'\nimport UpdatesForElement from './updates_for_element'\n\nimport { registerInnerUpdates } from '../updatable/inner_updates_compat'\n\nconst initialize = (initializeOptions = {}) => {\n const { consumer } = initializeOptions\n\n registerInnerUpdates()\n\n if (consumer) {\n CableConsumer.setConsumer(consumer)\n } else {\n console.error(\n 'CableReady requires a reference to your Action Cable `consumer` for its helpers to function.\\nEnsure that you have imported the `CableReady` package as well as `consumer` from your `channels` folder, then call `CableReady.initialize({ consumer })`.'\n )\n }\n\n if (!customElements.get('stream-from')) {\n customElements.define('stream-from', StreamFromElement)\n }\n\n if (!customElements.get('updates-for')) {\n customElements.define('updates-for', UpdatesForElement)\n }\n}\n\nexport { initialize }\n"],"names":["inputTags","INPUT","TEXTAREA","SELECT","mutableTags","OPTION","textInputTypes","color","date","datetime","email","month","number","password","range","search","tel","text","textarea","time","url","week","activeElement","ActiveElement","element","set","isTextInput","tagName","type","assignFocus","selector","focusElement","nodeType","Node","ELEMENT_NODE","document","querySelector","focus","dispatch","name","detail","evt","CustomEvent","bubbles","cancelable","dispatchEvent","window","jQuery","trigger","xpathToElement","xpath","evaluate","XPathResult","FIRST_ORDERED_NODE_TYPE","singleNodeValue","getClassNames","names","Array","flat","processElements","operation","callback","from","selectAll","forEach","kebabize","str","split","map","letter","idx","toUpperCase","toLowerCase","join","operate","cancel","delay","setTimeout","before","target","after","debounce","func","timeout","timer","args","clearTimeout","apply","this","handleErrors","response","ok","Error","statusText","async","graciouslyFetch","additionalHeaders","fetch","headers","undefined","e","console","error","shouldMorph","fromEl","toEl","shouldMorphCallbacks","includes","didMorph","el","didMorphCallbacks","verifyNotMutable","isEqualNode","verifyNotContentEditable","isContentEditable","verifyNotPermanent","permanentAttributeName","permanent","closest","ignore","value","attributes","attribute","setAttribute","Operations","append","html","focusSelector","insertAdjacentHTML","graft","parent","parentElement","appendChild","innerHtml","innerHTML","insertAdjacentHtml","position","insertAdjacentText","morph","template","createElement","String","trim","content","ordinal","children","indexOf","childrenOnly","morphdom","onBeforeElUpdated","onElUpdated","outerHtml","outerHTML","prepend","remove","replace","textContent","addCssClass","classList","add","removeAttribute","removeCssClass","setDatasetProperty","dataset","setProperty","setStyle","style","setStyles","styles","Object","entries","setValue","setMeta","meta","head","clearStorage","sessionStorage","localStorage","clear","go","delta","history","pushState","state","title","redirectTo","action","Turbo","visit","Turbolinks","location","href","reload","removeStorageItem","key","removeItem","replaceState","scrollIntoView","setCookie","cookie","setFocus","setStorageItem","setItem","consoleLog","message","level","log","consoleTable","data","columns","table","notification","options","Notification","requestPermission","then","result","permission","operations","newOperations","OperationStore","all","perform","emitMissingElementWarnings","batches","batch","cableReadyOperation","warn","consumer","BACKOFF","getConsumerWithRetry","retry","length","ms","Promise","resolve","CableConsumer","setConsumer","SubscribingElement","HTMLElement","disconnectedCallback","channel","unsubscribe","createSubscription","receivedCallback","subscriptions","create","identifier","received","preview","documentElement","hasAttribute","getAttribute","StreamFromElement","getConsumer","performOperations","cableReady","UpdatesForElement","constructor","super","attachShadow","mode","update","bind","blocks","querySelectorAll","query","Block","uniqueUrls","Set","block","hasOwnProperty","index","process","parseInt","shouldUpdate","blockIndex","resolveTurboFrames","fragments","_","documentFragment","reloadingTurboFrames","frame","frameResponse","id","frameTemplate","ignoresInnerUpdates","hasChangesSelectedForUpdate","only","changed","some","recursiveMarkUpdatesForElements","leaf","closestUpdatesFor","recursiveUnmarkUpdatesForElements","global","performAsync","reject","err","initialize","initializeOptions","addEventListener","event","customElements","get","define","addOperation","addOperations","version","packageInfo","cable","DOMOperations","CableReady"],"mappings":"2CAAO,MAAMA,EAAY,CACvBC,OAAO,EACPC,UAAU,EACVC,QAAQ,GAGGC,EAAc,CACzBH,OAAO,EACPC,UAAU,EACVG,QAAQ,GAGGC,EAAiB,CAC5B,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,UAAU,EACVC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,UAAU,EACVC,MAAM,EACNC,KAAK,EACLC,MAAM,GC9BR,IAAIC,EAEJ,IAAeC,EAAA,CACTC,cACF,OAAOF,GAETG,IAAKD,GACHF,EAAgBE,ICFpB,MAAME,EAAcF,GACXxB,EAAUwB,EAAQG,UAAYrB,EAAekB,EAAQI,MAOxDC,EAAcC,IAClB,MAIMC,GAHJD,GAAYA,EAASE,WAAaC,KAAKC,aACnCJ,EACAK,SAASC,cAAcN,KACGP,EAAcC,QAC1CO,GAAgBA,EAAaM,OAAON,EAAaM,SASjDC,EAAW,CAACd,EAASe,EAAMC,EAAS,MACxC,MACMC,EAAM,IAAIC,YAAYH,EADf,CAAEI,SAAS,EAAMC,YAAY,EAAMJ,OAAQA,IAExDhB,EAAQqB,cAAcJ,GAClBK,OAAOC,QAAQD,OAAOC,OAAOvB,GAASwB,QAAQT,EAAMC,IAKpDS,EAAiBC,GACdf,SAASgB,SACdD,EACAf,SACA,KACAiB,YAAYC,wBACZ,MACAC,gBAOEC,EAAgBC,GAASC,MAAMD,GAAOE,OAOtCC,EAAkB,CAACC,EAAWC,KAClCJ,MAAMK,KACJF,EAAUG,UAAYH,EAAUpC,QAAU,CAACoC,EAAUpC,UACrDwC,QAAQH,IAKNI,EAAWC,GACRA,EACJC,MAAM,IACNC,KAAI,CAACC,EAAQC,IACLD,EAAOE,gBAAkBF,EAC5B,GAAW,IAARC,EAAY,IAAM,KAAKD,EAAOG,g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