@fluid-topics/ft-reader-feedback 1.2.20 → 1.2.21
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.
|
@@ -216,7 +216,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
216
216
|
.ft-typography {
|
|
217
217
|
vertical-align: inherit;
|
|
218
218
|
}
|
|
219
|
-
`,cs=[Object.keys(Io).map(e=>Qa(e))];var ds=g(B()),Jr=g(R()),
|
|
219
|
+
`,cs=[Object.keys(Io).map(e=>Qa(e))];var ds=g(B()),Jr=g(R()),ot={color:Jr.FtCssVariableFactory.extend("--ft-loader-color","",Jr.designSystemVariables.colorPrimary),size:Jr.FtCssVariableFactory.create("--ft-loader-size","","SIZE","80px")},ps=ds.css`
|
|
220
220
|
:host {
|
|
221
221
|
line-height: 0;
|
|
222
222
|
}
|
|
@@ -225,8 +225,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
225
225
|
display: inline-block;
|
|
226
226
|
position: relative;
|
|
227
227
|
|
|
228
|
-
width: ${
|
|
229
|
-
height: ${
|
|
228
|
+
width: ${ot.size};
|
|
229
|
+
height: ${ot.size};
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
.ft-loader div {
|
|
@@ -235,7 +235,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
235
235
|
width: 25%;
|
|
236
236
|
height: 25%;
|
|
237
237
|
border-radius: 50%;
|
|
238
|
-
background: ${
|
|
238
|
+
background: ${ot.color};
|
|
239
239
|
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -282,7 +282,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
282
282
|
transform: translate(0, 0);
|
|
283
283
|
}
|
|
284
284
|
100% {
|
|
285
|
-
transform: translate(calc(0.35 * ${
|
|
285
|
+
transform: translate(calc(0.35 * ${ot.size}), 0);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
`;var us=g(B()),Ne=g(R()),St={size:Ne.FtCssVariableFactory.create("--ft-icon-font-size","","SIZE","24px"),fluidTopicsFontFamily:Ne.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family","",Ne.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-icons")),fileFormatFontFamily:Ne.FtCssVariableFactory.extend("--ft-icon-file-format-font-family","",Ne.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-mime")),materialFontFamily:Ne.FtCssVariableFactory.extend("--ft-icon-material-font-family","",Ne.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","Material Icons")),verticalAlign:Ne.FtCssVariableFactory.create("--ft-icon-vertical-align","","UNKNOWN","unset")},fs=us.css`
|
|
@@ -333,7 +333,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
333
333
|
.ft-icon--material {
|
|
334
334
|
font-family: ${St.materialFontFamily}, "Material Icons", sans-serif;
|
|
335
335
|
}
|
|
336
|
-
`;var hs=M.FtCssVariableFactory.extend("--ft-button-color","",M.designSystemVariables.colorPrimary),
|
|
336
|
+
`;var hs=M.FtCssVariableFactory.extend("--ft-button-color","",M.designSystemVariables.colorPrimary),et={backgroundColor:M.FtCssVariableFactory.extend("--ft-button-background-color","",M.designSystemVariables.colorSurface),borderRadius:M.FtCssVariableFactory.extend("--ft-button-border-radius","",M.designSystemVariables.borderRadiusL),color:hs,fontSize:M.FtCssVariableFactory.extend("--ft-button-font-size","",Wt.fontSize),iconSize:M.FtCssVariableFactory.create("--ft-button-icon-size","","SIZE","24px"),rippleColor:M.FtCssVariableFactory.extend("--ft-button-ripple-color","",hs),verticalPadding:M.FtCssVariableFactory.create("--ft-button-vertical-padding","","SIZE","6px"),horizontalPadding:M.FtCssVariableFactory.create("--ft-button-horizontal-padding","","SIZE","8px"),iconPadding:M.FtCssVariableFactory.create("--ft-button-icon-padding","","SIZE","8px"),opacityDisabled:M.FtCssVariableFactory.external(M.designSystemVariables.colorOpacityDisabled,"Design system")},ys=M.FtCssVariableFactory.extend("--ft-button-primary-color","",M.FtCssVariableFactory.extend("--ft-button-color","",M.designSystemVariables.colorOnPrimary)),qi={backgroundColor:M.FtCssVariableFactory.extend("--ft-button-primary-background-color","",M.FtCssVariableFactory.extend("--ft-button-background-color","",M.designSystemVariables.colorPrimary)),color:ys,rippleColor:M.FtCssVariableFactory.extend("--ft-button-primary-ripple-color","",ys)},Se={borderRadius:M.FtCssVariableFactory.extend("--ft-button-dense-border-radius","",M.FtCssVariableFactory.extend("--ft-button-border-radius","",M.designSystemVariables.borderRadiusM)),verticalPadding:M.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","","SIZE","2px"),horizontalPadding:M.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","","SIZE","4px"),iconPadding:M.FtCssVariableFactory.create("--ft-button-dense-icon-padding","","SIZE","4px")},gs=[ms.css`
|
|
337
337
|
:host {
|
|
338
338
|
display: inline-block;
|
|
339
339
|
max-width: 100%;
|
|
@@ -344,7 +344,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
344
344
|
box-shadow: 0px 0px 0px transparent;
|
|
345
345
|
border: 0px solid transparent;
|
|
346
346
|
text-shadow: 0px 0px 0px transparent;
|
|
347
|
-
font-size: ${
|
|
347
|
+
font-size: ${et.fontSize};
|
|
348
348
|
text-decoration: none;
|
|
349
349
|
}
|
|
350
350
|
|
|
@@ -374,21 +374,21 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
374
374
|
border: none;
|
|
375
375
|
pointer-events: auto;
|
|
376
376
|
|
|
377
|
-
--ft-button-internal-line-height: max(calc(${
|
|
378
|
-
--ft-button-internal-color: ${
|
|
379
|
-
${(0,M.setVariable)(St.size,
|
|
380
|
-
${(0,M.setVariable)(w.color,
|
|
377
|
+
--ft-button-internal-line-height: max(calc(${et.fontSize} + 2px), ${et.iconSize});
|
|
378
|
+
--ft-button-internal-color: ${et.color};
|
|
379
|
+
${(0,M.setVariable)(St.size,et.iconSize)};
|
|
380
|
+
${(0,M.setVariable)(w.color,et.rippleColor)};
|
|
381
381
|
|
|
382
|
-
border-radius: ${
|
|
383
|
-
padding: ${
|
|
384
|
-
background-color: ${
|
|
382
|
+
border-radius: ${et.borderRadius};
|
|
383
|
+
padding: ${et.verticalPadding} ${et.horizontalPadding};
|
|
384
|
+
background-color: ${et.backgroundColor};
|
|
385
385
|
color: var(--ft-button-internal-color);
|
|
386
386
|
-webkit-mask-image: radial-gradient(white, black);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
.ft-button.ft-button--outlined {
|
|
390
390
|
border: 1px solid var(--ft-button-internal-color);
|
|
391
|
-
padding: calc(${
|
|
391
|
+
padding: calc(${et.verticalPadding} - 1px) calc(${et.horizontalPadding} - 1px);
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
.ft-button.ft-button--dense {
|
|
@@ -406,7 +406,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
.ft-button--round {
|
|
409
|
-
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${
|
|
409
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${et.verticalPadding});
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
.ft-button--round.ft-button--dense {
|
|
@@ -415,7 +415,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
415
415
|
|
|
416
416
|
.ft-button[disabled] {
|
|
417
417
|
filter: grayscale(1);
|
|
418
|
-
opacity: ${
|
|
418
|
+
opacity: ${et.opacityDisabled};
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
.ft-button.ft-button--primary {
|
|
@@ -434,7 +434,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
434
434
|
white-space: nowrap;
|
|
435
435
|
text-overflow: ellipsis;
|
|
436
436
|
display: block;
|
|
437
|
-
margin: 0 ${
|
|
437
|
+
margin: 0 ${et.iconPadding};
|
|
438
438
|
${(0,M.setVariable)(Wt.fontSize,"1em")};
|
|
439
439
|
${(0,M.setVariable)(Wt.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
440
440
|
}
|
|
@@ -453,8 +453,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
.ft-button--label[hidden] + [part="icon"] {
|
|
456
|
-
margin: 0 calc(${
|
|
457
|
-
padding: 0 ${
|
|
456
|
+
margin: 0 calc(${et.horizontalPadding} * -1);
|
|
457
|
+
padding: 0 ${et.verticalPadding};
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
.ft-button--dense .ft-button--label[hidden] + [part="icon"] {
|
|
@@ -467,8 +467,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
ft-loader {
|
|
470
|
-
${(0,M.setVariable)(
|
|
471
|
-
${(0,M.setVariable)(
|
|
470
|
+
${(0,M.setVariable)(ot.size,et.iconSize)};
|
|
471
|
+
${(0,M.setVariable)(ot.color,"var(--ft-button-internal-color)")};
|
|
472
472
|
}
|
|
473
473
|
`,M.noTextSelect];var lt=g(R());var ct={textColor:lt.FtCssVariableFactory.extend("--ft-switch-text-color","",lt.designSystemVariables.colorOnSurfaceHigh),backgroundColor:lt.FtCssVariableFactory.extend("--ft-switch-background-color","",lt.designSystemVariables.colorSurface),selectedTextColor:lt.FtCssVariableFactory.extend("--ft-switch-selected-text-color","",lt.designSystemVariables.colorPrimary),selectedBackgroundColor:lt.FtCssVariableFactory.extend("--ft-switch-selected-background-color","",lt.designSystemVariables.colorPrimary),borderColor:lt.FtCssVariableFactory.extend("--ft-switch-border-color","",lt.designSystemVariables.colorOutline),borderRadius:lt.FtCssVariableFactory.extend("--ft-switch-border-radius","",lt.designSystemVariables.borderRadiusL),fontSize:lt.FtCssVariableFactory.extend("--ft-switch-font-size","",Wt.fontSize),iconSize:lt.FtCssVariableFactory.create("--ft-switch-icon-size","","SIZE","24px"),iconColor:lt.FtCssVariableFactory.extend("--ft-switch-text-color","",lt.designSystemVariables.colorOnSurfaceMedium),rippleColor:lt.FtCssVariableFactory.extend("--ft-switch-ripple-color","",lt.designSystemVariables.colorPrimary),outlineColor:lt.FtCssVariableFactory.extend("--ft-switch-outline-color","",lt.designSystemVariables.colorPrimary)};var Oe={feedbackInputMinWidth:J.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","","SIZE","300px"),ratedDateColor:J.FtCssVariableFactory.external(J.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:J.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color","",J.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:J.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color","",J.designSystemVariables.colorPrimary),filledRatingColor:J.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color","",J.designSystemVariables.colorPrimary),emptyRatingColor:J.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color","",J.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:J.FtCssVariableFactory.external(We.fontSize,"Typography"),sectionTitleFontSize:J.FtCssVariableFactory.external(ze.fontSize,"Typography"),starsBackgroundColor:J.FtCssVariableFactory.create("--ft-reader-feedback-stars-background-color","","COLOR",J.designSystemVariables.colorSurface)},vs=bs.css`
|
|
474
474
|
.ft-reader-feedback {
|
|
@@ -483,7 +483,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
483
483
|
flex-direction: row;
|
|
484
484
|
align-items: center;
|
|
485
485
|
margin-left: -6px;
|
|
486
|
-
${(0,J.setVariable)(
|
|
486
|
+
${(0,J.setVariable)(et.backgroundColor,Oe.starsBackgroundColor)}
|
|
487
487
|
}
|
|
488
488
|
|
|
489
489
|
.ft-reader-feedback--rating, .ft-reader-feedback--feedback {
|
|
@@ -496,14 +496,14 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
496
496
|
}
|
|
497
497
|
|
|
498
498
|
.ft-reader-feedback--rating {
|
|
499
|
-
${(0,J.setVariable)(
|
|
500
|
-
${(0,J.setVariable)(
|
|
499
|
+
${(0,J.setVariable)(et.color,Oe.emptyRatingColor)};
|
|
500
|
+
${(0,J.setVariable)(et.rippleColor,Oe.filledRatingColor)};
|
|
501
501
|
${(0,J.setVariable)(ct.textColor,Oe.emptyRatingColor)};
|
|
502
502
|
${(0,J.setVariable)(ct.selectedTextColor,Oe.filledRatingColor)};
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
506
|
-
${(0,J.setVariable)(
|
|
506
|
+
${(0,J.setVariable)(et.color,Oe.filledRatingColor)};
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
.ft-reader-feedback--feedback {
|
|
@@ -519,14 +519,14 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
522
|
-
${(0,J.setVariable)(
|
|
523
|
-
${(0,J.setVariable)(
|
|
522
|
+
${(0,J.setVariable)(et.color,Oe.sendFeedbackColor)};
|
|
523
|
+
${(0,J.setVariable)(et.backgroundColor,Oe.sendFeedbackBackgroundColor)};
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
[part="buttons-container"] {
|
|
527
527
|
align-self: flex-end;
|
|
528
528
|
}
|
|
529
|
-
`;var Hd=g(Ss(),1);var Os;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Os||(Os={}));var Cs;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Cs||(Cs={}));var ws;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(ws||(ws={}));var Es;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT"})(Es||(Es={}));var As;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(As||(As={}));var Rs;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Rs||(Rs={}));var Is;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Is||(Is={}));var bt;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(bt||(bt={}));var Ns;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Ns||(Ns={}));var Ts;(function(e){e.ASC="ASC",e.DESC="DESC"})(Ts||(Ts={}));var _s;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(_s||(_s={}));var ks;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ks||(ks={}));var Ls;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Ls||(Ls={}));var Ps;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Ps||(Ps={}));var Ds;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Ds||(Ds={}));var $s;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})($s||($s={}));var Bs;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC"})(Bs||(Bs={}));var Ms;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ms||(Ms={}));var
|
|
529
|
+
`;var Hd=g(Ss(),1);var Os;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Os||(Os={}));var Cs;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Cs||(Cs={}));var ws;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(ws||(ws={}));var Es;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT"})(Es||(Es={}));var As;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(As||(As={}));var Rs;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Rs||(Rs={}));var Is;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Is||(Is={}));var bt;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(bt||(bt={}));var Ns;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Ns||(Ns={}));var Ts;(function(e){e.ASC="ASC",e.DESC="DESC"})(Ts||(Ts={}));var _s;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(_s||(_s={}));var ks;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ks||(ks={}));var Ls;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Ls||(Ls={}));var Ps;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Ps||(Ps={}));var Ds;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Ds||(Ds={}));var $s;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})($s||($s={}));var Bs;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC"})(Bs||(Bs={}));var Ms;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ms||(Ms={}));var tt;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN",e.DEVELOPER="DEVELOPER"})(tt||(tt={}));var Fs;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Fs||(Fs={}));var Us;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Us||(Us={}));var zd={[tt.PERSONAL_BOOK_SHARE_USER]:[tt.PERSONAL_BOOK_USER],[tt.HTML_EXPORT_USER]:[tt.PERSONAL_BOOK_USER],[tt.PDF_EXPORT_USER]:[tt.PERSONAL_BOOK_USER],[tt.KHUB_ADMIN]:[tt.CONTENT_PUBLISHER],[tt.ADMIN]:[tt.KHUB_ADMIN,tt.USERS_ADMIN,tt.PORTAL_ADMIN],[tt.DEVELOPER]:[tt.BETA_USER,tt.DEBUG_USER],[tt.GENERATIVE_AI_EXPORT_USER]:[tt.GENERATIVE_AI_USER]};function Ws(e,t){return e===t||(zd[e]??[]).some(o=>Ws(o,t))}function pr(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(i=>Ws(i,t))}var sl=g(R());var rn=globalThis,Po=rn.trustedTypes,zs=Po?Po.createPolicy("lit-html",{createHTML:e=>e}):void 0,Zs="$lit$",Ve=`lit$${(Math.random()+"").slice(9)}$`,qs="?"+Ve,Vd=`<${qs}>`,hr=document,Do=()=>hr.createComment(""),eo=e=>e===null||typeof e!="object"&&typeof e!="function",Ys=Array.isArray,Gd=e=>Ys(e)||typeof e?.[Symbol.iterator]=="function",Yi=`[
|
|
530
530
|
\f\r]`,to=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hs=/-->/g,Vs=/>/g,ur=RegExp(`>|${Yi}(?:([^\\s"'>=/]+)(${Yi}*=${Yi}*(?:[^
|
|
531
531
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gs=/'/g,js=/"/g,Xs=/^(?:script|style|textarea|title)$/i,Qs=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),Js=Qs(1),tl=Qs(2),ro=Symbol.for("lit-noChange"),vt=Symbol.for("lit-nothing"),Ks=new WeakMap,fr=hr.createTreeWalker(hr,129);function el(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return zs!==void 0?zs.createHTML(t):t}var jd=(e,t)=>{let o=e.length-1,i=[],n,a=t===2?"<svg>":"",s=to;for(let c=0;c<o;c++){let u=e[c],p,h,m=-1,b=0;for(;b<u.length&&(s.lastIndex=b,h=s.exec(u),h!==null);)b=s.lastIndex,s===to?h[1]==="!--"?s=Hs:h[1]!==void 0?s=Vs:h[2]!==void 0?(Xs.test(h[2])&&(n=RegExp("</"+h[2],"g")),s=ur):h[3]!==void 0&&(s=ur):s===ur?h[0]===">"?(s=n??to,m=-1):h[1]===void 0?m=-2:(m=s.lastIndex-h[2].length,p=h[1],s=h[3]===void 0?ur:h[3]==='"'?js:Gs):s===js||s===Gs?s=ur:s===Hs||s===Vs?s=to:(s=ur,n=void 0);let x=s===ur&&e[c+1].startsWith("/>")?" ":"";a+=s===to?u+Vd:m>=0?(i.push(p),u.slice(0,m)+Zs+u.slice(m)+Ve+x):u+Ve+(m===-2?c:x)}return[el(e,a+(e[o]||"<?>")+(t===2?"</svg>":"")),i]},oo=class e{constructor({strings:t,_$litType$:o},i){let n;this.parts=[];let a=0,s=0,c=t.length-1,u=this.parts,[p,h]=jd(t,o);if(this.el=e.createElement(p,i),fr.currentNode=this.el.content,o===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(n=fr.nextNode())!==null&&u.length<c;){if(n.nodeType===1){if(n.hasAttributes())for(let m of n.getAttributeNames())if(m.endsWith(Zs)){let b=h[s++],x=n.getAttribute(m).split(Ve),S=/([.?@])?(.*)/.exec(b);u.push({type:1,index:a,name:S[2],strings:x,ctor:S[1]==="."?Qi:S[1]==="?"?Ji:S[1]==="@"?tn:$r}),n.removeAttribute(m)}else m.startsWith(Ve)&&(u.push({type:6,index:a}),n.removeAttribute(m));if(Xs.test(n.tagName)){let m=n.textContent.split(Ve),b=m.length-1;if(b>0){n.textContent=Po?Po.emptyScript:"";for(let x=0;x<b;x++)n.append(m[x],Do()),fr.nextNode(),u.push({type:2,index:++a});n.append(m[b],Do())}}}else if(n.nodeType===8)if(n.data===qs)u.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(Ve,m+1))!==-1;)u.push({type:7,index:a}),m+=Ve.length-1}a++}}static createElement(t,o){let i=hr.createElement("template");return i.innerHTML=t,i}};function Dr(e,t,o=e,i){if(t===ro)return t;let n=i!==void 0?o._$Co?.[i]:o._$Cl,a=eo(t)?void 0:t._$litDirective$;return n?.constructor!==a&&(n?._$AO?.(!1),a===void 0?n=void 0:(n=new a(e),n._$AT(e,o,i)),i!==void 0?(o._$Co??=[])[i]=n:o._$Cl=n),n!==void 0&&(t=Dr(e,n._$AS(e,t.values),n,i)),t}var Xi=class{constructor(t,o){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:o},parts:i}=this._$AD,n=(t?.creationScope??hr).importNode(o,!0);fr.currentNode=n;let a=fr.nextNode(),s=0,c=0,u=i[0];for(;u!==void 0;){if(s===u.index){let p;u.type===2?p=new $o(a,a.nextSibling,this,t):u.type===1?p=new u.ctor(a,u.name,u.strings,this,t):u.type===6&&(p=new en(a,this,t)),this._$AV.push(p),u=i[++c]}s!==u?.index&&(a=fr.nextNode(),s++)}return fr.currentNode=hr,n}p(t){let o=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,o),o+=i.strings.length-2):i._$AI(t[o])),o++}},$o=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,i,n){this.type=2,this._$AH=vt,this._$AN=void 0,this._$AA=t,this._$AB=o,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,o=this._$AM;return o!==void 0&&t?.nodeType===11&&(t=o.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,o=this){t=Dr(this,t,o),eo(t)?t===vt||t==null||t===""?(this._$AH!==vt&&this._$AR(),this._$AH=vt):t!==this._$AH&&t!==ro&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Gd(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==vt&&eo(this._$AH)?this._$AA.nextSibling.data=t:this.$(hr.createTextNode(t)),this._$AH=t}g(t){let{values:o,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=oo.createElement(el(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(o);else{let a=new Xi(n,this),s=a.u(this.options);a.p(o),this.$(s),this._$AH=a}}_$AC(t){let o=Ks.get(t.strings);return o===void 0&&Ks.set(t.strings,o=new oo(t)),o}T(t){Ys(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,i,n=0;for(let a of t)n===o.length?o.push(i=new e(this.k(Do()),this.k(Do()),this,this.options)):i=o[n],i._$AI(a),n++;n<o.length&&(this._$AR(i&&i._$AB.nextSibling,n),o.length=n)}_$AR(t=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},$r=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,i,n,a){this.type=1,this._$AH=vt,this._$AN=void 0,this.element=t,this.name=o,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=vt}_$AI(t,o=this,i,n){let a=this.strings,s=!1;if(a===void 0)t=Dr(this,t,o,0),s=!eo(t)||t!==this._$AH&&t!==ro,s&&(this._$AH=t);else{let c=t,u,p;for(t=a[0],u=0;u<a.length-1;u++)p=Dr(this,c[i+u],o,u),p===ro&&(p=this._$AH[u]),s||=!eo(p)||p!==this._$AH[u],p===vt?t=vt:t!==vt&&(t+=(p??"")+a[u+1]),this._$AH[u]=p}s&&!n&&this.O(t)}O(t){t===vt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Qi=class extends $r{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===vt?void 0:t}},Ji=class extends $r{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==vt)}},tn=class extends $r{constructor(t,o,i,n,a){super(t,o,i,n,a),this.type=5}_$AI(t,o=this){if((t=Dr(this,t,o,0)??vt)===ro)return;let i=this._$AH,n=t===vt&&i!==vt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==vt&&(i===vt||n);n&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},en=class{constructor(t,o,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=o,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Dr(this,t)}};var Kd=rn.litHtmlPolyfillSupport;Kd?.(oo,$o),(rn.litHtmlVersions??=[]).push("3.1.0");var ol=Symbol.for(""),Zd=e=>{if(e?.r===ol)return e?._$litStatic$},on=e=>({_$litStatic$:e,r:ol});var rl=new Map,il=e=>(t,...o)=>{let i=o.length,n,a,s=[],c=[],u,p=0,h=!1;for(;p<i;){for(u=t[p];p<i&&(a=o[p],(n=Zd(a))!==void 0);)u+=n+t[++p],h=!0;p!==i&&c.push(a),s.push(u),p++}if(p===i&&s.push(t[i]),h){let m=s.join("$$lit$$");(t=rl.get(m))===void 0&&(s.raw=s,rl.set(m,t=s)),o=c}return e(t,...o)},nn=il(Js),Xm=il(tl);var an=g(Z()),al=g(R());var Ge;(function(e){e.title="title",e.title_dense="title-dense",e.subtitle1="subtitle1",e.subtitle2="subtitle2",e.body1="body1",e.body2="body2",e.caption="caption",e.breadcrumb="breadcrumb",e.overline="overline",e.button="button",e.display="display",e.title1="title-1",e.title2="title-2",e.title3="title-3",e.body1regular="body-1-regular",e.body1medium="body-1-medium",e.body1semibold="body-1-semibold",e.body2regular="body-2-regular",e.body2medium="body-2-medium",e.body2semibold="body-2-semibold",e.label1medium="label-1-medium",e.label1semibold="label-1-semibold",e.label1bold="label-1-bold",e.label2medium="label-2-medium",e.label2semibold="label-2-semibold",e.label2bold="label-2-bold",e.caption1medium="caption-1-medium",e.caption1semibold="caption-1-semibold",e.caption1bold="caption-1-bold",e.caption2medium="caption-2-medium",e.caption2semibold="caption-2-semibold",e.caption2bold="caption-2-bold"})(Ge||(Ge={}));var nl=function(e,t,o,i){var n=arguments.length,a=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(a=(n<3?s(a):n>3?s(t,o,a):s(t,o))||a);return n>3&&a&&Object.defineProperty(t,o,a),a},ft=class extends al.FtLitElement{constructor(){super(...arguments),this.variant=Ge.body1}render(){return this.element?nn`
|
|
532
532
|
<${on(this.element)}
|
|
@@ -781,7 +781,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
781
781
|
@touchstart=${this.initDragFromTouch}>
|
|
782
782
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
783
783
|
</div>
|
|
784
|
-
`}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,o){this.dragging=!0,this.startX=t,this.startY=o,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,o){let i=this.fixedWidth+t-this.startX,n=this.fixedHeight+o-this.startY;this.dispatchEvent(new Sn(i,n))}};Dt.elementDefinitions={"ft-icon":xt};Dt.styles=[Ko.noTextSelect,ql];Ze([(0,fe.property)({type:Number})],Dt.prototype,"initialWidth",void 0);Ze([(0,fe.property)({type:Number})],Dt.prototype,"initialHeight",void 0);Ze([(0,fe.property)()],Dt.prototype,"icon",void 0);Ze([(0,fe.property)()],Dt.prototype,"iconVariant",void 0);Ze([(0,fe.property)()],Dt.prototype,"cursor",void 0);Ze([(0,fe.state)()],Dt.prototype,"dragging",void 0);Ze([(0,fe.eventOptions)({passive:!0})],Dt.prototype,"initDragFromMouse",null);Ze([(0,fe.eventOptions)({passive:!0})],Dt.prototype,"initDragFromTouch",null);(0,Yl.customElement)("ft-resizer")(Dt);var ec=g(R());var On=g(B()),Vr=g(Z()),Jl=g(Te()),tc=g(R());var Xl=g(B()),
|
|
784
|
+
`}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,o){this.dragging=!0,this.startX=t,this.startY=o,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,o){let i=this.fixedWidth+t-this.startX,n=this.fixedHeight+o-this.startY;this.dispatchEvent(new Sn(i,n))}};Dt.elementDefinitions={"ft-icon":xt};Dt.styles=[Ko.noTextSelect,ql];Ze([(0,fe.property)({type:Number})],Dt.prototype,"initialWidth",void 0);Ze([(0,fe.property)({type:Number})],Dt.prototype,"initialHeight",void 0);Ze([(0,fe.property)()],Dt.prototype,"icon",void 0);Ze([(0,fe.property)()],Dt.prototype,"iconVariant",void 0);Ze([(0,fe.property)()],Dt.prototype,"cursor",void 0);Ze([(0,fe.state)()],Dt.prototype,"dragging",void 0);Ze([(0,fe.eventOptions)({passive:!0})],Dt.prototype,"initDragFromMouse",null);Ze([(0,fe.eventOptions)({passive:!0})],Dt.prototype,"initDragFromTouch",null);(0,Yl.customElement)("ft-resizer")(Dt);var ec=g(R());var On=g(B()),Vr=g(Z()),Jl=g(Te()),tc=g(R());var Xl=g(B()),rt=g(R());var P={fontSize:rt.FtCssVariableFactory.create("--ft-input-label-font-size","","SIZE","14px"),raisedFontSize:rt.FtCssVariableFactory.create("--ft-input-label-raised-font-size","","SIZE","11px"),raisedZIndex:rt.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","","NUMBER","2"),verticalSpacing:rt.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","","SIZE","4px"),horizontalSpacing:rt.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","","SIZE","12px"),labelMaxWidth:rt.FtCssVariableFactory.create("--ft-input-label-max-width","","SIZE","100%"),borderColor:rt.FtCssVariableFactory.extend("--ft-input-label-border-color","",rt.designSystemVariables.colorOutline),textColor:rt.FtCssVariableFactory.extend("--ft-input-label-text-color","",rt.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:rt.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color","",rt.designSystemVariables.colorOnSurfaceDisabled),backgroundColor:rt.FtCssVariableFactory.extend("--ft-input-label-background-color","",rt.designSystemVariables.colorSurface),borderRadius:rt.FtCssVariableFactory.extend("--ft-input-label-border-radius","",rt.designSystemVariables.borderRadiusS),colorError:rt.FtCssVariableFactory.external(rt.designSystemVariables.colorError,"Design system")},Ql=Xl.css`
|
|
785
785
|
.ft-input-label {
|
|
786
786
|
position: absolute;
|
|
787
787
|
inset: 0;
|
|
@@ -832,8 +832,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
832
832
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
833
833
|
max-width: calc(${P.labelMaxWidth} - 2 * (${P.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
834
834
|
text-overflow: ellipsis;
|
|
835
|
-
${(0,
|
|
836
|
-
${(0,
|
|
835
|
+
${(0,rt.setVariable)(de.fontSize,P.fontSize)};
|
|
836
|
+
${(0,rt.setVariable)(de.lineHeight,P.fontSize)};
|
|
837
837
|
}
|
|
838
838
|
|
|
839
839
|
.ft-input-label--in-error .ft-input-label--text {
|
|
@@ -865,8 +865,8 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
.ft-input-label--raised .ft-input-label--text {
|
|
868
|
-
${(0,
|
|
869
|
-
${(0,
|
|
868
|
+
${(0,rt.setVariable)(de.fontSize,P.raisedFontSize)};
|
|
869
|
+
${(0,rt.setVariable)(de.lineHeight,P.raisedFontSize)};
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
@@ -1183,7 +1183,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1183
1183
|
/** Brand Primary styles **/
|
|
1184
1184
|
|
|
1185
1185
|
.ftds--family-brand.ft-button--primary {
|
|
1186
|
-
${(0,C.setVariable)(
|
|
1186
|
+
${(0,C.setVariable)(ot.color,f.primaryBrandIconColor)};
|
|
1187
1187
|
|
|
1188
1188
|
${(0,C.setVariable)(w.color,f.primaryBrandStateLayerColor)};
|
|
1189
1189
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.primaryBrandHoverStateLayerOpacity)};
|
|
@@ -1207,7 +1207,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1207
1207
|
/** Brand Secondary styles **/
|
|
1208
1208
|
|
|
1209
1209
|
.ftds--family-brand.ft-button--secondary {
|
|
1210
|
-
${(0,C.setVariable)(
|
|
1210
|
+
${(0,C.setVariable)(ot.color,f.secondaryBrandIconColor)};
|
|
1211
1211
|
|
|
1212
1212
|
${(0,C.setVariable)(w.color,f.secondaryBrandStateLayerColor)};
|
|
1213
1213
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondaryBrandHoverStateLayerOpacity)};
|
|
@@ -1232,7 +1232,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1232
1232
|
/** Brand Tertiary styles **/
|
|
1233
1233
|
|
|
1234
1234
|
.ftds--family-brand.ft-button--tertiary {
|
|
1235
|
-
${(0,C.setVariable)(
|
|
1235
|
+
${(0,C.setVariable)(ot.color,f.tertiaryBrandIconColor)};
|
|
1236
1236
|
|
|
1237
1237
|
${(0,C.setVariable)(w.color,f.tertiaryBrandStateLayerColor)};
|
|
1238
1238
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiaryBrandHoverStateLayerOpacity)};
|
|
@@ -1256,7 +1256,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1256
1256
|
/** Neutral Secondary styles **/
|
|
1257
1257
|
|
|
1258
1258
|
.ftds--family-neutral.ft-button--secondary {
|
|
1259
|
-
${(0,C.setVariable)(
|
|
1259
|
+
${(0,C.setVariable)(ot.color,f.secondaryNeutralIconColor)};
|
|
1260
1260
|
|
|
1261
1261
|
${(0,C.setVariable)(w.backgroundColor,f.secondaryNeutralStateLayerColor)};
|
|
1262
1262
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondaryNeutralHoverStateLayerOpacity)};
|
|
@@ -1281,7 +1281,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1281
1281
|
/** Neutral Tertiary styles **/
|
|
1282
1282
|
|
|
1283
1283
|
.ftds--family-neutral.ft-button--tertiary {
|
|
1284
|
-
${(0,C.setVariable)(
|
|
1284
|
+
${(0,C.setVariable)(ot.color,f.tertiaryNeutralIconColor)};
|
|
1285
1285
|
|
|
1286
1286
|
${(0,C.setVariable)(w.backgroundColor,f.tertiaryNeutralStateLayerColor)};
|
|
1287
1287
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiaryNeutralHoverStateLayerOpacity)};
|
|
@@ -1305,7 +1305,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1305
1305
|
/** Info Secondary styles **/
|
|
1306
1306
|
|
|
1307
1307
|
.ftds--family-info.ft-button--secondary {
|
|
1308
|
-
${(0,C.setVariable)(
|
|
1308
|
+
${(0,C.setVariable)(ot.color,f.secondaryInfoIconColor)};
|
|
1309
1309
|
|
|
1310
1310
|
${(0,C.setVariable)(w.backgroundColor,f.secondaryInfoStateLayerColor)};
|
|
1311
1311
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondaryInfoHoverStateLayerOpacity)};
|
|
@@ -1330,7 +1330,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1330
1330
|
/** Info Tertiary styles **/
|
|
1331
1331
|
|
|
1332
1332
|
.ftds--family-info.ft-button--tertiary {
|
|
1333
|
-
${(0,C.setVariable)(
|
|
1333
|
+
${(0,C.setVariable)(ot.color,f.tertiaryInfoIconColor)};
|
|
1334
1334
|
|
|
1335
1335
|
${(0,C.setVariable)(w.backgroundColor,f.tertiaryInfoStateLayerColor)};
|
|
1336
1336
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiaryInfoHoverStateLayerOpacity)};
|
|
@@ -1354,7 +1354,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1354
1354
|
/** Success Secondary styles **/
|
|
1355
1355
|
|
|
1356
1356
|
.ftds--family-success.ft-button--secondary {
|
|
1357
|
-
${(0,C.setVariable)(
|
|
1357
|
+
${(0,C.setVariable)(ot.color,f.secondarySuccessIconColor)};
|
|
1358
1358
|
|
|
1359
1359
|
${(0,C.setVariable)(w.backgroundColor,f.secondarySuccessStateLayerColor)};
|
|
1360
1360
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondarySuccessHoverStateLayerOpacity)};
|
|
@@ -1379,7 +1379,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1379
1379
|
/** Success Tertiary styles **/
|
|
1380
1380
|
|
|
1381
1381
|
.ftds--family-success.ft-button--tertiary {
|
|
1382
|
-
${(0,C.setVariable)(
|
|
1382
|
+
${(0,C.setVariable)(ot.color,f.tertiarySuccessIconColor)};
|
|
1383
1383
|
|
|
1384
1384
|
${(0,C.setVariable)(w.backgroundColor,f.tertiarySuccessStateLayerColor)};
|
|
1385
1385
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiarySuccessHoverStateLayerOpacity)};
|
|
@@ -1403,7 +1403,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1403
1403
|
/** Warning Secondary styles **/
|
|
1404
1404
|
|
|
1405
1405
|
.ftds--family-warning.ft-button--secondary {
|
|
1406
|
-
${(0,C.setVariable)(
|
|
1406
|
+
${(0,C.setVariable)(ot.color,f.secondaryWarningIconColor)};
|
|
1407
1407
|
|
|
1408
1408
|
${(0,C.setVariable)(w.backgroundColor,f.secondaryWarningStateLayerColor)};
|
|
1409
1409
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondaryWarningHoverStateLayerOpacity)};
|
|
@@ -1428,7 +1428,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1428
1428
|
/** Warning Tertiary styles **/
|
|
1429
1429
|
|
|
1430
1430
|
.ftds--family-warning.ft-button--tertiary {
|
|
1431
|
-
${(0,C.setVariable)(
|
|
1431
|
+
${(0,C.setVariable)(ot.color,f.tertiaryWarningIconColor)};
|
|
1432
1432
|
|
|
1433
1433
|
${(0,C.setVariable)(w.backgroundColor,f.tertiaryWarningStateLayerColor)};
|
|
1434
1434
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiaryWarningHoverStateLayerOpacity)};
|
|
@@ -1452,7 +1452,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1452
1452
|
/** Error Secondary styles **/
|
|
1453
1453
|
|
|
1454
1454
|
.ftds--family-error.ft-button--secondary {
|
|
1455
|
-
${(0,C.setVariable)(
|
|
1455
|
+
${(0,C.setVariable)(ot.color,f.secondaryErrorIconColor)};
|
|
1456
1456
|
|
|
1457
1457
|
${(0,C.setVariable)(w.backgroundColor,f.secondaryErrorStateLayerColor)};
|
|
1458
1458
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.secondaryErrorHoverStateLayerOpacity)};
|
|
@@ -1477,7 +1477,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1477
1477
|
/** Error Tertiary styles **/
|
|
1478
1478
|
|
|
1479
1479
|
.ftds--family-error.ft-button--tertiary {
|
|
1480
|
-
${(0,C.setVariable)(
|
|
1480
|
+
${(0,C.setVariable)(ot.color,f.tertiaryErrorIconColor)};
|
|
1481
1481
|
|
|
1482
1482
|
${(0,C.setVariable)(w.backgroundColor,f.tertiaryErrorStateLayerColor)};
|
|
1483
1483
|
${(0,C.setVariable)(w.opacityContentOnSurfaceHover,f.tertiaryErrorHoverStateLayerOpacity)};
|
|
@@ -1502,7 +1502,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1502
1502
|
|
|
1503
1503
|
.ftds--size-large {
|
|
1504
1504
|
${(0,C.setVariable)(St.size,f.largeIconSize)};
|
|
1505
|
-
${(0,C.setVariable)(
|
|
1505
|
+
${(0,C.setVariable)(ot.size,f.largeIconSize)};
|
|
1506
1506
|
|
|
1507
1507
|
height: ${f.largeHeight};
|
|
1508
1508
|
padding: 0 ${f.largeHorizontalPadding};
|
|
@@ -1524,7 +1524,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1524
1524
|
|
|
1525
1525
|
.ftds--size-medium {
|
|
1526
1526
|
${(0,C.setVariable)(St.size,f.mediumIconSize)};
|
|
1527
|
-
${(0,C.setVariable)(
|
|
1527
|
+
${(0,C.setVariable)(ot.size,f.mediumIconSize)};
|
|
1528
1528
|
|
|
1529
1529
|
height: ${f.mediumHeight};
|
|
1530
1530
|
padding: 0 ${f.mediumHorizontalPadding};
|
|
@@ -1547,7 +1547,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1547
1547
|
|
|
1548
1548
|
.ftds--size-small {
|
|
1549
1549
|
${(0,C.setVariable)(St.size,f.smallIconSize)};
|
|
1550
|
-
${(0,C.setVariable)(
|
|
1550
|
+
${(0,C.setVariable)(ot.size,f.smallIconSize)};
|
|
1551
1551
|
|
|
1552
1552
|
height: ${f.smallHeight};
|
|
1553
1553
|
padding: 0 ${f.smallHorizontalPadding};
|
|
@@ -1833,7 +1833,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1833
1833
|
.variant=${this.iconVariant}
|
|
1834
1834
|
.value=${this.icon}
|
|
1835
1835
|
@click=${()=>{var t;return(t=this.input)===null||t===void 0?void 0:t.focus()}}></ft-icon>
|
|
1836
|
-
`:Xt.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&t.get("value")!=null&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&t.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach(t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.suggestions.filter(t=>!t.hidden)):this.visibleSuggestions=this.suggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion])}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&(this.suggestionsContainer.style.width=this.mainPanel.getBoundingClientRect().width+"px",Ho(this.mainPanel,this.suggestionsContainer,"bottom").then(({x:o,y:i})=>{this.suggestionsContainer.style.left=`${o}px`,this.suggestionsContainer.style.top=`${i}px`}))}setValue(t,o=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),o&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var o;let i=((o=this.input)===null||o===void 0?void 0:o.value)||"";this.setValue(i,t.key=="Escape"||t.key=="Enter")}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var o;if(t.key==="ArrowDown"||t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;let i=this.visibleSuggestions.findIndex(a=>a.matches(":focus-within")),n;t.key==="ArrowDown"?n=i<this.visibleSuggestions.length-1?i+1:0:n=i>0?i-1:this.visibleSuggestions.length-1,(o=this.visibleSuggestions[n])===null||o===void 0||o.focus()}(t.key=="Escape"||t.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(t){var o;this.setValue(t.detail,!0),(o=this.input)===null||o===void 0||o.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,o;!((t=this.mainPanel)===null||t===void 0)&&t.matches(":focus-within")||(this.focused=!1,this.setValue(((o=this.input)===null||o===void 0?void 0:o.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}};W.elementDefinitions={"ft-input-label":Vt,"ft-ripple":j,"ft-typography":ft,"ft-icon":xt,"ft-text-field-suggestion":ce};W.styles=[Lr,Yr.noTextInputDefaultClearButton,bd];q([(0,G.property)()],W.prototype,"label",void 0);q([(0,G.property)({noAccessor:!0})],W.prototype,"value",null);q([(0,G.state)()],W.prototype,"dispatchedValue",void 0);q([(0,G.property)()],W.prototype,"helper",void 0);q([(0,G.property)()],W.prototype,"suggestionsHelper",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"outlined",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"disabled",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"error",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"fixedMenuPosition",void 0);q([(0,G.property)()],W.prototype,"prefix",void 0);q([(0,G.property)()],W.prototype,"icon",void 0);q([(0,G.property)()],W.prototype,"name",void 0);q([(0,G.property)()],W.prototype,"type",void 0);q([(0,G.property)()],W.prototype,"passwordHiddenIcon",void 0);q([(0,G.property)()],W.prototype,"passwordRevealedIcon",void 0);q([(0,G.property)()],W.prototype,"iconVariant",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"filterSuggestions",void 0);q([(0,G.property)({type:Number})],W.prototype,"maxLength",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"password",void 0);q([(0,G.state)()],W.prototype,"focused",void 0);q([(0,G.state)()],W.prototype,"hidePassword",void 0);q([(0,G.state)()],W.prototype,"hideSuggestions",void 0);q([(0,G.state)()],W.prototype,"visibleSuggestions",void 0);q([(0,G.query)(".ft-text-field--main-panel")],W.prototype,"mainPanel",void 0);q([(0,G.query)(".ft-text-field--input")],W.prototype,"input",void 0);q([(0,G.query)(".ft-text-field-suggestion--new-value")],W.prototype,"newValueSuggestion",void 0);q([(0,G.query)(".ft-text-field--suggestions")],W.prototype,"suggestionsContainer",void 0);q([(0,G.queryAssignedElements)({selector:"ft-text-field-suggestion"})],W.prototype,"suggestions",void 0);(0,sa.customElement)("ft-text-field")(W);(0,sa.customElement)("ft-text-field-suggestion")(ce);var Id=g(R());var Ao=g(B()),sr=g(Z()),Qt=g(R());var be=g(R());var wd=g(R()),Ed=e=>wd.FtReduxStore.get({name:"ft-reader-"+e,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0}});var la=class{constructor(t,o){this.mapId=t,this.paginatedToc=o,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,o,i){return t.flatMap(n=>(n.pageConfiguration&&this.registerPage(this.buildPage(n,i)),n.tocId==null?this.extractPagesToc(n.children,o,i):[{tocId:n.tocId,title:n.title,depth:o,children:this.extractPagesToc(n.children,o+1,n.tocId)}]))}convertNodes(t,o,i){return t.flatMap(n=>{var a,s,c;if(n.tocId==null)return[...this.convertSectionNodes((a=n.pageToc)!==null&&a!==void 0?a:[],o,n.tocId),...this.convertNodes(n.children,o,n.tocId)];let u=(s=n.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:n.tocId,contentId:n.contentId,title:n.title,hasRating:n.hasRating,origin:n.origin,prettyUrl:u,depth:o,parentTocId:i,children:[]};this.register(p);let h=this.convertSectionNodes((c=n.pageToc)!==null&&c!==void 0?c:[],o+1,n.tocId),m=this.convertNodes(n.children,o+1,p.tocId);return p.children=[...h,...m],[p]})}convertSectionNodes(t,o,i){return t.flatMap(n=>{var a;let s=(a=n.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={...n,prettyUrl:s,depth:o,parentTocId:i,children:[]};return this.register(c),c.children=this.convertSectionNodes(n.children,o+1,n.tocId),[c]})}buildPage(t,o){var i,n,a,s,c,u;let p={number:this.pages.length+1,title:(i=t.title)!==null&&i!==void 0?i:"",rootTocId:(n=t.tocId)!==null&&n!==void 0?n:"root",toc:((a=t.pageToc)!==null&&a!==void 0?a:[]).map(b=>this.nodeByTocId[b.tocId]),topics:[],hiddenTopics:[],breadcrumb:o?this.buildBreadcrumb(this.nodeByTocId[o]):[]},h=(b,x)=>(x?p.topics:p.hiddenTopics).push(b),m=(c=(s=t.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&c!==void 0?c:[];return p.breadcrumb.forEach((b,x)=>{h(b,m[x])}),t.tocId&&h(t.tocId,t.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=t.pageToc)!==null&&u!==void 0?u:[])),p}registerPage(t){for(let o of[...t.topics,...t.hiddenTopics])this.pageByTocId[o]||(this.pageByTocId[o]=t);this.pages.push(t)}tocIds(t){return t.flatMap(o=>[o.tocId,...this.tocIds(o.children)])}buildBreadcrumb(t){let o=[t.tocId];for(;t?.parentTocId;)o.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return o}register(t){t.prettyUrl&&(this.nodeByUrl[t.prettyUrl]==null?this.nodeByUrl[t.prettyUrl]=t:this.duplicatedPrettyUrls.add(t.prettyUrl)),this.nodeByUrl[`${this.mapId}/${t.tocId}`]=t,this.nodeByTocId[t.tocId]=t}},Ei=class{convertPaginatedToc(t,o){return new la(t,o).build()}};var Ai=class extends Ee{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,o,i){super(!1,o),this.converter=t,this._mapId=i,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",()=>this.api.getReaderConfiguration()),this.cache.register("map",()=>this.withMapId(t=>this.fetchMap(t))),this.cache.register("enrichedToc",()=>this.withMapId(t=>this.fetchPages(t).then(o=>this.converter.convertPaginatedToc(t,o)))),this.cache.register("ratingSummary",()=>{var t,o;return pr((o=(t=N.getState().session)===null||t===void 0?void 0:t.profile.roles)!==null&&o!==void 0?o:[],"RATING_USER")?this.withMapId(n=>this.fetchMapRating(n)):Promise.resolve()})}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getMapNow(){return this.cache.getNow("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var o;return(o=this.enrichedToc)===null||o===void 0?void 0:o.nodeByTocId[t]}getTocNodeNowByUrl(t){var o,i;let n=this.getMapNow();return n?.prettyUrl==t||`${n?.id}/root`===t?(o=this.enrichedToc)===null||o===void 0?void 0:o.toc[0]:(i=this.enrichedToc)===null||i===void 0?void 0:i.nodeByUrl[t]}async getPage(t){let o=await this.getEnrichedToc();return o.pages[t-1]||o.pages[0]}async getPageByTocId(t){let o=await this.getEnrichedToc();return o.pageByTocId[t]||o.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,()=>this.fetchTopicMetadata(t))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,()=>this.fetchTopicHTMLContent(t))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}getRelativesForDocument(t,o){return this.cache.get("document-relatives-"+t+"-"+o.join("-"),()=>this.fetchRelativesForDocument(t,o))}getRelativesForTopicInMap(t,o,i){return this.cache.get("topic-relatives-"+[t,o,...i].join("-"),()=>this.fetchRelativesForTopicInMap(t,o,i))}getAttachmentDownloadLink(t){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(t).content}?download=true`)}getLink(t,o,i){let n=this.getNavigationData(t,o,i),a=this.getReaderLinkPrefix()+(n.prettyUrl?n.prettyUrl:`${n.mapId}/${n.tocId}`),s=new URL(a,this.api.tenantBaseUrl);return n.page!=null&&s.searchParams.set("page",`${n.page}`),n.prettyUrlDuplicated&&s.searchParams.set("tocId",n.tocId),n.section!=null&&s.searchParams.set("section",n.section),s.href}getNavigationData(t,o,i){var n,a;t=t||"root";let s=this.enrichedToc,c=s?.pageByTocId[t],u=s?.nodeByTocId[t],p=u?.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:(n=u?.title)!==null&&n!==void 0?n:"",page:o&&c&&c.number!==o?o:void 0,prettyUrl:p?.replace(/^r\//,""),prettyUrlDuplicated:(a=s?.duplicatedPrettyUrls.has(p??""))!==null&&a!==void 0?a:!1,section:i}}async getAccurateNavigationData(t,o,i){return await this.getEnrichedToc(),this.getNavigationData(t,o,i)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then(t=>t?.publication)}getTopicRating(t){return this.getRatingSummary().then(o=>{var i;return o?{type:o.topics.type,rating:(i=o.topics)===null||i===void 0?void 0:i.ratings.find(n=>n.tocId===t)}:void 0})}rateMap(t,o){return this.makeRateMapRequest(t,o).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(t,o){return this.makeMapFeedbackRequest(t,o)}rateTopic(t,o,i){return this.makeRateTopicRequest(t,o,i).then(()=>this.clearRatingIfNecessary())}unrateTopic(t){return this.makeUnrateTopicRequest(t).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let t=N.getState().session;t?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,o,i){return this.makeTopicFeedbackRequest(t,o,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let o=this.getTocNodeNow(t),i=[{tocId:o.tocId,title:o.title}],n=this.getTocNodeNow(o.parentTocId);for(;n;)i.unshift({tocId:n.tocId,title:n.title}),n=this.getTocNodeNow(n.parentTocId);return i}isFeatureAccessible(t,{session:o}){var i;if(!this.isFeatureAvailable(t))return!1;switch(t){case ie.FEEDBACK:return pr(o??[],ot.FEEDBACK_USER);case ie.RATING:return pr(o??[],ot.RATING_USER);case ie.PRINT:return pr(o??[],ot.PRINT_USER);case ie.BOOKMARK:return!!o?.sessionAuthenticated;case ie.COLLECTIONS:return pr(o??[],ot.COLLECTION_USER);case ie.PERSONAL_BOOKS:return pr(o??[],ot.PERSONAL_BOOK_USER)&&!(!((i=this.getMapNow())===null||i===void 0)&&i.pbkConfidential);default:return!1}}makeAbsolute(t){return this.api.makeAbsolute(t)}};var Ri=class e extends Ai{static async build(t){return new e(new Ei,void 0,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){let o=await this.api.getMap(t);return this.fingerprint=o.fingerprint,o}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(t,o){let i={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:t,valueFilter:{negative:!1,values:o}}],sort:[],facets:[]};return this.api.search(i)}fetchRelativesForTopicInMap(t,o,i){let n={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:o,valueFilter:{negative:!1,values:i}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[t]}}],sort:[],facets:[]};return this.api.search(n)}makeMapFeedbackRequest(t,o){return this.api.sendMapFeedback(this.mapId,t,o)}makeRateMapRequest(t,o){return this.api.rateMap(this.mapId,t,o)}makeRateTopicRequest(t,o,i){return this.api.rateTopic(this.mapId,t,o,i)}makeTopicFeedbackRequest(t,o,i){return this.api.sendTopicFeedback(this.mapId,t,o,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}};var Ii=class e{static build(t,o){return new e(Ed(t.trim()||"context"),o??Ri.build)}loaded(){return(0,be.waitUntil)(()=>this._loaded)}constructor(t,o,i){this.store=t,this.clusteringHelperProvider=i,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new be.Debouncer(10),this.initService(o)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){return(0,be.waitFor)(()=>this.service)}async navigateToTopic(t,o,i){await this.loaded();let n=await this.awaitService(),a=await(i!=null?n.getPage(i):n.getPageByTocId(t??"root"));this.store.actions.currentPage(a),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,a),section:o})}resolveValidNonRootTocId(t,o){var i,n,a;let s=(i=t==="root"?void 0:t)!==null&&i!==void 0?i:o.rootTocId;return o.topics.includes(s)?s:(a=(n=o.topics[0])!==null&&n!==void 0?n:o.hiddenTopics[0])!==null&&a!==void 0?a:"root"}async navigateToPage(t){await this.loaded();let i=await(await this.awaitService()).getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var t;!((t=this.service)===null||t===void 0)&&t.mapId&&this.store.getState().map==null&&await this.loadDebouncer.run(()=>this.fetchData())}clear(){var t;this._loaded=!1,this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),this.store.actions.relatives(void 0),(t=this.service)===null||t===void 0||t.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(){var t,o,i,n,a;try{await Promise.all([(t=this.service)===null||t===void 0?void 0:t.getConfiguration().then(s=>this.store.actions.configuration(s)),(o=this.service)===null||o===void 0?void 0:o.getMap().then(s=>this.store.actions.map(s)),(i=this.service)===null||i===void 0?void 0:i.getToc().then(s=>this.store.actions.toc(s)),(n=this.service)===null||n===void 0?void 0:n.getPagesToc().then(s=>this.store.actions.pagesToc(s)),(a=this.service)===null||a===void 0?void 0:a.getPaginationConfiguration().then(s=>this.store.actions.paginationConfiguration(s))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0}catch(s){this.errorHandler&&!(s instanceof be.CanceledPromiseError)&&this.errorHandler(s)}}fetchRelatives(){var t,o,i;let n=(t=this.store.getState().map)===null||t===void 0?void 0:t.metadata.filter(a=>{var s;return a.key==((s=this.store.getState().configuration)===null||s===void 0?void 0:s.relativePivotMetadata)}).flatMap(a=>a.values);n!==void 0&&n.length>0?(o=this.service)===null||o===void 0||o.getRelativesForDocument((i=this.store.getState().configuration)===null||i===void 0?void 0:i.relativePivotMetadata,n).then(a=>{let s=a.results.flatMap(c=>c.entries);this.store.actions.relatives(s),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new CustomEvent("clustering-helper-created"))}createClusteringHelper(){var t,o;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let i=this.store.getState().relatives;if(i){let n=i.find(s=>{var c;return((c=s.map)===null||c===void 0?void 0:c.mapId)==this.store.getState().mapId}),a=(o=(t=N.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&o!==void 0?o:[];return new be.ClusteringHelper(i,n,this.metadataForSwitchToRelatives,a)}}async navigateToRelativeTopicIfFound(t){var o,i,n;await this.loaded();let a=await(0,be.waitFor)(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),s=this.store.getState().mapId,u=await(await this.awaitService()).getRelativesForTopicInMap(s,a,[t]);if(!((n=(i=(o=u?.results)===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.entries)===null||n===void 0)&&n[0]){let p=u.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}registerMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.add(t),this.store.getState().relatives==null?this.fetchRelatives():this.updateClusteringHelper()}unregisterMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.delete(t),this.updateClusteringHelper()}};var Ad=g(B());var Rd=Ad.css`
|
|
1836
|
+
`:Xt.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&t.get("value")!=null&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&t.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach(t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.suggestions.filter(t=>!t.hidden)):this.visibleSuggestions=this.suggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion])}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&(this.suggestionsContainer.style.width=this.mainPanel.getBoundingClientRect().width+"px",Ho(this.mainPanel,this.suggestionsContainer,"bottom").then(({x:o,y:i})=>{this.suggestionsContainer.style.left=`${o}px`,this.suggestionsContainer.style.top=`${i}px`}))}setValue(t,o=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),o&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var o;let i=((o=this.input)===null||o===void 0?void 0:o.value)||"";this.setValue(i,t.key=="Escape"||t.key=="Enter")}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var o;if(t.key==="ArrowDown"||t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;let i=this.visibleSuggestions.findIndex(a=>a.matches(":focus-within")),n;t.key==="ArrowDown"?n=i<this.visibleSuggestions.length-1?i+1:0:n=i>0?i-1:this.visibleSuggestions.length-1,(o=this.visibleSuggestions[n])===null||o===void 0||o.focus()}(t.key=="Escape"||t.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(t){var o;this.setValue(t.detail,!0),(o=this.input)===null||o===void 0||o.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,o;!((t=this.mainPanel)===null||t===void 0)&&t.matches(":focus-within")||(this.focused=!1,this.setValue(((o=this.input)===null||o===void 0?void 0:o.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}};W.elementDefinitions={"ft-input-label":Vt,"ft-ripple":j,"ft-typography":ft,"ft-icon":xt,"ft-text-field-suggestion":ce};W.styles=[Lr,Yr.noTextInputDefaultClearButton,bd];q([(0,G.property)()],W.prototype,"label",void 0);q([(0,G.property)({noAccessor:!0})],W.prototype,"value",null);q([(0,G.state)()],W.prototype,"dispatchedValue",void 0);q([(0,G.property)()],W.prototype,"helper",void 0);q([(0,G.property)()],W.prototype,"suggestionsHelper",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"outlined",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"disabled",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"error",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"fixedMenuPosition",void 0);q([(0,G.property)()],W.prototype,"prefix",void 0);q([(0,G.property)()],W.prototype,"icon",void 0);q([(0,G.property)()],W.prototype,"name",void 0);q([(0,G.property)()],W.prototype,"type",void 0);q([(0,G.property)()],W.prototype,"passwordHiddenIcon",void 0);q([(0,G.property)()],W.prototype,"passwordRevealedIcon",void 0);q([(0,G.property)()],W.prototype,"iconVariant",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"filterSuggestions",void 0);q([(0,G.property)({type:Number})],W.prototype,"maxLength",void 0);q([(0,G.property)({type:Boolean})],W.prototype,"password",void 0);q([(0,G.state)()],W.prototype,"focused",void 0);q([(0,G.state)()],W.prototype,"hidePassword",void 0);q([(0,G.state)()],W.prototype,"hideSuggestions",void 0);q([(0,G.state)()],W.prototype,"visibleSuggestions",void 0);q([(0,G.query)(".ft-text-field--main-panel")],W.prototype,"mainPanel",void 0);q([(0,G.query)(".ft-text-field--input")],W.prototype,"input",void 0);q([(0,G.query)(".ft-text-field-suggestion--new-value")],W.prototype,"newValueSuggestion",void 0);q([(0,G.query)(".ft-text-field--suggestions")],W.prototype,"suggestionsContainer",void 0);q([(0,G.queryAssignedElements)({selector:"ft-text-field-suggestion"})],W.prototype,"suggestions",void 0);(0,sa.customElement)("ft-text-field")(W);(0,sa.customElement)("ft-text-field-suggestion")(ce);var Id=g(R());var Ao=g(B()),sr=g(Z()),Qt=g(R());var be=g(R());var wd=g(R()),Ed=e=>wd.FtReduxStore.get({name:"ft-reader-"+e,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0}});var la=class{constructor(t,o){this.mapId=t,this.paginatedToc=o,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,o,i){return t.flatMap(n=>(n.pageConfiguration&&this.registerPage(this.buildPage(n,i)),n.tocId==null?this.extractPagesToc(n.children,o,i):[{tocId:n.tocId,title:n.title,depth:o,children:this.extractPagesToc(n.children,o+1,n.tocId)}]))}convertNodes(t,o,i){return t.flatMap(n=>{var a,s,c;if(n.tocId==null)return[...this.convertSectionNodes((a=n.pageToc)!==null&&a!==void 0?a:[],o,n.tocId),...this.convertNodes(n.children,o,n.tocId)];let u=(s=n.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:n.tocId,contentId:n.contentId,title:n.title,hasRating:n.hasRating,origin:n.origin,prettyUrl:u,depth:o,parentTocId:i,children:[]};this.register(p);let h=this.convertSectionNodes((c=n.pageToc)!==null&&c!==void 0?c:[],o+1,n.tocId),m=this.convertNodes(n.children,o+1,p.tocId);return p.children=[...h,...m],[p]})}convertSectionNodes(t,o,i){return t.flatMap(n=>{var a;let s=(a=n.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={...n,prettyUrl:s,depth:o,parentTocId:i,children:[]};return this.register(c),c.children=this.convertSectionNodes(n.children,o+1,n.tocId),[c]})}buildPage(t,o){var i,n,a,s,c,u;let p={number:this.pages.length+1,title:(i=t.title)!==null&&i!==void 0?i:"",rootTocId:(n=t.tocId)!==null&&n!==void 0?n:"root",toc:((a=t.pageToc)!==null&&a!==void 0?a:[]).map(b=>this.nodeByTocId[b.tocId]),topics:[],hiddenTopics:[],breadcrumb:o?this.buildBreadcrumb(this.nodeByTocId[o]):[]},h=(b,x)=>(x?p.topics:p.hiddenTopics).push(b),m=(c=(s=t.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&c!==void 0?c:[];return p.breadcrumb.forEach((b,x)=>{h(b,m[x])}),t.tocId&&h(t.tocId,t.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=t.pageToc)!==null&&u!==void 0?u:[])),p}registerPage(t){for(let o of[...t.topics,...t.hiddenTopics])this.pageByTocId[o]||(this.pageByTocId[o]=t);this.pages.push(t)}tocIds(t){return t.flatMap(o=>[o.tocId,...this.tocIds(o.children)])}buildBreadcrumb(t){let o=[t.tocId];for(;t?.parentTocId;)o.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return o}register(t){t.prettyUrl&&(this.nodeByUrl[t.prettyUrl]==null?this.nodeByUrl[t.prettyUrl]=t:this.duplicatedPrettyUrls.add(t.prettyUrl)),this.nodeByUrl[`${this.mapId}/${t.tocId}`]=t,this.nodeByTocId[t.tocId]=t}},Ei=class{convertPaginatedToc(t,o){return new la(t,o).build()}};var Ai=class extends Ee{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,o,i){super(!1,o),this.converter=t,this._mapId=i,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",()=>this.api.getReaderConfiguration()),this.cache.register("map",()=>this.withMapId(t=>this.fetchMap(t))),this.cache.register("enrichedToc",()=>this.withMapId(t=>this.fetchPages(t).then(o=>this.converter.convertPaginatedToc(t,o)))),this.cache.register("ratingSummary",()=>{var t,o;return pr((o=(t=N.getState().session)===null||t===void 0?void 0:t.profile.roles)!==null&&o!==void 0?o:[],"RATING_USER")?this.withMapId(n=>this.fetchMapRating(n)):Promise.resolve()})}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getMapNow(){return this.cache.getNow("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var o;return(o=this.enrichedToc)===null||o===void 0?void 0:o.nodeByTocId[t]}getTocNodeNowByUrl(t){var o,i;let n=this.getMapNow();return n?.prettyUrl==t||`${n?.id}/root`===t?(o=this.enrichedToc)===null||o===void 0?void 0:o.toc[0]:(i=this.enrichedToc)===null||i===void 0?void 0:i.nodeByUrl[t]}async getPage(t){let o=await this.getEnrichedToc();return o.pages[t-1]||o.pages[0]}async getPageByTocId(t){let o=await this.getEnrichedToc();return o.pageByTocId[t]||o.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,()=>this.fetchTopicMetadata(t))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,()=>this.fetchTopicHTMLContent(t))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}getRelativesForDocument(t,o){return this.cache.get("document-relatives-"+t+"-"+o.join("-"),()=>this.fetchRelativesForDocument(t,o))}getRelativesForTopicInMap(t,o,i){return this.cache.get("topic-relatives-"+[t,o,...i].join("-"),()=>this.fetchRelativesForTopicInMap(t,o,i))}getAttachmentDownloadLink(t){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(t).content}?download=true`)}getLink(t,o,i){let n=this.getNavigationData(t,o,i),a=this.getReaderLinkPrefix()+(n.prettyUrl?n.prettyUrl:`${n.mapId}/${n.tocId}`),s=new URL(a,this.api.tenantBaseUrl);return n.page!=null&&s.searchParams.set("page",`${n.page}`),n.prettyUrlDuplicated&&s.searchParams.set("tocId",n.tocId),n.section!=null&&s.searchParams.set("section",n.section),s.href}getNavigationData(t,o,i){var n,a;t=t||"root";let s=this.enrichedToc,c=s?.pageByTocId[t],u=s?.nodeByTocId[t],p=u?.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:(n=u?.title)!==null&&n!==void 0?n:"",page:o&&c&&c.number!==o?o:void 0,prettyUrl:p?.replace(/^r\//,""),prettyUrlDuplicated:(a=s?.duplicatedPrettyUrls.has(p??""))!==null&&a!==void 0?a:!1,section:i}}async getAccurateNavigationData(t,o,i){return await this.getEnrichedToc(),this.getNavigationData(t,o,i)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then(t=>t?.publication)}getTopicRating(t){return this.getRatingSummary().then(o=>{var i;return o?{type:o.topics.type,rating:(i=o.topics)===null||i===void 0?void 0:i.ratings.find(n=>n.tocId===t)}:void 0})}rateMap(t,o){return this.makeRateMapRequest(t,o).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(t,o){return this.makeMapFeedbackRequest(t,o)}rateTopic(t,o,i){return this.makeRateTopicRequest(t,o,i).then(()=>this.clearRatingIfNecessary())}unrateTopic(t){return this.makeUnrateTopicRequest(t).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let t=N.getState().session;t?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,o,i){return this.makeTopicFeedbackRequest(t,o,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let o=this.getTocNodeNow(t),i=[{tocId:o.tocId,title:o.title}],n=this.getTocNodeNow(o.parentTocId);for(;n;)i.unshift({tocId:n.tocId,title:n.title}),n=this.getTocNodeNow(n.parentTocId);return i}isFeatureAccessible(t,{session:o}){var i;if(!this.isFeatureAvailable(t))return!1;switch(t){case ie.FEEDBACK:return pr(o??[],tt.FEEDBACK_USER);case ie.RATING:return pr(o??[],tt.RATING_USER);case ie.PRINT:return pr(o??[],tt.PRINT_USER);case ie.BOOKMARK:return!!o?.sessionAuthenticated;case ie.COLLECTIONS:return pr(o??[],tt.COLLECTION_USER);case ie.PERSONAL_BOOKS:return pr(o??[],tt.PERSONAL_BOOK_USER)&&!(!((i=this.getMapNow())===null||i===void 0)&&i.pbkConfidential);default:return!1}}makeAbsolute(t){return this.api.makeAbsolute(t)}};var Ri=class e extends Ai{static async build(t){return new e(new Ei,void 0,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){let o=await this.api.getMap(t);return this.fingerprint=o.fingerprint,o}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(t,o){let i={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:t,valueFilter:{negative:!1,values:o}}],sort:[],facets:[]};return this.api.search(i)}fetchRelativesForTopicInMap(t,o,i){let n={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:o,valueFilter:{negative:!1,values:i}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[t]}}],sort:[],facets:[]};return this.api.search(n)}makeMapFeedbackRequest(t,o){return this.api.sendMapFeedback(this.mapId,t,o)}makeRateMapRequest(t,o){return this.api.rateMap(this.mapId,t,o)}makeRateTopicRequest(t,o,i){return this.api.rateTopic(this.mapId,t,o,i)}makeTopicFeedbackRequest(t,o,i){return this.api.sendTopicFeedback(this.mapId,t,o,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}};var Ii=class e{static build(t,o){return new e(Ed(t.trim()||"context"),o??Ri.build)}loaded(){return(0,be.waitUntil)(()=>this._loaded)}constructor(t,o,i){this.store=t,this.clusteringHelperProvider=i,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new be.Debouncer(10),this.initService(o)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){return(0,be.waitFor)(()=>this.service)}async navigateToTopic(t,o,i){await this.loaded();let n=await this.awaitService(),a=await(i!=null?n.getPage(i):n.getPageByTocId(t??"root"));this.store.actions.currentPage(a),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,a),section:o})}resolveValidNonRootTocId(t,o){var i,n,a;let s=(i=t==="root"?void 0:t)!==null&&i!==void 0?i:o.rootTocId;return o.topics.includes(s)?s:(a=(n=o.topics[0])!==null&&n!==void 0?n:o.hiddenTopics[0])!==null&&a!==void 0?a:"root"}async navigateToPage(t){await this.loaded();let i=await(await this.awaitService()).getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var t;!((t=this.service)===null||t===void 0)&&t.mapId&&this.store.getState().map==null&&await this.loadDebouncer.run(()=>this.fetchData())}clear(){var t;this._loaded=!1,this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),this.store.actions.relatives(void 0),(t=this.service)===null||t===void 0||t.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(){var t,o,i,n,a;try{await Promise.all([(t=this.service)===null||t===void 0?void 0:t.getConfiguration().then(s=>this.store.actions.configuration(s)),(o=this.service)===null||o===void 0?void 0:o.getMap().then(s=>this.store.actions.map(s)),(i=this.service)===null||i===void 0?void 0:i.getToc().then(s=>this.store.actions.toc(s)),(n=this.service)===null||n===void 0?void 0:n.getPagesToc().then(s=>this.store.actions.pagesToc(s)),(a=this.service)===null||a===void 0?void 0:a.getPaginationConfiguration().then(s=>this.store.actions.paginationConfiguration(s))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0}catch(s){this.errorHandler&&!(s instanceof be.CanceledPromiseError)&&this.errorHandler(s)}}fetchRelatives(){var t,o,i;let n=(t=this.store.getState().map)===null||t===void 0?void 0:t.metadata.filter(a=>{var s;return a.key==((s=this.store.getState().configuration)===null||s===void 0?void 0:s.relativePivotMetadata)}).flatMap(a=>a.values);n!==void 0&&n.length>0?(o=this.service)===null||o===void 0||o.getRelativesForDocument((i=this.store.getState().configuration)===null||i===void 0?void 0:i.relativePivotMetadata,n).then(a=>{let s=a.results.flatMap(c=>c.entries);this.store.actions.relatives(s),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new CustomEvent("clustering-helper-created"))}createClusteringHelper(){var t,o;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let i=this.store.getState().relatives;if(i){let n=i.find(s=>{var c;return((c=s.map)===null||c===void 0?void 0:c.mapId)==this.store.getState().mapId}),a=(o=(t=N.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&o!==void 0?o:[];return new be.ClusteringHelper(i,n,this.metadataForSwitchToRelatives,a)}}async navigateToRelativeTopicIfFound(t){var o,i,n;await this.loaded();let a=await(0,be.waitFor)(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),s=this.store.getState().mapId,u=await(await this.awaitService()).getRelativesForTopicInMap(s,a,[t]);if(!((n=(i=(o=u?.results)===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.entries)===null||n===void 0)&&n[0]){let p=u.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}registerMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.add(t),this.store.getState().relatives==null?this.fetchRelatives():this.updateClusteringHelper()}unregisterMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.delete(t),this.updateClusteringHelper()}};var Ad=g(B());var Rd=Ad.css`
|
|
1837
1837
|
`;var Ni=class extends CustomEvent{constructor(t,o){super("ft-reader-map-loaded",{detail:{map:t,toc:o}})}},Ti=class extends CustomEvent{constructor(t,o){super("ft-reader-visible-topics-change",{detail:{visibleTopics:o}})}},_i=class extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}},ki=class extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}},Li=class extends Event{constructor(){super("ft-reader-map-not-found")}},Pi=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},Di=class extends Event{constructor(){super("ft-reader-map-forbidden")}},$i=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var Bi=class{constructor(t){this.stateManager=t}searchInDocument(t){this.stateManager.setSearchInDocumentQuery(t??"")}};var Jt=function(e,t,o,i){var n=arguments.length,a=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(a=(n<3?s(a):n>3?s(t,o,a):s(t,o))||a);return n>3&&a&&Object.defineProperty(t,o,a),a},lu=e=>t=>+(t??"NaN")>0?+t:e,Et=class extends Qt.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new Qt.Debouncer(5),this.navigationDebouncer=new Qt.Debouncer(10),this.mapLoadedEventDebouncer=new Qt.Debouncer(50),this.addStore(N)}render(){return Ao.html`
|
|
1838
1838
|
${this.importStyleIfNeeded()}
|
|
1839
1839
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|