smoothly 0.2.8 → 0.2.11
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/dist/cjs/{Trigger-cf376531.js → Trigger-3443997e.js} +92 -55
- package/dist/cjs/{Notice-839702d8.js → index-2a011313.js} +381 -5
- package/dist/cjs/{index-1c61bdd3.js → index-3efe2a41.js} +18 -11
- package/dist/cjs/index.cjs.js +11 -374
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{smoothly-accordion_51.cjs.entry.js → smoothly-accordion_50.cjs.entry.js} +522 -13123
- package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-svg.cjs.entry.js +41 -0
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/App.js +9 -4
- package/dist/collection/components/app-demo/index.js +10 -0
- package/dist/collection/components/display/index.js +27 -2
- package/dist/collection/components/display-date-time/index.js +3 -0
- package/dist/collection/components/display-demo/index.js +16 -12
- package/dist/collection/components/input-date/index.js +18 -1
- package/dist/collection/components/input-demo/index.js +3 -1
- package/dist/collection/components/room/index.js +7 -3
- package/dist/collection/components/submit/Data.js +12 -0
- package/dist/collection/components/submit/index.js +10 -4
- package/dist/collection/index.js +1 -1
- package/dist/collection/{demo → model}/Listenable.js +11 -6
- package/dist/custom-elements/index.js +566 -13090
- package/dist/esm/{Trigger-365408f0.js → Trigger-327e506e.js} +92 -55
- package/dist/esm/{Notice-608b552c.js → index-1d438ba2.js} +381 -6
- package/dist/esm/{index-a3737440.js → index-4d9efff8.js} +18 -11
- package/dist/esm/index.js +5 -375
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{smoothly-accordion_51.entry.js → smoothly-accordion_50.entry.js} +522 -13122
- package/dist/esm/smoothly-google-font.entry.js +1 -1
- package/dist/esm/smoothly-radio-group.entry.js +1 -1
- package/dist/esm/smoothly-reorder.entry.js +1 -1
- package/dist/esm/smoothly-svg.entry.js +37 -0
- package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
- package/dist/esm/smoothly-trigger-source.entry.js +2 -2
- package/dist/esm/smoothly.js +3 -3
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/p-191ee4b8.js +2 -0
- package/dist/smoothly/p-76e88859.js +1 -0
- package/dist/smoothly/{p-0215b4da.entry.js → p-7a5eda51.entry.js} +1 -1
- package/dist/smoothly/p-8aefcb54.entry.js +1 -0
- package/dist/smoothly/{p-eec1c703.entry.js → p-8e4e941e.entry.js} +1 -1
- package/dist/smoothly/{p-993534fa.entry.js → p-919ae3e8.entry.js} +1 -1
- package/dist/smoothly/p-956089d5.entry.js +1 -0
- package/dist/smoothly/{p-6f009ac9.entry.js → p-9bc77fba.entry.js} +1 -1
- package/dist/smoothly/p-b1c579b3.js +1 -0
- package/dist/smoothly/{p-8ae38136.entry.js → p-d5d4832d.entry.js} +1 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/App.d.ts +1 -0
- package/dist/types/components/display/index.d.ts +2 -1
- package/dist/types/components/display-date-time/index.d.ts +3 -1
- package/dist/types/components/input-date/index.d.ts +1 -0
- package/dist/types/components/room/index.d.ts +1 -1
- package/dist/types/components/submit/Data.d.ts +7 -0
- package/dist/types/components/submit/index.d.ts +2 -3
- package/dist/types/components.d.ts +153 -44
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/Listenable.d.ts +10 -0
- package/package.json +14 -37
- package/dist/collection/demo/State.js +0 -40
- package/dist/smoothly/p-0cba3e3d.js +0 -1
- package/dist/smoothly/p-6ca0d36c.js +0 -1
- package/dist/smoothly/p-7a30d9b8.js +0 -1
- package/dist/smoothly/p-9d825b5a.entry.js +0 -1
- package/dist/types/demo/Listenable.d.ts +0 -6
- package/dist/types/demo/State.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smoothly",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Web component library written in Stencil.",
|
|
5
5
|
"author": "PayFunc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,61 +31,38 @@
|
|
|
31
31
|
"github": {
|
|
32
32
|
"release": true
|
|
33
33
|
},
|
|
34
|
-
"jest": {
|
|
35
|
-
"globals": {
|
|
36
|
-
"ts-jest": {
|
|
37
|
-
"tsConfig": "tsconfig.test.json"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"testEnvironment": "node",
|
|
41
|
-
"testRegex": "((\\.|/)(test|spec))(\\.|\\/.+)(jsx?|tsx?)$",
|
|
42
|
-
"testPathIgnorePatterns": [
|
|
43
|
-
"node_modules/",
|
|
44
|
-
"dist/"
|
|
45
|
-
],
|
|
46
|
-
"collectCoverageFrom": [
|
|
47
|
-
"**/*.{ts,tsx,js,jsx}",
|
|
48
|
-
"!**/node_modules/**",
|
|
49
|
-
"!**/dist/**"
|
|
50
|
-
],
|
|
51
|
-
"preset": "ts-jest",
|
|
52
|
-
"testMatch": null
|
|
53
|
-
},
|
|
54
34
|
"scripts": {
|
|
55
35
|
"build": "stencil build",
|
|
56
36
|
"start": "stencil build --dev --watch --serve",
|
|
57
37
|
"lint": "eslint 'src/**/*.{js,ts,tsx}'",
|
|
58
|
-
"fix": "eslint 'src/**/*.{js,ts,tsx}' --fix
|
|
38
|
+
"fix": "eslint 'src/**/*.{js,ts,tsx}' --fix",
|
|
59
39
|
"test": "stencil test --spec --e2e",
|
|
60
40
|
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
61
41
|
"clean": "rm -rf .stencil/ dist/ node_modules/ loader/ www/"
|
|
62
42
|
},
|
|
63
43
|
"dependencies": {
|
|
64
|
-
"authly": "0.
|
|
65
|
-
"isoly": "
|
|
66
|
-
"langly": "0.1
|
|
44
|
+
"authly": "3.0.1",
|
|
45
|
+
"isoly": "^2.0.8",
|
|
46
|
+
"langly": "2.0.1",
|
|
67
47
|
"normalize.css": "^8.0.1",
|
|
68
48
|
"stencil-router-v2": "^0.6.0",
|
|
69
|
-
"tidily": "0.0.
|
|
49
|
+
"tidily": "0.0.52"
|
|
70
50
|
},
|
|
71
51
|
"devDependencies": {
|
|
72
|
-
"@stencil/core": "^2.
|
|
52
|
+
"@stencil/core": "^2.17.4",
|
|
73
53
|
"@stencil/sass": "^1.5.2",
|
|
74
|
-
"@types/jest": "^27.
|
|
54
|
+
"@types/jest": "^27.0.3",
|
|
75
55
|
"@types/pvutils": "^1.0.1",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
77
|
-
"@typescript-eslint/parser": "^5.
|
|
78
|
-
"eslint": "^8.
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^5.36.0",
|
|
57
|
+
"@typescript-eslint/parser": "^5.36.0",
|
|
58
|
+
"eslint": "^8.23.0",
|
|
79
59
|
"eslint-plugin-prettierx": "github:utily/eslint-plugin-prettierx#utily-20220323",
|
|
80
60
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
81
61
|
"jest": "^27.0.3",
|
|
82
62
|
"jest-cli": "^27.4.5",
|
|
83
63
|
"prettier": "^2.7.1",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"stylelint-prettier": "^2.0.0",
|
|
88
|
-
"stylelint-scss": "^4.2.0",
|
|
89
|
-
"typescript": "^4.6.4"
|
|
64
|
+
"prettierx": "github:utily/prettierx#utily-20220323",
|
|
65
|
+
"puppeteer": "^17.0.0",
|
|
66
|
+
"typescript": "^4.8.2"
|
|
90
67
|
}
|
|
91
68
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _State_id, _State_all;
|
|
13
|
-
import { Listenable } from "./Listenable";
|
|
14
|
-
export class State {
|
|
15
|
-
constructor() {
|
|
16
|
-
_State_id.set(this, void 0);
|
|
17
|
-
_State_all.set(this, void 0);
|
|
18
|
-
}
|
|
19
|
-
get id() {
|
|
20
|
-
return __classPrivateFieldGet(this, _State_id, "f");
|
|
21
|
-
}
|
|
22
|
-
set id(value) {
|
|
23
|
-
__classPrivateFieldSet(this, _State_id, value, "f");
|
|
24
|
-
this.all = undefined;
|
|
25
|
-
}
|
|
26
|
-
get all() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
return (_a = __classPrivateFieldGet(this, _State_all, "f")) !== null && _a !== void 0 ? _a : (__classPrivateFieldSet(this, _State_all, load((_b = this.id) !== null && _b !== void 0 ? _b : 0), "f"));
|
|
29
|
-
}
|
|
30
|
-
set all(value) {
|
|
31
|
-
__classPrivateFieldSet(this, _State_all, value, "f");
|
|
32
|
-
this.current = value === null || value === void 0 ? void 0 : value[0];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
_State_id = new WeakMap(), _State_all = new WeakMap();
|
|
36
|
-
const state = Listenable.load(new State());
|
|
37
|
-
state.listen("current", current => console.log(current));
|
|
38
|
-
function load(id) {
|
|
39
|
-
return [id, id + 1];
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,l,n=!1,o=!1,s=!1,i=!1,r=null,c=!1;const f="undefined"!=typeof window?window:{},a=f.document||{head:{}},u={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,l,n)=>e.addEventListener(t,l,n),rel:(e,t,l,n)=>e.removeEventListener(t,l,n),ce:(e,t)=>new CustomEvent(e,t)},d=e=>Promise.resolve(e),$=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),h=(e,t,l)=>{l&&l.map((([l,n,o])=>{const s=e,i=y(t,o),r=m(l);u.ael(s,n,i,r),(t.o=t.o||[]).push((()=>u.rel(s,n,i,r)))}))},y=(e,t)=>l=>{try{256&e.t?e.i[t](l):(e.u=e.u||[]).push([t,l])}catch(e){$e(e)}},m=e=>0!=(2&e),p="http://www.w3.org/1999/xlink",b=new WeakMap,w=e=>"sc-"+e.$,g={},v=e=>"object"==(e=typeof e)||"function"===e,k=(e,t,...l)=>{let n=null,o=null,s=null,i=!1,r=!1,c=[];const f=t=>{for(let l=0;l<t.length;l++)n=t[l],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!v(n))&&(n+=""),i&&r?c[c.length-1].h+=n:c.push(i?j(null,n):n),r=i)};if(f(l),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,O);const a=j(e,null);return a.m=t,c.length>0&&(a.p=c),a.g=o,a.v=s,a},j=(e,t)=>({t:0,k:e,h:t,j:null,p:null,m:null,g:null,v:null}),S={},O={forEach:(e,t)=>e.map(M).forEach(t),map:(e,t)=>e.map(M).map(t).map(x)},M=e=>({vattrs:e.m,vchildren:e.p,vkey:e.g,vname:e.v,vtag:e.k,vtext:e.h}),x=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),k(e.vtag,t,...e.vchildren||[])}const t=j(e.vtag,e.vtext);return t.m=e.vattrs,t.p=e.vchildren,t.g=e.vkey,t.v=e.vname,t},C=(e,t,l,n,o,s)=>{if(l!==n){let i=de(e,t),r=t.toLowerCase();if("class"===t){const t=e.classList,o=P(l),s=P(n);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in l)n&&null!=n[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in n)l&&n[t]===l[t]||(t.includes("-")?e.style.setProperty(t,n[t]):e.style[t]=n[t])}else if("key"===t);else if("ref"===t)n&&n(e);else if(i||"o"!==t[0]||"n"!==t[1]){const c=v(n);if((i||c&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{let o=null==n?"":n;"list"===t?i=!1:null!=l&&e[t]==o||(e[t]=o)}}catch(e){}let f=!1;r!==(r=r.replace(/^xlink\:?/,""))&&(t=r,f=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(f?e.removeAttributeNS(p,t):e.removeAttribute(t)):(!i||4&s||o)&&!c&&(n=!0===n?"":n,f?e.setAttributeNS(p,t,n):e.setAttribute(t,n))}else t="-"===t[2]?t.slice(3):de(f,r)?r.slice(2):r[2]+t.slice(3),l&&u.rel(e,t,l,!1),n&&u.ael(e,t,n,!1)}},R=/\s/,P=e=>e?e.split(R):[],T=(e,t,l,n)=>{const o=11===t.j.nodeType&&t.j.host?t.j.host:t.j,s=e&&e.m||g,i=t.m||g;for(n in s)n in i||C(o,n,s[n],void 0,l,t.t);for(n in i)C(o,n,s[n],i[n],l,t.t)},E=(o,r,c,f)=>{let u,d,$,h=r.p[c],y=0;if(n||(s=!0,"slot"===h.k&&(e&&f.classList.add(e+"-s"),h.t|=h.p?2:1)),null!==h.h)u=h.j=a.createTextNode(h.h);else if(1&h.t)u=h.j=a.createTextNode("");else{if(i||(i="svg"===h.k),u=h.j=a.createElementNS(i?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&h.t?"slot-fb":h.k),i&&"foreignObject"===h.k&&(i=!1),T(null,h,i),null!=e&&u["s-si"]!==e&&u.classList.add(u["s-si"]=e),h.p)for(y=0;y<h.p.length;++y)d=E(o,h,y,u),d&&u.appendChild(d);"svg"===h.k?i=!1:"foreignObject"===u.tagName&&(i=!0)}return u["s-hn"]=l,3&h.t&&(u["s-sr"]=!0,u["s-cr"]=t,u["s-sn"]=h.v||"",$=o&&o.p&&o.p[c],$&&$.k===h.k&&o.j&&L(o.j,!1)),u},L=(e,t)=>{u.t|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==l&&o["s-ol"]&&(F(o).insertBefore(o,D(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&L(o,t)}u.t&=-2},N=(e,t,n,o,s,i)=>{let r,c=e["s-cr"]&&e["s-cr"].parentNode||e;for(c.shadowRoot&&c.tagName===l&&(c=c.shadowRoot);s<=i;++s)o[s]&&(r=E(null,n,s,e),r&&(o[s].j=r,c.insertBefore(r,D(t))))},W=(e,t,l,n,s)=>{for(;t<=l;++t)(n=e[t])&&(s=n.j,z(n),o=!0,s["s-ol"]?s["s-ol"].remove():L(s,!0),s.remove())},A=(e,t)=>e.k===t.k&&("slot"===e.k?e.v===t.v:e.g===t.g),D=e=>e&&e["s-ol"]||e,F=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,H=(e,t)=>{const l=t.j=e.j,n=e.p,o=t.p,s=t.k,r=t.h;let c;null===r?(i="svg"===s||"foreignObject"!==s&&i,"slot"===s||T(e,t,i),null!==n&&null!==o?((e,t,l,n)=>{let o,s,i=0,r=0,c=0,f=0,a=t.length-1,u=t[0],d=t[a],$=n.length-1,h=n[0],y=n[$];for(;i<=a&&r<=$;)if(null==u)u=t[++i];else if(null==d)d=t[--a];else if(null==h)h=n[++r];else if(null==y)y=n[--$];else if(A(u,h))H(u,h),u=t[++i],h=n[++r];else if(A(d,y))H(d,y),d=t[--a],y=n[--$];else if(A(u,y))"slot"!==u.k&&"slot"!==y.k||L(u.j.parentNode,!1),H(u,y),e.insertBefore(u.j,d.j.nextSibling),u=t[++i],y=n[--$];else if(A(d,h))"slot"!==u.k&&"slot"!==y.k||L(d.j.parentNode,!1),H(d,h),e.insertBefore(d.j,u.j),d=t[--a],h=n[++r];else{for(c=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].g&&t[f].g===h.g){c=f;break}c>=0?(s=t[c],s.k!==h.k?o=E(t&&t[r],l,c,e):(H(s,h),t[c]=void 0,o=s.j),h=n[++r]):(o=E(t&&t[r],l,r,e),h=n[++r]),o&&F(u.j).insertBefore(o,D(u.j))}i>a?N(e,null==n[$+1]?null:n[$+1].j,l,n,r,$):r>$&&W(t,i,a)})(l,n,t,o):null!==o?(null!==e.h&&(l.textContent=""),N(l,null,t,o,0,o.length-1)):null!==n&&W(n,0,n.length-1),i&&"svg"===s&&(i=!1)):(c=l["s-cr"])?c.parentNode.textContent=r:e.h!==r&&(l.data=r)},U=e=>{let t,l,n,o,s,i,r=e.childNodes;for(l=0,n=r.length;l<n;l++)if(t=r[l],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<n;o++)if(i=r[o].nodeType,r[o]["s-hn"]!==t["s-hn"]||""!==s){if(1===i&&s===r[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===i||3===i&&""!==r[o].textContent.trim()){t.hidden=!0;break}U(t)}},q=[],V=e=>{let t,l,n,s,i,r,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(t=f[c],t["s-sr"]&&(l=t["s-cr"])&&l.parentNode)for(n=l.parentNode.childNodes,s=t["s-sn"],r=n.length-1;r>=0;r--)l=n[r],l["s-cn"]||l["s-nr"]||l["s-hn"]===t["s-hn"]||(_(l,s)?(i=q.find((e=>e.S===l)),o=!0,l["s-sn"]=l["s-sn"]||s,i?i.O=t:q.push({O:t,S:l}),l["s-sr"]&&q.map((e=>{_(e.S,l["s-sn"])&&(i=q.find((e=>e.S===l)),i&&!e.O&&(e.O=i.O))}))):q.some((e=>e.S===l))||q.push({S:l}));1===t.nodeType&&V(t)}},_=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,z=e=>{e.m&&e.m.ref&&e.m.ref(null),e.p&&e.p.map(z)},B=e=>fe(e).M,G=(e,t,l)=>{const n=B(e);return{emit:e=>I(n,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},I=(e,t,l)=>{const n=u.ce(t,l);return e.dispatchEvent(n),n},J=(e,t)=>{t&&!e.C&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.C=t)))},K=(e,t)=>{if(e.t|=16,!(4&e.t))return J(e,e.R),je((()=>Q(e,t)));e.t|=512},Q=(e,t)=>{const l=e.i;let n;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>ne(l,e,t))),e.u=null),n=ne(l,"componentWillLoad")),oe(n,(()=>X(e,l,t)))},X=async(e,t,l)=>{const n=e.M,o=n["s-rc"];l&&(e=>{const t=e.P,l=e.M,n=t.t,o=((e,t)=>{let l=w(t),n=me.get(l);if(e=11===e.nodeType?e:a,n)if("string"==typeof n){let t,o=b.get(e=e.head||e);o||b.set(e,o=new Set),o.has(l)||(t=a.createElement("style"),t.innerHTML=n,e.insertBefore(t,e.querySelector("link")),o&&o.add(l))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return l})(l.shadowRoot?l.shadowRoot:l.getRootNode(),t);10&n&&(l["s-sc"]=o,l.classList.add(o+"-h"),2&n&&l.classList.add(o+"-s"))})(e);Y(e,t),o&&(o.map((e=>e())),n["s-rc"]=void 0);{const t=n["s-p"],l=()=>ee(e);0===t.length?l():(Promise.all(t).then(l),e.t|=4,t.length=0)}},Y=(i,c)=>{try{r=c,c=c.render&&c.render(),i.t&=-17,i.t|=2,((i,r)=>{const c=i.M,f=i.P,d=i.T||j(null,null),$=(e=>e&&e.k===S)(r)?r:k(null,null,r);if(l=c.tagName,f.L&&($.m=$.m||{},f.L.map((([e,t])=>$.m[t]=c[e]))),$.k=null,$.t|=4,i.T=$,$.j=d.j=c.shadowRoot||c,e=c["s-sc"],t=c["s-cr"],n=0!=(1&f.t),o=!1,H(d,$),u.t|=1,s){let e,t,l,n,o,s;V($.j);let i=0;for(;i<q.length;i++)e=q[i],t=e.S,t["s-ol"]||(l=a.createTextNode(""),l["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=l,t));for(i=0;i<q.length;i++)if(e=q[i],t=e.S,e.O){for(n=e.O.parentNode,o=e.O.nextSibling,l=t["s-ol"];l=l.previousSibling;)if(s=l["s-nr"],s&&s["s-sn"]===t["s-sn"]&&n===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&n!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),n.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&U($.j),u.t&=-2,q.length=0})(i,c)}catch(e){$e(e,i.M)}return r=null,null},Z=()=>r,ee=e=>{const t=e.M,l=e.i,n=e.R;ne(l,"componentDidRender"),64&e.t||(e.t|=64,se(t),ne(l,"componentDidLoad"),e.N(t),n||le()),e.W(t),e.C&&(e.C(),e.C=void 0),512&e.t&&ke((()=>K(e,!1))),e.t&=-517},te=e=>{{const t=fe(e),l=t.M.isConnected;return l&&2==(18&t.t)&&K(t,!1),l}},le=()=>{se(a.documentElement),ke((()=>I(f,"appload",{detail:{namespace:"smoothly"}})))},ne=(e,t,l)=>{if(e&&e[t])try{return e[t](l)}catch(e){$e(e)}},oe=(e,t)=>e&&e.then?e.then(t):t(),se=e=>e.classList.add("hydrated"),ie=(e,t,l)=>{if(t.A){e.watchers&&(t.D=e.watchers);const n=Object.entries(t.A),o=e.prototype;if(n.map((([e,[n]])=>{31&n||2&l&&32&n?Object.defineProperty(o,e,{get(){return((e,t)=>fe(this).F.get(t))(0,e)},set(l){((e,t,l,n)=>{const o=fe(e),s=o.M,i=o.F.get(t),r=o.t,c=o.i;if(l=((e,t)=>null==e||v(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,n.A[t][0]),(!(8&r)||void 0===i)&&l!==i&&(!Number.isNaN(i)||!Number.isNaN(l))&&(o.F.set(t,l),c)){if(n.D&&128&r){const e=n.D[t];e&&e.map((e=>{try{c[e](l,i,t)}catch(e){$e(e,s)}}))}2==(18&r)&&K(o,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0}):1&l&&64&n&&Object.defineProperty(o,e,{value(...t){const l=fe(this);return l.H.then((()=>l.i[e](...t)))}})})),1&l){const l=new Map;o.attributeChangedCallback=function(e,t,n){u.jmp((()=>{const t=l.get(e);if(this.hasOwnProperty(t))n=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==n)return;this[t]=(null!==n||"boolean"!=typeof this[t])&&n}))},e.observedAttributes=n.filter((([e,t])=>15&t[0])).map((([e,n])=>{const o=n[1]||e;return l.set(o,e),512&n[0]&&t.L.push([e,o]),o}))}}return e},re=(e,t={})=>{const l=[],n=t.exclude||[],o=f.customElements,s=a.head,i=s.querySelector("meta[charset]"),r=a.createElement("style"),c=[];let d,y=!0;Object.assign(u,t),u.l=new URL(t.resourcesUrl||"./",a.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],$:t[1],A:t[2],U:t[3]};s.A=t[2],s.U=t[3],s.L=[],s.D={};const i=s.$,r=class extends HTMLElement{constructor(e){super(e),ue(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),y?c.push(this):u.jmp((()=>(e=>{if(0==(1&u.t)){const t=fe(e),l=t.P,n=()=>{};if(1&t.t)h(e,t,l.U);else{t.t|=1,12&l.t&&(e=>{const t=e["s-cr"]=a.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let l=e;for(;l=l.parentNode||l.host;)if(l["s-p"]){J(t,t.R=l);break}}l.A&&Object.entries(l.A).map((([t,[l]])=>{if(31&l&&e.hasOwnProperty(t)){const l=e[t];delete e[t],e[t]=l}})),(async(e,t,l,n,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=ye(l)).then){const e=()=>{};o=await o,e()}o.isProxied||(l.D=o.watchers,ie(o,l,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){$e(e)}t.t&=-9,t.t|=128,e()}if(o.style){let e=o.style;const t=w(l);if(!me.has(t)){const n=()=>{};((e,t,l)=>{let n=me.get(e);$&&l?(n=n||new CSSStyleSheet,n.replace(t)):n=t,me.set(e,n)})(t,e,!!(1&l.t)),n()}}}const s=t.R,i=()=>K(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,l)}n()}})(this)))}disconnectedCallback(){u.jmp((()=>(()=>{if(0==(1&u.t)){const e=fe(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),ne(t,"disconnectedCallback")}})()))}componentOnReady(){return fe(this).q}};s.V=e[0],n.includes(i)||o.get(i)||(l.push(i),o.define(i,ie(r,s,1)))}))})),r.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),s.insertBefore(r,i?i.nextSibling:s.firstChild),y=!1,c.length?c.map((e=>e.connectedCallback())):u.jmp((()=>d=setTimeout(le,30)))},ce=new WeakMap,fe=e=>ce.get(e),ae=(e,t)=>ce.set(t.i=e,t),ue=(e,t)=>{const l={t:0,M:e,P:t,F:new Map};return l.H=new Promise((e=>l.W=e)),l.q=new Promise((e=>l.N=e)),e["s-p"]=[],e["s-rc"]=[],h(e,l,t.U),ce.set(e,l)},de=(e,t)=>t in e,$e=(e,t)=>(0,console.error)(e,t),he=new Map,ye=e=>{const t=e.$.replace(/-/g,"_"),l=e.V,n=he.get(l);return n?n[t]:import(`./${l}.entry.js`).then((e=>(he.set(l,e),e[t])),$e)},me=new Map,pe=[],be=[],we=(e,t)=>l=>{e.push(l),c||(c=!0,t&&4&u.t?ke(ve):u.raf(ve))},ge=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){$e(e)}e.length=0},ve=()=>{ge(pe),ge(be),(c=pe.length>0)&&u.raf(ve)},ke=e=>d().then(e),je=we(be,!0);export{S as H,B as a,re as b,G as c,te as f,Z as g,k as h,d as p,ae as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,f as e,h as n}from"./p-0cba3e3d.js";const i=t=>!("isConnected"in t)||t.isConnected,s=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(i))})(...e)}),2e3)}})();let o;const r=(t,e)=>{var n;return"to"in t?{path:t.path,to:t.to}:{path:t.path,id:t.id,jsx:null!==(n=t.render)&&void 0!==n?n:e}},l=(t,e=o)=>({href:t,onClick:n=>{n.metaKey||n.ctrlKey||2!=n.which&&1!=n.button&&(n.preventDefault(),e.push(t))}}),u=(t,e)=>{if("string"==typeof e){if(e===t)return{}}else if("function"==typeof e){const n=e(t);if(n)return!0===n?{}:{...n}}else{const n=e.exec(t);if(n)return e.lastIndex=0,{...n}}},c=t=>t.pathname.toLowerCase(),a=(()=>{const n=window,i=new URL(n.location.href),r=(void 0,c),{state:l,onChange:a,dispose:d}=((n,i)=>{const o=((t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(null!=t?t:{}));const i={dispose:[],get:[],set:[],reset:[]},s=()=>{n=new Map(Object.entries(null!=t?t:{})),i.reset.forEach((t=>t()))},o=t=>(i.get.forEach((e=>e(t))),n.get(t)),r=(t,s)=>{const o=n.get(t);e(s,o,t)&&(n.set(t,s),i.set.forEach((e=>e(t,s,o))))},l="undefined"==typeof Proxy?{}:new Proxy(t,{get:(t,e)=>o(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,n)=>(r(e,n),!0)}),u=(t,e)=>(i[t].push(e),()=>{((t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)})(i[t],e)});return{state:l,get:o,set:r,on:u,onChange:(e,n)=>{const i=u("set",((t,i)=>{t===e&&n(i)})),s=u("reset",(()=>n(t[e])));return()=>{i(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{i.dispose.forEach((t=>t())),s()},reset:s,forceUpdate:t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))}}})(n,i);return o.use((()=>{if("function"!=typeof t)return{};const n=new Map;return{dispose:()=>n.clear(),get:e=>{const i=t();i&&((t,e,n)=>{const i=t.get(e);i?i.includes(n)||i.push(n):t.set(e,[n])})(n,e,i)},set:t=>{const i=n.get(t);i&&n.set(t,i.filter(e)),s(n)},reset:()=>{n.forEach((t=>t.forEach(e))),s(n)}}})()),o})({url:i,activePath:r(i)},((t,e,n)=>"url"===n?t.href!==e.href:t!==e)),v=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);l.url=e,l.activePath=r(e)},h=t=>{const{activePath:e}=l;for(let n of t){const i=u(e,n.path);if(i){if(null!=n.to){const i="string"==typeof n.to?n.to:n.to(e);return v(i),h(t)}return{params:i,route:n}}}},f=()=>{const t=new URL(n.location.href);l.url=t,l.activePath=r(t)},p=o={Switch:(t,e)=>{const n=h(e);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return l.url},get activePath(){return l.activePath},push:v,onChange:a,dispose:()=>{o=void 0,n.removeEventListener("popstate",f),d()}};return f(),n.addEventListener("popstate",f),p})(),d=(t,e,i)=>{var s;const o=Object.entries(e[0]).reduce(((t,e)=>(t[e[0]]=null,t)),{}),u=c(o);function c(t){let e;return i.forEach([t],(t=>e=t)),null!=e?e:u}function d(t){return i.map([o],(e=>Object.assign(Object.assign({},e),t)))[0]}const h=e.map((t=>Object.assign(Object.assign({},c(t)),{node:t})));return n("smoothly-app",null,n("header",null,n("h1",null,n("a",Object.assign({},l(null!==(s=v(""))&&void 0!==s?s:"/")),t.label)),n("nav",null,n("ul",null,i.map([...h.filter((t=>{var e;return"nav-start"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})),...h.filter((t=>{var e,n;return(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)})),...h.filter((t=>{var e;return"nav-end"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)}))].map((t=>t.node)),(t=>{var e,n,i,s,o,r,l,c,h;(null===(e=t.vattrs)||void 0===e?void 0:e.label)&&(null===(n=t.vattrs)||void 0===n?void 0:n.path)&&(t=Object.assign(Object.assign({},u),{vtag:"a",vattrs:{href:null===(i=t.vattrs)||void 0===i?void 0:i.path},vchildren:[(null===(s=t.vattrs)||void 0===s?void 0:s.icon)?d({vtag:"smoothly-icon",vattrs:{toolTip:null===(o=t.vattrs)||void 0===o?void 0:o.label,name:null===(r=t.vattrs)||void 0===r?void 0:r.icon,size:"medium"}}):d({vtext:null===(l=t.vattrs)||void 0===l?void 0:l.label})]}));const f=v(null===(c=t.vattrs)||void 0===c?void 0:c.href);return"a"!=t.vtag?t:Object.assign(Object.assign({},t),f?{vattrs:Object.assign(Object.assign({},t.vattrs),{class:[null===(h=t.vattrs)||void 0===h?void 0:h.class,a.activePath==f?"active":""].join(" ")||void 0,href:f})}:{vattrs:Object.assign(Object.assign({},t.vattrs),{target:"new"})})})).map((t=>{var e,i;const s=c(t);return"a"!=s.vtag||(null===(e=s.vattrs)||void 0===e?void 0:e.target)?t:n("a",Object.assign({},s.vattrs,l(null===(i=s.vattrs)||void 0===i?void 0:i.href)),s.vchildren)})).map((t=>n("li",null,t))))),h.filter((t=>{var e;return"header"==(null===(e=t.vattrs)||void 0===e?void 0:e.slot)})).map((t=>t.node))),n("main",null,n(a.Switch,null,h.filter((t=>{var e;return null!=(null===(e=t.vattrs)||void 0===e?void 0:e.path)})).map((t=>{var e,i,s,o,l,u,c,a;return(null===(e=t.vattrs)||void 0===e?void 0:e.to)?n(r,{path:null!==(s=v(null===(i=t.vattrs)||void 0===i?void 0:i.path))&&void 0!==s?s:null===(o=t.vattrs)||void 0===o?void 0:o.path,to:null===(l=t.vattrs)||void 0===l?void 0:l.to}):n(r,{path:null!==(c=v(null===(u=t.vattrs)||void 0===u?void 0:u.path))&&void 0!==c?c:null===(a=t.vattrs)||void 0===a?void 0:a.path},t.node)})))))};function v(t){const e=new URL(t,document.baseURI);return""==t?new URL(document.baseURI).pathname:e.toString().startsWith(document.baseURI)?e.pathname:void 0}class h{constructor(t,e,n){switch(this.stateValue=t,this.messageValue=e,this.task=n,this.listeners=[],t){case"delayed":this.timer=window.setTimeout((()=>this.execute()),5e3);break;case"executing":this.execute();break;case"success":case"warning":case"failed":this.startCloseTimer()}}get state(){return this.stateValue}set state(t){this.stateValue!=t&&(this.stateValue=t,this.emit())}get message(){return this.messageValue}set message(t){this.messageValue!=t&&(this.messageValue=t,this.emit())}listen(t){this.listeners.push(t)}unlisten(t){this.listeners.filter((e=>e!=t))}emit(){this.listeners.forEach((t=>t(this)))}execute(){this.clearTimer(),this.task?(this.state="executing",this.task(this).then((t=>{this.messageValue=t[1],this.state=t[0]?"success":"failed",this.startCloseTimer()}))):this.state="failed"}startCloseTimer(){this.timer=window.setTimeout((()=>this.close()),15e3)}close(){this.clearTimer(),this.state="closed"}clearTimer(){this.timer&&(window.clearTimeout(this.timer),this.timer=void 0)}static delay(t,e){return new h("delayed",t,e)}static execute(t,e){return new h("executing",t,e)}static succeded(t){return new h("success",t)}static failed(t){return new h("failed",t)}static warn(t){return new h("warning",t)}}export{d as A,h as N}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class t{constructor(){this.encoding="utf-8"}encode(t){return Uint8Array.from(unescape(encodeURIComponent(t)).split(""),(t=>t.charCodeAt(0)))}}const n={standard:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",url:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function r(r,e="standard",i=""){"string"==typeof r&&(r=(new t).encode(r));const s=n[e],a=[];for(let t=0;t<r.length;t+=3){const n=r[t],e=t+1<r.length?r[t+1]:0,i=t+2<r.length?r[t+2]:0;a.push(s[n>>>2]),a.push(s[(3&n)<<4|e>>>4]),a.push(s[(15&e)<<2|i>>>6]),a.push(s[63&i])}const o=Math.ceil(r.length/3*4);return a.join("").substr(0,o)+i.repeat(a.length-o)}function e(t,r="standard"){for(;t.endsWith("=")&&t.length>0;)t=t.substr(0,t.length-1);const e=n[r],i=t.split("").map((t=>e.indexOf(t))),s=new Uint8Array(Math.floor(i.length/4*3));for(let t=0;t<s.length;t+=3){const n=i.shift()||0,r=i.shift()||0,e=i.shift()||0,a=i.shift()||0;s[t]=n<<2|r>>>4,s[t+1]=(15&r)<<4|e>>>2,s[t+2]=(3&e)<<6|a}return s}const i="undefined"!=typeof window?window.crypto||window.msCrypto:self.crypto||self.msCrypto;var s,a,o,c,u,f,S,y,A,h,p,w,l,g,H,b;!function(t){t.create=function(t,n,...r){const[e,...i]=(s=r,Array.isArray(s)&&s.length>0&&"string"==typeof s[0]?r.map((t=>Object.fromEntries(t.split(",").map((t=>t.split(":",2).map((t=>t.trim()))))))):r);var s;const a=Object.assign({},...Object.entries(e).map((([t,n])=>[t,[n,...i.map((n=>n[t])).filter((t=>t))]])).map((([n,r])=>({get[n](){return Object.assign(t(r),{name:n})}}))));return{current:a[n],...a}}}(s||(s={})),function(t){t.is=function(t){return"object"==typeof t&&(null==t.key||"string"==typeof t.key)&&"string"==typeof t.value&&"string"==typeof t.salt},t.stringify=function(t){return t.key=t.key&&4!=t.key.length?t.key.slice(-2):t.key,[t.key,t.salt,t.value].join(".")},t.parse=function(n){const r=n.split("."),e={key:r[0],salt:r[1],value:r[2]};return t.is(e)?e:void 0}}(a||(a={})),function(t){function n(t){return r(t,"url")}function s(t){t.length%2==1&&(t+="0");const r=new Uint8Array(t.length/2);for(let n=0;n<r.length;n++)r[n]=16*Number.parseInt(t[2*n],16)+Number.parseInt(t[2*n+1],16);return n(r)}function a(t,n){const r=e(t,"url");let i=[];for(const t of r)i.push(Math.floor(t/16).toString(16),(t%16).toString(16));return n&&(i=i.slice(0,n)),i.join("")}t.is=function(t,n){return"string"==typeof t&&(null==n||t.length==n)&&Array.from(t).every((t=>t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||"-"==t||"_"==t))},t.fromUint24=function(t){return s(t.toString(16).padStart(6,"0"))},t.toUint24=function(t){return Number.parseInt(a(t,6),16)},t.fromUint48=function(t){return s(t.toString(16).padStart(12,"0"))},t.toUint48=function(t){return Number.parseInt(a(t,12),16)},t.fromBinary=n,t.toBinary=function(t){return e(t,"url")},t.generate=function(t){return n(i.getRandomValues(new Uint8Array(t/4*3)))},t.fromHexadecimal=s,t.toHexadecimal=a,t.length=[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128],(t.Length||(t.Length={})).is=function(t){return"number"==typeof t&&t>=4&&t<=128&&(252&t)==t}}(o||(o={})),function(t){t.is=function(t){return"string"==typeof t||"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt},t.hash=async function(t,n,e){return e||(e=r(i.getRandomValues(new Uint8Array(64)))),{hash:await t.sign(e+n),salt:e}},t.verify=async function(n,r,e){return(await t.hash(n,e,r.salt)).hash==r.hash},(t.Hashed||(t.Hashed={})).is=function(t){return"object"==typeof t&&"string"==typeof t.hash&&"string"==typeof t.salt}}(c||(c={})),function(t){t.generate=function(t){return i.getRandomValues(t)}}(u||(u={})),(f||(f={})).is=function(t){return"HMAC"==t||"RSA"==t||"ECDSA"==t||"RSA-PSS"==t};class P{async sign(n){return"string"==typeof n?r(await this.signBinary((new t).encode(n)),"url"):this.signBinary(n)}verify(n,r){return"string"==typeof r&&(r=e(r,"url")),this.verifyBinary("string"==typeof n?(new t).encode(n):n,r)}}class d extends P{constructor(t,n,r){super(),this.hash=t,n&&("string"==typeof n&&(n=e(n)),this.publicKey=i.subtle.importKey("spki",n,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!1,["verify"])),r&&("string"==typeof r&&(r=e(r)),this.privateKey=i.subtle.importKey("pkcs8",r,{name:"ECDSA",namedCurve:"P-512"==t.replace("SHA","P")?"P-521":t.replace("SHA","P")},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await i.subtle.sign({name:"ECDSA",hash:{name:this.hash}},await this.privateKey,t))}async verifyBinary(t,n){return i.subtle.verify({name:"ECDSA",hash:{name:this.hash}},await this.publicKey,n,t)}}!function(t){t.is=function(t){return"SHA-1"==t||"SHA-256"==t||"SHA-384"==t||"SHA-512"==t}}(S||(S={}));class m extends P{async verifyBinary(t,n){return r(await this.signBinary(t),"url")==r(n,"url")}}class R extends m{constructor(t,n){super(),this.hash=t,"string"==typeof n&&(n=e(n,"url")),this.key=i.subtle.importKey("raw",n,{name:"HMAC",hash:{name:t}},!1,["sign","verify"])}async signBinary(t){return new Uint8Array(await i.subtle.sign("HMAC",await this.key,t))}}class v extends m{signBinary(t){return Promise.resolve(new Uint8Array(0))}}class E extends P{constructor(t,n,r){super(),this.hash=t,n&&("string"==typeof n&&(n=e(n)),this.publicKey=i.subtle.importKey("spki",n,{name:"RSASSA-PKCS1-v1_5",hash:{name:t}},!1,["verify"])),r&&("string"==typeof r&&(r=e(r)),this.privateKey=i.subtle.importKey("pkcs8",r,{name:"RSASSA-PKCS1-v1_5",hash:{name:t}},!0,["sign"]))}async signBinary(t){return new Uint8Array(await i.subtle.sign("RSASSA-PKCS1-v1_5",await this.privateKey,t))}async verifyBinary(t,n){return i.subtle.verify("RSASSA-PKCS1-v1_5",await this.publicKey,n,t)}}class k extends P{constructor(t,n,r){super(),this.hash=t,n&&("string"==typeof n&&(n=e(n)),this.publicKey=i.subtle.importKey("spki",n,{name:"RSA-PSS",hash:{name:t}},!1,["verify"])),r&&("string"==typeof r&&(r=e(r)),this.privateKey=i.subtle.importKey("pkcs8",r,{name:"RSA-PSS",hash:{name:t}},!0,["sign","verify"]))}async signBinary(t){return new Uint8Array(await i.subtle.sign({name:"RSA-PSS",saltLength:128},await this.privateKey,t))}async verifyBinary(t,n){return i.subtle.verify({name:"RSA-PSS",saltLength:128},await this.publicKey,n,t)}}!function(t){!function(t){t.is=f.is}(t.Algorithm||(t.Algorithm={})),(t.Hash||(t.Hash={})).is=S.is,t.create=function(t,n,...r){let e;switch(t){case"HMAC":null!=n&&(e=new R(n,r[0]));break;case"RSA":null!=n&&(e=new E(n,r[0],r[1]));break;case"RSA-PSS":null!=n&&(e=new k(n,r[0],r[1]));break;case"ECDSA":null!=n&&(e=new d(n,r[0],r[1]));break;case"None":e=new v}return e}}(y||(y={})),Uint8Array.__proto__.from||(Uint8Array.__proto__.from=function(t,n,r){const e=Uint8Array.__proto__;if("function"!=typeof this)throw new TypeError("# is not a constructor");if(this.__proto__!==e)throw new TypeError("this is not a typed array.");if("function"!=typeof(n=n||(t=>t)))throw new TypeError("specified argument is not a function");if(!(t=Object(t)).length)return new this(0);let i=[];for(const t of i)i.push(t);i=i.map(n,r);const s=new this(i.length);for(let t=0;t<s.length;t++)s[t]=i[t];return s}),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"function"==typeof t))}}(A||(A={})),function(t){t.is=function(t){return Array.isArray(t)&&t.every((t=>"string"==typeof t))}}(h||(h={})),function(t){t.is=function(t){return"object"==typeof t&&Object.entries(t).every((t=>"string"==typeof t[1]))}}(p||(p={})),function(t){t.is=function(t){return h.is(t)||A.is(t)||p.is(t)},(t.Converter||(t.Converter={})).is=A.is,(t.Crypto||(t.Crypto={})).is=h.is,(t.Renamer||(t.Renamer={})).is=p.is}(w||(w={})),function(t){t.is=function(t){return"object"==typeof t&&"function"==typeof t.apply&&"function"==typeof t.reverse},t.create=function(t){return{apply:t.apply?t.apply:t=>t,reverse:t.reverse?t.reverse:t=>t}}}(l||(l={})),function(t){t.is=function(t){return"RS256"==t||"RS384"==t||"RS512"==t||"ES256"==t||"ES384"==t||"ES512"==t||"PS256"==t||"PS384"==t||"PS512"==t}}(g||(g={})),function(t){t.is=function(t){return"HS256"==t||"HS384"==t||"HS512"==t}}(H||(H={})),function(t){t.is=function(t){return"none"==t||H.is(t)||g.is(t)},function(t){t.is=H.is}(t.Symmetric||(t.Symmetric={})),(t.Asymmetric||(t.Asymmetric={})).is=g.is}(b||(b={}));var C;class j{constructor(t,n){this.name=t,this.signer=n}sign(t){return n=this,r=void 0,i=function*(){return this.signer.sign(t)},new((e=void 0)||(e=Promise))((function(t,s){function a(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i.throw(t))}catch(t){s(t)}}function c(n){var r;n.done?t(n.value):(r=n.value,r instanceof e?r:new e((function(t){t(r)}))).then(a,o)}c((i=i.apply(n,r||[])).next())}));var n,r,e,i}verify(t,n){return this.signer.verify(t,n)}static create(t,...n){let r;switch(t){case"ES256":r=y.create("ECDSA","SHA-256",n[0],n[1]);break;case"ES384":r=y.create("ECDSA","SHA-384",n[0],n[1]);break;case"ES512":r=y.create("ECDSA","SHA-512",n[0],n[1]);break;case"PS256":r=y.create("RSA-PSS","SHA-256",n[0],n[1]);break;case"PS384":r=y.create("RSA-PSS","SHA-384",n[0],n[1]);break;case"PS512":r=y.create("RSA-PSS","SHA-512",n[0],n[1]);break;case"HS256":r=y.create("HMAC","SHA-256",n[0]);break;case"HS384":r=y.create("HMAC","SHA-384",n[0]);break;case"HS512":r=y.create("HMAC","SHA-512",n[0]);break;case"RS256":r=y.create("RSA","SHA-256",n[0],n[1]);break;case"RS384":r=y.create("RSA","SHA-384",n[0],n[1]);break;case"RS512":r=y.create("RSA","SHA-512",n[0],n[1]);break;case"none":r=y.create("None")}return r&&new j(t,r)}static none(){return j.create("none")}static HS256(t){return j.create("HS256",t)}static HS384(t){return j.create("HS384",t)}static HS512(t){return j.create("HS512",t)}static RS256(t,n){return j.create("RS256",t,n)}static RS384(t,n){return j.create("RS384",t,n)}static RS512(t,n){return j.create("RS512",t,n)}static ES256(t,n){return j.create("ES256",t,n)}static ES384(t,n){return j.create("ES384",t,n)}static ES512(t,n){return j.create("ES512",t,n)}static PS256(t,n){return j.create("PS256",t,n)}static PS384(t,n){return j.create("PS384",t,n)}static PS512(t,n){return j.create("PS512",t,n)}}!function(t){var n;(n=t.Name||(t.Name={})).is=b.is,function(t){t.is=b.Symmetric.is}(n.Symmetric||(n.Symmetric={})),function(t){t.is=b.Asymmetric.is}(n.Asymmetric||(n.Asymmetric={}))}(j||(j={})),function(t){t.is=function(t){return"string"==typeof t&&/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(t)}}(C||(C={}));class U{static is(t){return"object"==typeof t&&"string"==typeof t.destination&&null!=t.content}static send(t,n,r){if(U.is(t)&&null==r){(r=n)||(r=window);const e=t.destination.split("#",2);r.postMessage(t={destination:e[1],content:t.content},e[0])}else"string"!=typeof r&&(r||(r=window),"string"==typeof t&&U.send({destination:t,content:n},r))}static listen(t,n,r){const e=t.split("#",2);let i="";2==e.length&&(t=e[0],i=e[1]),(r||window).addEventListener("message",(r=>{const e=r.data;!U.is(e)||"*"!=t&&r.origin!=t||""!=i&&e.destination!=i||n(e.destination,e.content)}))}}class M{static is(t){return"object"==typeof t&&"string"==typeof t.name}}export{o as I,U as M,M as T}
|