@fluid-topics/ft-reader-feedback 1.0.57 → 1.0.59
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/build/ft-reader-feedback.d.ts +3 -2
- package/build/ft-reader-feedback.js +37 -32
- package/build/ft-reader-feedback.light.js +349 -340
- package/build/ft-reader-feedback.min.js +393 -384
- package/build/ft-reader-map-feedback.d.ts +2 -2
- package/build/ft-reader-map-feedback.js +12 -15
- package/build/ft-reader-topic-feedback.d.ts +2 -2
- package/build/ft-reader-topic-feedback.js +12 -14
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,
|
|
1
|
+
!function(t,i,e,o,s,n,r){var a;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(a||(a={}));var l=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class h extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const d=Symbol("registerInterval");class c extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[d]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[d]):this.dispatchEvent(new h)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=d,l([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}const f=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),p={color:f,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",f),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:i.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},u=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),v=u,g=i.FtCssVariableFactory.extend("--ft-ripple-background-color",u),b=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),x=b,y=i.FtCssVariableFactory.extend("--ft-ripple-background-color",b),m=e.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
13
13
|
overflow: hidden;
|
|
14
|
-
border-radius: ${
|
|
14
|
+
border-radius: ${p.borderRadius};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.ft-ripple .ft-ripple--background,
|
|
@@ -45,27 +45,27 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ft-ripple .ft-ripple--background {
|
|
48
|
-
background-color: ${
|
|
48
|
+
background-color: ${p.backgroundColor};
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.ft-ripple .ft-ripple--effect {
|
|
52
|
-
background-color: ${
|
|
52
|
+
background-color: ${p.color};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
56
|
-
background-color: ${
|
|
56
|
+
background-color: ${y};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
60
|
-
background-color: ${
|
|
60
|
+
background-color: ${x};
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
64
|
-
background-color: ${
|
|
64
|
+
background-color: ${g};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
68
|
-
background-color: ${
|
|
68
|
+
background-color: ${v};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.ft-ripple .ft-ripple--background {
|
|
@@ -95,32 +95,23 @@
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
98
|
-
opacity: ${
|
|
98
|
+
opacity: ${p.opacityContentOnSurfaceHover};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
102
|
-
opacity: ${
|
|
102
|
+
opacity: ${p.opacityContentOnSurfaceSelected};
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
106
|
-
opacity: ${
|
|
106
|
+
opacity: ${p.opacityContentOnSurfaceFocused};
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
110
|
-
opacity: ${
|
|
110
|
+
opacity: ${p.opacityContentOnSurfacePressed};
|
|
111
111
|
transform: translate(-50%, -50%) scale(1);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
`,$=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),w=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),k={fontFamily:w,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},S={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-title-font-family",$),fontSize:i.FtCssVariableFactory.extend("--ft-typography-title-font-size",k.fontSize,"20px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",k.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",k.letterSpacing,"0.15px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-title-line-height",k.lineHeight,"1.2"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",k.textTransform,"inherit")},_={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",$),fontSize:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",k.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",k.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",k.letterSpacing,"0.105px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",k.lineHeight,"1.7"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",k.textTransform,"inherit")},T=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",w),E=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",k.fontSize,"16px"),I=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",k.fontWeight,"600"),R=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",k.letterSpacing,"0.144px"),C=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",k.lineHeight,"1.5"),A=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",k.textTransform,"inherit"),O=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",w),N=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",k.fontSize,"14px"),U=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",k.fontWeight,"normal"),D=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",k.letterSpacing,"0.098px"),z=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",k.lineHeight,"1.7"),M=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",k.textTransform,"inherit"),B={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",w),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",k.fontSize,"16px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",k.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",k.letterSpacing,"0.496px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",k.lineHeight,"1.5"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",k.textTransform,"inherit")},P=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",w),L=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",k.fontSize,"14px"),F=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",k.fontWeight,"normal"),j=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",k.letterSpacing,"0.252px"),H=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",k.lineHeight,"1.4"),Z=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",k.textTransform,"inherit"),V={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",w),fontSize:i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",k.fontSize,"12px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",k.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",k.letterSpacing,"0.396px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",k.lineHeight,"1.33"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",k.textTransform,"inherit")},K=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",w),W=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",k.fontSize,"10px"),G=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",k.fontWeight,"normal"),q=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",k.letterSpacing,"0.33px"),X=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",k.lineHeight,"1.6"),Y=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",k.textTransform,"inherit"),J=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",w),Q=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",k.fontSize,"10px"),tt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",k.fontWeight,"normal"),it=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",k.letterSpacing,"1.5px"),et=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",k.lineHeight,"1.6"),ot=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",k.textTransform,"uppercase"),st={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",w),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",k.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",k.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",k.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",k.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",k.textTransform,"uppercase")},nt=e.css`
|
|
114
114
|
.ft-typography--title {
|
|
115
|
-
font-family: ${k.fontFamily};
|
|
116
|
-
font-size: ${k.fontSize};
|
|
117
|
-
font-weight: ${k.fontWeight};
|
|
118
|
-
letter-spacing: ${k.letterSpacing};
|
|
119
|
-
line-height: ${k.lineHeight};
|
|
120
|
-
text-transform: ${k.textTransform};
|
|
121
|
-
}
|
|
122
|
-
`,nt=i.css`
|
|
123
|
-
.ft-typography--title-dense {
|
|
124
115
|
font-family: ${S.fontFamily};
|
|
125
116
|
font-size: ${S.fontSize};
|
|
126
117
|
font-weight: ${S.fontWeight};
|
|
@@ -128,26 +119,35 @@
|
|
|
128
119
|
line-height: ${S.lineHeight};
|
|
129
120
|
text-transform: ${S.textTransform};
|
|
130
121
|
}
|
|
131
|
-
`,rt=
|
|
122
|
+
`,rt=e.css`
|
|
123
|
+
.ft-typography--title-dense {
|
|
124
|
+
font-family: ${_.fontFamily};
|
|
125
|
+
font-size: ${_.fontSize};
|
|
126
|
+
font-weight: ${_.fontWeight};
|
|
127
|
+
letter-spacing: ${_.letterSpacing};
|
|
128
|
+
line-height: ${_.lineHeight};
|
|
129
|
+
text-transform: ${_.textTransform};
|
|
130
|
+
}
|
|
131
|
+
`,at=e.css`
|
|
132
132
|
.ft-typography--subtitle1 {
|
|
133
|
-
font-family: ${
|
|
133
|
+
font-family: ${T};
|
|
134
134
|
font-size: ${E};
|
|
135
135
|
font-weight: ${I};
|
|
136
|
-
letter-spacing: ${
|
|
137
|
-
line-height: ${
|
|
136
|
+
letter-spacing: ${R};
|
|
137
|
+
line-height: ${C};
|
|
138
138
|
text-transform: ${A};
|
|
139
139
|
}
|
|
140
|
-
`,
|
|
140
|
+
`,lt=e.css`
|
|
141
141
|
.ft-typography--subtitle2 {
|
|
142
142
|
font-family: ${O};
|
|
143
|
-
font-size: ${
|
|
144
|
-
font-weight: ${
|
|
145
|
-
letter-spacing: ${
|
|
146
|
-
line-height: ${
|
|
147
|
-
text-transform: ${
|
|
143
|
+
font-size: ${N};
|
|
144
|
+
font-weight: ${U};
|
|
145
|
+
letter-spacing: ${D};
|
|
146
|
+
line-height: ${z};
|
|
147
|
+
text-transform: ${M};
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
`,
|
|
150
|
+
`,ht=e.css`
|
|
151
151
|
.ft-typography--body1 {
|
|
152
152
|
font-family: ${B.fontFamily};
|
|
153
153
|
font-size: ${B.fontSize};
|
|
@@ -156,56 +156,56 @@
|
|
|
156
156
|
line-height: ${B.lineHeight};
|
|
157
157
|
text-transform: ${B.textTransform};
|
|
158
158
|
}
|
|
159
|
-
`,
|
|
159
|
+
`,dt=e.css`
|
|
160
160
|
.ft-typography--body2 {
|
|
161
|
-
font-family: ${
|
|
162
|
-
font-size: ${
|
|
163
|
-
font-weight: ${
|
|
164
|
-
letter-spacing: ${
|
|
165
|
-
line-height: ${
|
|
166
|
-
text-transform: ${
|
|
167
|
-
}
|
|
168
|
-
`,
|
|
161
|
+
font-family: ${P};
|
|
162
|
+
font-size: ${L};
|
|
163
|
+
font-weight: ${F};
|
|
164
|
+
letter-spacing: ${j};
|
|
165
|
+
line-height: ${H};
|
|
166
|
+
text-transform: ${Z};
|
|
167
|
+
}
|
|
168
|
+
`,ct=e.css`
|
|
169
169
|
.ft-typography--caption {
|
|
170
|
-
font-family: ${
|
|
171
|
-
font-size: ${
|
|
172
|
-
font-weight: ${
|
|
173
|
-
letter-spacing: ${
|
|
174
|
-
line-height: ${
|
|
175
|
-
text-transform: ${
|
|
176
|
-
}
|
|
177
|
-
`,ft=
|
|
170
|
+
font-family: ${V.fontFamily};
|
|
171
|
+
font-size: ${V.fontSize};
|
|
172
|
+
font-weight: ${V.fontWeight};
|
|
173
|
+
letter-spacing: ${V.letterSpacing};
|
|
174
|
+
line-height: ${V.lineHeight};
|
|
175
|
+
text-transform: ${V.textTransform};
|
|
176
|
+
}
|
|
177
|
+
`,ft=e.css`
|
|
178
178
|
.ft-typography--breadcrumb {
|
|
179
179
|
font-family: ${K};
|
|
180
|
-
font-size: ${
|
|
180
|
+
font-size: ${W};
|
|
181
181
|
font-weight: ${G};
|
|
182
|
-
letter-spacing: ${
|
|
182
|
+
letter-spacing: ${q};
|
|
183
183
|
line-height: ${X};
|
|
184
184
|
text-transform: ${Y};
|
|
185
185
|
}
|
|
186
|
-
`,
|
|
186
|
+
`,pt=e.css`
|
|
187
187
|
.ft-typography--overline {
|
|
188
|
-
font-family: ${
|
|
189
|
-
font-size: ${
|
|
190
|
-
font-weight: ${
|
|
191
|
-
letter-spacing: ${
|
|
188
|
+
font-family: ${J};
|
|
189
|
+
font-size: ${Q};
|
|
190
|
+
font-weight: ${tt};
|
|
191
|
+
letter-spacing: ${it};
|
|
192
192
|
line-height: ${et};
|
|
193
|
-
text-transform: ${
|
|
193
|
+
text-transform: ${ot};
|
|
194
194
|
}
|
|
195
|
-
`,
|
|
195
|
+
`,ut=e.css`
|
|
196
196
|
.ft-typography--button {
|
|
197
|
-
font-family: ${
|
|
198
|
-
font-size: ${
|
|
199
|
-
font-weight: ${
|
|
200
|
-
letter-spacing: ${
|
|
201
|
-
line-height: ${
|
|
202
|
-
text-transform: ${
|
|
203
|
-
}
|
|
204
|
-
`,
|
|
197
|
+
font-family: ${st.fontFamily};
|
|
198
|
+
font-size: ${st.fontSize};
|
|
199
|
+
font-weight: ${st.fontWeight};
|
|
200
|
+
letter-spacing: ${st.letterSpacing};
|
|
201
|
+
line-height: ${st.lineHeight};
|
|
202
|
+
text-transform: ${st.textTransform};
|
|
203
|
+
}
|
|
204
|
+
`,vt=e.css`
|
|
205
205
|
.ft-typography {
|
|
206
206
|
vertical-align: inherit;
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,gt={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},bt=e.css`
|
|
209
209
|
:host {
|
|
210
210
|
line-height: 0;
|
|
211
211
|
}
|
|
@@ -214,8 +214,8 @@
|
|
|
214
214
|
display: inline-block;
|
|
215
215
|
position: relative;
|
|
216
216
|
|
|
217
|
-
width: ${
|
|
218
|
-
height: ${
|
|
217
|
+
width: ${gt.size};
|
|
218
|
+
height: ${gt.size};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
.ft-loader div {
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
width: 25%;
|
|
225
225
|
height: 25%;
|
|
226
226
|
border-radius: 50%;
|
|
227
|
-
background: ${
|
|
227
|
+
background: ${gt.color};
|
|
228
228
|
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -271,10 +271,10 @@
|
|
|
271
271
|
transform: translate(0, 0);
|
|
272
272
|
}
|
|
273
273
|
100% {
|
|
274
|
-
transform: translate(calc(0.35 * ${
|
|
274
|
+
transform: translate(calc(0.35 * ${gt.size}), 0);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,xt={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},yt=e.css`
|
|
278
278
|
:host, i.ft-icon {
|
|
279
279
|
display: inline-flex;
|
|
280
280
|
align-items: center;
|
|
@@ -283,14 +283,14 @@
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
:host {
|
|
286
|
-
width: ${
|
|
287
|
-
height: ${
|
|
286
|
+
width: ${xt.size};
|
|
287
|
+
height: ${xt.size};
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
i.ft-icon {
|
|
291
291
|
width: 100%;
|
|
292
292
|
height: 100%;
|
|
293
|
-
font-size: ${
|
|
293
|
+
font-size: ${xt.size};
|
|
294
294
|
line-height: 1;
|
|
295
295
|
font-weight: normal;
|
|
296
296
|
text-transform: none;
|
|
@@ -301,28 +301,28 @@
|
|
|
301
301
|
text-rendering: auto;
|
|
302
302
|
-webkit-font-smoothing: antialiased;
|
|
303
303
|
-moz-osx-font-smoothing: grayscale;
|
|
304
|
-
vertical-align: ${
|
|
304
|
+
vertical-align: ${xt.verticalAlign};
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
i.ft-icon.ft-icon--fluid-topics {
|
|
308
|
-
font-family: ${
|
|
308
|
+
font-family: ${xt.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
309
309
|
|
|
310
310
|
/* Ugly fix because font is broken */
|
|
311
|
-
font-size: calc(0.75 * ${
|
|
312
|
-
line-height: ${
|
|
311
|
+
font-size: calc(0.75 * ${xt.size});
|
|
312
|
+
line-height: ${xt.size};
|
|
313
313
|
position: relative;
|
|
314
314
|
top: -4%;
|
|
315
315
|
justify-content: center;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
.ft-icon--file-format {
|
|
319
|
-
font-family: ${
|
|
319
|
+
font-family: ${xt.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
.ft-icon--material {
|
|
323
|
-
font-family: ${
|
|
323
|
+
font-family: ${xt.materialFontFamily}, "Material Icons", sans-serif;
|
|
324
324
|
}
|
|
325
|
-
`,
|
|
325
|
+
`,mt=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),$t={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:mt,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",st.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",mt),verticalPadding:i.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:i.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:i.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},wt=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),kt={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:wt,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",wt)},St=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),_t=i.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),Tt=i.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),Et=i.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),It=[e.css`
|
|
326
326
|
:host {
|
|
327
327
|
display: inline-block;
|
|
328
328
|
max-width: 100%;
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
box-shadow: 0px 0px 0px transparent;
|
|
334
334
|
border: 0px solid transparent;
|
|
335
335
|
text-shadow: 0px 0px 0px transparent;
|
|
336
|
-
font-size: ${
|
|
336
|
+
font-size: ${$t.fontSize};
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
button:hover {
|
|
@@ -362,31 +362,31 @@
|
|
|
362
362
|
border: none;
|
|
363
363
|
pointer-events: auto;
|
|
364
364
|
|
|
365
|
-
--ft-button-internal-line-height: max(calc(${
|
|
366
|
-
--ft-button-internal-color: ${
|
|
367
|
-
${
|
|
368
|
-
${
|
|
365
|
+
--ft-button-internal-line-height: max(calc(${$t.fontSize} + 2px), ${$t.iconSize});
|
|
366
|
+
--ft-button-internal-color: ${$t.color};
|
|
367
|
+
${i.setVariable(xt.size,$t.iconSize)};
|
|
368
|
+
${i.setVariable(p.color,$t.rippleColor)};
|
|
369
369
|
|
|
370
|
-
border-radius: ${
|
|
371
|
-
padding: ${
|
|
372
|
-
background-color: ${
|
|
370
|
+
border-radius: ${$t.borderRadius};
|
|
371
|
+
padding: ${$t.verticalPadding} ${$t.horizontalPadding};
|
|
372
|
+
background-color: ${$t.backgroundColor};
|
|
373
373
|
color: var(--ft-button-internal-color);
|
|
374
374
|
-webkit-mask-image: radial-gradient(white, black);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
.ft-button.ft-button--outlined {
|
|
378
378
|
border: 1px solid var(--ft-button-internal-color);
|
|
379
|
-
padding: calc(${
|
|
379
|
+
padding: calc(${$t.verticalPadding} - 1px) calc(${$t.horizontalPadding} - 1px);
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
.ft-button.ft-button--dense {
|
|
383
|
-
padding: ${
|
|
384
|
-
border-radius: ${
|
|
383
|
+
padding: ${_t} ${Tt};
|
|
384
|
+
border-radius: ${St};
|
|
385
385
|
gap: ${Et};
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
.ft-button.ft-button--dense.ft-button--outlined {
|
|
389
|
-
padding: calc(${
|
|
389
|
+
padding: calc(${_t} - 1px) calc(${Tt} - 1px);
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
.ft-button:not([disabled]):hover {
|
|
@@ -394,22 +394,22 @@
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
.ft-button--round {
|
|
397
|
-
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${
|
|
397
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${$t.verticalPadding});
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
.ft-button--round.ft-button--dense {
|
|
401
|
-
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${
|
|
401
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${_t});
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
.ft-button[disabled] {
|
|
405
405
|
filter: grayscale(1);
|
|
406
|
-
opacity: ${
|
|
406
|
+
opacity: ${$t.opacityDisabled};
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
.ft-button.ft-button--primary {
|
|
410
|
-
background-color: ${
|
|
411
|
-
--ft-button-internal-color: ${
|
|
412
|
-
${
|
|
410
|
+
background-color: ${kt.backgroundColor};
|
|
411
|
+
--ft-button-internal-color: ${kt.color};
|
|
412
|
+
${i.setVariable(p.color,kt.rippleColor)};
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
.ft-button:focus {
|
|
@@ -422,9 +422,9 @@
|
|
|
422
422
|
white-space: nowrap;
|
|
423
423
|
text-overflow: ellipsis;
|
|
424
424
|
display: block;
|
|
425
|
-
margin: 0 ${
|
|
426
|
-
${
|
|
427
|
-
${
|
|
425
|
+
margin: 0 ${$t.iconPadding};
|
|
426
|
+
${i.setVariable(st.fontSize,"1em")};
|
|
427
|
+
${i.setVariable(st.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
.ft-button--dense .ft-button--label {
|
|
@@ -441,13 +441,13 @@
|
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
.ft-button--label[hidden] + ft-icon {
|
|
444
|
-
margin: 0 calc(${
|
|
445
|
-
padding: 0 ${
|
|
444
|
+
margin: 0 calc(${$t.horizontalPadding} * -1);
|
|
445
|
+
padding: 0 ${$t.verticalPadding};
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
.ft-button--dense .ft-button--label[hidden] + ft-icon {
|
|
449
|
-
margin: 0 calc(${
|
|
450
|
-
padding: 0 ${
|
|
449
|
+
margin: 0 calc(${Tt} * -1);
|
|
450
|
+
padding: 0 ${_t};
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
@@ -456,10 +456,10 @@
|
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
ft-loader {
|
|
459
|
-
${
|
|
460
|
-
${
|
|
459
|
+
${i.setVariable(gt.size,$t.iconSize)};
|
|
460
|
+
${i.setVariable(gt.color,"var(--ft-button-internal-color)")};
|
|
461
461
|
}
|
|
462
|
-
`,
|
|
462
|
+
`,i.noTextSelect],Rt={textColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceHigh),backgroundColor:i.FtCssVariableFactory.extend("--ft-switch-background-color",i.designSystemVariables.colorSurface),selectedTextColor:i.FtCssVariableFactory.extend("--ft-switch-selected-text-color",i.designSystemVariables.colorPrimary),selectedBackgroundColor:i.FtCssVariableFactory.extend("--ft-switch-selected-background-color",i.designSystemVariables.colorPrimary),borderColor:i.FtCssVariableFactory.extend("--ft-switch-border-color",i.designSystemVariables.colorOutline),borderRadius:i.FtCssVariableFactory.extend("--ft-switch-border-radius",i.designSystemVariables.borderRadiusL),fontSize:i.FtCssVariableFactory.extend("--ft-switch-font-size",st.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceMedium),rippleColor:i.FtCssVariableFactory.extend("--ft-switch-ripple-color",i.designSystemVariables.colorPrimary),outlineColor:i.FtCssVariableFactory.extend("--ft-switch-outline-color",i.designSystemVariables.colorPrimary)},Ct={feedbackInputMinWidth:i.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color",i.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color",i.designSystemVariables.colorPrimary),filledRatingColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color",i.designSystemVariables.colorPrimary),emptyRatingColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color",i.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:i.FtCssVariableFactory.external(S.fontSize,"Typography"),sectionTitleFontSize:i.FtCssVariableFactory.external(_.fontSize,"Typography")},At=e.css`
|
|
463
463
|
.ft-reader-feedback {
|
|
464
464
|
box-sizing: border-box;
|
|
465
465
|
display: flex;
|
|
@@ -505,14 +505,14 @@
|
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
.ft-reader-feedback--rating {
|
|
508
|
-
${
|
|
509
|
-
${
|
|
510
|
-
${
|
|
511
|
-
${
|
|
508
|
+
${i.setVariable($t.color,Ct.emptyRatingColor)};
|
|
509
|
+
${i.setVariable($t.rippleColor,Ct.filledRatingColor)};
|
|
510
|
+
${i.setVariable(Rt.textColor,Ct.emptyRatingColor)};
|
|
511
|
+
${i.setVariable(Rt.selectedTextColor,Ct.filledRatingColor)};
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
515
|
-
${
|
|
515
|
+
${i.setVariable($t.color,Ct.filledRatingColor)};
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
.ft-reader-feedback--feedback {
|
|
@@ -520,42 +520,42 @@
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
.ft-reader-feedback--rating-date {
|
|
523
|
-
color: ${
|
|
523
|
+
color: ${Ct.ratedDateColor};
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
.ft-reader-feedback--feedback ft-text-area {
|
|
527
|
-
min-width: ${
|
|
527
|
+
min-width: ${Ct.feedbackInputMinWidth};
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
531
531
|
align-self: flex-end;
|
|
532
|
-
${
|
|
533
|
-
${
|
|
532
|
+
${i.setVariable($t.color,Ct.sendFeedbackColor)};
|
|
533
|
+
${i.setVariable($t.backgroundColor,Ct.sendFeedbackBackgroundColor)};
|
|
534
534
|
}
|
|
535
|
-
`;!function(t){!function(e){var i={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function f(t){var e=new FileReader,i=d(e);return e.readAsArrayBuffer(t),i}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=c(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,i,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=d(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),o=0;o<e.length;o++)i[o]=String.fromCharCode(e[o]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=r(e);var i=this.map[t];this.map[t]=i?i+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=r(e)},l.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),a(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),a(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),a(t)},i.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var i,o,s=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(i=e.method||this.method||"GET",o=i.toUpperCase(),u.indexOf(o)>-1?o:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),o=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(s))}})),e}function g(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];g.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function y(t,o){return new Promise((function(s,n){var r=new v(t,o);if(r.signal&&r.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,e,i={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),o=i.shift().trim();if(o){var s=i.join(":").trim();e.append(o,s)}})),e)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;s(new g(o,i))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},a.open(r.method,r.url,!0),"include"===r.credentials?a.withCredentials=!0:"omit"===r.credentials&&(a.withCredentials=!1),"responseType"in a&&i.blob&&(a.responseType="blob"),r.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),r.signal&&(r.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&r.signal.removeEventListener("abort",h)}),a.send(void 0===r._bodyInit?null:r._bodyInit)}))}y.polyfill=!0,t.fetch||(t.fetch=y,t.Headers=l,t.Request=v,t.Response=g),e.Headers=l,e.Request=v,e.Response=g,e.fetch=y,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0);const Ot=t=>"object"==typeof t&&null!=t,Ct=t=>"string"==typeof t;var Nt,Ut,Dt,zt,Bt,Mt,Ft,Lt,Pt,jt,Ht,Zt;!function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Nt||(Nt={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Ut||(Ut={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(Dt||(Dt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(zt||(zt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Bt||(Bt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Mt||(Mt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ft||(Ft={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Lt||(Lt={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Pt||(Pt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(jt||(jt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Ht||(Ht={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Zt||(Zt={}));const Kt=t=>Ot(t)&&(null==t.authenticationIdentifier||(t=>Ot(t)&&Ct(t.identifier)&&Ct(t.realm))(t.authenticationIdentifier))&&(t=>"number"==typeof t)(t.idleTimeoutInMillis)&&Vt(t.profile)&&(t=>"boolean"==typeof t)(t.sessionAuthenticated),Vt=t=>Ot(t)&&(null==t.emailAddress||Ct(t.emailAddress))&&(null==t.displayName||Ct(t.displayName))&&Array.isArray(t.roles)&&t.roles.every((t=>(t=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(t))(t)))&&(null==t.userId||Ct(t.userId)),Gt={[Zt.PERSONAL_BOOK_SHARE_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.HTML_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.PDF_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.KHUB_ADMIN]:[Zt.CONTENT_PUBLISHER],[Zt.ADMIN]:[Zt.KHUB_ADMIN,Zt.USERS_ADMIN,Zt.PORTAL_ADMIN],[Zt.DEVELOPER]:[Zt.BETA_USER,Zt.DEBUG_USER]};function Wt(t,e){return t===e||(Gt[t]??[]).some((t=>Wt(t,e)))}function Xt(t,e){return(Kt(t)?t.profile.roles:Vt(t)?t.roles:t).some((t=>Wt(t,e)))}
|
|
535
|
+
`;!function(t){!function(i){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return e.iterable&&(i[Symbol.iterator]=function(){return i}),i}function l(t){this.map={},t instanceof l?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(i,e){t.onload=function(){i(t.result)},t.onerror=function(){e(t.error)}}))}function c(t){var i=new FileReader,e=d(i);return i.readAsArrayBuffer(t),e}function f(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var i;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var t,i,e,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,e=d(i),i.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),e=new Array(i.length),o=0;o<i.length;o++)e[o]=String.fromCharCode(i[o]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,i){t=n(t),i=r(i);var e=this.map[t];this.map[t]=e?e+", "+i:i},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,i){this.map[n(t)]=r(i)},l.prototype.forEach=function(t,i){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(i,this.map[e],e,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(i,e){t.push(e)})),a(t)},l.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(i,e){t.push([e,i])})),a(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,i){var e,o,s=(i=i||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new l(i.headers)),this.method=(e=i.method||this.method||"GET",o=e.toUpperCase(),u.indexOf(o)>-1?o:e),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function g(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),o=e.shift().replace(/\+/g," "),s=e.join("=").replace(/\+/g," ");i.append(decodeURIComponent(o),decodeURIComponent(s))}})),i}function b(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new l(i.headers),this.url=i.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];b.redirect=function(t,i){if(-1===x.indexOf(i))throw new RangeError("Invalid status code");return new b(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var e=Error(t);this.stack=e.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function y(t,o){return new Promise((function(s,n){var r=new v(t,o);if(r.signal&&r.signal.aborted)return n(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,i,e={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),o=e.shift().trim();if(o){var s=e.join(":").trim();i.append(o,s)}})),i)};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;s(new b(o,e))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new i.DOMException("Aborted","AbortError"))},a.open(r.method,r.url,!0),"include"===r.credentials?a.withCredentials=!0:"omit"===r.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),r.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),r.signal&&(r.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&r.signal.removeEventListener("abort",h)}),a.send(void 0===r._bodyInit?null:r._bodyInit)}))}y.polyfill=!0,t.fetch||(t.fetch=y,t.Headers=l,t.Request=v,t.Response=b),i.Headers=l,i.Request=v,i.Response=b,i.fetch=y,Object.defineProperty(i,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0);const Ot=t=>"object"==typeof t&&null!=t,Nt=t=>"string"==typeof t;var Ut,Dt,zt,Mt,Bt,Pt,Lt,Ft,jt,Ht,Zt,Vt;!function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Ut||(Ut={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Dt||(Dt={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(zt||(zt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(Mt||(Mt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Bt||(Bt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Pt||(Pt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Lt||(Lt={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Ft||(Ft={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(jt||(jt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Ht||(Ht={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Zt||(Zt={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Vt||(Vt={}));const Kt=t=>Ot(t)&&(null==t.authenticationIdentifier||(t=>Ot(t)&&Nt(t.identifier)&&Nt(t.realm))(t.authenticationIdentifier))&&(t=>"number"==typeof t)(t.idleTimeoutInMillis)&&Wt(t.profile)&&(t=>"boolean"==typeof t)(t.sessionAuthenticated),Wt=t=>Ot(t)&&(null==t.emailAddress||Nt(t.emailAddress))&&(null==t.displayName||Nt(t.displayName))&&Array.isArray(t.roles)&&t.roles.every((t=>(t=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(t))(t)))&&(null==t.userId||Nt(t.userId)),Gt={[Vt.PERSONAL_BOOK_SHARE_USER]:[Vt.PERSONAL_BOOK_USER],[Vt.HTML_EXPORT_USER]:[Vt.PERSONAL_BOOK_USER],[Vt.PDF_EXPORT_USER]:[Vt.PERSONAL_BOOK_USER],[Vt.KHUB_ADMIN]:[Vt.CONTENT_PUBLISHER],[Vt.ADMIN]:[Vt.KHUB_ADMIN,Vt.USERS_ADMIN,Vt.PORTAL_ADMIN],[Vt.DEVELOPER]:[Vt.BETA_USER,Vt.DEBUG_USER]};function qt(t,i){return t===i||(Gt[t]??[]).some((t=>qt(t,i)))}function Xt(t,i){return(Kt(t)?t.profile.roles:Wt(t)?t.roles:t).some((t=>qt(t,i)))}
|
|
536
536
|
/**
|
|
537
537
|
* @license
|
|
538
538
|
* Copyright 2017 Google LLC
|
|
539
539
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
540
|
-
*/var Yt;const
|
|
540
|
+
*/var Yt;const Jt=window,Qt=Jt.trustedTypes,ti=Qt?Qt.createPolicy("lit-html",{createHTML:t=>t}):void 0,ii="$lit$",ei=`lit$${(Math.random()+"").slice(9)}$`,oi="?"+ei,si=`<${oi}>`,ni=document,ri=()=>ni.createComment(""),ai=t=>null===t||"object"!=typeof t&&"function"!=typeof t,li=Array.isArray,hi="[ \t\n\f\r]",di=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ci=/-->/g,fi=/>/g,pi=RegExp(`>|${hi}(?:([^\\s"'>=/]+)(${hi}*=${hi}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ui=/'/g,vi=/"/g,gi=/^(?:script|style|textarea|title)$/i,bi=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),xi=Symbol.for("lit-noChange"),yi=Symbol.for("lit-nothing"),mi=new WeakMap,$i=ni.createTreeWalker(ni,129,null,!1),wi=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=di;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(r.lastIndex=d,l=r.exec(e),null!==l);)d=r.lastIndex,r===di?"!--"===l[1]?r=ci:void 0!==l[1]?r=fi:void 0!==l[2]?(gi.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=pi):void 0!==l[3]&&(r=pi):r===pi?">"===l[0]?(r=null!=s?s:di,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?pi:'"'===l[3]?vi:ui):r===vi||r===ui?r=pi:r===ci||r===fi?r=di:(r=pi,s=void 0);const c=r===pi&&t[i+1].startsWith("/>")?" ":"";n+=r===di?e+si:h>=0?(o.push(a),e.slice(0,h)+ii+e.slice(h)+ei+c):e+ei+(-2===h?(o.push(void 0),i):c)}const a=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==ti?ti.createHTML(a):a,o]};class ki{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=wi(t,i);if(this.el=ki.createElement(l,e),$i.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=$i.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith(ii)||i.startsWith(ei)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+ii).split(ei),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?Ii:"?"===i[1]?Ci:"@"===i[1]?Ai:Ei})}else a.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(gi.test(o.tagName)){const t=o.textContent.split(ei),i=t.length-1;if(i>0){o.textContent=Qt?Qt.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],ri()),$i.nextNode(),a.push({type:2,index:++s});o.append(t[i],ri())}}}else if(8===o.nodeType)if(o.data===oi)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(ei,t+1));)a.push({type:7,index:s}),t+=ei.length-1}s++}}static createElement(t,i){const e=ni.createElement("template");return e.innerHTML=t,e}}function Si(t,i,e=t,o){var s,n,r,a;if(i===xi)return i;let l=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=ai(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,o)),void 0!==o?(null!==(r=(a=e)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:e._$Cl=l),void 0!==l&&(i=Si(t,l._$AS(t,i.values),l,o)),i}class _i{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:ni).importNode(e,!0);$i.currentNode=s;let n=$i.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new Ti(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new Oi(n,this,t)),this._$AV.push(i),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=$i.nextNode(),r++)}return s}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class Ti{constructor(t,i,e,o){var s;this.type=2,this._$AH=yi,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Si(this,t,i),ai(t)?t===yi||null==t||""===t?(this._$AH!==yi&&this._$AR(),this._$AH=yi):t!==this._$AH&&t!==xi&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>li(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==yi&&ai(this._$AH)?this._$AA.nextSibling.data=t:this.$(ni.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=ki.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.v(e);else{const t=new _i(s,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=mi.get(t.strings);return void 0===i&&mi.set(t.strings,i=new ki(t)),i}T(t){li(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new Ti(this.k(ri()),this.k(ri()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Ei{constructor(t,i,e,o,s){this.type=1,this._$AH=yi,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=yi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=Si(this,t,i,0),n=!ai(t)||t!==this._$AH&&t!==xi,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=Si(this,o[e+r],i,r),a===xi&&(a=this._$AH[r]),n||(n=!ai(a)||a!==this._$AH[r]),a===yi?t=yi:t!==yi&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===yi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ii extends Ei{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===yi?void 0:t}}const Ri=Qt?Qt.emptyScript:"";class Ci extends Ei{constructor(){super(...arguments),this.type=4}j(t){t&&t!==yi?this.element.setAttribute(this.name,Ri):this.element.removeAttribute(this.name)}}class Ai extends Ei{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=Si(this,t,i,0))&&void 0!==e?e:yi)===xi)return;const o=this._$AH,s=t===yi&&o!==yi||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==yi&&(o===yi||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Oi{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){Si(this,t)}}const Ni=Jt.litHtmlPolyfillSupport;null==Ni||Ni(ki,Ti),(null!==(Yt=Jt.litHtmlVersions)&&void 0!==Yt?Yt:Jt.litHtmlVersions=[]).push("2.7.3");
|
|
541
541
|
/**
|
|
542
542
|
* @license
|
|
543
543
|
* Copyright 2020 Google LLC
|
|
544
544
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
545
545
|
*/
|
|
546
|
-
const
|
|
547
|
-
<${
|
|
546
|
+
const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void 0:t._$litStatic$},zi=t=>({_$litStatic$:t,r:Ui}),Mi=new Map,Bi=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(n=e[h],s=Di(n));)l+=s+i[++h],d=!0;h!==o&&a.push(n),r.push(l),h++}if(h===o&&r.push(i[o]),d){const t=r.join("$$lit$$");void 0===(i=Mi.get(t))&&(r.raw=r,Mi.set(t,i=r)),e=a}return t(i,...e)})(bi);var Pi;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Pi||(Pi={}));var Li,Fi,ji,Hi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Zi extends i.FtLitElement{constructor(){super(...arguments),this.variant=Pi.body1}render(){return this.element?Bi`
|
|
547
|
+
<${zi(this.element)}
|
|
548
548
|
class="ft-typography ft-typography--${this.variant}">
|
|
549
549
|
<slot></slot>
|
|
550
|
-
</${
|
|
551
|
-
`:
|
|
550
|
+
</${zi(this.element)}>
|
|
551
|
+
`:Bi`
|
|
552
552
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
553
|
-
`}}
|
|
553
|
+
`}}Zi.styles=[nt,rt,at,lt,ht,dt,ct,ft,pt,ut,vt],Hi([o.property()],Zi.prototype,"element",void 0),Hi([o.property()],Zi.prototype,"variant",void 0),i.customElement("ft-typography")(Zi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Li||(Li={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Fi||(Fi={})),new Map([...["abw"].map((t=>[t,Fi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Fi.AUDIO])),...["avi"].map((t=>[t,Fi.AVI])),...["chm","xhs"].map((t=>[t,Fi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Fi.CODE])),...["csv"].map((t=>[t,Fi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Fi.DITA])),...["epub"].map((t=>[t,Fi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Fi.EXCEL])),...["flac"].map((t=>[t,Fi.FLAC])),...["gif"].map((t=>[t,Fi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Fi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Fi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Fi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Fi.JPEG])),...["json"].map((t=>[t,Fi.JSON])),...["m4a","m4p"].map((t=>[t,Fi.M4A])),...["mov","qt"].map((t=>[t,Fi.MOV])),...["mp3"].map((t=>[t,Fi.MP3])),...["mp4","m4v"].map((t=>[t,Fi.MP4])),...["ogg","oga"].map((t=>[t,Fi.OGG])),...["pdf","ps"].map((t=>[t,Fi.PDF])),...["png"].map((t=>[t,Fi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Fi.POWERPOINT])),...["rar"].map((t=>[t,Fi.RAR])),...["stp"].map((t=>[t,Fi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Fi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Fi.VIDEO])),...["wav"].map((t=>[t,Fi.WAV])),...["wma"].map((t=>[t,Fi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Fi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Fi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Fi.YAML])),...["zip"].map((t=>[t,Fi.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(ji||(ji={}));var Vi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ki extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(ji).includes(this.variant)?this.variant:ji.fluid_topics,i=t!==ji.material||!!this.value;return e.html`
|
|
554
554
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
555
555
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
556
|
-
<slot ?hidden=${
|
|
556
|
+
<slot ?hidden=${i}></slot>
|
|
557
557
|
</i>
|
|
558
|
-
`}get textContent(){var t,
|
|
558
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case ji.file_format:this.resolvedIcon=null!==(t=Fi[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case ji.material:this.resolvedIcon=this.value||e.nothing;break;default:this.resolvedIcon=null!==(i=Li[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Ki.elementDefinitions={},Ki.styles=yt,Vi([o.property()],Ki.prototype,"variant",void 0),Vi([o.property()],Ki.prototype,"value",void 0),Vi([o.state()],Ki.prototype,"resolvedIcon",void 0),Vi([o.query("slot")],Ki.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Ki);const Wi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Gi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),qi=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Xi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","100"),Yi=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),Ji=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Qi=e.css`
|
|
559
559
|
.ft-tooltip--container {
|
|
560
560
|
display: block;
|
|
561
561
|
}
|
|
@@ -570,21 +570,21 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
570
570
|
box-sizing: border-box;
|
|
571
571
|
overflow: hidden;
|
|
572
572
|
width: max-content;
|
|
573
|
-
max-width: ${
|
|
573
|
+
max-width: ${Ji};
|
|
574
574
|
text-align: center;
|
|
575
|
-
padding: ${
|
|
576
|
-
z-index: ${
|
|
575
|
+
padding: ${Wi};
|
|
576
|
+
z-index: ${Xi};
|
|
577
577
|
}
|
|
578
578
|
|
|
579
579
|
.ft-tooltip--content {
|
|
580
580
|
padding: 4px 8px;
|
|
581
|
-
border-radius: ${
|
|
582
|
-
background-color: ${
|
|
583
|
-
color: ${
|
|
581
|
+
border-radius: ${Yi};
|
|
582
|
+
background-color: ${qi};
|
|
583
|
+
color: ${Gi};
|
|
584
584
|
position: relative;
|
|
585
585
|
word-break: break-word;
|
|
586
586
|
}
|
|
587
|
-
`;var
|
|
587
|
+
`;var te=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ie extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
588
588
|
<div part="container"
|
|
589
589
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
590
590
|
@mouseenter=${this.onHover}
|
|
@@ -602,7 +602,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
602
602
|
</div>
|
|
603
603
|
</div>
|
|
604
604
|
</div>
|
|
605
|
-
`}
|
|
605
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=this.tooltip.offsetWidth,e=this.tooltip.offsetHeight,o=(t.offsetHeight-e)/2,s=(t.offsetWidth-i)/2;let n=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-e-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-i-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const a=this.tooltip.style;a.left=n+"px",a.top=r+"px";const l=this.tooltip.getBoundingClientRect();let h=-l.x,d=l.x+l.width-window.innerWidth;a.left=n+Math.round(this.correctOutOfWindowPixels(h,d))+"px";let c=-l.y,f=l.y+l.height-window.innerHeight;a.top=r+Math.round(this.correctOutOfWindowPixels(c,f))+"px",a.maxWidth=`max(${t.offsetWidth}px, ${Ji})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,i){return Math.max(t,Math.min(0,-i))}}ie.elementDefinitions={"ft-typography":Zi},ie.styles=Qi,te([o.property()],ie.prototype,"text",void 0),te([o.property({type:Boolean})],ie.prototype,"manual",void 0),te([o.property({type:Boolean})],ie.prototype,"inline",void 0),te([o.property({type:Number})],ie.prototype,"delay",void 0),te([o.property()],ie.prototype,"position",void 0),te([o.queryAssignedNodes("",!0)],ie.prototype,"slotNodes",void 0),te([o.query(".ft-tooltip--container")],ie.prototype,"container",void 0),te([o.query(".ft-tooltip")],ie.prototype,"tooltip",void 0),te([o.query(".ft-tooltip--content")],ie.prototype,"tooltipContent",void 0),te([o.state()],ie.prototype,"visible",void 0),i.customElement("ft-tooltip")(ie);var ee=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class oe extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.originX=0,this.originY=0,this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
606
606
|
<style>
|
|
607
607
|
.ft-ripple .ft-ripple--effect {
|
|
608
608
|
left: ${this.originX}px;
|
|
@@ -613,7 +613,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
613
613
|
<div class="ft-ripple--background"></div>
|
|
614
614
|
<div class="ft-ripple--effect"></div>
|
|
615
615
|
</div>
|
|
616
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e
|
|
616
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var i,e;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}oe.elementDefinitions={},oe.styles=m,ee([o.property({type:Boolean})],oe.prototype,"primary",void 0),ee([o.property({type:Boolean})],oe.prototype,"secondary",void 0),ee([o.property({type:Boolean})],oe.prototype,"unbounded",void 0),ee([o.property({type:Boolean})],oe.prototype,"activated",void 0),ee([o.property({type:Boolean})],oe.prototype,"selected",void 0),ee([o.property({type:Boolean})],oe.prototype,"disabled",void 0),ee([o.state()],oe.prototype,"hovered",void 0),ee([o.state()],oe.prototype,"focused",void 0),ee([o.state()],oe.prototype,"pressed",void 0),ee([o.state()],oe.prototype,"rippling",void 0),ee([o.state()],oe.prototype,"originX",void 0),ee([o.state()],oe.prototype,"originY",void 0),ee([o.query(".ft-ripple")],oe.prototype,"ripple",void 0),ee([o.query(".ft-ripple--effect")],oe.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(oe);const se={borderRadiusLeft:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",i.designSystemVariables.borderRadiusL),borderRadiusRight:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",i.designSystemVariables.borderRadiusL),borderWidthLeft:i.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:i.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:i.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")},ne=e.css`
|
|
617
617
|
.ft-switch-option {
|
|
618
618
|
position: relative;
|
|
619
619
|
display: inline-block;
|
|
@@ -627,20 +627,20 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
.ft-switch-option--content {
|
|
630
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
631
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
630
|
+
--ft-switch-option-internal-line-height: calc(${Rt.fontSize} + 2px);
|
|
631
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Rt.iconSize});
|
|
632
632
|
|
|
633
633
|
border-style: solid;
|
|
634
|
-
border-color: ${
|
|
635
|
-
border-width: ${
|
|
636
|
-
border-radius: ${
|
|
634
|
+
border-color: ${Rt.borderColor};
|
|
635
|
+
border-width: ${se.borderWidthVertical} ${se.borderWidthRight} ${se.borderWidthVertical} ${se.borderWidthLeft};
|
|
636
|
+
border-radius: ${se.borderRadiusLeft} ${se.borderRadiusRight} ${se.borderRadiusRight} ${se.borderRadiusLeft};
|
|
637
637
|
display: flex;
|
|
638
638
|
align-items: center;
|
|
639
639
|
justify-content: center;
|
|
640
640
|
overflow: hidden;
|
|
641
|
-
${
|
|
641
|
+
${i.setVariable(xt.size,Rt.iconSize)};
|
|
642
642
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
643
|
-
background-color: ${
|
|
643
|
+
background-color: ${Rt.backgroundColor};
|
|
644
644
|
-webkit-mask-image: radial-gradient(white, black);
|
|
645
645
|
}
|
|
646
646
|
|
|
@@ -649,28 +649,28 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
652
|
-
background-color: ${
|
|
653
|
-
border-radius: ${
|
|
652
|
+
background-color: ${Rt.selectedBackgroundColor};
|
|
653
|
+
border-radius: ${se.borderRadiusLeft} ${se.borderRadiusRight} ${se.borderRadiusRight} ${se.borderRadiusLeft};
|
|
654
654
|
position: absolute;
|
|
655
655
|
inset: 0;
|
|
656
656
|
content: "";
|
|
657
657
|
z-index: 1;
|
|
658
|
-
opacity: ${
|
|
658
|
+
opacity: ${i.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
.ft-switch-option--label {
|
|
662
|
-
color: ${
|
|
662
|
+
color: ${Rt.textColor};
|
|
663
663
|
overflow: hidden;
|
|
664
664
|
white-space: nowrap;
|
|
665
665
|
text-overflow: ellipsis;
|
|
666
666
|
display: block;
|
|
667
667
|
margin: 0 8px;
|
|
668
|
-
${
|
|
669
|
-
${
|
|
668
|
+
${i.setVariable(st.fontSize,Rt.fontSize)};
|
|
669
|
+
${i.setVariable(st.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
.ft-switch-option--selected .ft-switch-option--label {
|
|
673
|
-
color: ${
|
|
673
|
+
color: ${Rt.selectedTextColor};
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
.ft-switch-option--label[hidden] {
|
|
@@ -678,7 +678,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
.ft-switch-option--ripple {
|
|
681
|
-
${
|
|
681
|
+
${i.setVariable(p.color,Rt.rippleColor)};
|
|
682
682
|
}
|
|
683
683
|
|
|
684
684
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -691,20 +691,20 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
691
691
|
|
|
692
692
|
ft-icon {
|
|
693
693
|
flex-shrink: 0;
|
|
694
|
-
color: ${
|
|
694
|
+
color: ${Rt.iconColor};
|
|
695
695
|
}
|
|
696
696
|
|
|
697
697
|
.ft-switch-option--selected ft-icon {
|
|
698
|
-
color: ${
|
|
698
|
+
color: ${Rt.selectedTextColor};
|
|
699
699
|
}
|
|
700
|
-
`;var
|
|
700
|
+
`;var re=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ae extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class le extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class he extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}update(t){super.update(t),t.has("selected")&&this.dispatchEvent(new le(this.selected))}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(e.html`
|
|
701
701
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
702
702
|
@click=${this.onChange}>
|
|
703
703
|
<div class="ft-switch-option--content">
|
|
704
704
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
705
705
|
<ft-typography part="text"
|
|
706
706
|
variant="button"
|
|
707
|
-
class="ft-switch-option--label ${
|
|
707
|
+
class="ft-switch-option--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
708
708
|
?hidden=${!this.hasTextContent()}>
|
|
709
709
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
710
710
|
</ft-typography>
|
|
@@ -713,29 +713,29 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
713
713
|
</label>
|
|
714
714
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
715
715
|
.checked=${this.selected}>
|
|
716
|
-
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:
|
|
716
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:e.html`
|
|
717
717
|
<ft-tooltip part="tooltip"
|
|
718
718
|
text="${this.getLabel()}"
|
|
719
719
|
position="${this.tooltipPosition}">
|
|
720
720
|
${t}
|
|
721
721
|
</ft-tooltip>
|
|
722
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new
|
|
722
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new ae(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
723
723
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
724
|
-
`:
|
|
724
|
+
`:e.nothing}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}he.elementDefinitions={"ft-ripple":oe,"ft-typography":Zi,"ft-tooltip":ie,"ft-icon":Ki},he.styles=[i.safariEllipsisFix,ne],re([o.property()],he.prototype,"value",void 0),re([o.property()],he.prototype,"icon",void 0),re([o.property()],he.prototype,"iconVariant",void 0),re([o.property()],he.prototype,"label",void 0),re([o.property()],he.prototype,"tooltipPosition",void 0),re([o.property({type:Boolean,reflect:!0})],he.prototype,"selected",void 0),re([o.property({type:Boolean})],he.prototype,"trailingIcon",void 0),re([o.property({type:Boolean})],he.prototype,"unselectable",void 0),re([o.query(".ft-switch-option--content slot")],he.prototype,"slottedContent",void 0),re([o.query(".ft-switch-option--input")],he.prototype,"input",void 0);var de=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ce extends CustomEvent{constructor(t){super("change",{detail:t})}}class fe extends i.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}update(t){super.update(t),t.has("selectedOption")&&this.updateOptions(),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return e.html`
|
|
725
725
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
726
726
|
<slot @slotchange=${this.onSlotchange}
|
|
727
727
|
@option-change=${this.onOptionChangeByScript}
|
|
728
728
|
@option-change-by-user=${this.onOptionChangeByUser}
|
|
729
729
|
></slot>
|
|
730
730
|
</div>
|
|
731
|
-
`}onKeyDown(t){let
|
|
731
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof he&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChangeByScript(t){t.stopPropagation();let i=t.target;this.onOptionChange(i)}onOptionChangeByUser(t){var i;t.stopPropagation(),this.onOptionChange(t.target),this.dispatchEvent(new ce(null===(i=this.selectedOption)||void 0===i?void 0:i.value))}onOptionChange(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}private(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}fe.elementDefinitions={},fe.styles=e.css`
|
|
732
732
|
:host {
|
|
733
733
|
display: inline-block;
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
.ft-switch {
|
|
737
|
-
border-radius: ${
|
|
738
|
-
outline-color: ${
|
|
737
|
+
border-radius: ${Rt.borderRadius};
|
|
738
|
+
outline-color: ${Rt.outlineColor};
|
|
739
739
|
}
|
|
740
740
|
|
|
741
741
|
.ft-switch slot {
|
|
@@ -744,25 +744,25 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
747
|
-
${
|
|
748
|
-
${
|
|
749
|
-
${
|
|
747
|
+
${i.setVariable(se.borderRadiusLeft,"0")};
|
|
748
|
+
${i.setVariable(se.borderRadiusRight,"0")};
|
|
749
|
+
${i.setVariable(se.borderWidthLeft,"0")};
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
753
|
-
${
|
|
754
|
-
${
|
|
753
|
+
${i.setVariable(se.borderRadiusLeft,Rt.borderRadius)};
|
|
754
|
+
${i.setVariable(se.borderWidthLeft,"1px")};
|
|
755
755
|
}
|
|
756
756
|
|
|
757
757
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
758
|
-
${
|
|
758
|
+
${i.setVariable(se.borderRadiusRight,Rt.borderRadius)};
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
762
762
|
--ft-switch-internal-vertical-padding: 2px;
|
|
763
763
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
764
764
|
}
|
|
765
|
-
`,
|
|
765
|
+
`,de([o.property({type:Boolean})],fe.prototype,"dense",void 0),de([o.property({type:Boolean})],fe.prototype,"unselectable",void 0),de([o.query(".ft-switch slot")],fe.prototype,"slottedContent",void 0),de([o.state()],fe.prototype,"selectedOption",void 0),de([o.query(".ft-switch")],fe.prototype,"ftSwitchDiv",void 0),i.customElement("ft-switch")(fe),i.customElement("ft-switch-option")(he);const pe=i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),ue=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),ve=e.css`
|
|
766
766
|
:host {
|
|
767
767
|
display: block;
|
|
768
768
|
}
|
|
@@ -773,17 +773,17 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
773
773
|
|
|
774
774
|
ft-icon {
|
|
775
775
|
transform: rotate(-45deg);
|
|
776
|
-
color: ${
|
|
776
|
+
color: ${pe};
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
.ft-resizer--dragging ft-icon,
|
|
780
780
|
.ft-resizer:hover ft-icon {
|
|
781
|
-
color: ${
|
|
781
|
+
color: ${ue};
|
|
782
782
|
}
|
|
783
|
-
`;var
|
|
783
|
+
`;var ge=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class be extends CustomEvent{constructor(t,i){super("resize",{detail:{width:t,height:i}})}}class xe extends i.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=ji.material,this.cursor="nwse-resize",this.dragging=!1,this.fixedWidth=0,this.fixedHeight=0,this.startX=0,this.startY=0,this.doDragFromMouse=t=>this.doDrag(t.clientX,t.clientY),this.doDragFromTouch=t=>this.doDrag(t.touches[0].clientX,t.touches[0].clientY),this.stopDrag=()=>{this.dragging=!1,document.removeEventListener("mousemove",this.doDragFromMouse,!1),document.removeEventListener("mouseup",this.stopDrag,!1),document.removeEventListener("touchmove",this.doDragFromTouch,!1),document.removeEventListener("touchend",this.stopDrag,!1),document.removeEventListener("touchcancel",this.stopDrag,!1)}}render(){return e.html`
|
|
784
784
|
<style>
|
|
785
785
|
.ft-resizer {
|
|
786
|
-
cursor: ${
|
|
786
|
+
cursor: ${e.unsafeCSS(this.cursor)}
|
|
787
787
|
}
|
|
788
788
|
</style>
|
|
789
789
|
<div class="ft-resizer ft-no-text-select ${this.dragging?"ft-resizer--dragging":""}"
|
|
@@ -791,25 +791,25 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
791
791
|
@touchstart=${this.initDragFromTouch}>
|
|
792
792
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
793
793
|
</div>
|
|
794
|
-
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,
|
|
794
|
+
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,i){this.dragging=!0,this.startX=t,this.startY=i,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,i){let e=this.fixedWidth+t-this.startX,o=this.fixedHeight+i-this.startY;this.dispatchEvent(new be(e,o))}}xe.elementDefinitions={"ft-icon":Ki},xe.styles=[i.noTextSelect,ve],ge([o.property({type:Number})],xe.prototype,"initialWidth",void 0),ge([o.property({type:Number})],xe.prototype,"initialHeight",void 0),ge([o.property()],xe.prototype,"icon",void 0),ge([o.property()],xe.prototype,"iconVariant",void 0),ge([o.property()],xe.prototype,"cursor",void 0),ge([o.state()],xe.prototype,"dragging",void 0),i.customElement("ft-resizer")(xe);const ye={fontSize:i.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:i.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:i.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:i.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:i.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:i.FtCssVariableFactory.extend("--ft-input-label-border-color",i.designSystemVariables.colorOutline),textColor:i.FtCssVariableFactory.extend("--ft-input-label-text-color",i.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:i.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",i.designSystemVariables.colorOnSurfaceDisabled),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},me=e.css`
|
|
795
795
|
.ft-input-label {
|
|
796
796
|
position: absolute;
|
|
797
797
|
inset: 0;
|
|
798
798
|
display: flex;
|
|
799
|
-
background-color: ${
|
|
800
|
-
border-radius: ${
|
|
799
|
+
background-color: ${ye.colorSurface};
|
|
800
|
+
border-radius: ${ye.borderRadiusS} ${ye.borderRadiusS} 0 0;
|
|
801
801
|
}
|
|
802
802
|
|
|
803
803
|
.ft-input-label--outlined {
|
|
804
|
-
border-radius: ${
|
|
804
|
+
border-radius: ${ye.borderRadiusS};
|
|
805
805
|
}
|
|
806
806
|
|
|
807
807
|
.ft-input-label {
|
|
808
|
-
border-color: ${
|
|
808
|
+
border-color: ${ye.borderColor};
|
|
809
809
|
}
|
|
810
810
|
|
|
811
811
|
.ft-input-label.ft-input-label--in-error {
|
|
812
|
-
border-color: ${
|
|
812
|
+
border-color: ${ye.colorError}
|
|
813
813
|
}
|
|
814
814
|
|
|
815
815
|
.ft-input-label:before,
|
|
@@ -822,7 +822,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
822
822
|
}
|
|
823
823
|
|
|
824
824
|
.ft-input-label:before {
|
|
825
|
-
width: calc(${
|
|
825
|
+
width: calc(${ye.horizontalSpacing} - 4px);
|
|
826
826
|
flex-shrink: 0;
|
|
827
827
|
}
|
|
828
828
|
|
|
@@ -838,20 +838,20 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
838
838
|
border-bottom-width: 1px;
|
|
839
839
|
border-bottom-style: solid;
|
|
840
840
|
border-color: inherit;
|
|
841
|
-
color: ${
|
|
841
|
+
color: ${ye.textColor};
|
|
842
842
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
843
|
-
max-width: calc(${
|
|
843
|
+
max-width: calc(${ye.labelMaxWidth} - 2 * (${ye.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
844
844
|
text-overflow: ellipsis;
|
|
845
|
-
${
|
|
846
|
-
${
|
|
845
|
+
${i.setVariable(V.fontSize,ye.fontSize)};
|
|
846
|
+
${i.setVariable(V.lineHeight,ye.fontSize)};
|
|
847
847
|
}
|
|
848
848
|
|
|
849
849
|
.ft-input-label--in-error .ft-input-label--text {
|
|
850
|
-
color: ${
|
|
850
|
+
color: ${ye.colorError}
|
|
851
851
|
}
|
|
852
852
|
|
|
853
853
|
.ft-input-label--disabled .ft-input-label--text {
|
|
854
|
-
color: ${
|
|
854
|
+
color: ${ye.disabledTextColor};
|
|
855
855
|
}
|
|
856
856
|
|
|
857
857
|
.ft-input-label--hidden-text {
|
|
@@ -868,19 +868,19 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
868
868
|
overflow: hidden;
|
|
869
869
|
white-space: nowrap;
|
|
870
870
|
text-overflow: ellipsis;
|
|
871
|
-
padding: ${
|
|
872
|
-
margin: calc(${
|
|
871
|
+
padding: ${ye.verticalSpacing} 4px;
|
|
872
|
+
margin: calc(${ye.verticalSpacing} * -1) 0;
|
|
873
873
|
max-width: 100%;
|
|
874
874
|
box-sizing: border-box;
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
.ft-input-label--raised .ft-input-label--text {
|
|
878
|
-
${
|
|
879
|
-
${
|
|
878
|
+
${i.setVariable(V.fontSize,ye.raisedFontSize)};
|
|
879
|
+
${i.setVariable(V.lineHeight,ye.raisedFontSize)};
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
883
|
-
top: ${
|
|
883
|
+
top: ${ye.verticalSpacing};
|
|
884
884
|
}
|
|
885
885
|
|
|
886
886
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -893,36 +893,36 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
893
893
|
.ft-input-label--outlined:before {
|
|
894
894
|
border-left-width: 1px;
|
|
895
895
|
border-left-style: solid;
|
|
896
|
-
border-radius: ${
|
|
896
|
+
border-radius: ${ye.borderRadiusS} 0 0 ${ye.borderRadiusS};
|
|
897
897
|
}
|
|
898
898
|
|
|
899
899
|
.ft-input-label--outlined:after {
|
|
900
900
|
border-right-width: 1px;
|
|
901
901
|
border-right-style: solid;
|
|
902
|
-
border-radius: 0 ${
|
|
902
|
+
border-radius: 0 ${ye.borderRadiusS} ${ye.borderRadiusS} 0;
|
|
903
903
|
}
|
|
904
904
|
|
|
905
905
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
906
906
|
padding: 2px 4px;
|
|
907
|
-
z-index: ${
|
|
908
|
-
background-color: ${
|
|
909
|
-
border-radius: ${
|
|
907
|
+
z-index: ${ye.raisedZIndex};
|
|
908
|
+
background-color: ${ye.colorSurface};
|
|
909
|
+
border-radius: ${ye.borderRadiusS};
|
|
910
910
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
911
911
|
}
|
|
912
912
|
|
|
913
913
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
914
914
|
border-top: none;
|
|
915
915
|
}
|
|
916
|
-
`;var
|
|
916
|
+
`;var $e=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class we extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return e.html`
|
|
917
917
|
<div class="${n.classMap(t)}">
|
|
918
|
-
${this.text?
|
|
918
|
+
${this.text?e.html`
|
|
919
919
|
<div class="ft-input-label--text ft-typography--caption">
|
|
920
920
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
921
921
|
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
922
922
|
</div>
|
|
923
923
|
`:null}
|
|
924
924
|
</div>
|
|
925
|
-
`}}
|
|
925
|
+
`}}we.elementDefinitions={},we.styles=[ct,me],$e([o.property({type:String})],we.prototype,"text",void 0),$e([o.property({type:Boolean})],we.prototype,"raised",void 0),$e([o.property({type:Boolean})],we.prototype,"outlined",void 0),$e([o.property({type:Boolean})],we.prototype,"disabled",void 0),$e([o.property({type:Boolean})],we.prototype,"error",void 0),i.customElement("ft-input-label")(we);const ke={fontSize:i.FtCssVariableFactory.create("--ft-text-area-font-size","SIZE","14px"),labelSize:i.FtCssVariableFactory.create("--ft-text-area-label-size","SIZE","11px"),verticalSpacing:i.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","SIZE","16px"),helperColor:i.FtCssVariableFactory.extend("--ft-text-area-helper-color",i.designSystemVariables.colorOnSurfaceMedium),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},Se=e.css`
|
|
926
926
|
*:focus {
|
|
927
927
|
outline: none;
|
|
928
928
|
}
|
|
@@ -934,10 +934,10 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
934
934
|
}
|
|
935
935
|
|
|
936
936
|
ft-input-label {
|
|
937
|
-
${
|
|
938
|
-
${
|
|
939
|
-
${
|
|
940
|
-
${
|
|
937
|
+
${i.setVariable(ye.fontSize,ke.fontSize)};
|
|
938
|
+
${i.setVariable(ye.raisedFontSize,ke.labelSize)};
|
|
939
|
+
${i.setVariable(ye.verticalSpacing,ke.verticalSpacing)};
|
|
940
|
+
${i.setVariable(ye.horizontalSpacing,ke.horizontalSpacing)};
|
|
941
941
|
}
|
|
942
942
|
|
|
943
943
|
.ft-text-area--main-panel {
|
|
@@ -955,8 +955,8 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
955
955
|
}
|
|
956
956
|
|
|
957
957
|
.ft-text-area--input-panel ft-ripple {
|
|
958
|
-
${
|
|
959
|
-
${
|
|
958
|
+
${i.setVariable(p.opacityContentOnSurfaceHover,"0.08")};
|
|
959
|
+
${i.setVariable(p.opacityContentOnSurfacePressed,"0.04")};
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
.ft-text-area--input {
|
|
@@ -968,12 +968,12 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
968
968
|
align-self: stretch;
|
|
969
969
|
resize: none;
|
|
970
970
|
|
|
971
|
-
${
|
|
972
|
-
${
|
|
973
|
-
color: ${
|
|
971
|
+
${i.setVariable(B.fontSize,ke.fontSize)};
|
|
972
|
+
${i.setVariable(B.lineHeight,ke.fontSize)};
|
|
973
|
+
color: ${ke.colorOnSurface};
|
|
974
974
|
|
|
975
|
-
padding: 0 ${
|
|
976
|
-
margin: calc(${
|
|
975
|
+
padding: 0 ${ke.horizontalSpacing};
|
|
976
|
+
margin: calc(${ke.verticalSpacing} + ${ke.labelSize} / 2) 0 ${ke.verticalSpacing} 0;
|
|
977
977
|
|
|
978
978
|
border: none;
|
|
979
979
|
background: none;
|
|
@@ -982,7 +982,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
.ft-text-area--disabled .ft-text-area--input {
|
|
985
|
-
color: ${
|
|
985
|
+
color: ${ke.colorOnSurfaceDisabled};
|
|
986
986
|
}
|
|
987
987
|
|
|
988
988
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -990,42 +990,42 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
990
990
|
}
|
|
991
991
|
|
|
992
992
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
993
|
-
${
|
|
994
|
-
${
|
|
993
|
+
${i.setVariable(ye.borderColor,ke.colorPrimary)};
|
|
994
|
+
${i.setVariable(ye.textColor,ke.colorPrimary)};
|
|
995
995
|
}
|
|
996
996
|
|
|
997
997
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
998
|
-
border-radius: ${
|
|
998
|
+
border-radius: ${ke.borderRadiusS} ${ke.borderRadiusS} 0 0;
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
1001
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
1002
1002
|
align-self: stretch;
|
|
1003
|
-
margin-bottom: ${
|
|
1004
|
-
margin-top: calc(${
|
|
1003
|
+
margin-bottom: ${ke.verticalSpacing};
|
|
1004
|
+
margin-top: calc(${ke.labelSize} + 2 * ${ke.verticalSpacing});
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
1007
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
1008
|
-
border-radius: ${
|
|
1008
|
+
border-radius: ${ke.borderRadiusS};
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
1011
|
.ft-text-area--helper-text {
|
|
1012
|
-
padding: 0 12px 0 ${
|
|
1013
|
-
color: ${
|
|
1012
|
+
padding: 0 12px 0 ${ke.horizontalSpacing};
|
|
1013
|
+
color: ${ke.helperColor};
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
1016
|
.ft-text-area--in-error .ft-text-area--input,
|
|
1017
1017
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
1018
|
-
color: ${
|
|
1018
|
+
color: ${ke.colorError};
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
1021
|
ft-resizer {
|
|
1022
1022
|
position: absolute;
|
|
1023
1023
|
bottom: 0;
|
|
1024
1024
|
}
|
|
1025
|
-
`;var
|
|
1025
|
+
`;var _e=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Te extends(i.toFtFormComponent(i.FtLitElement,"textbox")){constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return e.html`
|
|
1026
1026
|
<style>
|
|
1027
1027
|
.ft-text-area--main-panel {
|
|
1028
|
-
height: calc(4 * ${
|
|
1028
|
+
height: calc(4 * ${ke.verticalSpacing} + ${ke.labelSize} + ${ke.fontSize} + ${this.height}px);
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
1031
1031
|
ft-resizer {
|
|
@@ -1042,7 +1042,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1042
1042
|
></ft-input-label>
|
|
1043
1043
|
<div class="ft-text-area--input-panel"
|
|
1044
1044
|
aria-label="${this.label}">
|
|
1045
|
-
${this.outlined?null:
|
|
1045
|
+
${this.outlined?null:e.html`
|
|
1046
1046
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1047
1047
|
`}
|
|
1048
1048
|
<textarea class="ft-typography--body1 ft-text-area--input"
|
|
@@ -1059,19 +1059,19 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1059
1059
|
initialHeight="${this.height}"
|
|
1060
1060
|
cursor="ns-resize"></ft-resizer>
|
|
1061
1061
|
</div>
|
|
1062
|
-
${this.helper?
|
|
1062
|
+
${this.helper?e.html`
|
|
1063
1063
|
<ft-typography class="ft-text-area--helper-text" variant="caption">
|
|
1064
1064
|
${this.helper}
|
|
1065
1065
|
</ft-typography>`:void 0}
|
|
1066
1066
|
</div>
|
|
1067
|
-
`}setValue(t,
|
|
1067
|
+
`}setValue(t,i=!1){this.value=t,this.setFormValue(t),i&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Te.elementDefinitions={"ft-input-label":we,"ft-resizer":xe,"ft-ripple":oe,"ft-typography":Zi},Te.styles=[ht,Se],_e([o.property({type:String})],Te.prototype,"label",void 0),_e([o.property({reflect:!0})],Te.prototype,"value",void 0),_e([o.property({type:String})],Te.prototype,"helper",void 0),_e([o.property({type:Boolean})],Te.prototype,"outlined",void 0),_e([o.property({type:Boolean})],Te.prototype,"disabled",void 0),_e([o.property({type:Boolean})],Te.prototype,"error",void 0),_e([o.property({type:Number,reflect:!0})],Te.prototype,"height",void 0),_e([o.query("textarea")],Te.prototype,"textarea",void 0),_e([o.state()],Te.prototype,"focused",void 0),i.customElement("ft-text-area")(Te);class Ee extends i.FtLitElement{render(){return e.html`
|
|
1068
1068
|
<div class="ft-loader">
|
|
1069
1069
|
<div></div>
|
|
1070
1070
|
<div></div>
|
|
1071
1071
|
<div></div>
|
|
1072
1072
|
<div></div>
|
|
1073
1073
|
</div>
|
|
1074
|
-
`}}
|
|
1074
|
+
`}}Ee.styles=bt,i.customElement("ft-loader")(Ee);var Ie=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Re extends(i.toFtFormComponent(i.FtLitElement,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var i;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(i=this.form)||void 0===i||i.requestSubmit())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
1075
1075
|
<button part="button"
|
|
1076
1076
|
class="${n.classMap(t)}"
|
|
1077
1077
|
aria-label="${this.getLabel()}"
|
|
@@ -1080,29 +1080,29 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1080
1080
|
<ft-typography part="label"
|
|
1081
1081
|
variant="button"
|
|
1082
1082
|
element="span"
|
|
1083
|
-
class="ft-button--label ${
|
|
1083
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
1084
1084
|
?hidden=${!this.hasTextContent()}>
|
|
1085
1085
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
1086
1086
|
</ft-typography>
|
|
1087
1087
|
${this.resolveIcon()}
|
|
1088
1088
|
</button>
|
|
1089
|
-
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
`:t}resolveIcon(){return this.loading?
|
|
1096
|
-
<ft-loader part="loader icon"></ft-loader> `:this.icon?
|
|
1097
|
-
|
|
1098
|
-
`,
|
|
1099
|
-
`,
|
|
1089
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
1090
|
+
<ft-tooltip part="tooltip"
|
|
1091
|
+
text="${this.getLabel()}"
|
|
1092
|
+
position="${this.tooltipPosition}">
|
|
1093
|
+
${t}
|
|
1094
|
+
</ft-tooltip>
|
|
1095
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
1096
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
1097
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Re.elementDefinitions={"ft-ripple":oe,"ft-tooltip":ie,"ft-typography":Zi,"ft-icon":Ki,"ft-loader":Ee},Re.styles=[i.safariEllipsisFix,It],Ie([o.property({type:String,reflect:!0})],Re.prototype,"role",void 0),Ie([o.property()],Re.prototype,"type",void 0),Ie([o.property({type:Boolean})],Re.prototype,"primary",void 0),Ie([o.property({type:Boolean})],Re.prototype,"outlined",void 0),Ie([o.property({type:Boolean})],Re.prototype,"disabled",void 0),Ie([o.property({type:Boolean})],Re.prototype,"dense",void 0),Ie([o.property({type:Boolean})],Re.prototype,"round",void 0),Ie([o.property()],Re.prototype,"label",void 0),Ie([o.property()],Re.prototype,"icon",void 0),Ie([o.property()],Re.prototype,"iconVariant",void 0),Ie([o.property({type:Boolean})],Re.prototype,"trailingIcon",void 0),Ie([o.property({type:Boolean})],Re.prototype,"loading",void 0),Ie([o.property()],Re.prototype,"tooltipPosition",void 0),Ie([o.property({type:Boolean})],Re.prototype,"hideTooltip",void 0),Ie([o.property({type:Boolean})],Re.prototype,"forceTooltip",void 0),Ie([o.query(".ft-button")],Re.prototype,"button",void 0),Ie([o.query(".ft-button--label slot")],Re.prototype,"slottedContent",void 0),i.customElement("ft-button")(Re);const Ce=e.css`
|
|
1098
|
+
`,Ae=e.css`
|
|
1099
|
+
`,Oe=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Ne{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Oe.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?Ne.build(t):null!==(i=Ne.API)&&void 0!==i?i:Ne.API=Ne.build()}static await(t){return new Promise((i=>{let e=Ne.get(t);if(e)i(e);else{const o=Oe.subscribe((()=>{e=Ne.get(t),e&&(o(),i(e))}))}}))}}var Ue;const De=Symbol("clearAfterUnitTest");class ze{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ue]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Oe.getState().uiLocale,Oe.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Oe.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}Ue=De,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new ze((async(t,i)=>(await Ne.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new ze((async(t,i)=>(await Ne.await()).getCustomMessageContext(t,i))));const Me=window.FluidTopicsI18nService,Be=window.FluidTopicsCustomI18nService;var Pe=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Le extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Ne.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
1100
1100
|
<slot></slot>
|
|
1101
|
-
`}update(t){super.update(t),t.has("baseUrl")&&
|
|
1101
|
+
`}update(t){super.update(t),t.has("baseUrl")&&Oe.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Oe.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Oe.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Oe.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Oe.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Oe.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Oe.actions.setSession(this.session),t.has("availableUiLocales")&&Oe.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Me.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Le.elementDefinitions={},Le.styles=Ae,Pe([o.property()],Le.prototype,"baseUrl",void 0),Pe([o.property()],Le.prototype,"apiIntegrationIdentifier",void 0),Pe([o.property()],Le.prototype,"uiLocale",void 0),Pe([i.jsonProperty([])],Le.prototype,"availableUiLocales",void 0),Pe([o.property({type:Boolean})],Le.prototype,"editorMode",void 0),Pe([o.property({type:Boolean})],Le.prototype,"noCustom",void 0),Pe([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Le.prototype,"noCustomComponent",void 0),Pe([o.property({type:Boolean})],Le.prototype,"withManualResources",void 0),Pe([i.jsonProperty([])],Le.prototype,"messageContexts",void 0),Pe([i.jsonProperty(void 0)],Le.prototype,"session",void 0),Pe([o.property({type:Object})],Le.prototype,"apiProvider",void 0);class Fe{async listMySearches(){var t;return(null===(t=Oe.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ne.await()).listMySearches(Oe.getState().session.profile.userId):[]}}const je=new i.CacheRegistry;class He{async listMyBookmarks(){return je.get("bookmarks",(async()=>(await Ne.await()).listMyBookmarks(Oe.getState().session.profile.userId)))}clearCache(){je.clear("bookmarks")}}const Ze=i.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Ve=new class{constructor(){this.currentSession=Oe.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new He,Oe.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Oe.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Ze.actions.savedSearches(void 0)}clearMyBookmarks(){Ze.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Fe,i=await t.listMySearches();Ze.actions.savedSearches(i)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Ze.actions.bookmarks(i)}}};i.customElement("ft-app-context")(Le);var Ke=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const We=Symbol("i18nProperties"),Ge=Symbol("i18nUnsubs");function qe(t){var i;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[i]=new Map}get i18nService(){return this.useCustomMessageContexts?Be:Me}i18n(t,i,...e){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,i,...e);const s=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...s)}onI18nUpdate(t){var i;null===(i=this[We])||void 0===i||i.forEach(((i,e)=>{i.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(i))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var i;super.update(t),null===(i=this[We])||void 0===i||i.forEach(((t,i)=>{null!=t.argsProvider&&(this[i]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[We]&&new Set([...this[We].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,i){t=t.toLowerCase(),this[Ge].has(t)||this[Ge].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=i?i:{})}addI18nContext(t,i){this.addI18nMessages(t.name,i)}disconnectedCallback(){super.disconnectedCallback(),this[Ge].forEach((t=>t())),this[Ge].clear()}}return i=Ge,Ke([o.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class Xe extends(qe(i.FtLitElement)){}class Ye extends(qe(i.FtLitElementRedux)){}var Je=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Qe extends Ye{constructor(){super(),this.editorMode=!1,this.addStore(Oe)}render(){return this.key&&this.context?e.html`
|
|
1102
1102
|
<span class="ft-i18n">
|
|
1103
1103
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1104
1104
|
</span>
|
|
1105
|
-
`:this.editorMode?"Select a context and a label key.":
|
|
1105
|
+
`:this.editorMode?"Select a context and a label key.":e.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}Qe.elementDefinitions={},Qe.styles=Ce,Je([i.redux()],Qe.prototype,"editorMode",void 0),Je([o.property()],Qe.prototype,"context",void 0),Je([o.property()],Qe.prototype,"key",void 0),Je([i.jsonProperty([])],Qe.prototype,"args",void 0),Je([o.property()],Qe.prototype,"defaultMessage",void 0);class to{static build(t){return new to(t)}static fromGwt(t){return new to(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,i)=>{const e=i;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,i)=>(...t)=>Me.resolveMessage(this.name,i,...t)})}}const io=(t,i)=>(e,o)=>{var s,n;e.constructor.createProperty(o,null!=i?i:{attribute:!1,type:String});const r={...t,key:null!==(s=t.key)&&void 0!==s?s:o};e[We]=null!==(n=e[We])&&void 0!==n?n:new Map,e[We].set(o,r)};i.customElement("ft-i18n")(Qe);const eo=to.build("integratedFeedbackComponent"),oo={starsRating:"{0} stars","starsRating[\\=1]":"1 star",like:"Like",dislike:"Dislike",dichotomousYes:"Yes",dichotomousNo:"No",notRated:"Not rated",ratedNow:"Rated now",ratedToday:"Rated today",ratedOn:"Rated on {0, date}",feedbackInputLabel:"How can we improve it?",feedbackfromEmail:"Your email",feedbackfromEmailInvalid:"Please enter a valid email address",okButton:"Send feedback",cancelButton:"Cancel",feedbackSuccess:"Feedback successfully sent. Thank you!",feedbackFailure:"Failed to send feedback. Please try again later.",ratingSuccess:"Rating successfully sent. Thank you!",ratingFailure:"Failed to send rating. Please try again later.",mapFeedbackMainTitle:"Send feedback",mapRatingSectionTitle:"Rate this document",mapDichotomousRatingSectionTitle:"Did it solve your problem?",mapFeedbackSectionTitle:"Write your review",topicFeedbackMainTitle:"Send feedback",topicRatingSectionTitle:"Rate this content",topicDichotomousRatingSectionTitle:"Did this content solve your problem?",topicFeedbackSectionTitle:"Write your review"},so=to.build("inDesignerFeedbackComponent"),no={ratingNotConfigured:"Rating unavailable: no rating configured for this content.",missingRatingRole:"Rating unavailable: missing role RATING_USER.",missingFeedbackRole:"Feedback unavailable: missing role FEEDBACK_USER.",inDesignerOnlyNotice:"This notice will not appear outside this designer.",feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."},ro={fontSize:i.FtCssVariableFactory.create("--ft-text-field-font-size","SIZE","14px"),labelSize:i.FtCssVariableFactory.create("--ft-text-field-label-size","SIZE","11px"),verticalSpacing:i.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","SIZE","16px"),helperColor:i.FtCssVariableFactory.extend("--ft-text-field-helper-color",i.designSystemVariables.colorOnSurfaceMedium),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system"),prefixColor:i.FtCssVariableFactory.extend("--ft-text-field-prefix-color",i.designSystemVariables.colorOnSurfaceMedium),iconColor:i.FtCssVariableFactory.extend("--ft-text-field-icon-color",i.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:i.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","NUMBER","3"),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),colorOutline:i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),elevation02:i.FtCssVariableFactory.external(i.designSystemVariables.elevation02,"Design system"),suggestSize:i.FtCssVariableFactory.create("--ft-text-field-suggest-size","SIZE","300px")},ao=e.css`
|
|
1106
1106
|
*:focus {
|
|
1107
1107
|
outline: none;
|
|
1108
1108
|
}
|
|
@@ -1115,16 +1115,16 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
1117
|
ft-input-label {
|
|
1118
|
-
${
|
|
1119
|
-
${
|
|
1120
|
-
${
|
|
1121
|
-
${
|
|
1118
|
+
${i.setVariable(ye.fontSize,ro.fontSize)};
|
|
1119
|
+
${i.setVariable(ye.raisedFontSize,ro.labelSize)};
|
|
1120
|
+
${i.setVariable(ye.verticalSpacing,ro.verticalSpacing)};
|
|
1121
|
+
${i.setVariable(ye.horizontalSpacing,ro.horizontalSpacing)};
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
1124
|
.ft-text-field--main-panel {
|
|
1125
1125
|
position: relative;
|
|
1126
1126
|
display: flex;
|
|
1127
|
-
height: calc(4 * ${
|
|
1127
|
+
height: calc(4 * ${ro.verticalSpacing} + ${ro.labelSize} + ${ro.fontSize});
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
1130
|
.ft-text-field--input-panel {
|
|
@@ -1133,24 +1133,24 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1133
1133
|
display: flex;
|
|
1134
1134
|
align-items: center;
|
|
1135
1135
|
overflow: hidden;
|
|
1136
|
-
padding: 0 ${
|
|
1136
|
+
padding: 0 ${ro.horizontalSpacing};
|
|
1137
1137
|
|
|
1138
|
-
${
|
|
1139
|
-
${
|
|
1138
|
+
${i.setVariable(B.fontSize,ro.fontSize)};
|
|
1139
|
+
${i.setVariable(B.lineHeight,ro.fontSize)};
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
1142
|
.ft-text-field--input-panel ft-ripple {
|
|
1143
|
-
${
|
|
1144
|
-
${
|
|
1143
|
+
${i.setVariable(p.opacityContentOnSurfaceHover,"0.08")};
|
|
1144
|
+
${i.setVariable(p.opacityContentOnSurfacePressed,"0.04")};
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
1147
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
1148
1148
|
align-items: flex-end;
|
|
1149
|
-
padding: 0 ${
|
|
1149
|
+
padding: 0 ${ro.horizontalSpacing} ${ro.verticalSpacing} ${ro.horizontalSpacing};
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
1152
|
.ft-text-field--prefix {
|
|
1153
|
-
color: ${
|
|
1153
|
+
color: ${ro.prefixColor};
|
|
1154
1154
|
margin-right: 2px;
|
|
1155
1155
|
flex-shrink: 1;
|
|
1156
1156
|
overflow: hidden;
|
|
@@ -1169,15 +1169,15 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1169
1169
|
flex-shrink: 1;
|
|
1170
1170
|
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
1171
1171
|
|
|
1172
|
-
color: ${
|
|
1173
|
-
padding: calc(2 * ${
|
|
1172
|
+
color: ${ro.colorOnSurface};
|
|
1173
|
+
padding: calc(2 * ${ro.verticalSpacing}) 0;
|
|
1174
1174
|
border: none;
|
|
1175
1175
|
background: none;
|
|
1176
1176
|
}
|
|
1177
1177
|
|
|
1178
1178
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
|
|
1179
1179
|
padding-bottom: 0;
|
|
1180
|
-
padding-top: calc(${
|
|
1180
|
+
padding-top: calc(${ro.labelSize} + 2 * ${ro.verticalSpacing});
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
1183
|
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
@@ -1186,37 +1186,37 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1186
1186
|
}
|
|
1187
1187
|
|
|
1188
1188
|
.ft-text-field--disabled .ft-text-field--input {
|
|
1189
|
-
color: ${
|
|
1189
|
+
color: ${ro.colorOnSurfaceDisabled};
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
1192
1192
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
1193
|
-
${
|
|
1194
|
-
${
|
|
1193
|
+
${i.setVariable(ye.borderColor,ro.colorPrimary)};
|
|
1194
|
+
${i.setVariable(ye.textColor,ro.colorPrimary)};
|
|
1195
1195
|
}
|
|
1196
1196
|
|
|
1197
1197
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
1198
|
-
border-radius: ${
|
|
1198
|
+
border-radius: ${ro.borderRadiusS} ${ro.borderRadiusS} 0 0;
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
1201
|
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
1202
|
-
border-radius: ${
|
|
1202
|
+
border-radius: ${ro.borderRadiusS};
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
1205
1205
|
.ft-text-field--helper-text {
|
|
1206
|
-
padding: 0 12px 0 ${
|
|
1207
|
-
color: ${
|
|
1206
|
+
padding: 0 12px 0 ${ro.horizontalSpacing};
|
|
1207
|
+
color: ${ro.helperColor};
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
1210
|
.ft-text-field--in-error .ft-text-field--input,
|
|
1211
1211
|
.ft-text-field--in-error .ft-text-field--helper-text,
|
|
1212
1212
|
.ft-text-field--in-error .ft-text-field--prefix {
|
|
1213
|
-
color: ${
|
|
1213
|
+
color: ${ro.colorError};
|
|
1214
1214
|
}
|
|
1215
1215
|
|
|
1216
1216
|
.ft-text-field--icon {
|
|
1217
1217
|
align-self: center;
|
|
1218
1218
|
margin-left: 8px;
|
|
1219
|
-
color: ${
|
|
1219
|
+
color: ${ro.iconColor};
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
1222
|
.ft-text-field--container {
|
|
@@ -1229,13 +1229,13 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1229
1229
|
position: absolute;
|
|
1230
1230
|
left: 0;
|
|
1231
1231
|
right: 0;
|
|
1232
|
-
z-index: ${
|
|
1233
|
-
background: ${
|
|
1234
|
-
border: 1px solid ${
|
|
1235
|
-
border-radius: 0 0 ${
|
|
1236
|
-
box-shadow: ${
|
|
1232
|
+
z-index: ${ro.floatingZIndex};
|
|
1233
|
+
background: ${ro.colorSurface};
|
|
1234
|
+
border: 1px solid ${ro.colorOutline};
|
|
1235
|
+
border-radius: 0 0 ${ro.borderRadiusS} ${ro.borderRadiusS};
|
|
1236
|
+
box-shadow: ${ro.elevation02};
|
|
1237
1237
|
outline: none;
|
|
1238
|
-
max-height: ${
|
|
1238
|
+
max-height: ${ro.suggestSize};
|
|
1239
1239
|
overflow-y: auto;
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
@@ -1252,13 +1252,13 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
1254
|
.ft-text-field--with-icon {
|
|
1255
|
-
${
|
|
1255
|
+
${i.setVariable(ye.labelMaxWidth,`calc(100% - ${xt.size} - ${ye.horizontalSpacing})`)};
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
1258
1258
|
.ft-text-field--with-password ft-icon:hover {
|
|
1259
1259
|
cursor: pointer;
|
|
1260
1260
|
}
|
|
1261
|
-
`;var
|
|
1261
|
+
`;var lo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ho extends(i.toFtFormComponent(i.FtLitElement,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Li.EYE_SLASH,this.passwordRevealedIcon=Li.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const i=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",i)}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.password};return e.html`
|
|
1262
1262
|
<div class="${n.classMap(t)}">
|
|
1263
1263
|
<div class="ft-text-field--main-panel"
|
|
1264
1264
|
@keydown=${this.handleKeyboardNavigation}
|
|
@@ -1269,16 +1269,16 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1269
1269
|
?raised=${this.focused||""!=this.value}
|
|
1270
1270
|
?error=${this.error}></ft-input-label>
|
|
1271
1271
|
<div class="ft-text-field--input-panel">
|
|
1272
|
-
${this.outlined?
|
|
1272
|
+
${this.outlined?e.nothing:e.html`
|
|
1273
1273
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1274
1274
|
`}
|
|
1275
|
-
${this.prefix?
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1275
|
+
${this.prefix?e.html`
|
|
1276
|
+
<ft-typography class="ft-text-field--prefix" vaiant="body1">
|
|
1277
|
+
${this.prefix}
|
|
1278
|
+
</ft-typography>
|
|
1279
|
+
`:e.nothing}
|
|
1280
1280
|
<input type=${this.password&&this.hidePassword?"password":"text"}
|
|
1281
|
-
maxlength=${(t=>null!=t?t:
|
|
1281
|
+
maxlength=${(t=>null!=t?t:yi)(this.maxLength||void 0)}
|
|
1282
1282
|
aria-label="${this.label}"
|
|
1283
1283
|
class="ft-typography--body1 ft-text-field--input"
|
|
1284
1284
|
?disabled=${this.disabled}
|
|
@@ -1293,23 +1293,23 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1293
1293
|
<slot @slotchange=${()=>this.filterSuggestionsIfNeeded()}></slot>
|
|
1294
1294
|
</div>
|
|
1295
1295
|
</div>
|
|
1296
|
-
${this.helper?
|
|
1296
|
+
${this.helper?e.html`
|
|
1297
1297
|
<ft-typography class="ft-text-field--helper-text" variant="caption">
|
|
1298
1298
|
${this.helper}
|
|
1299
1299
|
</ft-typography>
|
|
1300
|
-
`:
|
|
1300
|
+
`:e.nothing}
|
|
1301
1301
|
</div>
|
|
1302
|
-
`}renderPasswordIcon(){return
|
|
1302
|
+
`}renderPasswordIcon(){return e.html`
|
|
1303
1303
|
<ft-icon class="ft-text-field--icon"
|
|
1304
1304
|
.variant=${this.iconVariant}
|
|
1305
1305
|
.value=${this.hidePassword?this.passwordHiddenIcon:this.passwordRevealedIcon}
|
|
1306
1306
|
@click=${()=>this.togglePasswordVisibility()}></ft-icon>
|
|
1307
|
-
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?
|
|
1307
|
+
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?e.html`
|
|
1308
1308
|
<ft-icon class="ft-text-field--icon"
|
|
1309
1309
|
.variant=${this.iconVariant}
|
|
1310
1310
|
.value=${this.icon}
|
|
1311
1311
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
1312
|
-
`:
|
|
1312
|
+
`:e.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var i,e;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(i=this.input)||void 0===i?void 0:i.getBoundingClientRect(),o=null===(e=this.suggestionsContainer)||void 0===e?void 0:e.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,i=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),i&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var i;const e=(null===(i=this.input)||void 0===i?void 0:i.value)||"";this.setValue(e,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var i;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const e=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?e<this.visibleSuggestions.length-1?e+1:0:e>0?e-1:this.visibleSuggestions.length-1,null===(i=this.visibleSuggestions[o])||void 0===i||i.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var i;this.setValue(t.detail,!0),null===(i=this.input)||void 0===i||i.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,i;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(i=this.input)||void 0===i?void 0:i.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}ho.elementDefinitions={"ft-input-label":we,"ft-ripple":oe,"ft-typography":Zi,"ft-icon":Ki},ho.styles=[ht,ao],lo([o.property()],ho.prototype,"label",void 0),lo([o.property({noAccessor:!0})],ho.prototype,"value",null),lo([o.state()],ho.prototype,"dispatchedValue",void 0),lo([o.property()],ho.prototype,"helper",void 0),lo([o.property({type:Boolean})],ho.prototype,"outlined",void 0),lo([o.property({type:Boolean})],ho.prototype,"disabled",void 0),lo([o.property({type:Boolean})],ho.prototype,"error",void 0),lo([o.property()],ho.prototype,"prefix",void 0),lo([o.property()],ho.prototype,"icon",void 0),lo([o.property()],ho.prototype,"passwordHiddenIcon",void 0),lo([o.property()],ho.prototype,"passwordRevealedIcon",void 0),lo([o.property()],ho.prototype,"iconVariant",void 0),lo([o.property({type:Boolean})],ho.prototype,"filterSuggestions",void 0),lo([o.property({type:Number})],ho.prototype,"maxLength",void 0),lo([o.property({type:Boolean})],ho.prototype,"password",void 0),lo([o.state()],ho.prototype,"focused",void 0),lo([o.state()],ho.prototype,"hidePassword",void 0),lo([o.state()],ho.prototype,"suggestionsOnTop",void 0),lo([o.state()],ho.prototype,"hideSuggestions",void 0),lo([o.state()],ho.prototype,"visibleSuggestions",void 0),lo([o.query(".ft-text-field--main-panel")],ho.prototype,"mainPanel",void 0),lo([o.query(".ft-text-field--input")],ho.prototype,"input",void 0),lo([o.query(".ft-text-field--suggestions")],ho.prototype,"suggestionsContainer",void 0),lo([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],ho.prototype,"suggestions",void 0);const co=e.css`
|
|
1313
1313
|
.ft-text-field-suggestion {
|
|
1314
1314
|
position: relative;
|
|
1315
1315
|
padding: 8px 16px;
|
|
@@ -1334,7 +1334,7 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1334
1334
|
slot {
|
|
1335
1335
|
pointer-events: none;
|
|
1336
1336
|
}
|
|
1337
|
-
`;var
|
|
1337
|
+
`;var fo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class po extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class uo extends i.FtLitElement{render(){return e.html`
|
|
1338
1338
|
<div class="ft-text-field-suggestion"
|
|
1339
1339
|
tabindex="-1"
|
|
1340
1340
|
@keydown=${this.onKeyDown}
|
|
@@ -1346,17 +1346,25 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1346
1346
|
<slot></slot>
|
|
1347
1347
|
</ft-typography>
|
|
1348
1348
|
</div>
|
|
1349
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new co(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}po.elementDefinitions={"ft-ripple":ii,"ft-typography":He,"ft-icon":Ke},po.styles=lo,fo([o.property()],po.prototype,"value",void 0),fo([o.query(".ft-text-field-suggestion")],po.prototype,"container",void 0),fo([o.queryAssignedNodes()],po.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(ao),e.customElement("ft-text-field-suggestion")(po),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(ho||(ho={}));var uo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class vo extends(Gi(d)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(to,eo),this.addI18nContext(io,oo)}get canAccessFeedback(){var t;return this.user&&Xt(this.user.roles,"FEEDBACK_USER")&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.FEEDBACK))}get canAccessRating(){var t;return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.RATING))}get userHasRatingRole(){return this.user&&Xt(this.user.roles,"RATING_USER")}get configuredRatingType(){var t,e;return null!==(e=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==e?e:"NO_RATING"}get ratingType(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==i?i:"NO_RATING"}get ratingValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==i?i:-1}get ratingDate(){var t,i;const o=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.date;return"string"==typeof o?e.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?i.html`
|
|
1349
|
+
`}focus(t){var i;null===(i=this.container)||void 0===i||i.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new po(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}uo.elementDefinitions={"ft-ripple":oe,"ft-typography":Zi,"ft-icon":Ki},uo.styles=co,fo([o.property()],uo.prototype,"value",void 0),fo([o.query(".ft-text-field-suggestion")],uo.prototype,"container",void 0),fo([o.queryAssignedNodes()],uo.prototype,"assignedNodes",void 0),i.customElement("ft-text-field")(ho),i.customElement("ft-text-field-suggestion")(uo);class vo{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,i,e){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,e)),null==t.tocId?this.extractPagesToc(t.children,i,e):[{tocId:t.tocId,title:t.title,depth:i,children:this.extractPagesToc(t.children,i+1,t.tocId)}])))}convertNodes(t,i,e){return t.flatMap((t=>{var o,s,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],i,t.tocId),...this.convertNodes(t.children,i,t.tocId)];let r=null===(s=t.prettyUrl)||void 0===s?void 0:s.replace(/^\//,"");const a={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:r,depth:i,parentTocId:e,children:[]};this.register(a);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],i+1,t.tocId),h=this.convertNodes(t.children,i+1,a.tocId);return a.children=[...l,...h],[a]}))}convertSectionNodes(t,i,e){return t.flatMap((t=>{var o;let s=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:s,depth:i,parentTocId:e,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,i+1,t.tocId),[n]}))}buildPage(t,i){var e,o,s,n,r,a;const l={number:this.pages.length+1,title:null!==(e=t.title)&&void 0!==e?e:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(s=t.pageToc)&&void 0!==s?s:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:i?this.buildBreadcrumb(this.nodeByTocId[i]):[]},h=(t,i)=>(i?l.topics:l.hiddenTopics).push(t),d=null!==(r=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==r?r:[];return l.breadcrumb.forEach(((t,i)=>{h(t,d[i])})),t.tocId&&h(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(a=t.pageToc)&&void 0!==a?a:[])),l}registerPage(t){for(let i of[...t.topics,...t.hiddenTopics])this.pageByTocId[i]||(this.pageByTocId[i]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const i=[t.tocId];for(;null==t?void 0:t.parentTocId;)i.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return i}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class go{convertPaginatedToc(t){return new vo(t).build()}}class bo{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,i,e,o){this.converter=t,this.api=i,this.cache=e,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,i;return Xt(null!==(i=null===(t=Oe.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==i?i:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var i;return null===(i=this.enrichedToc)||void 0===i?void 0:i.nodeByTocId[t]}async getPage(t){const i=await this.getEnrichedToc();return i.pages[t-1]||i.pages[0]}async getPageByTocId(t){const i=await this.getEnrichedToc();return i.pageByTocId[t]||i.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,i,e){const o=this.getNavigationData(t,i,e),s=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(s,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,i,e){var o,s;t=t||"root";const n=this.enrichedToc,r=null==n?void 0:n.pageByTocId[t],a=null==n?void 0:n.nodeByTocId[t],l=null==a?void 0:a.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==a?void 0:a.title)&&void 0!==o?o:"",page:i&&r&&r.number!==i?i:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(s=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==s&&s,section:e}}async getAccurateNavigationData(t,i,e){return await this.getEnrichedToc(),this.getNavigationData(t,i,e)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((i=>{var e;return i?{type:i.topics.type,rating:null===(e=i.topics)||void 0===e?void 0:e.ratings.find((i=>i.tocId===t))}:void 0}))}rateMap(t,i){return this.makeRateMapRequest(t,i).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,i){return this.makeMapFeedbackRequest(t,i)}rateTopic(t,i,e){return this.makeRateTopicRequest(t,i,e).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Oe.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,i,e){return this.makeTopicFeedbackRequest(t,i,e)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let i=this.getTocNodeNow(t),e=[{tocId:i.tocId,title:i.title}],o=this.getTocNodeNow(i.parentTocId);for(;o;)e.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return e}isFeatureAccessible(t,{session:i,ratingType:e}){if(!this.isFeatureAvailable(t))return!1;switch(t){case a.FEEDBACK:return Xt(null!=i?i:[],Vt.FEEDBACK_USER);case a.RATING:return Xt(null!=i?i:[],Vt.RATING_USER)&&null!=e&&e!==Mt.NO_RATING;case a.PRINT:return Xt(null!=i?i:[],Vt.PRINT_USER);case a.BOOKMARK:return!!(null==i?void 0:i.sessionAuthenticated);case a.COLLECTIONS:return Xt(null!=i?i:[],Vt.COLLECTION_USER);default:return!1}}}class xo extends bo{static async build(t){return new xo(new go,await Ne.await(),new i.CacheRegistry,t)}fetchMap(t){return this.api.getMap(t)}fetchMapRating(t){return this.api.getMapRating(t)}fetchPages(t){return this.api.getPages(t)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER")}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId)}makeMapFeedbackRequest(t,i){return this.api.sendMapFeedback(this.mapId,t,i)}makeRateMapRequest(t,i){return this.api.rateMap(this.mapId,t,i)}makeRateTopicRequest(t,i,e){return this.api.rateTopic(this.mapId,t,i,e)}makeTopicFeedbackRequest(t,i,e){return this.api.sendTopicFeedback(this.mapId,t,i,e)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class yo{static build(t,e){return new yo((t=>i.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0}}))(t.trim()||"context"),null!=e?e:xo.build)}constructor(t,e){this.store=t,this.reloadDebouncer=new i.Debouncer(10),this.initService(e)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await i.delay(5);return this.service}async navigateToTopic(t,i,e){const o=await this.awaitService(),s=await(null!=e?o.getPage(e):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(s),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,s),section:i})}resolveValidNonRootTocId(t,i){var e,o,s;let n=null!==(e="root"===t?void 0:t)&&void 0!==e?e:i.rootTocId;return i.topics.includes(n)?n:null!==(s=null!==(o=i.topics[0])&&void 0!==o?o:i.hiddenTopics[0])&&void 0!==s?s:"root"}async navigateToPage(t){const i=await this.awaitService();let e=await i.getPage(t);this.store.actions.currentPage(e)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,i;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),null===(t=this.service)||void 0===t||t.clear(),(null===(i=this.service)||void 0===i?void 0:i.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,e,o,s,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(e=this.service)||void 0===e?void 0:e.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(s=this.service)||void 0===s?void 0:s.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof i.CanceledPromiseError||this.errorHandler(t)}}}const mo=e.css`
|
|
1350
|
+
`;class $o extends CustomEvent{constructor(t,i){super("ft-reader-map-loaded",{detail:{map:t,toc:i}})}}class wo extends CustomEvent{constructor(t,i){super("ft-reader-visible-topics-change",{detail:{visibleTopics:i}})}}class ko extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class So extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class _o extends Event{constructor(){super("ft-reader-map-not-found")}}class To extends Event{constructor(){super("ft-reader-map-unauthorized")}}var Eo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Io extends i.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new i.Debouncer(5),this.navigationDebouncer=new i.Debouncer(10),this.addStore(Oe)}render(){return e.html`
|
|
1351
|
+
${this.importStyleIfNeeded()}
|
|
1352
|
+
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
1353
|
+
`}importStyleIfNeeded(){var t,i;const o=null===(t=this.stateManager.service)||void 0===t?void 0:t.themeStylesheet();return!o||window.location.href.startsWith(null!==(i=this.baseUrl)&&void 0!==i?i:"")?e.nothing:e.html`
|
|
1354
|
+
<style>
|
|
1355
|
+
@import "${o}"
|
|
1356
|
+
</style>
|
|
1357
|
+
`}get stateManager(){return null==this._stateManager&&(this._stateManager=yo.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then((t=>{const i=t.fontsStylesheet();if(i&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${i}"]`)){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",i),document.head.append(t)}}))}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),["tocId","section","page","mapId"].some((i=>t.has(i)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var i;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new $o(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(i=this.scrollTarget)||void 0===i?void 0:i.tocId)){const i=t.get("scrollTarget");null!=(null==i?void 0:i.tocId)&&this.scrollToTargetDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(i.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,i.section).then((t=>this.dispatchEvent(new ko(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var i;return this.stateManager.service.getAccurateNavigationData(t,null===(i=this.currentPage)||void 0===i?void 0:i.number)}))).then((t=>{let i=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>{var i;return{tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated,breadcrumb:null===(i=this.stateManager.service)||void 0===i?void 0:i.buildBreadcrumb(t.tocId)}}));this.dispatchEvent(new wo(this.map,i))}))}async reload(){await this.stateManager.reload(),this.navigateToTarget()}navigateToTarget(){this.navigationDebouncer.run((()=>{null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}))}registerComponent(t){t.stopPropagation();const i=t.composedPath()[0];this.register(i)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){const i=t;404===i.status?this.dispatchEvent(new _o):401===i.status?this.dispatchEvent(new To):this.dispatchEvent(new So(t))}reloadBookmarks(){Ve.reloadBookmarks()}}var Ro;Io.styles=mo,Eo([i.redux({store:Oe.name})],Io.prototype,"baseUrl",void 0),Eo([o.property()],Io.prototype,"mapId",void 0),Eo([o.property()],Io.prototype,"tocId",void 0),Eo([o.property()],Io.prototype,"section",void 0),Eo([o.property({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:Ro}})],Io.prototype,"page",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"map",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"toc",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"visibleTopics",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"currentPage",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"scrollTarget",void 0),Eo([o.property({attribute:!1})],Io.prototype,"readerServiceProvider",void 0),i.customElement("ft-reader-context")(Io);var Co=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ao extends(qe(c)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(eo,oo),this.addI18nContext(so,no)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.FEEDBACK,{session:this.session})}get canAccessRating(){var t,i;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type})}get userHasRatingRole(){return this.session&&Xt(this.session,"RATING_USER")}get configuredRatingType(){var t,i;return null!==(i=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==i?i:"NO_RATING"}get ratingType(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.type)&&void 0!==e?e:"NO_RATING"}get ratingValue(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.value)&&void 0!==e?e:-1}get ratingDate(){var t,e;const o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.date;return"string"==typeof o?i.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?e.html`
|
|
1350
1358
|
<div class="ft-reader-feedback">
|
|
1351
|
-
${this.hideTitle?
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1359
|
+
${this.hideTitle?e.nothing:e.html`
|
|
1360
|
+
<ft-typography variant="title" part="main-title">
|
|
1361
|
+
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
1362
|
+
</ft-typography>
|
|
1363
|
+
`}
|
|
1356
1364
|
${this.renderRatingSection()}
|
|
1357
1365
|
${this.renderFeedbackSection()}
|
|
1358
1366
|
</div>
|
|
1359
|
-
`:
|
|
1367
|
+
`:e.nothing}renderRatingSection(){return this.canAccessRating?e.html`
|
|
1360
1368
|
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
1361
1369
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1362
1370
|
${this.i18n("DICHOTOMOUS"===this.ratingSummary.type?this.i18nProperties.dichotomousRatingSectionTitle:this.i18nProperties.ratingSectionTitle)}
|
|
@@ -1366,98 +1374,99 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1366
1374
|
${this.renderRatingDate()}
|
|
1367
1375
|
</ft-typography>
|
|
1368
1376
|
</div>
|
|
1369
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1377
|
+
`:this.placeholderInEditor(this.userHasRatingRole?so.messages.ratingNotConfigured():so.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return eo.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return eo.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?eo.messages.ratedToday():eo.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return e.html`
|
|
1370
1378
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1371
|
-
${r.repeat(new Array(5),((t,
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1379
|
+
${r.repeat(new Array(5),((t,i)=>i),((t,i)=>{let o="STARS"===this.ratingType&&this.ratingValue>i;const s=i+1;return e.html`
|
|
1380
|
+
<ft-button round part="rating-stars-${s}"
|
|
1381
|
+
label="${eo.messages.starsRating(s)}"
|
|
1382
|
+
tooltipPosition="top"
|
|
1383
|
+
.iconVariant=${this.iconVariant}
|
|
1384
|
+
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
1385
|
+
class="ft-reader-feedback--${o?"active":"inactive"}"
|
|
1386
|
+
@click=${()=>this.rate(this.ratingValue===s?void 0:s)}
|
|
1387
|
+
></ft-button>
|
|
1388
|
+
`}))}
|
|
1381
1389
|
</div>
|
|
1382
|
-
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,
|
|
1390
|
+
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,i="LIKE"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1383
1391
|
<ft-switch unselectable
|
|
1384
1392
|
@change=${t=>this.rate(t.detail)}
|
|
1385
1393
|
part="rating rating-like">
|
|
1386
1394
|
<ft-switch-option .value=${1}
|
|
1387
|
-
?selected=${
|
|
1395
|
+
?selected=${i}
|
|
1388
1396
|
.iconVariant=${this.iconVariant}
|
|
1389
|
-
icon="${
|
|
1390
|
-
${
|
|
1397
|
+
icon="${i?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1398
|
+
${eo.messages.like()}
|
|
1391
1399
|
</ft-switch-option>
|
|
1392
1400
|
<ft-switch-option .value=${0}
|
|
1393
1401
|
?selected=${t}
|
|
1394
1402
|
.iconVariant=${this.iconVariant}
|
|
1395
1403
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1396
|
-
${
|
|
1404
|
+
${eo.messages.dislike()}
|
|
1397
1405
|
</ft-switch-option>
|
|
1398
1406
|
</ft-switch>
|
|
1399
|
-
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return
|
|
1407
|
+
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1400
1408
|
<ft-switch unselectable
|
|
1401
1409
|
@change=${t=>this.rate(t.detail)}
|
|
1402
1410
|
part="rating rating-dichotomous">
|
|
1403
1411
|
<ft-switch-option .value=${1}
|
|
1404
1412
|
?selected=${s}>
|
|
1405
|
-
${
|
|
1413
|
+
${eo.messages.dichotomousYes()}
|
|
1406
1414
|
</ft-switch-option>
|
|
1407
1415
|
<ft-switch-option .value=${0}
|
|
1408
1416
|
?selected=${o}>
|
|
1409
|
-
${
|
|
1417
|
+
${eo.messages.dichotomousNo()}
|
|
1410
1418
|
</ft-switch-option>
|
|
1411
1419
|
</ft-switch>
|
|
1412
|
-
`}return
|
|
1420
|
+
`}return e.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,i,o;if(this.canAccessFeedback){const s=this.feedbackMailLinkBuilder(this.feedbackMessage);let n=e.html`
|
|
1413
1421
|
<ft-button primary
|
|
1422
|
+
type="submit" name="submit"
|
|
1414
1423
|
class="ft-reader-feedback--send-feedback"
|
|
1415
1424
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
1416
|
-
@click=${()=>o?this.onMailerFeedbackSent():this.sendFeedback()}
|
|
1417
1425
|
part="send-feedback">
|
|
1418
|
-
${
|
|
1426
|
+
${eo.messages.okButton()}
|
|
1419
1427
|
</ft-button>
|
|
1420
|
-
`;return
|
|
1421
|
-
<a class="ft-reader-feedback--feedback-link" href="${
|
|
1422
|
-
${
|
|
1428
|
+
`;return s&&(n=e.html`
|
|
1429
|
+
<a class="ft-reader-feedback--feedback-link" href="${s}">
|
|
1430
|
+
${n}
|
|
1423
1431
|
</a>
|
|
1424
|
-
`),
|
|
1425
|
-
<
|
|
1432
|
+
`),e.html`
|
|
1433
|
+
<form class="ft-reader-feedback--feedback" part="feedback-container" autocomplete="on"
|
|
1434
|
+
@submit="${t=>this.onFormSubmitEvent(t,!!s)}">
|
|
1426
1435
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1427
1436
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
1428
1437
|
</ft-typography>
|
|
1429
|
-
${null==(null===(t=this.
|
|
1430
|
-
<ft-text-field outlined
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1438
|
+
${null==(null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)&&(null===(o=this.configuration)||void 0===o?void 0:o.mailsSentByFluidTopicsForUnauthenticatedUsers)?e.html`
|
|
1439
|
+
<ft-text-field outlined name="email" type="email" autocomplete="email"
|
|
1440
|
+
class="ft-reader-feedback--from-input"
|
|
1441
|
+
label=${eo.messages.feedbackfromEmail()}
|
|
1442
|
+
@change=${t=>this.from=t.detail.trim()}
|
|
1443
|
+
?error=${this.from&&!this.validFromEmail()}
|
|
1444
|
+
helper=${this.from&&!this.validFromEmail()?eo.messages.feedbackfromEmailInvalid():""}
|
|
1436
1445
|
/>
|
|
1437
|
-
`:
|
|
1446
|
+
`:e.nothing}
|
|
1438
1447
|
<ft-text-area outlined
|
|
1439
1448
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1440
|
-
label="${
|
|
1449
|
+
label="${eo.messages.feedbackInputLabel()}"
|
|
1441
1450
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1442
1451
|
></ft-text-area>
|
|
1443
|
-
${
|
|
1444
|
-
</
|
|
1445
|
-
`}return this.placeholderInEditor(
|
|
1452
|
+
${n}
|
|
1453
|
+
</form>
|
|
1454
|
+
`}return this.placeholderInEditor(so.messages.missingFeedbackRole())}onFormSubmitEvent(t,i){t.preventDefault(),i?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,i,e;return!(null==(null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)&&(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?e.html`
|
|
1446
1455
|
<div class="ft-reader-feedback--placeholder">
|
|
1447
1456
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1448
1457
|
<ft-tooltip position="left"
|
|
1449
|
-
text="${
|
|
1458
|
+
text="${so.messages.inDesignerOnlyNotice()}">
|
|
1450
1459
|
<ft-icon>INFO</ft-icon>
|
|
1451
1460
|
</ft-tooltip>
|
|
1452
1461
|
</div>
|
|
1453
|
-
`:
|
|
1462
|
+
`:e.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Ao.elementDefinitions={"ft-button":Re,"ft-typography":Zi,"ft-icon":Ki,"ft-tooltip":ie,"ft-switch":fe,"ft-switch-option":he,"ft-text-area":Te,"ft-text-field":ho},Ao.styles=At,Co([o.property({type:Boolean})],Ao.prototype,"editorMode",void 0),Co([o.property({type:Boolean})],Ao.prototype,"hideTitle",void 0),Co([o.property({type:Boolean})],Ao.prototype,"ratingAllowed",void 0),Co([o.property({attribute:!1})],Ao.prototype,"i18nProperties",void 0),Co([o.property({attribute:!1})],Ao.prototype,"ratingSummary",void 0),Co([o.property({attribute:!1})],Ao.prototype,"session",void 0),Co([o.query(".ft-reader-feedback--feedback-input")],Ao.prototype,"feedbackInput",void 0),Co([o.state()],Ao.prototype,"from",void 0),Co([o.state()],Ao.prototype,"feedbackMessage",void 0),Co([o.property()],Ao.prototype,"iconVariant",void 0),Co([o.property()],Ao.prototype,"emptyStarIcon",void 0),Co([o.property()],Ao.prototype,"filledStarIcon",void 0),Co([o.property()],Ao.prototype,"emptyLikeIcon",void 0),Co([o.property()],Ao.prototype,"filledLikeIcon",void 0),Co([o.property()],Ao.prototype,"emptyDislikeIcon",void 0),Co([o.property()],Ao.prototype,"filledDislikeIcon",void 0),Co([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],Ao.prototype,"configuration",void 0),Co([o.property()],Ao.prototype,"feedbackMailLinkBuilder",void 0);const Oo=to.fromGwt("server");class No{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,i,e,o,s){var n;this.subject=t,this.url=i,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=this.filterMetadata(e,o.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(e,null!==(n=o.bodyMetadataIds)&&void 0!==n?n:[]).map((t=>"["+t.values.join(", ")+"]")).join(" ")}filterMetadata(t,i){return i.map((i=>t.find((t=>t.key===i)))).filter((t=>null!=t&&t.values.length>0))}build(t){var i,e,o;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopics))||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers))return;const s=encodeURIComponent(this.subject+" "+this.subjectMetadata),n=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${Oo.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(o=this.configuration)||void 0===o?void 0:o.recipients.join(",")}?subject=${s}&body=${n}`}}var Uo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Do extends(qe(c)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=ji.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new No,this.i18nProperties={feedbackMainTitle:eo.properties.mapFeedbackMainTitle(),ratingSectionTitle:eo.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:eo.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:eo.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new i.Debouncer(100),this.sendRatingDebouncer=new i.Debouncer(500),this.addStore(Oe)}render(){return this.map&&(this.editorMode||this.componentVisible)?e.html`
|
|
1454
1463
|
<ft-reader-feedback
|
|
1455
1464
|
ratingAllowed
|
|
1456
1465
|
.i18nProperties=${this.i18nProperties}
|
|
1457
1466
|
.editorMode=${this.editorMode}
|
|
1458
1467
|
?hideTitle=${this.hideTitle}
|
|
1459
1468
|
.ratingSummary=${this.ratingSummary}
|
|
1460
|
-
.
|
|
1469
|
+
.session=${this.session}
|
|
1461
1470
|
.iconVariant=${this.iconVariant}
|
|
1462
1471
|
.emptyStarIcon=${this.emptyStarIcon}
|
|
1463
1472
|
.filledStarIcon=${this.filledStarIcon}
|
|
@@ -1470,20 +1479,20 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1470
1479
|
@send-feedback=${this.sendFeedback}
|
|
1471
1480
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1472
1481
|
></ft-reader-feedback>
|
|
1473
|
-
`:
|
|
1482
|
+
`:e.html`
|
|
1474
1483
|
<style>
|
|
1475
1484
|
:host {
|
|
1476
1485
|
display: none !important;
|
|
1477
1486
|
}
|
|
1478
1487
|
</style>
|
|
1479
|
-
`}get componentVisible(){var t;return
|
|
1488
|
+
`}get componentVisible(){var t,i,e;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.FEEDBACK,{session:this.session}))||(null===(i=this.service)||void 0===i?void 0:i.isFeatureAccessible(a.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type}))}update(t){var i,e,o,s;super.update(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((i=>t.has(i)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink())&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(s=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===s?void 0:s.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,i,e;this.map&&((null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:eo.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:so.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{this.editorMode?this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:so.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(e=this.service)||void 0===e?void 0:e.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:eo.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}Do.elementDefinitions={"ft-reader-feedback":Ao},Uo([i.redux({store:Oe.name})],Do.prototype,"session",void 0),Uo([i.redux({store:"reader"})],Do.prototype,"map",void 0),Uo([i.redux({store:Oe.name})],Do.prototype,"editorMode",void 0),Uo([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],Do.prototype,"configuration",void 0),Uo([o.state()],Do.prototype,"ratingSummary",void 0),Uo([o.property({type:Boolean})],Do.prototype,"hideTitle",void 0),Uo([o.property()],Do.prototype,"iconVariant",void 0),Uo([o.property()],Do.prototype,"emptyStarIcon",void 0),Uo([o.property()],Do.prototype,"filledStarIcon",void 0),Uo([o.property()],Do.prototype,"emptyLikeIcon",void 0),Uo([o.property()],Do.prototype,"filledLikeIcon",void 0),Uo([o.property()],Do.prototype,"emptyDislikeIcon",void 0),Uo([o.property()],Do.prototype,"filledDislikeIcon",void 0),Uo([o.query("ft-reader-feedback")],Do.prototype,"readerFeedback",void 0),Uo([io(Oo.properties["mail.map_feedback.subject"]((t=>{var i;return[null===(i=t.map)||void 0===i?void 0:i.title]})))],Do.prototype,"mailSubject",void 0);var zo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Mo extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const Bo=Symbol("registerInterval");class Po extends(function(t){var i;class e extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[i]=0}connectedCallback(){super.connectedCallback(),this[Bo]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[Bo]):this.dispatchEvent(new Mo)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return i=Bo,zo([o.state()],e.prototype,"tocNode",void 0),zo([o.state()],e.prototype,"disableContextInteractions",void 0),e}(c)){}var Lo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Fo extends(qe(Po)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=ji.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new No,this.i18nProperties={feedbackMainTitle:eo.properties.topicFeedbackMainTitle(),ratingSectionTitle:eo.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:eo.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:eo.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new i.Debouncer(100),this.sendRatingDebouncer=new i.Debouncer(500),this.addStore(Oe)}render(){return this.map&&this.tocNode&&(this.editorMode||this.componentVisible)?e.html`
|
|
1480
1489
|
<ft-reader-feedback
|
|
1481
1490
|
.i18nProperties=${this.i18nProperties}
|
|
1482
1491
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
1483
1492
|
.editorMode=${this.editorMode}
|
|
1484
1493
|
?hideTitle=${this.hideTitle}
|
|
1485
1494
|
.ratingSummary=${this.ratingSummary}
|
|
1486
|
-
.
|
|
1495
|
+
.session=${this.session}
|
|
1487
1496
|
.iconVariant=${this.iconVariant}
|
|
1488
1497
|
.emptyStarIcon=${this.emptyStarIcon}
|
|
1489
1498
|
.filledStarIcon=${this.filledStarIcon}
|
|
@@ -1496,10 +1505,10 @@ const Ne=Symbol.for(""),Ue=t=>{if((null==t?void 0:t.r)===Ne)return null==t?void
|
|
|
1496
1505
|
@send-feedback=${this.sendFeedback}
|
|
1497
1506
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1498
1507
|
></ft-reader-feedback>
|
|
1499
|
-
`:
|
|
1508
|
+
`:e.html`
|
|
1500
1509
|
<style>
|
|
1501
1510
|
:host {
|
|
1502
1511
|
display: none !important;
|
|
1503
1512
|
}
|
|
1504
1513
|
</style>
|
|
1505
|
-
`}get componentVisible(){var t;return
|
|
1514
|
+
`}get componentVisible(){var t,i,e;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.FEEDBACK,{session:this.session}))||(null===(i=this.service)||void 0===i?void 0:i.isFeatureAccessible(a.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type}))}update(t){var i,e,o,s;super.update(t),["tocNode","user"].some((i=>t.has(i)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((i=>t.has(i)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink(this.tocNode.tocId))&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(s=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===s?void 0:s.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,i,e;this.tocNode&&((null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateTopic(this.tocNode.tocId)):await(null===(o=this.service)||void 0===o?void 0:o.rateTopic(this.tocNode.tocId,null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:eo.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:so.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{!this.editorMode&&this.tocNode?(await(null===(e=this.service)||void 0===e?void 0:e.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:so.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:eo.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}Fo.elementDefinitions={"ft-reader-feedback":Ao},Lo([i.redux({store:Oe.name})],Fo.prototype,"session",void 0),Lo([i.redux({store:"reader"})],Fo.prototype,"map",void 0),Lo([i.redux({store:Oe.name})],Fo.prototype,"editorMode",void 0),Lo([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],Fo.prototype,"configuration",void 0),Lo([o.state()],Fo.prototype,"ratingSummary",void 0),Lo([o.property({type:Boolean})],Fo.prototype,"hideTitle",void 0),Lo([o.property()],Fo.prototype,"iconVariant",void 0),Lo([o.property()],Fo.prototype,"emptyStarIcon",void 0),Lo([o.property()],Fo.prototype,"filledStarIcon",void 0),Lo([o.property()],Fo.prototype,"emptyLikeIcon",void 0),Lo([o.property()],Fo.prototype,"filledLikeIcon",void 0),Lo([o.property()],Fo.prototype,"emptyDislikeIcon",void 0),Lo([o.property()],Fo.prototype,"filledDislikeIcon",void 0),Lo([o.query("ft-reader-feedback")],Fo.prototype,"readerFeedback",void 0),Lo([io(Oo.properties["mail.feedback.subject"]((t=>{var i,e;return[null===(i=t.tocNode)||void 0===i?void 0:i.title,null===(e=t.map)||void 0===e?void 0:e.title]})))],Fo.prototype,"mailSubject",void 0),i.customElement("ft-reader-map-feedback")(Do),i.customElement("ft-reader-topic-feedback")(Fo),t.FtReaderFeedbackCssVariables=Ct,t.FtReaderMapFeedback=Do,t.FtReaderTopicFeedback=Fo,t.styles=At}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|