lightning_ui_kit 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/lightning_ui_kit.css +1048 -2821
  3. data/app/assets/builds/lightning_ui_kit.js +1 -1
  4. data/app/assets/builds/lightning_ui_kit.js.map +3 -3
  5. data/app/assets/stylesheets/lightning_ui_kit/application.css +1 -1
  6. data/app/assets/vendor/lightning_ui_kit.css +1063 -1319
  7. data/app/assets/vendor/lightning_ui_kit.js +1 -1
  8. data/app/components/lightning_ui_kit/alert_component.html.erb +1 -1
  9. data/app/components/lightning_ui_kit/alert_component.rb +1 -1
  10. data/app/components/lightning_ui_kit/avatar_component.html.erb +5 -5
  11. data/app/components/lightning_ui_kit/avatar_component.rb +3 -3
  12. data/app/components/lightning_ui_kit/badge_component.html.erb +1 -1
  13. data/app/components/lightning_ui_kit/badge_component.rb +19 -19
  14. data/app/components/lightning_ui_kit/banner_component.html.erb +6 -6
  15. data/app/components/lightning_ui_kit/banner_component.rb +3 -3
  16. data/app/components/lightning_ui_kit/button_component.rb +29 -28
  17. data/app/components/lightning_ui_kit/checkbox_component.html.erb +29 -8
  18. data/app/components/lightning_ui_kit/description_list/item_component.html.erb +3 -3
  19. data/app/components/lightning_ui_kit/description_list_component.html.erb +1 -1
  20. data/app/components/lightning_ui_kit/dropdown_component.html.erb +5 -5
  21. data/app/components/lightning_ui_kit/dropdown_component.rb +3 -3
  22. data/app/components/lightning_ui_kit/dropzone_component.html.erb +22 -22
  23. data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
  24. data/app/components/lightning_ui_kit/file_input_component.html.erb +6 -6
  25. data/app/components/lightning_ui_kit/file_input_component.rb +1 -1
  26. data/app/components/lightning_ui_kit/input_component.html.erb +13 -13
  27. data/app/components/lightning_ui_kit/input_component.rb +1 -1
  28. data/app/components/lightning_ui_kit/link_component.html.erb +1 -1
  29. data/app/components/lightning_ui_kit/modal_component.html.erb +7 -7
  30. data/app/components/lightning_ui_kit/pagination_component.html.erb +2 -2
  31. data/app/components/lightning_ui_kit/pagination_component.rb +5 -4
  32. data/app/components/lightning_ui_kit/select_component.html.erb +14 -9
  33. data/app/components/lightning_ui_kit/skeleton_component.html.erb +4 -4
  34. data/app/components/lightning_ui_kit/spinner_component.html.erb +1 -1
  35. data/app/components/lightning_ui_kit/switch_component.html.erb +21 -6
  36. data/app/components/lightning_ui_kit/table_component.html.erb +10 -10
  37. data/app/components/lightning_ui_kit/text_component.rb +1 -1
  38. data/app/components/lightning_ui_kit/textarea_component.html.erb +10 -8
  39. data/app/javascript/lightning_ui_kit/controllers/accordion_controller.js +11 -11
  40. data/app/javascript/lightning_ui_kit/controllers/banner_controller.js +3 -3
  41. data/app/javascript/lightning_ui_kit/controllers/dropdown_controller.js +2 -1
  42. data/lib/lightning_ui_kit/version.rb +1 -1
  43. metadata +2 -2
@@ -2,5 +2,5 @@
2
2
 
3
3
  %o
4
4
 
5
- %o`,t,e,s),(o=window.onerror)===null||o===void 0||o.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function Pt(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function Ut(r){return K(r,"classes").reduce((t,s)=>Object.assign(t,qt(s)),{})}function qt(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${R(r)}Class`]:{get(){return this.classes.has(r)}}}}function Rt(r){return K(r,"outlets").reduce((t,s)=>Object.assign(t,Kt(s)),{})}function Ke(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function ze(r,e,t){let s=Ke(r,e,t);if(s||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),s=Ke(r,e,t),s))return s}function Kt(r){let e=le(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t){let o=ze(this,t,r);if(o)return o;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(s=>{let o=ze(this,s,r);if(o)return o;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${R(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function zt(r){return K(r,"targets").reduce((t,s)=>Object.assign(t,Wt(s)),{})}function Wt(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${R(r)}Target`]:{get(){return this.targets.has(r)}}}}function Ht(r){let e=Mt(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,o)=>{let h=Ye(o,this.identifier),d=this.data.getAttributeNameForKey(h.key);return Object.assign(s,{[d]:h})},{})}}};return e.reduce((s,o)=>Object.assign(s,Jt(o)),t)}function Jt(r,e){let t=Ye(r,e),{key:s,name:o,reader:h,writer:d}=t;return{[o]:{get(){let f=this.data.get(s);return f!==null?h(f):t.defaultValue},set(f){f===void 0?this.data.delete(s):this.data.set(s,d(f))}},[`has${R(o)}`]:{get(){return this.data.has(s)||t.hasCustomDefaultValue}}}}function Ye([r,e],t){return Yt({controller:t,token:r,typeDefinition:e})}function ne(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function q(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function Xt(r){let{controller:e,token:t,typeObject:s}=r,o=Pe(s.type),h=Pe(s.default),d=o&&h,f=o&&!h,g=!o&&h,v=ne(s.type),w=q(r.typeObject.default);if(f)return v;if(g)return w;if(v!==w){let B=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${B}" must match the defined type "${v}". The provided default value of "${s.default}" is of type "${w}".`)}if(d)return v}function Qt(r){let{controller:e,token:t,typeDefinition:s}=r,h=Xt({controller:e,token:t,typeObject:s}),d=q(s),f=ne(s),g=h||d||f;if(g)return g;let v=e?`${e}.${s}`:t;throw new Error(`Unknown value type "${v}" for "${t}" value`)}function Gt(r){let e=ne(r);if(e)return We[e];let t=he(r,"default"),s=he(r,"type"),o=r;if(t)return o.default;if(s){let{type:h}=o,d=ne(h);if(d)return We[d]}return r}function Yt(r){let{token:e,typeDefinition:t}=r,s=`${Xe(e)}-value`,o=Qt(r);return{type:o,key:s,name:Se(s),get defaultValue(){return Gt(t)},get hasCustomDefaultValue(){return q(t)!==void 0},reader:Zt[o],writer:He[o]||He.default}}var We={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Zt={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${q(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${q(e)}"`);return e},string(r){return r}},He={default:es,array:Je,object:Je};function Je(r){return JSON.stringify(r)}function es(r){return`${r}`}var m=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:o=this.identifier,bubbles:h=!0,cancelable:d=!0}={}){let f=o?`${o}:${e}`:e,g=new CustomEvent(f,{detail:s,bubbles:h,cancelable:d});return t.dispatchEvent(g),g}};m.blessings=[Ut,zt,Ht,Rt];m.targets=[];m.outlets=[];m.values={};var tt={exports:{}};(function(r,e){(function(t){r.exports=t()})(function(t){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(u,l){var i=u[0],n=u[1],c=u[2],a=u[3];i+=(n&c|~n&a)+l[0]-680876936|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&c)+l[1]-389564586|0,a=(a<<12|a>>>20)+i|0,c+=(a&i|~a&n)+l[2]+606105819|0,c=(c<<17|c>>>15)+a|0,n+=(c&a|~c&i)+l[3]-1044525330|0,n=(n<<22|n>>>10)+c|0,i+=(n&c|~n&a)+l[4]-176418897|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&c)+l[5]+1200080426|0,a=(a<<12|a>>>20)+i|0,c+=(a&i|~a&n)+l[6]-1473231341|0,c=(c<<17|c>>>15)+a|0,n+=(c&a|~c&i)+l[7]-45705983|0,n=(n<<22|n>>>10)+c|0,i+=(n&c|~n&a)+l[8]+1770035416|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&c)+l[9]-1958414417|0,a=(a<<12|a>>>20)+i|0,c+=(a&i|~a&n)+l[10]-42063|0,c=(c<<17|c>>>15)+a|0,n+=(c&a|~c&i)+l[11]-1990404162|0,n=(n<<22|n>>>10)+c|0,i+=(n&c|~n&a)+l[12]+1804603682|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&c)+l[13]-40341101|0,a=(a<<12|a>>>20)+i|0,c+=(a&i|~a&n)+l[14]-1502002290|0,c=(c<<17|c>>>15)+a|0,n+=(c&a|~c&i)+l[15]+1236535329|0,n=(n<<22|n>>>10)+c|0,i+=(n&a|c&~a)+l[1]-165796510|0,i=(i<<5|i>>>27)+n|0,a+=(i&c|n&~c)+l[6]-1069501632|0,a=(a<<9|a>>>23)+i|0,c+=(a&n|i&~n)+l[11]+643717713|0,c=(c<<14|c>>>18)+a|0,n+=(c&i|a&~i)+l[0]-373897302|0,n=(n<<20|n>>>12)+c|0,i+=(n&a|c&~a)+l[5]-701558691|0,i=(i<<5|i>>>27)+n|0,a+=(i&c|n&~c)+l[10]+38016083|0,a=(a<<9|a>>>23)+i|0,c+=(a&n|i&~n)+l[15]-660478335|0,c=(c<<14|c>>>18)+a|0,n+=(c&i|a&~i)+l[4]-405537848|0,n=(n<<20|n>>>12)+c|0,i+=(n&a|c&~a)+l[9]+568446438|0,i=(i<<5|i>>>27)+n|0,a+=(i&c|n&~c)+l[14]-1019803690|0,a=(a<<9|a>>>23)+i|0,c+=(a&n|i&~n)+l[3]-187363961|0,c=(c<<14|c>>>18)+a|0,n+=(c&i|a&~i)+l[8]+1163531501|0,n=(n<<20|n>>>12)+c|0,i+=(n&a|c&~a)+l[13]-1444681467|0,i=(i<<5|i>>>27)+n|0,a+=(i&c|n&~c)+l[2]-51403784|0,a=(a<<9|a>>>23)+i|0,c+=(a&n|i&~n)+l[7]+1735328473|0,c=(c<<14|c>>>18)+a|0,n+=(c&i|a&~i)+l[12]-1926607734|0,n=(n<<20|n>>>12)+c|0,i+=(n^c^a)+l[5]-378558|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^c)+l[8]-2022574463|0,a=(a<<11|a>>>21)+i|0,c+=(a^i^n)+l[11]+1839030562|0,c=(c<<16|c>>>16)+a|0,n+=(c^a^i)+l[14]-35309556|0,n=(n<<23|n>>>9)+c|0,i+=(n^c^a)+l[1]-1530992060|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^c)+l[4]+1272893353|0,a=(a<<11|a>>>21)+i|0,c+=(a^i^n)+l[7]-155497632|0,c=(c<<16|c>>>16)+a|0,n+=(c^a^i)+l[10]-1094730640|0,n=(n<<23|n>>>9)+c|0,i+=(n^c^a)+l[13]+681279174|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^c)+l[0]-358537222|0,a=(a<<11|a>>>21)+i|0,c+=(a^i^n)+l[3]-722521979|0,c=(c<<16|c>>>16)+a|0,n+=(c^a^i)+l[6]+76029189|0,n=(n<<23|n>>>9)+c|0,i+=(n^c^a)+l[9]-640364487|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^c)+l[12]-421815835|0,a=(a<<11|a>>>21)+i|0,c+=(a^i^n)+l[15]+530742520|0,c=(c<<16|c>>>16)+a|0,n+=(c^a^i)+l[2]-995338651|0,n=(n<<23|n>>>9)+c|0,i+=(c^(n|~a))+l[0]-198630844|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~c))+l[7]+1126891415|0,a=(a<<10|a>>>22)+i|0,c+=(i^(a|~n))+l[14]-1416354905|0,c=(c<<15|c>>>17)+a|0,n+=(a^(c|~i))+l[5]-57434055|0,n=(n<<21|n>>>11)+c|0,i+=(c^(n|~a))+l[12]+1700485571|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~c))+l[3]-1894986606|0,a=(a<<10|a>>>22)+i|0,c+=(i^(a|~n))+l[10]-1051523|0,c=(c<<15|c>>>17)+a|0,n+=(a^(c|~i))+l[1]-2054922799|0,n=(n<<21|n>>>11)+c|0,i+=(c^(n|~a))+l[8]+1873313359|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~c))+l[15]-30611744|0,a=(a<<10|a>>>22)+i|0,c+=(i^(a|~n))+l[6]-1560198380|0,c=(c<<15|c>>>17)+a|0,n+=(a^(c|~i))+l[13]+1309151649|0,n=(n<<21|n>>>11)+c|0,i+=(c^(n|~a))+l[4]-145523070|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~c))+l[11]-1120210379|0,a=(a<<10|a>>>22)+i|0,c+=(i^(a|~n))+l[2]+718787259|0,c=(c<<15|c>>>17)+a|0,n+=(a^(c|~i))+l[9]-343485551|0,n=(n<<21|n>>>11)+c|0,u[0]=i+u[0]|0,u[1]=n+u[1]|0,u[2]=c+u[2]|0,u[3]=a+u[3]|0}function h(u){var l=[],i;for(i=0;i<64;i+=4)l[i>>2]=u.charCodeAt(i)+(u.charCodeAt(i+1)<<8)+(u.charCodeAt(i+2)<<16)+(u.charCodeAt(i+3)<<24);return l}function d(u){var l=[],i;for(i=0;i<64;i+=4)l[i>>2]=u[i]+(u[i+1]<<8)+(u[i+2]<<16)+(u[i+3]<<24);return l}function f(u){var l=u.length,i=[1732584193,-271733879,-1732584194,271733878],n,c,a,y,A,p;for(n=64;n<=l;n+=64)o(i,h(u.substring(n-64,n)));for(u=u.substring(n-64),c=u.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)a[n>>2]|=u.charCodeAt(n)<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),n>55)for(o(i,a),n=0;n<16;n+=1)a[n]=0;return y=l*8,y=y.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(y[2],16),p=parseInt(y[1],16)||0,a[14]=A,a[15]=p,o(i,a),i}function g(u){var l=u.length,i=[1732584193,-271733879,-1732584194,271733878],n,c,a,y,A,p;for(n=64;n<=l;n+=64)o(i,d(u.subarray(n-64,n)));for(u=n-64<l?u.subarray(n-64):new Uint8Array(0),c=u.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<c;n+=1)a[n>>2]|=u[n]<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),n>55)for(o(i,a),n=0;n<16;n+=1)a[n]=0;return y=l*8,y=y.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(y[2],16),p=parseInt(y[1],16)||0,a[14]=A,a[15]=p,o(i,a),i}function v(u){var l="",i;for(i=0;i<4;i+=1)l+=s[u>>i*8+4&15]+s[u>>i*8&15];return l}function w(u){var l;for(l=0;l<u.length;l+=1)u[l]=v(u[l]);return u.join("")}w(f("hello")),typeof ArrayBuffer!="undefined"&&!ArrayBuffer.prototype.slice&&function(){function u(l,i){return l=l|0||0,l<0?Math.max(l+i,0):Math.min(l,i)}ArrayBuffer.prototype.slice=function(l,i){var n=this.byteLength,c=u(l,n),a=n,y,A,p,O;return i!==t&&(a=u(i,n)),c>a?new ArrayBuffer(0):(y=a-c,A=new ArrayBuffer(y),p=new Uint8Array(A),O=new Uint8Array(this,c,y),p.set(O),A)}}();function B(u){return/[\u0080-\uFFFF]/.test(u)&&(u=unescape(encodeURIComponent(u))),u}function x(u,l){var i=u.length,n=new ArrayBuffer(i),c=new Uint8Array(n),a;for(a=0;a<i;a+=1)c[a]=u.charCodeAt(a);return l?c:n}function G(u){return String.fromCharCode.apply(null,new Uint8Array(u))}function k(u,l,i){var n=new Uint8Array(u.byteLength+l.byteLength);return n.set(new Uint8Array(u)),n.set(new Uint8Array(l),u.byteLength),i?n:n.buffer}function N(u){var l=[],i=u.length,n;for(n=0;n<i-1;n+=2)l.push(parseInt(u.substr(n,2),16));return String.fromCharCode.apply(String,l)}function b(){this.reset()}return b.prototype.append=function(u){return this.appendBinary(B(u)),this},b.prototype.appendBinary=function(u){this._buff+=u,this._length+=u.length;var l=this._buff.length,i;for(i=64;i<=l;i+=64)o(this._hash,h(this._buff.substring(i-64,i)));return this._buff=this._buff.substring(i-64),this},b.prototype.end=function(u){var l=this._buff,i=l.length,n,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a;for(n=0;n<i;n+=1)c[n>>2]|=l.charCodeAt(n)<<(n%4<<3);return this._finish(c,i),a=w(this._hash),u&&(a=N(a)),this.reset(),a},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(u){return this._buff=u.buff,this._length=u.length,this._hash=u.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(u,l){var i=l,n,c,a;if(u[i>>2]|=128<<(i%4<<3),i>55)for(o(this._hash,u),i=0;i<16;i+=1)u[i]=0;n=this._length*8,n=n.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(n[2],16),a=parseInt(n[1],16)||0,u[14]=c,u[15]=a,o(this._hash,u)},b.hash=function(u,l){return b.hashBinary(B(u),l)},b.hashBinary=function(u,l){var i=f(u),n=w(i);return l?N(n):n},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(u){var l=k(this._buff.buffer,u,!0),i=l.length,n;for(this._length+=u.byteLength,n=64;n<=i;n+=64)o(this._hash,d(l.subarray(n-64,n)));return this._buff=n-64<i?new Uint8Array(l.buffer.slice(n-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(u){var l=this._buff,i=l.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,a;for(c=0;c<i;c+=1)n[c>>2]|=l[c]<<(c%4<<3);return this._finish(n,i),a=w(this._hash),u&&(a=N(a)),this.reset(),a},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var u=b.prototype.getState.call(this);return u.buff=G(u.buff),u},b.ArrayBuffer.prototype.setState=function(u){return u.buff=x(u.buff,!0),b.prototype.setState.call(this,u)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(u,l){var i=g(new Uint8Array(u)),n=w(i);return l?N(n):n},b})})(tt);var ts=tt.exports,ss=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,z=class{static create(e,t){new z(e).create(t)}constructor(e){this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}create(e){this.callback=e,this.md5Buffer=new ts.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",t=>this.fileReaderDidLoad(t)),this.fileReader.addEventListener("error",t=>this.fileReaderDidError(t)),this.readNextChunk()}fileReaderDidLoad(e){if(this.md5Buffer.append(e.target.result),!this.readNextChunk()){let t=this.md5Buffer.end(!0),s=btoa(t);this.callback(null,s)}}fileReaderDidError(e){this.callback(`Error reading ${this.file.name}`)}readNextChunk(){if(this.chunkIndex<this.chunkCount||this.chunkIndex==0&&this.chunkCount==0){let e=this.chunkIndex*this.chunkSize,t=Math.min(e+this.chunkSize,this.file.size),s=ss.call(this.file,e,t);return this.fileReader.readAsArrayBuffer(s),this.chunkIndex++,!0}else return!1}};function rs(r){let e=st(document.head,`meta[name="${r}"]`);if(e)return e.getAttribute("content")}function ns(r,e){typeof r=="string"&&(e=r,r=document);let t=r.querySelectorAll(e);return nt(t)}function st(r,e){return typeof r=="string"&&(e=r,r=document),r.querySelector(e)}function rt(r,e,t={}){let{disabled:s}=r,{bubbles:o,cancelable:h,detail:d}=t,f=document.createEvent("Event");f.initEvent(e,o||!0,h||!0),f.detail=d||{};try{r.disabled=!1,r.dispatchEvent(f)}finally{r.disabled=s}return f}function nt(r){return Array.isArray(r)?r:Array.from?Array.from(r):[].slice.call(r)}var Ne=class{constructor(e,t,s,o={}){this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:t},this.xhr=new XMLHttpRequest,this.xhr.open("POST",s,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(o).forEach(d=>{this.xhr.setRequestHeader(d,o[d])});let h=rs("csrf-token");h!=null&&this.xhr.setRequestHeader("X-CSRF-Token",h),this.xhr.addEventListener("load",d=>this.requestDidLoad(d)),this.xhr.addEventListener("error",d=>this.requestDidError(d))}get status(){return this.xhr.status}get response(){let{responseType:e,response:t}=this.xhr;return e=="json"?t:JSON.parse(t)}create(e){this.callback=e,this.xhr.send(JSON.stringify({blob:this.attributes}))}requestDidLoad(e){if(this.status>=200&&this.status<300){let{response:t}=this,{direct_upload:s}=t;delete t.direct_upload,this.attributes=t,this.directUploadData=s,this.callback(null,this.toJSON())}else this.requestDidError(e)}requestDidError(e){this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`)}toJSON(){let e={};for(let t in this.attributes)e[t]=this.attributes[t];return e}},Le=class{constructor(e){this.blob=e,this.file=e.file;let{url:t,headers:s}=e.directUploadData;this.xhr=new XMLHttpRequest,this.xhr.open("PUT",t,!0),this.xhr.responseType="text";for(let o in s)this.xhr.setRequestHeader(o,s[o]);this.xhr.addEventListener("load",o=>this.requestDidLoad(o)),this.xhr.addEventListener("error",o=>this.requestDidError(o))}create(e){this.callback=e,this.xhr.send(this.file.slice())}requestDidLoad(e){let{status:t,response:s}=this.xhr;t>=200&&t<300?this.callback(null,s):this.requestDidError(e)}requestDidError(e){this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`)}},is=0,W=class{constructor(e,t,s,o={}){this.id=++is,this.file=e,this.url=t,this.delegate=s,this.customHeaders=o}create(e){z.create(this.file,(t,s)=>{if(t){e(t);return}let o=new Ne(this.file,s,this.url,this.customHeaders);Ze(this.delegate,"directUploadWillCreateBlobWithXHR",o.xhr),o.create(h=>{if(h)e(h);else{let d=new Le(o);Ze(this.delegate,"directUploadWillStoreFileWithXHR",d.xhr),d.create(f=>{f?e(f):e(null,o.toJSON())})}})})}};function Ze(r,e,...t){if(r&&typeof r[e]=="function")return r[e](...t)}var $e=class{constructor(e,t){this.input=e,this.file=t,this.directUpload=new W(this.file,this.url,this),this.dispatch("initialize")}start(e){let t=document.createElement("input");t.type="hidden",t.name=this.input.name,this.input.insertAdjacentElement("beforebegin",t),this.dispatch("start"),this.directUpload.create((s,o)=>{s?(t.parentNode.removeChild(t),this.dispatchError(s)):t.value=o.signed_id,this.dispatch("end"),e(s)})}uploadRequestDidProgress(e){let t=e.loaded/e.total*100;t&&this.dispatch("progress",{progress:t})}get url(){return this.input.getAttribute("data-direct-upload-url")}dispatch(e,t={}){return t.file=this.file,t.id=this.directUpload.id,rt(this.input,`direct-upload:${e}`,{detail:t})}dispatchError(e){this.dispatch("error",{error:e}).defaultPrevented||alert(e)}directUploadWillCreateBlobWithXHR(e){this.dispatch("before-blob-request",{xhr:e})}directUploadWillStoreFileWithXHR(e){this.dispatch("before-storage-request",{xhr:e}),e.upload.addEventListener("progress",t=>this.uploadRequestDidProgress(t))}},os="input[type=file][data-direct-upload-url]:not([disabled])",De=class{constructor(e){this.form=e,this.inputs=ns(e,os).filter(t=>t.files.length)}start(e){let t=this.createDirectUploadControllers(),s=()=>{let o=t.shift();o?o.start(h=>{h?(e(h),this.dispatch("end")):s()}):(e(),this.dispatch("end"))};this.dispatch("start"),s()}createDirectUploadControllers(){let e=[];return this.inputs.forEach(t=>{nt(t.files).forEach(s=>{let o=new $e(t,s);e.push(o)})}),e}dispatch(e,t={}){return rt(this.form,`direct-uploads:${e}`,{detail:t})}},Be="data-direct-uploads-processing",ke=new WeakMap,et=!1;function je(){et||(et=!0,document.addEventListener("click",as,!0),document.addEventListener("submit",cs,!0),document.addEventListener("ajax:before",ls))}function as(r){let e=r.target.closest("button, input");e&&e.type==="submit"&&e.form&&ke.set(e.form,e)}function cs(r){it(r)}function ls(r){r.target.tagName=="FORM"&&it(r)}function it(r){let e=r.target;if(e.hasAttribute(Be)){r.preventDefault();return}let t=new De(e),{inputs:s}=t;s.length&&(r.preventDefault(),e.setAttribute(Be,""),s.forEach(us),t.start(o=>{e.removeAttribute(Be),o?s.forEach(ds):hs(e)}))}function hs(r){let e=ke.get(r)||st(r,"input[type=submit], button[type=submit]");if(e){let{disabled:t}=e;e.disabled=!1,e.focus(),e.click(),e.disabled=t}else e=document.createElement("input"),e.type="submit",e.style.display="none",r.appendChild(e),e.click(),r.removeChild(e);ke.delete(r)}function us(r){r.disabled=!0}function ds(r){r.disabled=!1}function fs(){window.ActiveStorage&&je()}setTimeout(fs,1);var H=class extends m{connect(){this.hasInputTarget&&(this.inputTarget.disabled=!0)}copy(r){if(r.preventDefault(),!this.hasInputTarget)return;let e=this.inputTarget.innerHTML||this.inputTarget.value;navigator.clipboard.writeText(e)}};E(H,"targets",["input"]);var J=class extends m{toggle(r){r.preventDefault();let e=this.controlTarget;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};E(J,"targets",["field","control"]);var ie=class extends m{close(){this.element.classList.remove("opacity-100"),this.element.classList.add("opacity-0"),setTimeout(()=>{this.element.classList.add("hidden")},300)}};var oe=class extends m{openModal(){this.findElement("lui-modal").open()}closeModal(){this.findElement("lui-modal").close()}findElement(r){let e=this.element.dataset.target.replace("#",""),t=document.getElementById(e);return this.application.getControllerForElementAndIdentifier(t,r)}};var j=class extends m{connect(){this.openFirstValue&&this.openItem(this.itemTargets[0])}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.contains(r.target)?this.isOpen(e)?this.closeItem(e):this.openItem(e):this.closeItem(e)})}openItem(r){let e=r.querySelector("[data-lui-accordion-target=content]");e.classList.remove("grid-rows-[0fr]"),e.classList.add("grid-rows-[1fr]"),e.classList.remove("opacity-0"),e.classList.add("opacity-100"),r.querySelector("[data-lui-accordion-target=arrow]").classList.add("rotate-180")}closeItem(r){let e=r.querySelector("[data-lui-accordion-target=content]");e.classList.remove("grid-rows-[1fr]"),e.classList.add("grid-rows-[0fr]"),e.classList.remove("opacity-100"),e.classList.add("opacity-0"),r.querySelector("[data-lui-accordion-target=arrow]").classList.remove("rotate-180")}isOpen(r){return r.querySelector("[data-lui-accordion-target=content]").classList.contains("grid-rows-[1fr]")}};E(j,"targets",["content","item"]),E(j,"values",{openFirst:{type:Boolean,default:!0}});var I=class extends m{connect(){this.dialogTarget.addEventListener("click",this.onClick.bind(this)),this.openValue&&this.open()}disconnect(){this.dialogTarget.removeEventListener("click",this.onClick.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(r=>r.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}onClick(r){r.target===this.dialogTarget&&this.dialogTarget.close()}submitForm(){this.dialogTarget.querySelector("form").requestSubmit()}};E(I,"targets",["dialog"]),E(I,"values",{open:Boolean});var V=class extends m{connect(){this.initialShowValue||this.itemTargets.forEach(r=>{r.classList.add("hidden")})}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.classList.toggle("hidden")})}};E(V,"targets",["item"]),E(V,"values",{initialShow:Boolean});var X=class extends m{toggle(r){r.preventDefault();let e=r.target;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};E(X,"targets",["field"]);var Ie=class extends m{};Ie.debounces=[];var Ve=class extends m{};Ve.throttles=[];var ps={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},ms={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},ot=(r,e={})=>{var t,s,o;let h=r,d=h.element.dataset.transitionTarget,f;d&&(f=h[`${d}Target`]);let g=(e==null?void 0:e.element)||f||h.element;if(!(g instanceof HTMLElement||g instanceof SVGElement))return;let v=g.dataset,w=parseInt(v.leaveAfter||"")||e.leaveAfter||0,{transitioned:B,hiddenClass:x,preserveOriginalClass:G,removeToClasses:k}=Object.assign({},ms,e),N=(t=h.enter)===null||t===void 0?void 0:t.bind(h),b=(s=h.leave)===null||s===void 0?void 0:s.bind(h),u=(o=h.toggleTransition)===null||o===void 0?void 0:o.bind(h);function l(p){return M(this,null,function*(){if(h.transitioned)return;h.transitioned=!0,N&&N(p);let O=S("enterFrom",e,v),L=S("enterActive",e,v),$=S("enterTo",e,v),D=S("leaveTo",e,v);x&&g.classList.remove(x),k||A(g,D),yield c(g,O,L,$,x,G,k),w>0&&setTimeout(()=>{i(p)},w)})}function i(p){return M(this,null,function*(){if(!h.transitioned)return;h.transitioned=!1,b&&b(p);let O=S("leaveFrom",e,v),L=S("leaveActive",e,v),$=S("leaveTo",e,v),D=S("enterTo",e,v);k||A(g,D),yield c(g,O,L,$,x,G,k),x&&g.classList.add(x)})}function n(p){u&&u(p),h.transitioned?i():l()}function c(p,O,L,$,D,ct,lt){return M(this,null,function*(){let P=[];ct&&(O.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T)),L.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T)),$.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T))),y(p,O),A(p,P),y(p,L),yield vs(),A(p,O),y(p,$),yield bs(p),A(p,L),lt&&A(p,$),y(p,P)})}function a(){h.transitioned=B,B?(x&&g.classList.remove(x),l()):(x&&g.classList.add(x),i())}function y(p,O){O.length>0&&p.classList.add(...O)}function A(p,O){O.length>0&&p.classList.remove(...O)}return a(),Object.assign(h,{enter:l,leave:i,toggleTransition:n}),[l,i,n]};function S(r,e,t){let s=`transition${r[0].toUpperCase()}${r.substr(1)}`,o=ps[r],h=e[r]||t[s]||t[o]||" ";return ys(h)?[]:h.split(" ")}function bs(r){return M(this,null,function*(){return new Promise(e=>{let t=Number(getComputedStyle(r).transitionDuration.split(",")[0].replace("s",""))*1e3;setTimeout(()=>{e(t)},t)})})}function vs(){return M(this,null,function*(){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(r)})})})}function ys(r){return r.length===0||!r.trim()}var _=class extends m{connect(){ot(this,{element:this.menuTarget})}toggle(){this.toggleTransition()}hide(e){!this.element.contains(e.target)&&!this.menuTarget.classList.contains("hidden")&&this.leave()}};E(_,"targets",["menu"]);var _e=class{constructor(e,t){this.controller=t,this.file=e,this.directUpload=new W(e,this.controller.inputTarget.dataset.directUploadUrl,this)}process(){this.insertUpload(),this.directUpload.create((e,t)=>{if(e){let o=this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`).querySelector("[data-lui-dropzone-target='status']");o.textContent="Failed. "+e,o.classList.add("text-red-500")}else{let s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value",t.signed_id),s.name=this.controller.inputTarget.name,this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`).appendChild(s),this.controller.inputTarget.value=""}})}insertUpload(){let e=this.controller.templateTarget.content.cloneNode(!0);e.querySelector("#\\#NEW_FILE").id=`upload_${this.directUpload.id}`,e.querySelector("[data-lui-dropzone-target='filename']").textContent=this.file.name,e.querySelector("[data-lui-dropzone-target='status']").textContent="Uploading...",this.controller.filesTarget.appendChild(e)}directUploadWillStoreFileWithXHR(e){e.upload.addEventListener("progress",t=>this.updateProgress(t))}updateProgress(e){let t=(e.loaded/e.total*100).toFixed(0),s=t==100?"Uploaded":"Uploading...",o=this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`);o.querySelector("[data-lui-dropzone-target='status']").textContent=s,o.querySelector("[data-lui-dropzone-target='progressbar']").style.width=`${t}%`,o.querySelector("[data-lui-dropzone-target='percentage-progress']").textContent=`${t}%`}},Q=class extends m{selectFiles(r){this.inputTarget.click()}uploadFiles(r){r.preventDefault(),[...r.dataTransfer?r.dataTransfer.files:r.target.files].forEach(t=>new _e(t,this).process())}activate(r){r.preventDefault()}removeFile(r){r.preventDefault(),r.target.closest("[data-lui-dropzone-target='file']").remove()}};E(Q,"targets",["input","template","files"]);var F="lui";je();var at=re.start();window.Stimulus=at;function Es(r){r.register(`${F}-clipboard`,H),r.register(`${F}-checkbox`,J),r.register(`${F}-banner`,ie),r.register(`${F}-main`,oe),r.register(`${F}-accordion`,j),r.register(`${F}-modal`,I),r.register(`${F}-reveal`,V),r.register(`${F}-switch`,X),r.register(`${F}-dropdown`,_),r.register(`${F}-dropzone`,Q)}Es(at);})();
5
+ %o`,t,e,s),(o=window.onerror)===null||o===void 0||o.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function Pt(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function Ut(r){return K(r,"classes").reduce((t,s)=>Object.assign(t,qt(s)),{})}function qt(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${R(r)}Class`]:{get(){return this.classes.has(r)}}}}function Rt(r){return K(r,"outlets").reduce((t,s)=>Object.assign(t,Kt(s)),{})}function Ke(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function ze(r,e,t){let s=Ke(r,e,t);if(s||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),s=Ke(r,e,t),s))return s}function Kt(r){let e=le(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t){let o=ze(this,t,r);if(o)return o;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(s=>{let o=ze(this,s,r);if(o)return o;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${R(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function zt(r){return K(r,"targets").reduce((t,s)=>Object.assign(t,Wt(s)),{})}function Wt(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${R(r)}Target`]:{get(){return this.targets.has(r)}}}}function Ht(r){let e=Mt(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,o)=>{let h=Ye(o,this.identifier),d=this.data.getAttributeNameForKey(h.key);return Object.assign(s,{[d]:h})},{})}}};return e.reduce((s,o)=>Object.assign(s,Jt(o)),t)}function Jt(r,e){let t=Ye(r,e),{key:s,name:o,reader:h,writer:d}=t;return{[o]:{get(){let f=this.data.get(s);return f!==null?h(f):t.defaultValue},set(f){f===void 0?this.data.delete(s):this.data.set(s,d(f))}},[`has${R(o)}`]:{get(){return this.data.has(s)||t.hasCustomDefaultValue}}}}function Ye([r,e],t){return Yt({controller:t,token:r,typeDefinition:e})}function ie(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function q(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function Xt(r){let{controller:e,token:t,typeObject:s}=r,o=Pe(s.type),h=Pe(s.default),d=o&&h,f=o&&!h,g=!o&&h,v=ie(s.type),w=q(r.typeObject.default);if(f)return v;if(g)return w;if(v!==w){let B=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${B}" must match the defined type "${v}". The provided default value of "${s.default}" is of type "${w}".`)}if(d)return v}function Qt(r){let{controller:e,token:t,typeDefinition:s}=r,h=Xt({controller:e,token:t,typeObject:s}),d=q(s),f=ie(s),g=h||d||f;if(g)return g;let v=e?`${e}.${s}`:t;throw new Error(`Unknown value type "${v}" for "${t}" value`)}function Gt(r){let e=ie(r);if(e)return We[e];let t=he(r,"default"),s=he(r,"type"),o=r;if(t)return o.default;if(s){let{type:h}=o,d=ie(h);if(d)return We[d]}return r}function Yt(r){let{token:e,typeDefinition:t}=r,s=`${Xe(e)}-value`,o=Qt(r);return{type:o,key:s,name:Se(s),get defaultValue(){return Gt(t)},get hasCustomDefaultValue(){return q(t)!==void 0},reader:Zt[o],writer:He[o]||He.default}}var We={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Zt={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${q(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${q(e)}"`);return e},string(r){return r}},He={default:es,array:Je,object:Je};function Je(r){return JSON.stringify(r)}function es(r){return`${r}`}var m=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:o=this.identifier,bubbles:h=!0,cancelable:d=!0}={}){let f=o?`${o}:${e}`:e,g=new CustomEvent(f,{detail:s,bubbles:h,cancelable:d});return t.dispatchEvent(g),g}};m.blessings=[Ut,zt,Ht,Rt];m.targets=[];m.outlets=[];m.values={};var tt={exports:{}};(function(r,e){(function(t){r.exports=t()})(function(t){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(u,l){var n=u[0],i=u[1],c=u[2],a=u[3];n+=(i&c|~i&a)+l[0]-680876936|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&c)+l[1]-389564586|0,a=(a<<12|a>>>20)+n|0,c+=(a&n|~a&i)+l[2]+606105819|0,c=(c<<17|c>>>15)+a|0,i+=(c&a|~c&n)+l[3]-1044525330|0,i=(i<<22|i>>>10)+c|0,n+=(i&c|~i&a)+l[4]-176418897|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&c)+l[5]+1200080426|0,a=(a<<12|a>>>20)+n|0,c+=(a&n|~a&i)+l[6]-1473231341|0,c=(c<<17|c>>>15)+a|0,i+=(c&a|~c&n)+l[7]-45705983|0,i=(i<<22|i>>>10)+c|0,n+=(i&c|~i&a)+l[8]+1770035416|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&c)+l[9]-1958414417|0,a=(a<<12|a>>>20)+n|0,c+=(a&n|~a&i)+l[10]-42063|0,c=(c<<17|c>>>15)+a|0,i+=(c&a|~c&n)+l[11]-1990404162|0,i=(i<<22|i>>>10)+c|0,n+=(i&c|~i&a)+l[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&c)+l[13]-40341101|0,a=(a<<12|a>>>20)+n|0,c+=(a&n|~a&i)+l[14]-1502002290|0,c=(c<<17|c>>>15)+a|0,i+=(c&a|~c&n)+l[15]+1236535329|0,i=(i<<22|i>>>10)+c|0,n+=(i&a|c&~a)+l[1]-165796510|0,n=(n<<5|n>>>27)+i|0,a+=(n&c|i&~c)+l[6]-1069501632|0,a=(a<<9|a>>>23)+n|0,c+=(a&i|n&~i)+l[11]+643717713|0,c=(c<<14|c>>>18)+a|0,i+=(c&n|a&~n)+l[0]-373897302|0,i=(i<<20|i>>>12)+c|0,n+=(i&a|c&~a)+l[5]-701558691|0,n=(n<<5|n>>>27)+i|0,a+=(n&c|i&~c)+l[10]+38016083|0,a=(a<<9|a>>>23)+n|0,c+=(a&i|n&~i)+l[15]-660478335|0,c=(c<<14|c>>>18)+a|0,i+=(c&n|a&~n)+l[4]-405537848|0,i=(i<<20|i>>>12)+c|0,n+=(i&a|c&~a)+l[9]+568446438|0,n=(n<<5|n>>>27)+i|0,a+=(n&c|i&~c)+l[14]-1019803690|0,a=(a<<9|a>>>23)+n|0,c+=(a&i|n&~i)+l[3]-187363961|0,c=(c<<14|c>>>18)+a|0,i+=(c&n|a&~n)+l[8]+1163531501|0,i=(i<<20|i>>>12)+c|0,n+=(i&a|c&~a)+l[13]-1444681467|0,n=(n<<5|n>>>27)+i|0,a+=(n&c|i&~c)+l[2]-51403784|0,a=(a<<9|a>>>23)+n|0,c+=(a&i|n&~i)+l[7]+1735328473|0,c=(c<<14|c>>>18)+a|0,i+=(c&n|a&~n)+l[12]-1926607734|0,i=(i<<20|i>>>12)+c|0,n+=(i^c^a)+l[5]-378558|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^c)+l[8]-2022574463|0,a=(a<<11|a>>>21)+n|0,c+=(a^n^i)+l[11]+1839030562|0,c=(c<<16|c>>>16)+a|0,i+=(c^a^n)+l[14]-35309556|0,i=(i<<23|i>>>9)+c|0,n+=(i^c^a)+l[1]-1530992060|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^c)+l[4]+1272893353|0,a=(a<<11|a>>>21)+n|0,c+=(a^n^i)+l[7]-155497632|0,c=(c<<16|c>>>16)+a|0,i+=(c^a^n)+l[10]-1094730640|0,i=(i<<23|i>>>9)+c|0,n+=(i^c^a)+l[13]+681279174|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^c)+l[0]-358537222|0,a=(a<<11|a>>>21)+n|0,c+=(a^n^i)+l[3]-722521979|0,c=(c<<16|c>>>16)+a|0,i+=(c^a^n)+l[6]+76029189|0,i=(i<<23|i>>>9)+c|0,n+=(i^c^a)+l[9]-640364487|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^c)+l[12]-421815835|0,a=(a<<11|a>>>21)+n|0,c+=(a^n^i)+l[15]+530742520|0,c=(c<<16|c>>>16)+a|0,i+=(c^a^n)+l[2]-995338651|0,i=(i<<23|i>>>9)+c|0,n+=(c^(i|~a))+l[0]-198630844|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~c))+l[7]+1126891415|0,a=(a<<10|a>>>22)+n|0,c+=(n^(a|~i))+l[14]-1416354905|0,c=(c<<15|c>>>17)+a|0,i+=(a^(c|~n))+l[5]-57434055|0,i=(i<<21|i>>>11)+c|0,n+=(c^(i|~a))+l[12]+1700485571|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~c))+l[3]-1894986606|0,a=(a<<10|a>>>22)+n|0,c+=(n^(a|~i))+l[10]-1051523|0,c=(c<<15|c>>>17)+a|0,i+=(a^(c|~n))+l[1]-2054922799|0,i=(i<<21|i>>>11)+c|0,n+=(c^(i|~a))+l[8]+1873313359|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~c))+l[15]-30611744|0,a=(a<<10|a>>>22)+n|0,c+=(n^(a|~i))+l[6]-1560198380|0,c=(c<<15|c>>>17)+a|0,i+=(a^(c|~n))+l[13]+1309151649|0,i=(i<<21|i>>>11)+c|0,n+=(c^(i|~a))+l[4]-145523070|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~c))+l[11]-1120210379|0,a=(a<<10|a>>>22)+n|0,c+=(n^(a|~i))+l[2]+718787259|0,c=(c<<15|c>>>17)+a|0,i+=(a^(c|~n))+l[9]-343485551|0,i=(i<<21|i>>>11)+c|0,u[0]=n+u[0]|0,u[1]=i+u[1]|0,u[2]=c+u[2]|0,u[3]=a+u[3]|0}function h(u){var l=[],n;for(n=0;n<64;n+=4)l[n>>2]=u.charCodeAt(n)+(u.charCodeAt(n+1)<<8)+(u.charCodeAt(n+2)<<16)+(u.charCodeAt(n+3)<<24);return l}function d(u){var l=[],n;for(n=0;n<64;n+=4)l[n>>2]=u[n]+(u[n+1]<<8)+(u[n+2]<<16)+(u[n+3]<<24);return l}function f(u){var l=u.length,n=[1732584193,-271733879,-1732584194,271733878],i,c,a,y,A,p;for(i=64;i<=l;i+=64)o(n,h(u.substring(i-64,i)));for(u=u.substring(i-64),c=u.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=0;i<c;i+=1)a[i>>2]|=u.charCodeAt(i)<<(i%4<<3);if(a[i>>2]|=128<<(i%4<<3),i>55)for(o(n,a),i=0;i<16;i+=1)a[i]=0;return y=l*8,y=y.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(y[2],16),p=parseInt(y[1],16)||0,a[14]=A,a[15]=p,o(n,a),n}function g(u){var l=u.length,n=[1732584193,-271733879,-1732584194,271733878],i,c,a,y,A,p;for(i=64;i<=l;i+=64)o(n,d(u.subarray(i-64,i)));for(u=i-64<l?u.subarray(i-64):new Uint8Array(0),c=u.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=0;i<c;i+=1)a[i>>2]|=u[i]<<(i%4<<3);if(a[i>>2]|=128<<(i%4<<3),i>55)for(o(n,a),i=0;i<16;i+=1)a[i]=0;return y=l*8,y=y.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(y[2],16),p=parseInt(y[1],16)||0,a[14]=A,a[15]=p,o(n,a),n}function v(u){var l="",n;for(n=0;n<4;n+=1)l+=s[u>>n*8+4&15]+s[u>>n*8&15];return l}function w(u){var l;for(l=0;l<u.length;l+=1)u[l]=v(u[l]);return u.join("")}w(f("hello")),typeof ArrayBuffer!="undefined"&&!ArrayBuffer.prototype.slice&&function(){function u(l,n){return l=l|0||0,l<0?Math.max(l+n,0):Math.min(l,n)}ArrayBuffer.prototype.slice=function(l,n){var i=this.byteLength,c=u(l,i),a=i,y,A,p,O;return n!==t&&(a=u(n,i)),c>a?new ArrayBuffer(0):(y=a-c,A=new ArrayBuffer(y),p=new Uint8Array(A),O=new Uint8Array(this,c,y),p.set(O),A)}}();function B(u){return/[\u0080-\uFFFF]/.test(u)&&(u=unescape(encodeURIComponent(u))),u}function x(u,l){var n=u.length,i=new ArrayBuffer(n),c=new Uint8Array(i),a;for(a=0;a<n;a+=1)c[a]=u.charCodeAt(a);return l?c:i}function G(u){return String.fromCharCode.apply(null,new Uint8Array(u))}function k(u,l,n){var i=new Uint8Array(u.byteLength+l.byteLength);return i.set(new Uint8Array(u)),i.set(new Uint8Array(l),u.byteLength),n?i:i.buffer}function N(u){var l=[],n=u.length,i;for(i=0;i<n-1;i+=2)l.push(parseInt(u.substr(i,2),16));return String.fromCharCode.apply(String,l)}function b(){this.reset()}return b.prototype.append=function(u){return this.appendBinary(B(u)),this},b.prototype.appendBinary=function(u){this._buff+=u,this._length+=u.length;var l=this._buff.length,n;for(n=64;n<=l;n+=64)o(this._hash,h(this._buff.substring(n-64,n)));return this._buff=this._buff.substring(n-64),this},b.prototype.end=function(u){var l=this._buff,n=l.length,i,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a;for(i=0;i<n;i+=1)c[i>>2]|=l.charCodeAt(i)<<(i%4<<3);return this._finish(c,n),a=w(this._hash),u&&(a=N(a)),this.reset(),a},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(u){return this._buff=u.buff,this._length=u.length,this._hash=u.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(u,l){var n=l,i,c,a;if(u[n>>2]|=128<<(n%4<<3),n>55)for(o(this._hash,u),n=0;n<16;n+=1)u[n]=0;i=this._length*8,i=i.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(i[2],16),a=parseInt(i[1],16)||0,u[14]=c,u[15]=a,o(this._hash,u)},b.hash=function(u,l){return b.hashBinary(B(u),l)},b.hashBinary=function(u,l){var n=f(u),i=w(n);return l?N(i):i},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(u){var l=k(this._buff.buffer,u,!0),n=l.length,i;for(this._length+=u.byteLength,i=64;i<=n;i+=64)o(this._hash,d(l.subarray(i-64,i)));return this._buff=i-64<n?new Uint8Array(l.buffer.slice(i-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(u){var l=this._buff,n=l.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,a;for(c=0;c<n;c+=1)i[c>>2]|=l[c]<<(c%4<<3);return this._finish(i,n),a=w(this._hash),u&&(a=N(a)),this.reset(),a},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var u=b.prototype.getState.call(this);return u.buff=G(u.buff),u},b.ArrayBuffer.prototype.setState=function(u){return u.buff=x(u.buff,!0),b.prototype.setState.call(this,u)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(u,l){var n=g(new Uint8Array(u)),i=w(n);return l?N(i):i},b})})(tt);var ts=tt.exports,ss=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,z=class{static create(e,t){new z(e).create(t)}constructor(e){this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}create(e){this.callback=e,this.md5Buffer=new ts.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",t=>this.fileReaderDidLoad(t)),this.fileReader.addEventListener("error",t=>this.fileReaderDidError(t)),this.readNextChunk()}fileReaderDidLoad(e){if(this.md5Buffer.append(e.target.result),!this.readNextChunk()){let t=this.md5Buffer.end(!0),s=btoa(t);this.callback(null,s)}}fileReaderDidError(e){this.callback(`Error reading ${this.file.name}`)}readNextChunk(){if(this.chunkIndex<this.chunkCount||this.chunkIndex==0&&this.chunkCount==0){let e=this.chunkIndex*this.chunkSize,t=Math.min(e+this.chunkSize,this.file.size),s=ss.call(this.file,e,t);return this.fileReader.readAsArrayBuffer(s),this.chunkIndex++,!0}else return!1}};function rs(r){let e=st(document.head,`meta[name="${r}"]`);if(e)return e.getAttribute("content")}function is(r,e){typeof r=="string"&&(e=r,r=document);let t=r.querySelectorAll(e);return it(t)}function st(r,e){return typeof r=="string"&&(e=r,r=document),r.querySelector(e)}function rt(r,e,t={}){let{disabled:s}=r,{bubbles:o,cancelable:h,detail:d}=t,f=document.createEvent("Event");f.initEvent(e,o||!0,h||!0),f.detail=d||{};try{r.disabled=!1,r.dispatchEvent(f)}finally{r.disabled=s}return f}function it(r){return Array.isArray(r)?r:Array.from?Array.from(r):[].slice.call(r)}var Ne=class{constructor(e,t,s,o={}){this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:t},this.xhr=new XMLHttpRequest,this.xhr.open("POST",s,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(o).forEach(d=>{this.xhr.setRequestHeader(d,o[d])});let h=rs("csrf-token");h!=null&&this.xhr.setRequestHeader("X-CSRF-Token",h),this.xhr.addEventListener("load",d=>this.requestDidLoad(d)),this.xhr.addEventListener("error",d=>this.requestDidError(d))}get status(){return this.xhr.status}get response(){let{responseType:e,response:t}=this.xhr;return e=="json"?t:JSON.parse(t)}create(e){this.callback=e,this.xhr.send(JSON.stringify({blob:this.attributes}))}requestDidLoad(e){if(this.status>=200&&this.status<300){let{response:t}=this,{direct_upload:s}=t;delete t.direct_upload,this.attributes=t,this.directUploadData=s,this.callback(null,this.toJSON())}else this.requestDidError(e)}requestDidError(e){this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`)}toJSON(){let e={};for(let t in this.attributes)e[t]=this.attributes[t];return e}},Le=class{constructor(e){this.blob=e,this.file=e.file;let{url:t,headers:s}=e.directUploadData;this.xhr=new XMLHttpRequest,this.xhr.open("PUT",t,!0),this.xhr.responseType="text";for(let o in s)this.xhr.setRequestHeader(o,s[o]);this.xhr.addEventListener("load",o=>this.requestDidLoad(o)),this.xhr.addEventListener("error",o=>this.requestDidError(o))}create(e){this.callback=e,this.xhr.send(this.file.slice())}requestDidLoad(e){let{status:t,response:s}=this.xhr;t>=200&&t<300?this.callback(null,s):this.requestDidError(e)}requestDidError(e){this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`)}},ns=0,W=class{constructor(e,t,s,o={}){this.id=++ns,this.file=e,this.url=t,this.delegate=s,this.customHeaders=o}create(e){z.create(this.file,(t,s)=>{if(t){e(t);return}let o=new Ne(this.file,s,this.url,this.customHeaders);Ze(this.delegate,"directUploadWillCreateBlobWithXHR",o.xhr),o.create(h=>{if(h)e(h);else{let d=new Le(o);Ze(this.delegate,"directUploadWillStoreFileWithXHR",d.xhr),d.create(f=>{f?e(f):e(null,o.toJSON())})}})})}};function Ze(r,e,...t){if(r&&typeof r[e]=="function")return r[e](...t)}var $e=class{constructor(e,t){this.input=e,this.file=t,this.directUpload=new W(this.file,this.url,this),this.dispatch("initialize")}start(e){let t=document.createElement("input");t.type="hidden",t.name=this.input.name,this.input.insertAdjacentElement("beforebegin",t),this.dispatch("start"),this.directUpload.create((s,o)=>{s?(t.parentNode.removeChild(t),this.dispatchError(s)):t.value=o.signed_id,this.dispatch("end"),e(s)})}uploadRequestDidProgress(e){let t=e.loaded/e.total*100;t&&this.dispatch("progress",{progress:t})}get url(){return this.input.getAttribute("data-direct-upload-url")}dispatch(e,t={}){return t.file=this.file,t.id=this.directUpload.id,rt(this.input,`direct-upload:${e}`,{detail:t})}dispatchError(e){this.dispatch("error",{error:e}).defaultPrevented||alert(e)}directUploadWillCreateBlobWithXHR(e){this.dispatch("before-blob-request",{xhr:e})}directUploadWillStoreFileWithXHR(e){this.dispatch("before-storage-request",{xhr:e}),e.upload.addEventListener("progress",t=>this.uploadRequestDidProgress(t))}},os="input[type=file][data-direct-upload-url]:not([disabled])",De=class{constructor(e){this.form=e,this.inputs=is(e,os).filter(t=>t.files.length)}start(e){let t=this.createDirectUploadControllers(),s=()=>{let o=t.shift();o?o.start(h=>{h?(e(h),this.dispatch("end")):s()}):(e(),this.dispatch("end"))};this.dispatch("start"),s()}createDirectUploadControllers(){let e=[];return this.inputs.forEach(t=>{it(t.files).forEach(s=>{let o=new $e(t,s);e.push(o)})}),e}dispatch(e,t={}){return rt(this.form,`direct-uploads:${e}`,{detail:t})}},Be="data-direct-uploads-processing",ke=new WeakMap,et=!1;function je(){et||(et=!0,document.addEventListener("click",as,!0),document.addEventListener("submit",cs,!0),document.addEventListener("ajax:before",ls))}function as(r){let e=r.target.closest("button, input");e&&e.type==="submit"&&e.form&&ke.set(e.form,e)}function cs(r){nt(r)}function ls(r){r.target.tagName=="FORM"&&nt(r)}function nt(r){let e=r.target;if(e.hasAttribute(Be)){r.preventDefault();return}let t=new De(e),{inputs:s}=t;s.length&&(r.preventDefault(),e.setAttribute(Be,""),s.forEach(us),t.start(o=>{e.removeAttribute(Be),o?s.forEach(ds):hs(e)}))}function hs(r){let e=ke.get(r)||st(r,"input[type=submit], button[type=submit]");if(e){let{disabled:t}=e;e.disabled=!1,e.focus(),e.click(),e.disabled=t}else e=document.createElement("input"),e.type="submit",e.style.display="none",r.appendChild(e),e.click(),r.removeChild(e);ke.delete(r)}function us(r){r.disabled=!0}function ds(r){r.disabled=!1}function fs(){window.ActiveStorage&&je()}setTimeout(fs,1);var H=class extends m{connect(){this.hasInputTarget&&(this.inputTarget.disabled=!0)}copy(r){if(r.preventDefault(),!this.hasInputTarget)return;let e=this.inputTarget.innerHTML||this.inputTarget.value;navigator.clipboard.writeText(e)}};E(H,"targets",["input"]);var J=class extends m{toggle(r){r.preventDefault();let e=this.controlTarget;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};E(J,"targets",["field","control"]);var ne=class extends m{close(){this.element.classList.remove("lui:opacity-100"),this.element.classList.add("lui:opacity-0"),setTimeout(()=>{this.element.classList.add("lui:hidden")},300)}};var oe=class extends m{openModal(){this.findElement("lui-modal").open()}closeModal(){this.findElement("lui-modal").close()}findElement(r){let e=this.element.dataset.target.replace("#",""),t=document.getElementById(e);return this.application.getControllerForElementAndIdentifier(t,r)}};var j=class extends m{connect(){this.openFirstValue&&this.openItem(this.itemTargets[0])}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.contains(r.target)?this.isOpen(e)?this.closeItem(e):this.openItem(e):this.closeItem(e)})}openItem(r){let e=r.querySelector("[data-lui-accordion-target=content]");e.classList.remove("lui:grid-rows-[0fr]"),e.classList.add("lui:grid-rows-[1fr]"),e.classList.remove("lui:opacity-0"),e.classList.add("lui:opacity-100"),r.querySelector("[data-lui-accordion-target=arrow]").classList.add("lui:rotate-180")}closeItem(r){let e=r.querySelector("[data-lui-accordion-target=content]");e.classList.remove("lui:grid-rows-[1fr]"),e.classList.add("lui:grid-rows-[0fr]"),e.classList.remove("lui:opacity-100"),e.classList.add("lui:opacity-0"),r.querySelector("[data-lui-accordion-target=arrow]").classList.remove("lui:rotate-180")}isOpen(r){return r.querySelector("[data-lui-accordion-target=content]").classList.contains("lui:grid-rows-[1fr]")}};E(j,"targets",["content","item"]),E(j,"values",{openFirst:{type:Boolean,default:!0}});var I=class extends m{connect(){this.dialogTarget.addEventListener("click",this.onClick.bind(this)),this.openValue&&this.open()}disconnect(){this.dialogTarget.removeEventListener("click",this.onClick.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(r=>r.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}onClick(r){r.target===this.dialogTarget&&this.dialogTarget.close()}submitForm(){this.dialogTarget.querySelector("form").requestSubmit()}};E(I,"targets",["dialog"]),E(I,"values",{open:Boolean});var V=class extends m{connect(){this.initialShowValue||this.itemTargets.forEach(r=>{r.classList.add("hidden")})}toggle(r){r.preventDefault(),this.itemTargets.forEach(e=>{e.classList.toggle("hidden")})}};E(V,"targets",["item"]),E(V,"values",{initialShow:Boolean});var X=class extends m{toggle(r){r.preventDefault();let e=r.target;e.dataset.checked?(this.fieldTarget.value=!1,delete e.dataset.checked):(this.fieldTarget.value=!0,e.dataset.checked=!0)}};E(X,"targets",["field"]);var Ie=class extends m{};Ie.debounces=[];var Ve=class extends m{};Ve.throttles=[];var ps={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},ms={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},ot=(r,e={})=>{var t,s,o;let h=r,d=h.element.dataset.transitionTarget,f;d&&(f=h[`${d}Target`]);let g=(e==null?void 0:e.element)||f||h.element;if(!(g instanceof HTMLElement||g instanceof SVGElement))return;let v=g.dataset,w=parseInt(v.leaveAfter||"")||e.leaveAfter||0,{transitioned:B,hiddenClass:x,preserveOriginalClass:G,removeToClasses:k}=Object.assign({},ms,e),N=(t=h.enter)===null||t===void 0?void 0:t.bind(h),b=(s=h.leave)===null||s===void 0?void 0:s.bind(h),u=(o=h.toggleTransition)===null||o===void 0?void 0:o.bind(h);function l(p){return M(this,null,function*(){if(h.transitioned)return;h.transitioned=!0,N&&N(p);let O=S("enterFrom",e,v),L=S("enterActive",e,v),$=S("enterTo",e,v),D=S("leaveTo",e,v);x&&g.classList.remove(x),k||A(g,D),yield c(g,O,L,$,x,G,k),w>0&&setTimeout(()=>{n(p)},w)})}function n(p){return M(this,null,function*(){if(!h.transitioned)return;h.transitioned=!1,b&&b(p);let O=S("leaveFrom",e,v),L=S("leaveActive",e,v),$=S("leaveTo",e,v),D=S("enterTo",e,v);k||A(g,D),yield c(g,O,L,$,x,G,k),x&&g.classList.add(x)})}function i(p){u&&u(p),h.transitioned?n():l()}function c(p,O,L,$,D,ct,lt){return M(this,null,function*(){let P=[];ct&&(O.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T)),L.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T)),$.forEach(T=>p.classList.contains(T)&&T!==D&&P.push(T))),y(p,O),A(p,P),y(p,L),yield vs(),A(p,O),y(p,$),yield bs(p),A(p,L),lt&&A(p,$),y(p,P)})}function a(){h.transitioned=B,B?(x&&g.classList.remove(x),l()):(x&&g.classList.add(x),n())}function y(p,O){O.length>0&&p.classList.add(...O)}function A(p,O){O.length>0&&p.classList.remove(...O)}return a(),Object.assign(h,{enter:l,leave:n,toggleTransition:i}),[l,n,i]};function S(r,e,t){let s=`transition${r[0].toUpperCase()}${r.substr(1)}`,o=ps[r],h=e[r]||t[s]||t[o]||" ";return ys(h)?[]:h.split(" ")}function bs(r){return M(this,null,function*(){return new Promise(e=>{let t=Number(getComputedStyle(r).transitionDuration.split(",")[0].replace("s",""))*1e3;setTimeout(()=>{e(t)},t)})})}function vs(){return M(this,null,function*(){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(r)})})})}function ys(r){return r.length===0||!r.trim()}var _=class extends m{connect(){ot(this,{element:this.menuTarget,hiddenClass:"lui:hidden"})}toggle(){this.toggleTransition()}hide(e){!this.element.contains(e.target)&&!this.menuTarget.classList.contains("lui:hidden")&&this.leave()}};E(_,"targets",["menu"]);var _e=class{constructor(e,t){this.controller=t,this.file=e,this.directUpload=new W(e,this.controller.inputTarget.dataset.directUploadUrl,this)}process(){this.insertUpload(),this.directUpload.create((e,t)=>{if(e){let o=this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`).querySelector("[data-lui-dropzone-target='status']");o.textContent="Failed. "+e,o.classList.add("text-red-500")}else{let s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("value",t.signed_id),s.name=this.controller.inputTarget.name,this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`).appendChild(s),this.controller.inputTarget.value=""}})}insertUpload(){let e=this.controller.templateTarget.content.cloneNode(!0);e.querySelector("#\\#NEW_FILE").id=`upload_${this.directUpload.id}`,e.querySelector("[data-lui-dropzone-target='filename']").textContent=this.file.name,e.querySelector("[data-lui-dropzone-target='status']").textContent="Uploading...",this.controller.filesTarget.appendChild(e)}directUploadWillStoreFileWithXHR(e){e.upload.addEventListener("progress",t=>this.updateProgress(t))}updateProgress(e){let t=(e.loaded/e.total*100).toFixed(0),s=t==100?"Uploaded":"Uploading...",o=this.controller.filesTarget.querySelector(`#upload_${this.directUpload.id}`);o.querySelector("[data-lui-dropzone-target='status']").textContent=s,o.querySelector("[data-lui-dropzone-target='progressbar']").style.width=`${t}%`,o.querySelector("[data-lui-dropzone-target='percentage-progress']").textContent=`${t}%`}},Q=class extends m{selectFiles(r){this.inputTarget.click()}uploadFiles(r){r.preventDefault(),[...r.dataTransfer?r.dataTransfer.files:r.target.files].forEach(t=>new _e(t,this).process())}activate(r){r.preventDefault()}removeFile(r){r.preventDefault(),r.target.closest("[data-lui-dropzone-target='file']").remove()}};E(Q,"targets",["input","template","files"]);var F="lui";je();var at=re.start();window.Stimulus=at;function Es(r){r.register(`${F}-clipboard`,H),r.register(`${F}-checkbox`,J),r.register(`${F}-banner`,ne),r.register(`${F}-main`,oe),r.register(`${F}-accordion`,j),r.register(`${F}-modal`,I),r.register(`${F}-reveal`,V),r.register(`${F}-switch`,X),r.register(`${F}-dropdown`,_),r.register(`${F}-dropzone`,Q)}Es(at);})();
6
6
  //# sourceMappingURL=lightning_ui_kit.js.map