@webqit/webflo 0.20.34 → 0.20.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/package.json +9 -3
  2. package/src/index.js +7 -7
  3. package/src/{build-pi → webflo-build}/index.js +4 -4
  4. package/src/{config-pi → webflo-config}/deployment/Env.js +0 -4
  5. package/src/{config-pi → webflo-config}/deployment/Layout.js +0 -4
  6. package/src/{config-pi → webflo-config}/deployment/Origins.js +0 -4
  7. package/src/{config-pi → webflo-config}/deployment/Proxy.js +0 -4
  8. package/src/{config-pi → webflo-config}/deployment/index.js +0 -7
  9. package/src/{config-pi → webflo-config}/index.js +0 -7
  10. package/src/{config-pi → webflo-config}/static/Init.js +0 -4
  11. package/src/{config-pi → webflo-config}/static/Manifest.js +0 -4
  12. package/src/{config-pi → webflo-config}/static/Ssg.js +0 -4
  13. package/src/{config-pi → webflo-config}/static/index.js +0 -7
  14. package/src/{deployment-pi → webflo-deployment}/index.js +0 -7
  15. package/src/{deployment-pi → webflo-deployment}/origins/index.js +0 -13
  16. package/src/webflo-exports/ui/index.js +1 -0
  17. package/src/{init-pi → webflo-init}/index.js +1 -1
  18. package/src/{runtime-pi → webflo-runtime}/webflo-client/bootstrap.js +1 -1
  19. package/src/{runtime-pi → webflo-runtime}/webflo-client/webflo-elements.js +195 -117
  20. package/src/webflo-runtime/webflo-client/webflo-embedded.js +56 -0
  21. package/src/{runtime-pi → webflo-runtime}/webflo-server/WebfloServer.js +1 -1
  22. package/src/{runtime-pi → webflo-runtime}/webflo-server/bootstrap.js +1 -1
  23. package/src/{runtime-pi → webflo-runtime}/webflo-worker/bootstrap.js +1 -1
  24. package/src/{services-pi → webflo-services}/cert/http-auth-hook.js +1 -1
  25. package/test/browser/elements.src.build.js +1239 -0
  26. package/test/browser/elements.src.build.js.map +7 -0
  27. package/test/browser/elements.src.js +3 -0
  28. package/test/browser/index.html +419 -0
  29. package/src/runtime-pi/webflo-client/webflo-embedded.js +0 -54
  30. package/test/index.test.js +0 -26
  31. package/test/site/package.json +0 -9
  32. package/test/site/public/bundle.html +0 -6
  33. package/test/site/public/bundle.html.json +0 -4
  34. package/test/site/public/bundle.js +0 -2
  35. package/test/site/public/bundle.js.gz +0 -0
  36. package/test/site/public/bundle.webflo.js +0 -15
  37. package/test/site/public/bundle.webflo.js.gz +0 -0
  38. package/test/site/public/index.html +0 -30
  39. package/test/site/public/index1.html +0 -35
  40. package/test/site/public/page-2/bundle.html +0 -5
  41. package/test/site/public/page-2/bundle.html.json +0 -1
  42. package/test/site/public/page-2/bundle.js +0 -2
  43. package/test/site/public/page-2/bundle.js.gz +0 -0
  44. package/test/site/public/page-2/index.html +0 -46
  45. package/test/site/public/page-2/logo-130x130.png +0 -0
  46. package/test/site/public/page-2/main.html +0 -3
  47. package/test/site/public/page-3/logo-130x130.png +0 -0
  48. package/test/site/public/page-4/subpage/bundle.html.json +0 -1
  49. package/test/site/public/page-4/subpage/bundle.js +0 -2
  50. package/test/site/public/page-4/subpage/bundle.js.gz +0 -0
  51. package/test/site/public/page-4/subpage/index.html +0 -31
  52. package/test/site/public/sparoots.json +0 -5
  53. package/test/site/public/worker.js +0 -3
  54. package/test/site/public/worker.js.gz +0 -0
  55. package/test/site/server/index.js +0 -16
  56. /package/src/{build-pi → webflo-build}/esbuild-plugin-uselive-transform.js +0 -0
  57. /package/src/{config-pi → webflo-config}/runtime/Client.js +0 -0
  58. /package/src/{config-pi → webflo-config}/runtime/Server.js +0 -0
  59. /package/src/{config-pi → webflo-config}/runtime/client/Worker.js +0 -0
  60. /package/src/{config-pi → webflo-config}/runtime/client/index.js +0 -0
  61. /package/src/{config-pi → webflo-config}/runtime/index.js +0 -0
  62. /package/src/{config-pi → webflo-config}/runtime/server/Headers.js +0 -0
  63. /package/src/{config-pi → webflo-config}/runtime/server/Redirects.js +0 -0
  64. /package/src/{config-pi → webflo-config}/runtime/server/index.js +0 -0
  65. /package/src/{deployment-pi → webflo-deployment}/util.js +0 -0
  66. /package/{test/site/public/page-4/subpage/bundle.html → src/webflo-exports/index.js} +0 -0
  67. /package/src/{init-pi → webflo-init}/templates/pwa/.gitignore +0 -0
  68. /package/src/{init-pi → webflo-init}/templates/pwa/.webqit/webflo/client.json +0 -0
  69. /package/src/{init-pi → webflo-init}/templates/pwa/.webqit/webflo/layout.json +0 -0
  70. /package/src/{init-pi → webflo-init}/templates/pwa/app/handler.server.js +0 -0
  71. /package/src/{init-pi → webflo-init}/templates/pwa/app/page.html +0 -0
  72. /package/src/{init-pi → webflo-init}/templates/pwa/package.json +0 -0
  73. /package/src/{init-pi → webflo-init}/templates/pwa/public/assets/app.css +0 -0
  74. /package/src/{init-pi → webflo-init}/templates/pwa/public/index.html +0 -0
  75. /package/src/{init-pi → webflo-init}/templates/pwa/public/manifest.json +0 -0
  76. /package/src/{init-pi → webflo-init}/templates/web/.gitignore +0 -0
  77. /package/src/{init-pi → webflo-init}/templates/web/.webqit/webflo/client.json +0 -0
  78. /package/src/{init-pi → webflo-init}/templates/web/.webqit/webflo/layout.json +0 -0
  79. /package/src/{init-pi → webflo-init}/templates/web/app/handler.server.js +0 -0
  80. /package/src/{init-pi → webflo-init}/templates/web/app/page.html +0 -0
  81. /package/src/{init-pi → webflo-init}/templates/web/package.json +0 -0
  82. /package/src/{init-pi → webflo-init}/templates/web/public/assets/app.css +0 -0
  83. /package/src/{init-pi → webflo-init}/templates/web/public/index.html +0 -0
  84. /package/src/{runtime-pi → webflo-runtime}/AppBootstrap.js +0 -0
  85. /package/src/{runtime-pi → webflo-runtime}/AppRuntime.js +0 -0
  86. /package/src/{runtime-pi → webflo-runtime}/index.js +0 -0
  87. /package/src/{runtime-pi → webflo-runtime}/webflo-client/ClientSideWorkport.js +0 -0
  88. /package/src/{runtime-pi → webflo-runtime}/webflo-client/DeviceCapabilities.js +0 -0
  89. /package/src/{runtime-pi → webflo-runtime}/webflo-client/WebfloClient.js +0 -0
  90. /package/src/{runtime-pi → webflo-runtime}/webflo-client/WebfloRootClientA.js +0 -0
  91. /package/src/{runtime-pi → webflo-runtime}/webflo-client/WebfloRootClientB.js +0 -0
  92. /package/src/{runtime-pi → webflo-runtime}/webflo-client/WebfloSubClient.js +0 -0
  93. /package/src/{runtime-pi → webflo-runtime}/webflo-client/index.js +0 -0
  94. /package/src/{runtime-pi → webflo-runtime}/webflo-client/webflo-devmode.js +0 -0
  95. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/ClientPortMixin.js +0 -0
  96. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/ClientRequestPort001.js +0 -0
  97. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/ClientRequestPort010.js +0 -0
  98. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/ClientRequestPort100.js +0 -0
  99. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/WebfloTenancy001.js +0 -0
  100. /package/src/{runtime-pi → webflo-runtime}/webflo-messaging/WebfloTenant001.js +0 -0
  101. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpCookies101.js +0 -0
  102. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpCookies110.js +0 -0
  103. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpEvent111.js +0 -0
  104. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpKeyvalInterface.js +0 -0
  105. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpSession001.js +0 -0
  106. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpSession110.js +0 -0
  107. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpThread111.js +0 -0
  108. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/HttpUser111.js +0 -0
  109. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/KeyvalsFactory001.js +0 -0
  110. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/KeyvalsFactory110.js +0 -0
  111. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/KeyvalsFactoryInterface.js +0 -0
  112. /package/src/{runtime-pi → webflo-runtime}/webflo-routing/WebfloRouter111.js +0 -0
  113. /package/src/{runtime-pi → webflo-runtime}/webflo-server/index.js +0 -0
  114. /package/src/{runtime-pi → webflo-runtime}/webflo-server/webflo-devmode.js +0 -0
  115. /package/src/{runtime-pi → webflo-runtime}/webflo-worker/WebfloWorker.js +0 -0
  116. /package/src/{runtime-pi → webflo-runtime}/webflo-worker/WorkerSideWorkport.js +0 -0
  117. /package/src/{runtime-pi → webflo-runtime}/webflo-worker/index.js +0 -0
  118. /package/src/{services-pi → webflo-services}/cert/http-cleanup-hook.js +0 -0
  119. /package/src/{services-pi → webflo-services}/cert/index.js +0 -0
  120. /package/src/{services-pi → webflo-services}/index.js +0 -0
  121. /package/src/{services-pi → webflo-services}/push/index.js +0 -0
@@ -0,0 +1,1239 @@
1
+ (()=>{var l=class extends HTMLElement{static get events(){return[]}static get observedAttributes(){return this.events.map(t=>`on${t}`)}#t={};#e(t,e){for(let o of this.constructor.events)t===`on${o}`&&(this.#t[t]&&(this.removeEventListener(o,this.#t[t]),this.#t[t]=null),e&&(this.#t[t]=Function("event",e).bind(this),this.addEventListener(o,this.#t[t])))}#o(){for(let t of this.constructor.events){let e=`on${t}`,o=null;Object.defineProperty(this,e,{get:()=>o,set:r=>{if(o&&(this.removeEventListener(t,o),o=null),typeof r=="function")this.addEventListener(t,r);else if(r!=null)throw new Error(`[${e}] handler must be null or a function`);o=r}})}}attributeChangedCallback(t,e,o){this.#e(t,o)}constructor(){super(),this.#o()}},h=class extends l{set type(t){[void 0,null].includes(t)?this.removeAttribute("type"):this.setAttribute("type",t)}get type(){return this.getAttribute("type")}get contentHTML(){return""}get css(){return""}#t=null;#e(){this.#t&&(this.shadowRoot.appendChild(this.#t),this.matches(":popover-open")&&this.#t.showPopover())}_processVisibility(t){this.hasAttribute("oncontent")&&(t.assignedNodes().find(e=>e.nodeName!=="#text"||e.textContent.trim())?this.showPopover():this.hidePopover())}render({content:t,context:e},o=null,r=1){if(e&&r>0){let a=document.createElement(this.tagName);a.setAttribute("popover",this.getAttribute("popover")||"auto"),this.classList.contains("_top")&&a.classList.add("_top"),a.render({content:t},o,0),this.render(e,a,r+1);return}this.#t?.remove(),this.#t=o,this.#e();let i=parseFloat(o?.style.getPropertyValue("--start-delay")||"0");this.style.setProperty("--start-delay",i+.1+"s"),this.type=t.type,this.innerHTML=t.message}connectedCallback(){this.popover||(this.popover="auto")}constructor(){super(),this.attachShadow({mode:"open"}),this.addEventListener("toggle",t=>{t.newState==="open"?this.#t?.showPopover():t.newState==="closed"&&(this.#t?.hidePopover(),this.getAttribute("oncontent")==="always"&&(this.innerHTML=""))}),this.shadowRoot.innerHTML=`
2
+ <div class="container">
3
+
4
+ <svg class="icon _info" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M444-296h72v-228h-72v228Zm36-312q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm0 528q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
5
+ <svg class="icon _success" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M390-298 246-442l72-72 72 72 252-252 72 72-324 324Zm90 218q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
6
+ <svg class="icon _error" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-292q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm-36-156h72v-240h-72v240Zm36 368q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
7
+ <svg class="icon _warning" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-292q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm-36-156h72v-240h-72v240Zm36 368q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
8
+ <div class="_content" part="content">
9
+ <slot
10
+ onslotchange="this.getRootNode().host?._processVisibility(this);"
11
+ >${this.contentHTML}</slot>
12
+ </div>
13
+ <button class="close-button" part="close-button" onclick="this.getRootNode().host.hidePopover();">
14
+ <svg xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M256-176 176-256l224-224-224-224 80-80 224 224 224-224 80 80-224 224 224 224-80 80-224-224-224 224Z"/></svg>
15
+ </button>
16
+
17
+ </div>
18
+ <style>
19
+ * {
20
+ box-sizing: border-box;
21
+ }
22
+
23
+ @keyframes flash {
24
+ from {
25
+ background-color: transparent;
26
+ }
27
+
28
+ 50% {
29
+ background-color: rgba(125, 125, 125, 0.2);
30
+ }
31
+
32
+ to {
33
+ background-color: transparent;
34
+ }
35
+ }
36
+
37
+ :host {
38
+ --color-default: var(--toast-color-default, whitesmoke);
39
+ --color-info: var(--toast-color-info, skyblue);
40
+ --color-success: var(--toast-color-success, lightgreen);
41
+ --color-error: var(--toast-color-error, coral);
42
+ --color-warning: var(--toast-color-warning, coral);
43
+
44
+ --wq-radius: var(--toast-radius, 1rem);
45
+ --background: var(--toast-background, rgb(30, 30, 30));
46
+ --shadow: var(--toast-shadow, rgb(30, 30, 30));
47
+
48
+ --dir: 1;
49
+ --translation: calc(var(--toast-translation, 50px) * var(--dir));
50
+ --exit-factor: var(--toast-exit-factor, -1);
51
+
52
+ --entry-transform: translateY(var(--translation));
53
+ --exit-transform: translateY(calc(var(--translation) * var(--exit-factor)));
54
+ }
55
+
56
+ :host {
57
+ border: none;
58
+ background: none;
59
+
60
+ margin-bottom: 0;
61
+ padding: 1rem;
62
+
63
+ /* Transition */
64
+ transition:
65
+ opacity 0.2s,
66
+ transform 0.2s,
67
+ bottom 0.1s,
68
+ top 0.1s,
69
+ overlay 0.2s allow-discrete,
70
+ display 0.2s allow-discrete;
71
+
72
+ /* Exit state */
73
+ transform: var(--exit-transform);
74
+ transition-delay: var(--start-delay, 0s);
75
+ opacity: 0;
76
+ }
77
+
78
+ :host(._top) {
79
+ margin-bottom: auto;
80
+ margin-top: 0;
81
+ --dir: -1;
82
+ }
83
+
84
+ /* ----------- */
85
+
86
+ .container {
87
+ position: relative;
88
+
89
+ display: flex;
90
+ align-items: start;
91
+ gap: 0.6rem;
92
+
93
+ padding-block: 0.8rem;
94
+ padding-inline: 1.2rem;
95
+ border-radius: var(--wq-radius);
96
+
97
+ color: var(--color-default);
98
+ background-color: var(--background);
99
+ box-shadow: var(--shadow);
100
+
101
+ anchor-name: --container;
102
+ }
103
+
104
+ /* ----------- */
105
+
106
+ :host(:popover-open) {
107
+ display: block;
108
+ opacity: 1;
109
+ transform: none;
110
+ }
111
+
112
+ @starting-style {
113
+ :host(:popover-open) {
114
+ opacity: 0;
115
+ transform: var(--entry-transform);
116
+ }
117
+ }
118
+
119
+ /* ----------- */
120
+
121
+ :host(:not([popover="manual"]):popover-open)::backdrop {
122
+ animation: flash 0.3s ease-in;
123
+ animation-iteration-count: 3;
124
+ }
125
+
126
+ :host([popover="manual"])::backdrop {
127
+ /* Transition */
128
+ transition:
129
+ display 0.2s allow-discrete,
130
+ overlay 0.2s allow-discrete,
131
+ backdrop-filter 0.2s;
132
+ }
133
+
134
+ :host([popover="manual"]:popover-open)::backdrop {
135
+ backdrop-filter: blur(3px);
136
+ }
137
+
138
+ @starting-style {
139
+ :host([popover="manual"]:popover-open)::backdrop {
140
+ backdrop-filter: none;
141
+ }
142
+ }
143
+
144
+ :host([popover="manual"]:popover-open)::before {
145
+ position: fixed;
146
+ inset: 0;
147
+ display: block;
148
+ content: "";
149
+ z-index: -1;
150
+ }
151
+
152
+ .icon {
153
+ display: none;
154
+ opacity: 0.6;
155
+ }
156
+
157
+ :host([type="info"]) .icon._info,
158
+ :host([type="success"]) .icon._success,
159
+ :host([type="error"]) .icon._error,
160
+ :host([type="warning"]) .icon._warning {
161
+ display: block;
162
+ }
163
+
164
+ :host([type="info"]) .container {
165
+ color: var(--color-info);
166
+ }
167
+
168
+ :host([type="success"]) .container {
169
+ color: var(--color-success);
170
+ }
171
+
172
+ :host([type="error"]) .container {
173
+ color: var(--color-error);
174
+ }
175
+
176
+ :host([type="warning"]) .container {
177
+ color: var(--color-warning);
178
+ }
179
+
180
+ .close-button {
181
+ padding-inline: 0;
182
+ display: flex;
183
+ align-items: center;
184
+ justify-content: center;
185
+ appearance: none;
186
+ font-size: inherit;
187
+ color: gray;
188
+ cursor: pointer;
189
+ border: none;
190
+ background: none;
191
+ transform: translateX(0.1rem);
192
+ }
193
+
194
+ :host(:not([popover="manual"])) .close-button {
195
+ display: none;
196
+ }
197
+
198
+ .close-button:hover {
199
+ opacity: 0.8;
200
+ }
201
+
202
+ /* ----------- */
203
+
204
+ :host(:not(._top)) wq-toast {
205
+ position-anchor: --container;
206
+ bottom: calc(anchor(bottom) - 0.5rem);
207
+ }
208
+
209
+ :host(:not(._top)) wq-toast:hover,
210
+ :host(:not(._top)) .container:hover ~ wq-toast {
211
+ bottom: calc(anchor(top) - 0.75rem);
212
+ transition-delay: 0;
213
+ }
214
+
215
+ :host(._top) wq-toast {
216
+ position-anchor: --container;
217
+ top: calc(anchor(top) - 0.5rem);
218
+ }
219
+
220
+ :host(._top) wq-toast:hover,
221
+ :host(._top) .container:hover ~ wq-toast {
222
+ top: calc(anchor(bottom) - 0.75rem);
223
+ transition-delay: 0;
224
+ }
225
+
226
+ ${this.css}
227
+ </style>`,this.#e()}},d=class extends Event{#t;get ratio(){return this.#t}constructor(t){super("minmax"),this.#t=t}},c=class extends l{static get events(){return super.events.concat(["minmax"])}static get observedAttributes(){return super.observedAttributes.concat(["class"])}get delegatesFocus(){return!1}set type(t){[void 0,null].includes(t)?this.removeAttribute("type"):this.setAttribute("type",t)}get type(){return this.getAttribute("type")}get headerBoxHTML(){return""}get headerHTML(){return""}get headerExtendedHTML(){return""}get mainHTML(){return""}get contentHTML(){return""}get footerHTML(){return""}get css(){return""}#t;#e;#o;#i;#n;#l;updateScrollViewDimensions(){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let t,e,o=this.classList.contains("_swipe-dismiss"),r=!!window.getComputedStyle(this).getPropertyValue("--modal-minmax-length");(o||r)&&requestAnimationFrame(()=>{let i=0,a=0;this.matches("._left._horz, ._top:not(._horz)")?this.#t.scrollTo({top:a,left:i}):(this.classList.contains("_horz")?(t=this.#t.offsetWidth,i=t-this.#o.offsetWidth):(e=this.#t.offsetHeight,a=e-this.#o.offsetHeight),(this.#t.scrollTop<a||this.#t.scrollLeft<i)&&this.#t.scrollTo({top:a,left:i}))}),this.#t.style.setProperty("--header-box-height",this.#n.offsetHeight+"px"),this.#t.style.setProperty("--header-max-height",this.#i.offsetHeight+"px"),this.#t.style.setProperty("--footer-max-height",this.#l.offsetHeight+"px"),!this.classList.contains("_container")&&(t===void 0&&(t=this.#t.offsetWidth),e===void 0&&(e=this.#t.offsetHeight),this.#t.style.setProperty("--view-width",t+"px"),this.#t.style.setProperty("--view-height",e+"px"))})})}#a=null;bindMinmaxWorker(){let t=this.classList.contains("_swipe-dismiss"),e=this.classList.contains("_minmax-events");if(!t&&!e)return;let o={root:this.#t,threshold:[0,1]},r=new IntersectionObserver(i=>{if(!!this.#s)for(let a of i){if(a.target===this.#o){let f=new d(1-a.intersectionRatio);this.dispatchEvent(f)}a.target===this.#e&&a.isIntersecting&&a.intersectionRatio>=.8&&this.hidePopover()}},o);setTimeout(()=>{e&&r.observe(this.#o),t&&r.observe(this.#e)},200),this.#a=()=>r.disconnect()}#s=!1;#r;#c(){this.#s=!1;let t=()=>this.#s=!0;this.#t.addEventListener("scroll",t),this.updateScrollViewDimensions();let e=()=>this.updateScrollViewDimensions();window.addEventListener("resize",e),this.#r?.(),this.#r=()=>{window.removeEventListener("resize",e),this.#t.removeEventListener("scroll",t)}}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),t==="class"&&this.#c()}connectedCallback(){super.connectedCallback?.(),this.popover||(this.popover="manual"),this.hasAttribute("open")&&this.showPopover()}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.(),this.#r=null,this.#a?.(),this.#a=null}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:this.delegatesFocus}),this.addEventListener("toggle",t=>{t.newState==="open"?(this.#c(),this.bindMinmaxWorker()):t.newState==="closed"&&(this.#r?.(),this.#r=null,this.#a?.(),this.#a=null)}),this.shadowRoot.innerHTML=`
228
+ <div class="spacing"></div>
229
+ <div class="view" part="view">
230
+
231
+ <div class="sentinel"></div>
232
+ <div class="spacing"></div>
233
+
234
+ <div class="container" part="container">
235
+ <header part="header">
236
+ <div class="header-box" part="header-box">
237
+ <slot
238
+ name="header-box"
239
+ onslotchange="this.classList.toggle('has-slotted', !!this.assignedElements().length); this.closest('.view').style.setProperty('--header-box-height', this.closest('.header-box').offsetHeight + 'px');"
240
+ >${this.headerBoxHTML}</slot>
241
+ </div>
242
+
243
+ <div class="header-bar" part="header-bar">
244
+ <div class="header-left">
245
+ <svg class="icon _info" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M444-296h72v-228h-72v228Zm36-312q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm0 528q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
246
+ <svg class="icon _success" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M390-298 246-442l72-72 72 72 252-252 72 72-324 324Zm90 218q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
247
+ <svg class="icon _error" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-292q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm-36-156h72v-240h-72v240Zm36 368q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
248
+ <svg class="icon _warning" xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-292q20 0 33-13t13-33q0-20-13-33t-33-13q-20 0-33 13t-13 33q0 20 13 33t33 13Zm-36-156h72v-240h-72v240Zm36 368q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Z"/></svg>
249
+ <div class="_content" style="flex-grow: 1">
250
+ <slot
251
+ name="header"
252
+ onslotchange="this.closest('.view').style.setProperty('--header-max-height', this.closest('header').offsetHeight + 'px');"
253
+ >${this.headerHTML}</slot>
254
+ </div>
255
+ </div>
256
+ <button class="close-button" part="close-button" onclick="this.getRootNode().host.hidePopover();">
257
+ <svg xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M256-176 176-256l224-224-224-224 80-80 224 224 224-224 80 80-224 224 224 224-80 80-224-224-224 224Z"/></svg>
258
+ </button>
259
+ </div>
260
+
261
+ ${this.headerExtendedHTML||`
262
+ <slot
263
+ name="header-extended"
264
+ onslotchange="this.closest('.view').style.setProperty('--header-max-height', this.closest('header').offsetHeight + 'px');"
265
+ ></slot>`}
266
+
267
+ </header>
268
+
269
+ <div class="scrollport-anchor">
270
+ <div class="scrollport">
271
+ <div class="scroll-fold scroll-fold-start" part="scroll-fold scroll-fold-start"></div>
272
+ <div class="scroll-fold scroll-fold-end" part="scroll-fold scroll-fold-end"></div>
273
+ <div class="scrollbar-track">
274
+ <div class="scrollbar-thumb"></div>
275
+ </div>
276
+ </div>
277
+ </div>
278
+
279
+ ${this.mainHTML||`<div class="main" part="main">${this.contentHTML||"<slot></slot>"}</div>`}
280
+
281
+ <footer part="footer">
282
+ <div class="footer-bar" part="footer-bar">
283
+ <slot
284
+ name="footer"
285
+ onslotchange="this.classList.toggle('has-slotted', !!this.assignedElements().length); this.closest('.view').style.setProperty('--footer-max-height', this.closest('footer').offsetHeight + 'px');"
286
+ >${this.footerHTML}</slot>
287
+ </div>
288
+ </footer>
289
+
290
+ </div>
291
+ </div>
292
+ <span class="spacing-b"></span>
293
+
294
+ <style>
295
+ * {
296
+ box-sizing: border-box;
297
+ }
298
+
299
+ @keyframes untransform {
300
+ to { transform: none; }
301
+ }
302
+
303
+ @keyframes transform-n {
304
+ to { transform: var(--transform); }
305
+ }
306
+
307
+ @keyframes appear {
308
+ from { opacity: 0; }
309
+ to { opacity: 1; }
310
+ }
311
+
312
+ @keyframes disappear {
313
+ from { opacity: 1; }
314
+ to { opacity: 0; }
315
+ }
316
+
317
+ @keyframes header-chrome {
318
+ from { background: var(--header-open-background); }
319
+ to { background: var(--header-background); }
320
+ }
321
+
322
+ @keyframes move-scrollbar-thumb {
323
+ from { transform: var(--scrollbar-thumb-start); }
324
+ to { transform: var(--scrollbar-thumb-length); }
325
+ }
326
+
327
+ @keyframes radius0 {
328
+ to { --wq-radius: 0; }
329
+ }
330
+
331
+ :host {
332
+ --wq-radius: var(--modal-radius, 1rem);
333
+ --aero-blur: var(--modal-aero-blur, 10px);
334
+ --background: var(--modal-background, rgba(80, 80, 80, 1));
335
+
336
+ --color-default: var(--modal-color-default, whitesmoke);
337
+ --color-info: var(--modal-color-info, whitesmoke);
338
+ --color-success: var(--modal-color-success, whitesmoke);
339
+ --color-error: var(--modal-color-error, whitesmoke);
340
+ --color-warning: var(--modal-color-warning, whitesmoke);
341
+
342
+ --header-color-default: var(--modal-header-color-default, var(--color-default));
343
+ --header-color-info: var(--modal-header-color-info, skyblue);
344
+ --header-color-success: var(--modal-header-color-success, lightgreen);
345
+ --header-color-error: var(--modal-header-color-error, coral);
346
+ --header-background: var(--modal-header-background, var(--background));
347
+
348
+ --header-open-background: var(--modal-header-open-background, var(--header-background));
349
+
350
+ --footer-color-default: var(--modal-footer-color-default, var(--color-default));
351
+ --footer-color-info: var(--modal-footer-color-info, skyblue);
352
+ --footer-color-success: var(--modal-footer-color-success, lightgreen);
353
+ --footer-color-error: var(--modal-footer-color-error, coral);
354
+ --footer-background: var(--modal-footer-background, var(--background));
355
+
356
+ --expanse-length: var(--modal-expanse-length, 0px);
357
+ --minmax-length: var(--modal-minmax-length, 0px);
358
+
359
+ --scrollbar-thumb-color: var(--modal-scrollbar-thumb-color, black);
360
+ --scrollbar-thumb-width: var(--modal-scrollbar-thumb-width, 4px);
361
+ --scrollbar-thumb-height: var(--modal-scrollbar-thumb-height, 30px);
362
+
363
+ --translation: calc(var(--modal-translation, 50px) * var(--dir));
364
+ --exit-factor: var(--modal-exit-factor, -1);
365
+ }
366
+
367
+ /* -------- internal, dynamic props (root) -------- */
368
+
369
+ :host {
370
+ --dir: 1;
371
+ --entry-transform: translateY(var(--translation));
372
+ --exit-transform: translateY(calc(var(--translation) * var(--exit-factor)));
373
+ }
374
+
375
+ :host(._swipe-dismiss) .view {
376
+ --swipe-dismiss-length: var(--modal-swipe-dismiss-length, calc(var(--view-height) - var(--minmax-length)));
377
+ }
378
+
379
+ :host(._horz._swipe-dismiss) .view {
380
+ --swipe-dismiss-length: var(--modal-swipe-dismiss-length, calc(var(--view-width) - var(--minmax-length)));
381
+ }
382
+
383
+ /* transform reversal */
384
+
385
+ :host(:is(._top, ._left)) { --dir: -1; }
386
+
387
+ /* horizontal axis */
388
+
389
+ :host(:is(._left, ._right, ._horz)) {
390
+ --entry-transform: translateX(var(--translation));
391
+ --exit-transform: translateX(calc(var(--translation) * var(--exit-factor)));
392
+ }
393
+
394
+ :host(._edge-tight) { --exit-factor: var(--modal-exit-factor, 1); }
395
+
396
+ /* -------- internal, dynamic props (view) -------- */
397
+
398
+ .view {
399
+ --header-max-height: 1.6rem;
400
+ --header-box-height: 0px;
401
+ --footer-max-height: 0px;
402
+
403
+ --header-min-height: calc(var(--header-max-height) - var(--header-box-height));
404
+ --footer-min-height: var(--footer-max-height);
405
+
406
+ --view-inner-height: calc(var(--view-height) - var(--header-min-height) - var(--footer-min-height));
407
+ --total-minmax-length: var(--minmax-length);
408
+
409
+ --y-scroll-effect-exclude: var(--total-minmax-length);
410
+ --scrollbar-appear-range: calc(var(--total-minmax-length) - 25px) var(--total-minmax-length);
411
+
412
+ --scrollbar-progress-range-start: calc(var(--total-minmax-length) + var(--header-box-height));
413
+ --scrollbar-progress-range-end: 100%;
414
+ --scrollbar-progress-range: var(--scrollbar-progress-range-start) var(--scrollbar-progress-range-end);
415
+
416
+ --scroll-snap-start: start;
417
+ --scroll-snap-end: end;
418
+
419
+ --radius-top-left: var(--wq-radius);
420
+ --radius-top-right: var(--wq-radius);
421
+ --radius-bottom-left: var(--wq-radius);
422
+ --radius-bottom-right: var(--wq-radius);
423
+ }
424
+
425
+ :host(._container) .view {
426
+ --view-height: calc(100cqh - var(--expanse-length));
427
+ --view-width: 100cqw;
428
+ }
429
+
430
+ :host(._container._horz) .view {
431
+ --view-height: 100cqh;
432
+ --view-width: calc(100cqw - var(--expanse-length));
433
+ }
434
+
435
+ :host(._swipe-dismiss:not(._horz)) .view {
436
+ --total-minmax-length: var(--view-height);
437
+ }
438
+
439
+ :host(._swipe-dismiss._horz) .view {
440
+ --total-minmax-length: var(--view-width);
441
+ }
442
+
443
+ /* transform reversal */
444
+
445
+ :host(:is(._top:not(._horz), ._left._horz)) .view {
446
+ --scroll-snap-start: end;
447
+ --scroll-snap-end: start;
448
+
449
+ --y-scroll-effect-exclude: 0px;
450
+ --scrollbar-appear-range: -25px 0;
451
+ }
452
+
453
+ :host(._top:not(._horz)) .view {
454
+ --scrollbar-progress-range-start: var(--header-box-height);
455
+ --scrollbar-progress-range-end: calc(100% - var(--total-minmax-length));
456
+ }
457
+
458
+ :host(._left._horz) .view {
459
+ --scrollbar-progress-range-start: 0;
460
+ --scrollbar-progress-range-end: calc(100% - var(--total-minmax-length));
461
+ }
462
+
463
+ /* curves */
464
+
465
+ :host(._top._edge-tight) .view {
466
+ --radius-top-left: 0px;
467
+ --radius-top-right: 0px;
468
+ }
469
+
470
+ :host(._bottom._edge-tight) .view {
471
+ --radius-bottom-left: 0px;
472
+ --radius-bottom-right: 0px;
473
+ }
474
+
475
+ :host(._left._edge-tight) .view {
476
+ --radius-top-left: 0px;
477
+ --radius-bottom-left: 0px;
478
+ }
479
+
480
+ :host(._right._edge-tight) .view {
481
+ --radius-top-right: 0px;
482
+ --radius-bottom-right: 0px;
483
+ }
484
+
485
+ /* --------- actual styling -------- */
486
+
487
+ :host {
488
+ background: none;
489
+ border: none;
490
+ padding: 0;
491
+
492
+ max-height: 100vh;
493
+ max-width: 100vw;
494
+
495
+ /* Transition */
496
+ transition:
497
+ opacity 0.2s,
498
+ transform 0.2s,
499
+ overlay 0.2s allow-discrete,
500
+ display 0.2s allow-discrete;
501
+ transition-timing-function: ease-out;
502
+
503
+ /* Exit state */
504
+ transform: var(--exit-transform);
505
+ opacity: 0;
506
+ }
507
+
508
+ :host(:not(._horz, ._left, ._right, ._top, ._bottom)) {
509
+ max-width: 800px;
510
+ }
511
+
512
+ /* edge alignment */
513
+
514
+ :host(._top) { margin-top: 0; }
515
+ :host(._bottom) { margin-bottom: 0; }
516
+ :host(._left) { margin-left: 0; }
517
+ :host(._right) { margin-right: 0; }
518
+
519
+ /* flex orientation */
520
+
521
+ :host,
522
+ .view {
523
+ flex-direction: column;
524
+ align-items: stretch;
525
+ }
526
+
527
+ :host(._horz),
528
+ :host(._horz) .view {
529
+ flex-direction: row;
530
+ }
531
+
532
+ :host(:is(._top:not(._horz), ._left._horz)) .view,
533
+ :host(:is(._top:not(._horz), ._left._horz)) .view .container {
534
+ order: -1;
535
+ }
536
+
537
+ :host(:is(._top:not(._horz), ._left._horz)) .view .sentinel {
538
+ order: 1000;
539
+ }
540
+
541
+ /* spacing */
542
+
543
+ :host>.spacing,
544
+ .view>.spacing,
545
+ .view>.sentinel {
546
+ position: relative;
547
+ display: block;
548
+ flex-shrink: 0;
549
+ }
550
+
551
+ :host(:not(._horz))>.spacing { height: var(--expanse-length); }
552
+ :host(:not(._horz, ._top, ._bottom))>:is(.spacing, .spacing-b) {
553
+ height: calc(var(--expanse-length) / 2);
554
+ flex-shrink: 0;
555
+ }
556
+
557
+ :host(._horz)>.spacing { width: var(--expanse-length); }
558
+ :host(._horz:not(._left, ._right))>:is(.spacing, .spacing-b) {
559
+ width: calc(var(--expanse-length) / 2);
560
+ flex-shrink: 0;
561
+ }
562
+
563
+ :host(:not(._horz)) .view>.spacing { height: var(--minmax-length); }
564
+ :host(._horz) .view>.spacing { width: var(--minmax-length); }
565
+
566
+ :host(:not(._horz)) .view>.sentinel { height: var(--swipe-dismiss-length); }
567
+ :host(._horz) .view>.sentinel { width: var(--swipe-dismiss-length); }
568
+
569
+ /* ----------- */
570
+
571
+ .view {
572
+ position: relative;
573
+ flex-grow: 1;
574
+ display: flex;
575
+
576
+ pointer-events: none;
577
+
578
+ overflow-y: auto;
579
+ scrollbar-width: none;
580
+
581
+ border-top-left-radius: var(--radius-top-left);
582
+ border-top-right-radius: var(--radius-top-right);
583
+ border-bottom-left-radius: var(--radius-bottom-left);
584
+ border-bottom-right-radius: var(--radius-bottom-right);
585
+
586
+ scroll-timeline-name: --view-scroll;
587
+
588
+ animation-timing-function: linear;
589
+ animation-fill-mode: forwards;
590
+ animation-name: untransform;
591
+ animation-timeline: --view-scroll;
592
+
593
+ animation-range: 0 var(--total-minmax-length);
594
+ }
595
+
596
+ :host(:not(._horz, ._top, ._bottom, ._edge-tight._alt-edge-tight)) .view {
597
+ transform: translateY(calc(var(--total-minmax-length) / -2));
598
+ }
599
+
600
+ :host(._horz:not(._left, ._right, ._edge-tight._alt-edge-tight)) .view {
601
+ transform: translateX(calc(var(--total-minmax-length) / -2));
602
+ }
603
+
604
+ :host(._edge-tight._alt-edge-tight) .view {
605
+ animation-timing-function: linear;
606
+ animation-fill-mode: forwards;
607
+ animation-name: radius0;
608
+ animation-timeline: --view-scroll;
609
+
610
+ animation-range: calc(var(--total-minmax-length) - var(--wq-radius)) var(--total-minmax-length);
611
+ }
612
+
613
+ :host(._horz) .view {
614
+ overflow-y: hidden;
615
+ overflow-x: auto;
616
+
617
+ scroll-timeline-axis: inline;
618
+ }
619
+
620
+ .view::-webkit-scrollbar { display: none; }
621
+
622
+ /* ----------- */
623
+
624
+ .container {
625
+ position: relative;
626
+ flex-grow: 1;
627
+
628
+ pointer-events: auto;
629
+
630
+ display: flex;
631
+ flex-direction: column;
632
+ }
633
+
634
+ :host(._swipe-dismiss-fadeout) .container {
635
+ animation-timing-function: linear;
636
+ animation-fill-mode: both;
637
+ animation-name: appear;
638
+ animation-timeline: --view-scroll;
639
+ animation-range: 0 var(--swipe-dismiss-length);
640
+ }
641
+
642
+ :host(._swipe-dismiss-fadeout:is(._top:not(._horz), ._left._horz)) .container {
643
+ animation-name: disappear;
644
+ animation-range: calc(100% - var(--swipe-dismiss-length)) 100%;
645
+ }
646
+
647
+ /* ------------ */
648
+
649
+ header {
650
+ position: sticky;
651
+ top: calc(var(--header-box-height) * -1);
652
+ z-index: 2;
653
+
654
+ display: flex;
655
+ flex-direction: column;
656
+
657
+ color: var(--header-color-default);
658
+ background: var(--header-background);
659
+
660
+ border-top-left-radius: var(--radius-top-left);
661
+ border-top-right-radius: var(--radius-top-right);
662
+
663
+ order: 1;
664
+ }
665
+
666
+ :host(:not(._horz)) header {
667
+ animation-timing-function: linear;
668
+ animation-fill-mode: both;
669
+ animation-name: header-chrome;
670
+ animation-timeline: --view-scroll;
671
+ animation-range: var(--y-scroll-effect-exclude) calc(var(--y-scroll-effect-exclude) + var(--header-box-height));
672
+ }
673
+
674
+ :host(._aero) :is(header, .main, footer) {
675
+ backdrop-filter: blur(var(--aero-blur));
676
+ }
677
+
678
+ .header-box {
679
+ position: relative;
680
+
681
+ display: flex;
682
+ align-items: center;
683
+ justify-content: center;
684
+
685
+ --transform: translateY(35%);
686
+
687
+ animation-timing-function: linear;
688
+ animation-fill-mode: forwards;
689
+ animation-name: disappear, transform-n;
690
+ animation-timeline: --view-scroll;
691
+ animation-range: var(--y-scroll-effect-exclude) calc(var(--y-scroll-effect-exclude) + (var(--header-box-height) / 2));
692
+ }
693
+
694
+ :host(._horz) .header-box {
695
+ display: none;
696
+ }
697
+
698
+ .header-bar {
699
+ position: relative;
700
+ z-index: 1;
701
+
702
+ display: flex;
703
+ align-items: start;
704
+ justify-content: space-between;
705
+ }
706
+
707
+ .header-bar {
708
+ gap: 0.6rem;
709
+ padding-block: 0.8rem;
710
+ padding-inline: 1.2rem;
711
+ }
712
+
713
+ .header-left {
714
+ display: flex;
715
+ align-items: start;
716
+ gap: 0.6rem;
717
+
718
+ opacity: 0;
719
+
720
+ animation-timing-function: linear;
721
+ animation-fill-mode: forwards;
722
+ animation-name: appear;
723
+ animation-timeline: --view-scroll;
724
+ animation-range: calc(var(--y-scroll-effect-exclude) + (var(--header-box-height) / 2)) calc(var(--y-scroll-effect-exclude) + var(--header-box-height));
725
+ }
726
+
727
+ :host(._horz) .header-left,
728
+ header:not(:has(slot[name="header-box"]:is(.has-slotted, :not(:empty)))) .header-left {
729
+ opacity: 1;
730
+ }
731
+
732
+ :host([type="info"]) header {
733
+ color: var(--header-color-info);
734
+ }
735
+
736
+ :host([type="success"]) header {
737
+ color: var(--header-color-success);
738
+ }
739
+
740
+ :host([type="error"]) header {
741
+ color: var(--header-color-error);
742
+ }
743
+
744
+ /* ----------- */
745
+
746
+ footer {
747
+ position: sticky;
748
+ bottom: 0;
749
+ z-index: 1;
750
+
751
+ border-bottom-left-radius: var(--radius-bottom-left);
752
+ border-bottom-right-radius: var(--radius-bottom-right);
753
+
754
+ color: var(--footer-color-default);
755
+ background: var(--footer-background);
756
+
757
+ order: 5;
758
+ }
759
+
760
+ :host([type="info"]) footer {
761
+ color: var(--footer-color-info);
762
+ }
763
+
764
+ :host([type="success"]) footer {
765
+ color: var(--footer-color-success);
766
+ }
767
+
768
+ :host([type="error"]) footer {
769
+ color: var(--footer-color-error);
770
+ }
771
+
772
+ /* ------------ */
773
+
774
+ footer .footer-bar {
775
+ position: sticky;
776
+ left: 0;
777
+ right: 0;
778
+ }
779
+
780
+ /* ----------- */
781
+
782
+ .view {
783
+ scroll-snap-type: y mandatory;
784
+ }
785
+
786
+ :host(._horz) .view {
787
+ scroll-snap-type: x mandatory;
788
+ }
789
+
790
+ .view>.spacing,
791
+ .view>.sentinel {
792
+ scroll-snap-align: var(--scroll-snap-start);
793
+ }
794
+
795
+ .main {
796
+ flex-grow: 1;
797
+
798
+ min-width: var(--view-width);
799
+ min-height: var(--view-inner-height);
800
+
801
+ scroll-margin-top: var(--header-min-height);
802
+ scroll-margin-bottom: var(--footer-min-height);
803
+ scroll-snap-align: var(--scroll-snap-start);
804
+
805
+ order: 3;
806
+ }
807
+
808
+ :host(:is(._top, ._left._horz)) .main {
809
+ scroll-snap-align: none;
810
+ }
811
+
812
+ :host(:is(._top, ._left._horz)) .container {
813
+ scroll-snap-align: var(--scroll-snap-start);
814
+ }
815
+
816
+ header {
817
+ scroll-snap-align: start;
818
+ }
819
+
820
+ .header-bar {
821
+ scroll-snap-align: start;
822
+ }
823
+
824
+ /* ----------- */
825
+
826
+ .scrollport-anchor {
827
+ order: 2;
828
+
829
+ position: sticky;
830
+ top: var(--header-min-height);
831
+ bottom: var(--footer-min-height);
832
+ left: 0;
833
+ right: 0;
834
+ display: flex;
835
+ flex-direction: column;
836
+
837
+ height: 0;
838
+ width: var(--view-width);
839
+
840
+ z-index: 1;
841
+ }
842
+
843
+ :host(:is(._left._horz, ._top:not(._horz))) .scrollport-anchor {
844
+ justify-content: end;
845
+ order: 4;
846
+ }
847
+
848
+ .scrollport {
849
+ position: relative;
850
+
851
+ height: var(--view-inner-height);
852
+ width: var(--view-width);
853
+ flex-shrink: 0;
854
+
855
+ pointer-events: none;
856
+ }
857
+
858
+ :host(._top:not(._horz)) .scrollport {
859
+ height: calc(var(--view-inner-height) - var(--header-box-height));
860
+ }
861
+
862
+ /* -- scroll unfold -- */
863
+
864
+ :host(._scroll-unfold) .scrollport {
865
+ display: flex;
866
+ flex-direction: column;
867
+ justify-content: space-between;
868
+ align-items: stretch;
869
+ }
870
+
871
+ :host(._scroll-unfold._horz) .scrollport {
872
+ flex-direction: row;
873
+ }
874
+
875
+ :host(._scroll-unfold) .scrollport .scroll-fold {
876
+ position: sticky;
877
+ opacity: 0;
878
+
879
+ background: var(--background);
880
+
881
+ mask-repeat: no-repeat;
882
+ mask-size: 100% 100%;
883
+
884
+ animation-timing-function: linear;
885
+ animation-fill-mode: forwards;
886
+ animation-name: appear;
887
+ animation-timeline: --view-scroll;
888
+
889
+ animation-range-start: var(--scrollbar-progress-range-start);
890
+ animation-range-end: calc(var(--scrollbar-progress-range-end) + 1px);
891
+ }
892
+
893
+ :host(._scroll-unfold) .scrollport .scroll-fold-end {
894
+ animation-range-start: calc(var(--scrollbar-progress-range-start) - 1px);
895
+ animation-range-end: var(--scrollbar-progress-range-end);
896
+ }
897
+
898
+ :host(._scroll-unfold:not(._horz)) .scrollport .scroll-fold {
899
+ top: var(--header-min-height);
900
+ height: 25%;
901
+
902
+ mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
903
+ -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
904
+ }
905
+
906
+ :host(._scroll-unfold:not(._horz)) .scrollport .scroll-fold-end {
907
+ bottom: var(--footer-min-height);
908
+ top: auto;
909
+ opacity: 1;
910
+ animation-name: disappear;
911
+ transform: scaleY(-1);
912
+ }
913
+
914
+ :host(._scroll-unfold._horz) .scrollport .scroll-fold {
915
+ left: 0;
916
+ width: 25%;
917
+
918
+ mask-image: linear-gradient(to right, black 0%, transparent 100%);
919
+ -webkit-mask-image: linear-gradient(to right, black 0%, transparent 100%);
920
+ }
921
+
922
+ :host(._scroll-unfold._horz) .scrollport .scroll-fold-end {
923
+ right: 0;
924
+ left: auto;
925
+ opacity: 1;
926
+ animation-name: disappear;
927
+ transform: scaleX(-1);
928
+ }
929
+
930
+ /* -- scrollbar -- */
931
+
932
+ :host(._scrollbars) .scrollbar-track {
933
+ position: absolute;
934
+ display: block;
935
+ overflow: hidden;
936
+
937
+ height: 100%;
938
+ top: 0;
939
+ right: 0;
940
+ padding-inline: 2px;
941
+
942
+ opacity: 0;
943
+
944
+ animation: appear linear;
945
+ animation-timeline: --view-scroll;
946
+ animation-range: var(--scrollbar-appear-range);
947
+ animation-fill-mode: forwards;
948
+ }
949
+
950
+ :host(._scrollbars._horz) .scrollbar-track {
951
+ height: unset;
952
+ width: 100%;
953
+ top: auto;
954
+ bottom: 0;
955
+ padding-inline: 0;
956
+ padding-block: 2px;
957
+ }
958
+
959
+ :host(._scrollbars) .scrollbar-thumb {
960
+ width: var(--scrollbar-thumb-width);
961
+ height: var(--scrollbar-thumb-height);
962
+ background: var(--scrollbar-thumb-color);
963
+ border-radius: 10px;
964
+
965
+ --scrollbar-thumb-start: translateY(0);
966
+ --scrollbar-thumb-length: translateY(calc(var(--view-inner-height) - 100%));
967
+
968
+ animation: move-scrollbar-thumb linear both;
969
+ animation-timeline: --view-scroll;
970
+ animation-range: var(--scrollbar-progress-range);
971
+ }
972
+
973
+ :host(._scrollbars._horz) .scrollbar-thumb {
974
+ height: var(--scrollbar-thumb-width);
975
+ width: var(--scrollbar-thumb-height);
976
+
977
+ --scrollbar-thumb-start: translateX(0);
978
+ --scrollbar-thumb-length: translateX(calc(var(--view-width) - 100%));
979
+ }
980
+
981
+ /* ----------- */
982
+
983
+ :host(:popover-open) {
984
+ display: flex;
985
+ opacity: 1;
986
+ transform: none;
987
+ }
988
+
989
+ @starting-style {
990
+ :host(:popover-open) {
991
+ opacity: 0;
992
+ transform: var(--entry-transform);
993
+ }
994
+ }
995
+
996
+ /* ----------- */
997
+
998
+ :host::backdrop {
999
+ /* Transition */
1000
+ transition:
1001
+ display 0.2s allow-discrete,
1002
+ overlay 0.2s allow-discrete,
1003
+ backdrop-filter 0.2s;
1004
+ }
1005
+
1006
+ :host(._swipe-dismiss._container) {
1007
+ timeline-scope: --view-scroll;
1008
+ }
1009
+
1010
+ :host(._swipe-dismiss._container)::backdrop {
1011
+ opacity: 0;
1012
+
1013
+ animation-timing-function: linear;
1014
+ animation-fill-mode: forwards;
1015
+ animation-name: appear;
1016
+ animation-timeline: --view-scroll;
1017
+
1018
+ animation-range: 0 calc(100cqh - var(--expanse-length) - var(--minmax-length));
1019
+ }
1020
+
1021
+ :host(._swipe-dismiss._container._horz)::backdrop {
1022
+ animation-range: 0 calc(100cqw - var(--expanse-length) - var(--minmax-length));
1023
+ }
1024
+
1025
+ :host(._swipe-dismiss._container._top:not(._horz))::backdrop,
1026
+ :host(._swipe-dismiss._container._left._horz)::backdrop {
1027
+ opacity: 1;
1028
+ animation-name: disappear;
1029
+ }
1030
+
1031
+ :host(._swipe-dismiss._container._top:not(._horz))::backdrop {
1032
+ animation-range: calc(100% - (100cqh - var(--expanse-length) - var(--minmax-length))) 100%;
1033
+ }
1034
+
1035
+ :host(._swipe-dismiss._container._left._horz)::backdrop {
1036
+ animation-range: calc(100% - (100cqw - var(--expanse-length) - var(--minmax-length))) 100%;
1037
+ }
1038
+
1039
+ :host(:popover-open)::backdrop {
1040
+ backdrop-filter: blur(3px);
1041
+ }
1042
+
1043
+ :host(:not([popover="manual"]):popover-open)::backdrop {
1044
+ backdrop-filter: blur(0px);
1045
+ }
1046
+
1047
+ @starting-style {
1048
+ :host(:popover-open)::backdrop {
1049
+ backdrop-filter: none;
1050
+ }
1051
+ }
1052
+
1053
+ :host(:popover-open)::before {
1054
+ position: fixed;
1055
+ inset: 0;
1056
+ display: block;
1057
+ content: "";
1058
+ z-index: -1;
1059
+ }
1060
+
1061
+ .icon {
1062
+ display: none;
1063
+ opacity: 0.6;
1064
+ }
1065
+
1066
+ :host([type="info"]) .icon._info,
1067
+ :host([type="success"]) .icon._success,
1068
+ :host([type="error"]) .icon._error,
1069
+ :host([type="warning"]) .icon._warning {
1070
+ display: block;
1071
+ }
1072
+
1073
+ :host([type="info"]) .container {
1074
+ color: var(--color-info);
1075
+ }
1076
+
1077
+ :host([type="success"]) .container {
1078
+ color: var(--color-success);
1079
+ }
1080
+
1081
+ :host([type="error"]) .container {
1082
+ color: var(--color-error);
1083
+ }
1084
+
1085
+ :host([type="warning"]) .container {
1086
+ color: var(--color-warning);
1087
+ }
1088
+
1089
+ .main {
1090
+ color: var(--color-default);
1091
+ background: var(--background);
1092
+ }
1093
+
1094
+ .view:not(:has(footer slot:is(.has-slotted, :not(:empty)))) .main {
1095
+ border-bottom-left-radius: var(--radius-bottom-left);
1096
+ border-bottom-right-radius: var(--radius-bottom-right);
1097
+ }
1098
+
1099
+ .close-button {
1100
+ padding-inline: 0;
1101
+ display: flex;
1102
+ align-items: center;
1103
+ justify-content: center;
1104
+ appearance: none;
1105
+ font-size: inherit;
1106
+ color: gray;
1107
+ cursor: pointer;
1108
+ border: none;
1109
+ background: none;
1110
+ }
1111
+
1112
+ :host(:not([popover="manual"])) {
1113
+ pointer-events: none;
1114
+ }
1115
+
1116
+ :host(:not([popover="manual"])) .close-button {
1117
+ display: none;
1118
+ }
1119
+
1120
+ .close-button:hover {
1121
+ opacity: 0.8;
1122
+ }
1123
+
1124
+ :host(._horz) :is(.header-left, .close-button) {
1125
+ position: sticky;
1126
+ left: 1.2rem;
1127
+ right: 1.2rem;
1128
+ }
1129
+
1130
+ ${this.css}
1131
+ </style>
1132
+ `,this.#t=this.shadowRoot.querySelector(".view"),this.#e=this.#t.querySelector(".sentinel"),this.#o=this.#t.querySelector(".spacing"),this.#i=this.#t.querySelector("header"),this.#n=this.#t.querySelector(".header-box"),this.#l=this.#t.querySelector("footer")}},p=class extends Event{#t;get data(){return this.#t}constructor(t){super("response"),this.#t=t}},n=class extends c{static get events(){return super.events.concat(["response"])}get delegatesFocus(){return!0}hidePopover(){this.respondWith(null)}respondWith(t){let e=new p(t);super.hidePopover(),this.dispatchEvent(e)}respondWithData(){let t=this.querySelector("form")||this.shadowRoot.querySelector("form");this.respondWith(t)}render(t={}){this.type=t.type;let e=[t.message];t.actions?.[0]&&e.push(`<span slot="action-0">${t.actions[0]}</span>`),t.actions?.[1]&&e.push(`<span slot="action-1">${t.actions[1]}</span>`),this.innerHTML=e.join(`
1133
+ `)}get actionTexts(){return["Cancel","Submit"]}get footerHTML(){return`
1134
+ <button
1135
+ part="action-0"
1136
+ class="action _secondary"
1137
+ onclick="this.getRootNode().host.hidePopover()">
1138
+ <svg xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M256-176 176-256l224-224-224-224 80-80 224 224 224-224 80 80-224 224 224 224-80 80-224-224-224 224Z"/></svg>
1139
+ <slot name="action-0" onslotchange="this.classList.toggle('has-slotted', !!this.assignedElements().length);">${this.actionTexts[0]}</slot>
1140
+ </button>
1141
+
1142
+ <button
1143
+ part="action-1"
1144
+ class="action _primary"
1145
+ onclick="this.getRootNode().host.respondWithData()">
1146
+ <svg xmlns="http://www.w3.org/2000/svg" height="1.4em" width="1.4em" viewBox="0 -960 960 960" fill="currentColor"><path d="M369-222 128-463l84-84 157 157 379-379 84 84-463 463Z"/></svg>
1147
+ <slot name="action-1" onslotchange="this.classList.toggle('has-slotted', !!this.assignedElements().length);">${this.actionTexts[1]}</slot>
1148
+ </button>
1149
+ `}get css(){return super.css+`
1150
+ :host {
1151
+ --primary-button-color: var(--dialog-primary-button-color, black);
1152
+ --primary-button-background: var(--dialog-primary-button-background, white);
1153
+ --secondary-button-color: var(--dialog-secondary-button-color, white);
1154
+ --secondary-button-background: var(--dialog-secondary-button-background, black);
1155
+ --button-radius: var(--dialog-button-radius, 10px);
1156
+ }
1157
+
1158
+ .main {
1159
+ flex-shrink: 0;
1160
+ display: flex;
1161
+ flex-direction: column;
1162
+ gap: 1rem;
1163
+ padding: 1rem;
1164
+ }
1165
+
1166
+ .footer-bar {
1167
+ display: flex;
1168
+ align-items: center;
1169
+ gap: 0.5rem;
1170
+ padding: 1rem;
1171
+ }
1172
+
1173
+ button.action {
1174
+ whitespace: nowrap;
1175
+ display: flex;
1176
+ align-items: center;
1177
+ justify-content: center;
1178
+ gap: 0.5rem;
1179
+ border: none;
1180
+ border-radius: var(--button-radius);
1181
+ padding: 0.5rem 1rem;
1182
+ cursor: pointer;
1183
+ transition: all 0.2s;
1184
+ font-size: inherit;
1185
+ font-weight: bold;
1186
+ flex-grow: 1;
1187
+ }
1188
+
1189
+ button.action:hover {
1190
+ opacity: 0.8;
1191
+ }
1192
+
1193
+ button.action:is(:focus, :active, .active) {
1194
+ outline: none;
1195
+ box-shadow: none;
1196
+ opacity: 0.5;
1197
+ }
1198
+
1199
+ button.action._primary {
1200
+ background-color: var(--primary-button-background);
1201
+ color: var(--primary-button-color);
1202
+ }
1203
+
1204
+ button.action._secondary {
1205
+ background-color: var(--secondary-button-background);
1206
+ color: var(--secondary-button-color);
1207
+ }
1208
+
1209
+ button.action:not(:has(slot:is(.has-slotted, :not(:empty)))) {
1210
+ display: none;
1211
+ }
1212
+ `}},m=class extends n{static get observedAttributes(){return super.observedAttributes.concat(["value","placeholder"])}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o);let r=this.shadowRoot.querySelector("input");t==="value"&&(r.value=o),t==="placeholder"&&(r.placeholder=o)}set placeholder(t){[void 0,null].includes(t)?this.removeAttribute("placeholder"):this.setAttribute("placeholder",t)}get placeholder(){return this.getAttribute("placeholder")}set value(t){[void 0,null].includes(t)?this.removeAttribute("value"):this.setAttribute("value",t)}get value(){return this.getAttribute("value")}respondWithData(){let t=this.shadowRoot.querySelector("input").value;this.respondWith(t)}render(t={}){this.value=t.value,this.placeholder=t.placeholder,super.render(t)}get mainHTML(){return`
1213
+ <form class="main" part="main" onsubmit="this.getRootNode().host.respondWithData(); event.preventDefault();">
1214
+ <slot></slot>
1215
+ <slot name="input">
1216
+ <input part="input" type="text" autocomplete="off" autofocus placeholder="Enter response">
1217
+ </slot>
1218
+ </form>
1219
+ `}get actionTexts(){return["Cancel","Submit"]}get css(){return super.css+`
1220
+ :host {
1221
+ --input-color: var(--prompt-input-color, inherit);
1222
+ --input-background: var(--prompt-input-background, rgba(255, 255, 255, 0.2));
1223
+ --input-radius: var(--prompt-input-radius, 10px);
1224
+ }
1225
+
1226
+ input {
1227
+ width: 100%;
1228
+ border: none;
1229
+ border-radius: var(--input-radius);
1230
+ padding: 0.6rem 1rem;
1231
+ color: var(--input-color);
1232
+ background-color: var(--input-background);
1233
+ }
1234
+
1235
+ input::placeholder {
1236
+ color: currentColor;
1237
+ }
1238
+ `}},g=class extends n{get actionTexts(){return["No","Yes"]}respondWith(t){super.respondWith(!!t)}respondWithData(){super.respondWith(!0)}},v=class extends n{get actionTexts(){return["","Got it"]}};function u(){try{CSS.registerProperty({name:"--wq-radius",syntax:"<length-percentage>",inherits:!0,initialValue:"0"})}catch{}customElements.define("wq-toast",h),customElements.define("wq-modal",c),customElements.define("wq-dialog",n),customElements.define("wq-prompt",m),customElements.define("wq-confirm",g),customElements.define("wq-alert",v)}u();})();
1239
+ //# sourceMappingURL=elements.src.build.js.map