widgies 0.1.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.
- package/README.md +105 -0
- package/dist/affirmation.d.ts +1 -0
- package/dist/affirmation.js +129 -0
- package/dist/affirmation.min.js +129 -0
- package/dist/ambient.d.ts +1 -0
- package/dist/ambient.js +191 -0
- package/dist/ambient.min.js +191 -0
- package/dist/calculator.d.ts +1 -0
- package/dist/calculator.js +97 -0
- package/dist/calculator.min.js +97 -0
- package/dist/chunk-3F3FJ7VN.js +82 -0
- package/dist/chunk-BP7C5X5K.min.js +82 -0
- package/dist/core/BaseWidget.d.ts +15 -0
- package/dist/core/theme.d.ts +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/qr-code.d.ts +1 -0
- package/dist/qr-code.js +125 -0
- package/dist/qr-code.min.js +125 -0
- package/dist/qrcode-5PUKNF3Z.js +3 -0
- package/dist/qrcode-DXXPLUCT.min.js +3 -0
- package/dist/random-number.d.ts +1 -0
- package/dist/random-number.js +109 -0
- package/dist/random-number.min.js +109 -0
- package/dist/timer.d.ts +1 -0
- package/dist/timer.js +153 -0
- package/dist/timer.min.js +153 -0
- package/dist/widgets/affirmation.d.ts +21 -0
- package/dist/widgets/ambient.d.ts +34 -0
- package/dist/widgets/calculator.d.ts +18 -0
- package/dist/widgets/qr-code.d.ts +22 -0
- package/dist/widgets/random-number.d.ts +17 -0
- package/dist/widgets/timer.d.ts +30 -0
- package/dist/widgies.js +882 -0
- package/dist/widgies.min.js +882 -0
- package/package.json +83 -0
package/dist/qr-code.js
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
import{a as l}from"./chunk-3F3FJ7VN.js";var d=null,s=class extends l{constructor(){super(...arguments);this.textInput=null;this.generateButton=null;this.qrDisplay=null;this.downloadButton=null}render(){this.shadow.innerHTML="";let t=this.createStyleSheet();t&&this.shadow.appendChild(t);let e=document.createElement("div");e.innerHTML=`
|
2
|
+
<div class="qr-generator" role="application" aria-label="QR code generator">
|
3
|
+
<div class="input-section">
|
4
|
+
<label for="qr-text">Text to encode:</label>
|
5
|
+
<input
|
6
|
+
type="text"
|
7
|
+
id="qr-text"
|
8
|
+
class="text-input"
|
9
|
+
placeholder="Enter text or URL"
|
10
|
+
value="${this.getAttribute("text")||""}"
|
11
|
+
maxlength="256"
|
12
|
+
aria-describedby="qr-display"
|
13
|
+
>
|
14
|
+
<button class="generate-btn" type="button">Generate QR Code</button>
|
15
|
+
</div>
|
16
|
+
<div class="qr-display" id="qr-display" aria-live="polite" aria-label="Generated QR code">
|
17
|
+
<div class="placeholder">Enter text above to generate QR code</div>
|
18
|
+
</div>
|
19
|
+
<button class="download-btn" type="button" style="display: none;" aria-label="Download QR code as PNG">
|
20
|
+
Download PNG
|
21
|
+
</button>
|
22
|
+
</div>
|
23
|
+
`,this.shadow.appendChild(e),this.textInput=this.shadow.querySelector(".text-input"),this.generateButton=this.shadow.querySelector(".generate-btn"),this.qrDisplay=this.shadow.querySelector(".qr-display"),this.downloadButton=this.shadow.querySelector(".download-btn")}attachEventListeners(){this.generateButton?.addEventListener("click",()=>{this.generateQRCode()}),this.textInput?.addEventListener("input",()=>{this.validateInput()}),this.textInput?.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.generateQRCode())}),this.downloadButton?.addEventListener("click",()=>{this.downloadQRCode()})}handleActivation(t){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.textInput?.value&&this.generateQRCode())}validateInput(){if(!this.textInput||!this.generateButton)return;let t=this.textInput.value.trim();this.generateButton.disabled=t.length===0}async generateQRCode(){if(!this.textInput||!this.qrDisplay)return;let t=this.textInput.value.trim();if(!t){this.showError("Please enter text to encode");return}try{if(!d){this.showLoading("Loading QR code generator...");try{d=(await import("./qrcode-5PUKNF3Z.js")).default}catch{this.showError("Failed to load QR code generator. Please ensure the library is available.");return}}let e=this.createQRCode(t);this.renderQRCode(e),this.downloadButton.style.display="block",this.dispatchEvent(new CustomEvent("qr-generated",{detail:{text:t,size:e.length},bubbles:!0}))}catch{this.showError("Failed to generate QR code")}}createQRCode(t){try{let e=d(0,"L");e.addData(t),e.make();let i=e.getModuleCount(),r=[];for(let a=0;a<i;a++){r[a]=[];for(let n=0;n<i;n++)r[a][n]=e.isDark(a,n)?1:0}return r}catch(e){return console.error("QR Code generation failed:",e),[[1,1,1],[1,0,1],[1,1,1]]}}renderQRCode(t){if(!this.qrDisplay)return;let e=t.length,i=8,r=document.createElement("canvas"),a=r.getContext("2d");if(r.width=e*i,r.height=e*i,r.setAttribute("aria-label",`QR code for: ${this.textInput?.value}`),a){a.fillStyle="#ffffff",a.fillRect(0,0,r.width,r.height),a.fillStyle="#000000";for(let n=0;n<e;n++)for(let o=0;o<e;o++)t[n][o]===1&&a.fillRect(o*i,n*i,i,i)}this.qrDisplay.innerHTML="",this.qrDisplay.appendChild(r)}downloadQRCode(){let t=this.qrDisplay?.querySelector("canvas");if(t)try{let e=document.createElement("a");e.download=`qr-code-${Date.now()}.png`,e.href=t.toDataURL("image/png"),e.click()}catch{this.showError("Download failed")}}showError(t){this.qrDisplay&&(this.qrDisplay.innerHTML=`<div class="error" role="alert">${t}</div>`,this.downloadButton.style.display="none")}showLoading(t){this.qrDisplay&&(this.qrDisplay.innerHTML=`<div class="loading" role="status">${t}</div>`,this.downloadButton.style.display="none")}static get observedAttributes(){return["text"]}attributeChangedCallback(t,e,i){t==="text"&&this.textInput&&(this.textInput.value=i||"",this.validateInput())}connectedCallback(){super.connectedCallback(),this.generateButton&&(this.generateButton.disabled=!0),setTimeout(()=>this.validateInput(),0)}getStyles(){return`
|
24
|
+
${this.getBaseStyles()}
|
25
|
+
|
26
|
+
.qr-generator {
|
27
|
+
width: 300px;
|
28
|
+
text-align: center;
|
29
|
+
}
|
30
|
+
|
31
|
+
.input-section {
|
32
|
+
margin-bottom: 1rem;
|
33
|
+
}
|
34
|
+
|
35
|
+
.input-section label {
|
36
|
+
display: block;
|
37
|
+
margin-bottom: 0.5rem;
|
38
|
+
font-weight: 500;
|
39
|
+
font-size: 0.9rem;
|
40
|
+
}
|
41
|
+
|
42
|
+
.text-input {
|
43
|
+
width: 100%;
|
44
|
+
padding: 0.75rem;
|
45
|
+
margin-bottom: 1rem;
|
46
|
+
border: 1px solid color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 30%, transparent);
|
47
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
48
|
+
background: var(--widgies-surface, var(--widgies-surface-light, #ffffffe6));
|
49
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
50
|
+
font: inherit;
|
51
|
+
box-sizing: border-box;
|
52
|
+
}
|
53
|
+
|
54
|
+
.text-input:focus {
|
55
|
+
outline: 2px solid var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
56
|
+
outline-offset: 1px;
|
57
|
+
}
|
58
|
+
|
59
|
+
.generate-btn, .download-btn {
|
60
|
+
width: 100%;
|
61
|
+
padding: 0.75rem 1.5rem;
|
62
|
+
font-size: 1rem;
|
63
|
+
font-weight: 600;
|
64
|
+
margin-bottom: 0.5rem;
|
65
|
+
}
|
66
|
+
|
67
|
+
.qr-display {
|
68
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)) 70%, var(--widgies-text, var(--widgies-text-light, #1a1a1a)));
|
69
|
+
padding: 1rem;
|
70
|
+
border-radius: var(--widgies-radius, 0.5rem);
|
71
|
+
margin-bottom: 1rem;
|
72
|
+
min-height: 200px;
|
73
|
+
display: flex;
|
74
|
+
align-items: center;
|
75
|
+
justify-content: center;
|
76
|
+
}
|
77
|
+
|
78
|
+
.placeholder {
|
79
|
+
color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 60%, transparent);
|
80
|
+
font-style: italic;
|
81
|
+
}
|
82
|
+
|
83
|
+
.error {
|
84
|
+
color: #dc2626;
|
85
|
+
font-weight: 500;
|
86
|
+
}
|
87
|
+
|
88
|
+
.loading {
|
89
|
+
color: var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
90
|
+
font-weight: 500;
|
91
|
+
animation: pulse 1.5s ease-in-out infinite;
|
92
|
+
}
|
93
|
+
|
94
|
+
@keyframes pulse {
|
95
|
+
0%, 100% { opacity: 1; }
|
96
|
+
50% { opacity: 0.5; }
|
97
|
+
}
|
98
|
+
|
99
|
+
canvas {
|
100
|
+
max-width: 100%;
|
101
|
+
height: auto;
|
102
|
+
image-rendering: pixelated;
|
103
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
104
|
+
}
|
105
|
+
|
106
|
+
@media (prefers-color-scheme: dark) {
|
107
|
+
.text-input {
|
108
|
+
background: var(--widgies-surface, var(--widgies-surface-dark, #181824e6));
|
109
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
110
|
+
border-color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 30%, transparent);
|
111
|
+
}
|
112
|
+
|
113
|
+
.text-input:focus {
|
114
|
+
outline-color: var(--widgies-accent, var(--widgies-accent-dark, #a88bff));
|
115
|
+
}
|
116
|
+
|
117
|
+
.qr-display {
|
118
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)) 70%, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)));
|
119
|
+
}
|
120
|
+
|
121
|
+
.placeholder {
|
122
|
+
color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 60%, transparent);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
`}};function c(){customElements.get("widgies-qr-code")||customElements.define("widgies-qr-code",s)}c();export{s as QRCodeWidget,c as register};
|
@@ -0,0 +1,125 @@
|
|
1
|
+
import{a as l}from"./chunk-BP7C5X5K.min.js";var d=null,s=class extends l{constructor(){super(...arguments);this.textInput=null;this.generateButton=null;this.qrDisplay=null;this.downloadButton=null}render(){this.shadow.innerHTML="";let t=this.createStyleSheet();t&&this.shadow.appendChild(t);let e=document.createElement("div");e.innerHTML=`
|
2
|
+
<div class="qr-generator" role="application" aria-label="QR code generator">
|
3
|
+
<div class="input-section">
|
4
|
+
<label for="qr-text">Text to encode:</label>
|
5
|
+
<input
|
6
|
+
type="text"
|
7
|
+
id="qr-text"
|
8
|
+
class="text-input"
|
9
|
+
placeholder="Enter text or URL"
|
10
|
+
value="${this.getAttribute("text")||""}"
|
11
|
+
maxlength="256"
|
12
|
+
aria-describedby="qr-display"
|
13
|
+
>
|
14
|
+
<button class="generate-btn" type="button">Generate QR Code</button>
|
15
|
+
</div>
|
16
|
+
<div class="qr-display" id="qr-display" aria-live="polite" aria-label="Generated QR code">
|
17
|
+
<div class="placeholder">Enter text above to generate QR code</div>
|
18
|
+
</div>
|
19
|
+
<button class="download-btn" type="button" style="display: none;" aria-label="Download QR code as PNG">
|
20
|
+
Download PNG
|
21
|
+
</button>
|
22
|
+
</div>
|
23
|
+
`,this.shadow.appendChild(e),this.textInput=this.shadow.querySelector(".text-input"),this.generateButton=this.shadow.querySelector(".generate-btn"),this.qrDisplay=this.shadow.querySelector(".qr-display"),this.downloadButton=this.shadow.querySelector(".download-btn")}attachEventListeners(){this.generateButton?.addEventListener("click",()=>{this.generateQRCode()}),this.textInput?.addEventListener("input",()=>{this.validateInput()}),this.textInput?.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.generateQRCode())}),this.downloadButton?.addEventListener("click",()=>{this.downloadQRCode()})}handleActivation(t){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.textInput?.value&&this.generateQRCode())}validateInput(){if(!this.textInput||!this.generateButton)return;let t=this.textInput.value.trim();this.generateButton.disabled=t.length===0}async generateQRCode(){if(!this.textInput||!this.qrDisplay)return;let t=this.textInput.value.trim();if(!t){this.showError("Please enter text to encode");return}try{if(!d){this.showLoading("Loading QR code generator...");try{d=(await import("./qrcode-DXXPLUCT.min.js")).default}catch{this.showError("Failed to load QR code generator. Please ensure the library is available.");return}}let e=this.createQRCode(t);this.renderQRCode(e),this.downloadButton.style.display="block",this.dispatchEvent(new CustomEvent("qr-generated",{detail:{text:t,size:e.length},bubbles:!0}))}catch{this.showError("Failed to generate QR code")}}createQRCode(t){try{let e=d(0,"L");e.addData(t),e.make();let i=e.getModuleCount(),r=[];for(let a=0;a<i;a++){r[a]=[];for(let n=0;n<i;n++)r[a][n]=e.isDark(a,n)?1:0}return r}catch(e){return console.error("QR Code generation failed:",e),[[1,1,1],[1,0,1],[1,1,1]]}}renderQRCode(t){if(!this.qrDisplay)return;let e=t.length,i=8,r=document.createElement("canvas"),a=r.getContext("2d");if(r.width=e*i,r.height=e*i,r.setAttribute("aria-label",`QR code for: ${this.textInput?.value}`),a){a.fillStyle="#ffffff",a.fillRect(0,0,r.width,r.height),a.fillStyle="#000000";for(let n=0;n<e;n++)for(let o=0;o<e;o++)t[n][o]===1&&a.fillRect(o*i,n*i,i,i)}this.qrDisplay.innerHTML="",this.qrDisplay.appendChild(r)}downloadQRCode(){let t=this.qrDisplay?.querySelector("canvas");if(t)try{let e=document.createElement("a");e.download=`qr-code-${Date.now()}.png`,e.href=t.toDataURL("image/png"),e.click()}catch{this.showError("Download failed")}}showError(t){this.qrDisplay&&(this.qrDisplay.innerHTML=`<div class="error" role="alert">${t}</div>`,this.downloadButton.style.display="none")}showLoading(t){this.qrDisplay&&(this.qrDisplay.innerHTML=`<div class="loading" role="status">${t}</div>`,this.downloadButton.style.display="none")}static get observedAttributes(){return["text"]}attributeChangedCallback(t,e,i){t==="text"&&this.textInput&&(this.textInput.value=i||"",this.validateInput())}connectedCallback(){super.connectedCallback(),this.generateButton&&(this.generateButton.disabled=!0),setTimeout(()=>this.validateInput(),0)}getStyles(){return`
|
24
|
+
${this.getBaseStyles()}
|
25
|
+
|
26
|
+
.qr-generator {
|
27
|
+
width: 300px;
|
28
|
+
text-align: center;
|
29
|
+
}
|
30
|
+
|
31
|
+
.input-section {
|
32
|
+
margin-bottom: 1rem;
|
33
|
+
}
|
34
|
+
|
35
|
+
.input-section label {
|
36
|
+
display: block;
|
37
|
+
margin-bottom: 0.5rem;
|
38
|
+
font-weight: 500;
|
39
|
+
font-size: 0.9rem;
|
40
|
+
}
|
41
|
+
|
42
|
+
.text-input {
|
43
|
+
width: 100%;
|
44
|
+
padding: 0.75rem;
|
45
|
+
margin-bottom: 1rem;
|
46
|
+
border: 1px solid color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 30%, transparent);
|
47
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
48
|
+
background: var(--widgies-surface, var(--widgies-surface-light, #ffffffe6));
|
49
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
50
|
+
font: inherit;
|
51
|
+
box-sizing: border-box;
|
52
|
+
}
|
53
|
+
|
54
|
+
.text-input:focus {
|
55
|
+
outline: 2px solid var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
56
|
+
outline-offset: 1px;
|
57
|
+
}
|
58
|
+
|
59
|
+
.generate-btn, .download-btn {
|
60
|
+
width: 100%;
|
61
|
+
padding: 0.75rem 1.5rem;
|
62
|
+
font-size: 1rem;
|
63
|
+
font-weight: 600;
|
64
|
+
margin-bottom: 0.5rem;
|
65
|
+
}
|
66
|
+
|
67
|
+
.qr-display {
|
68
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)) 70%, var(--widgies-text, var(--widgies-text-light, #1a1a1a)));
|
69
|
+
padding: 1rem;
|
70
|
+
border-radius: var(--widgies-radius, 0.5rem);
|
71
|
+
margin-bottom: 1rem;
|
72
|
+
min-height: 200px;
|
73
|
+
display: flex;
|
74
|
+
align-items: center;
|
75
|
+
justify-content: center;
|
76
|
+
}
|
77
|
+
|
78
|
+
.placeholder {
|
79
|
+
color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 60%, transparent);
|
80
|
+
font-style: italic;
|
81
|
+
}
|
82
|
+
|
83
|
+
.error {
|
84
|
+
color: #dc2626;
|
85
|
+
font-weight: 500;
|
86
|
+
}
|
87
|
+
|
88
|
+
.loading {
|
89
|
+
color: var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
90
|
+
font-weight: 500;
|
91
|
+
animation: pulse 1.5s ease-in-out infinite;
|
92
|
+
}
|
93
|
+
|
94
|
+
@keyframes pulse {
|
95
|
+
0%, 100% { opacity: 1; }
|
96
|
+
50% { opacity: 0.5; }
|
97
|
+
}
|
98
|
+
|
99
|
+
canvas {
|
100
|
+
max-width: 100%;
|
101
|
+
height: auto;
|
102
|
+
image-rendering: pixelated;
|
103
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
104
|
+
}
|
105
|
+
|
106
|
+
@media (prefers-color-scheme: dark) {
|
107
|
+
.text-input {
|
108
|
+
background: var(--widgies-surface, var(--widgies-surface-dark, #181824e6));
|
109
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
110
|
+
border-color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 30%, transparent);
|
111
|
+
}
|
112
|
+
|
113
|
+
.text-input:focus {
|
114
|
+
outline-color: var(--widgies-accent, var(--widgies-accent-dark, #a88bff));
|
115
|
+
}
|
116
|
+
|
117
|
+
.qr-display {
|
118
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)) 70%, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)));
|
119
|
+
}
|
120
|
+
|
121
|
+
.placeholder {
|
122
|
+
color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 60%, transparent);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
`}};function c(){customElements.get("widgies-qr-code")||customElements.define("widgies-qr-code",s)}c();export{s as QRCodeWidget,c as register};
|
@@ -0,0 +1,3 @@
|
|
1
|
+
var v=function(w,x){let s=w,l=j[x],e=null,t=0,u=null,p=[],y={},h=function(r,c){t=s*4+17,e=function(n){let f=new Array(n);for(let i=0;i<n;i+=1){f[i]=new Array(n);for(let g=0;g<n;g+=1)f[i][g]=null}return f}(t),a(0,0),a(t-7,0),a(0,t-7),D(),P(),I(r,c),s>=7&&E(r),u==null&&(u=Z(s,l,p)),m(u,c)},a=function(r,c){for(let n=-1;n<=7;n+=1)if(!(r+n<=-1||t<=r+n))for(let f=-1;f<=7;f+=1)c+f<=-1||t<=c+f||(0<=n&&n<=6&&(f==0||f==6)||0<=f&&f<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=f&&f<=4?e[r+n][c+f]=!0:e[r+n][c+f]=!1)},_=function(){let r=0,c=0;for(let n=0;n<8;n+=1){h(!0,n);let f=O.getLostPoint(y);(n==0||r>f)&&(r=f,c=n)}return c},P=function(){for(let r=8;r<t-8;r+=1)e[r][6]==null&&(e[r][6]=r%2==0);for(let r=8;r<t-8;r+=1)e[6][r]==null&&(e[6][r]=r%2==0)},D=function(){let r=O.getPatternPosition(s);for(let c=0;c<r.length;c+=1)for(let n=0;n<r.length;n+=1){let f=r[c],i=r[n];if(e[f][i]==null)for(let g=-2;g<=2;g+=1)for(let A=-2;A<=2;A+=1)g==-2||g==2||A==-2||A==2||g==0&&A==0?e[f+g][i+A]=!0:e[f+g][i+A]=!1}},E=function(r){let c=O.getBCHTypeNumber(s);for(let n=0;n<18;n+=1){let f=!r&&(c>>n&1)==1;e[Math.floor(n/3)][n%3+t-8-3]=f}for(let n=0;n<18;n+=1){let f=!r&&(c>>n&1)==1;e[n%3+t-8-3][Math.floor(n/3)]=f}},I=function(r,c){let n=l<<3|c,f=O.getBCHTypeInfo(n);for(let i=0;i<15;i+=1){let g=!r&&(f>>i&1)==1;i<6?e[i][8]=g:i<8?e[i+1][8]=g:e[t-15+i][8]=g}for(let i=0;i<15;i+=1){let g=!r&&(f>>i&1)==1;i<8?e[8][t-i-1]=g:i<9?e[8][15-i-1+1]=g:e[8][15-i-1]=g}e[t-8][8]=!r},m=function(r,c){let n=-1,f=t-1,i=7,g=0,A=O.getMaskFunction(c);for(let B=t-1;B>0;B-=2)for(B==6&&(B-=1);;){for(let M=0;M<2;M+=1)if(e[f][B-M]==null){let T=!1;g<r.length&&(T=(r[g]>>>i&1)==1),A(f,B-M)&&(T=!T),e[f][B-M]=T,i-=1,i==-1&&(g+=1,i=7)}if(f+=n,f<0||t<=f){f-=n,n=-n;break}}},X=function(r,c){let n=0,f=0,i=0,g=new Array(c.length),A=new Array(c.length);for(let b=0;b<c.length;b+=1){let C=c[b].dataCount,L=c[b].totalCount-C;f=Math.max(f,C),i=Math.max(i,L),g[b]=new Array(C);for(let R=0;R<g[b].length;R+=1)g[b][R]=255&r.getBuffer()[R+n];n+=C;let Q=O.getErrorCorrectPolynomial(L),F=K(g[b],Q.getLength()-1).mod(Q);A[b]=new Array(Q.getLength()-1);for(let R=0;R<A[b].length;R+=1){let S=R+F.getLength()-A[b].length;A[b][R]=S>=0?F.getAt(S):0}}let B=0;for(let b=0;b<c.length;b+=1)B+=c[b].totalCount;let M=new Array(B),T=0;for(let b=0;b<f;b+=1)for(let C=0;C<c.length;C+=1)b<g[C].length&&(M[T]=g[C][b],T+=1);for(let b=0;b<i;b+=1)for(let C=0;C<c.length;C+=1)b<A[C].length&&(M[T]=A[C][b],T+=1);return M},Z=function(r,c,n){let f=Y.getRSBlocks(r,c),i=G();for(let A=0;A<n.length;A+=1){let B=n[A];i.put(B.getMode(),4),i.put(B.getLength(),O.getLengthInBits(B.getMode(),r)),B.write(i)}let g=0;for(let A=0;A<f.length;A+=1)g+=f[A].dataCount;if(i.getLengthInBits()>g*8)throw"code length overflow. ("+i.getLengthInBits()+">"+g*8+")";for(i.getLengthInBits()+4<=g*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=g*8||(i.put(236,8),i.getLengthInBits()>=g*8));)i.put(17,8);return X(i,f)};y.addData=function(r,c){c=c||"Byte";let n=null;switch(c){case"Numeric":n=W(r);break;case"Alphanumeric":n=V(r);break;case"Byte":n=q(r);break;case"Kanji":n=z(r);break;default:throw"mode:"+c}p.push(n),u=null},y.isDark=function(r,c){if(r<0||t<=r||c<0||t<=c)throw r+","+c;return e[r][c]},y.getModuleCount=function(){return t},y.make=function(){if(s<1){let r=1;for(;r<40;r++){let c=Y.getRSBlocks(r,l),n=G();for(let i=0;i<p.length;i++){let g=p[i];n.put(g.getMode(),4),n.put(g.getLength(),O.getLengthInBits(g.getMode(),r)),g.write(n)}let f=0;for(let i=0;i<c.length;i++)f+=c[i].dataCount;if(n.getLengthInBits()<=f*8)break}s=r}h(!1,_())},y.createTableTag=function(r,c){r=r||2,c=typeof c>"u"?r*4:c;let n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+c+"px;",n+='">',n+="<tbody>";for(let f=0;f<y.getModuleCount();f+=1){n+="<tr>";for(let i=0;i<y.getModuleCount();i+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+r+"px;",n+=" height: "+r+"px;",n+=" background-color: ",n+=y.isDark(f,i)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>",n},y.createSvgTag=function(r,c,n,f){let i={};typeof arguments[0]=="object"&&(i=arguments[0],r=i.cellSize,c=i.margin,n=i.alt,f=i.title),r=r||2,c=typeof c>"u"?r*4:c,n=typeof n=="string"?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,f=typeof f=="string"?{text:f}:f||{},f.text=f.text||null,f.id=f.text?f.id||"qrcode-title":null;let g=y.getModuleCount()*r+c*2,A,B,M,T,b="",C;for(C="l"+r+",0 0,"+r+" -"+r+",0 0,-"+r+"z ",b+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',b+=i.scalable?"":' width="'+g+'px" height="'+g+'px"',b+=' viewBox="0 0 '+g+" "+g+'" ',b+=' preserveAspectRatio="xMinYMin meet"',b+=f.text||n.text?' role="img" aria-labelledby="'+U([f.id,n.id].join(" ").trim())+'"':"",b+=">",b+=f.text?'<title id="'+U(f.id)+'">'+U(f.text)+"</title>":"",b+=n.text?'<description id="'+U(n.id)+'">'+U(n.text)+"</description>":"",b+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',b+='<path d="',M=0;M<y.getModuleCount();M+=1)for(T=M*r+c,A=0;A<y.getModuleCount();A+=1)y.isDark(M,A)&&(B=A*r+c,b+="M"+B+","+T+C);return b+='" stroke="transparent" fill="black"/>',b+="</svg>",b},y.createDataURL=function(r,c){r=r||2,c=typeof c>"u"?r*4:c;let n=y.getModuleCount()*r+c*2,f=c,i=n-c;return rt(n,n,function(g,A){if(f<=g&&g<i&&f<=A&&A<i){let B=Math.floor((g-f)/r),M=Math.floor((A-f)/r);return y.isDark(M,B)?0:1}else return 1})},y.createImgTag=function(r,c,n){r=r||2,c=typeof c>"u"?r*4:c;let f=y.getModuleCount()*r+c*2,i="";return i+="<img",i+=' src="',i+=y.createDataURL(r,c),i+='"',i+=' width="',i+=f,i+='"',i+=' height="',i+=f,i+='"',n&&(i+=' alt="',i+=U(n),i+='"'),i+="/>",i};let U=function(r){let c="";for(let n=0;n<r.length;n+=1){let f=r.charAt(n);switch(f){case"<":c+="<";break;case">":c+=">";break;case"&":c+="&";break;case'"':c+=""";break;default:c+=f;break}}return c},$=function(r){r=typeof r>"u"?1*2:r;let n=y.getModuleCount()*1+r*2,f=r,i=n-r,g,A,B,M,T,b={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},C={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},L="";for(g=0;g<n;g+=2){for(B=Math.floor((g-f)/1),M=Math.floor((g+1-f)/1),A=0;A<n;A+=1)T="\u2588",f<=A&&A<i&&f<=g&&g<i&&y.isDark(B,Math.floor((A-f)/1))&&(T=" "),f<=A&&A<i&&f<=g+1&&g+1<i&&y.isDark(M,Math.floor((A-f)/1))?T+=" ":T+="\u2588",L+=r<1&&g+1>=i?C[T]:b[T];L+=`
|
2
|
+
`}return n%2&&r>0?L.substring(0,L.length-n-1)+Array(n+1).join("\u2580"):L.substring(0,L.length-1)};return y.createASCII=function(r,c){if(r=r||1,r<2)return $(c);r-=1,c=typeof c>"u"?r*2:c;let n=y.getModuleCount()*r+c*2,f=c,i=n-c,g,A,B,M,T=Array(r+1).join("\u2588\u2588"),b=Array(r+1).join(" "),C="",L="";for(g=0;g<n;g+=1){for(B=Math.floor((g-f)/r),L="",A=0;A<n;A+=1)M=1,f<=A&&A<i&&f<=g&&g<i&&y.isDark(B,Math.floor((A-f)/r))&&(M=0),L+=M?T:b;for(B=0;B<r;B+=1)C+=L+`
|
3
|
+
`}return C.substring(0,C.length-1)},y.renderTo2dContext=function(r,c){c=c||2;let n=y.getModuleCount();for(let f=0;f<n;f++)for(let i=0;i<n;i++)r.fillStyle=y.isDark(f,i)?"black":"white",r.fillRect(f*c,i*c,c,c)},y};v.stringToBytes=function(w){let x=[];for(let d=0;d<w.length;d+=1){let o=w.charCodeAt(d);x.push(o&255)}return x};v.createStringToBytes=function(w,x){let d=function(){let s=et(w),l=function(){let u=s.read();if(u==-1)throw"eof";return u},e=0,t={};for(;;){let u=s.read();if(u==-1)break;let p=l(),y=l(),h=l(),a=String.fromCharCode(u<<8|p),_=y<<8|h;t[a]=_,e+=1}if(e!=x)throw e+" != "+x;return t}(),o=63;return function(s){let l=[];for(let e=0;e<s.length;e+=1){let t=s.charCodeAt(e);if(t<128)l.push(t);else{let u=d[s.charAt(e)];typeof u=="number"?(u&255)==u?l.push(u):(l.push(u>>>8),l.push(u&255)):l.push(o)}}return l}};var k={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},j={L:1,M:0,Q:3,H:2},N={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},O=function(){let w=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],x=1335,d=7973,o=21522,s={},l=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return s.getBCHTypeInfo=function(e){let t=e<<10;for(;l(t)-l(x)>=0;)t^=x<<l(t)-l(x);return(e<<10|t)^o},s.getBCHTypeNumber=function(e){let t=e<<12;for(;l(t)-l(d)>=0;)t^=d<<l(t)-l(d);return e<<12|t},s.getPatternPosition=function(e){return w[e-1]},s.getMaskFunction=function(e){switch(e){case N.PATTERN000:return function(t,u){return(t+u)%2==0};case N.PATTERN001:return function(t,u){return t%2==0};case N.PATTERN010:return function(t,u){return u%3==0};case N.PATTERN011:return function(t,u){return(t+u)%3==0};case N.PATTERN100:return function(t,u){return(Math.floor(t/2)+Math.floor(u/3))%2==0};case N.PATTERN101:return function(t,u){return t*u%2+t*u%3==0};case N.PATTERN110:return function(t,u){return(t*u%2+t*u%3)%2==0};case N.PATTERN111:return function(t,u){return(t*u%3+(t+u)%2)%2==0};default:throw"bad maskPattern:"+e}},s.getErrorCorrectPolynomial=function(e){let t=K([1],0);for(let u=0;u<e;u+=1)t=t.multiply(K([1,H.gexp(u)],0));return t},s.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case k.MODE_NUMBER:return 10;case k.MODE_ALPHA_NUM:return 9;case k.MODE_8BIT_BYTE:return 8;case k.MODE_KANJI:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case k.MODE_NUMBER:return 12;case k.MODE_ALPHA_NUM:return 11;case k.MODE_8BIT_BYTE:return 16;case k.MODE_KANJI:return 10;default:throw"mode:"+e}else if(t<41)switch(e){case k.MODE_NUMBER:return 14;case k.MODE_ALPHA_NUM:return 13;case k.MODE_8BIT_BYTE:return 16;case k.MODE_KANJI:return 12;default:throw"mode:"+e}else throw"type:"+t},s.getLostPoint=function(e){let t=e.getModuleCount(),u=0;for(let h=0;h<t;h+=1)for(let a=0;a<t;a+=1){let _=0,P=e.isDark(h,a);for(let D=-1;D<=1;D+=1)if(!(h+D<0||t<=h+D))for(let E=-1;E<=1;E+=1)a+E<0||t<=a+E||D==0&&E==0||P==e.isDark(h+D,a+E)&&(_+=1);_>5&&(u+=3+_-5)}for(let h=0;h<t-1;h+=1)for(let a=0;a<t-1;a+=1){let _=0;e.isDark(h,a)&&(_+=1),e.isDark(h+1,a)&&(_+=1),e.isDark(h,a+1)&&(_+=1),e.isDark(h+1,a+1)&&(_+=1),(_==0||_==4)&&(u+=3)}for(let h=0;h<t;h+=1)for(let a=0;a<t-6;a+=1)e.isDark(h,a)&&!e.isDark(h,a+1)&&e.isDark(h,a+2)&&e.isDark(h,a+3)&&e.isDark(h,a+4)&&!e.isDark(h,a+5)&&e.isDark(h,a+6)&&(u+=40);for(let h=0;h<t;h+=1)for(let a=0;a<t-6;a+=1)e.isDark(a,h)&&!e.isDark(a+1,h)&&e.isDark(a+2,h)&&e.isDark(a+3,h)&&e.isDark(a+4,h)&&!e.isDark(a+5,h)&&e.isDark(a+6,h)&&(u+=40);let p=0;for(let h=0;h<t;h+=1)for(let a=0;a<t;a+=1)e.isDark(a,h)&&(p+=1);let y=Math.abs(100*p/t/t-50)/5;return u+=y*10,u},s}(),H=function(){let w=new Array(256),x=new Array(256);for(let o=0;o<8;o+=1)w[o]=1<<o;for(let o=8;o<256;o+=1)w[o]=w[o-4]^w[o-5]^w[o-6]^w[o-8];for(let o=0;o<255;o+=1)x[w[o]]=o;let d={};return d.glog=function(o){if(o<1)throw"glog("+o+")";return x[o]},d.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return w[o]},d}(),K=function(w,x){if(typeof w.length>"u")throw w.length+"/"+x;let d=function(){let s=0;for(;s<w.length&&w[s]==0;)s+=1;let l=new Array(w.length-s+x);for(let e=0;e<w.length-s;e+=1)l[e]=w[e+s];return l}(),o={};return o.getAt=function(s){return d[s]},o.getLength=function(){return d.length},o.multiply=function(s){let l=new Array(o.getLength()+s.getLength()-1);for(let e=0;e<o.getLength();e+=1)for(let t=0;t<s.getLength();t+=1)l[e+t]^=H.gexp(H.glog(o.getAt(e))+H.glog(s.getAt(t)));return K(l,0)},o.mod=function(s){if(o.getLength()-s.getLength()<0)return o;let l=H.glog(o.getAt(0))-H.glog(s.getAt(0)),e=new Array(o.getLength());for(let t=0;t<o.getLength();t+=1)e[t]=o.getAt(t);for(let t=0;t<s.getLength();t+=1)e[t]^=H.gexp(H.glog(s.getAt(t))+l);return K(e,0).mod(s)},o},Y=function(){let w=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(s,l){let e={};return e.totalCount=s,e.dataCount=l,e},d={},o=function(s,l){switch(l){case j.L:return w[(s-1)*4+0];case j.M:return w[(s-1)*4+1];case j.Q:return w[(s-1)*4+2];case j.H:return w[(s-1)*4+3];default:return}};return d.getRSBlocks=function(s,l){let e=o(s,l);if(typeof e>"u")throw"bad rs block @ typeNumber:"+s+"/errorCorrectionLevel:"+l;let t=e.length/3,u=[];for(let p=0;p<t;p+=1){let y=e[p*3+0],h=e[p*3+1],a=e[p*3+2];for(let _=0;_<y;_+=1)u.push(x(h,a))}return u},d}(),G=function(){let w=[],x=0,d={};return d.getBuffer=function(){return w},d.getAt=function(o){let s=Math.floor(o/8);return(w[s]>>>7-o%8&1)==1},d.put=function(o,s){for(let l=0;l<s;l+=1)d.putBit((o>>>s-l-1&1)==1)},d.getLengthInBits=function(){return x},d.putBit=function(o){let s=Math.floor(x/8);w.length<=s&&w.push(0),o&&(w[s]|=128>>>x%8),x+=1},d},W=function(w){let x=k.MODE_NUMBER,d=w,o={};o.getMode=function(){return x},o.getLength=function(e){return d.length},o.write=function(e){let t=d,u=0;for(;u+2<t.length;)e.put(s(t.substring(u,u+3)),10),u+=3;u<t.length&&(t.length-u==1?e.put(s(t.substring(u,u+1)),4):t.length-u==2&&e.put(s(t.substring(u,u+2)),7))};let s=function(e){let t=0;for(let u=0;u<e.length;u+=1)t=t*10+l(e.charAt(u));return t},l=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;throw"illegal char :"+e};return o},V=function(w){let x=k.MODE_ALPHA_NUM,d=w,o={};o.getMode=function(){return x},o.getLength=function(l){return d.length},o.write=function(l){let e=d,t=0;for(;t+1<e.length;)l.put(s(e.charAt(t))*45+s(e.charAt(t+1)),11),t+=2;t<e.length&&l.put(s(e.charAt(t)),6)};let s=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return o},q=function(w){let x=k.MODE_8BIT_BYTE,d=w,o=v.stringToBytes(w),s={};return s.getMode=function(){return x},s.getLength=function(l){return o.length},s.write=function(l){for(let e=0;e<o.length;e+=1)l.put(o[e],8)},s},z=function(w){let x=k.MODE_KANJI,d=w,o=v.stringToBytes;(function(e,t){let u=o(e);if(u.length!=2||(u[0]<<8|u[1])!=t)throw"sjis not supported."})("\u53CB",38726);let s=o(w),l={};return l.getMode=function(){return x},l.getLength=function(e){return~~(s.length/2)},l.write=function(e){let t=s,u=0;for(;u+1<t.length;){let p=(255&t[u])<<8|255&t[u+1];if(33088<=p&&p<=40956)p-=33088;else if(57408<=p&&p<=60351)p-=49472;else throw"illegal char at "+(u+1)+"/"+p;p=(p>>>8&255)*192+(p&255),e.put(p,13),u+=2}if(u<t.length)throw"illegal char at "+(u+1)},l},J=function(){let w=[],x={};return x.writeByte=function(d){w.push(d&255)},x.writeShort=function(d){x.writeByte(d),x.writeByte(d>>>8)},x.writeBytes=function(d,o,s){o=o||0,s=s||d.length;for(let l=0;l<s;l+=1)x.writeByte(d[l+o])},x.writeString=function(d){for(let o=0;o<d.length;o+=1)x.writeByte(d.charCodeAt(o))},x.toByteArray=function(){return w},x.toString=function(){let d="";d+="[";for(let o=0;o<w.length;o+=1)o>0&&(d+=","),d+=w[o];return d+="]",d},x},tt=function(){let w=0,x=0,d=0,o="",s={},l=function(t){o+=String.fromCharCode(e(t&63))},e=function(t){if(t<0)throw"n:"+t;if(t<26)return 65+t;if(t<52)return 97+(t-26);if(t<62)return 48+(t-52);if(t==62)return 43;if(t==63)return 47;throw"n:"+t};return s.writeByte=function(t){for(w=w<<8|t&255,x+=8,d+=1;x>=6;)l(w>>>x-6),x-=6},s.flush=function(){if(x>0&&(l(w<<6-x),w=0,x=0),d%3!=0){let t=3-d%3;for(let u=0;u<t;u+=1)o+="="}},s.toString=function(){return o},s},et=function(w){let x=w,d=0,o=0,s=0,l={};l.read=function(){for(;s<8;){if(d>=x.length){if(s==0)return-1;throw"unexpected end of file./"+s}let u=x.charAt(d);if(d+=1,u=="=")return s=0,-1;if(u.match(/^\s$/))continue;o=o<<6|e(u.charCodeAt(0)),s+=6}let t=o>>>s-8&255;return s-=8,t};let e=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(t==43)return 62;if(t==47)return 63;throw"c:"+t};return l},nt=function(w,x){let d=w,o=x,s=new Array(w*x),l={};l.setPixel=function(p,y,h){s[y*d+p]=h},l.write=function(p){p.writeString("GIF87a"),p.writeShort(d),p.writeShort(o),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(d),p.writeShort(o),p.writeByte(0);let y=2,h=t(y);p.writeByte(y);let a=0;for(;h.length-a>255;)p.writeByte(255),p.writeBytes(h,a,255),a+=255;p.writeByte(h.length-a),p.writeBytes(h,a,h.length-a),p.writeByte(0),p.writeString(";")};let e=function(p){let y=p,h=0,a=0,_={};return _.write=function(P,D){if(P>>>D)throw"length over";for(;h+D>=8;)y.writeByte(255&(P<<h|a)),D-=8-h,P>>>=8-h,a=0,h=0;a=P<<h|a,h=h+D},_.flush=function(){h>0&&y.writeByte(a)},_},t=function(p){let y=1<<p,h=(1<<p)+1,a=p+1,_=u();for(let m=0;m<y;m+=1)_.add(String.fromCharCode(m));_.add(String.fromCharCode(y)),_.add(String.fromCharCode(h));let P=J(),D=e(P);D.write(y,a);let E=0,I=String.fromCharCode(s[E]);for(E+=1;E<s.length;){let m=String.fromCharCode(s[E]);E+=1,_.contains(I+m)?I=I+m:(D.write(_.indexOf(I),a),_.size()<4095&&(_.size()==1<<a&&(a+=1),_.add(I+m)),I=m)}return D.write(_.indexOf(I),a),D.write(h,a),D.flush(),P.toByteArray()},u=function(){let p={},y=0,h={};return h.add=function(a){if(h.contains(a))throw"dup key:"+a;p[a]=y,y+=1},h.size=function(){return y},h.indexOf=function(a){return p[a]},h.contains=function(a){return typeof p[a]<"u"},h};return l},rt=function(w,x,d){let o=nt(w,x);for(let t=0;t<x;t+=1)for(let u=0;u<w;u+=1)o.setPixel(u,t,d(u,t));let s=J();o.write(s);let l=tt(),e=s.toByteArray();for(let t=0;t<e.length;t+=1)l.writeByte(e[t]);return l.flush(),"data:image/gif;base64,"+l},it=v,st=v.stringToBytes;export{it as default,v as qrcode,st as stringToBytes};
|
@@ -0,0 +1,3 @@
|
|
1
|
+
var v=function(w,x){let s=w,l=j[x],e=null,t=0,u=null,p=[],y={},h=function(r,c){t=s*4+17,e=function(n){let f=new Array(n);for(let i=0;i<n;i+=1){f[i]=new Array(n);for(let g=0;g<n;g+=1)f[i][g]=null}return f}(t),a(0,0),a(t-7,0),a(0,t-7),D(),P(),I(r,c),s>=7&&E(r),u==null&&(u=Z(s,l,p)),m(u,c)},a=function(r,c){for(let n=-1;n<=7;n+=1)if(!(r+n<=-1||t<=r+n))for(let f=-1;f<=7;f+=1)c+f<=-1||t<=c+f||(0<=n&&n<=6&&(f==0||f==6)||0<=f&&f<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=f&&f<=4?e[r+n][c+f]=!0:e[r+n][c+f]=!1)},_=function(){let r=0,c=0;for(let n=0;n<8;n+=1){h(!0,n);let f=O.getLostPoint(y);(n==0||r>f)&&(r=f,c=n)}return c},P=function(){for(let r=8;r<t-8;r+=1)e[r][6]==null&&(e[r][6]=r%2==0);for(let r=8;r<t-8;r+=1)e[6][r]==null&&(e[6][r]=r%2==0)},D=function(){let r=O.getPatternPosition(s);for(let c=0;c<r.length;c+=1)for(let n=0;n<r.length;n+=1){let f=r[c],i=r[n];if(e[f][i]==null)for(let g=-2;g<=2;g+=1)for(let A=-2;A<=2;A+=1)g==-2||g==2||A==-2||A==2||g==0&&A==0?e[f+g][i+A]=!0:e[f+g][i+A]=!1}},E=function(r){let c=O.getBCHTypeNumber(s);for(let n=0;n<18;n+=1){let f=!r&&(c>>n&1)==1;e[Math.floor(n/3)][n%3+t-8-3]=f}for(let n=0;n<18;n+=1){let f=!r&&(c>>n&1)==1;e[n%3+t-8-3][Math.floor(n/3)]=f}},I=function(r,c){let n=l<<3|c,f=O.getBCHTypeInfo(n);for(let i=0;i<15;i+=1){let g=!r&&(f>>i&1)==1;i<6?e[i][8]=g:i<8?e[i+1][8]=g:e[t-15+i][8]=g}for(let i=0;i<15;i+=1){let g=!r&&(f>>i&1)==1;i<8?e[8][t-i-1]=g:i<9?e[8][15-i-1+1]=g:e[8][15-i-1]=g}e[t-8][8]=!r},m=function(r,c){let n=-1,f=t-1,i=7,g=0,A=O.getMaskFunction(c);for(let B=t-1;B>0;B-=2)for(B==6&&(B-=1);;){for(let M=0;M<2;M+=1)if(e[f][B-M]==null){let T=!1;g<r.length&&(T=(r[g]>>>i&1)==1),A(f,B-M)&&(T=!T),e[f][B-M]=T,i-=1,i==-1&&(g+=1,i=7)}if(f+=n,f<0||t<=f){f-=n,n=-n;break}}},X=function(r,c){let n=0,f=0,i=0,g=new Array(c.length),A=new Array(c.length);for(let b=0;b<c.length;b+=1){let C=c[b].dataCount,L=c[b].totalCount-C;f=Math.max(f,C),i=Math.max(i,L),g[b]=new Array(C);for(let R=0;R<g[b].length;R+=1)g[b][R]=255&r.getBuffer()[R+n];n+=C;let Q=O.getErrorCorrectPolynomial(L),F=K(g[b],Q.getLength()-1).mod(Q);A[b]=new Array(Q.getLength()-1);for(let R=0;R<A[b].length;R+=1){let S=R+F.getLength()-A[b].length;A[b][R]=S>=0?F.getAt(S):0}}let B=0;for(let b=0;b<c.length;b+=1)B+=c[b].totalCount;let M=new Array(B),T=0;for(let b=0;b<f;b+=1)for(let C=0;C<c.length;C+=1)b<g[C].length&&(M[T]=g[C][b],T+=1);for(let b=0;b<i;b+=1)for(let C=0;C<c.length;C+=1)b<A[C].length&&(M[T]=A[C][b],T+=1);return M},Z=function(r,c,n){let f=Y.getRSBlocks(r,c),i=G();for(let A=0;A<n.length;A+=1){let B=n[A];i.put(B.getMode(),4),i.put(B.getLength(),O.getLengthInBits(B.getMode(),r)),B.write(i)}let g=0;for(let A=0;A<f.length;A+=1)g+=f[A].dataCount;if(i.getLengthInBits()>g*8)throw"code length overflow. ("+i.getLengthInBits()+">"+g*8+")";for(i.getLengthInBits()+4<=g*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=g*8||(i.put(236,8),i.getLengthInBits()>=g*8));)i.put(17,8);return X(i,f)};y.addData=function(r,c){c=c||"Byte";let n=null;switch(c){case"Numeric":n=W(r);break;case"Alphanumeric":n=V(r);break;case"Byte":n=q(r);break;case"Kanji":n=z(r);break;default:throw"mode:"+c}p.push(n),u=null},y.isDark=function(r,c){if(r<0||t<=r||c<0||t<=c)throw r+","+c;return e[r][c]},y.getModuleCount=function(){return t},y.make=function(){if(s<1){let r=1;for(;r<40;r++){let c=Y.getRSBlocks(r,l),n=G();for(let i=0;i<p.length;i++){let g=p[i];n.put(g.getMode(),4),n.put(g.getLength(),O.getLengthInBits(g.getMode(),r)),g.write(n)}let f=0;for(let i=0;i<c.length;i++)f+=c[i].dataCount;if(n.getLengthInBits()<=f*8)break}s=r}h(!1,_())},y.createTableTag=function(r,c){r=r||2,c=typeof c>"u"?r*4:c;let n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+c+"px;",n+='">',n+="<tbody>";for(let f=0;f<y.getModuleCount();f+=1){n+="<tr>";for(let i=0;i<y.getModuleCount();i+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+r+"px;",n+=" height: "+r+"px;",n+=" background-color: ",n+=y.isDark(f,i)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>",n},y.createSvgTag=function(r,c,n,f){let i={};typeof arguments[0]=="object"&&(i=arguments[0],r=i.cellSize,c=i.margin,n=i.alt,f=i.title),r=r||2,c=typeof c>"u"?r*4:c,n=typeof n=="string"?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,f=typeof f=="string"?{text:f}:f||{},f.text=f.text||null,f.id=f.text?f.id||"qrcode-title":null;let g=y.getModuleCount()*r+c*2,A,B,M,T,b="",C;for(C="l"+r+",0 0,"+r+" -"+r+",0 0,-"+r+"z ",b+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',b+=i.scalable?"":' width="'+g+'px" height="'+g+'px"',b+=' viewBox="0 0 '+g+" "+g+'" ',b+=' preserveAspectRatio="xMinYMin meet"',b+=f.text||n.text?' role="img" aria-labelledby="'+U([f.id,n.id].join(" ").trim())+'"':"",b+=">",b+=f.text?'<title id="'+U(f.id)+'">'+U(f.text)+"</title>":"",b+=n.text?'<description id="'+U(n.id)+'">'+U(n.text)+"</description>":"",b+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',b+='<path d="',M=0;M<y.getModuleCount();M+=1)for(T=M*r+c,A=0;A<y.getModuleCount();A+=1)y.isDark(M,A)&&(B=A*r+c,b+="M"+B+","+T+C);return b+='" stroke="transparent" fill="black"/>',b+="</svg>",b},y.createDataURL=function(r,c){r=r||2,c=typeof c>"u"?r*4:c;let n=y.getModuleCount()*r+c*2,f=c,i=n-c;return rt(n,n,function(g,A){if(f<=g&&g<i&&f<=A&&A<i){let B=Math.floor((g-f)/r),M=Math.floor((A-f)/r);return y.isDark(M,B)?0:1}else return 1})},y.createImgTag=function(r,c,n){r=r||2,c=typeof c>"u"?r*4:c;let f=y.getModuleCount()*r+c*2,i="";return i+="<img",i+=' src="',i+=y.createDataURL(r,c),i+='"',i+=' width="',i+=f,i+='"',i+=' height="',i+=f,i+='"',n&&(i+=' alt="',i+=U(n),i+='"'),i+="/>",i};let U=function(r){let c="";for(let n=0;n<r.length;n+=1){let f=r.charAt(n);switch(f){case"<":c+="<";break;case">":c+=">";break;case"&":c+="&";break;case'"':c+=""";break;default:c+=f;break}}return c},$=function(r){r=typeof r>"u"?1*2:r;let n=y.getModuleCount()*1+r*2,f=r,i=n-r,g,A,B,M,T,b={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},C={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},L="";for(g=0;g<n;g+=2){for(B=Math.floor((g-f)/1),M=Math.floor((g+1-f)/1),A=0;A<n;A+=1)T="\u2588",f<=A&&A<i&&f<=g&&g<i&&y.isDark(B,Math.floor((A-f)/1))&&(T=" "),f<=A&&A<i&&f<=g+1&&g+1<i&&y.isDark(M,Math.floor((A-f)/1))?T+=" ":T+="\u2588",L+=r<1&&g+1>=i?C[T]:b[T];L+=`
|
2
|
+
`}return n%2&&r>0?L.substring(0,L.length-n-1)+Array(n+1).join("\u2580"):L.substring(0,L.length-1)};return y.createASCII=function(r,c){if(r=r||1,r<2)return $(c);r-=1,c=typeof c>"u"?r*2:c;let n=y.getModuleCount()*r+c*2,f=c,i=n-c,g,A,B,M,T=Array(r+1).join("\u2588\u2588"),b=Array(r+1).join(" "),C="",L="";for(g=0;g<n;g+=1){for(B=Math.floor((g-f)/r),L="",A=0;A<n;A+=1)M=1,f<=A&&A<i&&f<=g&&g<i&&y.isDark(B,Math.floor((A-f)/r))&&(M=0),L+=M?T:b;for(B=0;B<r;B+=1)C+=L+`
|
3
|
+
`}return C.substring(0,C.length-1)},y.renderTo2dContext=function(r,c){c=c||2;let n=y.getModuleCount();for(let f=0;f<n;f++)for(let i=0;i<n;i++)r.fillStyle=y.isDark(f,i)?"black":"white",r.fillRect(f*c,i*c,c,c)},y};v.stringToBytes=function(w){let x=[];for(let d=0;d<w.length;d+=1){let o=w.charCodeAt(d);x.push(o&255)}return x};v.createStringToBytes=function(w,x){let d=function(){let s=et(w),l=function(){let u=s.read();if(u==-1)throw"eof";return u},e=0,t={};for(;;){let u=s.read();if(u==-1)break;let p=l(),y=l(),h=l(),a=String.fromCharCode(u<<8|p),_=y<<8|h;t[a]=_,e+=1}if(e!=x)throw e+" != "+x;return t}(),o=63;return function(s){let l=[];for(let e=0;e<s.length;e+=1){let t=s.charCodeAt(e);if(t<128)l.push(t);else{let u=d[s.charAt(e)];typeof u=="number"?(u&255)==u?l.push(u):(l.push(u>>>8),l.push(u&255)):l.push(o)}}return l}};var k={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},j={L:1,M:0,Q:3,H:2},N={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},O=function(){let w=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],x=1335,d=7973,o=21522,s={},l=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return s.getBCHTypeInfo=function(e){let t=e<<10;for(;l(t)-l(x)>=0;)t^=x<<l(t)-l(x);return(e<<10|t)^o},s.getBCHTypeNumber=function(e){let t=e<<12;for(;l(t)-l(d)>=0;)t^=d<<l(t)-l(d);return e<<12|t},s.getPatternPosition=function(e){return w[e-1]},s.getMaskFunction=function(e){switch(e){case N.PATTERN000:return function(t,u){return(t+u)%2==0};case N.PATTERN001:return function(t,u){return t%2==0};case N.PATTERN010:return function(t,u){return u%3==0};case N.PATTERN011:return function(t,u){return(t+u)%3==0};case N.PATTERN100:return function(t,u){return(Math.floor(t/2)+Math.floor(u/3))%2==0};case N.PATTERN101:return function(t,u){return t*u%2+t*u%3==0};case N.PATTERN110:return function(t,u){return(t*u%2+t*u%3)%2==0};case N.PATTERN111:return function(t,u){return(t*u%3+(t+u)%2)%2==0};default:throw"bad maskPattern:"+e}},s.getErrorCorrectPolynomial=function(e){let t=K([1],0);for(let u=0;u<e;u+=1)t=t.multiply(K([1,H.gexp(u)],0));return t},s.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case k.MODE_NUMBER:return 10;case k.MODE_ALPHA_NUM:return 9;case k.MODE_8BIT_BYTE:return 8;case k.MODE_KANJI:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case k.MODE_NUMBER:return 12;case k.MODE_ALPHA_NUM:return 11;case k.MODE_8BIT_BYTE:return 16;case k.MODE_KANJI:return 10;default:throw"mode:"+e}else if(t<41)switch(e){case k.MODE_NUMBER:return 14;case k.MODE_ALPHA_NUM:return 13;case k.MODE_8BIT_BYTE:return 16;case k.MODE_KANJI:return 12;default:throw"mode:"+e}else throw"type:"+t},s.getLostPoint=function(e){let t=e.getModuleCount(),u=0;for(let h=0;h<t;h+=1)for(let a=0;a<t;a+=1){let _=0,P=e.isDark(h,a);for(let D=-1;D<=1;D+=1)if(!(h+D<0||t<=h+D))for(let E=-1;E<=1;E+=1)a+E<0||t<=a+E||D==0&&E==0||P==e.isDark(h+D,a+E)&&(_+=1);_>5&&(u+=3+_-5)}for(let h=0;h<t-1;h+=1)for(let a=0;a<t-1;a+=1){let _=0;e.isDark(h,a)&&(_+=1),e.isDark(h+1,a)&&(_+=1),e.isDark(h,a+1)&&(_+=1),e.isDark(h+1,a+1)&&(_+=1),(_==0||_==4)&&(u+=3)}for(let h=0;h<t;h+=1)for(let a=0;a<t-6;a+=1)e.isDark(h,a)&&!e.isDark(h,a+1)&&e.isDark(h,a+2)&&e.isDark(h,a+3)&&e.isDark(h,a+4)&&!e.isDark(h,a+5)&&e.isDark(h,a+6)&&(u+=40);for(let h=0;h<t;h+=1)for(let a=0;a<t-6;a+=1)e.isDark(a,h)&&!e.isDark(a+1,h)&&e.isDark(a+2,h)&&e.isDark(a+3,h)&&e.isDark(a+4,h)&&!e.isDark(a+5,h)&&e.isDark(a+6,h)&&(u+=40);let p=0;for(let h=0;h<t;h+=1)for(let a=0;a<t;a+=1)e.isDark(a,h)&&(p+=1);let y=Math.abs(100*p/t/t-50)/5;return u+=y*10,u},s}(),H=function(){let w=new Array(256),x=new Array(256);for(let o=0;o<8;o+=1)w[o]=1<<o;for(let o=8;o<256;o+=1)w[o]=w[o-4]^w[o-5]^w[o-6]^w[o-8];for(let o=0;o<255;o+=1)x[w[o]]=o;let d={};return d.glog=function(o){if(o<1)throw"glog("+o+")";return x[o]},d.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return w[o]},d}(),K=function(w,x){if(typeof w.length>"u")throw w.length+"/"+x;let d=function(){let s=0;for(;s<w.length&&w[s]==0;)s+=1;let l=new Array(w.length-s+x);for(let e=0;e<w.length-s;e+=1)l[e]=w[e+s];return l}(),o={};return o.getAt=function(s){return d[s]},o.getLength=function(){return d.length},o.multiply=function(s){let l=new Array(o.getLength()+s.getLength()-1);for(let e=0;e<o.getLength();e+=1)for(let t=0;t<s.getLength();t+=1)l[e+t]^=H.gexp(H.glog(o.getAt(e))+H.glog(s.getAt(t)));return K(l,0)},o.mod=function(s){if(o.getLength()-s.getLength()<0)return o;let l=H.glog(o.getAt(0))-H.glog(s.getAt(0)),e=new Array(o.getLength());for(let t=0;t<o.getLength();t+=1)e[t]=o.getAt(t);for(let t=0;t<s.getLength();t+=1)e[t]^=H.gexp(H.glog(s.getAt(t))+l);return K(e,0).mod(s)},o},Y=function(){let w=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(s,l){let e={};return e.totalCount=s,e.dataCount=l,e},d={},o=function(s,l){switch(l){case j.L:return w[(s-1)*4+0];case j.M:return w[(s-1)*4+1];case j.Q:return w[(s-1)*4+2];case j.H:return w[(s-1)*4+3];default:return}};return d.getRSBlocks=function(s,l){let e=o(s,l);if(typeof e>"u")throw"bad rs block @ typeNumber:"+s+"/errorCorrectionLevel:"+l;let t=e.length/3,u=[];for(let p=0;p<t;p+=1){let y=e[p*3+0],h=e[p*3+1],a=e[p*3+2];for(let _=0;_<y;_+=1)u.push(x(h,a))}return u},d}(),G=function(){let w=[],x=0,d={};return d.getBuffer=function(){return w},d.getAt=function(o){let s=Math.floor(o/8);return(w[s]>>>7-o%8&1)==1},d.put=function(o,s){for(let l=0;l<s;l+=1)d.putBit((o>>>s-l-1&1)==1)},d.getLengthInBits=function(){return x},d.putBit=function(o){let s=Math.floor(x/8);w.length<=s&&w.push(0),o&&(w[s]|=128>>>x%8),x+=1},d},W=function(w){let x=k.MODE_NUMBER,d=w,o={};o.getMode=function(){return x},o.getLength=function(e){return d.length},o.write=function(e){let t=d,u=0;for(;u+2<t.length;)e.put(s(t.substring(u,u+3)),10),u+=3;u<t.length&&(t.length-u==1?e.put(s(t.substring(u,u+1)),4):t.length-u==2&&e.put(s(t.substring(u,u+2)),7))};let s=function(e){let t=0;for(let u=0;u<e.length;u+=1)t=t*10+l(e.charAt(u));return t},l=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;throw"illegal char :"+e};return o},V=function(w){let x=k.MODE_ALPHA_NUM,d=w,o={};o.getMode=function(){return x},o.getLength=function(l){return d.length},o.write=function(l){let e=d,t=0;for(;t+1<e.length;)l.put(s(e.charAt(t))*45+s(e.charAt(t+1)),11),t+=2;t<e.length&&l.put(s(e.charAt(t)),6)};let s=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;if("A"<=l&&l<="Z")return l.charCodeAt(0)-65+10;switch(l){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+l}};return o},q=function(w){let x=k.MODE_8BIT_BYTE,d=w,o=v.stringToBytes(w),s={};return s.getMode=function(){return x},s.getLength=function(l){return o.length},s.write=function(l){for(let e=0;e<o.length;e+=1)l.put(o[e],8)},s},z=function(w){let x=k.MODE_KANJI,d=w,o=v.stringToBytes;(function(e,t){let u=o(e);if(u.length!=2||(u[0]<<8|u[1])!=t)throw"sjis not supported."})("\u53CB",38726);let s=o(w),l={};return l.getMode=function(){return x},l.getLength=function(e){return~~(s.length/2)},l.write=function(e){let t=s,u=0;for(;u+1<t.length;){let p=(255&t[u])<<8|255&t[u+1];if(33088<=p&&p<=40956)p-=33088;else if(57408<=p&&p<=60351)p-=49472;else throw"illegal char at "+(u+1)+"/"+p;p=(p>>>8&255)*192+(p&255),e.put(p,13),u+=2}if(u<t.length)throw"illegal char at "+(u+1)},l},J=function(){let w=[],x={};return x.writeByte=function(d){w.push(d&255)},x.writeShort=function(d){x.writeByte(d),x.writeByte(d>>>8)},x.writeBytes=function(d,o,s){o=o||0,s=s||d.length;for(let l=0;l<s;l+=1)x.writeByte(d[l+o])},x.writeString=function(d){for(let o=0;o<d.length;o+=1)x.writeByte(d.charCodeAt(o))},x.toByteArray=function(){return w},x.toString=function(){let d="";d+="[";for(let o=0;o<w.length;o+=1)o>0&&(d+=","),d+=w[o];return d+="]",d},x},tt=function(){let w=0,x=0,d=0,o="",s={},l=function(t){o+=String.fromCharCode(e(t&63))},e=function(t){if(t<0)throw"n:"+t;if(t<26)return 65+t;if(t<52)return 97+(t-26);if(t<62)return 48+(t-52);if(t==62)return 43;if(t==63)return 47;throw"n:"+t};return s.writeByte=function(t){for(w=w<<8|t&255,x+=8,d+=1;x>=6;)l(w>>>x-6),x-=6},s.flush=function(){if(x>0&&(l(w<<6-x),w=0,x=0),d%3!=0){let t=3-d%3;for(let u=0;u<t;u+=1)o+="="}},s.toString=function(){return o},s},et=function(w){let x=w,d=0,o=0,s=0,l={};l.read=function(){for(;s<8;){if(d>=x.length){if(s==0)return-1;throw"unexpected end of file./"+s}let u=x.charAt(d);if(d+=1,u=="=")return s=0,-1;if(u.match(/^\s$/))continue;o=o<<6|e(u.charCodeAt(0)),s+=6}let t=o>>>s-8&255;return s-=8,t};let e=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(t==43)return 62;if(t==47)return 63;throw"c:"+t};return l},nt=function(w,x){let d=w,o=x,s=new Array(w*x),l={};l.setPixel=function(p,y,h){s[y*d+p]=h},l.write=function(p){p.writeString("GIF87a"),p.writeShort(d),p.writeShort(o),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(","),p.writeShort(0),p.writeShort(0),p.writeShort(d),p.writeShort(o),p.writeByte(0);let y=2,h=t(y);p.writeByte(y);let a=0;for(;h.length-a>255;)p.writeByte(255),p.writeBytes(h,a,255),a+=255;p.writeByte(h.length-a),p.writeBytes(h,a,h.length-a),p.writeByte(0),p.writeString(";")};let e=function(p){let y=p,h=0,a=0,_={};return _.write=function(P,D){if(P>>>D)throw"length over";for(;h+D>=8;)y.writeByte(255&(P<<h|a)),D-=8-h,P>>>=8-h,a=0,h=0;a=P<<h|a,h=h+D},_.flush=function(){h>0&&y.writeByte(a)},_},t=function(p){let y=1<<p,h=(1<<p)+1,a=p+1,_=u();for(let m=0;m<y;m+=1)_.add(String.fromCharCode(m));_.add(String.fromCharCode(y)),_.add(String.fromCharCode(h));let P=J(),D=e(P);D.write(y,a);let E=0,I=String.fromCharCode(s[E]);for(E+=1;E<s.length;){let m=String.fromCharCode(s[E]);E+=1,_.contains(I+m)?I=I+m:(D.write(_.indexOf(I),a),_.size()<4095&&(_.size()==1<<a&&(a+=1),_.add(I+m)),I=m)}return D.write(_.indexOf(I),a),D.write(h,a),D.flush(),P.toByteArray()},u=function(){let p={},y=0,h={};return h.add=function(a){if(h.contains(a))throw"dup key:"+a;p[a]=y,y+=1},h.size=function(){return y},h.indexOf=function(a){return p[a]},h.contains=function(a){return typeof p[a]<"u"},h};return l},rt=function(w,x,d){let o=nt(w,x);for(let t=0;t<x;t+=1)for(let u=0;u<w;u+=1)o.setPixel(u,t,d(u,t));let s=J();o.write(s);let l=tt(),e=s.toByteArray();for(let t=0;t<e.length;t+=1)l.writeByte(e[t]);return l.flush(),"data:image/gif;base64,"+l},it=v,st=v.stringToBytes;export{it as default,v as qrcode,st as stringToBytes};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { RandomNumberWidget, register } from './widgets/random-number.js';
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import{a as u}from"./chunk-3F3FJ7VN.js";var n=class extends u{constructor(){super(...arguments);this.display=null;this.generateButton=null;this.minInput=null;this.maxInput=null}render(){this.shadow.innerHTML="";let e=this.createStyleSheet();e&&this.shadow.appendChild(e);let t=document.createElement("div");t.innerHTML=`
|
2
|
+
<div class="random-number" role="application" aria-label="Random number generator">
|
3
|
+
<div class="controls">
|
4
|
+
<div class="range-inputs">
|
5
|
+
<label>
|
6
|
+
Min:
|
7
|
+
<input type="number" class="min-input" value="${this.getAttribute("min")||"1"}" aria-label="Minimum value">
|
8
|
+
</label>
|
9
|
+
<label>
|
10
|
+
Max:
|
11
|
+
<input type="number" class="max-input" value="${this.getAttribute("max")||"100"}" aria-label="Maximum value">
|
12
|
+
</label>
|
13
|
+
</div>
|
14
|
+
<button class="generate-btn" aria-describedby="random-display">Generate</button>
|
15
|
+
</div>
|
16
|
+
<div class="display" id="random-display" aria-live="polite" aria-label="Generated random number">
|
17
|
+
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
`,this.shadow.appendChild(t),this.display=this.shadow.querySelector(".display"),this.generateButton=this.shadow.querySelector(".generate-btn"),this.minInput=this.shadow.querySelector(".min-input"),this.maxInput=this.shadow.querySelector(".max-input")}attachEventListeners(){this.generateButton?.addEventListener("click",()=>{this.generateRandomNumber()}),this.minInput?.addEventListener("input",()=>{this.validateInputs()}),this.maxInput?.addEventListener("input",()=>{this.validateInputs()}),this.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.generateRandomNumber())})}validateInputs(){if(!this.minInput||!this.maxInput||!this.generateButton)return;let e=parseInt(this.minInput.value),t=parseInt(this.maxInput.value),i=!isNaN(e)&&!isNaN(t)&&e<=t;this.generateButton.disabled=!i,!i&&e>t?(this.minInput.setAttribute("aria-invalid","true"),this.maxInput.setAttribute("aria-invalid","true")):(this.minInput.removeAttribute("aria-invalid"),this.maxInput.removeAttribute("aria-invalid"))}generateRandomNumber(){if(!this.minInput||!this.maxInput||!this.display)return;let e=parseInt(this.minInput.value),t=parseInt(this.maxInput.value);if(isNaN(e)||isNaN(t)||e>t){this.display.textContent="Invalid range";return}let i=this.cryptoRandomInt(e,t+1);this.display.textContent=i.toString(),this.dispatchEvent(new CustomEvent("random-generated",{detail:{value:i,min:e,max:t},bubbles:!0}))}cryptoRandomInt(e,t){if(typeof crypto<"u"&&crypto.getRandomValues){let i=t-e,r=Math.ceil(Math.log2(i)/8),d=Math.pow(256,r),l=new Uint8Array(r),a;do{crypto.getRandomValues(l),a=0;for(let s=0;s<r;s++)a=(a<<8)+l[s]}while(a>=d-d%i);return e+a%i}else return Math.floor(Math.random()*(t-e))+e}static get observedAttributes(){return["min","max"]}attributeChangedCallback(e,t,i){e==="min"&&this.minInput&&(this.minInput.value=i||"1",this.validateInputs()),e==="max"&&this.maxInput&&(this.maxInput.value=i||"100",this.validateInputs())}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.validateInputs(),0)}getStyles(){return`
|
21
|
+
${this.getBaseStyles()}
|
22
|
+
|
23
|
+
.random-number {
|
24
|
+
width: 280px;
|
25
|
+
text-align: center;
|
26
|
+
}
|
27
|
+
|
28
|
+
.controls {
|
29
|
+
margin-bottom: 1rem;
|
30
|
+
}
|
31
|
+
|
32
|
+
.range-inputs {
|
33
|
+
display: flex;
|
34
|
+
gap: 1rem;
|
35
|
+
margin-bottom: 1rem;
|
36
|
+
justify-content: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.range-inputs label {
|
40
|
+
display: flex;
|
41
|
+
flex-direction: column;
|
42
|
+
align-items: center;
|
43
|
+
font-size: 0.9rem;
|
44
|
+
font-weight: 500;
|
45
|
+
}
|
46
|
+
|
47
|
+
.range-inputs input {
|
48
|
+
width: 80px;
|
49
|
+
padding: 0.5rem;
|
50
|
+
margin-top: 0.25rem;
|
51
|
+
border: 1px solid color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 30%, transparent);
|
52
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
53
|
+
background: var(--widgies-surface, var(--widgies-surface-light, #ffffffe6));
|
54
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
55
|
+
font: inherit;
|
56
|
+
text-align: center;
|
57
|
+
}
|
58
|
+
|
59
|
+
.range-inputs input:focus {
|
60
|
+
outline: 2px solid var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
61
|
+
outline-offset: 1px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.range-inputs input[aria-invalid="true"] {
|
65
|
+
border-color: #dc2626;
|
66
|
+
background: color-mix(in srgb, #dc2626 10%, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)));
|
67
|
+
}
|
68
|
+
|
69
|
+
.generate-btn {
|
70
|
+
width: 100%;
|
71
|
+
padding: 0.75rem 1.5rem;
|
72
|
+
font-size: 1rem;
|
73
|
+
font-weight: 600;
|
74
|
+
}
|
75
|
+
|
76
|
+
.display {
|
77
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)) 70%, var(--widgies-text, var(--widgies-text-light, #1a1a1a)));
|
78
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
79
|
+
padding: 1.5rem;
|
80
|
+
border-radius: var(--widgies-radius, 0.5rem);
|
81
|
+
font-size: 2rem;
|
82
|
+
font-weight: bold;
|
83
|
+
min-height: 2rem;
|
84
|
+
display: flex;
|
85
|
+
align-items: center;
|
86
|
+
justify-content: center;
|
87
|
+
}
|
88
|
+
|
89
|
+
@media (prefers-color-scheme: dark) {
|
90
|
+
.range-inputs input {
|
91
|
+
background: var(--widgies-surface, var(--widgies-surface-dark, #181824e6));
|
92
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
93
|
+
border-color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 30%, transparent);
|
94
|
+
}
|
95
|
+
|
96
|
+
.range-inputs input:focus {
|
97
|
+
outline-color: var(--widgies-accent, var(--widgies-accent-dark, #a88bff));
|
98
|
+
}
|
99
|
+
|
100
|
+
.range-inputs input[aria-invalid="true"] {
|
101
|
+
background: color-mix(in srgb, #dc2626 10%, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)));
|
102
|
+
}
|
103
|
+
|
104
|
+
.display {
|
105
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)) 70%, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)));
|
106
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
107
|
+
}
|
108
|
+
}
|
109
|
+
`}};function o(){customElements.get("widgies-random-number")||customElements.define("widgies-random-number",n)}o();export{n as RandomNumberWidget,o as register};
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import{a as u}from"./chunk-BP7C5X5K.min.js";var n=class extends u{constructor(){super(...arguments);this.display=null;this.generateButton=null;this.minInput=null;this.maxInput=null}render(){this.shadow.innerHTML="";let e=this.createStyleSheet();e&&this.shadow.appendChild(e);let t=document.createElement("div");t.innerHTML=`
|
2
|
+
<div class="random-number" role="application" aria-label="Random number generator">
|
3
|
+
<div class="controls">
|
4
|
+
<div class="range-inputs">
|
5
|
+
<label>
|
6
|
+
Min:
|
7
|
+
<input type="number" class="min-input" value="${this.getAttribute("min")||"1"}" aria-label="Minimum value">
|
8
|
+
</label>
|
9
|
+
<label>
|
10
|
+
Max:
|
11
|
+
<input type="number" class="max-input" value="${this.getAttribute("max")||"100"}" aria-label="Maximum value">
|
12
|
+
</label>
|
13
|
+
</div>
|
14
|
+
<button class="generate-btn" aria-describedby="random-display">Generate</button>
|
15
|
+
</div>
|
16
|
+
<div class="display" id="random-display" aria-live="polite" aria-label="Generated random number">
|
17
|
+
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
`,this.shadow.appendChild(t),this.display=this.shadow.querySelector(".display"),this.generateButton=this.shadow.querySelector(".generate-btn"),this.minInput=this.shadow.querySelector(".min-input"),this.maxInput=this.shadow.querySelector(".max-input")}attachEventListeners(){this.generateButton?.addEventListener("click",()=>{this.generateRandomNumber()}),this.minInput?.addEventListener("input",()=>{this.validateInputs()}),this.maxInput?.addEventListener("input",()=>{this.validateInputs()}),this.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.generateRandomNumber())})}validateInputs(){if(!this.minInput||!this.maxInput||!this.generateButton)return;let e=parseInt(this.minInput.value),t=parseInt(this.maxInput.value),i=!isNaN(e)&&!isNaN(t)&&e<=t;this.generateButton.disabled=!i,!i&&e>t?(this.minInput.setAttribute("aria-invalid","true"),this.maxInput.setAttribute("aria-invalid","true")):(this.minInput.removeAttribute("aria-invalid"),this.maxInput.removeAttribute("aria-invalid"))}generateRandomNumber(){if(!this.minInput||!this.maxInput||!this.display)return;let e=parseInt(this.minInput.value),t=parseInt(this.maxInput.value);if(isNaN(e)||isNaN(t)||e>t){this.display.textContent="Invalid range";return}let i=this.cryptoRandomInt(e,t+1);this.display.textContent=i.toString(),this.dispatchEvent(new CustomEvent("random-generated",{detail:{value:i,min:e,max:t},bubbles:!0}))}cryptoRandomInt(e,t){if(typeof crypto<"u"&&crypto.getRandomValues){let i=t-e,r=Math.ceil(Math.log2(i)/8),d=Math.pow(256,r),l=new Uint8Array(r),a;do{crypto.getRandomValues(l),a=0;for(let s=0;s<r;s++)a=(a<<8)+l[s]}while(a>=d-d%i);return e+a%i}else return Math.floor(Math.random()*(t-e))+e}static get observedAttributes(){return["min","max"]}attributeChangedCallback(e,t,i){e==="min"&&this.minInput&&(this.minInput.value=i||"1",this.validateInputs()),e==="max"&&this.maxInput&&(this.maxInput.value=i||"100",this.validateInputs())}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.validateInputs(),0)}getStyles(){return`
|
21
|
+
${this.getBaseStyles()}
|
22
|
+
|
23
|
+
.random-number {
|
24
|
+
width: 280px;
|
25
|
+
text-align: center;
|
26
|
+
}
|
27
|
+
|
28
|
+
.controls {
|
29
|
+
margin-bottom: 1rem;
|
30
|
+
}
|
31
|
+
|
32
|
+
.range-inputs {
|
33
|
+
display: flex;
|
34
|
+
gap: 1rem;
|
35
|
+
margin-bottom: 1rem;
|
36
|
+
justify-content: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.range-inputs label {
|
40
|
+
display: flex;
|
41
|
+
flex-direction: column;
|
42
|
+
align-items: center;
|
43
|
+
font-size: 0.9rem;
|
44
|
+
font-weight: 500;
|
45
|
+
}
|
46
|
+
|
47
|
+
.range-inputs input {
|
48
|
+
width: 80px;
|
49
|
+
padding: 0.5rem;
|
50
|
+
margin-top: 0.25rem;
|
51
|
+
border: 1px solid color-mix(in srgb, var(--widgies-text, var(--widgies-text-light, #1a1a1a)) 30%, transparent);
|
52
|
+
border-radius: calc(var(--widgies-radius, 0.5rem) * 0.5);
|
53
|
+
background: var(--widgies-surface, var(--widgies-surface-light, #ffffffe6));
|
54
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
55
|
+
font: inherit;
|
56
|
+
text-align: center;
|
57
|
+
}
|
58
|
+
|
59
|
+
.range-inputs input:focus {
|
60
|
+
outline: 2px solid var(--widgies-accent, var(--widgies-accent-light, #6c4cff));
|
61
|
+
outline-offset: 1px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.range-inputs input[aria-invalid="true"] {
|
65
|
+
border-color: #dc2626;
|
66
|
+
background: color-mix(in srgb, #dc2626 10%, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)));
|
67
|
+
}
|
68
|
+
|
69
|
+
.generate-btn {
|
70
|
+
width: 100%;
|
71
|
+
padding: 0.75rem 1.5rem;
|
72
|
+
font-size: 1rem;
|
73
|
+
font-weight: 600;
|
74
|
+
}
|
75
|
+
|
76
|
+
.display {
|
77
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-light, #ffffffe6)) 70%, var(--widgies-text, var(--widgies-text-light, #1a1a1a)));
|
78
|
+
color: var(--widgies-text, var(--widgies-text-light, #1a1a1a));
|
79
|
+
padding: 1.5rem;
|
80
|
+
border-radius: var(--widgies-radius, 0.5rem);
|
81
|
+
font-size: 2rem;
|
82
|
+
font-weight: bold;
|
83
|
+
min-height: 2rem;
|
84
|
+
display: flex;
|
85
|
+
align-items: center;
|
86
|
+
justify-content: center;
|
87
|
+
}
|
88
|
+
|
89
|
+
@media (prefers-color-scheme: dark) {
|
90
|
+
.range-inputs input {
|
91
|
+
background: var(--widgies-surface, var(--widgies-surface-dark, #181824e6));
|
92
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
93
|
+
border-color: color-mix(in srgb, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)) 30%, transparent);
|
94
|
+
}
|
95
|
+
|
96
|
+
.range-inputs input:focus {
|
97
|
+
outline-color: var(--widgies-accent, var(--widgies-accent-dark, #a88bff));
|
98
|
+
}
|
99
|
+
|
100
|
+
.range-inputs input[aria-invalid="true"] {
|
101
|
+
background: color-mix(in srgb, #dc2626 10%, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)));
|
102
|
+
}
|
103
|
+
|
104
|
+
.display {
|
105
|
+
background: color-mix(in srgb, var(--widgies-surface, var(--widgies-surface-dark, #181824e6)) 70%, var(--widgies-text, var(--widgies-text-dark, #f5f5ff)));
|
106
|
+
color: var(--widgies-text, var(--widgies-text-dark, #f5f5ff));
|
107
|
+
}
|
108
|
+
}
|
109
|
+
`}};function o(){customElements.get("widgies-random-number")||customElements.define("widgies-random-number",n)}o();export{n as RandomNumberWidget,o as register};
|
package/dist/timer.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { TimerWidget, register } from './widgets/timer.js';
|