@digital-realty/ui-knowledgebase 0.1.3 → 0.1.4-IXUAT-11250.561389

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -452,33 +452,45 @@ launchpad widget depend on it.
452
452
  **Type:** Story
453
453
 
454
454
  **Summary**
455
- Search across KB posts from the hero search input, with a results list that links to posts.
455
+ Search KB post titles from a search input, with a results dropdown that links to posts.
456
+ PO decision: **client-side, title-only** substring match (mirrors legacy); content/body
457
+ search was explicitly deferred.
456
458
 
457
459
  **Background**
458
- The legacy KB hero has a search box. Content is small, so a simple substring match is
459
- enough — no ranking engine. Runs against Strapi REST.
460
-
461
- **Scope**
462
-
463
- - Add `StrapiClient.search(query)` (KB-1) using Strapi filters (`$containsi` on `title`,
464
- `abstract`, `text`), published-only and locale-aware, returning normalized post previews.
465
- - Wire the hero search input (KB-4): debounce input, call `search`, and show results.
466
- - Render results as a simple list (title, abstract, category/topic); click → `/details/:uid`.
467
- - Handle empty query, no-results, and error states.
460
+ The legacy KB filtered a preloaded post list in-memory (no per-keystroke API, no debounce,
461
+ 3+ char threshold). Content is small, so this is plenty — no ranking engine. We reuse the
462
+ shared `ix-search-bar` (dropdown mode, added in `@digital-realty/ix-search-bar` 2.5.0) and
463
+ wrap it as `kb-search-bar`.
464
+
465
+ **Scope** — search is **scoped to the current page**:
466
+
467
+ - `kb-search-bar` (`src/components/kb-search-bar.ts`) wraps `<ix-search-bar>` and feeds it a
468
+ scoped post-title set, substring-matched client-side on `title` (3+ chars → dropdown).
469
+ - Scope by page: **landing searches all posts**; **category page** searches only that
470
+ category (`category="<uid>"`); **topic page** searches only that topic (`topic="<code>"`).
471
+ - Data via `getKbClient().getPostLinks(scope)` (KB-1) — a lightweight fetch of `uid` + `title`
472
+ + the post's `category { uid, icon }` only (no body/media), cached per scope. Published-only
473
+ and locale-aware via the existing client config.
474
+ - Each result shows the title + its category icon; selecting one links to `/details/:uid`
475
+ (also emits a `kb-search-select` event `{ uid }` for parents that want to intercept).
468
476
 
469
477
  **Out of scope**
470
478
 
471
- - Ranking / relevance scoring, faceting, and search analytics.
479
+ - Content/body search (deferred by PO), ranking / relevance scoring, faceting, analytics.
472
480
 
473
481
  **Acceptance criteria**
474
482
 
475
- - Typing a query returns matching published posts; matches are case-insensitive across title/abstract/text.
483
+ - Typing 3+ chars shows matching posts (case-insensitive title substring); fewer chars show nothing.
484
+ - Results are scoped to the page (all / one category / one topic).
476
485
  - Selecting a result navigates to `/details/:uid`.
477
- - Empty query clears results; no-results and error states render.
486
+ - Clearing the query closes the dropdown.
478
487
 
479
- **Dependencies:** KB-1, KB-4.
488
+ **Dependencies:** KB-1 (`getPostLinks`), KB-4, and `@digital-realty/ix-search-bar >= 2.5.0`
489
+ (dropdown/shape/leading-icon) provided by the host at runtime.
480
490
 
481
- _Note: the search input also appears on the category and topic pages (same component, different placement), not only the hero._
491
+ _Note: the search input appears on the landing hero and on the category/topic pages (same
492
+ component, different scope). Result navigation target (`/details/:uid`) is an assumption
493
+ pending final PO confirmation — trivially switchable since the component builds the href._
482
494
 
483
495
  ### KB-17 · `kb-back-button`
484
496
 
@@ -1,6 +1,6 @@
1
1
  import{LitElement as e,css as t,html as n,nothing as r}from"lit";import{customElement as i,property as a,state as o}from"lit/decorators.js";import{Router as s}from"@vaadin/router";import{unsafeHTML as c}from"lit/directives/unsafe-html.js";var l=null;function u(e,t,n){l=new s(e,{baseUrl:t}),l.setRoutes(n)}function d(){return l}function f(){l?.unsubscribe(),l?.removeRoutes(),l=null}function p(e,t,n){if(e!=null){if(Array.isArray(e)){e.forEach((e,r)=>p(e,`${t}[${r}]`,n));return}if(typeof e==`object`){for(let[r,i]of Object.entries(e))i!==void 0&&p(i,`${t}[${r}]`,n);return}n.push(`${encodeURIComponent(t)}=${encodeURIComponent(String(e))}`)}}function ee(e){let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&p(r,n,t);return t.length?`?${t.join(`&`)}`:``}function te(e,t){return e?/^https?:\/\//i.test(e)?e:`${t.replace(/\/+$/,``)}${e.startsWith(`/`)?e:`/${e}`}`:``}function m(e,t){this.v=e,this.k=t}function h(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ne(e){if(Array.isArray(e))return e}function re(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function g(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(e,t){return ne(e)||re(e,t)||ie(e,t)||g()}function ie(e,t){if(e){if(typeof e==`string`)return h(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function v(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof m;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}v.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},v.prototype.next=function(e){return this._invoke(`next`,e)},v.prototype.throw=function(e){return this._invoke(`throw`,e)},v.prototype.return=function(e){return this._invoke(`return`,e)};var ae=Object.entries,oe=Object.setPrototypeOf,y=Object.isFrozen,b=Object.getPrototypeOf,se=Object.getOwnPropertyDescriptor,x=Object.freeze,S=Object.seal,ce=Object.create,le=typeof Reflect<`u`&&Reflect,C=le.apply,ue=le.construct;x||=function(e){return e},S||=function(e){return e},C||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ue||=function(e){return new e(...[...arguments].slice(1))};var w=A(Array.prototype.forEach);Array.prototype.indexOf;var de=A(Array.prototype.lastIndexOf),fe=A(Array.prototype.pop),pe=A(Array.prototype.push);Array.prototype.slice;var me=A(Array.prototype.splice),he=Array.isArray,ge=A(String.prototype.toLowerCase),_e=A(String.prototype.toString),ve=A(String.prototype.match),ye=A(String.prototype.replace),be=A(String.prototype.indexOf),xe=A(String.prototype.trim),T=A(Number.prototype.toString),Se=A(Boolean.prototype.toString),Ce=typeof BigInt>`u`?null:A(BigInt.prototype.toString),we=typeof Symbol>`u`?null:A(Symbol.prototype.toString),E=A(Object.prototype.hasOwnProperty),D=A(Object.prototype.toString),O=A(RegExp.prototype.test),k=Te(TypeError);function A(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return C(e,t,n)}}function Te(e){return function(){return ue(e,[...arguments])}}function j(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ge;if(oe&&oe(e,null),!he(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(y(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ee(e){for(let t=0;t<e.length;t++)E(e,t)||(e[t]=null);return e}function M(e){let t=ce(null);for(let r of ae(e)){var n=_(r,2);let i=n[0],a=n[1];E(e,i)&&(t[i]=he(a)?Ee(a):a&&typeof a==`object`&&a.constructor===Object?M(a):a)}return t}function De(e){switch(typeof e){case`string`:return e;case`number`:return T(e);case`boolean`:return Se(e);case`bigint`:return Ce?Ce(e):`0`;case`symbol`:return we?we(e):`Symbol()`;case`undefined`:return D(e);case`function`:case`object`:{if(e===null)return D(e);let t=e,n=N(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:D(e)}return D(e)}default:return D(e)}}function N(e,t){for(;e!==null;){let n=se(e,t);if(n){if(n.get)return A(n.get);if(typeof n.value==`function`)return A(n.value)}e=b(e)}function n(){return null}return n}function Oe(e){try{return O(e,``),!0}catch{return!1}}var ke=x(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ae=x(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),je=x([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Me=x([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ne=x(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Pe=x([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=x([`#text`]),Ie=x(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Le=x(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Re=x(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ze=x([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=S(/{{[\w\W]*|^[\w\W]*}}/g),Ve=S(/<%[\w\W]*|^[\w\W]*%>/g),He=S(/\${[\w\W]*/g),Ue=S(/^data-[\-\w.\u00B7-\uFFFF]+$/),We=S(/^aria-[\-\w]+$/),Ge=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ke=S(/^(?:\w+script|data):/i),qe=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Je=S(/^html$/i),Ye=S(/^[a-z][.\w]*(-[.\w]+)+$/i),Xe=S(/<[/\w!]/g),Ze=S(/<[/\w]/g),Qe=S(/<\/no(script|embed|frames)/i),$e=S(/\/>/i),P={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},et=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],tt=x(j({},et)),nt=function(){let e={};return w(et,t=>{e[t]=S(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),x(e)}(),rt=function(){return typeof window>`u`?null:window},it=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},at=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},F=function(e,t,n,r){return E(e,t)&&he(e[t])?j(r.base?M(r.base):{},e[t],r.transform):n},ot=function(e,t,n){let r=E(e,t)?e[t]:void 0;return r&&typeof r==`object`?M(r):n()};function st(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rt(),t=e=>st(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==P.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=N(d,`cloneNode`),p=N(d,`remove`),ee=N(d,`removeAttributeNode`),te=N(d,`nextSibling`),m=N(d,`childNodes`),h=N(d,`parentNode`),ne=N(d,`shadowRoot`),re=N(d,`attributes`),g=o&&o.prototype?N(o.prototype,`nodeType`):null,_=o&&o.prototype?N(o.prototype,`nodeName`):null,ie=o&&o.prototype?N(o.prototype,`ownerDocument`):null,v=function(e){return g?g(e):e.nodeType},oe=function(e){return _?_(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,se,le=!1,C=0,ue=function(){if(C>0)throw k(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},T=function(e){ue(),C++;try{return y.createHTML(e)}finally{C--}},Se=function(e){ue(),C++;try{return y.createScriptURL(e)}finally{C--}},Ce=function(){return le||=(se=it(u,i),!0),se},we=n,D=we.implementation,A=we.createNodeIterator,Te=we.createDocumentFragment,Ee=we.getElementsByTagName,et=r.importNode,I=at();t.isSupported=typeof ae==`function`&&typeof h==`function`&&D&&D.createHTMLDocument!==void 0;let ct=Be,lt=Ve,ut=He,dt=Ue,ft=We,pt=Ke,mt=qe,ht=Ye,gt=Ge,L=null,_t=j({},[...ke,...Ae,...je,...Ne,...Fe]),R=null,z=j({},[...Ie,...Le,...Re,...ze]),B=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),vt=null,yt=null,V=Object.seal(ce(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),bt=!0,xt=!0,H=!1,U=!0,W=!1,G=!0,K=!1,q=!1,St=null,J=null,Ct=!1,Y=!1,wt=!1,Tt=!1,Et=!0,Dt=!1,Ot=`user-content-`,kt=!0,At=!1,jt={},Mt=null,Nt=j({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Pt=null,Ft=j({},[`audio`,`video`,`img`,`source`,`image`,`track`]),It=null,Lt=j({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Rt=`http://www.w3.org/1998/Math/MathML`,zt=`http://www.w3.org/2000/svg`,X=`http://www.w3.org/1999/xhtml`,Bt=X,Vt=!1,Ht=null,Ut=j({},[Rt,zt,X],_e),Wt=x([`mi`,`mo`,`mn`,`ms`,`mtext`]),Gt=j({},Wt),Kt=x([`annotation-xml`]),qt=j({},Kt),Jt=j({},[`title`,`style`,`font`,`a`,`script`]),Yt=null,Xt=[`application/xhtml+xml`,`text/html`],Z=null,Zt=null,Qt=n.createElement(`form`),$t=function(e){return e instanceof RegExp||e instanceof Function},en=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Zt&&Zt===e)return;(!e||typeof e!=`object`)&&(e={}),e=M(e),Yt=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Z=Yt===`application/xhtml+xml`?_e:ge,L=F(e,`ALLOWED_TAGS`,_t,{transform:Z}),R=F(e,`ALLOWED_ATTR`,z,{transform:Z}),Ht=F(e,`ALLOWED_NAMESPACES`,Ut,{transform:_e}),It=F(e,`ADD_URI_SAFE_ATTR`,Lt,{transform:Z,base:Lt}),Pt=F(e,`ADD_DATA_URI_TAGS`,Ft,{transform:Z,base:Ft}),Mt=F(e,`FORBID_CONTENTS`,Nt,{transform:Z}),vt=F(e,`FORBID_TAGS`,M({}),{transform:Z}),yt=F(e,`FORBID_ATTR`,M({}),{transform:Z}),jt=E(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?M(e.USE_PROFILES):e.USE_PROFILES:!1,bt=e.ALLOW_ARIA_ATTR!==!1,xt=e.ALLOW_DATA_ATTR!==!1,H=e.ALLOW_UNKNOWN_PROTOCOLS||!1,U=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=e.SAFE_FOR_TEMPLATES||!1,G=e.SAFE_FOR_XML!==!1,K=e.WHOLE_DOCUMENT||!1,Y=e.RETURN_DOM||!1,wt=e.RETURN_DOM_FRAGMENT||!1,Tt=e.RETURN_TRUSTED_TYPE||!1,Ct=e.FORCE_BODY||!1,Et=e.SANITIZE_DOM!==!1,Dt=e.SANITIZE_NAMED_PROPS||!1,kt=e.KEEP_CONTENT!==!1,At=e.IN_PLACE||!1,gt=Oe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ge,Bt=typeof e.NAMESPACE==`string`?e.NAMESPACE:X,Gt=ot(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>j({},Wt)),qt=ot(e,`HTML_INTEGRATION_POINTS`,()=>j({},Kt));let t=ot(e,`CUSTOM_ELEMENT_HANDLING`,()=>ce(null));if(B=ce(null),E(t,`tagNameCheck`)&&$t(t.tagNameCheck)&&(B.tagNameCheck=t.tagNameCheck),E(t,`attributeNameCheck`)&&$t(t.attributeNameCheck)&&(B.attributeNameCheck=t.attributeNameCheck),E(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(B.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),S(B),W&&(xt=!1),wt&&(Y=!0),jt&&(L=j({},Fe),R=ce(null),jt.html===!0&&(j(L,ke),j(R,Ie)),jt.svg===!0&&(j(L,Ae),j(R,Le),j(R,ze)),jt.svgFilters===!0&&(j(L,je),j(R,Le),j(R,ze)),jt.mathMl===!0&&(j(L,Ne),j(R,Re),j(R,ze))),V.tagCheck=null,V.attributeCheck=null,E(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?V.tagCheck=e.ADD_TAGS:he(e.ADD_TAGS)&&(L===_t&&(L=M(L)),j(L,e.ADD_TAGS,Z))),E(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?V.attributeCheck=e.ADD_ATTR:he(e.ADD_ATTR)&&(R===z&&(R=M(R)),j(R,e.ADD_ATTR,Z))),E(e,`ADD_FORBID_CONTENTS`)&&he(e.ADD_FORBID_CONTENTS)&&(Mt===Nt&&(Mt=M(Mt)),j(Mt,e.ADD_FORBID_CONTENTS,Z)),kt&&(L[`#text`]=!0),K&&j(L,[`html`,`head`,`body`]),L.table&&(j(L,[`tbody`]),delete vt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw k(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw k(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=y;y=e.TRUSTED_TYPES_POLICY;try{b=T(``)}catch(e){throw y=t,e}}else e.TRUSTED_TYPES_POLICY===null?(y=void 0,b=``):(y===void 0&&(y=Ce()),y&&typeof b==`string`&&(b=T(``)));x&&x(e),Zt=e},tn=j({},[...Ae,...je,...Me]),nn=j({},[...Ne,...Pe]),rn=function(e,t,n){return t.namespaceURI===X?e===`svg`:t.namespaceURI===Rt?e===`svg`&&(n===`annotation-xml`||Gt[n]):!!tn[e]},an=function(e,t,n){return t.namespaceURI===X?e===`math`:t.namespaceURI===zt?e===`math`&&qt[n]:!!nn[e]},on=function(e,t,n){return t.namespaceURI===zt&&!qt[n]||t.namespaceURI===Rt&&!Gt[n]?!1:!nn[e]&&(Jt[e]||!tn[e])},sn=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:Bt,tagName:`template`});let n=ge(e.tagName),r=ge(t.tagName);return Ht[e.namespaceURI]?e.namespaceURI===zt?rn(n,t,r):e.namespaceURI===Rt?an(n,t,r):e.namespaceURI===X?on(n,t,r):!!(Yt===`application/xhtml+xml`&&Ht[e.namespaceURI]):!1},Q=function(e){pe(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw k(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},cn=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},ln=function(e){fn(e);let t=m(e);if(t){let e=[];w(t,t=>{pe(e,t)}),w(e,e=>{try{p(e)}catch{}})}let n=re(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&cn(e,r,i)}},un=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}pe(t.removed,{attribute:r||null,from:n});try{r?ee(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Y||wt)try{Q(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},dn=function(e){let t=re(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||R[Z(i)]||cn(e,r,i)}},fn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();v(e)===P.element&&dn(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},pn=function(e,t){return G?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},mn=function(e){if(!G)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=v(e);if(n===P.processingInstruction||n===P.comment&&O(Ze,e.data)){try{p(e)}catch{}continue}if(n===P.element){let t=e,n=Z(oe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&pn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},hn=function(e){let t=null,r=null;if(Ct)e=`<remove></remove>`+e;else{let t=ve(e,/^[\r\n\t ]+/);r=t&&t[0]}Yt===`application/xhtml+xml`&&Bt===X&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?T(e):e;if(Bt===X)try{t=new l().parseFromString(i,Yt)}catch{}if(!t||!t.documentElement){t=D.createDocument(Bt,`template`,null);try{t.documentElement.innerHTML=Vt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Bt===X?Ee.call(t,K?`html`:`body`)[0]:K?t.documentElement:a},gn=function(e){let t=ie?ie(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_n=function(e){return e=ye(e,ct,` `),e=ye(e,lt,` `),e=ye(e,ut,` `),e},vn=function(e){e.normalize();let t=ie?ie(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=_n(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&w(i,e=>{bn(e.content)&&vn(e.content)})},yn=function(e){let t=_?_(e):null;return typeof t!=`string`||Z(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==re(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==g(e)||e.childNodes!==m(e)},bn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===P.documentFragment}catch{return!1}},xn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&w(e,e=>{e.call(t,n,r,Zt)})}let Sn=function(e,t){return!!(G&&e.hasChildNodes()&&!xn(e.firstElementChild)&&O(Xe,e.textContent)&&O(Xe,e.innerHTML)||G&&e.namespaceURI===X&&tt[t]&&(xn(e.firstElementChild)||typeof e.textContent==`string`&&O(nt[t],e.textContent))||e.nodeType===P.processingInstruction||G&&e.nodeType===P.comment&&O(Ze,e.data))},Cn=function(e,t){return e instanceof RegExp?O(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},wn=function(e,t,n){if(!vt[t]&&An(t)&&Cn(B.tagNameCheck,t))return!1;if(kt&&!Mt[t]){let t=h(e),r=m(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return Q(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?M(t):t},En=function(e,t){return e===t||h(e)!==null?!1:(At&&fn(e),!0)},Dn=function(e,n){if($(I.beforeSanitizeElements,e,null),En(e,n))return!0;if(yn(e))return Q(e),!0;let r=Z(oe(e));if(L=Tn(I.uponSanitizeElement,L,_t,St),$(I.uponSanitizeElement,e,{tagName:r,allowedTags:L}),En(e,n))return!0;if(Sn(e,r))return Q(e),!0;if(vt[r]||!(V.tagCheck instanceof Function&&V.tagCheck(r))&&!L[r]){let t=wn(e,r,n);return t===!1&&($(I.afterSanitizeElements,e,null),En(e,n))?!0:t}if(v(e)===P.element&&!sn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&O(Qe,e.innerHTML))return Q(e),!0;if(W&&e.nodeType===P.text){let n=_n(e.textContent);e.textContent!==n&&(pe(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(I.afterSanitizeElements,e,null),En(e,n)},On=function(e,t,r){if(yt[t]||pn(t,e)||Et&&(t===`id`||t===`name`)&&(r in n||r in Qt))return!1;let i=R[t]||V.attributeCheck instanceof Function&&V.attributeCheck(t,e);return xt&&O(dt,t)||bt&&O(ft,t)?!0:i?It[t]||O(gt,ye(r,mt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&be(r,`data:`)===0&&Pt[e]||H&&!O(pt,ye(r,mt,``))?!0:!r:An(e)&&Cn(B.tagNameCheck,e)&&Cn(B.attributeNameCheck,t,e)||t===`is`&&B.allowCustomizedBuiltInElements&&Cn(B.tagNameCheck,r)},kn=j({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[ge(e)]&&O(ht,e)},jn=function(e,t,n,r){if(y&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return T(r);case`TrustedScriptURL`:return Se(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!yn(e)||(Q(e),!1)}catch{return un(t,e),!1}},Nn=function(e,n){if($(I.beforeSanitizeAttributes,e,null),En(e,n))return;let r=e.attributes;if(!r||yn(e))return;R=Tn(I.uponSanitizeAttribute,R,z,J);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},a=r.length,o=Z(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Z(s),d=l,f=s===`value`?d:xe(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(I.uponSanitizeAttribute,e,i),f=i.attrValue,Dt&&(u===`id`||u===`name`)&&be(f,Ot)!==0&&(un(s,e,n),f=Ot+f,p=!0),G&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){un(s,e,n);continue}if(u===`attributename`&&ve(f,`href`)){un(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){un(s,e,n);continue}if(!U&&O($e,f)){un(s,e,n);continue}if(W&&(f=_n(f)),!On(o,u,f)){un(s,e,n);continue}f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&fe(t.removed)}}$(I.afterSanitizeAttributes,e,null),En(e,n)},Pn=function(e){let t=null,n=gn(e);for($(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(I.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t,e),bn(t.content)&&Pn(t.content),v(t)===P.element){let e=ne(t);bn(e)&&(Fn(e),Pn(e))}$(I.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=v(n)===P.element,i=m(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=_?_(n):null;if(typeof e==`string`&&Z(e)===`template`){let e=n.content;bn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ne(n);bn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Vt=!e,Vt&&(e=`<!-->`),typeof e!=`string`&&!xn(e)&&(e=De(e),typeof e!=`string`))throw k(`dirty is not a string, aborting`);if(!t.isSupported)return e;q?(L=St,R=J):en(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(L=M(L)),I.uponSanitizeAttribute.length>0&&(R=M(R)),t.removed=[];let c=At&&typeof e!=`string`&&xn(e);if(c){mn(e);let t=oe(e);if(typeof t==`string`){let n=Z(t);if(!L[n]||vt[n])throw ln(e),k(`root node is forbidden and cannot be sanitized in-place`)}if(yn(e))throw ln(e),k(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw ln(e),t}}else if(xn(e))i=hn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===P.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!Y&&!W&&!K&&e.indexOf(`<`)===-1)return y&&Tt?T(e):e;if(i=hn(e),!i)return Y?null:Tt?b:``}i&&Ct&&Q(i.firstChild);let l=c?e:i;try{let e=gn(l);for(;o=e.nextNode();)Dn(o,l),Nn(o,l),bn(o.content)&&Pn(o.content)}catch(n){throw c&&(ln(e),w(t.removed,e=>{e.element&&fn(e.element)})),n}if(c){let n=!1;if(w(t.removed,t=>{t.element&&(t.element===e&&(n=!0),fn(t.element))}),n)throw k(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return W&&vn(e),e}if(Y){if(W&&vn(i),wt)for(s=Te.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=et.call(r,s,!0)),s}let u=K?i.outerHTML:i.innerHTML;return K&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&O(Je,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
- `+u),W&&(u=_n(u)),y&&Tt?T(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};en(e),q=!0,St=L,J=R},t.clearConfig=function(){Zt=null,q=!1,St=null,J=null,y=se,b=``},t.isValidAttribute=function(e,t,n){Zt||en({});let r=Z(e),i=Z(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&E(I,e)&&pe(I[e],t)},t.removeHook=function(e,t){if(E(I,e)){if(t!==void 0){let n=de(I[e],t);return n===-1?void 0:me(I[e],n,1)[0]}return fe(I[e])}},t.removeHooks=function(e){E(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=at()},t}var I=st();function ct(e){return I.sanitize(e,{USE_PROFILES:{html:!0}})}function lt(e,t){let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`a[href]`).forEach(e=>{let n=e.getAttribute(`href`)??``,r=n.startsWith(`/uploads/`)?te(n,t):n;r!==n&&e.setAttribute(`href`,r),ut(r)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}),n.querySelectorAll(`img[src]`).forEach(e=>{let n=e.getAttribute(`src`)??``;n.startsWith(`/uploads/`)&&e.setAttribute(`src`,te(n,t))}),n.body.innerHTML}function ut(e){if(!/^https?:\/\//i.test(e))return!1;try{return new URL(e).origin!==window.location.origin}catch{return!1}}function dt(e,t){let r=lt(ct(e??``),t);return n`${c(r)}`}function ft(e,t){if(!e||!e.url)return null;let n;if(e.formats){n={};for(let[r,i]of Object.entries(e.formats))i?.url&&(n[r]={url:te(i.url,t),width:i.width,height:i.height})}return{url:te(e.url,t),alternativeText:e.alternativeText??null,mime:e.mime,name:e.name,width:e.width,height:e.height,formats:n}}var pt=e=>e===`text`||e===`accordion`||e===`video_card`||e===`document_card`?e:void 0;function mt(e){return{documentId:e.documentId??``,code:e.code??``,name:e.name??``,icon:e.icon}}function ht(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,subtitle:e.subtitle,icon:e.icon,image:ft(e.image,t),behavior:pt(e.behavior),order:e.order,showSortBy:e.showSortBy??!1,showFilterByTopic:e.showFilterByTopic??!1}}function gt(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,abstract:e.abstract,body:dt(e.text,t),behavior:pt(e.behavior),featured:e.featured??!1,duration:e.duration,dateAdded:e.dateAdded,publishedAt:e.publishedAt??null,topics:(e.topics??[]).map(mt),category:e.category?ht(e.category,t):null,thumbnail:ft(e.thumbnail,t),video:ft(e.video,t),documents:(e.documents??[]).map(e=>ft(e,t)).filter(e=>e!==null)}}function L(e,t){return e?{heading:e.heading??``,description:e.description??``,backgroundImage:ft(e.backgroundImage,t)}:null}var _t=class extends Error{constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause}),this.name=`KbApiError`,this.status=t?.status}},R=`whats-new`,z=100,B={thumbnail:!0,video:!0,documents:!0,topics:!0,category:!0};function vt(e){let t=e.apiBaseUrl.replace(/\/+$/,``),n=e.mediaBaseUrl,r=e.previewDrafts?`draft`:`published`,i=e.locale,a=e.fetch??globalThis.fetch.bind(globalThis);async function o(e,n){let o=ee({...n,status:r,locale:i}),s=`${t}/api/${e}${o}`,c;try{c=await a(s)}catch(t){throw new _t(`Network error fetching ${e}`,{cause:t})}if(!c.ok)throw new _t(`Strapi responded ${c.status} for ${e}`,{status:c.status});let l;try{l=await c.json()}catch(t){throw new _t(`Invalid JSON from ${e}`,{cause:t})}return l.data}async function s(e,t){return await o(e,t)??[]}return{async getLanding(){let[e,t,r,i,a]=await Promise.all([o(`index-page`,{populate:{backgroundImage:!0}}),s(`categories`,{populate:{image:!0},sort:[`order:asc`],pagination:{pageSize:z}}),s(`topics`,{sort:[`order:asc`],pagination:{pageSize:z}}),s(`posts`,{filters:{featured:{$eq:!0}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}}),s(`posts`,{filters:{category:{uid:{$eq:R}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{indexPage:L(e,n),categories:t.map(e=>ht(e,n)),topics:r.map(e=>mt(e)),featured:i.map(e=>gt(e,n)),whatsNew:a.map(e=>gt(e,n))}},async getCategory(e){let[t,r]=await Promise.all([s(`categories`,{filters:{uid:{$eq:e}},populate:{image:!0},pagination:{pageSize:1}}),s(`posts`,{filters:{category:{uid:{$eq:e}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{category:t[0]?ht(t[0],n):null,posts:r.map(e=>gt(e,n))}},async getTopic(e){let[t,r]=await Promise.all([s(`topics`,{filters:{code:{$eq:e}},pagination:{pageSize:1}}),s(`posts`,{filters:{topics:{code:{$eq:e}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{topic:t[0]?mt(t[0]):null,posts:r.map(e=>gt(e,n))}},async getPost(e){let t=await s(`posts`,{filters:{uid:{$eq:e}},populate:B,pagination:{pageSize:1}});return t[0]?gt(t[0],n):null}}}function yt(e){let t=new Map;function n(e,n){let r=t.get(e);if(r)return r;let i=n().catch(n=>{throw t.delete(e),n});return t.set(e,i),i}return{getLanding:()=>n(`landing`,()=>e.getLanding()),getCategory:t=>n(`category:${t}`,()=>e.getCategory(t)),getTopic:t=>n(`topic:${t}`,()=>e.getTopic(t)),getPost:t=>n(`post:${t}`,()=>e.getPost(t)),invalidate:e=>{e?t.delete(e):t.clear()}}}function V(){let e=window.gpConfig?.[`ui-knowledgebase`],t=e?.[`KB:strapiBaseUrl`];if(!t)throw Error(`ui-knowledgebase config not loaded: window.gpConfig['ui-knowledgebase']['KB:strapiBaseUrl'] is missing. Ensure config.json is fetched before the KB route renders.`);return{apiBaseUrl:t,mediaBaseUrl:t,previewDrafts:e?.[`KB:previewDraftContent`]??!1,locale:`en`}}var bt;function xt(){return bt||=yt(vt(V())),bt}function H(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var U=class extends e{constructor(...e){super(...e),this.loading=!0,this.error=!1,this.data=null}static{this.styles=t`
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(e,t){return ne(e)||re(e,t)||ie(e,t)||g()}function ie(e,t){if(e){if(typeof e==`string`)return h(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function v(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof m;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}v.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},v.prototype.next=function(e){return this._invoke(`next`,e)},v.prototype.throw=function(e){return this._invoke(`throw`,e)},v.prototype.return=function(e){return this._invoke(`return`,e)};var ae=Object.entries,oe=Object.setPrototypeOf,y=Object.isFrozen,b=Object.getPrototypeOf,se=Object.getOwnPropertyDescriptor,x=Object.freeze,S=Object.seal,ce=Object.create,le=typeof Reflect<`u`&&Reflect,C=le.apply,ue=le.construct;x||=function(e){return e},S||=function(e){return e},C||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ue||=function(e){return new e(...[...arguments].slice(1))};var de=k(Array.prototype.forEach);Array.prototype.indexOf;var fe=k(Array.prototype.lastIndexOf),pe=k(Array.prototype.pop),me=k(Array.prototype.push);Array.prototype.slice;var he=k(Array.prototype.splice),ge=Array.isArray,_e=k(String.prototype.toLowerCase),ve=k(String.prototype.toString),ye=k(String.prototype.match),be=k(String.prototype.replace),xe=k(String.prototype.indexOf),Se=k(String.prototype.trim),w=k(Number.prototype.toString),Ce=k(Boolean.prototype.toString),we=typeof BigInt>`u`?null:k(BigInt.prototype.toString),Te=typeof Symbol>`u`?null:k(Symbol.prototype.toString),T=k(Object.prototype.hasOwnProperty),E=k(Object.prototype.toString),D=k(RegExp.prototype.test),O=Ee(TypeError);function k(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return C(e,t,n)}}function Ee(e){return function(){return ue(e,[...arguments])}}function A(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_e;if(oe&&oe(e,null),!ge(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(y(t)||(t[r]=e),i=e)}e[i]=!0}return e}function De(e){for(let t=0;t<e.length;t++)T(e,t)||(e[t]=null);return e}function j(e){let t=ce(null);for(let r of ae(e)){var n=_(r,2);let i=n[0],a=n[1];T(e,i)&&(t[i]=ge(a)?De(a):a&&typeof a==`object`&&a.constructor===Object?j(a):a)}return t}function Oe(e){switch(typeof e){case`string`:return e;case`number`:return w(e);case`boolean`:return Ce(e);case`bigint`:return we?we(e):`0`;case`symbol`:return Te?Te(e):`Symbol()`;case`undefined`:return E(e);case`function`:case`object`:{if(e===null)return E(e);let t=e,n=M(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:E(e)}return E(e)}default:return E(e)}}function M(e,t){for(;e!==null;){let n=se(e,t);if(n){if(n.get)return k(n.get);if(typeof n.value==`function`)return k(n.value)}e=b(e)}function n(){return null}return n}function ke(e){try{return D(e,``),!0}catch{return!1}}var Ae=x(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),je=x(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Me=x([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ne=x([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Pe=x(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Fe=x([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ie=x([`#text`]),Le=x(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Re=x(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),ze=x(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Be=x([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ve=S(/{{[\w\W]*|^[\w\W]*}}/g),He=S(/<%[\w\W]*|^[\w\W]*%>/g),Ue=S(/\${[\w\W]*/g),We=S(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ge=S(/^aria-[\-\w]+$/),Ke=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qe=S(/^(?:\w+script|data):/i),Je=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ye=S(/^html$/i),Xe=S(/^[a-z][.\w]*(-[.\w]+)+$/i),Ze=S(/<[/\w!]/g),Qe=S(/<[/\w]/g),$e=S(/<\/no(script|embed|frames)/i),et=S(/\/>/i),N={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},tt=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],nt=x(A({},tt)),rt=function(){let e={};return de(tt,t=>{e[t]=S(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),x(e)}(),it=function(){return typeof window>`u`?null:window},at=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ot=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},P=function(e,t,n,r){return T(e,t)&&ge(e[t])?A(r.base?j(r.base):{},e[t],r.transform):n},st=function(e,t,n){let r=T(e,t)?e[t]:void 0;return r&&typeof r==`object`?j(r):n()};function ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:it(),t=e=>ct(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==N.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=M(d,`cloneNode`),p=M(d,`remove`),ee=M(d,`removeAttributeNode`),te=M(d,`nextSibling`),m=M(d,`childNodes`),h=M(d,`parentNode`),ne=M(d,`shadowRoot`),re=M(d,`attributes`),g=o&&o.prototype?M(o.prototype,`nodeType`):null,_=o&&o.prototype?M(o.prototype,`nodeName`):null,ie=o&&o.prototype?M(o.prototype,`ownerDocument`):null,v=function(e){return g?g(e):e.nodeType},oe=function(e){return _?_(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,se,le=!1,C=0,ue=function(){if(C>0)throw O(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},w=function(e){ue(),C++;try{return y.createHTML(e)}finally{C--}},Ce=function(e){ue(),C++;try{return y.createScriptURL(e)}finally{C--}},we=function(){return le||=(se=at(u,i),!0),se},Te=n,E=Te.implementation,k=Te.createNodeIterator,Ee=Te.createDocumentFragment,De=Te.getElementsByTagName,tt=r.importNode,F=ot();t.isSupported=typeof ae==`function`&&typeof h==`function`&&E&&E.createHTMLDocument!==void 0;let lt=Ve,ut=He,dt=Ue,ft=We,pt=Ge,mt=qe,ht=Je,gt=Xe,I=Ke,L=null,_t=A({},[...Ae,...je,...Me,...Pe,...Ie]),R=null,vt=A({},[...Le,...Re,...ze,...Be]),z=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,yt=null,V=Object.seal(ce(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),bt=!0,xt=!0,St=!1,H=!0,U=!1,W=!0,G=!1,Ct=!1,K=null,wt=null,q=!1,J=!1,Y=!1,Tt=!1,Et=!0,Dt=!1,Ot=`user-content-`,kt=!0,At=!1,jt={},Mt=null,Nt=A({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Pt=null,Ft=A({},[`audio`,`video`,`img`,`source`,`image`,`track`]),It=null,Lt=A({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Rt=`http://www.w3.org/1998/Math/MathML`,zt=`http://www.w3.org/2000/svg`,X=`http://www.w3.org/1999/xhtml`,Bt=X,Vt=!1,Ht=null,Ut=A({},[Rt,zt,X],ve),Wt=x([`mi`,`mo`,`mn`,`ms`,`mtext`]),Gt=A({},Wt),Kt=x([`annotation-xml`]),qt=A({},Kt),Jt=A({},[`title`,`style`,`font`,`a`,`script`]),Yt=null,Xt=[`application/xhtml+xml`,`text/html`],Z=null,Zt=null,Qt=n.createElement(`form`),$t=function(e){return e instanceof RegExp||e instanceof Function},en=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Zt&&Zt===e)return;(!e||typeof e!=`object`)&&(e={}),e=j(e),Yt=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Z=Yt===`application/xhtml+xml`?ve:_e,L=P(e,`ALLOWED_TAGS`,_t,{transform:Z}),R=P(e,`ALLOWED_ATTR`,vt,{transform:Z}),Ht=P(e,`ALLOWED_NAMESPACES`,Ut,{transform:ve}),It=P(e,`ADD_URI_SAFE_ATTR`,Lt,{transform:Z,base:Lt}),Pt=P(e,`ADD_DATA_URI_TAGS`,Ft,{transform:Z,base:Ft}),Mt=P(e,`FORBID_CONTENTS`,Nt,{transform:Z}),B=P(e,`FORBID_TAGS`,j({}),{transform:Z}),yt=P(e,`FORBID_ATTR`,j({}),{transform:Z}),jt=T(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?j(e.USE_PROFILES):e.USE_PROFILES:!1,bt=e.ALLOW_ARIA_ATTR!==!1,xt=e.ALLOW_DATA_ATTR!==!1,St=e.ALLOW_UNKNOWN_PROTOCOLS||!1,H=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,U=e.SAFE_FOR_TEMPLATES||!1,W=e.SAFE_FOR_XML!==!1,G=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Y=e.RETURN_DOM_FRAGMENT||!1,Tt=e.RETURN_TRUSTED_TYPE||!1,q=e.FORCE_BODY||!1,Et=e.SANITIZE_DOM!==!1,Dt=e.SANITIZE_NAMED_PROPS||!1,kt=e.KEEP_CONTENT!==!1,At=e.IN_PLACE||!1,I=ke(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ke,Bt=typeof e.NAMESPACE==`string`?e.NAMESPACE:X,Gt=st(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>A({},Wt)),qt=st(e,`HTML_INTEGRATION_POINTS`,()=>A({},Kt));let t=st(e,`CUSTOM_ELEMENT_HANDLING`,()=>ce(null));if(z=ce(null),T(t,`tagNameCheck`)&&$t(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),T(t,`attributeNameCheck`)&&$t(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),T(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),S(z),U&&(xt=!1),Y&&(J=!0),jt&&(L=A({},Ie),R=ce(null),jt.html===!0&&(A(L,Ae),A(R,Le)),jt.svg===!0&&(A(L,je),A(R,Re),A(R,Be)),jt.svgFilters===!0&&(A(L,Me),A(R,Re),A(R,Be)),jt.mathMl===!0&&(A(L,Pe),A(R,ze),A(R,Be))),V.tagCheck=null,V.attributeCheck=null,T(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?V.tagCheck=e.ADD_TAGS:ge(e.ADD_TAGS)&&(L===_t&&(L=j(L)),A(L,e.ADD_TAGS,Z))),T(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?V.attributeCheck=e.ADD_ATTR:ge(e.ADD_ATTR)&&(R===vt&&(R=j(R)),A(R,e.ADD_ATTR,Z))),T(e,`ADD_FORBID_CONTENTS`)&&ge(e.ADD_FORBID_CONTENTS)&&(Mt===Nt&&(Mt=j(Mt)),A(Mt,e.ADD_FORBID_CONTENTS,Z)),kt&&(L[`#text`]=!0),G&&A(L,[`html`,`head`,`body`]),L.table&&(A(L,[`tbody`]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw O(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw O(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=y;y=e.TRUSTED_TYPES_POLICY;try{b=w(``)}catch(e){throw y=t,e}}else e.TRUSTED_TYPES_POLICY===null?(y=void 0,b=``):(y===void 0&&(y=we()),y&&typeof b==`string`&&(b=w(``)));x&&x(e),Zt=e},tn=A({},[...je,...Me,...Ne]),nn=A({},[...Pe,...Fe]),rn=function(e,t,n){return t.namespaceURI===X?e===`svg`:t.namespaceURI===Rt?e===`svg`&&(n===`annotation-xml`||Gt[n]):!!tn[e]},an=function(e,t,n){return t.namespaceURI===X?e===`math`:t.namespaceURI===zt?e===`math`&&qt[n]:!!nn[e]},on=function(e,t,n){return t.namespaceURI===zt&&!qt[n]||t.namespaceURI===Rt&&!Gt[n]?!1:!nn[e]&&(Jt[e]||!tn[e])},sn=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:Bt,tagName:`template`});let n=_e(e.tagName),r=_e(t.tagName);return Ht[e.namespaceURI]?e.namespaceURI===zt?rn(n,t,r):e.namespaceURI===Rt?an(n,t,r):e.namespaceURI===X?on(n,t,r):!!(Yt===`application/xhtml+xml`&&Ht[e.namespaceURI]):!1},Q=function(e){me(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw O(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},cn=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},ln=function(e){fn(e);let t=m(e);if(t){let e=[];de(t,t=>{me(e,t)}),de(e,e=>{try{p(e)}catch{}})}let n=re(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&cn(e,r,i)}},un=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}me(t.removed,{attribute:r||null,from:n});try{r?ee(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(J||Y)try{Q(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},dn=function(e){let t=re(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||R[Z(i)]||cn(e,r,i)}},fn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();v(e)===N.element&&dn(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},pn=function(e,t){return W?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},mn=function(e){if(!W)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=v(e);if(n===N.processingInstruction||n===N.comment&&D(Qe,e.data)){try{p(e)}catch{}continue}if(n===N.element){let t=e,n=Z(oe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&pn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},hn=function(e){let t=null,r=null;if(q)e=`<remove></remove>`+e;else{let t=ye(e,/^[\r\n\t ]+/);r=t&&t[0]}Yt===`application/xhtml+xml`&&Bt===X&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?w(e):e;if(Bt===X)try{t=new l().parseFromString(i,Yt)}catch{}if(!t||!t.documentElement){t=E.createDocument(Bt,`template`,null);try{t.documentElement.innerHTML=Vt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Bt===X?De.call(t,G?`html`:`body`)[0]:G?t.documentElement:a},gn=function(e){let t=ie?ie(e):e.ownerDocument;return k.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_n=function(e){return e=be(e,lt,` `),e=be(e,ut,` `),e=be(e,dt,` `),e},vn=function(e){e.normalize();let t=ie?ie(e):e.ownerDocument,n=k.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=_n(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&de(i,e=>{bn(e.content)&&vn(e.content)})},yn=function(e){let t=_?_(e):null;return typeof t!=`string`||Z(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==re(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==g(e)||e.childNodes!==m(e)},bn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===N.documentFragment}catch{return!1}},xn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&de(e,e=>{e.call(t,n,r,Zt)})}let Sn=function(e,t){return!!(W&&e.hasChildNodes()&&!xn(e.firstElementChild)&&D(Ze,e.textContent)&&D(Ze,e.innerHTML)||W&&e.namespaceURI===X&&nt[t]&&(xn(e.firstElementChild)||typeof e.textContent==`string`&&D(rt[t],e.textContent))||e.nodeType===N.processingInstruction||W&&e.nodeType===N.comment&&D(Qe,e.data))},Cn=function(e,t){return e instanceof RegExp?D(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},wn=function(e,t,n){if(!B[t]&&An(t)&&Cn(z.tagNameCheck,t))return!1;if(kt&&!Mt[t]){let t=h(e),r=m(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return Q(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?j(t):t},En=function(e,t){return e===t||h(e)!==null?!1:(At&&fn(e),!0)},Dn=function(e,n){if($(F.beforeSanitizeElements,e,null),En(e,n))return!0;if(yn(e))return Q(e),!0;let r=Z(oe(e));if(L=Tn(F.uponSanitizeElement,L,_t,K),$(F.uponSanitizeElement,e,{tagName:r,allowedTags:L}),En(e,n))return!0;if(Sn(e,r))return Q(e),!0;if(B[r]||!(V.tagCheck instanceof Function&&V.tagCheck(r))&&!L[r]){let t=wn(e,r,n);return t===!1&&($(F.afterSanitizeElements,e,null),En(e,n))?!0:t}if(v(e)===N.element&&!sn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&D($e,e.innerHTML))return Q(e),!0;if(U&&e.nodeType===N.text){let n=_n(e.textContent);e.textContent!==n&&(me(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(F.afterSanitizeElements,e,null),En(e,n)},On=function(e,t,r){if(yt[t]||pn(t,e)||Et&&(t===`id`||t===`name`)&&(r in n||r in Qt))return!1;let i=R[t]||V.attributeCheck instanceof Function&&V.attributeCheck(t,e);return xt&&D(ft,t)||bt&&D(pt,t)?!0:i?It[t]||D(I,be(r,ht,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&xe(r,`data:`)===0&&Pt[e]||St&&!D(mt,be(r,ht,``))?!0:!r:An(e)&&Cn(z.tagNameCheck,e)&&Cn(z.attributeNameCheck,t,e)||t===`is`&&z.allowCustomizedBuiltInElements&&Cn(z.tagNameCheck,r)},kn=A({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[_e(e)]&&D(gt,e)},jn=function(e,t,n,r){if(y&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return w(r);case`TrustedScriptURL`:return Ce(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!yn(e)||(Q(e),!1)}catch{return un(t,e),!1}},Nn=function(e,n){if($(F.beforeSanitizeAttributes,e,null),En(e,n))return;let r=e.attributes;if(!r||yn(e))return;R=Tn(F.uponSanitizeAttribute,R,vt,wt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},a=r.length,o=Z(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Z(s),d=l,f=s===`value`?d:Se(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,i),f=i.attrValue,Dt&&(u===`id`||u===`name`)&&xe(f,Ot)!==0&&(un(s,e,n),f=Ot+f,p=!0),W&&D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){un(s,e,n);continue}if(u===`attributename`&&ye(f,`href`)){un(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){un(s,e,n);continue}if(!H&&D(et,f)){un(s,e,n);continue}if(U&&(f=_n(f)),!On(o,u,f)){un(s,e,n);continue}f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&pe(t.removed)}}$(F.afterSanitizeAttributes,e,null),En(e,n)},Pn=function(e){let t=null,n=gn(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t,e),bn(t.content)&&Pn(t.content),v(t)===N.element){let e=ne(t);bn(e)&&(Fn(e),Pn(e))}$(F.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=v(n)===N.element,i=m(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=_?_(n):null;if(typeof e==`string`&&Z(e)===`template`){let e=n.content;bn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ne(n);bn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Vt=!e,Vt&&(e=`<!-->`),typeof e!=`string`&&!xn(e)&&(e=Oe(e),typeof e!=`string`))throw O(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ct?(L=K,R=wt):en(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(L=j(L)),F.uponSanitizeAttribute.length>0&&(R=j(R)),t.removed=[];let c=At&&typeof e!=`string`&&xn(e);if(c){mn(e);let t=oe(e);if(typeof t==`string`){let n=Z(t);if(!L[n]||B[n])throw ln(e),O(`root node is forbidden and cannot be sanitized in-place`)}if(yn(e))throw ln(e),O(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw ln(e),t}}else if(xn(e))i=hn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===N.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!J&&!U&&!G&&e.indexOf(`<`)===-1)return y&&Tt?w(e):e;if(i=hn(e),!i)return J?null:Tt?b:``}i&&q&&Q(i.firstChild);let l=c?e:i;try{let e=gn(l);for(;o=e.nextNode();)Dn(o,l),Nn(o,l),bn(o.content)&&Pn(o.content)}catch(n){throw c&&(ln(e),de(t.removed,e=>{e.element&&fn(e.element)})),n}if(c){let n=!1;if(de(t.removed,t=>{t.element&&(t.element===e&&(n=!0),fn(t.element))}),n)throw O(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return U&&vn(e),e}if(J){if(U&&vn(i),Y)for(s=Ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=tt.call(r,s,!0)),s}let u=G?i.outerHTML:i.innerHTML;return G&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&D(Ye,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+u),U&&(u=_n(u)),y&&Tt?w(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};en(e),Ct=!0,K=L,wt=R},t.clearConfig=function(){Zt=null,Ct=!1,K=null,wt=null,y=se,b=``},t.isValidAttribute=function(e,t,n){Zt||en({});let r=Z(e),i=Z(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&T(F,e)&&me(F[e],t)},t.removeHook=function(e,t){if(T(F,e)){if(t!==void 0){let n=fe(F[e],t);return n===-1?void 0:he(F[e],n,1)[0]}return pe(F[e])}},t.removeHooks=function(e){T(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=ot()},t}var F=ct();function lt(e){return F.sanitize(e,{USE_PROFILES:{html:!0}})}function ut(e,t){let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`a[href]`).forEach(e=>{let n=e.getAttribute(`href`)??``,r=n.startsWith(`/uploads/`)?te(n,t):n;r!==n&&e.setAttribute(`href`,r),dt(r)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}),n.querySelectorAll(`img[src]`).forEach(e=>{let n=e.getAttribute(`src`)??``;n.startsWith(`/uploads/`)&&e.setAttribute(`src`,te(n,t))}),n.body.innerHTML}function dt(e){if(!/^https?:\/\//i.test(e))return!1;try{return new URL(e).origin!==window.location.origin}catch{return!1}}function ft(e,t){let r=ut(lt(e??``),t);return n`${c(r)}`}function pt(e,t){if(!e||!e.url)return null;let n;if(e.formats){n={};for(let[r,i]of Object.entries(e.formats))i?.url&&(n[r]={url:te(i.url,t),width:i.width,height:i.height})}return{url:te(e.url,t),alternativeText:e.alternativeText??null,mime:e.mime,name:e.name,width:e.width,height:e.height,formats:n}}var mt=e=>e===`text`||e===`accordion`||e===`video_card`||e===`document_card`?e:void 0;function ht(e){return{documentId:e.documentId??``,code:e.code??``,name:e.name??``,icon:e.icon}}function gt(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,subtitle:e.subtitle,icon:e.icon,image:pt(e.image,t),behavior:mt(e.behavior),order:e.order,showSortBy:e.showSortBy??!1,showFilterByTopic:e.showFilterByTopic??!1}}function I(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,abstract:e.abstract,body:ft(e.text,t),behavior:mt(e.behavior),featured:e.featured??!1,duration:e.duration,dateAdded:e.dateAdded,publishedAt:e.publishedAt??null,topics:(e.topics??[]).map(ht),category:e.category?gt(e.category,t):null,thumbnail:pt(e.thumbnail,t),video:pt(e.video,t),documents:(e.documents??[]).map(e=>pt(e,t)).filter(e=>e!==null)}}function L(e,t){return e?{heading:e.heading??``,description:e.description??``,backgroundImage:pt(e.backgroundImage,t)}:null}var _t=class extends Error{constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause}),this.name=`KbApiError`,this.status=t?.status}};function R(e){return!e.uid||!e.title?null:{uid:e.uid,title:e.title,categoryUid:e.category?.uid??``,categoryIcon:e.category?.icon}}var vt=`whats-new`,z=100,B={thumbnail:!0,video:!0,documents:!0,topics:!0,category:!0};function yt(e){let t=e.apiBaseUrl.replace(/\/+$/,``),n=e.mediaBaseUrl,r=e.previewDrafts?`draft`:`published`,i=e.locale,a=e.fetch??globalThis.fetch.bind(globalThis);async function o(e,n){let o=ee({...n,status:r,locale:i}),s=`${t}/api/${e}${o}`,c;try{c=await a(s)}catch(t){throw new _t(`Network error fetching ${e}`,{cause:t})}if(!c.ok)throw new _t(`Strapi responded ${c.status} for ${e}`,{status:c.status});let l;try{l=await c.json()}catch(t){throw new _t(`Invalid JSON from ${e}`,{cause:t})}return l.data}async function s(e,t){return await o(e,t)??[]}return{async getLanding(){let[e,t,r,i,a]=await Promise.all([o(`index-page`,{populate:{backgroundImage:!0}}),s(`categories`,{populate:{image:!0},sort:[`order:asc`],pagination:{pageSize:z}}),s(`topics`,{sort:[`order:asc`],pagination:{pageSize:z}}),s(`posts`,{filters:{featured:{$eq:!0}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}}),s(`posts`,{filters:{category:{uid:{$eq:vt}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{indexPage:L(e,n),categories:t.map(e=>gt(e,n)),topics:r.map(e=>ht(e)),featured:i.map(e=>I(e,n)),whatsNew:a.map(e=>I(e,n))}},async getCategory(e){let[t,r]=await Promise.all([s(`categories`,{filters:{uid:{$eq:e}},populate:{image:!0},pagination:{pageSize:1}}),s(`posts`,{filters:{category:{uid:{$eq:e}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{category:t[0]?gt(t[0],n):null,posts:r.map(e=>I(e,n))}},async getTopic(e){let[t,r]=await Promise.all([s(`topics`,{filters:{code:{$eq:e}},pagination:{pageSize:1}}),s(`posts`,{filters:{topics:{code:{$eq:e}}},populate:B,sort:[`dateAdded:desc`],pagination:{pageSize:z}})]);return{topic:t[0]?ht(t[0]):null,posts:r.map(e=>I(e,n))}},async getPost(e){let t=await s(`posts`,{filters:{uid:{$eq:e}},populate:B,pagination:{pageSize:1}});return t[0]?I(t[0],n):null},async getPostLinks(e){let t={};return e?.categoryUid&&(t.category={uid:{$eq:e.categoryUid}}),e?.topicCode&&(t.topics={code:{$eq:e.topicCode}}),(await s(`posts`,{fields:[`uid`,`title`],populate:{category:{fields:[`uid`,`icon`]}},filters:Object.keys(t).length?t:void 0,sort:[`title:asc`],pagination:{pageSize:z}})).map(R).filter(e=>e!==null)}}}function V(e){let t=new Map;function n(e,n){let r=t.get(e);if(r)return r;let i=n().catch(n=>{throw t.delete(e),n});return t.set(e,i),i}return{getLanding:()=>n(`landing`,()=>e.getLanding()),getCategory:t=>n(`category:${t}`,()=>e.getCategory(t)),getTopic:t=>n(`topic:${t}`,()=>e.getTopic(t)),getPost:t=>n(`post:${t}`,()=>e.getPost(t)),getPostLinks:t=>n(`postlinks:${t?.categoryUid??``}:${t?.topicCode??``}`,()=>e.getPostLinks(t)),invalidate:e=>{e?t.delete(e):t.clear()}}}function bt(){let e=window.gpConfig?.[`ui-knowledgebase`],t=e?.[`KB:strapiBaseUrl`];if(!t)throw Error(`ui-knowledgebase config not loaded: window.gpConfig['ui-knowledgebase']['KB:strapiBaseUrl'] is missing. Ensure config.json is fetched before the KB route renders.`);return{apiBaseUrl:t,mediaBaseUrl:t,previewDrafts:e?.[`KB:previewDraftContent`]??!1,locale:`en`}}var xt;function St(){return xt||=V(yt(bt())),xt}function H(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var U=class extends e{constructor(...e){super(...e),this.loading=!0,this.error=!1,this.data=null}static{this.styles=t`
4
4
  :host {
5
5
  display: block;
6
6
  padding: 1rem;
@@ -18,7 +18,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
18
18
  button {
19
19
  cursor: pointer;
20
20
  }
21
- `}connectedCallback(){super.connectedCallback(),this.load()}async load(){this.loading=!0,this.error=!1;try{this.data=await xt().getLanding()}catch{this.error=!0}finally{this.loading=!1}}render(){if(this.loading)return n`<p class="muted">Loading…</p>`;if(this.error||!this.data)return n`
21
+ `}connectedCallback(){super.connectedCallback(),this.load()}async load(){this.loading=!0,this.error=!1;try{this.data=await St().getLanding()}catch{this.error=!0}finally{this.loading=!1}}render(){if(this.loading)return n`<p class="muted">Loading…</p>`;if(this.error||!this.data)return n`
22
22
  <p role="alert">Couldn't load the Knowledge Base.</p>
23
23
  <button @click=${()=>void this.load()}>Retry</button>
24
24
  `;let{indexPage:e,categories:t,topics:i,featured:a,whatsNew:o}=this.data;return n`
@@ -32,7 +32,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
32
32
  <ul>
33
33
  ${t.map(e=>n`
34
34
  <li>
35
- <a href="${q}/category/${e.uid}">${e.title}</a>
35
+ <a href="${K}/category/${e.uid}">${e.title}</a>
36
36
  ${e.subtitle?n`<span class="muted"> — ${e.subtitle}</span>`:r}
37
37
  </li>
38
38
  `)}
@@ -42,7 +42,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
42
42
  <section>
43
43
  <h2>Topics</h2>
44
44
  <ul>
45
- ${i.map(e=>n`<li><a href="${q}/topic/${e.code}">${e.name}</a></li>`)}
45
+ ${i.map(e=>n`<li><a href="${K}/topic/${e.code}">${e.name}</a></li>`)}
46
46
  </ul>
47
47
  </section>
48
48
 
@@ -59,7 +59,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
59
59
  <ul>
60
60
  ${e.map(e=>n`
61
61
  <li>
62
- <a href="${q}/details/${e.uid}">${e.title}</a>
62
+ <a href="${K}/details/${e.uid}">${e.title}</a>
63
63
  ${e.abstract?n`<span class="muted"> — ${e.abstract}</span>`:r}
64
64
  </li>
65
65
  `)}
@@ -80,7 +80,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
80
80
  `}onAfterEnter(e){this.code=String(e.params.code??``)}render(){return n`
81
81
  <a href="/knowledge-base">&larr; Knowledge Base</a>
82
82
  <h1>Topic: ${this.code}</h1>
83
- `}};H([o()],G.prototype,`code`,void 0),G=H([i(`kb-topic-view`)],G);var K=class extends e{constructor(...e){super(...e),this.uid=``}static{this.styles=t`
83
+ `}};H([o()],G.prototype,`code`,void 0),G=H([i(`kb-topic-view`)],G);var Ct=class extends e{constructor(...e){super(...e),this.uid=``}static{this.styles=t`
84
84
  :host {
85
85
  display: block;
86
86
  padding: 1rem;
@@ -88,4 +88,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
88
88
  `}onAfterEnter(e){this.uid=String(e.params.uid??``)}render(){return n`
89
89
  <a href="/knowledge-base">&larr; Knowledge Base</a>
90
90
  <h1>Details: ${this.uid}</h1>
91
- `}};H([o()],K.prototype,`uid`,void 0),K=H([i(`kb-details-view`)],K);var q=`/knowledge-base`,St=e=>e===`/knowledge-base`||e.startsWith(`/knowledge-base/`),J={Landing:`kb-landing`,Category:`kb-category`,Topic:`kb-topic`,Details:`kb-details`},Ct=[{path:q,children:[{name:J.Landing,path:`/`,component:`kb-landing-view`},{name:J.Category,path:`/category/:uid`,component:`kb-category-view`},{name:J.Topic,path:`/topic/:code`,component:`kb-topic-view`},{name:J.Details,path:`/details/:uid`,component:`kb-details-view`}]},{path:`(.*)`,component:`no-elem`}],Y=class extends e{constructor(...e){super(...e),this.baseUrl=`/`,this.active=!1,this.outlet=document.createElement(`main`),this.onLocationChanged=e=>{let{router:t,location:n}=e.detail;t===d()&&(this.active=St(n.pathname))}}connectedCallback(){super.connectedCallback(),window.addEventListener(`vaadin-router-location-changed`,this.onLocationChanged),u(this.outlet,this.baseUrl,Ct),this.dispatchEvent(new CustomEvent(`mfe-loaded`,{detail:{routes:Ct}}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`vaadin-router-location-changed`,this.onLocationChanged),f(),this.active=!1}render(){return this.active?n`${this.outlet}`:r}};H([a({type:String})],Y.prototype,`baseUrl`,void 0),H([o()],Y.prototype,`active`,void 0),Y=H([i(`ui-knowledgebase`)],Y);export{Y as UiKnowledgebase};
91
+ `}};H([o()],Ct.prototype,`uid`,void 0),Ct=H([i(`kb-details-view`)],Ct);var K=`/knowledge-base`,wt=e=>e===`/knowledge-base`||e.startsWith(`/knowledge-base/`),q={Landing:`kb-landing`,Category:`kb-category`,Topic:`kb-topic`,Details:`kb-details`},J=[{path:K,children:[{name:q.Landing,path:`/`,component:`kb-landing-view`},{name:q.Category,path:`/category/:uid`,component:`kb-category-view`},{name:q.Topic,path:`/topic/:code`,component:`kb-topic-view`},{name:q.Details,path:`/details/:uid`,component:`kb-details-view`}]},{path:`(.*)`,component:`no-elem`}],Y=class extends e{constructor(...e){super(...e),this.baseUrl=`/`,this.active=!1,this.outlet=document.createElement(`main`),this.onLocationChanged=e=>{let{router:t,location:n}=e.detail;t===d()&&(this.active=wt(n.pathname))}}connectedCallback(){super.connectedCallback(),window.addEventListener(`vaadin-router-location-changed`,this.onLocationChanged),u(this.outlet,this.baseUrl,J),this.dispatchEvent(new CustomEvent(`mfe-loaded`,{detail:{routes:J}}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`vaadin-router-location-changed`,this.onLocationChanged),f(),this.active=!1}render(){return this.active?n`${this.outlet}`:r}};H([a({type:String})],Y.prototype,`baseUrl`,void 0),H([o()],Y.prototype,`active`,void 0),Y=H([i(`ui-knowledgebase`)],Y);export{Y as UiKnowledgebase};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-realty/ui-knowledgebase",
3
- "version": "0.1.3",
3
+ "version": "0.1.4-IXUAT-11250.561389",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"