turbo_boost-elements 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f8ac3dacb38451c6da9d96c0f86980a949392c981982319a358297607f081ee
4
- data.tar.gz: 97fd8cb91d843b33bba9838d14fb48c237eaf29bcba1cf36fb775026cbcb44a3
3
+ metadata.gz: 85e407fb37fba9803a7f0e752a0cb44db5cec3075b707a0cc1bd427a5e2b5f85
4
+ data.tar.gz: 9db8b25a35ab39d05a6ad8a6bf37570db9e5edc6ea0c3b255a1fb5ba907befb6
5
5
  SHA512:
6
- metadata.gz: 8a7ada648f5aaed6a6fb753a05366b47b59adcc4b8438a814c343d0b7758ef1a94f0f1b1eedb25137a7cd3c5ecb7f3017f8b73672976d7b0d5580aec98dae46c
7
- data.tar.gz: d33d811f419a4abaed29017bff59b559ca34b93a09e3a5af8547673cff1f96e70413dc8c66dba5f7a2068de2b7b224544bbf8366312e1813815bbef714faba47
6
+ metadata.gz: c609c49ac6331f521029838cf5c4ba0272b423d9632568be15fbe1235db7c6f70c4396163ce01ad36d75f73918d4eef2ab4d93071a56c3e5016e2fda8914c32e
7
+ data.tar.gz: 9c9bab6ed2ebb5134a3a9c06c1b7e56bba1e7f33c5423ac4f21476a1f468e9fd3e41089b3751e25f45ae092b138b09336f49981377506c9d7938f11c131e70bc
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </h1>
5
5
  <p align="center">
6
6
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
7
- <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1378-47d299.svg" />
7
+ <img alt="Lines of Code" src="https://img.shields.io/badge/loc-574-47d299.svg" />
8
8
  </a>
9
9
  <a href="https://codeclimate.com/github/hopsoft/turbo_boost-elements/maintainability">
10
10
  <img src="https://api.codeclimate.com/v1/badges/7aac6daed3e4032e292e/maintainability" />
@@ -78,12 +78,12 @@ Pre-built easy to use reactive TurboBoost elements for Rails/Hotwire apps.
78
78
 
79
79
  ## Dependencies
80
80
 
81
- - [ruby](https://www.ruby-lang.org/) `>=2.7.3`
82
- - [rails](https://rubygems.org/gems/rails) `>=6.1`
83
- - [turbo-rails](https://rubygems.org/gems/turbo-rails) `>=1.1`
84
- - [@hotwired/turbo](https://yarnpkg.com/package/@hotwired/turbo) `>=7.2.0`
85
- - [@hotwired/turbo-rails](https://yarnpkg.com/package/@hotwired/turbo-rails) `>=7.2.0`
86
- - [turbo_boost-commands](https://github.com/hopsoft/turbo_boost-commands) `>=0.0.2`
81
+ - [ruby](https://www.ruby-lang.org/) `>= 3.0`
82
+ - [rails](https://rubygems.org/gems/rails) `>= 6.1`
83
+ - [turbo-rails](https://rubygems.org/gems/turbo-rails) `>= 1.1`
84
+ - [@hotwired/turbo-rails](https://www.npmjs.com/package/@hotwired/turbo-rails) `>= 7.2`
85
+ - [turbo_boost-commands](https://rubygems.org/gems/turbo_boost-commands) `>= 0.1.1`
86
+ - [@turbo-boost/commands](https://www.npmjs.com/package/@turbo-boost/commands) `>= 0.1.1`
87
87
 
88
88
  ## Setup
89
89
 
@@ -195,14 +195,16 @@ TurboBoost.devtools.start()
195
195
 
196
196
  ## Releasing
197
197
 
198
- 1. Run `yarn` and `bundle` to pick up the latest
199
- 1. Bump version number at `lib/turbo_boost/elements/version.rb`. Pre-release versions use `.preN`
198
+ 1. Run `npm install` and `bundle` to pick up the latest
199
+ 1. Update the version number consistently in the following files:
200
+ * `lib/turbo_boost/elements/version.rb` - pre-release versions should use `.preN`
201
+ * `app/javascript/version.js` - pre-release versions use `-preN`
202
+ * `package.json` - pre-release versions use `-preN`
200
203
  1. Run `bin/standardize`
201
- 1. Run `rake build` and `yarn build`
204
+ 1. Run `rake build` and `npm run build`
202
205
  1. Commit and push changes to GitHub
203
206
  1. Run `rake release`
204
- 1. Run `yarn publish --no-git-tag-version --access public`
205
- 1. Yarn will prompt you for the new version. Pre-release versions use `-preN`
207
+ 1. Run `npm publish --access public`
206
208
  1. Commit and push changes to GitHub
207
209
  1. Create a new release on GitHub ([here](https://github.com/hopsoft/turbo_boost-elements/releases)) and generate the changelog for the stable release for it
208
210
 
@@ -1,4 +1,4 @@
1
- var De=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,ie=(e,t,o)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,l=(e,t)=>{for(var o in t||(t={}))Re.call(t,o)&&ie(e,o,t[o]);if(se)for(var o of se(t))je.call(t,o)&&ie(e,o,t[o]);return e},p=(e,t)=>Be(e,He(t)),Me=class{get element(){return document.querySelector('meta[name="turbo-boost"]')}get token(){return this.element.getAttribute("content")}get busy(){return this.element.dataset.busy==="true"}set busy(e){return this.element.dataset.busy=!!e}},u=new Me,c={start:"turbo-boost:command:start",success:"turbo-boost:command:success",finish:"turbo-boost:command:finish",abort:"turbo-boost:command:abort",clientError:"turbo-boost:command:client-error",serverError:"turbo-boost:command:server-error"},f={stateLoad:"turbo-boost:state:load",stateChange:"turbo-boost:state:change"},h=l(l({},c),f);function m(e,t,o={}){return new Promise(r=>{o=o||{},o.detail=o.detail||{},t=t||document;let n=new CustomEvent(e,p(l({},o),{bubbles:!0}));t.dispatchEvent(n),r(n)})}var N;function R(e,t=null){if(!e||typeof e!="object")return e;let o=new Proxy(e,{deleteProperty(r,n){return delete r[n],m(f.stateChange,u.element,{detail:{state:N}}),!0},set(r,n,s,i){return r[n]=R(s,this),m(f.stateChange,u.element,{detail:{state:N}}),!0}});if(Array.isArray(e))e.forEach((r,n)=>e[n]=R(r,o));else if(typeof e=="object")for(let[r,n]of Object.entries(e))e[r]=R(n,o);return t||(N=o),o}var qe=R,W,E,C,le;function ce(){if(!u.element)return w();let e=atob(u.element.dataset.state);C={},E=qe(JSON.parse(e)),W=l({},E),delete u.element.dataset.clientStateChange,setTimeout(()=>m(f.stateLoad,u.element,{detail:{state:E}}))}function w(){clearTimeout(le),le=setTimeout(ce,10)}W||ce();addEventListener("DOMContentLoaded",w);addEventListener("load",w);addEventListener("turbo:load",w);addEventListener("turbo:frame-load",w);addEventListener(c.success,w);addEventListener(f.stateChange,e=>{C={};for(let[t,o]of Object.entries(E))W[t]!==o&&(C[t]=o);u.element.dataset.clientStateChange=!0,u.element.dataset.state=btoa(JSON.stringify(E))});var j={events:f,get current(){return E},get delta(){return C},get payloadChunks(){return btoa(JSON.stringify(C)).match(/.{1,2000}/g)}};function Pe(e){let t="<html",o="</html",r=e.indexOf(t),n=e.lastIndexOf(o);if(r>=0&&n>=0){let s=e.slice(e.indexOf(">",r)+1,n);document.documentElement.innerHTML=s}}function Ne(e){document.body.insertAdjacentHTML("beforeend",e)}var A={append:Ne,replaceDocument:Pe},M={};function Ie(e){M[e.id]=e}function ze(e){delete M[e]}var me={add:Ie,remove:ze,get commands(){return[...Object.values(M)]},get length(){return Object.keys(M).length}};function he(e){e.detail.endedAt=Date.now(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>m(c.finish,e.target,{detail:e.detail}),25)}addEventListener(c.serverError,he);addEventListener(c.success,he);addEventListener(c.finish,e=>me.remove(e.detail.id),!0);var X={events:c},z={};addEventListener("turbo:before-fetch-request",e=>{let t=e.target.closest("turbo-frame"),{fetchOptions:o}=e.detail;if(u.busy){let r=["text/vnd.turbo-boost.html",o.headers.Accept];r=r.filter(n=>n&&n.trim().length>0).join(", "),o.headers.Accept=r,o.headers["TurboBoost-Token"]=u.token}j.payloadChunks.forEach((r,n)=>{o.headers[`TurboBoost-State-${n.toString().padStart(4,"0")}`]=r})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:o}=e.detail;if(t&&(z[t.id]=t.src),o.header("TurboBoost")){if(o.statusCode<200||o.statusCode>399){let r=`Server returned a ${o.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`;m(X.events.clientError,document,{detail:p(l({},e.detail),{error:r})},!0)}o.header("TurboBoost")==="Append"&&(e.preventDefault(),o.responseText.then(r=>A.append(r)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboBoostSrc=z[t.id]||t.src||t.dataset.turboBoostSrc,delete z[t.id]});var _e={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",commandAttribute:"data-turbo-command",confirmAttribute:"data-turbo-confirm",turboSubmitStartEvent:"turbo:submit-start"},d=l({},_e),ge={method:e=>Promise.resolve(confirm(e))},Fe=e=>e.detail.driver==="method",We=e=>{if(e.detail.driver!=="form")return!1;let t=e.target,o=t.closest("turbo-frame"),r=t.closest(`[${d.frameAttribute}]`);return!!(o||r)},Xe=e=>Fe(e)||We(e);document.addEventListener(c.start,async e=>{let t=e.target.getAttribute(d.confirmAttribute);!t||(e.detail.confirmation=!0,Xe(e))||await ge.method(t)||e.preventDefault()});var Je=ge,b=[],_;function Ge(e,t){let o=b.find(r=>r.name===e);return o&&b.splice(b.indexOf(o),1),b=[{name:e,selectors:t},...b],document.removeEventListener(e,_,!0),document.addEventListener(e,_,!0),l({},b.find(r=>r.name===e))}function Ue(e){return b.find(t=>t.selectors.find(o=>Array.from(document.querySelectorAll(o)).find(r=>r===e)))}function Ve(e,t){let o=Ue(t);return o&&o.name===e}var g={register:Ge,isRegisteredForElement:Ve,get events(){return[...b]},set handler(e){_=e}};function Ke(e){return e.closest(`[${d.commandAttribute}]`)}function Ye(e){return e.closest("turbo-frame[src]")||e.closest("turbo-frame[data-turbo-frame-src]")||e.closest("turbo-frame")}function Qe(e,t={}){if(e.tagName.toLowerCase()!=="select")return t.value=e.value||null;if(!e.multiple)return t.value=e.options[e.selectedIndex].value;t.values=Array.from(e.options).reduce((o,r)=>(r.selected&&o.push(r.value),o),[])}function Ze(e){let t=Array.from(e.attributes).reduce((o,r)=>{let n=r.value;return o[r.name]=n,o},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,Qe(e,t),delete t.class,delete t.action,delete t.href,delete t[d.commandAttribute],delete t[d.frameAttribute],t}var J={buildAttributePayload:Ze,findClosestCommand:Ke,findClosestFrameWithSource:Ye};function et(e){var t;if((e==null?void 0:e.formElement)instanceof HTMLFormElement&&(e==null?void 0:e.body)instanceof URLSearchParams&&((t=e==null?void 0:e.fetchRequest)==null?void 0:t.body)instanceof URLSearchParams){e.formData=new FormData(e.formElement);for(let[o,r]of e.formData.entries())e.fetchRequest.body.set(o,r),e.body.set(o,r);return e}}function tt(e,t={},o={}){t.token=u.token;let r=e.querySelector('input[name="turbo_boost_command"]')||document.createElement("input");r.type="hidden",r.name="turbo_boost_command",r.value=JSON.stringify(t),e.appendChild(r),et(o.detail.formSubmission)}var ot={invokeCommand:tt};function rt(e,t={}){let o=document.createElement("a");o.href=e;let r=new URL(o);return r.searchParams.set("turbo_boost_command",JSON.stringify(t)),r}var G={build:rt};function nt(e,t){let o=t.src;t=l({},t),delete t.src,e.src=G.build(o,t)}var ae={invokeCommand:nt};function st(e,t={}){let o=t.src;t=l({},t),delete t.src,delete t.href,e.setAttribute("href",G.build(o,t))}var it={invokeCommand:st};function lt(e){let t=e.target;m(X.events.abort,document,{detail:p(l({},e.detail),{xhr:t})})}function F(e){let t=e.target;t.getResponseHeader("TurboBoost")==="Append"||t.getResponseHeader("Content-Type").startsWith("text/vnd.turbo-boost.html")?A.append(t.responseText):A.replaceDocument(t.responseText);let o=`Server returned a ${t.status} status code! TurboBoost Commands require 2XX-3XX status codes.`;m(X.events.clientError,document,{detail:p(l({},e.detail),{error:o,xhr:t})},!0)}function at(e){let t=e.target;if(t.status<200||t.status>399)return F(e);let o=t.responseText;t.getResponseHeader("TurboBoost")==="Append"||t.getResponseHeader("Content-Type").startsWith("text/vnd.turbo-boost.html")?A.append(t.responseText):A.replaceDocument(t.responseText)}function dt(e){let t=e.src;e=l({},e),delete e.src;try{let o=new XMLHttpRequest;o.open("GET",G.build(t,e),!0),o.setRequestHeader("Accept","text/vnd.turbo-boost.html, text/html, application/xhtml+xml"),o.setRequestHeader("TurboBoost-Token",u.token),j.payloadChunks.forEach((r,n)=>o.setRequestHeader(`TurboBoost-State-${n.toString().padStart(4,"0")}`,r)),o.addEventListener("abort",lt),o.addEventListener("error",F),o.addEventListener("load",at),o.send()}catch(o){let r=`Unexpected error sending HTTP request! ${o.message}`;F(o,{detail:{message:r}})}}var ut={invokeCommand:dt};function I(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboBoostSrc||location.href}function ct(e){let t=J.findClosestFrameWithSource(e),{turboFrame:o,turboMethod:r}=e.dataset;return e.tagName.toLowerCase()==="form"?{name:"form",reason:"Element is a form.",frame:t,src:e.action,invokeCommand:ot.invokeCommand}:r&&r.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeCommand:it.invokeCommand}:o&&o!=="_self"?(t=document.getElementById(o),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:I(e,t),invokeCommand:ae.invokeCommand}):(!o||o==="_self")&&t?{name:"frame",reason:"element does NOT target a frame or targets _self and is contained by a frame",frame:t,src:I(e,t),invokeCommand:ae.invokeCommand}:{name:"window",reason:"element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)",frame:null,src:I(e),invokeCommand:ut.invokeCommand}}var de={find:ct},q="unknown",be={debug:Object.values(h),info:Object.values(h),warn:[h.abort,h.clientError,h.serverError],error:[h.clientError,h.serverError],unknown:[]};Object.values(h).forEach(e=>{addEventListener(e,t=>{if(be[q].includes(t.type)){let{target:o,detail:r}=t;console[q](t.type,{target:o,detail:r})}})});var mt={get level(){return q},set level(e){return Object.keys(be).includes(e)||(e="unknown"),q=e}};function ht(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var gt={v4:ht};function ue(e,t){return{id:e,name:t.getAttribute(d.commandAttribute),elementId:t.id.length>0?t.id:null,elementAttributes:J.buildAttributePayload(t),startedAt:Date.now()}}async function bt(e){let t,o={};try{if(t=J.findClosestCommand(e.target),!t||!g.isRegisteredForElement(e.type,t))return;let r=`turbo-command-${gt.v4()}`,n=de.find(t),s=p(l({},ue(r,t)),{driver:n.name,frameId:n.frame?n.frame.id:null,src:n.src}),i=await m(c.start,t,{cancelable:!0,detail:s});if(i.defaultPrevented||i.detail.confirmation&&e.defaultPrevented)return m(c.abort,t,{detail:{message:`An event handler for '${c.start}' prevented default behavior and blocked command invocation!`,source:i}});switch(n=de.find(t),s=p(l({},ue(r,t)),{driver:n.name,frameId:n.frame?n.frame.id:null,src:n.src}),me.add(s),["frame","window"].includes(n.name)&&e.preventDefault(),u.busy=!0,setTimeout(()=>u.busy=!1,10),n.name){case"method":return n.invokeCommand(t,s);case"form":return n.invokeCommand(t,s,e);case"frame":return n.invokeCommand(n.frame,s);case"window":return n.invokeCommand(s)}}catch(r){m(c.clientError,t,{detail:p(l({},o),{error:r})})}}self.TurboBoost=self.TurboBoost||{};self.TurboBoost=p(l({},self.TurboBoost),{stateEvents:f,get state(){return j.current},get stateDelta(){return j.delta}});self.TurboBoost.Commands||(g.handler=bt,g.register("click",[`[${d.commandAttribute}]`]),g.register("submit",[`form[${d.commandAttribute}]`]),g.register(d.turboSubmitStartEvent,[`form[${d.commandAttribute}]`]),g.register("change",[`input[${d.commandAttribute}]`,`select[${d.commandAttribute}]`,`textarea[${d.commandAttribute}]`]),self.TurboBoost.Commands={confirmation:Je,logger:mt,schema:d,events:c,registerEventDelegate:g.register,get eventDelegates(){return g.events}});var Nt=self.TurboBoost.Commands;var pt=Object.defineProperty,ft=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,fe=(e,t,o)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))yt.call(t,o)&&fe(e,o,t[o]);if(pe)for(var o of pe(t))Et.call(t,o)&&fe(e,o,t[o]);return e},k=(e,t)=>ft(e,vt(t));function wt(e){let t=document.createElement("template");return t.innerHTML=e,t}function ee(e,t){t=t||document.body;let o=wt(e).content.cloneNode(!0).querySelector("*");return t.appendChild(o)}function U(e,t={}){if(!e)return;Q(e);let{outline:o,outlineOffset:r}=t;o=o||"dashed 3px red",r=r||"0px",e.originalStyles=e.originalStyles||{display:e.style.display,minHeight:e.style.minHeight,minWidth:e.style.minWidth,outline:e.style.outline,outlineOffset:e.style.outlineOffset},getComputedStyle(e).display.match(/^inline$/i)&&e.offsetWidth===0&&e.offsetHeight===0&&(e.style.display="inline-block",e.style.minHeight="2px",e.style.minWidth="2px"),e.style.outline=o,e.style.outlineOffset=r,e.dataset.turboBoostHighlight=!0}function Q(e){if(e){if(e.originalStyles){for(let[t,o]of Object.entries(e.originalStyles))o?e.style[t]=o:e.style[t]="";delete e.originalStyles}delete e.dataset.turboBoostHighlight}}function V(e){if(!e)return{};let t=e.getBoundingClientRect(),o=e.offsetWidth,r=e.offsetHeight,n=t.top+window.scrollY,s=t.left+window.scrollX,i=s+o,L=n+r;return{top:n,left:s,right:i,bottom:L,width:o,height:r}}function $(e){try{e()}catch(t){}}var Tt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html,this.labelElement.addEventListener("click",e=>{e.preventDefault(),this.toggle()}),this.checkboxElement.addEventListener("change",e=>this.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}toggle(){this.checked?this.uncheck():this.check()}check(){this.checkboxElement.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}uncheck(){this.checkboxElement.checked=!1,this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}get name(){return this.getAttribute("name")}get checked(){return this.checkboxElement.checked}get checkboxElement(){return this.shadowRoot.querySelector("input")}get labelElement(){return this.shadowRoot.querySelector("label")}get html(){return`
1
+ import"@turbo-boost/commands";var K=Object.defineProperty,U=Object.defineProperties,X=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,H=(t,e,o)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,c=(t,e)=>{for(var o in e||(e={}))Y.call(e,o)&&H(t,o,e[o]);if(O)for(var o of O(e))Q.call(e,o)&&H(t,o,e[o]);return t},h=(t,e)=>U(t,X(e)),Z="0.0.6";function ee(t){let e=document.createElement("template");return e.innerHTML=t,e}function $(t,e){e=e||document.body;let o=ee(t).content.cloneNode(!0).querySelector("*");return e.appendChild(o)}function w(t,e={}){if(!t)return;L(t);let{outline:o,outlineOffset:r}=e;o=o||"dashed 3px red",r=r||"0px",t.originalStyles=t.originalStyles||{display:t.style.display,minHeight:t.style.minHeight,minWidth:t.style.minWidth,outline:t.style.outline,outlineOffset:t.style.outlineOffset},getComputedStyle(t).display.match(/^inline$/i)&&t.offsetWidth===0&&t.offsetHeight===0&&(t.style.display="inline-block",t.style.minHeight="2px",t.style.minWidth="2px"),t.style.outline=o,t.style.outlineOffset=r,t.dataset.turboBoostHighlight=!0}function L(t){if(t){if(t.originalStyles){for(let[e,o]of Object.entries(t.originalStyles))o?t.style[e]=o:t.style[e]="";delete t.originalStyles}delete t.dataset.turboBoostHighlight}}function k(t){if(!t)return{};let e=t.getBoundingClientRect(),o=t.offsetWidth,r=t.offsetHeight,s=e.top+window.scrollY,i=e.left+window.scrollX,n=i+o,g=s+r;return{top:s,left:i,right:n,bottom:g,width:o,height:r}}function b(t){try{t()}catch(e){}}var te=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html,this.labelElement.addEventListener("click",t=>{t.preventDefault(),this.toggle()}),this.checkboxElement.addEventListener("change",t=>this.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}toggle(){this.checked?this.uncheck():this.check()}check(){this.checkboxElement.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}uncheck(){this.checkboxElement.checked=!1,this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}get name(){return this.getAttribute("name")}get checked(){return this.checkboxElement.checked}get checkboxElement(){return this.shadowRoot.querySelector("input")}get labelElement(){return this.shadowRoot.querySelector("label")}get html(){return`
2
2
  <style>${this.stylesheet}</style>
3
3
  <div>
4
4
  <input name="checkbox" type="checkbox">
@@ -21,7 +21,7 @@ var De=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnProperty
21
21
  label {
22
22
  color: black;
23
23
  }
24
- `}},kt=class extends HTMLElement{constructor(){super(),this.enabledDevtools={},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html,this.shadowRoot.querySelector("button").addEventListener("click",()=>this.dispatchEvent(new CustomEvent("turbo-boost:devtools-close",{bubbles:!0}))),this.addEventListener("change",e=>{let t=e.target,{checked:o,name:r}=t;o?this.enableDevtool(r):this.disableDevtool(r)})}enableDevtool(e){this.enabledDevtools[e]||(this.enabledDevtools[e]=!0,this.dispatchEvent(new CustomEvent("turbo-boost:devtool-enable",{bubbles:!0,detail:{name:e}})))}disableDevtool(e){this.enabledDevtools[e]&&(delete this.enabledDevtools[e],this.dispatchEvent(new CustomEvent("turbo-boost:devtool-disable",{bubbles:!0,detail:{name:e}})))}close(){this.devtoolElements.forEach(e=>{e.checked&&e.uncheck()}),this.remove()}get devtoolElements(){return this.querySelectorAll('[slot="devtool"]')}get closeElement(){return this.querySelector("button")}get html(){return`
24
+ `}},oe=class extends HTMLElement{constructor(){super(),this.enabledDevtools={},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html,this.shadowRoot.querySelector("button").addEventListener("click",()=>this.dispatchEvent(new CustomEvent("turbo-boost:devtools-close",{bubbles:!0}))),this.addEventListener("change",t=>{let e=t.target,{checked:o,name:r}=e;o?this.enableDevtool(r):this.disableDevtool(r)})}enableDevtool(t){this.enabledDevtools[t]||(this.enabledDevtools[t]=!0,this.dispatchEvent(new CustomEvent("turbo-boost:devtool-enable",{bubbles:!0,detail:{name:t}})))}disableDevtool(t){this.enabledDevtools[t]&&(delete this.enabledDevtools[t],this.dispatchEvent(new CustomEvent("turbo-boost:devtool-disable",{bubbles:!0,detail:{name:t}})))}close(){this.devtoolElements.forEach(t=>{t.checked&&t.uncheck()}),this.remove()}get devtoolElements(){return this.querySelectorAll('[slot="devtool"]')}get closeElement(){return this.querySelector("button")}get html(){return`
25
25
  <style>${this.stylesheet}</style>
26
26
  <div>
27
27
  <img src="https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342">
@@ -89,7 +89,7 @@ var De=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnProperty
89
89
  button:hover {
90
90
  opacity: 1;
91
91
  }
92
- `}},xt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html}connectedCallback(){let e=localStorage.getItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`);e&&(this.style.transform=e)}disconnectedCallback(){this.id!=="undefined"&&this.id!==""&&localStorage.setItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`,this.style.transform)}get color(){return this.getAttribute("color")||"darkslategray"}get backgroundColor(){return this.getAttribute("background-color")||"gainsboro"}get position(){return this.getAttribute("position")||"top"}get html(){return`
92
+ `}},re=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.html}connectedCallback(){let t=localStorage.getItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`);t&&(this.style.transform=t)}disconnectedCallback(){this.id!=="undefined"&&this.id!==""&&localStorage.setItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`,this.style.transform)}get color(){return this.getAttribute("color")||"darkslategray"}get backgroundColor(){return this.getAttribute("background-color")||"gainsboro"}get position(){return this.getAttribute("position")||"top"}get html(){return`
93
93
  <style>${this.stylesheet}</style>
94
94
  <div role="container">
95
95
  <div role="title">
@@ -183,38 +183,38 @@ var De=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnProperty
183
183
  slot[name="content-bottom"] {
184
184
  color: red;
185
185
  }
186
- `}},x=[],Lt={LeaderLine:{src:"https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js",integrity:"sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==",global:"LeaderLine"},PlainDraggable:{src:"https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js",global:"PlainDraggable"}};function St(e){return e.global&&self[e.global]||document.querySelector(`[src='${e.src}']`)?!0:x.includes(e)}function Ct(e){if(St(e))return;x.push(e);let{src:t,integrity:o}=e,r=document.createElement("script");r.setAttribute("src",t),r.setAttribute("crossorigin","anonymous"),r.setAttribute("referrerpolicy","no-referrer"),o&&r.setAttribute("integrity",o),document.head.appendChild(r)}function ye(e){if(!x.includes(e))return;x.splice(x.indexOf(e),1);let{src:t}=e,o=document.querySelector(`script[src='${t}']`);o&&o.remove(),e.global&&self[e.global]&&(self[e.global]=null)}function At(){[...x].forEach(e=>ye(e))}var O=k(T({},Lt),{add:Ct,remove:ye,removeAll:At});customElements.define("turbo-boost-devtool",Tt);customElements.define("turbo-boost-devtool-supervisor",kt);customElements.define("turbo-boost-devtool-tooltip",xt);var a;function Ee(){if(a)try{new PlainDraggable(a)}catch(e){setTimeout(Ee,200)}}function te(){Te()||(a.close(),a.dispatchEvent(new CustomEvent("turbo-boost:devtools-stop",{bubbles:!0})),a=null,O.removeAll())}function we(){P()||(O.add(O.LeaderLine),O.add(O.PlainDraggable),a=ee("<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>"),setTimeout(Ee,200),a.dispatchEvent(new CustomEvent("turbo-boost:devtools-start",{bubbles:!0})))}function $t(){let e=a?Object.keys(a.enabledDevtools):[];te(),we(),a.devtoolElements.forEach(t=>{e.includes(t.name)&&t.check()})}function P(){return!!a}function Te(){return!P()}var ve;function ke(){clearTimeout(ve),ve=setTimeout($t,25)}function D(){P()&&ke()}addEventListener("turbo:load",D);addEventListener("turbo-frame:load",D);addEventListener("turbo-boost:devtools-connect",D);addEventListener("turbo-boost:devtools-close",te);window.TurboBoost&&(addEventListener(TurboBoost.Commands.events.success,D),addEventListener(TurboBoost.Commands.events.finish,D));function Ot(e,t){if(a)return ee(`
187
- <turbo-boost-devtool name="${e}" slot="devtool">
188
- <span slot="label">${t}</span>
186
+ `}},u=[],ie={LeaderLine:{src:"https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js",integrity:"sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==",global:"LeaderLine"},PlainDraggable:{src:"https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js",global:"PlainDraggable"}};function se(t){return t.global&&self[t.global]||document.querySelector(`[src='${t.src}']`)?!0:u.includes(t)}function le(t){if(se(t))return;u.push(t);let{src:e,integrity:o}=t,r=document.createElement("script");r.setAttribute("src",e),r.setAttribute("crossorigin","anonymous"),r.setAttribute("referrerpolicy","no-referrer"),o&&r.setAttribute("integrity",o),document.head.appendChild(r)}function M(t){if(!u.includes(t))return;u.splice(u.indexOf(t),1);let{src:e}=t,o=document.querySelector(`script[src='${e}']`);o&&o.remove(),t.global&&self[t.global]&&(self[t.global]=null)}function ne(){[...u].forEach(t=>M(t))}var p=h(c({},ie),{add:le,remove:M,removeAll:ne});customElements.define("turbo-boost-devtool",te);customElements.define("turbo-boost-devtool-supervisor",oe);customElements.define("turbo-boost-devtool-tooltip",re);var l;function j(){if(l)try{new PlainDraggable(l)}catch(t){setTimeout(j,200)}}function A(){N()||(l.close(),l.dispatchEvent(new CustomEvent("turbo-boost:devtools-stop",{bubbles:!0})),l=null,p.removeAll())}function I(){y()||(p.add(p.LeaderLine),p.add(p.PlainDraggable),l=$("<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>"),setTimeout(j,200),l.dispatchEvent(new CustomEvent("turbo-boost:devtools-start",{bubbles:!0})))}function ae(){let t=l?Object.keys(l.enabledDevtools):[];A(),I(),l.devtoolElements.forEach(e=>{t.includes(e.name)&&e.check()})}function y(){return!!l}function N(){return!y()}var R;function q(){clearTimeout(R),R=setTimeout(ae,25)}function v(){y()&&q()}addEventListener("turbo:load",v);addEventListener("turbo-frame:load",v);addEventListener("turbo-boost:devtools-connect",v);addEventListener("turbo-boost:devtools-close",A);window.TurboBoost&&(addEventListener(TurboBoost.Commands.events.success,v),addEventListener(TurboBoost.Commands.events.finish,v));function de(t,e){if(l)return $(`
187
+ <turbo-boost-devtool name="${t}" slot="devtool">
188
+ <span slot="label">${e}</span>
189
189
  </turbo-boost-devtool>
190
- `,a)}function Dt(e){return a?a.enabledDevtools[e]:!1}var Z={enabled:Dt,register:Ot,start:we,stop:te,restart:ke,get started(){return P()},get stopped(){return Te()}};function K(e,t,o,r={}){let{backgroundColor:n,color:s,position:i,id:L}=r;return s=s||"white",i=i||"top",ee(`
191
- <turbo-boost-devtool-tooltip id="${L}" position="${i}" background-color="${n}" color="${s}">
192
- <div slot='title'>${e}</div>
193
- <div slot='subtitle'>${t}</div>
190
+ `,l)}function ce(t){return l?l.enabledDevtools[t]:!1}var S={enabled:ce,register:de,start:I,stop:A,restart:q,get started(){return y()},get stopped(){return N()}};function x(t,e,o,r={}){let{backgroundColor:s,color:i,position:n,id:g}=r;return i=i||"white",n=n||"top",$(`
191
+ <turbo-boost-devtool-tooltip id="${g}" position="${n}" background-color="${s}" color="${i}">
192
+ <div slot='title'>${t}</div>
193
+ <div slot='subtitle'>${e}</div>
194
194
  ${o}
195
195
  </turbo-boost-devtool-tooltip>
196
- `)}var Y,oe=class{constructor(e){this.delegate=e;let t,o=()=>{clearTimeout(t),t=setTimeout(this.hide({active:!1}),25)};this.eventListeners["turbo-boost:devtool-enable"]=r=>{let{name:n}=r.detail;n===this.delegate.name&&(U(this.delegate.triggerElement,{outline:"3px dashed blueviolet",outlineOffset:"2px"}),this.hide({active:!1}),this.active&&this.show())},this.eventListeners["turbo-boost:devtool-disable"]=r=>{let{name:n}=r.detail;n===this.delegate.name&&Q(this.delegate.triggerElement)},this.eventListeners.click=r=>{r.target.closest("turbo-boost-devtool-tooltip")||o()},this.eventListeners["turbo:load"]=o,this.eventListeners["turbo-frame:load"]=o,window.TurboBoost&&(this.eventListeners[TurboBoost.Commands.events.finish]=o),this.registerEventListeners()}registerEventListeners(){Object.entries(this.eventListeners).forEach(([e,t])=>{addEventListener(e,t)})}unregisterEventListeners(){Object.entries(this.eventListeners).forEach(([e,t])=>{removeEventListener(e,t)})}get eventListeners(){return this._eventListeners||(this._eventListeners={})}show(){if(!this.enabled||this.active)return;this.active=!0,this.hide({active:!0}),U(this.delegate.targetElement,{outline:"3px dashed darkcyan",outlineOffset:"-2px"}),U(this.delegate.morphElement,{outline:"3px dashed chocolate",outlineOffset:"3px"}),this.renderingTooltip=this.createRenderingTooltip(),this.targetTooltip=this.createTargetTooltip(),this.triggerTooltip=this.createTriggerTooltip(this.targetTooltip,this.renderingTooltip),document.querySelectorAll(".leader-line").forEach(t=>t.style.zIndex=1e5);let e={morph:{partial:this.delegate.triggerElement.renders,id:this.delegate.triggerElement.morphs,status:this.delegate.morphElement?"OK":"Not Found"},trigger:{partial:null,id:null,status:"Not Found"},target:{partial:null,id:null,status:"Not Found"}};this.delegate.triggerElement&&(e.trigger={partial:this.delegate.triggerElement.partial,id:this.delegate.triggerElement.id,status:"OK"},e.target.id=this.delegate.triggerElement.controls),this.delegate.targetElement&&(e.target={partial:this.delegate.targetElement.partial,dom_id:this.delegate.targetElement.id,status:"OK"}),console.table(e)}hide({active:e=!1}){document.querySelectorAll("turbo-boost-devtool-tooltip").forEach(t=>{$(()=>t.line.remove()),$(()=>t.drag.remove()),$(()=>t.lineToRendering.remove()),$(()=>t.lineToTarget.remove()),$(()=>t.remove())}),document.querySelectorAll("[data-turbo-boost-highlight]").forEach(t=>{t.tagName.match(/turbo-boost-toggle-trigger/i)||Q(t)}),this.active=e}get active(){return Y===this.delegate}set active(e){e?Y=this.delegate:Y=null}get enabled(){return Z.enabled(this.delegate.name)}static register(e,t){Z.register(e,t)}createRenderingTooltip(){if(!this.delegate.triggerElement.renders)return console.debug("Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.");if(!this.delegate.triggerElement.morphs)return console.debug(`Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`);let e=`
196
+ `)}var T,D=class{constructor(t){this.delegate=t;let e,o=()=>{clearTimeout(e),e=setTimeout(this.hide({active:!1}),25)};this.eventListeners["turbo-boost:devtool-enable"]=r=>{let{name:s}=r.detail;s===this.delegate.name&&(w(this.delegate.triggerElement,{outline:"3px dashed blueviolet",outlineOffset:"2px"}),this.hide({active:!1}),this.active&&this.show())},this.eventListeners["turbo-boost:devtool-disable"]=r=>{let{name:s}=r.detail;s===this.delegate.name&&L(this.delegate.triggerElement)},this.eventListeners.click=r=>{r.target.closest("turbo-boost-devtool-tooltip")||o()},this.eventListeners["turbo:load"]=o,this.eventListeners["turbo-frame:load"]=o,window.TurboBoost&&(this.eventListeners[TurboBoost.Commands.events.finish]=o),this.registerEventListeners()}registerEventListeners(){Object.entries(this.eventListeners).forEach(([t,e])=>{addEventListener(t,e)})}unregisterEventListeners(){Object.entries(this.eventListeners).forEach(([t,e])=>{removeEventListener(t,e)})}get eventListeners(){return this._eventListeners||(this._eventListeners={})}show(){if(!this.enabled||this.active)return;this.active=!0,this.hide({active:!0}),w(this.delegate.targetElement,{outline:"3px dashed darkcyan",outlineOffset:"-2px"}),w(this.delegate.morphElement,{outline:"3px dashed chocolate",outlineOffset:"3px"}),this.renderingTooltip=this.createRenderingTooltip(),this.targetTooltip=this.createTargetTooltip(),this.triggerTooltip=this.createTriggerTooltip(this.targetTooltip,this.renderingTooltip),document.querySelectorAll(".leader-line").forEach(e=>e.style.zIndex=1e5);let t={morph:{partial:this.delegate.triggerElement.renders,id:this.delegate.triggerElement.morphs,status:this.delegate.morphElement?"OK":"Not Found"},trigger:{partial:null,id:null,status:"Not Found"},target:{partial:null,id:null,status:"Not Found"}};this.delegate.triggerElement&&(t.trigger={partial:this.delegate.triggerElement.partial,id:this.delegate.triggerElement.id,status:"OK"},t.target.id=this.delegate.triggerElement.controls),this.delegate.targetElement&&(t.target={partial:this.delegate.targetElement.partial,dom_id:this.delegate.targetElement.id,status:"OK"}),console.table(t)}hide({active:t=!1}){document.querySelectorAll("turbo-boost-devtool-tooltip").forEach(e=>{b(()=>e.line.remove()),b(()=>e.drag.remove()),b(()=>e.lineToRendering.remove()),b(()=>e.lineToTarget.remove()),b(()=>e.remove())}),document.querySelectorAll("[data-turbo-boost-highlight]").forEach(e=>{e.tagName.match(/turbo-boost-toggle-trigger/i)||L(e)}),this.active=t}get active(){return T===this.delegate}set active(t){t?T=this.delegate:T=null}get enabled(){return S.enabled(this.delegate.name)}static register(t,e){S.register(t,e)}createRenderingTooltip(){if(!this.delegate.triggerElement.renders)return console.debug("Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.");if(!this.delegate.triggerElement.morphs)return console.debug(`Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`);let t=`
197
197
  <svg xmlns="http://www.w3.org/2000/svg" style="display:inline-block;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.586 7.586"></path><circle cx="11" cy="11" r="2"></circle></svg>
198
198
  RENDERING - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;
199
- `,t=`
199
+ `,e=`
200
200
  <b>partial</b>: ${this.delegate.triggerElement.renders||"unknown"}<br>
201
201
  <b>morphs</b>: ${this.delegate.triggerElement.morphs||"unknown"}<br>
202
- `,o=K(e,t,`
202
+ `,o=x(t,e,`
203
203
  <div slot="content-top" style="font-size:85%; font-style:italic; font-weight:100;">
204
204
  The <b>TRIGGER</b> toggles the <b>TARGET</b> then renders the partial &amp; morphs the element.<br>
205
205
  </div>
206
- `,{id:`${this.delegate.id}-rendering`,backgroundColor:"lightyellow",color:"chocolate"}),r=V(this.delegate.morphElement),n=Math.ceil(r.top+r.height/2-o.offsetHeight/2),s=Math.ceil(r.left+r.width+100);return o.style.top=`${n}px`,o.style.left=`${s}px`,o.line=new LeaderLine(o,this.delegate.morphElement,k(T({},this.leaderLineOptions),{color:"chocolate"})),o.drag=new PlainDraggable(o),o}createTargetTooltip(){var e,t;if(!this.delegate.targetElement)return console.debug(`Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`);let o=`
206
+ `,{id:`${this.delegate.id}-rendering`,backgroundColor:"lightyellow",color:"chocolate"}),r=k(this.delegate.morphElement),s=Math.ceil(r.top+r.height/2-o.offsetHeight/2),i=Math.ceil(r.left+r.width+100);return o.style.top=`${s}px`,o.style.left=`${i}px`,o.line=new LeaderLine(o,this.delegate.morphElement,h(c({},this.leaderLineOptions),{color:"chocolate"})),o.drag=new PlainDraggable(o),o}createTargetTooltip(){var t,e;if(!this.delegate.targetElement)return console.debug(`Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`);let o=`
207
207
  <svg xmlns="http://www.w3.org/2000/svg" style="display:inline-block;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="6"></circle><circle cx="12" cy="12" r="2"></circle></svg>
208
208
  TARGET - &lt;${this.delegate.targetElement.tagName.toLowerCase()}&gt;
209
- `,r=K(o,((e=this.delegate.targetTooltipData)==null?void 0:e.subtitle)||"",((t=this.delegate.targetTooltipData)==null?void 0:t.content)||"",{id:`${this.delegate.id}-target`,backgroundColor:"lightcyan",color:"darkcyan",position:"bottom"}),n=V(this.delegate.targetElement),s=Math.ceil(n.top+r.offsetHeight),i=Math.ceil(n.left+n.width+r.offsetWidth/3);return r.style.top=`${s}px`,r.style.left=`${i}px`,r.line=new LeaderLine(r,this.delegate.targetElement,k(T({},this.leaderLineOptions),{color:"darkcyan"})),r.drag=new PlainDraggable(r),r}createTriggerTooltip(e,t){var o,r;if(!this.delegate.triggerElement)return;let n=`
209
+ `,r=x(o,((t=this.delegate.targetTooltipData)==null?void 0:t.subtitle)||"",((e=this.delegate.targetTooltipData)==null?void 0:e.content)||"",{id:`${this.delegate.id}-target`,backgroundColor:"lightcyan",color:"darkcyan",position:"bottom"}),s=k(this.delegate.targetElement),i=Math.ceil(s.top+r.offsetHeight),n=Math.ceil(s.left+s.width+r.offsetWidth/3);return r.style.top=`${i}px`,r.style.left=`${n}px`,r.line=new LeaderLine(r,this.delegate.targetElement,h(c({},this.leaderLineOptions),{color:"darkcyan"})),r.drag=new PlainDraggable(r),r}createTriggerTooltip(t,e){var o,r;if(!this.delegate.triggerElement)return;let s=`
210
210
  <svg xmlns="http://www.w3.org/2000/svg" style="display:inline;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>
211
211
  TRIGGER - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;
212
- `,s=K(n,((o=this.delegate.triggerTooltipData)==null?void 0:o.subtitle)||"",((r=this.delegate.triggerTooltipData)==null?void 0:r.content)||"",{id:`${this.delegate.id}-trigger`,backgroundColor:"lavender",color:"blueviolet"}),i=V(this.delegate.triggerElement),L=Math.ceil(i.top-s.offsetHeight*2),Oe=Math.ceil(i.left+i.width+s.offsetWidth/3);return s.style.top=`${L}px`,s.style.left=`${Oe}px`,s.line=new LeaderLine(this.delegate.triggerElement,s,k(T({},this.leaderLineOptions),{color:"blueviolet"})),e&&(s.lineToTarget=new LeaderLine(s,e,k(T({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.targetLineLabel,size:2.1})),e.drag.onMove=()=>{var S,ne;e.line.position(),(S=s.lineToTarget)==null||S.position(),(ne=s.lineToRendering)==null||ne.position()}),t&&(s.lineToRendering=new LeaderLine(s,t,k(T({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.renderingLineLabel,size:2.1})),t.drag.onMove=()=>{var S;t.line.position(),s.lineToTarget&&s.lineToTarget.position(),(S=s.lineToRendering)==null||S.position()}),s.drag=new PlainDraggable(s),s.drag.onMove=()=>{s.line.position(),s.lineToTarget&&s.lineToTarget.position(),s.lineToRendering&&s.lineToRendering.position()},s}get leaderLineOptions(){return{dash:{animation:!0},dropShadow:{opacity:.3},endPlug:"arrow3",endPlugSize:1.7,size:3,startPlug:"disc",startPlugSize:1}}},{restart:Bt,start:Ht,stop:Rt}=Z;function xe(e,t,o){Object.assign(e,{initializeDevtool(){let r=()=>this.devtool.show();addEventListener("turbo-boost:devtools-start",()=>{this.devtool=new oe(this),this.addEventListener("mouseenter",r)}),addEventListener("turbo-boost:devtools-stop",()=>{this.removeEventListener("mouseenter",r),this.removeDevtool()}),this.dispatchEvent(new CustomEvent("turbo-boost:devtools-connect",{bubbles:!0}))},hideDevtool(){var r;(r=this.devtool)==null||r.hide({active:!1})},removeDevtool(){this.devtool.hide({active:!1}),this.devtool.unregisterEventListeners(),delete this.devtool},name:t,targetLineLabel:o}),["triggerElement","morphElement","targetElement"].filter(r=>e[r]===void 0).forEach(r=>{Object.defineProperty(e,r,{get(){return e}})})}var Le={restart:Bt,start:Ht,stop:Rt};var v=class extends HTMLElement{constructor(t){super(),this.devtool="unknown",this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=t||"<slot></slot>"}connectedCallback(){this.ensureId()}ensureId(){this.id.trim().length||(this.id=`${this.tagName}-${this.uuidv4()}`.toLowerCase())}uuidv4(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}get viewStack(){let t=this.getAttribute("view-stack");return t?JSON.parse(t):[]}get partial(){return this.viewStack[0]}};var jt=`
212
+ `,i=x(s,((o=this.delegate.triggerTooltipData)==null?void 0:o.subtitle)||"",((r=this.delegate.triggerTooltipData)==null?void 0:r.content)||"",{id:`${this.delegate.id}-trigger`,backgroundColor:"lavender",color:"blueviolet"}),n=k(this.delegate.triggerElement),g=Math.ceil(n.top-i.offsetHeight*2),J=Math.ceil(n.left+n.width+i.offsetWidth/3);return i.style.top=`${g}px`,i.style.left=`${J}px`,i.line=new LeaderLine(this.delegate.triggerElement,i,h(c({},this.leaderLineOptions),{color:"blueviolet"})),t&&(i.lineToTarget=new LeaderLine(i,t,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.targetLineLabel,size:2.1})),t.drag.onMove=()=>{var m,B;t.line.position(),(m=i.lineToTarget)==null||m.position(),(B=i.lineToRendering)==null||B.position()}),e&&(i.lineToRendering=new LeaderLine(i,e,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.renderingLineLabel,size:2.1})),e.drag.onMove=()=>{var m;e.line.position(),i.lineToTarget&&i.lineToTarget.position(),(m=i.lineToRendering)==null||m.position()}),i.drag=new PlainDraggable(i),i.drag.onMove=()=>{i.line.position(),i.lineToTarget&&i.lineToTarget.position(),i.lineToRendering&&i.lineToRendering.position()},i}get leaderLineOptions(){return{dash:{animation:!0},dropShadow:{opacity:.3},endPlug:"arrow3",endPlugSize:1.7,size:3,startPlug:"disc",startPlugSize:1}}},{restart:he,start:ue,stop:ge}=S;function z(t,e,o){Object.assign(t,{initializeDevtool(){let r=()=>this.devtool.show();addEventListener("turbo-boost:devtools-start",()=>{this.devtool=new D(this),this.addEventListener("mouseenter",r)}),addEventListener("turbo-boost:devtools-stop",()=>{this.removeEventListener("mouseenter",r),this.removeDevtool()}),this.dispatchEvent(new CustomEvent("turbo-boost:devtools-connect",{bubbles:!0}))},hideDevtool(){var r;(r=this.devtool)==null||r.hide({active:!1})},removeDevtool(){var r,s;(r=this.devtool)!=null&&r.hide&&this.devtool.hide({active:!1}),(s=this.devtool)!=null&&s.unregisterEventListeners&&this.devtool.unregisterEventListeners(),delete this.devtool},name:e,targetLineLabel:o}),["triggerElement","morphElement","targetElement"].filter(r=>t[r]===void 0).forEach(r=>{Object.defineProperty(t,r,{get(){return t}})})}var P={restart:he,start:ue,stop:ge,VERSION:Z};var V="0.0.18";var a=class extends HTMLElement{constructor(e){super(),this.devtool="unknown",this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=e||"<slot></slot>"}connectedCallback(){this.ensureId()}ensureId(){this.id.trim().length||(this.id=`${this.tagName}-${this.uuidv4()}`.toLowerCase())}uuidv4(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}get viewStack(){let e=this.getAttribute("view-stack");return e?JSON.parse(e):[]}get partial(){return this.viewStack[0]}};var me=`
213
213
  <turbo-boost>
214
214
  <slot name="busy" hidden></slot>
215
215
  <slot></slot>
216
216
  </turbo-boost>
217
- `,Se=100,re=400,y=class extends v{constructor(){super(jt)}showBusyElement(){clearTimeout(this.showBusyElementTimeout),clearTimeout(this.hideBusyElementTimeout),this.busyElement&&(this.busyStartedAt=Date.now()+Se,this.showBusyElementTimeout=setTimeout(()=>{this.busySlotElement.hidden=!1,this.defaultSlotElement.hidden=!0},Se))}hideBusyElement(){if(clearTimeout(this.showBusyElementTimeout),clearTimeout(this.hideBusyElementTimeout),!this.busyElement)return;let t=re-(Date.now()-this.busyStartedAt);t<0&&(t=0),delete this.busyStartedAt,this.hideBusyElementTimeout=setTimeout(()=>{this.busySlotElement.hidden=!0,this.defaultSlotElement.hidden=!1},t)}get busyElement(){return this.querySelector(':scope > [slot="busy"]')}get busySlotElement(){return this.shadowRoot.querySelector('slot[name="busy"]')}get defaultSlotElement(){return this.shadowRoot.querySelector("slot:not([name])")}get busy(){return this.getAttribute("busy")==="true"}set busy(t){t=!!t,this.busy!==t&&(this.setAttribute("busy",t),t?this.showBusyElement():this.hideBusyElement())}get busyStartedAt(){return this.dataset.busyStartedAt?Number(this.dataset.busyStartedAt):0}set busyStartedAt(t){this.dataset.busyStartedAt=t}};var B=class extends y{connectedCallback(){super.connectedCallback(),this.mouseenterHandler=this.onMouseenter.bind(this),this.addEventListener("mouseenter",this.mouseenterHandler),this.collapseHandler=this.collapse.bind(this),this.collapseNowHandler=this.collapseNow.bind(this),this.collapseOn.forEach(t=>{let o=t.split("@"),r=o[0];o.length>1?(o[1].match(/^self|window$/)?self:self[o[1]]).addEventListener(r,this.collapseNowHandler):this.addEventListener(r,this.collapseHandler)})}disconnectedCallback(){this.removeEventListener("mouseenter",this.mouseenterHandler),this.collapseOn.forEach(t=>{let o=t.split("@"),r=o[0];o.length>1?(o[1].match(/^self|window$/)?self:self[o[1]]).removeEventListener(r,this.collapseNowHandler):this.removeEventListener(r,this.collapseHandler)})}cacheHTML(){}renderCachedHTML(){}onMouseenter(){clearTimeout(this.collapseTimeout)}collapse(t=250){if(clearTimeout(this.collapseTimeout),!this.busy){if(typeof t!="number"&&(t=250),t>0)return this.collapseTimeout=setTimeout(()=>this.collapse(0),t);this.innerHTML="";try{this.expanded=!1,this.triggerElement.hideDevtool()}catch(o){}}}collapseNow(t){t.target.closest("turbo-boost-devtool-tooltip")||this.collapse(0)}collapseMatches(){document.querySelectorAll(this.collapseSelector).forEach(t=>{t.id!==this.id&&t.collapse&&t.collapse(0)})}get collapseSelector(){return this.triggerElement.collapseSelector||this.getAttribute("collapse-selector")}get focusSelector(){return this.getAttribute("focus-selector")}get triggerElement(){return document.getElementById(this.labeledBy)}get triggerElements(){return document.querySelectorAll(`[aria-controls="${this.id}"]`)}get labeledBy(){return this.getAttribute("aria-labeledby")}set labeledBy(t){return this.setAttribute("aria-labeledby",t)}get collapseOn(){let t=this.getAttribute("collapse-on");return t?JSON.parse(t):[]}get expanded(){return this.triggerElement?this.triggerElement.expanded:!1}set expanded(t){this.triggerElements.forEach(o=>o.expanded=t)}get busy(){return this.triggerElement&&this.triggerElement.busy}};var Ce;function Mt(e){["bold","bullet","code","heading1","href","italic","number","quote","strike"].forEach(o=>e.deactivateAttribute(o))}function qt(e){if(e.value.length===0)return;let t=e.editor,o=[];for(;o[0]!==t.getSelectedRange()[0]&&o[1]!==t.getSelectedRange()[1];)o=t.getSelectedRange(),t.moveCursorInDirection("forward");t.insertString(" "),t.moveCursorInDirection("forward"),t.setSelectedRange([o[1],t.getSelectedRange()[1]]),Mt(t),t.setSelectedRange([t.getSelectedRange()[1],t.getSelectedRange()[1]])}function Pt(e){clearTimeout(Ce),Ce=setTimeout(()=>{if(!e)return;e.focus();let t=e.closest("trix-editor");try{t?qt(t):e.selectionStart=e.selectionEnd=e.value.length}catch(o){}finally{e.scrollIntoView({block:"center",behavior:"smooth"})}},100)}var Ae=e=>Pt(e);document.addEventListener("turbo-boost:devtools-start",()=>oe.register("toggle","toggles"));var $e,H=class extends y{constructor(){super(),xe(this,"toggle","toggles")}connectedCallback(){super.connectedCallback();let{start:t}=TurboBoost.Commands.events;this.commandStartHandler=this.onCommandStart.bind(this),this.addEventListener(t,this.commandStartHandler);let{before:o}=TurboBoost.Streams.invokeEvents;this.beforeInvokeHandler=this.onBeforeInvoke.bind(this),addEventListener(o,this.beforeInvokeHandler),this.initializeDevtool()}disconnectedCallback(){setTimeout(()=>{let{start:t}=TurboBoost.Commands.events;this.removeEventListener(t,this.commandStartHandler);let{before:o}=TurboBoost.Streams.invokeEvents;removeEventListener(o,this.beforeInvokeHandler),this.removeDevtool()},1e3)}onCommandStart(t){$e=this.focusSelector,this.targetElement.labeledBy=this.id,this.targetElement.collapseMatches(),this.busy=!0}onBeforeInvoke(t){if(t.detail.method!=="morph"||t.target.id!==this.morphs)return;let o=`turbo-boost-toggle-target[aria-labeledby="${this.id}"]`;if(!t.target.querySelector(o))return;let r=Date.now()-this.busyStartedAt,n=re-r;n<10&&(n=10),t.detail.invoke={delay:n},setTimeout(()=>{this.busy=!1,this.morphToggleTriggerElements.forEach(s=>s.busy=!1)},n-10),setTimeout(()=>Ae(this.targetElement.querySelector($e)),n+100)}get sharedViews(){if(!this.targetElement)return[];if(!this.targetElement.viewStack)return[];let t=(o,r)=>(this.targetElement.viewStack.includes(r)&&o.push(r),o);return this.viewStack.reduce(t.bind(this),[])}get renders(){return this.getAttribute("renders")}get morphs(){return this.getAttribute("morphs")}get morphToggleTriggerElements(){return Array.from(this.morphElement.querySelectorAll("turbo-boost-toggle-trigger"))}get controls(){return this.getAttribute("aria-controls")}get collapseSelector(){return this.getAttribute("collapse-selector")}get focusSelector(){return this.getAttribute("focus-selector")||this.targetElement.focusSelector}get remember(){return this.getAttribute("remember")==="true"}set remember(t){return this.setAttribute("remember",!!t)}get expanded(){return this.getAttribute("aria-expanded")==="true"}set expanded(t){this.setAttribute("aria-expanded",!!t)}get collapsed(){return!this.expanded}get command(){return this.dataset.turboCommand}get renderingLineLabel(){return"renders & morphs"}get morphElement(){return this.morphs?document.getElementById(this.morphs):null}get targetElement(){return this.controls?document.getElementById(this.controls):null}get triggerTooltipData(){let t=this.triggerElement.viewStack.reverse().map((o,r)=>this.triggerElement.sharedViews.includes(o)?`<div slot="content">${r+1}. ${o}</div>`:`<div slot="content-bottom">${r+1}. ${o}</div>`,this).join("");return{subtitle:`
217
+ `,F=100,C=400,d=class extends a{constructor(){super(me)}showBusyElement(){clearTimeout(this.showBusyElementTimeout),clearTimeout(this.hideBusyElementTimeout),this.busyElement&&(this.busyStartedAt=Date.now()+F,this.showBusyElementTimeout=setTimeout(()=>{this.busySlotElement.hidden=!1,this.defaultSlotElement.hidden=!0},F))}hideBusyElement(){if(clearTimeout(this.showBusyElementTimeout),clearTimeout(this.hideBusyElementTimeout),!this.busyElement)return;let e=C-(Date.now()-this.busyStartedAt);e<0&&(e=0),delete this.busyStartedAt,this.hideBusyElementTimeout=setTimeout(()=>{this.busySlotElement.hidden=!0,this.defaultSlotElement.hidden=!1},e)}get busyElement(){return this.querySelector(':scope > [slot="busy"]')}get busySlotElement(){return this.shadowRoot.querySelector('slot[name="busy"]')}get defaultSlotElement(){return this.shadowRoot.querySelector("slot:not([name])")}get busy(){return this.getAttribute("busy")==="true"}set busy(e){e=!!e,this.busy!==e&&(this.setAttribute("busy",e),e?this.showBusyElement():this.hideBusyElement())}get busyStartedAt(){return this.dataset.busyStartedAt?Number(this.dataset.busyStartedAt):0}set busyStartedAt(e){this.dataset.busyStartedAt=e}};var f=class extends d{connectedCallback(){super.connectedCallback(),this.mouseenterHandler=this.onMouseenter.bind(this),this.addEventListener("mouseenter",this.mouseenterHandler),this.collapseHandler=this.collapse.bind(this),this.collapseNowHandler=this.collapseNow.bind(this),this.collapseOn.forEach(e=>{let o=e.split("@"),r=o[0];o.length>1?(o[1].match(/^self|window$/)?self:self[o[1]]).addEventListener(r,this.collapseNowHandler):this.addEventListener(r,this.collapseHandler)})}disconnectedCallback(){this.removeEventListener("mouseenter",this.mouseenterHandler),this.collapseOn.forEach(e=>{let o=e.split("@"),r=o[0];o.length>1?(o[1].match(/^self|window$/)?self:self[o[1]]).removeEventListener(r,this.collapseNowHandler):this.removeEventListener(r,this.collapseHandler)})}cacheHTML(){}renderCachedHTML(){}onMouseenter(){clearTimeout(this.collapseTimeout)}collapse(e=250){if(clearTimeout(this.collapseTimeout),!this.busy){if(typeof e!="number"&&(e=250),e>0)return this.collapseTimeout=setTimeout(()=>this.collapse(0),e);this.innerHTML="";try{this.expanded=!1,this.triggerElement.hideDevtool()}catch(o){}}}collapseNow(e){e.target.closest("turbo-boost-devtool-tooltip")||this.collapse(0)}collapseMatches(){document.querySelectorAll(this.collapseSelector).forEach(e=>{e.id!==this.id&&e.collapse&&e.collapse(0)})}get collapseSelector(){return this.triggerElement.collapseSelector||this.getAttribute("collapse-selector")}get focusSelector(){return this.getAttribute("focus-selector")}get triggerElement(){return document.getElementById(this.labeledBy)}get triggerElements(){return document.querySelectorAll(`[aria-controls="${this.id}"]`)}get labeledBy(){return this.getAttribute("aria-labeledby")}set labeledBy(e){return this.setAttribute("aria-labeledby",e)}get collapseOn(){let e=this.getAttribute("collapse-on");return e?JSON.parse(e):[]}get expanded(){return this.triggerElement?this.triggerElement.expanded:!1}set expanded(e){this.triggerElements.forEach(o=>o.expanded=e)}get busy(){return this.triggerElement&&this.triggerElement.busy}};var W;function be(t){["bold","bullet","code","heading1","href","italic","number","quote","strike"].forEach(o=>t.deactivateAttribute(o))}function pe(t){if(t.value.length===0)return;let e=t.editor,o=[];for(;o[0]!==e.getSelectedRange()[0]&&o[1]!==e.getSelectedRange()[1];)o=e.getSelectedRange(),e.moveCursorInDirection("forward");e.insertString(" "),e.moveCursorInDirection("forward"),e.setSelectedRange([o[1],e.getSelectedRange()[1]]),be(e),e.setSelectedRange([e.getSelectedRange()[1],e.getSelectedRange()[1]])}function ve(t){clearTimeout(W),W=setTimeout(()=>{if(!t)return;t.focus();let e=t.closest("trix-editor");try{e?pe(e):t.selectionStart=t.selectionEnd=t.value.length}catch(o){}finally{t.scrollIntoView({block:"center",behavior:"smooth"})}},100)}var G=t=>ve(t);document.addEventListener("turbo-boost:devtools-start",()=>D.register("toggle","toggles"));var _,E=class extends d{constructor(){super(),z(this,"toggle","toggles")}connectedCallback(){super.connectedCallback();let{start:e}=TurboBoost.Commands.events;this.commandStartHandler=this.onCommandStart.bind(this),this.addEventListener(e,this.commandStartHandler);let{before:o}=TurboBoost.Streams.invokeEvents;this.beforeInvokeHandler=this.onBeforeInvoke.bind(this),addEventListener(o,this.beforeInvokeHandler),this.initializeDevtool()}disconnectedCallback(){setTimeout(()=>{let{start:e}=TurboBoost.Commands.events;this.removeEventListener(e,this.commandStartHandler);let{before:o}=TurboBoost.Streams.invokeEvents;removeEventListener(o,this.beforeInvokeHandler),this.removeDevtool()},1e3)}onCommandStart(e){_=this.focusSelector,this.targetElement.labeledBy=this.id,this.targetElement.collapseMatches(),this.busy=!0}onBeforeInvoke(e){if(e.detail.method!=="morph"||e.target.id!==this.morphs)return;let o=`turbo-boost-toggle-target[aria-labeledby="${this.id}"]`;if(!e.target.querySelector(o))return;let r=Date.now()-this.busyStartedAt,s=C-r;s<10&&(s=10),e.detail.invoke={delay:s},setTimeout(()=>{this.busy=!1,this.morphToggleTriggerElements.forEach(i=>i.busy=!1)},s-10),setTimeout(()=>G(this.targetElement.querySelector(_)),s+100)}get sharedViews(){if(!this.targetElement)return[];if(!this.targetElement.viewStack)return[];let e=(o,r)=>(this.targetElement.viewStack.includes(r)&&o.push(r),o);return this.viewStack.reduce(e.bind(this),[])}get renders(){return this.getAttribute("renders")}get morphs(){return this.getAttribute("morphs")}get morphToggleTriggerElements(){return Array.from(this.morphElement.querySelectorAll("turbo-boost-toggle-trigger"))}get controls(){return this.getAttribute("aria-controls")}get collapseSelector(){return this.getAttribute("collapse-selector")}get focusSelector(){return this.getAttribute("focus-selector")||this.targetElement.focusSelector}get remember(){return this.getAttribute("remember")==="true"}set remember(e){return this.setAttribute("remember",!!e)}get expanded(){return this.getAttribute("aria-expanded")==="true"}set expanded(e){this.setAttribute("aria-expanded",!!e)}get collapsed(){return!this.expanded}get command(){return this.dataset.turboCommand}get renderingLineLabel(){return"renders & morphs"}get morphElement(){return this.morphs?document.getElementById(this.morphs):null}get targetElement(){return this.controls?document.getElementById(this.controls):null}get triggerTooltipData(){let e=this.triggerElement.viewStack.reverse().map((o,r)=>this.triggerElement.sharedViews.includes(o)?`<div slot="content">${r+1}. ${o}</div>`:`<div slot="content-bottom">${r+1}. ${o}</div>`,this).join("");return{subtitle:`
218
218
  <b>id</b>: ${this.triggerElement.id}<br>
219
219
  <b>aria-controls</b>: ${this.triggerElement.controls}<br>
220
220
  <b>aria-expanded</b>: ${this.triggerElement.expanded}<br>
@@ -224,14 +224,14 @@ var De=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnProperty
224
224
  <svg xmlns="http://www.w3.org/2000/svg" style="display:inline-block;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
225
225
  <b>View Stack</b>
226
226
  </div>
227
- ${t}
228
- `}}get targetTooltipData(){let t=this.targetElement.viewStack.reverse().map((o,r)=>this.triggerElement.sharedViews.includes(o)?`<div slot="content">${r+1}. ${o}</div>`:`<div slot="content-bottom">${r+1}. ${o}</div>`,this).join("");return{subtitle:`<b>id</b>: ${this.targetElement.id}<br>
227
+ ${e}
228
+ `}}get targetTooltipData(){let e=this.targetElement.viewStack.reverse().map((o,r)=>this.triggerElement.sharedViews.includes(o)?`<div slot="content">${r+1}. ${o}</div>`:`<div slot="content-bottom">${r+1}. ${o}</div>`,this).join("");return{subtitle:`<b>id</b>: ${this.targetElement.id}<br>
229
229
  <b>aria-labeled-by</b>: ${this.targetElement.labeledBy}<br>
230
230
  `,content:`
231
231
  <div slot="content-top">
232
232
  <svg xmlns="http://www.w3.org/2000/svg" style="display:inline-block;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
233
233
  <b>View Stack</b>
234
234
  </div>
235
- ${t}
236
- `}}};customElements.define("turbo-boost",v);customElements.define("turbo-boost-toggle-target",B);customElements.define("turbo-boost-toggle-trigger",H);self.TurboBoost=self.TurboBoost||{};self.TurboBoost.devtools=Le;self.TurboBoost.Elements={};var uo=self.TurboBoost.Elements;export{uo as default};
235
+ ${e}
236
+ `}}};customElements.define("turbo-boost",a);customElements.define("turbo-boost-toggle-target",f);customElements.define("turbo-boost-toggle-trigger",E);self.TurboBoost=self.TurboBoost||{};self.TurboBoost.devtools=P;self.TurboBoost.Elements={VERSION:V};var Pe=self.TurboBoost.Elements;export{Pe as default};
237
237
  //# sourceMappingURL=elements.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../node_modules/@turbo-boost/commands/app/javascript/meta.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/events.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/state/observable.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/state/index.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/renderer.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/activity.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/lifecycle.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/turbo.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/schema.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/confirmation.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/delegates.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/elements.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/drivers/form.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/urls.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/drivers/frame.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/drivers/method.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/drivers/window.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/drivers/index.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/logger.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/uuids.js", "../../../../node_modules/@turbo-boost/commands/app/javascript/index.js", "../../../../node_modules/@turbo-boost/devtools/src/utils/dom.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/devtool_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/supervisor_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/tooltip_element.js", "../../../../node_modules/@turbo-boost/devtools/src/dependencies.js", "../../../../node_modules/@turbo-boost/devtools/src/supervisor.js", "../../../../node_modules/@turbo-boost/devtools/src/devtool.js", "../../../../node_modules/@turbo-boost/devtools/src/index.js", "../../../javascript/elements/turbo_boost_element/index.js", "../../../javascript/elements/toggle_elements/toggle_element/index.js", "../../../javascript/elements/toggle_elements/target_element/index.js", "../../../javascript/elements/toggle_elements/trigger_element/focus.js", "../../../javascript/elements/toggle_elements/trigger_element/index.js", "../../../javascript/elements/index.js", "../../../javascript/index.js"],
4
- "sourcesContent": ["class Meta {\n get element() {\n return document.querySelector('meta[name=\"turbo-boost\"]')\n }\n\n get token() {\n return this.element.getAttribute('content')\n }\n\n get busy() {\n return this.element.dataset.busy === 'true'\n }\n\n set busy(value) {\n return (this.element.dataset.busy = !!value)\n }\n}\n\nexport default new Meta()\n", "export const commandEvents = {\n start: 'turbo-boost:command:start',\n success: 'turbo-boost:command:success',\n finish: 'turbo-boost:command:finish',\n abort: 'turbo-boost:command:abort',\n clientError: 'turbo-boost:command:client-error',\n serverError: 'turbo-boost:command:server-error'\n}\n\nexport const stateEvents = {\n stateLoad: 'turbo-boost:state:load',\n stateChange: 'turbo-boost:state:change'\n}\n\nexport const allEvents = { ...commandEvents, ...stateEvents }\n\nexport function dispatch(name, target, options = {}) {\n return new Promise(resolve => {\n options = options || {}\n options.detail = options.detail || {}\n target = target || document\n const evt = new CustomEvent(name, { ...options, bubbles: true })\n target.dispatchEvent(evt)\n resolve(evt)\n })\n}\n", "import meta from '../meta'\nimport { dispatch, stateEvents as events } from '../events'\n\nlet head\n\nfunction observable(object, parent = null) {\n if (!object || typeof object !== 'object') return object\n\n const proxy = new Proxy(object, {\n deleteProperty(target, key) {\n delete target[key]\n dispatch(events.stateChange, meta.element, { detail: { state: head } })\n return true\n },\n\n set(target, key, value, receiver) {\n target[key] = observable(value, this)\n dispatch(events.stateChange, meta.element, { detail: { state: head } })\n return true\n }\n })\n\n if (Array.isArray(object)) {\n object.forEach((value, index) => (object[index] = observable(value, proxy)))\n } else if (typeof object === 'object') {\n for (const [key, value] of Object.entries(object)) object[key] = observable(value, proxy)\n }\n\n if (!parent) head = proxy\n return proxy\n}\n\nexport default observable\n", "import meta from '../meta'\nimport observable from './observable'\nimport { dispatch, commandEvents, stateEvents } from '../events'\n\nlet loadedState, currentState, changedState\nlet loadStateTimeout\n\nfunction loadState() {\n if (!meta.element) return loadStateLater()\n const json = atob(meta.element.dataset.state)\n changedState = {}\n currentState = observable(JSON.parse(json))\n loadedState = { ...currentState }\n delete meta.element.dataset.clientStateChange\n setTimeout(() =>\n dispatch(stateEvents.stateLoad, meta.element, {\n detail: { state: currentState }\n })\n )\n}\n\nfunction loadStateLater() {\n clearTimeout(loadStateTimeout)\n loadStateTimeout = setTimeout(loadState, 10)\n}\n\nif (!loadedState) loadState()\n\naddEventListener('DOMContentLoaded', loadStateLater)\naddEventListener('load', loadStateLater)\naddEventListener('turbo:load', loadStateLater)\naddEventListener('turbo:frame-load', loadStateLater)\naddEventListener(commandEvents.success, loadStateLater)\n\naddEventListener(stateEvents.stateChange, event => {\n changedState = {}\n for (const [key, value] of Object.entries(currentState))\n if (loadedState[key] !== value) changedState[key] = value\n meta.element.dataset.clientStateChange = true\n meta.element.dataset.state = btoa(JSON.stringify(currentState))\n})\n\nexport default {\n events: stateEvents,\n\n get current() {\n return currentState\n },\n\n get delta() {\n return changedState\n },\n\n // The UI state changes are split into chunks and sent to the server in an HTTP request header.\n // Max size for an HTTP header is around 4k or 4,000 bytes.\n // A Base64 character is an 8-bit-padded ASCII character... or 1 byte\n //\n // SEE: lib/state.rb - for info on how `state` is serialized/deserialized\n get payloadChunks() {\n return btoa(JSON.stringify(changedState)).match(/.{1,2000}/g)\n }\n}\n", "function replaceDocument(content) {\n const head = '<html'\n const tail = '</html'\n const headIndex = content.indexOf(head)\n const tailIndex = content.lastIndexOf(tail)\n if (headIndex >= 0 && tailIndex >= 0) {\n const html = content.slice(content.indexOf('>', headIndex) + 1, tailIndex)\n document.documentElement.innerHTML = html\n }\n}\n\nfunction append(content) {\n document.body.insertAdjacentHTML('beforeend', content)\n}\n\nexport default { append, replaceDocument }\n", "const active = {}\n\nfunction add(payload) {\n active[payload.id] = payload\n}\n\nfunction remove(id) {\n delete active[id]\n}\n\nexport default {\n add,\n remove,\n get commands() {\n return [...Object.values(active)]\n },\n get length() {\n return Object.keys(active).length\n }\n}\n", "import activity from './activity'\nimport { dispatch, commandEvents } from './events'\n\nfunction finish(event) {\n event.detail.endedAt = Date.now()\n event.detail.milliseconds = event.detail.endedAt - event.detail.startedAt\n setTimeout(() => dispatch(commandEvents.finish, event.target, { detail: event.detail }), 25)\n}\n\n// TODO: forward source event to finish (error or success)\naddEventListener(commandEvents.serverError, finish)\naddEventListener(commandEvents.success, finish)\naddEventListener(commandEvents.finish, event => activity.remove(event.detail.id), true)\n\nexport default { events: commandEvents }\n", "import meta from './meta'\nimport state from './state'\nimport renderer from './renderer'\nimport { dispatch } from './events'\nimport lifecycle from './lifecycle'\n\nconst frameSources = {}\n\n// fires before making a turbo HTTP request\naddEventListener('turbo:before-fetch-request', event => {\n const frame = event.target.closest('turbo-frame')\n const { fetchOptions } = event.detail\n\n // command invoked and busy\n if (meta.busy) {\n let acceptHeaders = ['text/vnd.turbo-boost.html', fetchOptions.headers['Accept']]\n acceptHeaders = acceptHeaders.filter(entry => entry && entry.trim().length > 0).join(', ')\n fetchOptions.headers['Accept'] = acceptHeaders\n fetchOptions.headers['TurboBoost-Token'] = meta.token\n }\n\n // always send state\n state.payloadChunks.forEach((chunk, i) => {\n fetchOptions.headers[`TurboBoost-State-${i.toString().padStart(4, '0')}`] = chunk\n })\n})\n\n// fires after receiving a turbo HTTP response\naddEventListener('turbo:before-fetch-response', event => {\n const frame = event.target.closest('turbo-frame')\n const { fetchResponse: response } = event.detail\n\n if (frame) frameSources[frame.id] = frame.src\n\n if (response.header('TurboBoost')) {\n if (response.statusCode < 200 || response.statusCode > 399) {\n const error = `Server returned a ${response.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`\n dispatch(lifecycle.events.clientError, document, { detail: { ...event.detail, error } }, true)\n }\n\n if (response.header('TurboBoost') === 'Append') {\n event.preventDefault()\n response.responseText.then(content => renderer.append(content))\n }\n }\n})\n\n// fires when a frame element is navigated and finishes loading\naddEventListener('turbo:frame-load', event => {\n const frame = event.target.closest('turbo-frame')\n frame.dataset.turboBoostSrc = frameSources[frame.id] || frame.src || frame.dataset.turboBoostSrc\n delete frameSources[frame.id]\n})\n", "const schema = {\n // attributes\n frameAttribute: 'data-turbo-frame',\n methodAttribute: 'data-turbo-method',\n commandAttribute: 'data-turbo-command',\n confirmAttribute: 'data-turbo-confirm',\n\n // events\n turboSubmitStartEvent: 'turbo:submit-start'\n}\n\nexport default { ...schema }\n", "import { commandEvents } from './events'\nimport schema from './schema'\n\nconst confirmation = {\n method: message => Promise.resolve(confirm(message))\n}\n\nconst isTurboMethod = event => event.detail.driver === 'method'\n\nconst isTurboForm = event => {\n if (event.detail.driver !== 'form') return false\n\n const element = event.target\n const frame = element.closest('turbo-frame')\n const target = element.closest(`[${schema.frameAttribute}]`)\n return !!(frame || target)\n}\n\nconst shouldDelegate = event => isTurboMethod(event) || isTurboForm(event)\n\ndocument.addEventListener(commandEvents.start, async event => {\n const message = event.target.getAttribute(schema.confirmAttribute)\n if (!message) return\n\n event.detail.confirmation = true\n\n if (shouldDelegate(event)) return // delegate confirmation handling to Turbo\n\n const proceed = await confirmation.method(message)\n if (!proceed) event.preventDefault()\n})\n\nexport default confirmation\n", "let events = []\nlet eventListener\n\nfunction register(eventName, selectors) {\n const match = events.find(evt => evt.name === eventName)\n if (match) events.splice(events.indexOf(match), 1)\n events = [{ name: eventName, selectors }, ...events]\n\n document.removeEventListener(eventName, eventListener, true)\n document.addEventListener(eventName, eventListener, true)\n\n return { ...events.find(evt => evt.name === eventName) }\n}\n\nfunction getRegisteredEventForElement(element) {\n return events.find(evt =>\n evt.selectors.find(selector => Array.from(document.querySelectorAll(selector)).find(el => el === element))\n )\n}\n\nfunction isRegisteredForElement(eventName, element) {\n const evt = getRegisteredEventForElement(element)\n return evt && evt.name === eventName\n}\n\nexport default {\n register,\n isRegisteredForElement,\n get events() {\n return [...events]\n },\n set handler(fn) {\n eventListener = fn\n }\n}\n", "import schema from './schema'\nimport lifecycle from './lifecycle'\n\nfunction findClosestCommand(element) {\n return element.closest(`[${schema.commandAttribute}]`)\n}\n\nfunction findClosestFrameWithSource(element) {\n return (\n element.closest('turbo-frame[src]') ||\n element.closest('turbo-frame[data-turbo-frame-src]') ||\n element.closest('turbo-frame')\n )\n}\n\nfunction assignElementValueToPayload(element, payload = {}) {\n if (element.tagName.toLowerCase() !== 'select') return (payload.value = element.value || null)\n\n if (!element.multiple) return (payload.value = element.options[element.selectedIndex].value)\n\n payload.values = Array.from(element.options).reduce((memo, option) => {\n if (option.selected) memo.push(option.value)\n return memo\n }, [])\n}\n\nfunction buildAttributePayload(element) {\n const payload = Array.from(element.attributes).reduce((memo, attr) => {\n let value = attr.value\n memo[attr.name] = value\n return memo\n }, {})\n\n payload.tag = element.tagName\n payload.checked = !!element.checked\n payload.disabled = !!element.disabled\n assignElementValueToPayload(element, payload)\n\n // reduce payload size to keep URL length smaller\n delete payload.class\n delete payload.action\n delete payload.href\n delete payload[schema.commandAttribute]\n delete payload[schema.frameAttribute]\n\n return payload\n}\n\nexport default {\n buildAttributePayload,\n findClosestCommand,\n findClosestFrameWithSource\n}\n", "import meta from '../meta'\n\nfunction updateFormSubmission(formSubmission) {\n const shouldUpdate =\n formSubmission?.formElement instanceof HTMLFormElement &&\n formSubmission?.body instanceof URLSearchParams &&\n formSubmission?.fetchRequest?.body instanceof URLSearchParams\n\n if (!shouldUpdate) return\n\n formSubmission.formData = new FormData(formSubmission.formElement)\n for (const [key, value] of formSubmission.formData.entries()) {\n formSubmission.fetchRequest.body.set(key, value)\n formSubmission.body.set(key, value)\n }\n\n return formSubmission\n}\n\nfunction invokeCommand(form, payload = {}, event = {}) {\n payload.token = meta.token\n const input = form.querySelector('input[name=\"turbo_boost_command\"]') || document.createElement('input')\n input.type = 'hidden'\n input.name = 'turbo_boost_command'\n input.value = JSON.stringify(payload)\n form.appendChild(input)\n updateFormSubmission(event.detail.formSubmission)\n}\n\nexport default { invokeCommand }\n", "function build(urlString, payload = {}) {\n const a = document.createElement('a')\n a.href = urlString\n const url = new URL(a)\n url.searchParams.set('turbo_boost_command', JSON.stringify(payload))\n return url\n}\n\nexport default { build }\n", "import urls from '../urls'\n\nfunction invokeCommand(frame, payload) {\n const src = payload.src\n payload = { ...payload }\n delete payload.src\n frame.src = urls.build(src, payload)\n}\n\nexport default { invokeCommand }\n", "import urls from '../urls'\n\nfunction invokeCommand(element, payload = {}) {\n const src = payload.src\n payload = { ...payload }\n delete payload.src\n delete payload.href\n element.setAttribute('href', urls.build(src, payload))\n}\n\nexport default { invokeCommand }\n", "import meta from '../meta'\nimport state from '../state'\nimport { dispatch } from '../events'\nimport lifecycle from '../lifecycle'\nimport urls from '../urls'\nimport renderer from '../renderer'\n\nfunction aborted(event) {\n const xhr = event.target\n dispatch(lifecycle.events.abort, document, {\n detail: { ...event.detail, xhr }\n })\n}\n\nfunction errored(event) {\n const xhr = event.target\n\n const append =\n xhr.getResponseHeader('TurboBoost') === 'Append' ||\n xhr.getResponseHeader('Content-Type').startsWith('text/vnd.turbo-boost.html')\n append ? renderer.append(xhr.responseText) : renderer.replaceDocument(xhr.responseText)\n\n const error = `Server returned a ${xhr.status} status code! TurboBoost Commands require 2XX-3XX status codes.`\n\n dispatch(lifecycle.events.clientError, document, { detail: { ...event.detail, error, xhr } }, true)\n}\n\nfunction loaded(event) {\n const xhr = event.target\n if (xhr.status < 200 || xhr.status > 399) return errored(event)\n const content = xhr.responseText\n const append =\n xhr.getResponseHeader('TurboBoost') === 'Append' ||\n xhr.getResponseHeader('Content-Type').startsWith('text/vnd.turbo-boost.html')\n append ? renderer.append(xhr.responseText) : renderer.replaceDocument(xhr.responseText)\n}\n\nfunction invokeCommand(payload) {\n const src = payload.src\n payload = { ...payload }\n delete payload.src\n\n try {\n const xhr = new XMLHttpRequest()\n xhr.open('GET', urls.build(src, payload), true)\n xhr.setRequestHeader('Accept', 'text/vnd.turbo-boost.html, text/html, application/xhtml+xml')\n xhr.setRequestHeader('TurboBoost-Token', meta.token)\n state.payloadChunks.forEach((chunk, i) =>\n xhr.setRequestHeader(`TurboBoost-State-${i.toString().padStart(4, '0')}`, chunk)\n )\n\n xhr.addEventListener('abort', aborted)\n xhr.addEventListener('error', errored)\n xhr.addEventListener('load', loaded)\n xhr.send()\n } catch (ex) {\n const message = `Unexpected error sending HTTP request! ${ex.message}`\n errored(ex, { detail: { message } })\n }\n}\n\nexport default { invokeCommand }\n", "import elements from '../elements'\nimport formDriver from './form'\nimport frameDriver from './frame'\nimport methodDriver from './method'\nimport windowDriver from './window'\n\nfunction src(element, frame) {\n frame = frame || { dataset: {} }\n return element.href || frame.src || frame.dataset.turboBoostSrc || location.href\n}\n\nfunction find(element) {\n let frame = elements.findClosestFrameWithSource(element)\n\n const { turboFrame, turboMethod } = element.dataset\n\n if (element.tagName.toLowerCase() === 'form')\n return {\n name: 'form',\n reason: 'Element is a form.',\n frame,\n src: element.action,\n invokeCommand: formDriver.invokeCommand\n }\n\n if (turboMethod && turboMethod.length > 0)\n return {\n name: 'method',\n reason: 'Element defines data-turbo-method.',\n frame,\n src: element.href,\n invokeCommand: methodDriver.invokeCommand\n }\n\n // element targets a frame that is not _self\n if (turboFrame && turboFrame !== '_self') {\n frame = document.getElementById(turboFrame)\n return {\n name: 'frame',\n reason: 'element targets a frame that is not _self',\n frame,\n src: src(element, frame),\n invokeCommand: frameDriver.invokeCommand\n }\n }\n\n // element does NOT target a frame or targets _self and is contained by a frame\n if ((!turboFrame || turboFrame === '_self') && frame)\n return {\n name: 'frame',\n reason: 'element does NOT target a frame or targets _self and is contained by a frame',\n frame,\n src: src(element, frame),\n invokeCommand: frameDriver.invokeCommand\n }\n\n // element matches one or more of the following conditions\n // - targets _top\n // - does NOT target a frame\n // - is NOT contained by a frame\n return {\n name: 'window',\n reason:\n 'element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)',\n frame: null,\n src: src(element),\n invokeCommand: windowDriver.invokeCommand\n }\n}\n\nexport default { find }\n", "import { allEvents as events } from './events'\n\nlet currentLevel = 'unknown'\n\nconst logLevels = {\n debug: Object.values(events),\n info: Object.values(events),\n warn: [events.abort, events.clientError, events.serverError],\n error: [events.clientError, events.serverError],\n unknown: []\n}\n\nObject.values(events).forEach(name => {\n addEventListener(name, event => {\n if (logLevels[currentLevel].includes(event.type)) {\n const { target, detail } = event\n console[currentLevel](event.type, { target, detail })\n }\n })\n})\n\nexport default {\n get level() {\n return currentLevel\n },\n set level(value) {\n if (!Object.keys(logLevels).includes(value)) value = 'unknown'\n return (currentLevel = value)\n }\n}\n", "function v4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n )\n}\n\nexport default { v4 }\n", "import './turbo'\nimport schema from './schema'\nimport { dispatch, commandEvents, stateEvents } from './events'\nimport activity from './activity'\nimport confirmation from './confirmation'\nimport delegates from './delegates'\nimport drivers from './drivers'\nimport meta from './meta'\nimport elements from './elements'\nimport lifecycle from './lifecycle'\nimport logger from './logger'\nimport state from './state'\nimport urls from './urls'\nimport uuids from './uuids'\n\nfunction buildCommandPayload(id, element) {\n return {\n id, // uniquely identifies the command\n name: element.getAttribute(schema.commandAttribute),\n elementId: element.id.length > 0 ? element.id : null,\n elementAttributes: elements.buildAttributePayload(element),\n startedAt: Date.now()\n }\n}\n\nasync function invokeCommand(event) {\n let element\n let payload = {}\n\n try {\n element = elements.findClosestCommand(event.target)\n if (!element) return\n if (!delegates.isRegisteredForElement(event.type, element)) return\n\n const commandId = `turbo-command-${uuids.v4()}`\n let driver = drivers.find(element)\n let payload = {\n ...buildCommandPayload(commandId, element),\n driver: driver.name,\n frameId: driver.frame ? driver.frame.id : null,\n src: driver.src\n }\n\n const startEvent = await dispatch(commandEvents.start, element, {\n cancelable: true,\n detail: payload\n })\n\n if (startEvent.defaultPrevented || (startEvent.detail.confirmation && event.defaultPrevented))\n return dispatch(commandEvents.abort, element, {\n detail: {\n message: `An event handler for '${commandEvents.start}' prevented default behavior and blocked command invocation!`,\n source: startEvent\n }\n })\n\n // the element and thus the driver may have changed based on the start event handler(s)\n driver = drivers.find(element)\n payload = {\n ...buildCommandPayload(commandId, element),\n driver: driver.name,\n frameId: driver.frame ? driver.frame.id : null,\n src: driver.src\n }\n\n activity.add(payload)\n\n if (['frame', 'window'].includes(driver.name)) event.preventDefault()\n\n meta.busy = true\n setTimeout(() => (meta.busy = false), 10)\n\n switch (driver.name) {\n case 'method':\n return driver.invokeCommand(element, payload)\n case 'form':\n return driver.invokeCommand(element, payload, event)\n case 'frame':\n return driver.invokeCommand(driver.frame, payload)\n case 'window':\n return driver.invokeCommand(payload)\n }\n } catch (error) {\n dispatch(commandEvents.clientError, element, {\n detail: { ...payload, error }\n })\n }\n}\n\nself.TurboBoost = self.TurboBoost || {}\n\nself.TurboBoost = {\n ...self.TurboBoost,\n\n stateEvents,\n\n get state() {\n return state.current\n },\n\n get stateDelta() {\n return state.delta\n }\n}\n\nif (!self.TurboBoost.Commands) {\n // wire things up and setup defaults for event delegation\n delegates.handler = invokeCommand\n delegates.register('click', [`[${schema.commandAttribute}]`])\n delegates.register('submit', [`form[${schema.commandAttribute}]`])\n delegates.register(schema.turboSubmitStartEvent, [`form[${schema.commandAttribute}]`])\n delegates.register('change', [\n `input[${schema.commandAttribute}]`,\n `select[${schema.commandAttribute}]`,\n `textarea[${schema.commandAttribute}]`\n ])\n\n self.TurboBoost.Commands = {\n confirmation,\n logger,\n schema,\n events: commandEvents,\n registerEventDelegate: delegates.register,\n get eventDelegates() {\n return delegates.events\n }\n }\n}\n\nexport default self.TurboBoost.Commands\n", "export function template (html) {\n let template = document.createElement('template')\n template.innerHTML = html\n return template\n}\n\nexport function appendHTML (html, parent) {\n parent = parent || document.body\n const clone = template(html).content.cloneNode(true)\n const child = clone.querySelector('*')\n return parent.appendChild(child)\n}\n\nexport function addHighlight (element, options = {}) {\n if (!element) return\n removeHighlight(element)\n let { outline, outlineOffset } = options\n\n outline = outline || 'dashed 3px red'\n outlineOffset = outlineOffset || '0px'\n\n element.originalStyles = element.originalStyles || {\n display: element.style.display,\n minHeight: element.style.minHeight,\n minWidth: element.style.minWidth,\n outline: element.style.outline,\n outlineOffset: element.style.outlineOffset\n }\n\n if (\n getComputedStyle(element).display.match(/^inline$/i) &&\n element.offsetWidth === 0 &&\n element.offsetHeight === 0\n ) {\n element.style.display = 'inline-block'\n element.style.minHeight = '2px'\n element.style.minWidth = '2px'\n }\n element.style.outline = outline\n element.style.outlineOffset = outlineOffset\n element.dataset.turboBoostHighlight = true\n}\n\nexport function removeHighlight (element) {\n if (!element) return\n if (element.originalStyles) {\n for (const [key, value] of Object.entries(element.originalStyles))\n value ? (element.style[key] = value) : (element.style[key] = '')\n delete element.originalStyles\n }\n delete element.dataset.turboBoostHighlight\n}\n\nexport function coordinates (element) {\n if (!element) return {}\n const rect = element.getBoundingClientRect()\n const width = element.offsetWidth\n const height = element.offsetHeight\n const top = rect.top + window.scrollY\n const left = rect.left + window.scrollX\n const right = left + width\n const bottom = top + height\n return { top, left, right, bottom, width, height }\n}\n\nexport function attempt (callback) {\n try {\n callback()\n } catch {}\n}\n", "export default class DevtoolElement extends HTMLElement {\n constructor () {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.labelElement.addEventListener('click', event => {\n event.preventDefault()\n this.toggle()\n })\n this.checkboxElement.addEventListener('change', event =>\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n )\n }\n\n toggle () {\n this.checked ? this.uncheck() : this.check()\n }\n\n check () {\n this.checkboxElement.checked = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n uncheck () {\n this.checkboxElement.checked = false\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n get name () {\n return this.getAttribute('name')\n }\n\n get checked () {\n return this.checkboxElement.checked\n }\n\n get checkboxElement () {\n return this.shadowRoot.querySelector('input')\n }\n\n get labelElement () {\n return this.shadowRoot.querySelector('label')\n }\n\n get html () {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <input name=\"checkbox\" type=\"checkbox\">\n <label for=\"checkbox\"><slot name=\"label\"></slot></label>\n </div>\n `\n }\n\n get stylesheet () {\n return `\n :host, :host * {\n cursor: pointer;\n }\n\n div {\n display: flex;\n margin-right: 10px;\n }\n\n input:checked + label{\n font-weight: bold;\n }\n\n label {\n color: black;\n }\n `\n }\n}\n", "import { appendHTML } from '../utils/dom.js'\n\nexport default class SupervisorElement extends HTMLElement {\n constructor () {\n super()\n this.enabledDevtools = {}\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.shadowRoot.querySelector('button').addEventListener('click', () =>\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-close', {\n bubbles: true\n })\n )\n )\n\n this.addEventListener('change', event => {\n const devtoolElement = event.target\n const { checked, name } = devtoolElement\n checked ? this.enableDevtool(name) : this.disableDevtool(name)\n })\n }\n\n enableDevtool (name) {\n if (this.enabledDevtools[name]) return\n this.enabledDevtools[name] = true\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-enable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n disableDevtool (name) {\n if (!this.enabledDevtools[name]) return\n delete this.enabledDevtools[name]\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-disable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n close () {\n this.devtoolElements.forEach(el => {\n if (el.checked) el.uncheck()\n })\n this.remove()\n }\n\n get devtoolElements () {\n return this.querySelectorAll('[slot=\"devtool\"]')\n }\n\n get closeElement () {\n return this.querySelector('button')\n }\n\n get html () {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n <slot name=\"devtool\"></slot>\n <button>\u2715</button>\n </div>\n `\n }\n\n get stylesheet () {\n return `\n :host {\n background-color: gainsboro;\n border-radius: 5px;\n bottom: 20px;\n display: block;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n left: 50%;\n outline-offset: 1px;\n outline: solid 2px black;\n padding: 5px 10px;\n position: fixed;\n transform: translateX(-50%);\n z-index: 8999;\n }\n\n * {\n -webkit-user-select: none;\n font-family: helvetica, sans-serif;\n font-size: 1rem;\n user-select: none;\n }\n\n img {\n align-self: center;\n cursor: grab;\n height: 25px;\n margin-left: -5px;\n vertical-align: middle;\n }\n\n div {\n display: flex;\n gap: 0 5px;\n position: relative;\n }\n\n [slot=\"devtool\"] {\n align-self: center;\n }\n\n button {\n align-self: center;\n background-color: darkgray;\n border-radius: 50%;\n border: none;\n color: black;\n cursor: pointer;\n font-size: 10px;\n height: 18px;\n line-height: 18px;\n margin-right: -5px;\n opacity: 0.5;\n outline: solid 1px black;\n padding: 0 2px;\n width: 18px;\n }\n\n button:hover {\n opacity: 1;\n }\n `\n }\n}\n", "export default class TooltipElement extends HTMLElement {\n constructor () {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n }\n\n connectedCallback () {\n const savedTransform = localStorage.getItem(\n `turbo-boost-devtools-${location.href}-${this.id}-transform`\n )\n\n if (savedTransform) {\n this.style.transform = savedTransform\n }\n }\n\n disconnectedCallback () {\n if (this.id !== 'undefined' && this.id !== '') {\n localStorage.setItem(\n `turbo-boost-devtools-${location.href}-${this.id}-transform`,\n this.style.transform\n )\n }\n }\n\n get color () {\n return this.getAttribute('color') || 'darkslategray'\n }\n\n get backgroundColor () {\n return this.getAttribute('background-color') || 'gainsboro'\n }\n\n get position () {\n return this.getAttribute('position') || 'top'\n }\n\n get html () {\n return `\n <style>${this.stylesheet}</style>\n <div role=\"container\">\n <div role=\"title\">\n <slot name=\"title\"></slot>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n </div>\n <slot name=\"subtitle\"></slot>\n <slot name=\"content-top\"></slot>\n <slot name=\"content\"></slot>\n <slot name=\"content-bottom\"></slot>\n </div>\n `\n }\n\n get stylesheet () {\n return `\n :host {\n display: block;\n position: absolute;\n z-index: 8999;\n }\n\n * {\n color: ${this.color}\n font-size: 1rem;\n }\n\n [role=\"container\"] {\n background-color: ${this.backgroundColor};\n border-radius: 15px;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n font-family: monospace;\n min-height: 30px;\n min-width: 100px;\n opacity: 0.9;\n outline-offset: 1px;\n outline: dashed 3px ${this.color};\n padding: 12px;\n position: relative;\n white-space: nowrap;\n }\n\n [role=\"title\"] {\n display: flex;\n }\n\n [role=\"title\"] slot[name=\"title\"] {\n color: ${this.color};\n display: block;\n flex-grow: 1;\n font-weight: bold;\n }\n\n [role=\"title\"] img {\n height: 25px;\n vertical-align: middle;\n }\n\n slot[name=\"subtitle\"] {\n border-bottom: dotted 1px ${this.color};\n border-top: dotted 1px ${this.color};\n color: ${this.color};\n display: block;\n font-size: 0.8rem;\n font-weight: lighter;\n margin-bottom: 12px;\n margin-top: 8px;\n padding-bottom: 4px;\n padding-top: 4px;\n width: 100%;\n }\n\n slot[name=\"content-top\"],\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n display: block;\n font-weight: normal;\n }\n\n slot[name=\"content-top\"] {\n color: ${this.color};\n margin-bottom: 8px;\n }\n\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n opacity: 0.7;\n padding-left: 12px;\n }\n\n slot[name=\"content\"] {\n color: ${this.color};\n }\n\n slot[name=\"content-bottom\"] {\n color: red;\n }\n `\n }\n}\n", "const added = []\n\nconst dependencies = {\n LeaderLine: {\n src:\n 'https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js',\n integrity:\n 'sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==',\n global: 'LeaderLine'\n },\n\n PlainDraggable: {\n src:\n 'https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js',\n global: 'PlainDraggable'\n }\n}\n\nfunction exists (dependency) {\n if (dependency.global && self[dependency.global]) return true\n if (document.querySelector(`[src='${dependency.src}']`)) return true\n return added.includes(dependency)\n}\n\nfunction add (dependency) {\n if (exists(dependency)) return\n added.push(dependency)\n\n const { src, integrity } = dependency\n const script = document.createElement('script')\n script.setAttribute('src', src)\n script.setAttribute('crossorigin', 'anonymous')\n script.setAttribute('referrerpolicy', 'no-referrer')\n if (integrity) script.setAttribute('integrity', integrity)\n document.head.appendChild(script)\n}\n\nfunction remove (dependency) {\n if (!added.includes(dependency)) return\n added.splice(added.indexOf(dependency), 1)\n\n const { src } = dependency\n const el = document.querySelector(`script[src='${src}']`)\n if (el) el.remove()\n if (dependency.global && self[dependency.global])\n self[dependency.global] = null\n}\n\nfunction removeAll () {\n ;[...added].forEach(dependency => remove(dependency))\n}\n\nexport default { ...dependencies, add, remove, removeAll }\n", "import { appendHTML } from './utils/dom'\nimport DevtoolElement from './elements/devtool_element'\nimport SupervisorElement from './elements/supervisor_element'\nimport TooltipElement from './elements/tooltip_element'\nimport dependencies from './dependencies'\n\ncustomElements.define('turbo-boost-devtool', DevtoolElement)\ncustomElements.define('turbo-boost-devtool-supervisor', SupervisorElement)\ncustomElements.define('turbo-boost-devtool-tooltip', TooltipElement)\n\nlet supervisorElement\n\nfunction makeDraggable () {\n if (!supervisorElement) return\n try {\n new PlainDraggable(supervisorElement)\n } catch {\n setTimeout(makeDraggable, 200)\n }\n}\n\nfunction stop () {\n if (stopped()) return\n supervisorElement.close()\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-stop', {\n bubbles: true\n })\n )\n supervisorElement = null\n dependencies.removeAll()\n}\n\nfunction start () {\n if (started()) return\n dependencies.add(dependencies.LeaderLine)\n dependencies.add(dependencies.PlainDraggable)\n supervisorElement = appendHTML(\n '<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>'\n )\n setTimeout(makeDraggable, 200)\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-start', {\n bubbles: true\n })\n )\n}\n\nfunction restart () {\n const enabledList = supervisorElement\n ? Object.keys(supervisorElement.enabledDevtools)\n : []\n\n stop()\n start()\n\n supervisorElement.devtoolElements.forEach(el => {\n if (enabledList.includes(el.name)) el.check()\n })\n}\n\nfunction started () {\n return !!supervisorElement\n}\n\nfunction stopped () {\n return !started()\n}\n\nlet restartTimeout\nfunction debouncedRestart () {\n clearTimeout(restartTimeout)\n restartTimeout = setTimeout(restart, 25)\n}\n\nfunction autoRestart () {\n if (started()) debouncedRestart()\n}\n\naddEventListener('turbo:load', autoRestart)\naddEventListener('turbo-frame:load', autoRestart)\naddEventListener('turbo-boost:devtools-connect', autoRestart)\naddEventListener('turbo-boost:devtools-close', stop)\n\nif (window.TurboBoost) {\n addEventListener(TurboBoost.Commands.events.success, autoRestart)\n addEventListener(TurboBoost.Commands.events.finish, autoRestart)\n}\n\nfunction register (name, label) {\n if (!supervisorElement) return\n return appendHTML(\n `\n <turbo-boost-devtool name=\"${name}\" slot=\"devtool\">\n <span slot=\"label\">${label}</span>\n </turbo-boost-devtool>\n `,\n supervisorElement\n )\n}\n\nfunction enabled (name) {\n if (!supervisorElement) return false\n return supervisorElement.enabledDevtools[name]\n}\n\nexport default {\n enabled,\n register,\n start,\n stop,\n restart: debouncedRestart,\n get started () {\n return started()\n },\n get stopped () {\n return stopped()\n }\n}\n", "// Icons courtesy of https://feathericons.com/\nimport supervisor from './supervisor'\nimport {\n appendHTML,\n addHighlight,\n attempt,\n coordinates,\n removeHighlight\n} from './utils/dom.js'\n\nfunction appendTooltip (title, subtitle, content, options = {}) {\n let { backgroundColor, color, position, id } = options\n color = color || 'white'\n position = position || 'top'\n return appendHTML(`\n <turbo-boost-devtool-tooltip id=\"${id}\" position=\"${position}\" background-color=\"${backgroundColor}\" color=\"${color}\">\n <div slot='title'>${title}</div>\n <div slot='subtitle'>${subtitle}</div>\n ${content}\n </turbo-boost-devtool-tooltip>\n `)\n}\n\nlet activeTarget\n\nexport default class Devtool {\n constructor (delegate) {\n this.delegate = delegate\n\n let hideTimeout\n const debouncedHide = () => {\n clearTimeout(hideTimeout)\n hideTimeout = setTimeout(this.hide({ active: false }), 25)\n }\n\n this.eventListeners['turbo-boost:devtool-enable'] = event => {\n // LeaderLine.positionByWindowResize = false\n const { name } = event.detail\n if (name !== this.delegate.name) return\n\n addHighlight(this.delegate.triggerElement, {\n outline: '3px dashed blueviolet',\n outlineOffset: '2px'\n })\n\n this.hide({ active: false })\n if (this.active) this.show()\n }\n\n this.eventListeners['turbo-boost:devtool-disable'] = event => {\n const { name } = event.detail\n if (name === this.delegate.name)\n removeHighlight(this.delegate.triggerElement)\n }\n\n this.eventListeners['click'] = event => {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n debouncedHide()\n }\n\n this.eventListeners['turbo:load'] = debouncedHide\n this.eventListeners['turbo-frame:load'] = debouncedHide\n if (window.TurboBoost) {\n this.eventListeners[TurboBoost.Commands.events.finish] = debouncedHide\n }\n\n this.registerEventListeners()\n }\n\n registerEventListeners () {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n addEventListener(type, listener)\n })\n }\n\n unregisterEventListeners () {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n removeEventListener(type, listener)\n })\n }\n\n get eventListeners () {\n return this._eventListeners || (this._eventListeners = {})\n }\n\n show () {\n if (!this.enabled) return\n\n if (this.active) return\n this.active = true\n\n this.hide({ active: true })\n\n addHighlight(this.delegate.targetElement, {\n outline: '3px dashed darkcyan',\n outlineOffset: '-2px'\n })\n\n addHighlight(this.delegate.morphElement, {\n outline: '3px dashed chocolate',\n outlineOffset: '3px'\n })\n\n this.renderingTooltip = this.createRenderingTooltip()\n this.targetTooltip = this.createTargetTooltip()\n this.triggerTooltip = this.createTriggerTooltip(\n this.targetTooltip,\n this.renderingTooltip\n )\n\n document\n .querySelectorAll('.leader-line')\n .forEach(el => (el.style.zIndex = 100000))\n\n const data = {\n morph: {\n partial: this.delegate.triggerElement.renders,\n id: this.delegate.triggerElement.morphs,\n status: this.delegate.morphElement ? 'OK' : 'Not Found'\n },\n trigger: { partial: null, id: null, status: 'Not Found' },\n target: { partial: null, id: null, status: 'Not Found' }\n }\n\n if (this.delegate.triggerElement) {\n data.trigger = {\n partial: this.delegate.triggerElement.partial,\n id: this.delegate.triggerElement.id,\n status: 'OK'\n }\n data.target.id = this.delegate.triggerElement.controls\n }\n\n if (this.delegate.targetElement)\n data.target = {\n partial: this.delegate.targetElement.partial,\n dom_id: this.delegate.targetElement.id,\n status: 'OK'\n }\n\n console.table(data)\n }\n\n hide ({ active: active = false }) {\n document\n .querySelectorAll('turbo-boost-devtool-tooltip')\n .forEach(tooltip => {\n attempt(() => tooltip.line.remove())\n attempt(() => tooltip.drag.remove())\n attempt(() => tooltip.lineToRendering.remove())\n attempt(() => tooltip.lineToTarget.remove())\n attempt(() => tooltip.remove())\n })\n\n document.querySelectorAll('[data-turbo-boost-highlight]').forEach(el => {\n if (!el.tagName.match(/turbo-boost-toggle-trigger/i)) removeHighlight(el)\n })\n\n this.active = active\n }\n\n get active () {\n return activeTarget === this.delegate\n }\n\n set active (value) {\n if (value) activeTarget = this.delegate\n else activeTarget = null\n }\n\n get enabled () {\n return supervisor.enabled(this.delegate.name)\n }\n\n static register (name, label) {\n supervisor.register(name, label)\n }\n\n createRenderingTooltip () {\n if (!this.delegate.triggerElement.renders)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.`\n )\n\n if (!this.delegate.triggerElement.morphs)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19l7-7 3 3-7 7-3-3z\"></path><path d=\"M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z\"></path><path d=\"M2 2l7.586 7.586\"></path><circle cx=\"11\" cy=\"11\" r=\"2\"></circle></svg>\n RENDERING - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;\n `\n const subtitle = `\n <b>partial</b>: ${this.delegate.triggerElement.renders || 'unknown'}<br>\n <b>morphs</b>: ${this.delegate.triggerElement.morphs || 'unknown'}<br>\n `\n const content = `\n <div slot=\"content-top\" style=\"font-size:85%; font-style:italic; font-weight:100;\">\n The <b>TRIGGER</b> toggles the <b>TARGET</b> then renders the partial &amp; morphs the element.<br>\n </div>\n `\n const tooltip = appendTooltip(title, subtitle, content, {\n id: `${this.delegate.id}-rendering`,\n backgroundColor: 'lightyellow',\n color: 'chocolate'\n })\n\n const coords = coordinates(this.delegate.morphElement)\n const top = Math.ceil(\n coords.top + coords.height / 2 - tooltip.offsetHeight / 2\n )\n const left = Math.ceil(coords.left + coords.width + 100)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.morphElement, {\n ...this.leaderLineOptions,\n color: 'chocolate'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTargetTooltip () {\n if (!this.delegate.targetElement)\n return console.debug(\n `Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><circle cx=\"12\" cy=\"12\" r=\"6\"></circle><circle cx=\"12\" cy=\"12\" r=\"2\"></circle></svg>\n TARGET - &lt;${this.delegate.targetElement.tagName.toLowerCase()}&gt;\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.targetTooltipData?.subtitle || '',\n this.delegate.targetTooltipData?.content || '',\n {\n id: `${this.delegate.id}-target`,\n backgroundColor: 'lightcyan',\n color: 'darkcyan',\n position: 'bottom'\n }\n )\n\n const coords = coordinates(this.delegate.targetElement)\n const top = Math.ceil(coords.top + tooltip.offsetHeight)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.targetElement, {\n ...this.leaderLineOptions,\n color: 'darkcyan'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTriggerTooltip (targetTooltip, renderingTooltip) {\n if (!this.delegate.triggerElement) return\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"></polygon></svg>\n TRIGGER - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.triggerTooltipData?.subtitle || '',\n this.delegate.triggerTooltipData?.content || '',\n {\n id: `${this.delegate.id}-trigger`,\n backgroundColor: 'lavender',\n color: 'blueviolet'\n }\n )\n\n const coords = coordinates(this.delegate.triggerElement)\n const top = Math.ceil(coords.top - tooltip.offsetHeight * 2)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(this.delegate.triggerElement, tooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet'\n })\n\n if (targetTooltip) {\n tooltip.lineToTarget = new LeaderLine(tooltip, targetTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.targetLineLabel,\n size: 2.1\n })\n\n targetTooltip.drag.onMove = () => {\n targetTooltip.line.position()\n tooltip.lineToTarget?.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n if (renderingTooltip) {\n tooltip.lineToRendering = new LeaderLine(tooltip, renderingTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.renderingLineLabel,\n size: 2.1\n })\n\n renderingTooltip.drag.onMove = () => {\n renderingTooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n tooltip.drag = new PlainDraggable(tooltip)\n tooltip.drag.onMove = () => {\n tooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n if (tooltip.lineToRendering) tooltip.lineToRendering.position()\n }\n\n return tooltip\n }\n\n get leaderLineOptions () {\n return {\n dash: { animation: true },\n dropShadow: { opacity: 0.3 },\n endPlug: 'arrow3',\n endPlugSize: 1.7,\n size: 3,\n startPlug: 'disc',\n startPlugSize: 1\n }\n }\n}\n", "import supervisor from './supervisor'\nimport Devtool from './devtool'\n\nconst { restart, start, stop } = supervisor\n\nfunction decorateElementWithDevtool (element, name, label) {\n Object.assign(element, {\n initializeDevtool () {\n const mouseenter = () => this.devtool.show()\n\n addEventListener('turbo-boost:devtools-start', () => {\n this.devtool = new Devtool(this)\n this.addEventListener('mouseenter', mouseenter)\n })\n\n addEventListener('turbo-boost:devtools-stop', () => {\n this.removeEventListener('mouseenter', mouseenter)\n this.removeDevtool()\n })\n\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-connect', { bubbles: true })\n )\n },\n hideDevtool () {\n this.devtool?.hide({ active: false })\n },\n removeDevtool () {\n this.devtool.hide({ active: false })\n this.devtool.unregisterEventListeners()\n delete this.devtool\n },\n name,\n targetLineLabel: label\n })\n\n // the element references below are defaults that are placed on the receiver if not present\n const properties = ['triggerElement', 'morphElement', 'targetElement']\n\n properties\n .filter(property => {\n return element[property] === undefined\n })\n .forEach(property => {\n Object.defineProperty(element, property, {\n get () {\n return element\n }\n })\n })\n}\n\n//;(async () => {\n// // we cannot detect customElements.get(\"cable-ready-updates-for\") because they are lazily initialized\n// if (window.CableReady) await import('./delegates/cable_ready.js')\n//})()\n\nexport { Devtool, decorateElementWithDevtool }\n\nexport default { restart, start, stop }\n", "export default class TurboBoostElement extends HTMLElement {\n constructor(html) {\n super()\n this.devtool = 'unknown'\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = html || '<slot></slot>'\n }\n\n connectedCallback() {\n this.ensureId()\n }\n\n ensureId() {\n if (this.id.trim().length) return\n this.id = `${this.tagName}-${this.uuidv4()}`.toLowerCase()\n }\n\n // SEE: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid\n uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n )\n }\n\n get viewStack() {\n const value = this.getAttribute('view-stack')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get partial() {\n return this.viewStack[0]\n }\n}\n", "import TurboBoostElement from '../../turbo_boost_element'\n\nconst html = `\n <turbo-boost>\n <slot name=\"busy\" hidden></slot>\n <slot></slot>\n </turbo-boost>\n`\n\nexport const busyDelay = 100 // milliseconds - time to wait before showing busy element\nexport const busyDuration = 400 // milliseconds - minimum time that busy element is shown\n\nexport default class ToggleElement extends TurboBoostElement {\n constructor() {\n super(html)\n }\n\n // TODO: Should we timeout after a theoretical max wait time?\n // The idea being that a server error occurred and the toggle failed.\n showBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n this.busyStartedAt = Date.now() + busyDelay\n this.showBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = false\n this.defaultSlotElement.hidden = true\n }, busyDelay)\n }\n\n hideBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n let delay = busyDuration - (Date.now() - this.busyStartedAt)\n if (delay < 0) delay = 0\n\n delete this.busyStartedAt\n this.hideBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = true\n this.defaultSlotElement.hidden = false\n }, delay)\n }\n\n get busyElement() {\n return this.querySelector(':scope > [slot=\"busy\"]')\n }\n\n get busySlotElement() {\n return this.shadowRoot.querySelector('slot[name=\"busy\"]')\n }\n\n get defaultSlotElement() {\n return this.shadowRoot.querySelector('slot:not([name])')\n }\n\n // indicates if an rpc call is active/busy\n get busy() {\n return this.getAttribute('busy') === 'true'\n }\n\n // indicates if an rpc call is active/busy\n set busy(value) {\n value = !!value\n if (this.busy === value) return\n this.setAttribute('busy', value)\n if (value) this.showBusyElement()\n else this.hideBusyElement()\n }\n\n get busyStartedAt() {\n if (!this.dataset.busyStartedAt) return 0\n return Number(this.dataset.busyStartedAt)\n }\n\n set busyStartedAt(value) {\n this.dataset.busyStartedAt = value\n }\n}\n", "import ToggleElement from '../toggle_element'\n\nexport default class ToggleTargetElement extends ToggleElement {\n connectedCallback() {\n super.connectedCallback()\n\n this.mouseenterHandler = this.onMouseenter.bind(this)\n this.addEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseHandler = this.collapse.bind(this)\n this.collapseNowHandler = this.collapseNow.bind(this)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.addEventListener(name, this.collapseNowHandler)\n } else {\n this.addEventListener(name, this.collapseHandler)\n }\n })\n }\n\n disconnectedCallback() {\n this.removeEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.removeEventListener(name, this.collapseNowHandler)\n } else {\n this.removeEventListener(name, this.collapseHandler)\n }\n })\n }\n\n // TODO: get cached content working properly\n // perhaps use a mechanic other than morph\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n cacheHTML() {\n // this.cachedHTML = this.innerHTML\n }\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n renderCachedHTML() {\n // if (!this.cachedHTML) return\n // this.innerHTML = this.cachedHTML\n }\n\n onMouseenter() {\n clearTimeout(this.collapseTimeout)\n }\n\n collapse(delay = 250) {\n clearTimeout(this.collapseTimeout)\n if (this.busy) return\n if (typeof delay !== 'number') delay = 250\n\n if (delay > 0) return (this.collapseTimeout = setTimeout(() => this.collapse(0), delay))\n\n this.innerHTML = ''\n try {\n this.expanded = false\n this.triggerElement.hideDevtool()\n } catch {}\n }\n\n collapseNow(event) {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n this.collapse(0)\n }\n\n collapseMatches() {\n document.querySelectorAll(this.collapseSelector).forEach(el => {\n if (el.id === this.id) return\n if (el.collapse) el.collapse(0)\n })\n }\n\n get collapseSelector() {\n return this.triggerElement.collapseSelector || this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector')\n }\n\n // the active trigger\n get triggerElement() {\n return document.getElementById(this.labeledBy)\n }\n\n // all triggers\n get triggerElements() {\n return document.querySelectorAll(`[aria-controls=\"${this.id}\"]`)\n }\n\n // the dom id of the active trigger\n get labeledBy() {\n return this.getAttribute('aria-labeledby')\n }\n\n set labeledBy(value) {\n return this.setAttribute('aria-labeledby', value)\n }\n\n get collapseOn() {\n const value = this.getAttribute('collapse-on')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get expanded() {\n return this.triggerElement ? this.triggerElement.expanded : false\n }\n\n set expanded(value) {\n this.triggerElements.forEach(el => (el.expanded = value))\n }\n\n get busy() {\n return this.triggerElement && this.triggerElement.busy\n }\n}\n", "let focusTimeout\n\nfunction deactivateTrixAttributes(editor) {\n const attributes = ['bold', 'bullet', 'code', 'heading1', 'href', 'italic', 'number', 'quote', 'strike']\n attributes.forEach(name => editor.deactivateAttribute(name))\n}\n\nfunction focusTrixEditorElement(element) {\n if (element.value.length === 0) return\n\n const editor = element.editor\n\n // move cursor to the end\n let lastRange = []\n while (lastRange[0] !== editor.getSelectedRange()[0] && lastRange[1] !== editor.getSelectedRange()[1]) {\n lastRange = editor.getSelectedRange()\n editor.moveCursorInDirection('forward')\n }\n\n // insert an empty char and select it\n editor.insertString(' ')\n editor.moveCursorInDirection('forward')\n editor.setSelectedRange([lastRange[1], editor.getSelectedRange()[1]])\n\n // deactivate all trix features for the selection\n deactivateTrixAttributes(editor)\n\n // move cursor to end and collapse the selection\n editor.setSelectedRange([editor.getSelectedRange()[1], editor.getSelectedRange()[1]])\n}\n\nfunction debouncedFocus(element) {\n clearTimeout(focusTimeout)\n\n focusTimeout = setTimeout(() => {\n if (!element) return\n\n element.focus()\n const trixEditorElement = element.closest('trix-editor')\n\n try {\n if (trixEditorElement) {\n focusTrixEditorElement(trixEditorElement)\n } else {\n element.selectionStart = element.selectionEnd = element.value.length\n }\n } catch (_) {\n } finally {\n element.scrollIntoView({ block: 'center', behavior: 'smooth' })\n }\n }, 100)\n}\n\nexport default element => debouncedFocus(element)\n", "import { Devtool, decorateElementWithDevtool } from '@turbo-boost/devtools'\n\nimport ToggleElement, { busyDuration } from '../toggle_element'\nimport focus from './focus'\n\ndocument.addEventListener('turbo-boost:devtools-start', () => Devtool.register('toggle', 'toggles'))\n\nlet currentFocusSelector\n\nexport default class ToggleTriggerElement extends ToggleElement {\n constructor() {\n super()\n\n decorateElementWithDevtool(this, 'toggle', 'toggles')\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.commandStartHandler = this.onCommandStart.bind(this)\n this.addEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n this.beforeInvokeHandler = this.onBeforeInvoke.bind(this)\n addEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n // fires after receiving the toggle morph Turbo Stream but before it is executed\n // this.addEventListener(TurboBoost.Commands.events.success, event => {\n // // TODO: imlement cache, this.targetElement.cacheHTML()\n // })\n\n this.initializeDevtool()\n }\n\n disconnectedCallback() {\n // delay cleanup because the trigger may have been morphed out of the DOM,\n // but it's needed to apply behavior like focus etc...\n setTimeout(() => {\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.removeEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n removeEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n this.removeDevtool()\n }, 1000)\n }\n\n onCommandStart(event) {\n currentFocusSelector = this.focusSelector\n this.targetElement.labeledBy = this.id\n this.targetElement.collapseMatches()\n this.busy = true\n // TODO: implement cache - this.targetElement.renderCachedHTML()\n }\n\n // runs before an invoke turbo stream is executed\n onBeforeInvoke(event) {\n // return early if we're not the element responsible for this invoke\n if (event.detail.method !== 'morph') return\n if (event.target.id !== this.morphs) return\n const selector = `turbo-boost-toggle-target[aria-labeledby=\"${this.id}\"]`\n if (!event.target.querySelector(selector)) return\n\n // ensure the busy element is shown long enough for a good user experience\n // we accomplish this by modifying the event.detail with invoke instructions i.e. { delay }\n // SEE: the TurboBoost Streams library for details on how this works\n const duration = Date.now() - this.busyStartedAt\n let delay = busyDuration - duration\n if (delay < 10) delay = 10\n event.detail.invoke = { delay }\n\n // runs before the morph is executed\n setTimeout(() => {\n this.busy = false\n this.morphToggleTriggerElements.forEach(el => (el.busy = false))\n }, delay - 10)\n\n // runs after the morph is executed\n setTimeout(() => focus(this.targetElement.querySelector(currentFocusSelector)), delay + 100)\n }\n\n // a list of views shared between the trigger and target\n get sharedViews() {\n if (!this.targetElement) return []\n if (!this.targetElement.viewStack) return []\n const reducer = (memo, view) => {\n if (this.targetElement.viewStack.includes(view)) memo.push(view)\n return memo\n }\n return this.viewStack.reduce(reducer.bind(this), [])\n }\n\n // the partial to render\n get renders() {\n return this.getAttribute('renders')\n }\n\n // the renderered partial's top wrapping dom_id\n get morphs() {\n return this.getAttribute('morphs')\n }\n\n // all toggle elements contained by the `morphElement`\n get morphToggleTriggerElements() {\n return Array.from(this.morphElement.querySelectorAll('turbo-boost-toggle-trigger'))\n }\n\n // the target's dom_id\n get controls() {\n return this.getAttribute('aria-controls')\n }\n\n get collapseSelector() {\n return this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector') || this.targetElement.focusSelector\n }\n\n // indicates if the toggle state should be remembered across requests\n get remember() {\n return this.getAttribute('remember') === 'true'\n }\n\n set remember(value) {\n return this.setAttribute('remember', !!value)\n }\n\n // indicates if the target is expanded\n get expanded() {\n return this.getAttribute('aria-expanded') === 'true'\n }\n\n set expanded(value) {\n this.setAttribute('aria-expanded', !!value)\n }\n\n // indicates if the target is expanded\n get collapsed() {\n return !this.expanded\n }\n\n // ------ DevToolDelegate ------\n get command() {\n return this.dataset.turboCommand\n }\n\n get renderingLineLabel() {\n return 'renders & morphs'\n }\n\n // the morph element\n get morphElement() {\n if (!this.morphs) return null\n return document.getElementById(this.morphs)\n }\n\n // the target element\n get targetElement() {\n if (!this.controls) return null\n return document.getElementById(this.controls)\n }\n\n get triggerTooltipData() {\n let content = this.triggerElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `\n <b>id</b>: ${this.triggerElement.id}<br>\n <b>aria-controls</b>: ${this.triggerElement.controls}<br>\n <b>aria-expanded</b>: ${this.triggerElement.expanded}<br>\n <b>remember</b>: ${this.triggerElement.remember}<br>\n `,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n\n get targetTooltipData() {\n let content = this.targetElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `<b>id</b>: ${this.targetElement.id}<br>\n <b>aria-labeled-by</b>: ${this.targetElement.labeledBy}<br>\n`,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n}\n", "import TurboBoostElement from './turbo_boost_element'\nimport ToggleTargetElement from './toggle_elements/target_element'\nimport ToggleTriggerElement from './toggle_elements/trigger_element'\n\n// Valid custom element names: https://html.spec.whatwg.org/#valid-custom-element-name\n\ncustomElements.define('turbo-boost', TurboBoostElement)\ncustomElements.define('turbo-boost-toggle-target', ToggleTargetElement)\ncustomElements.define('turbo-boost-toggle-trigger', ToggleTriggerElement)\n", "import '@turbo-boost/commands'\nimport devtools from '@turbo-boost/devtools'\nimport './elements'\n\nself.TurboBoost = self.TurboBoost || {}\nself.TurboBoost.devtools = devtools\nself.TurboBoost.Elements = {}\n\nexport default self.TurboBoost.Elements\n"],
5
- "mappings": "6aAAMA,GAAN,KAAW,CACT,IAAI,SAAU,CACZ,OAAO,SAAS,cAAc,0BAA0B,CAC1D,CAEA,IAAI,OAAQ,CACV,OAAO,KAAK,QAAQ,aAAa,SAAS,CAC5C,CAEA,IAAI,MAAO,CACT,OAAO,KAAK,QAAQ,QAAQ,OAAS,MACvC,CAEA,IAAI,KAAKC,EAAO,CACd,OAAQ,KAAK,QAAQ,QAAQ,KAAO,CAAC,CAACA,CACxC,CACF,EAEOC,EAAQ,IAAIF,GClBNG,EAAgB,CAC3B,MAAO,4BACP,QAAS,8BACT,OAAQ,6BACR,MAAO,4BACP,YAAa,mCACb,YAAa,kCACf,EAEaC,EAAc,CACzB,UAAW,yBACX,YAAa,0BACf,EAEaC,EAAYC,EAAAA,EAAA,CAAA,EAAKH,CAAAA,EAAkBC,CAAAA,EAEzC,SAASG,EAASC,EAAMC,EAAQC,EAAU,CAAC,EAAG,CACnD,OAAO,IAAI,QAAQC,GAAW,CAC5BD,EAAUA,GAAW,CAAC,EACtBA,EAAQ,OAASA,EAAQ,QAAU,CAAC,EACpCD,EAASA,GAAU,SACnB,IAAMG,EAAM,IAAI,YAAYJ,EAAMK,EAAAP,EAAA,CAAA,EAAKI,CAAAA,EAAL,CAAc,QAAS,EAAK,CAAA,CAAC,EAC/DD,EAAO,cAAcG,CAAG,EACxBD,EAAQC,CAAG,CACb,CAAC,CACH,CCtBA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BAA8BC,CAAoB,ECJxE,KAAK,WAAa,KAAK,YAAc,CAAC,EACtC,KAAK,WAAW,SAAWC,GAC3B,KAAK,WAAW,SAAW,CAAC,EAE5B,IAAOC,GAAQ,KAAK,WAAW",
6
- "names": ["Meta", "value", "meta_default", "commandEvents", "stateEvents", "allEvents", "__spreadValues", "dispatch", "name", "target", "options", "resolve", "evt", "__spreadProps", "head", "observable", "object", "parent", "proxy", "key", "receiver", "index", "observable_default", "loadedState", "currentState", "changedState", "loadStateTimeout", "loadState", "loadStateLater", "json", "event", "state_default", "replaceDocument", "content", "tail", "headIndex", "tailIndex", "html", "append", "renderer_default", "active", "add", "payload", "remove", "id", "activity_default", "finish", "lifecycle_default", "frameSources", "frame", "fetchOptions", "acceptHeaders", "entry", "chunk", "i", "response", "error", "schema", "schema_default", "confirmation", "message", "isTurboMethod", "isTurboForm", "element", "shouldDelegate", "confirmation_default", "events", "eventListener", "register", "eventName", "selectors", "match", "getRegisteredEventForElement", "selector", "el", "isRegisteredForElement", "delegates_default", "fn", "findClosestCommand", "findClosestFrameWithSource", "assignElementValueToPayload", "memo", "option", "buildAttributePayload", "attr", "elements_default", "updateFormSubmission", "formSubmission", "_a", "invokeCommand", "form", "input", "form_default", "build", "urlString", "a", "url", "urls_default", "src", "frame_default", "method_default", "aborted", "xhr", "errored", "loaded", "ex", "window_default", "find", "turboFrame", "turboMethod", "drivers_default", "currentLevel", "logLevels", "detail", "logger_default", "v4", "c", "uuids_default", "buildCommandPayload", "commandId", "driver", "startEvent", "javascript_default", "template", "html", "appendHTML", "parent", "child", "addHighlight", "element", "options", "removeHighlight", "outline", "outlineOffset", "key", "value", "coordinates", "rect", "width", "height", "top", "left", "right", "bottom", "attempt", "callback", "e", "DevtoolElement", "event", "SupervisorElement", "devtoolElement", "checked", "name", "el", "TooltipElement", "savedTransform", "added", "dependencies", "exists", "dependency", "add", "src", "integrity", "script", "remove", "removeAll", "dependencies_default", "__spreadProps", "__spreadValues", "supervisorElement", "makeDraggable", "stop", "stopped", "start", "started", "restart", "enabledList", "restartTimeout", "debouncedRestart", "autoRestart", "register", "label", "enabled", "supervisor_default", "appendTooltip", "title", "subtitle", "content", "backgroundColor", "color", "position", "id", "activeTarget", "Devtool", "delegate", "hideTimeout", "debouncedHide", "type", "listener", "data", "active", "tooltip", "coords", "_a", "_b", "targetTooltip", "renderingTooltip", "decorateElementWithDevtool", "mouseenter", "property", "src_default", "TurboBoostElement", "html", "c", "value", "html", "busyDelay", "busyDuration", "ToggleElement", "TurboBoostElement", "delay", "value", "ToggleTargetElement", "ToggleElement", "entry", "parts", "name", "delay", "e", "event", "el", "value", "focusTimeout", "deactivateTrixAttributes", "editor", "name", "focusTrixEditorElement", "element", "lastRange", "debouncedFocus", "trixEditorElement", "_", "focus_default", "y", "currentFocusSelector", "ToggleTriggerElement", "ToggleElement", "kt", "commandStartEvent", "beforeInvokeEvent", "event", "selector", "duration", "delay", "busyDuration", "el", "focus_default", "reducer", "memo", "view", "value", "content", "index", "TurboBoostElement", "ToggleTargetElement", "ToggleTriggerElement", "Lt", "javascript_default"]
3
+ "sources": ["../../../javascript/index.js", "../../../../node_modules/@turbo-boost/devtools/src/version.js", "../../../../node_modules/@turbo-boost/devtools/src/utils/dom.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/devtool_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/supervisor_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/tooltip_element.js", "../../../../node_modules/@turbo-boost/devtools/src/dependencies.js", "../../../../node_modules/@turbo-boost/devtools/src/supervisor.js", "../../../../node_modules/@turbo-boost/devtools/src/devtool.js", "../../../../node_modules/@turbo-boost/devtools/src/index.js", "../../../javascript/version.js", "../../../javascript/elements/turbo_boost_element/index.js", "../../../javascript/elements/toggle_elements/toggle_element/index.js", "../../../javascript/elements/toggle_elements/target_element/index.js", "../../../javascript/elements/toggle_elements/trigger_element/focus.js", "../../../javascript/elements/toggle_elements/trigger_element/index.js", "../../../javascript/elements/index.js"],
4
+ "sourcesContent": ["import '@turbo-boost/commands'\nimport devtools from '@turbo-boost/devtools'\nimport VERSION from './version'\nimport './elements'\n\nself.TurboBoost = self.TurboBoost || {}\nself.TurboBoost.devtools = devtools\nself.TurboBoost.Elements = { VERSION }\n\nexport default self.TurboBoost.Elements\n", "export default '0.0.6'\n", "export function template(html) {\n let template = document.createElement('template')\n template.innerHTML = html\n return template\n}\n\nexport function appendHTML(html, parent) {\n parent = parent || document.body\n const clone = template(html).content.cloneNode(true)\n const child = clone.querySelector('*')\n return parent.appendChild(child)\n}\n\nexport function addHighlight(element, options = {}) {\n if (!element) return\n removeHighlight(element)\n let { outline, outlineOffset } = options\n\n outline = outline || 'dashed 3px red'\n outlineOffset = outlineOffset || '0px'\n\n element.originalStyles = element.originalStyles || {\n display: element.style.display,\n minHeight: element.style.minHeight,\n minWidth: element.style.minWidth,\n outline: element.style.outline,\n outlineOffset: element.style.outlineOffset\n }\n\n if (\n getComputedStyle(element).display.match(/^inline$/i) &&\n element.offsetWidth === 0 &&\n element.offsetHeight === 0\n ) {\n element.style.display = 'inline-block'\n element.style.minHeight = '2px'\n element.style.minWidth = '2px'\n }\n element.style.outline = outline\n element.style.outlineOffset = outlineOffset\n element.dataset.turboBoostHighlight = true\n}\n\nexport function removeHighlight(element) {\n if (!element) return\n if (element.originalStyles) {\n for (const [key, value] of Object.entries(element.originalStyles))\n value ? (element.style[key] = value) : (element.style[key] = '')\n delete element.originalStyles\n }\n delete element.dataset.turboBoostHighlight\n}\n\nexport function coordinates(element) {\n if (!element) return {}\n const rect = element.getBoundingClientRect()\n const width = element.offsetWidth\n const height = element.offsetHeight\n const top = rect.top + window.scrollY\n const left = rect.left + window.scrollX\n const right = left + width\n const bottom = top + height\n return { top, left, right, bottom, width, height }\n}\n\nexport function attempt(callback) {\n try {\n callback()\n } catch {}\n}\n", "export default class DevtoolElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.labelElement.addEventListener('click', event => {\n event.preventDefault()\n this.toggle()\n })\n this.checkboxElement.addEventListener('change', event =>\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n )\n }\n\n toggle() {\n this.checked ? this.uncheck() : this.check()\n }\n\n check() {\n this.checkboxElement.checked = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n uncheck() {\n this.checkboxElement.checked = false\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n get name() {\n return this.getAttribute('name')\n }\n\n get checked() {\n return this.checkboxElement.checked\n }\n\n get checkboxElement() {\n return this.shadowRoot.querySelector('input')\n }\n\n get labelElement() {\n return this.shadowRoot.querySelector('label')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <input name=\"checkbox\" type=\"checkbox\">\n <label for=\"checkbox\"><slot name=\"label\"></slot></label>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host, :host * {\n cursor: pointer;\n }\n\n div {\n display: flex;\n margin-right: 10px;\n }\n\n input:checked + label{\n font-weight: bold;\n }\n\n label {\n color: black;\n }\n `\n }\n}\n", "import { appendHTML } from '../utils/dom.js'\n\nexport default class SupervisorElement extends HTMLElement {\n constructor() {\n super()\n this.enabledDevtools = {}\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.shadowRoot.querySelector('button').addEventListener('click', () =>\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-close', {\n bubbles: true\n })\n )\n )\n\n this.addEventListener('change', event => {\n const devtoolElement = event.target\n const { checked, name } = devtoolElement\n checked ? this.enableDevtool(name) : this.disableDevtool(name)\n })\n }\n\n enableDevtool(name) {\n if (this.enabledDevtools[name]) return\n this.enabledDevtools[name] = true\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-enable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n disableDevtool(name) {\n if (!this.enabledDevtools[name]) return\n delete this.enabledDevtools[name]\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-disable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n close() {\n this.devtoolElements.forEach(el => {\n if (el.checked) el.uncheck()\n })\n this.remove()\n }\n\n get devtoolElements() {\n return this.querySelectorAll('[slot=\"devtool\"]')\n }\n\n get closeElement() {\n return this.querySelector('button')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n <slot name=\"devtool\"></slot>\n <button>\u2715</button>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n background-color: gainsboro;\n border-radius: 5px;\n bottom: 20px;\n display: block;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n left: 50%;\n outline-offset: 1px;\n outline: solid 2px black;\n padding: 5px 10px;\n position: fixed;\n transform: translateX(-50%);\n z-index: 8999;\n }\n\n * {\n -webkit-user-select: none;\n font-family: helvetica, sans-serif;\n font-size: 1rem;\n user-select: none;\n }\n\n img {\n align-self: center;\n cursor: grab;\n height: 25px;\n margin-left: -5px;\n vertical-align: middle;\n }\n\n div {\n display: flex;\n gap: 0 5px;\n position: relative;\n }\n\n [slot=\"devtool\"] {\n align-self: center;\n }\n\n button {\n align-self: center;\n background-color: darkgray;\n border-radius: 50%;\n border: none;\n color: black;\n cursor: pointer;\n font-size: 10px;\n height: 18px;\n line-height: 18px;\n margin-right: -5px;\n opacity: 0.5;\n outline: solid 1px black;\n padding: 0 2px;\n width: 18px;\n }\n\n button:hover {\n opacity: 1;\n }\n `\n }\n}\n", "export default class TooltipElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n }\n\n connectedCallback() {\n const savedTransform = localStorage.getItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`)\n\n if (savedTransform) {\n this.style.transform = savedTransform\n }\n }\n\n disconnectedCallback() {\n if (this.id !== 'undefined' && this.id !== '') {\n localStorage.setItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`, this.style.transform)\n }\n }\n\n get color() {\n return this.getAttribute('color') || 'darkslategray'\n }\n\n get backgroundColor() {\n return this.getAttribute('background-color') || 'gainsboro'\n }\n\n get position() {\n return this.getAttribute('position') || 'top'\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div role=\"container\">\n <div role=\"title\">\n <slot name=\"title\"></slot>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n </div>\n <slot name=\"subtitle\"></slot>\n <slot name=\"content-top\"></slot>\n <slot name=\"content\"></slot>\n <slot name=\"content-bottom\"></slot>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n display: block;\n position: absolute;\n z-index: 8999;\n }\n\n * {\n color: ${this.color}\n font-size: 1rem;\n }\n\n [role=\"container\"] {\n background-color: ${this.backgroundColor};\n border-radius: 15px;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n font-family: monospace;\n min-height: 30px;\n min-width: 100px;\n opacity: 0.9;\n outline-offset: 1px;\n outline: dashed 3px ${this.color};\n padding: 12px;\n position: relative;\n white-space: nowrap;\n }\n\n [role=\"title\"] {\n display: flex;\n }\n\n [role=\"title\"] slot[name=\"title\"] {\n color: ${this.color};\n display: block;\n flex-grow: 1;\n font-weight: bold;\n }\n\n [role=\"title\"] img {\n height: 25px;\n vertical-align: middle;\n }\n\n slot[name=\"subtitle\"] {\n border-bottom: dotted 1px ${this.color};\n border-top: dotted 1px ${this.color};\n color: ${this.color};\n display: block;\n font-size: 0.8rem;\n font-weight: lighter;\n margin-bottom: 12px;\n margin-top: 8px;\n padding-bottom: 4px;\n padding-top: 4px;\n width: 100%;\n }\n\n slot[name=\"content-top\"],\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n display: block;\n font-weight: normal;\n }\n\n slot[name=\"content-top\"] {\n color: ${this.color};\n margin-bottom: 8px;\n }\n\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n opacity: 0.7;\n padding-left: 12px;\n }\n\n slot[name=\"content\"] {\n color: ${this.color};\n }\n\n slot[name=\"content-bottom\"] {\n color: red;\n }\n `\n }\n}\n", "const added = []\n\nconst dependencies = {\n LeaderLine: {\n src: 'https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js',\n integrity:\n 'sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==',\n global: 'LeaderLine'\n },\n\n PlainDraggable: {\n src: 'https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js',\n global: 'PlainDraggable'\n }\n}\n\nfunction exists(dependency) {\n if (dependency.global && self[dependency.global]) return true\n if (document.querySelector(`[src='${dependency.src}']`)) return true\n return added.includes(dependency)\n}\n\nfunction add(dependency) {\n if (exists(dependency)) return\n added.push(dependency)\n\n const { src, integrity } = dependency\n const script = document.createElement('script')\n script.setAttribute('src', src)\n script.setAttribute('crossorigin', 'anonymous')\n script.setAttribute('referrerpolicy', 'no-referrer')\n if (integrity) script.setAttribute('integrity', integrity)\n document.head.appendChild(script)\n}\n\nfunction remove(dependency) {\n if (!added.includes(dependency)) return\n added.splice(added.indexOf(dependency), 1)\n\n const { src } = dependency\n const el = document.querySelector(`script[src='${src}']`)\n if (el) el.remove()\n if (dependency.global && self[dependency.global]) self[dependency.global] = null\n}\n\nfunction removeAll() {\n ;[...added].forEach(dependency => remove(dependency))\n}\n\nexport default { ...dependencies, add, remove, removeAll }\n", "import { appendHTML } from './utils/dom'\nimport DevtoolElement from './elements/devtool_element'\nimport SupervisorElement from './elements/supervisor_element'\nimport TooltipElement from './elements/tooltip_element'\nimport dependencies from './dependencies'\n\ncustomElements.define('turbo-boost-devtool', DevtoolElement)\ncustomElements.define('turbo-boost-devtool-supervisor', SupervisorElement)\ncustomElements.define('turbo-boost-devtool-tooltip', TooltipElement)\n\nlet supervisorElement\n\nfunction makeDraggable() {\n if (!supervisorElement) return\n try {\n new PlainDraggable(supervisorElement)\n } catch {\n setTimeout(makeDraggable, 200)\n }\n}\n\nfunction stop() {\n if (stopped()) return\n supervisorElement.close()\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-stop', {\n bubbles: true\n })\n )\n supervisorElement = null\n dependencies.removeAll()\n}\n\nfunction start() {\n if (started()) return\n dependencies.add(dependencies.LeaderLine)\n dependencies.add(dependencies.PlainDraggable)\n supervisorElement = appendHTML('<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>')\n setTimeout(makeDraggable, 200)\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-start', {\n bubbles: true\n })\n )\n}\n\nfunction restart() {\n const enabledList = supervisorElement ? Object.keys(supervisorElement.enabledDevtools) : []\n\n stop()\n start()\n\n supervisorElement.devtoolElements.forEach(el => {\n if (enabledList.includes(el.name)) el.check()\n })\n}\n\nfunction started() {\n return !!supervisorElement\n}\n\nfunction stopped() {\n return !started()\n}\n\nlet restartTimeout\nfunction debouncedRestart() {\n clearTimeout(restartTimeout)\n restartTimeout = setTimeout(restart, 25)\n}\n\nfunction autoRestart() {\n if (started()) debouncedRestart()\n}\n\naddEventListener('turbo:load', autoRestart)\naddEventListener('turbo-frame:load', autoRestart)\naddEventListener('turbo-boost:devtools-connect', autoRestart)\naddEventListener('turbo-boost:devtools-close', stop)\n\nif (window.TurboBoost) {\n addEventListener(TurboBoost.Commands.events.success, autoRestart)\n addEventListener(TurboBoost.Commands.events.finish, autoRestart)\n}\n\nfunction register(name, label) {\n if (!supervisorElement) return\n return appendHTML(\n `\n <turbo-boost-devtool name=\"${name}\" slot=\"devtool\">\n <span slot=\"label\">${label}</span>\n </turbo-boost-devtool>\n `,\n supervisorElement\n )\n}\n\nfunction enabled(name) {\n if (!supervisorElement) return false\n return supervisorElement.enabledDevtools[name]\n}\n\nexport default {\n enabled,\n register,\n start,\n stop,\n restart: debouncedRestart,\n get started() {\n return started()\n },\n get stopped() {\n return stopped()\n }\n}\n", "// Icons courtesy of https://feathericons.com/\nimport supervisor from './supervisor'\nimport { appendHTML, addHighlight, attempt, coordinates, removeHighlight } from './utils/dom.js'\n\nfunction appendTooltip(title, subtitle, content, options = {}) {\n let { backgroundColor, color, position, id } = options\n color = color || 'white'\n position = position || 'top'\n return appendHTML(`\n <turbo-boost-devtool-tooltip id=\"${id}\" position=\"${position}\" background-color=\"${backgroundColor}\" color=\"${color}\">\n <div slot='title'>${title}</div>\n <div slot='subtitle'>${subtitle}</div>\n ${content}\n </turbo-boost-devtool-tooltip>\n `)\n}\n\nlet activeTarget\n\nexport default class Devtool {\n constructor(delegate) {\n this.delegate = delegate\n\n let hideTimeout\n const debouncedHide = () => {\n clearTimeout(hideTimeout)\n hideTimeout = setTimeout(this.hide({ active: false }), 25)\n }\n\n this.eventListeners['turbo-boost:devtool-enable'] = event => {\n // LeaderLine.positionByWindowResize = false\n const { name } = event.detail\n if (name !== this.delegate.name) return\n\n addHighlight(this.delegate.triggerElement, {\n outline: '3px dashed blueviolet',\n outlineOffset: '2px'\n })\n\n this.hide({ active: false })\n if (this.active) this.show()\n }\n\n this.eventListeners['turbo-boost:devtool-disable'] = event => {\n const { name } = event.detail\n if (name === this.delegate.name) removeHighlight(this.delegate.triggerElement)\n }\n\n this.eventListeners['click'] = event => {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n debouncedHide()\n }\n\n this.eventListeners['turbo:load'] = debouncedHide\n this.eventListeners['turbo-frame:load'] = debouncedHide\n if (window.TurboBoost) {\n this.eventListeners[TurboBoost.Commands.events.finish] = debouncedHide\n }\n\n this.registerEventListeners()\n }\n\n registerEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n addEventListener(type, listener)\n })\n }\n\n unregisterEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n removeEventListener(type, listener)\n })\n }\n\n get eventListeners() {\n return this._eventListeners || (this._eventListeners = {})\n }\n\n show() {\n if (!this.enabled) return\n\n if (this.active) return\n this.active = true\n\n this.hide({ active: true })\n\n addHighlight(this.delegate.targetElement, {\n outline: '3px dashed darkcyan',\n outlineOffset: '-2px'\n })\n\n addHighlight(this.delegate.morphElement, {\n outline: '3px dashed chocolate',\n outlineOffset: '3px'\n })\n\n this.renderingTooltip = this.createRenderingTooltip()\n this.targetTooltip = this.createTargetTooltip()\n this.triggerTooltip = this.createTriggerTooltip(this.targetTooltip, this.renderingTooltip)\n\n document.querySelectorAll('.leader-line').forEach(el => (el.style.zIndex = 100000))\n\n const data = {\n morph: {\n partial: this.delegate.triggerElement.renders,\n id: this.delegate.triggerElement.morphs,\n status: this.delegate.morphElement ? 'OK' : 'Not Found'\n },\n trigger: { partial: null, id: null, status: 'Not Found' },\n target: { partial: null, id: null, status: 'Not Found' }\n }\n\n if (this.delegate.triggerElement) {\n data.trigger = {\n partial: this.delegate.triggerElement.partial,\n id: this.delegate.triggerElement.id,\n status: 'OK'\n }\n data.target.id = this.delegate.triggerElement.controls\n }\n\n if (this.delegate.targetElement)\n data.target = {\n partial: this.delegate.targetElement.partial,\n dom_id: this.delegate.targetElement.id,\n status: 'OK'\n }\n\n console.table(data)\n }\n\n hide({ active: active = false }) {\n document.querySelectorAll('turbo-boost-devtool-tooltip').forEach(tooltip => {\n attempt(() => tooltip.line.remove())\n attempt(() => tooltip.drag.remove())\n attempt(() => tooltip.lineToRendering.remove())\n attempt(() => tooltip.lineToTarget.remove())\n attempt(() => tooltip.remove())\n })\n\n document.querySelectorAll('[data-turbo-boost-highlight]').forEach(el => {\n if (!el.tagName.match(/turbo-boost-toggle-trigger/i)) removeHighlight(el)\n })\n\n this.active = active\n }\n\n get active() {\n return activeTarget === this.delegate\n }\n\n set active(value) {\n if (value) activeTarget = this.delegate\n else activeTarget = null\n }\n\n get enabled() {\n return supervisor.enabled(this.delegate.name)\n }\n\n static register(name, label) {\n supervisor.register(name, label)\n }\n\n createRenderingTooltip() {\n if (!this.delegate.triggerElement.renders)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.`\n )\n\n if (!this.delegate.triggerElement.morphs)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19l7-7 3 3-7 7-3-3z\"></path><path d=\"M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z\"></path><path d=\"M2 2l7.586 7.586\"></path><circle cx=\"11\" cy=\"11\" r=\"2\"></circle></svg>\n RENDERING - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;\n `\n const subtitle = `\n <b>partial</b>: ${this.delegate.triggerElement.renders || 'unknown'}<br>\n <b>morphs</b>: ${this.delegate.triggerElement.morphs || 'unknown'}<br>\n `\n const content = `\n <div slot=\"content-top\" style=\"font-size:85%; font-style:italic; font-weight:100;\">\n The <b>TRIGGER</b> toggles the <b>TARGET</b> then renders the partial &amp; morphs the element.<br>\n </div>\n `\n const tooltip = appendTooltip(title, subtitle, content, {\n id: `${this.delegate.id}-rendering`,\n backgroundColor: 'lightyellow',\n color: 'chocolate'\n })\n\n const coords = coordinates(this.delegate.morphElement)\n const top = Math.ceil(coords.top + coords.height / 2 - tooltip.offsetHeight / 2)\n const left = Math.ceil(coords.left + coords.width + 100)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.morphElement, {\n ...this.leaderLineOptions,\n color: 'chocolate'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTargetTooltip() {\n if (!this.delegate.targetElement)\n return console.debug(\n `Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><circle cx=\"12\" cy=\"12\" r=\"6\"></circle><circle cx=\"12\" cy=\"12\" r=\"2\"></circle></svg>\n TARGET - &lt;${this.delegate.targetElement.tagName.toLowerCase()}&gt;\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.targetTooltipData?.subtitle || '',\n this.delegate.targetTooltipData?.content || '',\n {\n id: `${this.delegate.id}-target`,\n backgroundColor: 'lightcyan',\n color: 'darkcyan',\n position: 'bottom'\n }\n )\n\n const coords = coordinates(this.delegate.targetElement)\n const top = Math.ceil(coords.top + tooltip.offsetHeight)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.targetElement, {\n ...this.leaderLineOptions,\n color: 'darkcyan'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTriggerTooltip(targetTooltip, renderingTooltip) {\n if (!this.delegate.triggerElement) return\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"></polygon></svg>\n TRIGGER - &lt;${this.delegate.triggerElement.tagName.toLowerCase()}&gt;\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.triggerTooltipData?.subtitle || '',\n this.delegate.triggerTooltipData?.content || '',\n {\n id: `${this.delegate.id}-trigger`,\n backgroundColor: 'lavender',\n color: 'blueviolet'\n }\n )\n\n const coords = coordinates(this.delegate.triggerElement)\n const top = Math.ceil(coords.top - tooltip.offsetHeight * 2)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(this.delegate.triggerElement, tooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet'\n })\n\n if (targetTooltip) {\n tooltip.lineToTarget = new LeaderLine(tooltip, targetTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.targetLineLabel,\n size: 2.1\n })\n\n targetTooltip.drag.onMove = () => {\n targetTooltip.line.position()\n tooltip.lineToTarget?.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n if (renderingTooltip) {\n tooltip.lineToRendering = new LeaderLine(tooltip, renderingTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.renderingLineLabel,\n size: 2.1\n })\n\n renderingTooltip.drag.onMove = () => {\n renderingTooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n tooltip.drag = new PlainDraggable(tooltip)\n tooltip.drag.onMove = () => {\n tooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n if (tooltip.lineToRendering) tooltip.lineToRendering.position()\n }\n\n return tooltip\n }\n\n get leaderLineOptions() {\n return {\n dash: { animation: true },\n dropShadow: { opacity: 0.3 },\n endPlug: 'arrow3',\n endPlugSize: 1.7,\n size: 3,\n startPlug: 'disc',\n startPlugSize: 1\n }\n }\n}\n", "import VERSION from './version'\nimport supervisor from './supervisor'\nimport Devtool from './devtool'\n\nconst { restart, start, stop } = supervisor\n\nfunction decorateElementWithDevtool(element, name, label) {\n Object.assign(element, {\n initializeDevtool() {\n const mouseenter = () => this.devtool.show()\n\n addEventListener('turbo-boost:devtools-start', () => {\n this.devtool = new Devtool(this)\n this.addEventListener('mouseenter', mouseenter)\n })\n\n addEventListener('turbo-boost:devtools-stop', () => {\n this.removeEventListener('mouseenter', mouseenter)\n this.removeDevtool()\n })\n\n this.dispatchEvent(new CustomEvent('turbo-boost:devtools-connect', { bubbles: true }))\n },\n hideDevtool() {\n this.devtool?.hide({ active: false })\n },\n removeDevtool() {\n if (this.devtool?.hide) this.devtool.hide({ active: false })\n if (this.devtool?.unregisterEventListeners) this.devtool.unregisterEventListeners()\n delete this.devtool\n },\n name,\n targetLineLabel: label\n })\n\n // the element references below are defaults that are placed on the receiver if not present\n const properties = ['triggerElement', 'morphElement', 'targetElement']\n\n properties\n .filter(property => {\n return element[property] === undefined\n })\n .forEach(property => {\n Object.defineProperty(element, property, {\n get() {\n return element\n }\n })\n })\n}\n\n//;(async () => {\n// // we cannot detect customElements.get(\"cable-ready-updates-for\") because they are lazily initialized\n// if (window.CableReady) await import('./delegates/cable_ready.js')\n//})()\n\nexport { Devtool, decorateElementWithDevtool }\n\nexport default { restart, start, stop, VERSION }\n", "export default '0.0.18'\n", "export default class TurboBoostElement extends HTMLElement {\n constructor(html) {\n super()\n this.devtool = 'unknown'\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = html || '<slot></slot>'\n }\n\n connectedCallback() {\n this.ensureId()\n }\n\n ensureId() {\n if (this.id.trim().length) return\n this.id = `${this.tagName}-${this.uuidv4()}`.toLowerCase()\n }\n\n // SEE: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid\n uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n )\n }\n\n get viewStack() {\n const value = this.getAttribute('view-stack')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get partial() {\n return this.viewStack[0]\n }\n}\n", "import TurboBoostElement from '../../turbo_boost_element'\n\nconst html = `\n <turbo-boost>\n <slot name=\"busy\" hidden></slot>\n <slot></slot>\n </turbo-boost>\n`\n\nexport const busyDelay = 100 // milliseconds - time to wait before showing busy element\nexport const busyDuration = 400 // milliseconds - minimum time that busy element is shown\n\nexport default class ToggleElement extends TurboBoostElement {\n constructor() {\n super(html)\n }\n\n // TODO: Should we timeout after a theoretical max wait time?\n // The idea being that a server error occurred and the toggle failed.\n showBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n this.busyStartedAt = Date.now() + busyDelay\n this.showBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = false\n this.defaultSlotElement.hidden = true\n }, busyDelay)\n }\n\n hideBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n let delay = busyDuration - (Date.now() - this.busyStartedAt)\n if (delay < 0) delay = 0\n\n delete this.busyStartedAt\n this.hideBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = true\n this.defaultSlotElement.hidden = false\n }, delay)\n }\n\n get busyElement() {\n return this.querySelector(':scope > [slot=\"busy\"]')\n }\n\n get busySlotElement() {\n return this.shadowRoot.querySelector('slot[name=\"busy\"]')\n }\n\n get defaultSlotElement() {\n return this.shadowRoot.querySelector('slot:not([name])')\n }\n\n // indicates if an rpc call is active/busy\n get busy() {\n return this.getAttribute('busy') === 'true'\n }\n\n // indicates if an rpc call is active/busy\n set busy(value) {\n value = !!value\n if (this.busy === value) return\n this.setAttribute('busy', value)\n if (value) this.showBusyElement()\n else this.hideBusyElement()\n }\n\n get busyStartedAt() {\n if (!this.dataset.busyStartedAt) return 0\n return Number(this.dataset.busyStartedAt)\n }\n\n set busyStartedAt(value) {\n this.dataset.busyStartedAt = value\n }\n}\n", "import ToggleElement from '../toggle_element'\n\nexport default class ToggleTargetElement extends ToggleElement {\n connectedCallback() {\n super.connectedCallback()\n\n this.mouseenterHandler = this.onMouseenter.bind(this)\n this.addEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseHandler = this.collapse.bind(this)\n this.collapseNowHandler = this.collapseNow.bind(this)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.addEventListener(name, this.collapseNowHandler)\n } else {\n this.addEventListener(name, this.collapseHandler)\n }\n })\n }\n\n disconnectedCallback() {\n this.removeEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.removeEventListener(name, this.collapseNowHandler)\n } else {\n this.removeEventListener(name, this.collapseHandler)\n }\n })\n }\n\n // TODO: get cached content working properly\n // perhaps use a mechanic other than morph\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n cacheHTML() {\n // this.cachedHTML = this.innerHTML\n }\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n renderCachedHTML() {\n // if (!this.cachedHTML) return\n // this.innerHTML = this.cachedHTML\n }\n\n onMouseenter() {\n clearTimeout(this.collapseTimeout)\n }\n\n collapse(delay = 250) {\n clearTimeout(this.collapseTimeout)\n if (this.busy) return\n if (typeof delay !== 'number') delay = 250\n\n if (delay > 0) return (this.collapseTimeout = setTimeout(() => this.collapse(0), delay))\n\n this.innerHTML = ''\n try {\n this.expanded = false\n this.triggerElement.hideDevtool()\n } catch {}\n }\n\n collapseNow(event) {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n this.collapse(0)\n }\n\n collapseMatches() {\n document.querySelectorAll(this.collapseSelector).forEach(el => {\n if (el.id === this.id) return\n if (el.collapse) el.collapse(0)\n })\n }\n\n get collapseSelector() {\n return this.triggerElement.collapseSelector || this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector')\n }\n\n // the active trigger\n get triggerElement() {\n return document.getElementById(this.labeledBy)\n }\n\n // all triggers\n get triggerElements() {\n return document.querySelectorAll(`[aria-controls=\"${this.id}\"]`)\n }\n\n // the dom id of the active trigger\n get labeledBy() {\n return this.getAttribute('aria-labeledby')\n }\n\n set labeledBy(value) {\n return this.setAttribute('aria-labeledby', value)\n }\n\n get collapseOn() {\n const value = this.getAttribute('collapse-on')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get expanded() {\n return this.triggerElement ? this.triggerElement.expanded : false\n }\n\n set expanded(value) {\n this.triggerElements.forEach(el => (el.expanded = value))\n }\n\n get busy() {\n return this.triggerElement && this.triggerElement.busy\n }\n}\n", "let focusTimeout\n\nfunction deactivateTrixAttributes(editor) {\n const attributes = ['bold', 'bullet', 'code', 'heading1', 'href', 'italic', 'number', 'quote', 'strike']\n attributes.forEach(name => editor.deactivateAttribute(name))\n}\n\nfunction focusTrixEditorElement(element) {\n if (element.value.length === 0) return\n\n const editor = element.editor\n\n // move cursor to the end\n let lastRange = []\n while (lastRange[0] !== editor.getSelectedRange()[0] && lastRange[1] !== editor.getSelectedRange()[1]) {\n lastRange = editor.getSelectedRange()\n editor.moveCursorInDirection('forward')\n }\n\n // insert an empty char and select it\n editor.insertString(' ')\n editor.moveCursorInDirection('forward')\n editor.setSelectedRange([lastRange[1], editor.getSelectedRange()[1]])\n\n // deactivate all trix features for the selection\n deactivateTrixAttributes(editor)\n\n // move cursor to end and collapse the selection\n editor.setSelectedRange([editor.getSelectedRange()[1], editor.getSelectedRange()[1]])\n}\n\nfunction debouncedFocus(element) {\n clearTimeout(focusTimeout)\n\n focusTimeout = setTimeout(() => {\n if (!element) return\n\n element.focus()\n const trixEditorElement = element.closest('trix-editor')\n\n try {\n if (trixEditorElement) {\n focusTrixEditorElement(trixEditorElement)\n } else {\n element.selectionStart = element.selectionEnd = element.value.length\n }\n } catch (_) {\n } finally {\n element.scrollIntoView({ block: 'center', behavior: 'smooth' })\n }\n }, 100)\n}\n\nexport default element => debouncedFocus(element)\n", "import { Devtool, decorateElementWithDevtool } from '@turbo-boost/devtools'\n\nimport ToggleElement, { busyDuration } from '../toggle_element'\nimport focus from './focus'\n\ndocument.addEventListener('turbo-boost:devtools-start', () => Devtool.register('toggle', 'toggles'))\n\nlet currentFocusSelector\n\nexport default class ToggleTriggerElement extends ToggleElement {\n constructor() {\n super()\n\n decorateElementWithDevtool(this, 'toggle', 'toggles')\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.commandStartHandler = this.onCommandStart.bind(this)\n this.addEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n this.beforeInvokeHandler = this.onBeforeInvoke.bind(this)\n addEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n // fires after receiving the toggle morph Turbo Stream but before it is executed\n // this.addEventListener(TurboBoost.Commands.events.success, event => {\n // // TODO: imlement cache, this.targetElement.cacheHTML()\n // })\n\n this.initializeDevtool()\n }\n\n disconnectedCallback() {\n // delay cleanup because the trigger may have been morphed out of the DOM,\n // but it's needed to apply behavior like focus etc...\n setTimeout(() => {\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.removeEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n removeEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n this.removeDevtool()\n }, 1000)\n }\n\n onCommandStart(event) {\n currentFocusSelector = this.focusSelector\n this.targetElement.labeledBy = this.id\n this.targetElement.collapseMatches()\n this.busy = true\n // TODO: implement cache - this.targetElement.renderCachedHTML()\n }\n\n // runs before an invoke turbo stream is executed\n onBeforeInvoke(event) {\n // return early if we're not the element responsible for this invoke\n if (event.detail.method !== 'morph') return\n if (event.target.id !== this.morphs) return\n const selector = `turbo-boost-toggle-target[aria-labeledby=\"${this.id}\"]`\n if (!event.target.querySelector(selector)) return\n\n // ensure the busy element is shown long enough for a good user experience\n // we accomplish this by modifying the event.detail with invoke instructions i.e. { delay }\n // SEE: the TurboBoost Streams library for details on how this works\n const duration = Date.now() - this.busyStartedAt\n let delay = busyDuration - duration\n if (delay < 10) delay = 10\n event.detail.invoke = { delay }\n\n // runs before the morph is executed\n setTimeout(() => {\n this.busy = false\n this.morphToggleTriggerElements.forEach(el => (el.busy = false))\n }, delay - 10)\n\n // runs after the morph is executed\n setTimeout(() => focus(this.targetElement.querySelector(currentFocusSelector)), delay + 100)\n }\n\n // a list of views shared between the trigger and target\n get sharedViews() {\n if (!this.targetElement) return []\n if (!this.targetElement.viewStack) return []\n const reducer = (memo, view) => {\n if (this.targetElement.viewStack.includes(view)) memo.push(view)\n return memo\n }\n return this.viewStack.reduce(reducer.bind(this), [])\n }\n\n // the partial to render\n get renders() {\n return this.getAttribute('renders')\n }\n\n // the renderered partial's top wrapping dom_id\n get morphs() {\n return this.getAttribute('morphs')\n }\n\n // all toggle elements contained by the `morphElement`\n get morphToggleTriggerElements() {\n return Array.from(this.morphElement.querySelectorAll('turbo-boost-toggle-trigger'))\n }\n\n // the target's dom_id\n get controls() {\n return this.getAttribute('aria-controls')\n }\n\n get collapseSelector() {\n return this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector') || this.targetElement.focusSelector\n }\n\n // indicates if the toggle state should be remembered across requests\n get remember() {\n return this.getAttribute('remember') === 'true'\n }\n\n set remember(value) {\n return this.setAttribute('remember', !!value)\n }\n\n // indicates if the target is expanded\n get expanded() {\n return this.getAttribute('aria-expanded') === 'true'\n }\n\n set expanded(value) {\n this.setAttribute('aria-expanded', !!value)\n }\n\n // indicates if the target is expanded\n get collapsed() {\n return !this.expanded\n }\n\n // ------ DevToolDelegate ------\n get command() {\n return this.dataset.turboCommand\n }\n\n get renderingLineLabel() {\n return 'renders & morphs'\n }\n\n // the morph element\n get morphElement() {\n if (!this.morphs) return null\n return document.getElementById(this.morphs)\n }\n\n // the target element\n get targetElement() {\n if (!this.controls) return null\n return document.getElementById(this.controls)\n }\n\n get triggerTooltipData() {\n let content = this.triggerElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `\n <b>id</b>: ${this.triggerElement.id}<br>\n <b>aria-controls</b>: ${this.triggerElement.controls}<br>\n <b>aria-expanded</b>: ${this.triggerElement.expanded}<br>\n <b>remember</b>: ${this.triggerElement.remember}<br>\n `,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n\n get targetTooltipData() {\n let content = this.targetElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `<b>id</b>: ${this.targetElement.id}<br>\n <b>aria-labeled-by</b>: ${this.targetElement.labeledBy}<br>\n`,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n}\n", "import TurboBoostElement from './turbo_boost_element'\nimport ToggleTargetElement from './toggle_elements/target_element'\nimport ToggleTriggerElement from './toggle_elements/trigger_element'\n\n// Valid custom element names: https://html.spec.whatwg.org/#valid-custom-element-name\n\ncustomElements.define('turbo-boost', TurboBoostElement)\ncustomElements.define('turbo-boost-toggle-target', ToggleTargetElement)\ncustomElements.define('turbo-boost-toggle-trigger', ToggleTriggerElement)\n"],
5
+ "mappings": "AAAA,MAAO,qbCAAA,EAAQ,QCAR,SAASC,GAASC,EAAM,CAC7B,IAAID,EAAW,SAAS,cAAc,UAAU,EAChD,OAAAA,EAAS,UAAYC,EACdD,CACT,CAEO,SAASE,EAAWD,EAAME,EAAQ,CACvCA,EAASA,GAAU,SAAS,KAE5B,IAAMC,EADQJ,GAASC,CAAI,EAAE,QAAQ,UAAU,EAAI,EAC/B,cAAc,GAAG,EACrC,OAAOE,EAAO,YAAYC,CAAK,CACjC,CAEO,SAASC,EAAaC,EAASC,EAAU,CAAC,EAAG,CAClD,GAAI,CAACD,EAAS,OACdE,EAAgBF,CAAO,EACvB,GAAI,CAAE,QAAAG,EAAS,cAAAC,CAAc,EAAIH,EAEjCE,EAAUA,GAAW,iBACrBC,EAAgBA,GAAiB,MAEjCJ,EAAQ,eAAiBA,EAAQ,gBAAkB,CACjD,QAASA,EAAQ,MAAM,QACvB,UAAWA,EAAQ,MAAM,UACzB,SAAUA,EAAQ,MAAM,SACxB,QAASA,EAAQ,MAAM,QACvB,cAAeA,EAAQ,MAAM,aAC/B,EAGE,iBAAiBA,CAAO,EAAE,QAAQ,MAAM,WAAW,GACnDA,EAAQ,cAAgB,GACxBA,EAAQ,eAAiB,IAEzBA,EAAQ,MAAM,QAAU,eACxBA,EAAQ,MAAM,UAAY,MAC1BA,EAAQ,MAAM,SAAW,OAE3BA,EAAQ,MAAM,QAA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AAQ,CAAC,KAAKH,CAAI,SACzC,8BAA8BG,EAAQ,CAAC,KAAKH,CAAI,SACnD,IAAI,EACN,KAAK,EAAE,EAEV,MAAO,CACL,SAAU,cAAc,KAAK,cAAc,EAAE;AAAA,gCACnB,KAAK,cAAc,SAAS;AAAA,EAEtD,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA,QAKPE,CAAO;AAAA,KAEX,CACF,CACF,EClNA,eAAe,OAAO,cAAeE,CAAiB,EACtD,eAAe,OAAO,4BAA6BC,CAAmB,EACtE,eAAe,OAAO,6BAA8BC,CAAoB,EhBHxE,KAAK,WAAa,KAAK,YAAc,CAAC,EACtC,KAAK,WAAW,SAAWC,EAC3B,KAAK,WAAW,SAAW,CAAE,QAAAC,CAAQ,EAErC,IAAOC,GAAQ,KAAK,WAAW",
6
+ "names": ["version_default", "template", "html", "appendHTML", "parent", "child", "addHighlight", "element", "options", "removeHighlight", "outline", "outlineOffset", "key", "value", "coordinates", "rect", "width", "height", "top", "left", "right", "bottom", "attempt", "callback", "e", "DevtoolElement", "event", "SupervisorElement", "devtoolElement", "checked", "name", "el", "TooltipElement", "savedTransform", "added", "dependencies", "exists", "dependency", "add", "src", "integrity", "script", "remove", "removeAll", "dependencies_default", "__spreadProps", "__spreadValues", "supervisorElement", "makeDraggable", "stop", "stopped", "start", "started", "restart", "enabledList", "restartTimeout", "debouncedRestart", "autoRestart", "register", "label", "enabled", "supervisor_default", "appendTooltip", "title", "subtitle", "content", "backgroundColor", "color", "position", "id", "activeTarget", "Devtool", "delegate", "hideTimeout", "debouncedHide", "type", "listener", "data", "active", "tooltip", "coords", "_a", "_b", "targetTooltip", "renderingTooltip", "decorateElementWithDevtool", "mouseenter", "property", "src_default", "version_default", "TurboBoostElement", "html", "c", "value", "html", "busyDelay", "busyDuration", "ToggleElement", "TurboBoostElement", "delay", "value", "ToggleTargetElement", "ToggleElement", "entry", "parts", "name", "delay", "e", "event", "el", "value", "focusTimeout", "deactivateTrixAttributes", "editor", "name", "focusTrixEditorElement", "element", "lastRange", "debouncedFocus", "trixEditorElement", "_", "focus_default", "y", "currentFocusSelector", "ToggleTriggerElement", "ToggleElement", "$t", "commandStartEvent", "beforeInvokeEvent", "event", "selector", "duration", "delay", "busyDuration", "el", "focus_default", "reducer", "memo", "view", "value", "content", "index", "TurboBoostElement", "ToggleTargetElement", "ToggleTriggerElement", "Dt", "version_default", "javascript_default"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js":{"bytes":11697,"imports":[],"format":"esm"},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytes":19335,"imports":[],"format":"esm"},"app/javascript/elements/turbo_boost_element/index.js":{"bytes":844,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytes":2193,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"../../turbo_boost_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytes":3370,"imports":[{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytes":1585,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytes":7168,"imports":[{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/focus.js","kind":"import-statement","original":"./focus"}],"format":"esm"},"app/javascript/elements/index.js":{"bytes":481,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"./turbo_boost_element"},{"path":"app/javascript/elements/toggle_elements/target_element/index.js","kind":"import-statement","original":"./toggle_elements/target_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/index.js","kind":"import-statement","original":"./toggle_elements/trigger_element"}],"format":"esm"},"app/javascript/index.js":{"bytes":244,"imports":[{"path":"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js","kind":"import-statement","original":"@turbo-boost/commands"},{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/index.js","kind":"import-statement","original":"./elements"}],"format":"esm"}},"outputs":{"app/assets/builds/@turbo-boost/elements.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":107124},"app/assets/builds/@turbo-boost/elements.js":{"imports":[],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js":{"bytesInOutput":11631},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytesInOutput":19271},"app/javascript/elements/turbo_boost_element/index.js":{"bytesInOutput":541},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytesInOutput":1284},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytesInOutput":2040},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytesInOutput":768},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytesInOutput":4299},"app/javascript/elements/index.js":{"bytesInOutput":146},"app/javascript/index.js":{"bytesInOutput":124}},"bytes":40164}}}
1
+ {"inputs":{"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytes":19453,"imports":[],"format":"esm"},"app/javascript/version.js":{"bytes":24,"imports":[],"format":"esm"},"app/javascript/elements/turbo_boost_element/index.js":{"bytes":844,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytes":2193,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"../../turbo_boost_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytes":3370,"imports":[{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytes":1585,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytes":7168,"imports":[{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/focus.js","kind":"import-statement","original":"./focus"}],"format":"esm"},"app/javascript/elements/index.js":{"bytes":481,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"./turbo_boost_element"},{"path":"app/javascript/elements/toggle_elements/target_element/index.js","kind":"import-statement","original":"./toggle_elements/target_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/index.js","kind":"import-statement","original":"./toggle_elements/trigger_element"}],"format":"esm"},"app/javascript/index.js":{"bytes":285,"imports":[{"path":"@turbo-boost/commands","kind":"import-statement","external":true},{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/version.js","kind":"import-statement","original":"./version"},{"path":"app/javascript/elements/index.js","kind":"import-statement","original":"./elements"}],"format":"esm"}},"outputs":{"app/assets/builds/@turbo-boost/elements.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":68586},"app/assets/builds/@turbo-boost/elements.js":{"imports":[{"path":"@turbo-boost/commands","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"app/javascript/index.js":{"bytesInOutput":162},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytesInOutput":19332},"app/javascript/version.js":{"bytesInOutput":15},"app/javascript/elements/turbo_boost_element/index.js":{"bytesInOutput":546},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytesInOutput":1279},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytesInOutput":2040},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytesInOutput":764},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytesInOutput":4292},"app/javascript/elements/index.js":{"bytesInOutput":146}},"bytes":28636}}}
@@ -13,7 +13,7 @@ module TurboBoost::Elements::ApplicationHelper
13
13
  prefixes = %w[toggle_]
14
14
  prefixes.each do |prefix|
15
15
  next unless name.start_with?(prefix)
16
- return send("#{prefix}tag_builder").public_send(name.to_s.delete_prefix(prefix), ...)
16
+ return send(:"#{prefix}tag_builder").public_send(name.to_s.delete_prefix(prefix), ...)
17
17
  end
18
18
  super
19
19
  end
@@ -22,7 +22,7 @@ module TurboBoost::Elements::ApplicationHelper
22
22
  prefixes = %w[toggle_]
23
23
  prefixes.each do |prefix|
24
24
  next unless name.start_with?(prefix)
25
- return send("#{prefix}tag_builder").respond_to_missing?(name.to_s.delete_prefix(prefix), ...)
25
+ return send(:"#{prefix}tag_builder").respond_to_missing?(name.to_s.delete_prefix(prefix), ...)
26
26
  end
27
27
  super
28
28
  end
@@ -1,9 +1,10 @@
1
1
  import '@turbo-boost/commands'
2
2
  import devtools from '@turbo-boost/devtools'
3
+ import VERSION from './version'
3
4
  import './elements'
4
5
 
5
6
  self.TurboBoost = self.TurboBoost || {}
6
7
  self.TurboBoost.devtools = devtools
7
- self.TurboBoost.Elements = {}
8
+ self.TurboBoost.Elements = { VERSION }
8
9
 
9
10
  export default self.TurboBoost.Elements
@@ -0,0 +1 @@
1
+ export default '0.0.18'
@@ -11,11 +11,19 @@ module TurboBoost::Elements
11
11
 
12
12
  class Engine < ::Rails::Engine
13
13
  isolate_namespace TurboBoost::Elements
14
+
14
15
  config.turbo_boost_elements = ActiveSupport::OrderedOptions.new
16
+ config.turbo_boost_elements.precompile_assets = true
15
17
 
16
18
  ActiveSupport.on_load(:action_controller_base) do
17
19
  # `self` is ActionController::Base
18
20
  helper TurboBoost::Elements::ApplicationHelper
19
21
  end
22
+
23
+ config.after_initialize do |app|
24
+ if app.config.respond_to?(:assets) && app.config.turbo_boost_elements.precompile_assets
25
+ app.config.assets.precompile += %w[@turbo-boost/elements.js]
26
+ end
27
+ end
20
28
  end
21
29
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TurboBoost
4
4
  module Elements
5
- VERSION = "0.0.17"
5
+ VERSION = "0.0.18"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_boost-elements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.11
47
+ version: 0.1.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.11
54
+ version: 0.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: magic_frozen_string_literal
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +132,6 @@ extra_rdoc_files: []
132
132
  files:
133
133
  - MIT-LICENSE
134
134
  - README.md
135
- - app/assets/builds/@turbo-boost/commands.metafile.json
136
135
  - app/assets/builds/@turbo-boost/elements.js
137
136
  - app/assets/builds/@turbo-boost/elements.js.map
138
137
  - app/assets/builds/@turbo-boost/elements.metafile.json
@@ -146,6 +145,7 @@ files:
146
145
  - app/javascript/elements/toggle_elements/trigger_element/index.js
147
146
  - app/javascript/elements/turbo_boost_element/index.js
148
147
  - app/javascript/index.js
148
+ - app/javascript/version.js
149
149
  - lib/turbo_boost/elements.rb
150
150
  - lib/turbo_boost/elements/engine.rb
151
151
  - lib/turbo_boost/elements/tag_builders.rb
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.4.10
177
+ rubygems_version: 3.5.3
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Pre-built easy to use reactive TurboBoost elements for Rails/Hotwire apps.
@@ -1 +0,0 @@
1
- {"inputs":{"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js":{"bytes":11151,"imports":[],"format":"esm"},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytes":19326,"imports":[],"format":"esm"},"app/javascript/elements/turbo_boost_element/index.js":{"bytes":844,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytes":2193,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"../../turbo_boost_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytes":3370,"imports":[{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytes":1585,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytes":7168,"imports":[{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/focus.js","kind":"import-statement","original":"./focus"}],"format":"esm"},"app/javascript/elements/index.js":{"bytes":481,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"./turbo_boost_element"},{"path":"app/javascript/elements/toggle_elements/target_element/index.js","kind":"import-statement","original":"./toggle_elements/target_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/index.js","kind":"import-statement","original":"./toggle_elements/trigger_element"}],"format":"esm"},"app/javascript/index.js":{"bytes":244,"imports":[{"path":"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js","kind":"import-statement","original":"@turbo-boost/commands"},{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/index.js","kind":"import-statement","original":"./elements"}],"format":"esm"}},"outputs":{"app/assets/builds/@turbo-boost/elements.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":92571},"app/assets/builds/@turbo-boost/elements.js":{"imports":[],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js":{"bytesInOutput":11085},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytesInOutput":19262},"app/javascript/elements/turbo_boost_element/index.js":{"bytesInOutput":541},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytesInOutput":1284},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytesInOutput":2040},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytesInOutput":768},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytesInOutput":4299},"app/javascript/elements/index.js":{"bytesInOutput":146},"app/javascript/index.js":{"bytesInOutput":124}},"bytes":39609}}}