@fluid-topics/ft-reader-feedback 1.2.4 → 1.2.5

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.
@@ -1820,7 +1820,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
1820
1820
  <style>
1821
1821
  @import "${i}"
1822
1822
  </style>
1823
- `}get stateManager(){return this._stateManager==null&&(this._stateManager=Ai.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then(t=>{let o=t.fontsStylesheet();if(o&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${o}"]`)){let i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",o),document.head.append(i)}window.FluidTopicsReaderService=new $i(this.stateManager)})}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&(this.stateManager.setMapId(this.mapId),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&this.searchInDocumentQuery!=null&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some(o=>t.has(o))&&this.mapId&&this.navigateToTarget(),t.has("session")&&this.reload()}contentAvailableCallback(t){var o;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),t.has("scrollTarget")&&((o=this.scrollTarget)===null||o===void 0?void 0:o.tocId)==null){let i=t.get("scrollTarget");i?.tocId!=null&&this.scrollToTargetDebouncer.run(()=>{var n;return this.stateManager.service.getAccurateNavigationData(i.tocId,(n=this.currentPage)===null||n===void 0?void 0:n.number,i.section).then(a=>this.dispatchEvent(new Ni(a)))})}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map(i=>{var n;return this.stateManager.service.getAccurateNavigationData(i,(n=this.currentPage)===null||n===void 0?void 0:n.number)})).then(i=>{let n=i.filter(a=>a!=null&&a.topicTitle!=="").map(a=>{var s;return{tocId:a.tocId,title:a.topicTitle,page:a.page,prettyUrl:a.prettyUrl,prettyUrlDuplicated:a.prettyUrlDuplicated,breadcrumb:(s=this.stateManager.service)===null||s===void 0?void 0:s.buildBreadcrumb(a.tocId)}});this.dispatchEvent(new Ii(this.map,n))})}clear(){this.stateManager.clear()}async reload(){await this.stateManager.reload()}async navigateToTarget(){await this.navigationDebouncer.run(async()=>{this.topicPivot!=null?!await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)&&this.lastNotifiedNotFoundRelative!==this.mapId+this.topicPivot?(this.dispatchEvent(new Pi),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot):this.lastNotifiedNotFoundRelative=void 0:this.tocId!=null?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):this.page!=null&&await this.stateManager.navigateToPage(this.page)})}registerComponent(t){t.stopPropagation();let o=t.composedPath()[0];this.register(o)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){let o=t;o.status===401?this.dispatchEvent(new Li):o.status===403?this.dispatchEvent(new ki):o.status===404?this.dispatchEvent(new _i):this.dispatchEvent(new Ti(t))}reloadBookmarks(){Ul.reloadBookmarks()}async reloadRating(){var t,o;await((t=this.stateManager.service)===null||t===void 0?void 0:t.reloadRating()),(o=this.stateManager.store)===null||o===void 0||o.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run(()=>{this.map&&this.toc&&this.dispatchEvent(new Ri(this.map,this.toc))})}};Ct.styles=Ed;Xt([(0,Yt.redux)({store:N.name})],Ct.prototype,"baseUrl",void 0);Xt([(0,Yt.redux)({store:N.name})],Ct.prototype,"session",void 0);Xt([(0,sr.property)()],Ct.prototype,"mapId",void 0);Xt([(0,sr.property)()],Ct.prototype,"tocId",void 0);Xt([(0,sr.property)()],Ct.prototype,"section",void 0);Xt([(0,sr.property)()],Ct.prototype,"topicPivot",void 0);Xt([(0,sr.property)()],Ct.prototype,"searchInDocumentQuery",void 0);Xt([(0,sr.property)({type:Number,converter:{fromAttribute:au()}})],Ct.prototype,"page",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"map",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"toc",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"visibleTopics",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"currentPage",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"scrollTarget",void 0);Xt([(0,sr.property)({attribute:!1})],Ct.prototype,"readerServiceProvider",void 0);(0,Ad.customElement)("ft-reader-context")(Ct);var Di=class extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}},Bi=class extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}},Mi=class extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}},Fi=class extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}},Ui=class extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}};var wt=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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},X=class extends ir(Me){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(V,Kl)}get canAccessFeedback(){var t;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(re.FEEDBACK,{session:this.session})}get canAccessRating(){var t,o;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(re.RATING,{session:this.session,ratingType:(o=this.ratingSummary)===null||o===void 0?void 0:o.type})}get configuredRatingType(){var t,o;return(o=this.ratingAllowed?(t=this.ratingSummary)===null||t===void 0?void 0:t.type:"NO_RATING")!==null&&o!==void 0?o:"NO_RATING"}get ratingType(){var t,o,i;return(i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.type)!==null&&i!==void 0?i:"NO_RATING"}get ratingValue(){var t,o,i;return(i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.value)!==null&&i!==void 0?i:-1}get ratingDate(){var t,o;let i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.date;return typeof i=="string"?(0,Wi.parseDate)(i):i}render(){return!this.canAccessFeedback&&!this.canAccessRating?yt.nothing:yt.html`
1823
+ `}get stateManager(){return this._stateManager==null&&(this._stateManager=Ai.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then(t=>{let o=t.fontsStylesheet();if(o&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${o}"]`)){let i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",o),document.head.append(i)}window.FluidTopicsReaderService=new $i(this.stateManager)})}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&(this.stateManager.setMapId(this.mapId),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&this.searchInDocumentQuery!=null&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some(o=>t.has(o))&&this.mapId&&this.navigateToTarget(),t.has("session")&&this.reload()}contentAvailableCallback(t){var o;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),t.has("scrollTarget")&&((o=this.scrollTarget)===null||o===void 0?void 0:o.tocId)==null){let i=t.get("scrollTarget");i?.tocId!=null&&this.scrollToTargetDebouncer.run(()=>{var n;return this.stateManager.service.getAccurateNavigationData(i.tocId,(n=this.currentPage)===null||n===void 0?void 0:n.number,i.section).then(a=>this.dispatchEvent(new Ni(a)))})}(t.has("visibleTopics")||t.has("scrollTarget"))&&this.scrollTarget==null&&Promise.all(this.visibleTopics.map(i=>{var n;return this.stateManager.service.getAccurateNavigationData(i,(n=this.currentPage)===null||n===void 0?void 0:n.number)})).then(i=>{let n=i.filter(a=>a!=null&&a.topicTitle!=="").map(a=>{var s;return{tocId:a.tocId,title:a.topicTitle,page:a.page,prettyUrl:a.prettyUrl,prettyUrlDuplicated:a.prettyUrlDuplicated,breadcrumb:(s=this.stateManager.service)===null||s===void 0?void 0:s.buildBreadcrumb(a.tocId)}});this.dispatchEvent(new Ii(this.map,n))})}clear(){this.stateManager.clear()}async reload(){await this.stateManager.reload()}async navigateToTarget(){await this.navigationDebouncer.run(async()=>{this.topicPivot!=null?!await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)&&this.lastNotifiedNotFoundRelative!==this.mapId+this.topicPivot?(this.dispatchEvent(new Pi),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot):this.lastNotifiedNotFoundRelative=void 0:this.tocId!=null?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):this.page!=null&&await this.stateManager.navigateToPage(this.page)})}registerComponent(t){t.stopPropagation();let o=t.composedPath()[0];this.register(o)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){let o=t;o.status===401?this.dispatchEvent(new Li):o.status===403?this.dispatchEvent(new ki):o.status===404?this.dispatchEvent(new _i):this.dispatchEvent(new Ti(t))}reloadBookmarks(){Ul.reloadBookmarks()}async reloadRating(){var t,o;await((t=this.stateManager.service)===null||t===void 0?void 0:t.reloadRating()),(o=this.stateManager.store)===null||o===void 0||o.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run(()=>{this.map&&this.toc&&this.dispatchEvent(new Ri(this.map,this.toc))})}};Ct.styles=Ed;Xt([(0,Yt.redux)({store:N.name})],Ct.prototype,"baseUrl",void 0);Xt([(0,Yt.redux)({store:N.name})],Ct.prototype,"session",void 0);Xt([(0,sr.property)()],Ct.prototype,"mapId",void 0);Xt([(0,sr.property)()],Ct.prototype,"tocId",void 0);Xt([(0,sr.property)()],Ct.prototype,"section",void 0);Xt([(0,sr.property)()],Ct.prototype,"topicPivot",void 0);Xt([(0,sr.property)()],Ct.prototype,"searchInDocumentQuery",void 0);Xt([(0,sr.property)({type:Number,converter:{fromAttribute:au()}})],Ct.prototype,"page",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"map",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"toc",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"visibleTopics",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"currentPage",void 0);Xt([(0,Yt.redux)({store:"reader"})],Ct.prototype,"scrollTarget",void 0);Xt([(0,sr.property)({attribute:!1})],Ct.prototype,"readerServiceProvider",void 0);(0,Ad.customElement)("ft-reader-context")(Ct);var Di=class extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}},Bi=class extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}},Mi=class extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}},Fi=class extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}},Ui=class extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}};var wt=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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},X=class extends ir(Me){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(V,Kl)}get canAccessFeedback(){var t;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(re.FEEDBACK,{session:this.session})}get canAccessRating(){var t,o;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(re.RATING,{session:this.session,ratingType:(o=this.ratingSummary)===null||o===void 0?void 0:o.type})}get configuredRatingType(){var t,o;return(o=this.ratingAllowed?(t=this.ratingSummary)===null||t===void 0?void 0:t.type:"NO_RATING")!==null&&o!==void 0?o:"NO_RATING"}get ratingType(){var t,o,i;return(i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.type)!==null&&i!==void 0?i:"NO_RATING"}get ratingValue(){var t,o,i;return(i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.value)!==null&&i!==void 0?i:-1}get ratingDate(){var t,o;let i=(o=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||o===void 0?void 0:o.date;return typeof i=="string"?(0,Wi.parseDate)(i):i}render(){return!this.canAccessFeedback&&!this.canAccessRating?yt.nothing:yt.html`
1824
1824
  <div class="ft-reader-feedback">
1825
1825
  ${this.hideTitle?yt.nothing:yt.html`
1826
1826
  <ft-typography variant="title" part="main-title">
@@ -1865,7 +1865,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
1865
1865
  <style>
1866
1866
  @import "${i}"
1867
1867
  </style>
1868
- `}get stateManager(){return this._stateManager==null&&(this._stateManager=Ji.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then(t=>{let e=t.fontsStylesheet();if(e&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${e}"]`)){let i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",e),document.head.append(i)}window.FluidTopicsReaderService=new ln(this.stateManager)})}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&(this.stateManager.setMapId(this.mapId),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&this.searchInDocumentQuery!=null&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some(e=>t.has(e))&&this.mapId&&this.navigateToTarget(),t.has("session")&&this.reload()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),t.has("scrollTarget")&&((e=this.scrollTarget)===null||e===void 0?void 0:e.tocId)==null){let i=t.get("scrollTarget");i?.tocId!=null&&this.scrollToTargetDebouncer.run(()=>{var n;return this.stateManager.service.getAccurateNavigationData(i.tocId,(n=this.currentPage)===null||n===void 0?void 0:n.number,i.section).then(a=>this.dispatchEvent(new en(a)))})}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map(i=>{var n;return this.stateManager.service.getAccurateNavigationData(i,(n=this.currentPage)===null||n===void 0?void 0:n.number)})).then(i=>{let n=i.filter(a=>a!=null&&a.topicTitle!=="").map(a=>{var s;return{tocId:a.tocId,title:a.topicTitle,page:a.page,prettyUrl:a.prettyUrl,prettyUrlDuplicated:a.prettyUrlDuplicated,breadcrumb:(s=this.stateManager.service)===null||s===void 0?void 0:s.buildBreadcrumb(a.tocId)}});this.dispatchEvent(new tn(this.map,n))})}clear(){this.stateManager.clear()}async reload(){await this.stateManager.reload()}async navigateToTarget(){await this.navigationDebouncer.run(async()=>{this.topicPivot!=null?!await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)&&this.lastNotifiedNotFoundRelative!==this.mapId+this.topicPivot?(this.dispatchEvent(new sn),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot):this.lastNotifiedNotFoundRelative=void 0:this.tocId!=null?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):this.page!=null&&await this.stateManager.navigateToPage(this.page)})}registerComponent(t){t.stopPropagation();let e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){let e=t;e.status===401?this.dispatchEvent(new nn):e.status===403?this.dispatchEvent(new an):e.status===404?this.dispatchEvent(new on):this.dispatchEvent(new rn(t))}reloadBookmarks(){lp.reloadBookmarks()}async reloadRating(){var t,e;await((t=this.stateManager.service)===null||t===void 0?void 0:t.reloadRating()),(e=this.stateManager.store)===null||e===void 0||e.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run(()=>{this.map&&this.toc&&this.dispatchEvent(new Qi(this.map,this.toc))})}};wt.styles=hp;Vt([ct({store:M.name})],wt.prototype,"baseUrl",void 0);Vt([ct({store:M.name})],wt.prototype,"session",void 0);Vt([g()],wt.prototype,"mapId",void 0);Vt([g()],wt.prototype,"tocId",void 0);Vt([g()],wt.prototype,"section",void 0);Vt([g()],wt.prototype,"topicPivot",void 0);Vt([g()],wt.prototype,"searchInDocumentQuery",void 0);Vt([g({type:Number,converter:{fromAttribute:dh()}})],wt.prototype,"page",void 0);Vt([ct({store:"reader"})],wt.prototype,"map",void 0);Vt([ct({store:"reader"})],wt.prototype,"toc",void 0);Vt([ct({store:"reader"})],wt.prototype,"visibleTopics",void 0);Vt([ct({store:"reader"})],wt.prototype,"currentPage",void 0);Vt([ct({store:"reader"})],wt.prototype,"scrollTarget",void 0);Vt([g({attribute:!1})],wt.prototype,"readerServiceProvider",void 0);Z("ft-reader-context")(wt);var cn=class extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}},dn=class extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}},pn=class extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}},un=class extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}},fn=class extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}};var At=function(r,t,e,i){var n=arguments.length,a=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,i);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(n<3?s(a):n>3?s(t,e,a):s(t,e))||a);return n>3&&a&&Object.defineProperty(t,e,a),a},nt=class extends Je(Ke){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(tt,dp)}get canAccessFeedback(){var t;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(Yt.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(Yt.RATING,{session:this.session,ratingType:(e=this.ratingSummary)===null||e===void 0?void 0:e.type})}get configuredRatingType(){var t,e;return(e=this.ratingAllowed?(t=this.ratingSummary)===null||t===void 0?void 0:t.type:"NO_RATING")!==null&&e!==void 0?e:"NO_RATING"}get ratingType(){var t,e,i;return(i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.type)!==null&&i!==void 0?i:"NO_RATING"}get ratingValue(){var t,e,i;return(i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.value)!==null&&i!==void 0?i:-1}get ratingDate(){var t,e;let i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.date;return typeof i=="string"?vi(i):i}render(){return!this.canAccessFeedback&&!this.canAccessRating?V:$`
1868
+ `}get stateManager(){return this._stateManager==null&&(this._stateManager=Ji.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then(t=>{let e=t.fontsStylesheet();if(e&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${e}"]`)){let i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",e),document.head.append(i)}window.FluidTopicsReaderService=new ln(this.stateManager)})}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&(this.stateManager.setMapId(this.mapId),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&this.searchInDocumentQuery!=null&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some(e=>t.has(e))&&this.mapId&&this.navigateToTarget(),t.has("session")&&this.reload()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),t.has("scrollTarget")&&((e=this.scrollTarget)===null||e===void 0?void 0:e.tocId)==null){let i=t.get("scrollTarget");i?.tocId!=null&&this.scrollToTargetDebouncer.run(()=>{var n;return this.stateManager.service.getAccurateNavigationData(i.tocId,(n=this.currentPage)===null||n===void 0?void 0:n.number,i.section).then(a=>this.dispatchEvent(new en(a)))})}(t.has("visibleTopics")||t.has("scrollTarget"))&&this.scrollTarget==null&&Promise.all(this.visibleTopics.map(i=>{var n;return this.stateManager.service.getAccurateNavigationData(i,(n=this.currentPage)===null||n===void 0?void 0:n.number)})).then(i=>{let n=i.filter(a=>a!=null&&a.topicTitle!=="").map(a=>{var s;return{tocId:a.tocId,title:a.topicTitle,page:a.page,prettyUrl:a.prettyUrl,prettyUrlDuplicated:a.prettyUrlDuplicated,breadcrumb:(s=this.stateManager.service)===null||s===void 0?void 0:s.buildBreadcrumb(a.tocId)}});this.dispatchEvent(new tn(this.map,n))})}clear(){this.stateManager.clear()}async reload(){await this.stateManager.reload()}async navigateToTarget(){await this.navigationDebouncer.run(async()=>{this.topicPivot!=null?!await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)&&this.lastNotifiedNotFoundRelative!==this.mapId+this.topicPivot?(this.dispatchEvent(new sn),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot):this.lastNotifiedNotFoundRelative=void 0:this.tocId!=null?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):this.page!=null&&await this.stateManager.navigateToPage(this.page)})}registerComponent(t){t.stopPropagation();let e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){let e=t;e.status===401?this.dispatchEvent(new nn):e.status===403?this.dispatchEvent(new an):e.status===404?this.dispatchEvent(new on):this.dispatchEvent(new rn(t))}reloadBookmarks(){lp.reloadBookmarks()}async reloadRating(){var t,e;await((t=this.stateManager.service)===null||t===void 0?void 0:t.reloadRating()),(e=this.stateManager.store)===null||e===void 0||e.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run(()=>{this.map&&this.toc&&this.dispatchEvent(new Qi(this.map,this.toc))})}};wt.styles=hp;Vt([ct({store:M.name})],wt.prototype,"baseUrl",void 0);Vt([ct({store:M.name})],wt.prototype,"session",void 0);Vt([g()],wt.prototype,"mapId",void 0);Vt([g()],wt.prototype,"tocId",void 0);Vt([g()],wt.prototype,"section",void 0);Vt([g()],wt.prototype,"topicPivot",void 0);Vt([g()],wt.prototype,"searchInDocumentQuery",void 0);Vt([g({type:Number,converter:{fromAttribute:dh()}})],wt.prototype,"page",void 0);Vt([ct({store:"reader"})],wt.prototype,"map",void 0);Vt([ct({store:"reader"})],wt.prototype,"toc",void 0);Vt([ct({store:"reader"})],wt.prototype,"visibleTopics",void 0);Vt([ct({store:"reader"})],wt.prototype,"currentPage",void 0);Vt([ct({store:"reader"})],wt.prototype,"scrollTarget",void 0);Vt([g({attribute:!1})],wt.prototype,"readerServiceProvider",void 0);Z("ft-reader-context")(wt);var cn=class extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}},dn=class extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}},pn=class extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}},un=class extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}},fn=class extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}};var At=function(r,t,e,i){var n=arguments.length,a=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,i);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(n<3?s(a):n>3?s(t,e,a):s(t,e))||a);return n>3&&a&&Object.defineProperty(t,e,a),a},nt=class extends Je(Ke){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(tt,dp)}get canAccessFeedback(){var t;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(Yt.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return(t=this.service)===null||t===void 0?void 0:t.isFeatureAccessible(Yt.RATING,{session:this.session,ratingType:(e=this.ratingSummary)===null||e===void 0?void 0:e.type})}get configuredRatingType(){var t,e;return(e=this.ratingAllowed?(t=this.ratingSummary)===null||t===void 0?void 0:t.type:"NO_RATING")!==null&&e!==void 0?e:"NO_RATING"}get ratingType(){var t,e,i;return(i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.type)!==null&&i!==void 0?i:"NO_RATING"}get ratingValue(){var t,e,i;return(i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.value)!==null&&i!==void 0?i:-1}get ratingDate(){var t,e;let i=(e=(t=this.ratingSummary)===null||t===void 0?void 0:t.rating)===null||e===void 0?void 0:e.date;return typeof i=="string"?vi(i):i}render(){return!this.canAccessFeedback&&!this.canAccessRating?V:$`
1869
1869
  <div class="ft-reader-feedback">
1870
1870
  ${this.hideTitle?V:$`
1871
1871
  <ft-typography variant="title" part="main-title">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-feedback",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Feedback forms for a map and its topics in an integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "1.2.4",
23
- "@fluid-topics/ft-reader-context": "1.2.4",
24
- "@fluid-topics/ft-wc-utils": "1.2.4",
22
+ "@fluid-topics/ft-app-context": "1.2.5",
23
+ "@fluid-topics/ft-reader-context": "1.2.5",
24
+ "@fluid-topics/ft-wc-utils": "1.2.5",
25
25
  "lit": "3.1.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluid-topics/public-api": "1.0.78"
29
29
  },
30
- "gitHead": "c5822c07ea0e1ee8ed9b54f8d66ded338594a42f"
30
+ "gitHead": "aec75d3dcbb3256c079ecf330a0f2755e7469584"
31
31
  }