@fluid-topics/ft-reader-feedback 0.3.65 → 0.3.66
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.light.js +177 -177
- package/build/ft-reader-feedback.min.js +16 -16
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,i,
|
|
1
|
+
!function(t,e,i,o,s,n,r){var a=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 l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class h extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=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.registerIntervalReader=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this.registerIntervalReader):this.dispatchEvent(new l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return a([o.state()],e.prototype,"stateManager",void 0),e}(e.FtLitElementRedux)){}const d=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),p={color:d,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",d),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},c=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),f=c,u=e.FtCssVariableFactory.extend("--ft-ripple-background-color",c),v=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),b=v,g=e.FtCssVariableFactory.extend("--ft-ripple-background-color",v),x=i.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
opacity: ${p.opacityContentOnSurfacePressed};
|
|
88
88
|
transform: translate(-50%, -50%) scale(1);
|
|
89
89
|
}
|
|
90
|
-
`,y=
|
|
90
|
+
`,y=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),m=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),$={fontFamily:m,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},w={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-font-size",$.fontSize,"20px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",$.letterSpacing,"0.15px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-line-height",$.lineHeight,"1.2"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",$.textTransform,"inherit")},k={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",$.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",$.letterSpacing,"0.105px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",$.lineHeight,"1.7"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",$.textTransform,"inherit")},_=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",m),S=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",$.fontSize,"16px"),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",$.fontWeight,"600"),z=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",$.letterSpacing,"0.144px"),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",$.lineHeight,"1.5"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",$.textTransform,"inherit"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",m),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",$.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",$.fontWeight,"normal"),D=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",$.letterSpacing,"0.098px"),A=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",$.lineHeight,"1.7"),B=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",$.textTransform,"inherit"),j={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",$.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",$.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",$.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",$.textTransform,"inherit")},M=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",m),U=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",$.fontSize,"14px"),E=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",$.fontWeight,"normal"),F=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",$.letterSpacing,"0.252px"),L=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",$.lineHeight,"1.4"),P=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",$.textTransform,"inherit"),H={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",$.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",$.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",$.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",$.textTransform,"inherit")},W=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",m),Z=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",$.fontSize,"10px"),V=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",$.fontWeight,"normal"),G=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",$.letterSpacing,"0.33px"),K=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",$.lineHeight,"1.6"),Y=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",$.textTransform,"inherit"),q=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",m),X=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",$.fontSize,"10px"),J=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",$.fontWeight,"normal"),Q=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",$.letterSpacing,"1.5px"),tt=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",$.lineHeight,"1.6"),et=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",$.textTransform,"uppercase"),it={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",$.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",$.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",$.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",$.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",$.textTransform,"uppercase")},ot=i.css`
|
|
91
91
|
.ft-typography--title {
|
|
92
92
|
font-family: ${w.fontFamily};
|
|
93
93
|
font-size: ${w.fontSize};
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
line-height: ${w.lineHeight};
|
|
97
97
|
text-transform: ${w.textTransform};
|
|
98
98
|
}
|
|
99
|
-
`,st=
|
|
99
|
+
`,st=i.css`
|
|
100
100
|
.ft-typography--title-dense {
|
|
101
101
|
font-family: ${k.fontFamily};
|
|
102
102
|
font-size: ${k.fontSize};
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
line-height: ${k.lineHeight};
|
|
106
106
|
text-transform: ${k.textTransform};
|
|
107
107
|
}
|
|
108
|
-
`,nt=
|
|
108
|
+
`,nt=i.css`
|
|
109
109
|
.ft-typography--subtitle1 {
|
|
110
110
|
font-family: ${_};
|
|
111
111
|
font-size: ${S};
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
line-height: ${C};
|
|
115
115
|
text-transform: ${T};
|
|
116
116
|
}
|
|
117
|
-
`,rt=
|
|
117
|
+
`,rt=i.css`
|
|
118
118
|
.ft-typography--subtitle2 {
|
|
119
119
|
font-family: ${O};
|
|
120
120
|
font-size: ${R};
|
|
@@ -124,25 +124,25 @@
|
|
|
124
124
|
text-transform: ${B};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
`,at=
|
|
127
|
+
`,at=i.css`
|
|
128
128
|
.ft-typography--body1 {
|
|
129
|
-
font-family: ${
|
|
130
|
-
font-size: ${
|
|
131
|
-
font-weight: ${
|
|
132
|
-
letter-spacing: ${
|
|
133
|
-
line-height: ${
|
|
134
|
-
text-transform: ${
|
|
135
|
-
}
|
|
136
|
-
`,lt=
|
|
129
|
+
font-family: ${j.fontFamily};
|
|
130
|
+
font-size: ${j.fontSize};
|
|
131
|
+
font-weight: ${j.fontWeight};
|
|
132
|
+
letter-spacing: ${j.letterSpacing};
|
|
133
|
+
line-height: ${j.lineHeight};
|
|
134
|
+
text-transform: ${j.textTransform};
|
|
135
|
+
}
|
|
136
|
+
`,lt=i.css`
|
|
137
137
|
.ft-typography--body2 {
|
|
138
|
-
font-family: ${
|
|
139
|
-
font-size: ${
|
|
140
|
-
font-weight: ${
|
|
138
|
+
font-family: ${M};
|
|
139
|
+
font-size: ${U};
|
|
140
|
+
font-weight: ${E};
|
|
141
141
|
letter-spacing: ${F};
|
|
142
142
|
line-height: ${L};
|
|
143
143
|
text-transform: ${P};
|
|
144
144
|
}
|
|
145
|
-
`,ht=
|
|
145
|
+
`,ht=i.css`
|
|
146
146
|
.ft-typography--caption {
|
|
147
147
|
font-family: ${H.fontFamily};
|
|
148
148
|
font-size: ${H.fontSize};
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
line-height: ${H.lineHeight};
|
|
152
152
|
text-transform: ${H.textTransform};
|
|
153
153
|
}
|
|
154
|
-
`,dt=
|
|
154
|
+
`,dt=i.css`
|
|
155
155
|
.ft-typography--breadcrumb {
|
|
156
156
|
font-family: ${W};
|
|
157
157
|
font-size: ${Z};
|
|
@@ -160,29 +160,29 @@
|
|
|
160
160
|
line-height: ${K};
|
|
161
161
|
text-transform: ${Y};
|
|
162
162
|
}
|
|
163
|
-
`,pt=
|
|
163
|
+
`,pt=i.css`
|
|
164
164
|
.ft-typography--overline {
|
|
165
165
|
font-family: ${q};
|
|
166
166
|
font-size: ${X};
|
|
167
167
|
font-weight: ${J};
|
|
168
168
|
letter-spacing: ${Q};
|
|
169
169
|
line-height: ${tt};
|
|
170
|
-
text-transform: ${
|
|
170
|
+
text-transform: ${et};
|
|
171
171
|
}
|
|
172
|
-
`,ct=
|
|
172
|
+
`,ct=i.css`
|
|
173
173
|
.ft-typography--button {
|
|
174
|
-
font-family: ${
|
|
175
|
-
font-size: ${
|
|
176
|
-
font-weight: ${
|
|
177
|
-
letter-spacing: ${
|
|
178
|
-
line-height: ${
|
|
179
|
-
text-transform: ${
|
|
180
|
-
}
|
|
181
|
-
`,ft=
|
|
174
|
+
font-family: ${it.fontFamily};
|
|
175
|
+
font-size: ${it.fontSize};
|
|
176
|
+
font-weight: ${it.fontWeight};
|
|
177
|
+
letter-spacing: ${it.letterSpacing};
|
|
178
|
+
line-height: ${it.lineHeight};
|
|
179
|
+
text-transform: ${it.textTransform};
|
|
180
|
+
}
|
|
181
|
+
`,ft=i.css`
|
|
182
182
|
.ft-typography {
|
|
183
183
|
vertical-align: inherit;
|
|
184
184
|
}
|
|
185
|
-
`,ut={color:
|
|
185
|
+
`,ut={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},vt=i.css`
|
|
186
186
|
:host {
|
|
187
187
|
line-height: 0;
|
|
188
188
|
}
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
transform: translate(calc(0.35 * ${ut.size}), 0);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
`,bt={size:
|
|
254
|
+
`,bt={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},gt=i.css`
|
|
255
255
|
:host, i.ft-icon {
|
|
256
256
|
display: inline-flex;
|
|
257
257
|
align-items: center;
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
.ft-icon--material {
|
|
299
299
|
font-family: ${bt.materialFontFamily}, "Material Icons", sans-serif;
|
|
300
300
|
}
|
|
301
|
-
`,xt=
|
|
301
|
+
`,xt=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),yt={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:xt,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",it.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",xt),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},mt=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),$t={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:mt,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",mt)},wt=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),kt=[e.noTextSelect,i.css`
|
|
302
302
|
:host {
|
|
303
303
|
display: inline-block;
|
|
304
304
|
max-width: 100%;
|
|
@@ -340,10 +340,10 @@
|
|
|
340
340
|
|
|
341
341
|
--ft-button-internal-line-height: calc(${yt.fontSize} + 2px);
|
|
342
342
|
--ft-button-internal-color: ${yt.color};
|
|
343
|
-
${
|
|
343
|
+
${e.setVariable(bt.size,yt.iconSize)};
|
|
344
344
|
--ft-button-internal-vertical-padding: 6px;
|
|
345
345
|
--ft-button-internal-horizontal-padding: 8px;
|
|
346
|
-
${
|
|
346
|
+
${e.setVariable(p.color,yt.rippleColor)};
|
|
347
347
|
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${yt.iconSize});
|
|
348
348
|
|
|
349
349
|
border-radius: ${yt.borderRadius};
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
.ft-button.ft-button--primary {
|
|
376
376
|
background-color: ${$t.backgroundColor};
|
|
377
377
|
--ft-button-internal-color: ${$t.color};
|
|
378
|
-
${
|
|
378
|
+
${e.setVariable(p.color,$t.rippleColor)};
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
.ft-button.ft-button--outlined {
|
|
@@ -394,8 +394,8 @@
|
|
|
394
394
|
text-overflow: ellipsis;
|
|
395
395
|
display: block;
|
|
396
396
|
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
397
|
-
${
|
|
398
|
-
${
|
|
397
|
+
${e.setVariable(it.fontSize,"1em")};
|
|
398
|
+
${e.setVariable(it.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
.ft-button--label[hidden] {
|
|
@@ -418,10 +418,10 @@
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
ft-loader {
|
|
421
|
-
${
|
|
422
|
-
${
|
|
421
|
+
${e.setVariable(ut.size,yt.iconSize)};
|
|
422
|
+
${e.setVariable(ut.color,"var(--ft-button-internal-color)")};
|
|
423
423
|
}
|
|
424
|
-
`],_t={textColor:
|
|
424
|
+
`],_t={textColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceHigh),backgroundColor:e.FtCssVariableFactory.extend("--ft-switch-background-color",e.designSystemVariables.colorSurface),selectedTextColor:e.FtCssVariableFactory.extend("--ft-switch-selected-text-color",e.designSystemVariables.colorPrimary),selectedBackgroundColor:e.FtCssVariableFactory.extend("--ft-switch-selected-background-color",e.designSystemVariables.colorPrimary),borderColor:e.FtCssVariableFactory.extend("--ft-switch-border-color",e.designSystemVariables.colorOutline),borderRadius:e.FtCssVariableFactory.extend("--ft-switch-border-radius",e.designSystemVariables.borderRadiusL),fontSize:e.FtCssVariableFactory.extend("--ft-switch-font-size",it.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceMedium),rippleColor:e.FtCssVariableFactory.extend("--ft-switch-ripple-color",e.designSystemVariables.colorPrimary),outlineColor:e.FtCssVariableFactory.extend("--ft-switch-outline-color",e.designSystemVariables.colorPrimary)},St={feedbackInputMinWidth:e.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color",e.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color",e.designSystemVariables.colorPrimary),filledRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color",e.designSystemVariables.colorPrimary),emptyRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color",e.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:e.FtCssVariableFactory.external(w.fontSize,"Typography"),sectionTitleFontSize:e.FtCssVariableFactory.external(k.fontSize,"Typography")},It=i.css`
|
|
425
425
|
.ft-reader-feedback {
|
|
426
426
|
box-sizing: border-box;
|
|
427
427
|
display: flex;
|
|
@@ -467,14 +467,14 @@
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
.ft-reader-feedback--rating {
|
|
470
|
-
${
|
|
471
|
-
${
|
|
472
|
-
${
|
|
473
|
-
${
|
|
470
|
+
${e.setVariable(yt.color,St.emptyRatingColor)};
|
|
471
|
+
${e.setVariable(yt.rippleColor,St.filledRatingColor)};
|
|
472
|
+
${e.setVariable(_t.textColor,St.emptyRatingColor)};
|
|
473
|
+
${e.setVariable(_t.selectedTextColor,St.filledRatingColor)};
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
477
|
-
${
|
|
477
|
+
${e.setVariable(yt.color,St.filledRatingColor)};
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
.ft-reader-feedback--feedback {
|
|
@@ -491,33 +491,33 @@
|
|
|
491
491
|
|
|
492
492
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
493
493
|
align-self: flex-end;
|
|
494
|
-
${
|
|
495
|
-
${
|
|
494
|
+
${e.setVariable(yt.color,St.sendFeedbackColor)};
|
|
495
|
+
${e.setVariable(yt.backgroundColor,St.sendFeedbackBackgroundColor)};
|
|
496
496
|
}
|
|
497
497
|
`
|
|
498
498
|
/**
|
|
499
499
|
* @license
|
|
500
500
|
* Copyright 2017 Google LLC
|
|
501
501
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
502
|
-
*/;var zt;const Ct=window,Tt=Ct.trustedTypes,Ot=Tt?Tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Rt=`lit$${(Math.random()+"").slice(9)}$`,Nt="?"+Rt,Dt=`<${Nt}>`,At=document,Bt=(t="")=>At.createComment(t),
|
|
502
|
+
*/;var zt;const Ct=window,Tt=Ct.trustedTypes,Ot=Tt?Tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Rt=`lit$${(Math.random()+"").slice(9)}$`,Nt="?"+Rt,Dt=`<${Nt}>`,At=document,Bt=(t="")=>At.createComment(t),jt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Mt=Array.isArray,Ut=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Et=/-->/g,Ft=/>/g,Lt=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Pt=/'/g,Ht=/"/g,Wt=/^(?:script|style|textarea|title)$/i,Zt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Vt=Symbol.for("lit-noChange"),Gt=Symbol.for("lit-nothing"),Kt=new WeakMap,Yt=At.createTreeWalker(At,129,null,!1),qt=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=Ut;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)d=r.lastIndex,r===Ut?"!--"===l[1]?r=Et:void 0!==l[1]?r=Ft:void 0!==l[2]?(Wt.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=Lt):void 0!==l[3]&&(r=Lt):r===Lt?">"===l[0]?(r=null!=s?s:Ut,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?Lt:'"'===l[3]?Ht:Pt):r===Ht||r===Pt?r=Lt:r===Et||r===Ft?r=Ut:(r=Lt,s=void 0);const p=r===Lt&&t[e+1].startsWith("/>")?" ":"";n+=r===Ut?i+Dt:h>=0?(o.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+Rt+p):i+Rt+(-2===h?(o.push(void 0),e):p)}const a=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Ot?Ot.createHTML(a):a,o]};class Xt{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=qt(t,e);if(this.el=Xt.createElement(l,i),Yt.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Yt.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Rt)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(Rt),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?ie:"?"===e[1]?se:"@"===e[1]?ne:ee})}else a.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(Wt.test(o.tagName)){const t=o.textContent.split(Rt),e=t.length-1;if(e>0){o.textContent=Tt?Tt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Bt()),Yt.nextNode(),a.push({type:2,index:++s});o.append(t[e],Bt())}}}else if(8===o.nodeType)if(o.data===Nt)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(Rt,t+1));)a.push({type:7,index:s}),t+=Rt.length-1}s++}}static createElement(t,e){const i=At.createElement("template");return i.innerHTML=t,i}}function Jt(t,e,i=t,o){var s,n,r,a;if(e===Vt)return e;let l=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const h=jt(e)?void 0:e._$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,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(e=Jt(t,l._$AS(t,e.values),l,o)),e}class Qt{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:At).importNode(i,!0);Yt.currentNode=s;let n=Yt.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new te(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new re(n,this,t)),this.u.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=Yt.nextNode(),r++)}return s}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class te{constructor(t,e,i,o){var s;this.type=2,this._$AH=Gt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Jt(this,t,e),jt(t)?t===Gt||null==t||""===t?(this._$AH!==Gt&&this._$AR(),this._$AH=Gt):t!==this._$AH&&t!==Vt&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Mt(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==Gt&&jt(this._$AH)?this._$AA.nextSibling.data=t:this.T(At.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Xt.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new Qt(s,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=Kt.get(t.strings);return void 0===e&&Kt.set(t.strings,e=new Xt(t)),e}k(t){Mt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new te(this.O(Bt()),this.O(Bt()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class ee{constructor(t,e,i,o,s){this.type=1,this._$AH=Gt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Gt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=Jt(this,t,e,0),n=!jt(t)||t!==this._$AH&&t!==Vt,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=Jt(this,o[i+r],e,r),a===Vt&&(a=this._$AH[r]),n||(n=!jt(a)||a!==this._$AH[r]),a===Gt?t=Gt:t!==Gt&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===Gt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ie extends ee{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Gt?void 0:t}}const oe=Tt?Tt.emptyScript:"";class se extends ee{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Gt?this.element.setAttribute(this.name,oe):this.element.removeAttribute(this.name)}}class ne extends ee{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Jt(this,t,e,0))&&void 0!==i?i:Gt)===Vt)return;const o=this._$AH,s=t===Gt&&o!==Gt||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Gt&&(o===Gt||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class re{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Jt(this,t)}}const ae=Ct.litHtmlPolyfillSupport;null==ae||ae(Xt,te),(null!==(zt=Ct.litHtmlVersions)&&void 0!==zt?zt:Ct.litHtmlVersions=[]).push("2.4.0");
|
|
503
503
|
/**
|
|
504
504
|
* @license
|
|
505
505
|
* Copyright 2020 Google LLC
|
|
506
506
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
507
507
|
*/
|
|
508
|
-
const
|
|
509
|
-
<${
|
|
508
|
+
const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void 0:t._$litStatic$},de=t=>({_$litStatic$:t,r:le}),pe=new Map,ce=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=e[h];h<o&&void 0!==(n=i[h],s=he(n));)l+=s+e[++h],d=!0;a.push(n),r.push(l),h++}if(h===o&&r.push(e[o]),d){const t=r.join("$$lit$$");void 0===(e=pe.get(t))&&(r.raw=r,pe.set(t,e=r)),i=a}return t(e,...i)})(Zt);var fe;!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"}(fe||(fe={}));var ue,ve,be,ge=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 xe extends e.FtLitElement{constructor(){super(...arguments),this.variant=fe.body1}render(){return this.element?ce`
|
|
509
|
+
<${de(this.element)}
|
|
510
510
|
class="ft-typography ft-typography--${this.variant}">
|
|
511
511
|
<slot></slot>
|
|
512
|
-
</${
|
|
513
|
-
`:
|
|
512
|
+
</${de(this.element)}>
|
|
513
|
+
`:ce`
|
|
514
514
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
515
|
-
`}}
|
|
516
|
-
<i class="ft-icon ${"ft-icon--"+
|
|
515
|
+
`}}xe.styles=[ot,st,nt,rt,at,lt,ht,dt,pt,ct,ft],ge([o.property()],xe.prototype,"element",void 0),ge([o.property()],xe.prototype,"variant",void 0),e.customElement("ft-typography")(xe),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",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.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",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=""}(ue||(ue={})),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=""}(ve||(ve={})),new Map([...["abw"].map((t=>[t,ve.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,ve.AUDIO])),...["avi"].map((t=>[t,ve.AVI])),...["chm","xhs"].map((t=>[t,ve.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,ve.CODE])),...["csv"].map((t=>[t,ve.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,ve.DITA])),...["epub"].map((t=>[t,ve.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,ve.EXCEL])),...["flac"].map((t=>[t,ve.FLAC])),...["gif"].map((t=>[t,ve.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,ve.GZIP])),...["html","htm","xhtml"].map((t=>[t,ve.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,ve.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,ve.JPEG])),...["json"].map((t=>[t,ve.JSON])),...["m4a","m4p"].map((t=>[t,ve.M4A])),...["mov","qt"].map((t=>[t,ve.MOV])),...["mp3"].map((t=>[t,ve.MP3])),...["mp4","m4v"].map((t=>[t,ve.MP4])),...["ogg","oga"].map((t=>[t,ve.OGG])),...["pdf","ps"].map((t=>[t,ve.PDF])),...["png"].map((t=>[t,ve.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,ve.POWERPOINT])),...["rar"].map((t=>[t,ve.RAR])),...["stp"].map((t=>[t,ve.STP])),...["txt","rtf","md","mdown"].map((t=>[t,ve.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,ve.VIDEO])),...["wav"].map((t=>[t,ve.WAV])),...["wma"].map((t=>[t,ve.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,ve.WORD])),...["xml","xsl","rdf"].map((t=>[t,ve.XML])),...["yaml","yml","x-yaml"].map((t=>[t,ve.YAML])),...["zip"].map((t=>[t,ve.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(be||(be={}));var ye=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 me extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){var t;const e=null!==(t=this.variant)&&void 0!==t?t:be.fluid_topics,o="material"!==e||this.value;return i.html`
|
|
516
|
+
<i class="ft-icon ${"ft-icon--"+e}">
|
|
517
517
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
518
518
|
<slot ?hidden=${o}></slot>
|
|
519
519
|
</i>
|
|
520
|
-
`}get textContent(){var t,
|
|
520
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case be.file_format:this.resolvedIcon=null!==(t=ve[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case be.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ue[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}me.elementDefinitions={},me.styles=gt,ye([o.property()],me.prototype,"variant",void 0),ye([o.property()],me.prototype,"value",void 0),ye([o.state()],me.prototype,"resolvedIcon",void 0),ye([o.query("slot")],me.prototype,"slottedContent",void 0),e.customElement("ft-icon")(me);const $e=e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),we=e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),ke=e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),_e=e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),Se=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),Ie=e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),ze=i.css`
|
|
521
521
|
.ft-tooltip--container {
|
|
522
522
|
display: block;
|
|
523
523
|
position: relative;
|
|
@@ -533,23 +533,23 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
533
533
|
box-sizing: border-box;
|
|
534
534
|
overflow: hidden;
|
|
535
535
|
width: max-content;
|
|
536
|
-
max-width: ${
|
|
536
|
+
max-width: ${Ie};
|
|
537
537
|
text-align: center;
|
|
538
|
-
padding: ${$
|
|
539
|
-
z-index: ${
|
|
538
|
+
padding: ${$e};
|
|
539
|
+
z-index: ${_e};
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
.ft-tooltip--content {
|
|
543
543
|
padding: 4px 8px;
|
|
544
|
-
border-radius: ${
|
|
545
|
-
background-color: ${
|
|
546
|
-
color: ${
|
|
544
|
+
border-radius: ${Se};
|
|
545
|
+
background-color: ${ke};
|
|
546
|
+
color: ${we};
|
|
547
547
|
top: -500px;
|
|
548
548
|
left: -500px;
|
|
549
549
|
position: relative;
|
|
550
550
|
word-break: break-word;
|
|
551
551
|
}
|
|
552
|
-
`;var
|
|
552
|
+
`;var Ce=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 Te extends e.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 e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return i.html`
|
|
553
553
|
<div part="container"
|
|
554
554
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
555
555
|
@mouseenter=${this.onHover}
|
|
@@ -567,7 +567,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
567
567
|
</div>
|
|
568
568
|
</div>
|
|
569
569
|
</div>
|
|
570
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((
|
|
570
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((e=>t.has(e)))&&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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${Ie})`}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())}}Te.elementDefinitions={"ft-typography":xe},Te.styles=ze,Ce([o.property()],Te.prototype,"text",void 0),Ce([o.property({type:Boolean})],Te.prototype,"manual",void 0),Ce([o.property({type:Boolean})],Te.prototype,"inline",void 0),Ce([o.property({type:Number})],Te.prototype,"delay",void 0),Ce([o.property()],Te.prototype,"position",void 0),Ce([o.queryAssignedNodes("",!0)],Te.prototype,"slotNodes",void 0),Ce([o.query(".ft-tooltip--container")],Te.prototype,"container",void 0),Ce([o.query("slot")],Te.prototype,"target",void 0),Ce([o.query(".ft-tooltip")],Te.prototype,"tooltip",void 0),Ce([o.query(".ft-tooltip--content")],Te.prototype,"tooltipContent",void 0),Ce([o.state()],Te.prototype,"visible",void 0),e.customElement("ft-tooltip")(Te);var Oe=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 Re extends e.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.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.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 e.Debouncer(10),this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{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.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 i.html`
|
|
571
571
|
<style>
|
|
572
572
|
.ft-ripple .ft-ripple--effect,
|
|
573
573
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -584,7 +584,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
584
584
|
<div class="ft-ripple--background"></div>
|
|
585
585
|
<div class="ft-ripple--effect"></div>
|
|
586
586
|
</div>
|
|
587
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i
|
|
587
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}))}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),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",i),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 e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}Re.elementDefinitions={},Re.styles=x,Oe([o.property({type:Boolean})],Re.prototype,"primary",void 0),Oe([o.property({type:Boolean})],Re.prototype,"secondary",void 0),Oe([o.property({type:Boolean})],Re.prototype,"unbounded",void 0),Oe([o.property({type:Boolean})],Re.prototype,"activated",void 0),Oe([o.property({type:Boolean})],Re.prototype,"selected",void 0),Oe([o.property({type:Boolean})],Re.prototype,"disabled",void 0),Oe([o.state()],Re.prototype,"hovered",void 0),Oe([o.state()],Re.prototype,"focused",void 0),Oe([o.state()],Re.prototype,"pressed",void 0),Oe([o.state()],Re.prototype,"rippling",void 0),Oe([o.state()],Re.prototype,"rippleSize",void 0),Oe([o.state()],Re.prototype,"originX",void 0),Oe([o.state()],Re.prototype,"originY",void 0),Oe([o.query(".ft-ripple")],Re.prototype,"ripple",void 0),Oe([o.query(".ft-ripple--effect")],Re.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(Re);const Ne={borderRadiusLeft:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",e.designSystemVariables.borderRadiusL),borderRadiusRight:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",e.designSystemVariables.borderRadiusL),borderWidthLeft:e.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:e.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:e.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")},De=i.css`
|
|
588
588
|
.ft-switch-option {
|
|
589
589
|
position: relative;
|
|
590
590
|
display: inline-block;
|
|
@@ -603,13 +603,13 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
603
603
|
|
|
604
604
|
border-style: solid;
|
|
605
605
|
border-color: ${_t.borderColor};
|
|
606
|
-
border-width: ${
|
|
607
|
-
border-radius: ${
|
|
606
|
+
border-width: ${Ne.borderWidthVertical} ${Ne.borderWidthRight} ${Ne.borderWidthVertical} ${Ne.borderWidthLeft};
|
|
607
|
+
border-radius: ${Ne.borderRadiusLeft} ${Ne.borderRadiusRight} ${Ne.borderRadiusRight} ${Ne.borderRadiusLeft};
|
|
608
608
|
display: flex;
|
|
609
609
|
align-items: center;
|
|
610
610
|
justify-content: center;
|
|
611
611
|
overflow: hidden;
|
|
612
|
-
${
|
|
612
|
+
${e.setVariable(bt.size,_t.iconSize)};
|
|
613
613
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
614
614
|
background-color: ${_t.backgroundColor};
|
|
615
615
|
-webkit-mask-image: radial-gradient(white, black);
|
|
@@ -621,12 +621,12 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
621
621
|
|
|
622
622
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
623
623
|
background-color: ${_t.selectedBackgroundColor};
|
|
624
|
-
border-radius: ${
|
|
624
|
+
border-radius: ${Ne.borderRadiusLeft} ${Ne.borderRadiusRight} ${Ne.borderRadiusRight} ${Ne.borderRadiusLeft};
|
|
625
625
|
position: absolute;
|
|
626
626
|
inset: 0;
|
|
627
627
|
content: "";
|
|
628
628
|
z-index: 1;
|
|
629
|
-
opacity: ${
|
|
629
|
+
opacity: ${e.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
.ft-switch-option--label {
|
|
@@ -636,8 +636,8 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
636
636
|
text-overflow: ellipsis;
|
|
637
637
|
display: block;
|
|
638
638
|
margin: 0 8px;
|
|
639
|
-
${
|
|
640
|
-
${
|
|
639
|
+
${e.setVariable(it.fontSize,_t.fontSize)};
|
|
640
|
+
${e.setVariable(it.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
641
641
|
}
|
|
642
642
|
|
|
643
643
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
@@ -649,7 +649,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
.ft-switch-option--ripple {
|
|
652
|
-
${
|
|
652
|
+
${e.setVariable(p.color,_t.rippleColor)};
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -668,7 +668,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
668
668
|
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
669
669
|
color: ${_t.selectedTextColor};
|
|
670
670
|
}
|
|
671
|
-
`;var
|
|
671
|
+
`;var Ae=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 Be extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class je extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.iconVariant=be.material,this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Be)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(i.html`
|
|
672
672
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
673
673
|
@click=${this.onChange}>
|
|
674
674
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
@@ -677,27 +677,27 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
677
677
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
678
678
|
<ft-typography part="text"
|
|
679
679
|
variant="button"
|
|
680
|
-
class="ft-switch-option--label ${
|
|
680
|
+
class="ft-switch-option--label ${e.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
681
681
|
?hidden=${!this.hasTextContent()}>
|
|
682
682
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
683
683
|
</ft-typography>
|
|
684
684
|
${this.resolveIcon()}
|
|
685
685
|
</div>
|
|
686
686
|
</label>
|
|
687
|
-
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:
|
|
687
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:i.html`
|
|
688
688
|
<ft-tooltip part="tooltip"
|
|
689
689
|
text="${this.getLabel()}"
|
|
690
690
|
position="${this.tooltipPosition}">
|
|
691
691
|
${t}
|
|
692
692
|
</ft-tooltip>
|
|
693
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?
|
|
693
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?i.html`
|
|
694
694
|
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
695
|
-
`:
|
|
695
|
+
`:i.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}je.elementDefinitions={"ft-ripple":Re,"ft-typography":xe,"ft-tooltip":Te,"ft-icon":me},je.styles=[e.safariEllipsisFix,De],Ae([o.property()],je.prototype,"value",void 0),Ae([o.property()],je.prototype,"icon",void 0),Ae([o.property()],je.prototype,"iconVariant",void 0),Ae([o.property()],je.prototype,"label",void 0),Ae([o.property()],je.prototype,"tooltipPosition",void 0),Ae([o.property({type:Boolean,reflect:!0})],je.prototype,"selected",void 0),Ae([o.property({type:Boolean})],je.prototype,"trailingIcon",void 0),Ae([o.property({type:Boolean})],je.prototype,"unselectable",void 0),Ae([o.query(".ft-switch-option--content slot")],je.prototype,"slottedContent",void 0),Ae([o.query(".ft-switch-option--input")],je.prototype,"input",void 0);var Me=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 Ue extends CustomEvent{constructor(t){super("change",{detail:t})}}class Ee extends e.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}updated(t){var e;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Ue(null===(e=this.selectedOption)||void 0===e?void 0:e.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return i.html`
|
|
696
696
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
697
697
|
<slot @slotchange=${this.onSlotchange}
|
|
698
698
|
@option-change=${this.onOptionChange}></slot>
|
|
699
699
|
</div>
|
|
700
|
-
`}onKeyDown(t){let
|
|
700
|
+
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].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 je&&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)}onOptionChange(t){t.stopPropagation();let e=t.target;e.selected?this.selectedOption=e:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Ee.elementDefinitions={},Ee.styles=i.css`
|
|
701
701
|
:host {
|
|
702
702
|
display: inline-block;
|
|
703
703
|
}
|
|
@@ -713,25 +713,25 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
716
|
-
${
|
|
717
|
-
${
|
|
718
|
-
${
|
|
716
|
+
${e.setVariable(Ne.borderRadiusLeft,"0")};
|
|
717
|
+
${e.setVariable(Ne.borderRadiusRight,"0")};
|
|
718
|
+
${e.setVariable(Ne.borderWidthLeft,"0")};
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
722
|
-
${
|
|
723
|
-
${
|
|
722
|
+
${e.setVariable(Ne.borderRadiusLeft,_t.borderRadius)};
|
|
723
|
+
${e.setVariable(Ne.borderWidthLeft,"1px")};
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
727
|
-
${
|
|
727
|
+
${e.setVariable(Ne.borderRadiusRight,_t.borderRadius)};
|
|
728
728
|
}
|
|
729
729
|
|
|
730
730
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
731
731
|
--ft-switch-internal-vertical-padding: 2px;
|
|
732
732
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
733
733
|
}
|
|
734
|
-
`,
|
|
734
|
+
`,Me([o.property({type:Boolean})],Ee.prototype,"dense",void 0),Me([o.property({type:Boolean})],Ee.prototype,"unselectable",void 0),Me([o.query(".ft-switch slot")],Ee.prototype,"slottedContent",void 0),Me([o.state()],Ee.prototype,"selectedOption",void 0),Me([o.query(".ft-switch")],Ee.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(Ee),e.customElement("ft-switch-option")(je);const Fe=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),Le=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),Pe=i.css`
|
|
735
735
|
:host {
|
|
736
736
|
display: block;
|
|
737
737
|
}
|
|
@@ -742,17 +742,17 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
742
742
|
|
|
743
743
|
ft-icon {
|
|
744
744
|
transform: rotate(-45deg);
|
|
745
|
-
color: ${
|
|
745
|
+
color: ${Fe};
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
.ft-resizer--dragging ft-icon,
|
|
749
749
|
.ft-resizer:hover ft-icon {
|
|
750
|
-
color: ${
|
|
750
|
+
color: ${Le};
|
|
751
751
|
}
|
|
752
|
-
`;var
|
|
752
|
+
`;var He=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 We extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class Ze extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",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 i.html`
|
|
753
753
|
<style>
|
|
754
754
|
.ft-resizer {
|
|
755
|
-
cursor: ${
|
|
755
|
+
cursor: ${i.unsafeCSS(this.cursor)}
|
|
756
756
|
}
|
|
757
757
|
</style>
|
|
758
758
|
<div class="ft-resizer ft-no-text-select ${this.dragging?"ft-resizer--dragging":""}"
|
|
@@ -760,25 +760,25 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
760
760
|
@touchstart=${this.initDragFromTouch}>
|
|
761
761
|
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
762
762
|
</div>
|
|
763
|
-
`}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,
|
|
763
|
+
`}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,e){this.dragging=!0,this.startX=t,this.startY=e,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,e){let i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new We(i,o))}}Ze.elementDefinitions={"ft-icon":me},Ze.styles=[e.noTextSelect,Pe],He([o.property({type:Number})],Ze.prototype,"initialWidth",void 0),He([o.property({type:Number})],Ze.prototype,"initialHeight",void 0),He([o.property()],Ze.prototype,"icon",void 0),He([o.property()],Ze.prototype,"cursor",void 0),He([o.state()],Ze.prototype,"dragging",void 0),e.customElement("ft-resizer")(Ze);const Ve={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Ge=i.css`
|
|
764
764
|
.ft-input-label {
|
|
765
765
|
position: absolute;
|
|
766
766
|
inset: 0;
|
|
767
767
|
display: flex;
|
|
768
|
-
background-color: ${
|
|
769
|
-
border-radius: ${
|
|
768
|
+
background-color: ${Ve.colorSurface};
|
|
769
|
+
border-radius: ${Ve.borderRadiusS} ${Ve.borderRadiusS} 0 0;
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
.ft-input-label--outlined {
|
|
773
|
-
border-radius: ${
|
|
773
|
+
border-radius: ${Ve.borderRadiusS};
|
|
774
774
|
}
|
|
775
775
|
|
|
776
776
|
.ft-input-label {
|
|
777
|
-
border-color: ${
|
|
777
|
+
border-color: ${Ve.borderColor};
|
|
778
778
|
}
|
|
779
779
|
|
|
780
780
|
.ft-input-label.ft-input-label--in-error {
|
|
781
|
-
border-color: ${
|
|
781
|
+
border-color: ${Ve.colorError}
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
.ft-input-label:before,
|
|
@@ -791,7 +791,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
791
791
|
}
|
|
792
792
|
|
|
793
793
|
.ft-input-label:before {
|
|
794
|
-
width: calc(${
|
|
794
|
+
width: calc(${Ve.horizontalSpacing} - 4px);
|
|
795
795
|
flex-shrink: 0;
|
|
796
796
|
}
|
|
797
797
|
|
|
@@ -807,20 +807,20 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
807
807
|
border-bottom-width: 1px;
|
|
808
808
|
border-bottom-style: solid;
|
|
809
809
|
border-color: inherit;
|
|
810
|
-
color: ${
|
|
810
|
+
color: ${Ve.textColor};
|
|
811
811
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
812
|
-
max-width: calc(${
|
|
812
|
+
max-width: calc(${Ve.labelMaxWidth} - 2 * (${Ve.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
813
813
|
text-overflow: ellipsis;
|
|
814
|
-
${
|
|
815
|
-
${
|
|
814
|
+
${e.setVariable(H.fontSize,Ve.fontSize)};
|
|
815
|
+
${e.setVariable(H.lineHeight,Ve.fontSize)};
|
|
816
816
|
}
|
|
817
817
|
|
|
818
818
|
.ft-input-label--in-error .ft-input-label--text {
|
|
819
|
-
color: ${
|
|
819
|
+
color: ${Ve.colorError}
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
.ft-input-label--disabled .ft-input-label--text {
|
|
823
|
-
color: ${
|
|
823
|
+
color: ${Ve.disabledTextColor};
|
|
824
824
|
}
|
|
825
825
|
|
|
826
826
|
.ft-input-label--hidden-text {
|
|
@@ -837,19 +837,19 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
837
837
|
overflow: hidden;
|
|
838
838
|
white-space: nowrap;
|
|
839
839
|
text-overflow: ellipsis;
|
|
840
|
-
padding: ${
|
|
841
|
-
margin: calc(${
|
|
840
|
+
padding: ${Ve.verticalSpacing} 4px;
|
|
841
|
+
margin: calc(${Ve.verticalSpacing} * -1) 0;
|
|
842
842
|
max-width: 100%;
|
|
843
843
|
box-sizing: border-box;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
846
|
.ft-input-label--raised .ft-input-label--text {
|
|
847
|
-
${
|
|
848
|
-
${
|
|
847
|
+
${e.setVariable(H.fontSize,Ve.raisedFontSize)};
|
|
848
|
+
${e.setVariable(H.lineHeight,Ve.raisedFontSize)};
|
|
849
849
|
}
|
|
850
850
|
|
|
851
851
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
852
|
-
top: ${
|
|
852
|
+
top: ${Ve.verticalSpacing};
|
|
853
853
|
}
|
|
854
854
|
|
|
855
855
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -862,36 +862,36 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
862
862
|
.ft-input-label--outlined:before {
|
|
863
863
|
border-left-width: 1px;
|
|
864
864
|
border-left-style: solid;
|
|
865
|
-
border-radius: ${
|
|
865
|
+
border-radius: ${Ve.borderRadiusS} 0 0 ${Ve.borderRadiusS};
|
|
866
866
|
}
|
|
867
867
|
|
|
868
868
|
.ft-input-label--outlined:after {
|
|
869
869
|
border-right-width: 1px;
|
|
870
870
|
border-right-style: solid;
|
|
871
|
-
border-radius: 0 ${
|
|
871
|
+
border-radius: 0 ${Ve.borderRadiusS} ${Ve.borderRadiusS} 0;
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
875
875
|
padding: 2px 4px;
|
|
876
|
-
z-index: ${
|
|
877
|
-
background-color: ${
|
|
878
|
-
border-radius: ${
|
|
876
|
+
z-index: ${Ve.raisedZIndex};
|
|
877
|
+
background-color: ${Ve.colorSurface};
|
|
878
|
+
border-radius: ${Ve.borderRadiusS};
|
|
879
879
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
883
883
|
border-top: none;
|
|
884
884
|
}
|
|
885
|
-
`;var
|
|
885
|
+
`;var Ke=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 Ye extends e.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 i.html`
|
|
886
886
|
<div class="${n.classMap(t)}">
|
|
887
|
-
${this.text?
|
|
887
|
+
${this.text?i.html`
|
|
888
888
|
<div class="ft-input-label--text ft-typography--caption">
|
|
889
889
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
890
890
|
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
891
891
|
</div>
|
|
892
892
|
`:null}
|
|
893
893
|
</div>
|
|
894
|
-
`}}
|
|
894
|
+
`}}Ye.elementDefinitions={},Ye.styles=[ht,Ge],Ke([o.property({type:String})],Ye.prototype,"text",void 0),Ke([o.property({type:Boolean})],Ye.prototype,"raised",void 0),Ke([o.property({type:Boolean})],Ye.prototype,"outlined",void 0),Ke([o.property({type:Boolean})],Ye.prototype,"disabled",void 0),Ke([o.property({type:Boolean})],Ye.prototype,"error",void 0),e.customElement("ft-input-label")(Ye);const qe={fontSize:e.FtCssVariableFactory.create("--ft-text-area-font-size","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-area-label-size","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-area-helper-color",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Xe=i.css`
|
|
895
895
|
*:focus {
|
|
896
896
|
outline: none;
|
|
897
897
|
}
|
|
@@ -903,10 +903,10 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
903
903
|
}
|
|
904
904
|
|
|
905
905
|
ft-input-label {
|
|
906
|
-
${
|
|
907
|
-
${
|
|
908
|
-
${
|
|
909
|
-
${
|
|
906
|
+
${e.setVariable(Ve.fontSize,qe.fontSize)};
|
|
907
|
+
${e.setVariable(Ve.raisedFontSize,qe.labelSize)};
|
|
908
|
+
${e.setVariable(Ve.verticalSpacing,qe.verticalSpacing)};
|
|
909
|
+
${e.setVariable(Ve.horizontalSpacing,qe.horizontalSpacing)};
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
.ft-text-area--main-panel {
|
|
@@ -924,8 +924,8 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
924
924
|
}
|
|
925
925
|
|
|
926
926
|
.ft-text-area--input-panel ft-ripple {
|
|
927
|
-
${
|
|
928
|
-
${
|
|
927
|
+
${e.setVariable(p.opacityContentOnSurfaceHover,"0.08")};
|
|
928
|
+
${e.setVariable(p.opacityContentOnSurfacePressed,"0.04")};
|
|
929
929
|
}
|
|
930
930
|
|
|
931
931
|
.ft-text-area--input {
|
|
@@ -937,12 +937,12 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
937
937
|
align-self: stretch;
|
|
938
938
|
resize: none;
|
|
939
939
|
|
|
940
|
-
${
|
|
941
|
-
${
|
|
942
|
-
color: ${
|
|
940
|
+
${e.setVariable(j.fontSize,qe.fontSize)};
|
|
941
|
+
${e.setVariable(j.lineHeight,qe.fontSize)};
|
|
942
|
+
color: ${qe.colorOnSurface};
|
|
943
943
|
|
|
944
|
-
padding: 0 ${
|
|
945
|
-
margin: calc(${
|
|
944
|
+
padding: 0 ${qe.horizontalSpacing};
|
|
945
|
+
margin: calc(${qe.verticalSpacing} + ${qe.labelSize} / 2) 0 ${qe.verticalSpacing} 0;
|
|
946
946
|
|
|
947
947
|
border: none;
|
|
948
948
|
background: none;
|
|
@@ -951,7 +951,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
951
951
|
}
|
|
952
952
|
|
|
953
953
|
.ft-text-area--disabled .ft-text-area--input {
|
|
954
|
-
color: ${
|
|
954
|
+
color: ${qe.colorOnSurfaceDisabled};
|
|
955
955
|
}
|
|
956
956
|
|
|
957
957
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -959,32 +959,32 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
959
959
|
}
|
|
960
960
|
|
|
961
961
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
962
|
-
${
|
|
963
|
-
${
|
|
962
|
+
${e.setVariable(Ve.borderColor,qe.colorPrimary)};
|
|
963
|
+
${e.setVariable(Ve.textColor,qe.colorPrimary)};
|
|
964
964
|
}
|
|
965
965
|
|
|
966
966
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
967
|
-
border-radius: ${
|
|
967
|
+
border-radius: ${qe.borderRadiusS} ${qe.borderRadiusS} 0 0;
|
|
968
968
|
}
|
|
969
969
|
|
|
970
970
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
971
971
|
align-self: stretch;
|
|
972
|
-
margin-bottom: ${
|
|
973
|
-
margin-top: calc(${
|
|
972
|
+
margin-bottom: ${qe.verticalSpacing};
|
|
973
|
+
margin-top: calc(${qe.labelSize} + 2 * ${qe.verticalSpacing});
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
977
|
-
border-radius: ${
|
|
977
|
+
border-radius: ${qe.borderRadiusS};
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
.ft-text-area--helper-text {
|
|
981
|
-
padding: 0 12px 0 ${
|
|
982
|
-
color: ${
|
|
981
|
+
padding: 0 12px 0 ${qe.horizontalSpacing};
|
|
982
|
+
color: ${qe.helperColor};
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
.ft-text-area--in-error .ft-text-area--input,
|
|
986
986
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
987
|
-
color: ${
|
|
987
|
+
color: ${qe.colorError};
|
|
988
988
|
}
|
|
989
989
|
|
|
990
990
|
ft-resizer {
|
|
@@ -992,10 +992,10 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
992
992
|
right: 0;
|
|
993
993
|
bottom: 0;
|
|
994
994
|
}
|
|
995
|
-
`;var
|
|
995
|
+
`;var Je=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 Qe extends e.FtLitElement{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 i.html`
|
|
996
996
|
<style>
|
|
997
997
|
.ft-text-area--main-panel {
|
|
998
|
-
height: calc(4 * ${
|
|
998
|
+
height: calc(4 * ${qe.verticalSpacing} + ${qe.labelSize} + ${qe.fontSize} + ${this.height}px);
|
|
999
999
|
}
|
|
1000
1000
|
</style>
|
|
1001
1001
|
<div class="${n.classMap(t)}">
|
|
@@ -1008,7 +1008,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1008
1008
|
></ft-input-label>
|
|
1009
1009
|
<div class="ft-text-area--input-panel"
|
|
1010
1010
|
aria-label="${this.label}">
|
|
1011
|
-
${this.outlined?null:
|
|
1011
|
+
${this.outlined?null:i.html`
|
|
1012
1012
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1013
1013
|
`}
|
|
1014
1014
|
<textarea class="ft-typography--body1 ft-text-area--input"
|
|
@@ -1025,19 +1025,19 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1025
1025
|
initialHeight="${this.height}"
|
|
1026
1026
|
cursor="ns-resize"></ft-resizer>
|
|
1027
1027
|
</div>
|
|
1028
|
-
${this.helper?
|
|
1028
|
+
${this.helper?i.html`
|
|
1029
1029
|
<ft-typography class="ft-text-area--helper-text" variant="caption">
|
|
1030
1030
|
${this.helper}
|
|
1031
1031
|
</ft-typography>`:void 0}
|
|
1032
1032
|
</div>
|
|
1033
|
-
`}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}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)||""}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}
|
|
1033
|
+
`}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}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)||""}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Qe.elementDefinitions={"ft-input-label":Ye,"ft-resizer":Ze,"ft-ripple":Re,"ft-typography":xe},Qe.styles=[at,Xe],Je([o.property({type:String})],Qe.prototype,"label",void 0),Je([o.property({reflect:!0})],Qe.prototype,"value",void 0),Je([o.property({type:String})],Qe.prototype,"helper",void 0),Je([o.property({type:Boolean})],Qe.prototype,"outlined",void 0),Je([o.property({type:Boolean})],Qe.prototype,"disabled",void 0),Je([o.property({type:Boolean})],Qe.prototype,"error",void 0),Je([o.property({type:Number,reflect:!0})],Qe.prototype,"height",void 0),Je([o.query("textarea")],Qe.prototype,"textarea",void 0),Je([o.state()],Qe.prototype,"focused",void 0),e.customElement("ft-text-area")(Qe);class ti extends e.FtLitElement{render(){return i.html`
|
|
1034
1034
|
<div class="ft-loader">
|
|
1035
1035
|
<div></div>
|
|
1036
1036
|
<div></div>
|
|
1037
1037
|
<div></div>
|
|
1038
1038
|
<div></div>
|
|
1039
1039
|
</div>
|
|
1040
|
-
`}}
|
|
1040
|
+
`}}ti.styles=vt,e.customElement("ft-loader")(ti);var ei=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 ii extends e.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=be.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}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(i.html`
|
|
1041
1041
|
<button part="button"
|
|
1042
1042
|
class="${n.classMap(t)}"
|
|
1043
1043
|
aria-label="${this.getLabel()}"
|
|
@@ -1046,29 +1046,29 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1046
1046
|
<ft-typography part="label"
|
|
1047
1047
|
variant="button"
|
|
1048
1048
|
element="span"
|
|
1049
|
-
class="ft-button--label ${
|
|
1049
|
+
class="ft-button--label ${e.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
1050
1050
|
?hidden=${!this.hasTextContent()}>
|
|
1051
1051
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
1052
1052
|
</ft-typography>
|
|
1053
1053
|
${this.resolveIcon()}
|
|
1054
1054
|
</button>
|
|
1055
|
-
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?
|
|
1055
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?i.html`
|
|
1056
1056
|
<ft-tooltip part="tooltip"
|
|
1057
1057
|
text="${this.getLabel()}"
|
|
1058
1058
|
position="${this.tooltipPosition}">
|
|
1059
1059
|
${t}
|
|
1060
1060
|
</ft-tooltip>
|
|
1061
|
-
`:t}resolveIcon(){return this.loading?
|
|
1062
|
-
<ft-loader part="loader icon"></ft-loader> `:this.icon?
|
|
1063
|
-
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:
|
|
1064
|
-
`,
|
|
1065
|
-
`,
|
|
1061
|
+
`:t}resolveIcon(){return this.loading?i.html`
|
|
1062
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1063
|
+
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.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}}ii.elementDefinitions={"ft-ripple":Re,"ft-tooltip":Te,"ft-typography":xe,"ft-icon":me,"ft-loader":ti},ii.styles=[e.safariEllipsisFix,kt],ei([o.property({type:String,reflect:!0})],ii.prototype,"role",void 0),ei([o.property({type:Boolean})],ii.prototype,"primary",void 0),ei([o.property({type:Boolean})],ii.prototype,"outlined",void 0),ei([o.property({type:Boolean})],ii.prototype,"disabled",void 0),ei([o.property({type:Boolean})],ii.prototype,"dense",void 0),ei([o.property({type:Boolean})],ii.prototype,"round",void 0),ei([o.property({type:String})],ii.prototype,"label",void 0),ei([o.property({type:String})],ii.prototype,"icon",void 0),ei([o.property({type:String})],ii.prototype,"iconVariant",void 0),ei([o.property({type:Boolean})],ii.prototype,"trailingIcon",void 0),ei([o.property({type:Boolean})],ii.prototype,"loading",void 0),ei([o.property({type:String})],ii.prototype,"tooltipPosition",void 0),ei([o.property({type:Boolean})],ii.prototype,"hideTooltip",void 0),ei([o.property({type:Boolean})],ii.prototype,"forceTooltip",void 0),ei([o.query(".ft-button")],ii.prototype,"button",void 0),ei([o.query(".ft-button--label slot")],ii.prototype,"slottedContent",void 0),e.customElement("ft-button")(ii);const oi=i.css`
|
|
1064
|
+
`,si=i.css`
|
|
1065
|
+
`,ni=e.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class ri{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=ni.getState(),o=null!=t?t:i;if(e&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,o,!0)}static get(t){var e;return null!=t?ri.build(t):null!==(e=ri.API)&&void 0!==e?e:ri.API=ri.build()}static await(t){return new Promise((e=>{let i=ri.get(t);if(i)e(i);else{const o=ni.subscribe((()=>{i=ri.get(t),i&&(o(),e(i))}))}}))}}var ai;const li=Symbol("clearAfterUnitTest");class hi{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[ai]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=ni.getState().uiLocale,ni.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=ni.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,i){var o;if(t=t.toLowerCase(),Object.keys(i).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...i};e.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,i,...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 e.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(i,...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,e){var i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.delete(e)}}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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}ai=li,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new hi((async(t,e)=>(await ri.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new hi((async(t,e)=>(await ri.await()).getCustomMessageContext(t,e))));const di=window.FluidTopicsI18nService,pi=window.FluidTopicsCustomI18nService;var ci=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 fi extends e.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=()=>ri.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return i.html`
|
|
1066
1066
|
<slot></slot>
|
|
1067
|
-
`}updated(t){super.updated(t),t.has("baseUrl")&&
|
|
1067
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&ni.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&ni.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&ni.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&ni.actions.setNoCustom(this.noCustom),t.has("editorMode")&&ni.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&ni.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&ni.actions.setSession(this.session),t.has("availableUiLocales")&&ni.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>di.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 e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}fi.elementDefinitions={},fi.styles=si,ci([o.property()],fi.prototype,"baseUrl",void 0),ci([o.property()],fi.prototype,"apiIntegrationIdentifier",void 0),ci([o.property()],fi.prototype,"uiLocale",void 0),ci([e.jsonProperty([])],fi.prototype,"availableUiLocales",void 0),ci([o.property({type:Boolean})],fi.prototype,"editorMode",void 0),ci([o.property({type:Boolean})],fi.prototype,"noCustom",void 0),ci([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],fi.prototype,"noCustomComponent",void 0),ci([o.property({type:Boolean})],fi.prototype,"withManualResources",void 0),ci([e.jsonProperty([])],fi.prototype,"messageContexts",void 0),ci([e.jsonProperty(void 0)],fi.prototype,"session",void 0),ci([o.property({type:Object})],fi.prototype,"apiProvider",void 0),e.customElement("ft-app-context")(fi);var ui=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};const vi=Symbol("i18nProperties"),bi=Symbol("i18nUnsubs");function gi(t){var e;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?pi:di}i18n(t,e,...i){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...i);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 e;null===(e=this[vi])||void 0===e||e.forEach(((e,i)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[i]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var e;super.updated(t),null===(e=this[vi])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[vi]&&new Set([...this[vi].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[bi].has(t)||this[bi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[bi].forEach((t=>t())),this[bi].clear()}}return e=bi,ui([o.property({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}class xi extends(gi(e.FtLitElement)){}class yi extends(gi(e.FtLitElementRedux)){}var mi=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 $i extends yi{constructor(){super(),this.editorMode=!1,this.addStore(ni)}render(){return this.key&&this.context?i.html`
|
|
1068
1068
|
<span class="ft-i18n">${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}</span>
|
|
1069
|
-
`:
|
|
1069
|
+
`:this.editorMode?"Select a context and a label key.":i.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}$i.elementDefinitions={},$i.styles=oi,mi([e.redux()],$i.prototype,"editorMode",void 0),mi([o.property()],$i.prototype,"context",void 0),mi([o.property()],$i.prototype,"key",void 0),mi([e.jsonProperty([])],$i.prototype,"args",void 0),mi([o.property()],$i.prototype,"defaultMessage",void 0);class wi{constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const i=e;return t=>({context:this.name,key:i,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>di.resolveMessage(this.name,e,...t)})}static build(t){return new wi(t)}static fromGwt(t){return new wi(t)}}const ki=t=>(e,i)=>{var o,s;e.constructor.createProperty(i,{attribute:!1,type:String});const n={...t,key:null!==(o=t.key)&&void 0!==o?o:i};e[vi]=null!==(s=e[vi])&&void 0!==s?s:new Map,e[vi].set(i,n)};e.customElement("ft-i18n")($i);const _i=wi.build("integratedFeedbackComponent"),Si={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?",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"},Ii=wi.build("inDesignerFeedbackComponent"),zi={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."};var Ci=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 Ti extends xi{constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.feedbackMessage="",this.iconVariant=be.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.addI18nContext(_i,Si),this.addI18nContext(Ii,zi)}get canAccessFeedback(){return this.user&&this.user.roles.includes("FEEDBACK_USER")}get canAccessRating(){return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType}get userHasRatingRole(){return this.user&&this.user.roles.includes("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`
|
|
1070
1070
|
<div class="ft-reader-feedback">
|
|
1071
|
-
${this.hideTitle?
|
|
1071
|
+
${this.hideTitle?i.nothing:i.html`
|
|
1072
1072
|
<ft-typography variant="title" part="main-title">
|
|
1073
1073
|
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
1074
1074
|
</ft-typography>
|
|
@@ -1076,7 +1076,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1076
1076
|
${this.renderRatingSection()}
|
|
1077
1077
|
${this.renderFeedbackSection()}
|
|
1078
1078
|
</div>
|
|
1079
|
-
`:
|
|
1079
|
+
`:i.nothing}renderRatingSection(){return this.canAccessRating?i.html`
|
|
1080
1080
|
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
1081
1081
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1082
1082
|
${this.i18n("DICHOTOMOUS"===this.ratingSummary.type?this.i18nProperties.dichotomousRatingSectionTitle:this.i18nProperties.ratingSectionTitle)}
|
|
@@ -1086,11 +1086,11 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1086
1086
|
${this.renderRatingDate()}
|
|
1087
1087
|
</ft-typography>
|
|
1088
1088
|
</div>
|
|
1089
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1089
|
+
`:this.placeholderInEditor(this.userHasRatingRole?Ii.messages.ratingNotConfigured():Ii.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return _i.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return _i.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?_i.messages.ratedToday():_i.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return i.html`
|
|
1090
1090
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1091
|
-
${r.repeat(new Array(5),((t,
|
|
1091
|
+
${r.repeat(new Array(5),((t,e)=>e),((t,e)=>{let o="STARS"===this.ratingType&&this.ratingValue>e;const s=e+1;return i.html`
|
|
1092
1092
|
<ft-button round part="rating-stars-${s}"
|
|
1093
|
-
label="${
|
|
1093
|
+
label="${_i.messages.starsRating(s)}"
|
|
1094
1094
|
tooltipPosition="top"
|
|
1095
1095
|
.iconVariant=${this.iconVariant}
|
|
1096
1096
|
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
@@ -1099,66 +1099,66 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1099
1099
|
></ft-button>
|
|
1100
1100
|
`}))}
|
|
1101
1101
|
</div>
|
|
1102
|
-
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,
|
|
1102
|
+
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,e="LIKE"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
1103
1103
|
<ft-switch @change=${t=>this.rate(t.detail)} part="rating rating-like">
|
|
1104
1104
|
<ft-switch-option .value=${1}
|
|
1105
|
-
?selected=${
|
|
1105
|
+
?selected=${e}
|
|
1106
1106
|
.iconVariant=${this.iconVariant}
|
|
1107
|
-
icon="${
|
|
1108
|
-
${
|
|
1107
|
+
icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1108
|
+
${_i.messages.like()}
|
|
1109
1109
|
</ft-switch-option>
|
|
1110
1110
|
<ft-switch-option .value=${0}
|
|
1111
1111
|
?selected=${t}
|
|
1112
1112
|
.iconVariant=${this.iconVariant}
|
|
1113
1113
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1114
|
-
${
|
|
1114
|
+
${_i.messages.dislike()}
|
|
1115
1115
|
</ft-switch-option>
|
|
1116
1116
|
</ft-switch>
|
|
1117
|
-
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return
|
|
1117
|
+
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
1118
1118
|
<ft-switch @change=${t=>this.rate(t.detail)}
|
|
1119
1119
|
part="rating rating-dichotomous">
|
|
1120
1120
|
<ft-switch-option .value=${1}
|
|
1121
1121
|
?selected=${s}>
|
|
1122
|
-
${
|
|
1122
|
+
${_i.messages.dichotomousYes()}
|
|
1123
1123
|
</ft-switch-option>
|
|
1124
1124
|
<ft-switch-option .value=${0}
|
|
1125
1125
|
?selected=${o}>
|
|
1126
|
-
${
|
|
1126
|
+
${_i.messages.dichotomousNo()}
|
|
1127
1127
|
</ft-switch-option>
|
|
1128
1128
|
</ft-switch>
|
|
1129
|
-
`}return
|
|
1129
|
+
`}return i.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){if(this.canAccessFeedback){const t=this.feedbackMailLinkBuilder(this.feedbackMessage);let e=i.html`
|
|
1130
1130
|
<ft-button primary
|
|
1131
1131
|
class="ft-reader-feedback--send-feedback"
|
|
1132
1132
|
?disabled=${!this.feedbackMessage}
|
|
1133
1133
|
@click=${()=>t?this.clearFeedbackInput():this.sendFeedback()}
|
|
1134
1134
|
part="send-feedback">
|
|
1135
|
-
${
|
|
1135
|
+
${_i.messages.okButton()}
|
|
1136
1136
|
</ft-button>
|
|
1137
|
-
`;return t&&(i
|
|
1137
|
+
`;return t&&(e=i.html`
|
|
1138
1138
|
<a class="ft-reader-feedback--feedback-link" href="${t}">
|
|
1139
|
-
${
|
|
1139
|
+
${e}
|
|
1140
1140
|
</a>
|
|
1141
|
-
`),
|
|
1141
|
+
`),i.html`
|
|
1142
1142
|
<div class="ft-reader-feedback--feedback" part="feedback-container">
|
|
1143
1143
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1144
1144
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
1145
1145
|
</ft-typography>
|
|
1146
1146
|
<ft-text-area outlined
|
|
1147
1147
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1148
|
-
label="${
|
|
1148
|
+
label="${_i.messages.feedbackInputLabel()}"
|
|
1149
1149
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1150
1150
|
></ft-text-area>
|
|
1151
|
-
${
|
|
1151
|
+
${e}
|
|
1152
1152
|
</div>
|
|
1153
|
-
`}return this.placeholderInEditor(
|
|
1153
|
+
`}return this.placeholderInEditor(Ii.messages.missingFeedbackRole())}sendFeedback(){this.dispatchEvent(new CustomEvent("send-feedback",{detail:this.feedbackInput.value}))}placeholderInEditor(t){return this.editorMode?i.html`
|
|
1154
1154
|
<div class="ft-reader-feedback--placeholder">
|
|
1155
1155
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1156
1156
|
<ft-tooltip position="left"
|
|
1157
|
-
text="${
|
|
1157
|
+
text="${Ii.messages.inDesignerOnlyNotice()}">
|
|
1158
1158
|
<ft-icon>INFO</ft-icon>
|
|
1159
1159
|
</ft-tooltip>
|
|
1160
1160
|
</div>
|
|
1161
|
-
`:
|
|
1161
|
+
`:i.nothing}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Ti.elementDefinitions={"ft-button":ii,"ft-typography":xe,"ft-icon":me,"ft-tooltip":Te,"ft-switch":Ee,"ft-switch-option":je,"ft-text-area":Qe},Ti.styles=It,Ci([o.property({type:Boolean})],Ti.prototype,"editorMode",void 0),Ci([o.property({type:Boolean})],Ti.prototype,"hideTitle",void 0),Ci([o.property({type:Boolean})],Ti.prototype,"ratingAllowed",void 0),Ci([o.property({attribute:!1})],Ti.prototype,"i18nProperties",void 0),Ci([o.property({attribute:!1})],Ti.prototype,"ratingSummary",void 0),Ci([o.property({attribute:!1})],Ti.prototype,"user",void 0),Ci([o.query(".ft-reader-feedback--feedback-input")],Ti.prototype,"feedbackInput",void 0),Ci([o.state()],Ti.prototype,"feedbackMessage",void 0),Ci([o.property()],Ti.prototype,"iconVariant",void 0),Ci([o.property()],Ti.prototype,"emptyStarIcon",void 0),Ci([o.property()],Ti.prototype,"filledStarIcon",void 0),Ci([o.property()],Ti.prototype,"emptyLikeIcon",void 0),Ci([o.property()],Ti.prototype,"filledLikeIcon",void 0),Ci([o.property()],Ti.prototype,"emptyDislikeIcon",void 0),Ci([o.property()],Ti.prototype,"filledDislikeIcon",void 0),Ci([o.property()],Ti.prototype,"feedbackMailLinkBuilder",void 0);const Oi=wi.fromGwt("server");class Ri{constructor(){this.subject="",this.url="",this.allMetadata="",this.subjectMetadata="",this.isAuthenticated=!1}update(t,e,i,o,s){this.subject=t,this.url=e,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=o.subjectMetadataIds.map((t=>i.find((e=>e.key===t)))).filter((t=>null!=t)).map((t=>"["+t.values.join(", ")+"]")).join(""),this.allMetadata=i.filter((t=>!t.key.startsWith("ft:"))).map((t=>"["+t.values.join(", ")+"]")).join(" ")}build(t){var e,i;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics)))return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),s=encodeURIComponent(`\n${this.allMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${Oi.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(i=this.configuration)||void 0===i?void 0:i.recipients.join(",")}?subject=${o}&body=${s}`}}var Ni=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 Di extends(gi(h)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=be.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 Ri,this.i18nProperties={feedbackMainTitle:_i.properties.mapFeedbackMainTitle(),ratingSectionTitle:_i.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:_i.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:_i.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(ni)}render(){return null==this.map?i.nothing:i.html`
|
|
1162
1162
|
<ft-reader-feedback
|
|
1163
1163
|
ratingAllowed
|
|
1164
1164
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1177,7 +1177,7 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1177
1177
|
@rate=${this.rate}
|
|
1178
1178
|
@send-feedback=${this.sendFeedback}
|
|
1179
1179
|
></ft-reader-feedback>
|
|
1180
|
-
`}updated(t){var i,
|
|
1180
|
+
`}updated(t){var e,i,o;super.updated(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.map&&((null===(t=this.user)||void 0===t?void 0:t.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 i,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.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 e.FtNotificationEvent({type:"error",message:_i.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ii.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ii.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(i=this.service)||void 0===i?void 0:i.sendMapFeedback(t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:_i.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:_i.messages.feedbackFailure()}))}}}Di.elementDefinitions={"ft-reader-feedback":Ti},Ni([e.redux({store:ni.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Di.prototype,"user",void 0),Ni([e.redux({store:"reader"})],Di.prototype,"map",void 0),Ni([e.redux({store:ni.name})],Di.prototype,"editorMode",void 0),Ni([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Di.prototype,"configuration",void 0),Ni([o.state()],Di.prototype,"ratingSummary",void 0),Ni([o.property({type:Boolean})],Di.prototype,"hideTitle",void 0),Ni([o.property()],Di.prototype,"iconVariant",void 0),Ni([o.property()],Di.prototype,"emptyStarIcon",void 0),Ni([o.property()],Di.prototype,"filledStarIcon",void 0),Ni([o.property()],Di.prototype,"emptyLikeIcon",void 0),Ni([o.property()],Di.prototype,"filledLikeIcon",void 0),Ni([o.property()],Di.prototype,"emptyDislikeIcon",void 0),Ni([o.property()],Di.prototype,"filledDislikeIcon",void 0),Ni([o.query("ft-reader-feedback")],Di.prototype,"readerFeedback",void 0),Ni([ki(Oi.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],Di.prototype,"mailSubject",void 0);var Ai=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 Bi extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}class ji extends(function(t){class e extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registerIntervalTopic=0}connectedCallback(){super.connectedCallback(),this.registerIntervalTopic=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this.registerIntervalTopic):this.dispatchEvent(new Bi)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return Ai([o.state()],e.prototype,"tocNode",void 0),Ai([o.state()],e.prototype,"disableContextInteractions",void 0),e}(h)){}var Mi=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 Ui extends(gi(ji)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=be.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 Ri,this.i18nProperties={feedbackMainTitle:_i.properties.topicFeedbackMainTitle(),ratingSectionTitle:_i.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:_i.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:_i.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(ni)}render(){return null==this.map||null==this.tocNode?i.nothing:i.html`
|
|
1181
1181
|
<ft-reader-feedback
|
|
1182
1182
|
.i18nProperties=${this.i18nProperties}
|
|
1183
1183
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1196,4 +1196,4 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
|
|
|
1196
1196
|
@rate=${this.rate}
|
|
1197
1197
|
@send-feedback=${this.sendFeedback}
|
|
1198
1198
|
></ft-reader-feedback>
|
|
1199
|
-
`}updated(t){var i,
|
|
1199
|
+
`}updated(t){var e,i,o;super.updated(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.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 i,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.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 e.FtNotificationEvent({type:"error",message:_i.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ii.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{!this.editorMode&&this.tocNode?(await(null===(i=this.service)||void 0===i?void 0:i.sendTopicFeedback(this.tocNode.tocId,t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:_i.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ii.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:_i.messages.feedbackFailure()}))}}}Ui.elementDefinitions={"ft-reader-feedback":Ti},Mi([e.redux({store:ni.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Ui.prototype,"user",void 0),Mi([e.redux({store:"reader"})],Ui.prototype,"map",void 0),Mi([e.redux({store:ni.name})],Ui.prototype,"editorMode",void 0),Mi([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Ui.prototype,"configuration",void 0),Mi([o.state()],Ui.prototype,"ratingSummary",void 0),Mi([o.property({type:Boolean})],Ui.prototype,"hideTitle",void 0),Mi([o.property()],Ui.prototype,"iconVariant",void 0),Mi([o.property()],Ui.prototype,"emptyStarIcon",void 0),Mi([o.property()],Ui.prototype,"filledStarIcon",void 0),Mi([o.property()],Ui.prototype,"emptyLikeIcon",void 0),Mi([o.property()],Ui.prototype,"filledLikeIcon",void 0),Mi([o.property()],Ui.prototype,"emptyDislikeIcon",void 0),Mi([o.property()],Ui.prototype,"filledDislikeIcon",void 0),Mi([o.query("ft-reader-feedback")],Ui.prototype,"readerFeedback",void 0),Mi([ki(Oi.properties["mail.feedback.subject"]((t=>{var e,i;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(i=t.map)||void 0===i?void 0:i.title]})))],Ui.prototype,"mailSubject",void 0),e.customElement("ft-reader-map-feedback")(Di),e.customElement("ft-reader-topic-feedback")(Ui),t.FtReaderFeedbackCssVariables=St,t.FtReaderMapFeedback=Di,t.FtReaderTopicFeedback=Ui,t.styles=It,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|