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.
- checksums.yaml +4 -4
- data/app/assets/builds/lightning_ui_kit.css +1048 -2821
- data/app/assets/builds/lightning_ui_kit.js +1 -1
- data/app/assets/builds/lightning_ui_kit.js.map +3 -3
- data/app/assets/stylesheets/lightning_ui_kit/application.css +1 -1
- data/app/assets/vendor/lightning_ui_kit.css +1063 -1319
- data/app/assets/vendor/lightning_ui_kit.js +1 -1
- data/app/components/lightning_ui_kit/alert_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/alert_component.rb +1 -1
- data/app/components/lightning_ui_kit/avatar_component.html.erb +5 -5
- data/app/components/lightning_ui_kit/avatar_component.rb +3 -3
- data/app/components/lightning_ui_kit/badge_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/badge_component.rb +19 -19
- data/app/components/lightning_ui_kit/banner_component.html.erb +6 -6
- data/app/components/lightning_ui_kit/banner_component.rb +3 -3
- data/app/components/lightning_ui_kit/button_component.rb +29 -28
- data/app/components/lightning_ui_kit/checkbox_component.html.erb +29 -8
- data/app/components/lightning_ui_kit/description_list/item_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/description_list_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/dropdown_component.html.erb +5 -5
- data/app/components/lightning_ui_kit/dropdown_component.rb +3 -3
- data/app/components/lightning_ui_kit/dropzone_component.html.erb +22 -22
- data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
- data/app/components/lightning_ui_kit/file_input_component.html.erb +6 -6
- data/app/components/lightning_ui_kit/file_input_component.rb +1 -1
- data/app/components/lightning_ui_kit/input_component.html.erb +13 -13
- data/app/components/lightning_ui_kit/input_component.rb +1 -1
- data/app/components/lightning_ui_kit/link_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/modal_component.html.erb +7 -7
- data/app/components/lightning_ui_kit/pagination_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/pagination_component.rb +5 -4
- data/app/components/lightning_ui_kit/select_component.html.erb +14 -9
- data/app/components/lightning_ui_kit/skeleton_component.html.erb +4 -4
- data/app/components/lightning_ui_kit/spinner_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/switch_component.html.erb +21 -6
- data/app/components/lightning_ui_kit/table_component.html.erb +10 -10
- data/app/components/lightning_ui_kit/text_component.rb +1 -1
- data/app/components/lightning_ui_kit/textarea_component.html.erb +10 -8
- data/app/javascript/lightning_ui_kit/controllers/accordion_controller.js +11 -11
- data/app/javascript/lightning_ui_kit/controllers/banner_controller.js +3 -3
- data/app/javascript/lightning_ui_kit/controllers/dropdown_controller.js +2 -1
- data/lib/lightning_ui_kit/version.rb +1 -1
- metadata +2 -2
@@ -2,4 +2,4 @@
|
|
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);})();
|
@@ -7,7 +7,7 @@ class LightningUiKit::AlertComponent < LightningUiKit::BaseComponent
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def default_classes
|
10
|
-
"flex items-center p-4 text-sm text-gray-800 rounded-lg bg-gray-50"
|
10
|
+
"lui:flex lui:items-center lui:p-4 lui:text-sm lui:text-gray-800 lui:rounded-lg lui:bg-gray-50"
|
11
11
|
end
|
12
12
|
|
13
13
|
def classes
|
@@ -1,20 +1,20 @@
|
|
1
1
|
<%= tag.span(
|
2
2
|
class: class_names(
|
3
|
-
"inline-grid shrink-0 align-middle [--avatar-radius:20%] [--ring-opacity:20%] *:col-start-1 *:row-start-1 outline
|
3
|
+
"lui:inline-grid lui:shrink-0 lui:align-middle lui:[--avatar-radius:20%] lui:[--ring-opacity:20%] *:lui:col-start-1 *:lui:row-start-1 lui:outline lui:-outline-offset-1 lui:outline-black/(--ring-opacity)",
|
4
4
|
SIZE_CLASSES.fetch(@size, SIZE_CLASSES[:md]),
|
5
|
-
@initials ? "text-white bg-zinc-900" : "text-zinc-500 bg-zinc-200",
|
6
|
-
@square ? "rounded-(--avatar-radius)
|
5
|
+
@initials ? "lui:text-white lui:bg-zinc-900" : "lui:text-zinc-500 lui:bg-zinc-200",
|
6
|
+
@square ? "lui:rounded-(--avatar-radius) lui:*:rounded-(--avatar-radius)" : "lui:rounded-full lui:*:rounded-full",
|
7
7
|
@options[:class]
|
8
8
|
),
|
9
9
|
data: { slot: "avatar" }
|
10
10
|
) do %>
|
11
11
|
<% if @initials %>
|
12
|
-
<svg class="size-full fill-current p-[5%] text-[48px] font-medium uppercase select-none" viewBox="0 0 100 100" aria-hidden="true">
|
12
|
+
<svg class="lui:size-full lui:fill-current lui:p-[5%] lui:text-[48px] lui:font-medium lui:uppercase lui:select-none" viewBox="0 0 100 100" aria-hidden="true">
|
13
13
|
<text x="50%" y="50%" alignment-baseline="middle" dominant-baseline="middle" text-anchor="middle" dy=".125em">
|
14
14
|
<%= @initials %>
|
15
15
|
</text>
|
16
16
|
</svg>
|
17
17
|
<% else %>
|
18
|
-
<%= image_tag(@url, class: "size-full", alt: @alt) %>
|
18
|
+
<%= image_tag(@url, class: "lui:size-full", alt: @alt) %>
|
19
19
|
<% end %>
|
20
20
|
<% end %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
class LightningUiKit::AvatarComponent < LightningUiKit::BaseComponent
|
4
4
|
SIZE_CLASSES = {
|
5
|
-
sm: "size-6",
|
6
|
-
md: "size-8",
|
7
|
-
lg: "size-10"
|
5
|
+
sm: "lui:size-6",
|
6
|
+
md: "lui:size-8",
|
7
|
+
lg: "lui:size-10"
|
8
8
|
}
|
9
9
|
|
10
10
|
def initialize(url: nil, size: :md, initials: nil, square: false, alt: nil, **options)
|
@@ -9,13 +9,13 @@ class LightningUiKit::BadgeComponent < LightningUiKit::BaseComponent
|
|
9
9
|
def classes
|
10
10
|
status_classes = case @status
|
11
11
|
when :success
|
12
|
-
"bg-green-200 text-zinc-500"
|
12
|
+
"lui:bg-green-200 lui:text-zinc-500"
|
13
13
|
when :warning
|
14
|
-
"bg-yellow-200 text-zinc-500"
|
14
|
+
"lui:bg-yellow-200 lui:text-zinc-500"
|
15
15
|
when :error
|
16
|
-
"bg-red-600/80 text-white"
|
16
|
+
"lui:bg-red-600/80 lui:text-white"
|
17
17
|
else
|
18
|
-
"bg-zinc-400/20 text-zinc-500"
|
18
|
+
"lui:bg-zinc-400/20 lui:text-zinc-500"
|
19
19
|
end
|
20
20
|
[defalt_classes, status_classes].join(" ")
|
21
21
|
end
|
@@ -25,44 +25,44 @@ class LightningUiKit::BadgeComponent < LightningUiKit::BaseComponent
|
|
25
25
|
when :complete
|
26
26
|
case @status
|
27
27
|
when :success
|
28
|
-
"bg-green-600 border-green-600"
|
28
|
+
"lui:bg-green-600 lui:border-green-600"
|
29
29
|
when :warning
|
30
|
-
"bg-yellow-400 border-yellow-400"
|
30
|
+
"lui:bg-yellow-400 lui:border-yellow-400"
|
31
31
|
when :error
|
32
|
-
"bg-red-700 border-red-700"
|
32
|
+
"lui:bg-red-700 lui:border-red-700"
|
33
33
|
else
|
34
|
-
"bg-zinc-400 border-zinc-400"
|
34
|
+
"lui:bg-zinc-400 lui:border-zinc-400"
|
35
35
|
end
|
36
36
|
when :incomplete
|
37
37
|
case @status
|
38
38
|
when :error
|
39
|
-
"bg-transparent border-white"
|
39
|
+
"lui:bg-transparent lui:border-white"
|
40
40
|
else
|
41
|
-
"bg-transparent border-zinc-400"
|
41
|
+
"lui:bg-transparent lui:border-zinc-400"
|
42
42
|
end
|
43
43
|
when :partialy_complete
|
44
|
-
partialy_complete_classes = "relative after:w-[3.75px] after:h-[8.2px]\
|
45
|
-
after:border-transparent after:border-[1px] after:-rotate-45 after:absolute after:-top-[1px]\
|
46
|
-
after:left-[1px] after:margin-0 after-margin-y-[1px]"
|
44
|
+
partialy_complete_classes = "lui:relative lui:after:w-[3.75px] lui:after:h-[8.2px]\
|
45
|
+
lui:after:border-transparent lui:after:border-[1px] lui:after:-rotate-45 lui:after:absolute lui:after:-top-[1px]\
|
46
|
+
lui:after:left-[1px] lui:after:margin-0 lui:after-margin-y-[1px]"
|
47
47
|
case @status
|
48
48
|
when :success
|
49
|
-
"#{partialy_complete_classes} border-green-600 after:border-l-green-600 after:border-r-green-600"
|
49
|
+
"#{partialy_complete_classes} lui:border-green-600 lui:after:border-l-green-600 lui:after:border-r-green-600"
|
50
50
|
when :warning
|
51
|
-
"#{partialy_complete_classes} border-yellow-400 after:border-l-yellow-400 after:border-r-yellow-400"
|
51
|
+
"#{partialy_complete_classes} lui:border-yellow-400 lui:after:border-l-yellow-400 lui:after:border-r-yellow-400"
|
52
52
|
when :error
|
53
|
-
"#{partialy_complete_classes} border-white after:border-l-white after:border-r-white"
|
53
|
+
"#{partialy_complete_classes} lui:border-white lui:after:border-l-white lui:after:border-r-white"
|
54
54
|
else
|
55
|
-
"#{partialy_complete_classes} border-zinc-400 after:border-l-zinc-400 after:border-r-zinc-400"
|
55
|
+
"#{partialy_complete_classes} lui:border-zinc-400 lui:after:border-l-zinc-400 lui:after:border-r-zinc-400"
|
56
56
|
end
|
57
57
|
end
|
58
58
|
[default_progress_classes, progress_classes].join(" ")
|
59
59
|
end
|
60
60
|
|
61
61
|
def default_progress_classes
|
62
|
-
"h-2 w-2 rounded-[3px] border-[1px]"
|
62
|
+
"lui:h-2 lui:w-2 lui:rounded-[3px] lui:border-[1px]"
|
63
63
|
end
|
64
64
|
|
65
65
|
def defalt_classes
|
66
|
-
"relative inline-flex items-center relative gap-x-1.5 rounded-[10px] px-2.5 py-1 text-sm font-medium sm:text-xs forced-colors:outline"
|
66
|
+
"lui:relative lui:inline-flex lui:items-center lui:relative lui:gap-x-1.5 lui:rounded-[10px] lui:px-2.5 lui:py-1 lui:text-sm lui:font-medium lui:sm:text-xs lui:forced-colors:outline"
|
67
67
|
end
|
68
68
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<%= tag.div(class: classes, data: { type: @type, controller: "lui-banner" }) do %>
|
2
|
-
<div data-slot="header" class="flex items-center px-4 py-3">
|
3
|
-
<%= heroicon(icon, variant: :outline, options: { class: "shrink-0 w-5 h-5 me-2" }) %>
|
4
|
-
<span class="sr-only"><%= @type.to_s.humanize %></span>
|
5
|
-
<h3 class="text-md font-medium"><%= @title %></h3>
|
2
|
+
<div data-slot="header" class="lui:flex lui:items-center lui:px-4 lui:py-3">
|
3
|
+
<%= heroicon(icon, variant: :outline, options: { class: "lui:shrink-0 lui:w-5 lui:h-5 lui:me-2" }) %>
|
4
|
+
<span class="lui:sr-only"><%= @type.to_s.humanize %></span>
|
5
|
+
<h3 class="lui:text-md lui:font-medium"><%= @title %></h3>
|
6
6
|
</div>
|
7
7
|
|
8
|
-
<div class="text-sm text-gray-800 p-4">
|
8
|
+
<div class="lui:text-sm lui:text-gray-800 lui:p-4">
|
9
9
|
<%= content %>
|
10
10
|
</div>
|
11
11
|
|
12
12
|
<% if footer.present? %>
|
13
|
-
<div class="p-4 pt-0">
|
13
|
+
<div class="lui:p-4 lui:pt-0">
|
14
14
|
<%= footer %>
|
15
15
|
</div>
|
16
16
|
<% end %>
|
@@ -12,9 +12,9 @@ class LightningUiKit::BannerComponent < LightningUiKit::BaseComponent
|
|
12
12
|
def classes
|
13
13
|
type_classes = case @type
|
14
14
|
when :error
|
15
|
-
"
|
15
|
+
"lui:*:data-[slot=header]:bg-red-600/80 lui:*:data-[slot=header]:text-white"
|
16
16
|
else
|
17
|
-
"
|
17
|
+
"lui:*:data-[slot=header]:bg-gray-50"
|
18
18
|
end
|
19
19
|
|
20
20
|
merge_classes([default_classes, type_classes, @options[:class]].compact.join(" "))
|
@@ -30,6 +30,6 @@ class LightningUiKit::BannerComponent < LightningUiKit::BaseComponent
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def default_classes
|
33
|
-
"border border-zinc-950/10 rounded-lg overflow-hidden transition-opacity duration-300 ease-out opacity-100"
|
33
|
+
"lui:border lui:border-zinc-950/10 lui:rounded-lg lui:overflow-hidden lui:transition-opacity lui:duration-300 lui:ease-out lui:opacity-100"
|
34
34
|
end
|
35
35
|
end
|
@@ -30,46 +30,47 @@ class LightningUiKit::ButtonComponent < LightningUiKit::BaseComponent
|
|
30
30
|
|
31
31
|
case @size
|
32
32
|
when :small
|
33
|
-
class_list << "text-xs"
|
33
|
+
class_list << "lui:text-xs"
|
34
34
|
when :default
|
35
|
-
class_list << "text-base/6 font-semibold sm:text-sm/6"
|
35
|
+
class_list << "lui:text-base/6 lui:font-semibold lui:sm:text-sm/6"
|
36
36
|
end
|
37
37
|
|
38
38
|
merge_classes(class_list.compact.join(" "))
|
39
39
|
end
|
40
40
|
|
41
41
|
def destructive_classes
|
42
|
-
"text-white border-red-500 hover:bg-red-600 active:bg-red-700\
|
43
|
-
[--btn-bg:var(--color-red-600)]\
|
44
|
-
[--btn-border:var(--color-red-950)]/90
|
45
|
-
[--btn-hover-overlay:var(--color-white)]/10\
|
46
|
-
[--btn-icon:var(--color-red-400)]\
|
47
|
-
active:[--btn-icon:var(--color-zinc-300)] hover:[--btn-icon:var(--color-zinc-300)] cursor-pointer"
|
42
|
+
"lui:text-white lui:border-red-500 lui:hover:bg-red-600 lui:active:bg-red-700\
|
43
|
+
lui:[--btn-bg:var(--lui-color-red-600)]\
|
44
|
+
lui:[--btn-border:var(--lui-color-red-950)]/90
|
45
|
+
lui:[--btn-hover-overlay:var(--lui-color-white)]/10\
|
46
|
+
lui:[--btn-icon:var(--lui-color-red-400)]\
|
47
|
+
lui:active:[--btn-icon:var(--lui-color-zinc-300)] lui:hover:[--btn-icon:var(--lui-color-zinc-300)] lui:cursor-pointer"
|
48
48
|
end
|
49
49
|
|
50
|
-
# TODO:
|
51
50
|
def default_classes
|
52
|
-
"relative isolate rounded-lg border inline-flex items-baseline justify-center gap-x-2 px-4 py-2 sm:px-[calc(--spacing(3)-1px)]\
|
53
|
-
sm:py-[calc(--spacing(1.5)-1px)] focus:outline-hidden
|
54
|
-
|
55
|
-
sm:*:data-[slot=icon]:my-1 sm:*:data-[slot=icon]:size-4 border-transparent bg-(--btn-border) before:absolute before:inset-0\
|
56
|
-
before:-z-10 before:rounded-[calc(var(--radius-lg)-1px)] before:bg-(--btn-bg) before:shadow-sm after:absolute after:inset-0
|
57
|
-
after:-z-10 after:rounded-[calc(var(--radius-lg)-1px)] after:shadow-[shadow:inset_0_1px_--theme(--color-white/15%)]\
|
58
|
-
active:after:bg-(--btn-hover-overlay) hover:after:bg-(--btn-hover-overlay)
|
59
|
-
|
60
|
-
|
61
|
-
[--btn-
|
62
|
-
[--btn-
|
63
|
-
[--btn-
|
64
|
-
|
51
|
+
"lui:relative lui:isolate lui:rounded-lg lui:border lui:inline-flex lui:items-baseline lui:justify-center lui:gap-x-2 lui:px-4 lui:py-2 lui:sm:px-[calc(--spacing(3)-1px)]\
|
52
|
+
lui:sm:py-[calc(--spacing(1.5)-1px)] lui:focus:outline-hidden lui:*:data-[slot=icon]:-mx-0.5 lui:*:data-[slot=icon]:my-0.5\
|
53
|
+
lui:*:data-[slot=icon]:size-5 lui:*:data-[slot=icon]:shrink-0 lui:*:data-[slot=icon]:self-center lui:*:data-[slot=icon]:text-(--btn-icon)\
|
54
|
+
lui:sm:*:data-[slot=icon]:my-1 lui:sm:*:data-[slot=icon]:size-4 lui:border-transparent lui:bg-(--btn-border) lui:before:absolute lui:before:inset-0\
|
55
|
+
lui:before:-z-10 lui:before:rounded-[calc(var(--lui-radius-lg)-1px)] lui:before:bg-(--btn-bg) lui:before:shadow-sm lui:after:absolute lui:after:inset-0
|
56
|
+
lui:after:-z-10 lui:after:rounded-[calc(var(--lui-radius-lg)-1px)] lui:after:shadow-[shadow:inset_0_1px_--theme(--color-white/15%)]\
|
57
|
+
lui:active:after:bg-(--btn-hover-overlay) lui:hover:after:bg-(--btn-hover-overlay)\
|
58
|
+
lui:disabled:opacity-50 lui:disabled:before:shadow-none lui:disabled:after:shadow-none lui:disabled:hover:after:bg-transparent\
|
59
|
+
lui:text-white lui:cursor-pointer\
|
60
|
+
lui:[--btn-bg:var(--lui-color-zinc-900)]\
|
61
|
+
lui:[--btn-border:var(--lui-color-zinc-950)]/90
|
62
|
+
lui:[--btn-hover-overlay:var(--lui-color-white)]/10\
|
63
|
+
lui:[--btn-icon:var(--lui-color-zinc-400)]\
|
64
|
+
lui:active:[--btn-icon:var(--lui-color-zinc-300)]\
|
65
|
+
lui:hover:[--btn-icon:var(--lui-color-zinc-300)]"
|
65
66
|
end
|
66
67
|
|
67
68
|
def outline_classes
|
68
|
-
"relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-lg border px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)]\
|
69
|
-
sm:py-[calc(--spacing(1.5)-1px)] focus:outline-hidden focus:outline focus:outline-2 focus:outline-offset-2\
|
70
|
-
focus:outline-blue-500 disabled:opacity-50
|
71
|
-
|
72
|
-
sm:*:data-[slot=icon]:size-4 border-zinc-950/10 text-zinc-950 active:bg-zinc-950/[2.5%] hover:bg-zinc-950/[2.5%]\
|
73
|
-
[--btn-icon:var(--color-zinc-500)] active:[--btn-icon:var(--color-zinc-700)] hover:[--btn-icon:var(--color-zinc-700)] cursor-pointer"
|
69
|
+
"lui:relative lui:isolate lui:inline-flex lui:items-baseline lui:justify-center lui:gap-x-2 lui:rounded-lg lui:border lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] sm:lui:px-[calc(--spacing(3)-1px)]\
|
70
|
+
lui:sm:py-[calc(--spacing(1.5)-1px)] lui:focus:outline-hidden lui:focus:outline lui:focus:outline-2 lui:focus:outline-offset-2\
|
71
|
+
lui:focus:outline-blue-500 lui:disabled:opacity-50 lui:*:data-[slot=icon]:-mx-0.5 lui:*:data-[slot=icon]:my-0.5 lui:*:data-[slot=icon]:size-5\
|
72
|
+
lui:*:data-[slot=icon]:shrink-0 lui:*:data-[slot=icon]:self-center lui:*:data-[slot=icon]:text-(--btn-icon) lui:sm:*:data-[slot=icon]:my-1\
|
73
|
+
lui:sm:*:data-[slot=icon]:size-4 lui:border-zinc-950/10 lui:text-zinc-950 lui:active:bg-zinc-950/[2.5%] lui:hover:bg-zinc-950/[2.5%]\
|
74
|
+
lui:[--btn-icon:var(--lui-color-zinc-500)] lui:active:[--btn-icon:var(--lui-color-zinc-700)] lui:hover:[--btn-icon:var(--lui-color-zinc-700)] lui:cursor-pointer"
|
74
75
|
end
|
75
76
|
end
|
@@ -1,26 +1,47 @@
|
|
1
|
-
<div
|
1
|
+
<div
|
2
|
+
data-controller="lui-checkbox"
|
3
|
+
data-slot="field"
|
4
|
+
class="lui:grid lui:grid-cols-[1.125rem_1fr] lui:items-center lui:gap-x-4 lui:gap-y-1 lui:sm:grid-cols-[1rem_1fr] lui:*:data-[slot=control]:col-start-1 lui:*:data-[slot=control]:row-start-1 lui:*:data-[slot=control]:justify-self-center lui:*:data-[slot=label]:col-start-2 lui:*:data-[slot=label]:row-start-1 lui:*:data-[slot=label]:justify-self-start lui:*:data-[slot=description]:col-start-2 lui:*:data-[slot=description]:row-start-2 lui:has-data-[slot=description]:**:data-[slot=label]:font-medium"
|
5
|
+
>
|
2
6
|
<span
|
3
7
|
data-lui-checkbox-target="control"
|
4
8
|
data-slot="control"
|
5
|
-
class="group inline-flex focus:outline-hidden"
|
9
|
+
class="lui:group lui:inline-flex lui:focus:outline-hidden" role="checkbox" aria-checked="false" tabindex="0"
|
6
10
|
data-action="click->lui-checkbox#toggle"
|
7
11
|
>
|
8
|
-
<span class="relative isolate flex size-[1.125rem] items-center justify-center
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
+
<span class="lui:relative lui:isolate lui:flex lui:size-[1.125rem] lui:items-center lui:justify-center
|
13
|
+
lui:rounded-[0.3125rem] lui:sm:size-4 lui:before:absolute lui:before:inset-0 lui:before:-z-10
|
14
|
+
lui:before:rounded-[calc(0.3125rem-1px)] lui:before:bg-white lui:before:shadow-sm
|
15
|
+
lui:group-data-checked:before:bg-(--checkbox-checked-bg) lui:border lui:border-zinc-950/15
|
16
|
+
lui:group-data-checked:border-transparent lui:group-hover:group-data-checked:border-transparent
|
17
|
+
lui:group-hover:border-zinc-950/30 lui:group-data-checked:bg-(--checkbox-checked-border)
|
18
|
+
lui:after:absolute lui:after:inset-0 lui:after:rounded-[calc(0.3125rem-1px)] lui:after:shadow-[inset_0_1px_--theme(--color-white/15%)]
|
19
|
+
lui:group-data-focus:outline lui:group-data-focus:outline-2 lui:group-data-focus:outline-offset-2
|
20
|
+
lui:group-data-focus:outline-blue-500 lui:group-data-disabled:opacity-50 lui:group-data-disabled:border-zinc-950/25
|
21
|
+
lui:group-data-disabled:bg-zinc-950/5 lui:group-data-disabled:[--checkbox-check:var(--lui-color-zinc-950)]/50
|
22
|
+
lui:group-data-disabled:before:bg-transparent lui:forced-colors:[--checkbox-check:HighlightText] lui:forced-colors:[--checkbox-checked-bg:Highlight]
|
23
|
+
lui:forced-colors:group-data-disabled:[--checkbox-check:Highlight]
|
24
|
+
lui:[--checkbox-check:var(--lui-color-white)]
|
25
|
+
lui:[--checkbox-checked-bg:var(--lui-color-zinc-900)]
|
26
|
+
lui:[--checkbox-checked-border:var(--color-zinc-950)]/90"
|
27
|
+
>
|
28
|
+
<svg class="lui:size-4 lui:stroke-(--checkbox-check) lui:opacity-0 lui:group-data-checked:opacity-100 lui:sm:h-3.5 lui:sm:w-3.5" viewBox="0 0 14 14" fill="none">
|
29
|
+
<path class="lui:opacity-100 lui:group-data-indeterminate:opacity-0" d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
30
|
+
<path class="lui:opacity-0 lui:group-data-indeterminate:opacity-100" d="M3 7H11" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
12
31
|
</svg>
|
13
32
|
</span>
|
14
33
|
</span>
|
15
34
|
<% if @label %>
|
16
|
-
<label
|
35
|
+
<label
|
36
|
+
data-slot="label"
|
37
|
+
class="lui:text-base/6 lui:text-zinc-950 lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6"
|
17
38
|
data-action="click->lui-checkbox#toggle"
|
18
39
|
>
|
19
40
|
<%= @label %>
|
20
41
|
</label>
|
21
42
|
<% end %>
|
22
43
|
<% if @description %>
|
23
|
-
<p data-slot="description" class="text-base/6 text-zinc-500 data-disabled:opacity-50 sm:text-sm/6"
|
44
|
+
<p data-slot="description" class="lui:text-base/6 lui:text-zinc-500 lui:data-disabled:opacity-50 lui:sm:text-sm/6">
|
24
45
|
<%= @description %>
|
25
46
|
</p>
|
26
47
|
<% end %>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<dt class="col-start-1 border-t border-zinc-950/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:py-3 flex items-center">
|
1
|
+
<dt class="lui:col-start-1 lui:border-t lui:border-zinc-950/5 lui:pt-3 lui:text-zinc-500 lui:first:border-none lui:sm:border-t lui:sm:border-zinc-950/5 lui:sm:py-3 lui:flex lui:items-center">
|
2
2
|
<%= @label %>
|
3
3
|
</dt>
|
4
4
|
|
5
|
-
<dd class="pt-1 pb-3 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:py-3 sm:nth-2:border-none flex items-center">
|
6
|
-
<div class="w-full">
|
5
|
+
<dd class="lui:pt-1 lui:pb-3 lui:text-zinc-950 lui:sm:border-t lui:sm:border-zinc-950/5 lui:sm:py-3 lui:sm:nth-2:border-none lui:flex lui:items-center">
|
6
|
+
<div class="lui:w-full">
|
7
7
|
<% if @value %>
|
8
8
|
<%= @value %>
|
9
9
|
<% else %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<dl class="grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,--spacing(80))_auto] sm:text-sm/6">
|
1
|
+
<dl class="lui:grid lui:grid-cols-1 lui:text-base/6 lui:sm:grid-cols-[min(50%,--spacing(80))_auto] lui:sm:text-sm/6">
|
2
2
|
<% items.each do |item| %>
|
3
3
|
<%= item %>
|
4
4
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<div data-controller="lui-dropdown" class="relative">
|
2
|
-
<button type="button" data-action="lui-dropdown#toggle click@window->lui-dropdown#hide" class="flex items-center justify-between cursor-pointer w-full text-sm/6 font-medium text-zinc-700 hover:text-zinc-950">
|
1
|
+
<div data-controller="lui-dropdown" class="lui:relative">
|
2
|
+
<button type="button" data-action="lui-dropdown#toggle click@window->lui-dropdown#hide" class="lui:flex lui:items-center lui:justify-between lui:cursor-pointer lui:w-full lui:text-sm/6 lui:font-medium lui:text-zinc-700 lui:hover:text-zinc-950">
|
3
3
|
<% if trigger? %>
|
4
4
|
<%= trigger %>
|
5
5
|
<% else %>
|
@@ -8,11 +8,11 @@
|
|
8
8
|
|
9
9
|
<% case @anchor.to_s %>
|
10
10
|
<% when "bottom_right" %>
|
11
|
-
<svg class="w-2.5 h-2.5 ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
11
|
+
<svg class="lui:w-2.5 lui:h-2.5 lui:ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
12
12
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
|
13
13
|
</svg>
|
14
14
|
<% when "top_right" %>
|
15
|
-
<svg class="w-2.5 h-2.5 ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
15
|
+
<svg class="lui:w-2.5 lui:h-2.5 lui:ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
16
16
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 5 4-4 4 4"/>
|
17
17
|
</svg>
|
18
18
|
<% end %>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
data-transition-leave-to="opacity-0 scale-95"
|
28
28
|
>
|
29
29
|
<% items.each do |item| %>
|
30
|
-
<div class="px-4 py-2 text-sm/5 font-medium text-zinc-950 hover:bg-zinc-950/5">
|
30
|
+
<div class="lui:px-4 lui:py-2 lui:text-sm/5 lui:font-medium lui:text-zinc-950 lui:hover:bg-zinc-950/5">
|
31
31
|
<%= item %>
|
32
32
|
</div>
|
33
33
|
<% end %>
|
@@ -11,12 +11,12 @@ class LightningUiKit::DropdownComponent < LightningUiKit::BaseComponent
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def menu_classes
|
14
|
-
classes = %w[hidden transition transform p-1 origin-top-left absolute left-0 w-56 rounded-md shadow-lg bg-white ring-1 ring-zinc-950/10 focus:outline-none]
|
14
|
+
classes = %w[lui:hidden lui:transition lui:transform lui:p-1 lui:origin-top-left lui:absolute lui:left-0 lui:w-56 lui:rounded-md lui:shadow-lg lui:bg-white lui:ring-1 lui:ring-zinc-950/10 lui:focus:outline-none]
|
15
15
|
case @position.to_s
|
16
16
|
when "top"
|
17
|
-
classes << "mb-2 top-auto bottom-full"
|
17
|
+
classes << "lui:mb-2 lui:top-auto lui:bottom-full"
|
18
18
|
when "bottom"
|
19
|
-
classes << "mt-2"
|
19
|
+
classes << "lui:mt-2"
|
20
20
|
end
|
21
21
|
classes.join(" ")
|
22
22
|
end
|