@luzmo/analytics-components-kit 1.0.1-alpha.135 → 1.0.1-alpha.136

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.
@@ -0,0 +1,43 @@
1
+ export interface ChatMessage {
2
+ id?: string;
3
+ type: 'user' | 'ai';
4
+ message: string;
5
+ }
6
+ export interface LuzmoChart {
7
+ version: string;
8
+ type: string;
9
+ position: {
10
+ sizeX: number;
11
+ sizeY: number;
12
+ row: number;
13
+ col: number;
14
+ };
15
+ title: Record<string, unknown>;
16
+ options: Record<string, unknown>;
17
+ content: Record<string, unknown>;
18
+ slots: Array<{
19
+ name: string;
20
+ content: unknown[];
21
+ }>;
22
+ filterGroups?: Array<{
23
+ condition: string;
24
+ filters: Array<{
25
+ expression: string;
26
+ parameters: unknown[];
27
+ }>;
28
+ }>;
29
+ update?: boolean;
30
+ aichartId?: string;
31
+ }
32
+ export interface AISampleChart {
33
+ error?: string;
34
+ generatedChart: Record<string, unknown> & {
35
+ feedback: unknown;
36
+ };
37
+ question: string;
38
+ functionCall: string;
39
+ functionResponse: any;
40
+ feedback: unknown;
41
+ conversationId?: string;
42
+ message?: string;
43
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export type { Column, ColumnSubtype, ColumnType, GenericSlotContent, ItemFilterGroup, SlotName, ThemeConfig, VizItemSlots, VizItemType } from '@luzmo/dashboard-contents-types';
9
9
  export type { ElementSize, Placement } from '@luzmo/lucero';
10
+ export type * from './types/ai-chat.types';
10
11
  export type * from './types/data-field-events.types';
11
12
  export type * from './types/dataset-data-field.types';
12
13
  export type * from './types/dataset.types';
@@ -0,0 +1,43 @@
1
+ export interface ChatMessage {
2
+ id?: string;
3
+ type: 'user' | 'ai';
4
+ message: string;
5
+ }
6
+
7
+ export interface LuzmoChart {
8
+ version: string;
9
+ type: string;
10
+ position: {
11
+ sizeX: number;
12
+ sizeY: number;
13
+ row: number;
14
+ col: number;
15
+ };
16
+ title: Record<string, unknown>;
17
+ options: Record<string, unknown>;
18
+ content: Record<string, unknown>;
19
+ slots: Array<{
20
+ name: string;
21
+ content: unknown[];
22
+ }>;
23
+ filterGroups?: Array<{
24
+ condition: string;
25
+ filters: Array<{
26
+ expression: string;
27
+ parameters: unknown[];
28
+ }>;
29
+ }>;
30
+ update?: boolean;
31
+ aichartId?: string;
32
+ }
33
+
34
+ export interface AISampleChart {
35
+ error?: string;
36
+ generatedChart: Record<string, unknown> & { feedback: unknown };
37
+ question: string;
38
+ functionCall: string;
39
+ functionResponse: any;
40
+ feedback: unknown;
41
+ conversationId?: string;
42
+ message?: string;
43
+ }
package/angular/types.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
 
21
21
  export type { ElementSize, Placement } from '@luzmo/lucero';
22
22
 
23
+ export type * from './types/ai-chat.types';
23
24
  export type * from './types/data-field-events.types';
24
25
  export type * from './types/dataset-data-field.types';
25
26
  export type * from './types/dataset.types';
@@ -1,51 +1,8 @@
1
1
  import '@luzmo/lucero/chat-message';
2
2
  import { LuzmoElement } from '@utils/base';
3
3
  import { TemplateResult } from 'lit';
4
- import { Dataset } from '../../types';
4
+ import type { ChatMessage, Dataset, LuzmoChart } from '../../types';
5
5
  import '../ai-interaction-textarea';
6
- export interface ChatMessage {
7
- id?: string;
8
- type: 'user' | 'ai';
9
- message: string;
10
- }
11
- export interface LuzmoChart {
12
- version: string;
13
- type: string;
14
- position: {
15
- sizeX: number;
16
- sizeY: number;
17
- row: number;
18
- col: number;
19
- };
20
- title: Record<string, unknown>;
21
- options: Record<string, unknown>;
22
- content: Record<string, unknown>;
23
- slots: Array<{
24
- name: string;
25
- content: unknown[];
26
- }>;
27
- filterGroups?: Array<{
28
- condition: string;
29
- filters: Array<{
30
- expression: string;
31
- parameters: unknown[];
32
- }>;
33
- }>;
34
- update?: boolean;
35
- aichartId?: string;
36
- }
37
- export interface AISampleChart {
38
- error?: string;
39
- generatedChart: Record<string, unknown> & {
40
- feedback: unknown;
41
- };
42
- question: string;
43
- functionCall: string;
44
- functionResponse: any;
45
- feedback: unknown;
46
- conversationId?: string;
47
- message?: string;
48
- }
49
6
  /**
50
7
  * @name luzmo-ai-chat
51
8
  * @summary A complete AI chat interface combining messages display and input
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-CMapUjQp.cjs`),require(`../focus-visible-3ACCHno4.cjs`);const e=require(`../ai-chat-BHqwiaBZ.cjs`);require(`../set-locale-CxIt8D8X.cjs`),require(`../dataset-icon-B0jNtKtL.cjs`),require(`../data-broker-CaAKW_nK.cjs`),require(`../dataset-selector-list-Bvfo3EJg.cjs`),require(`../dataset-selector-row-B3Jk4Vxd.cjs`),require(`../ai-interaction-textarea-DR8UM5gD.cjs`),exports.LuzmoAiChat=e.t;
20
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-CMapUjQp.cjs`),require(`../focus-visible-3ACCHno4.cjs`);const e=require(`../ai-chat-Kvx4go3B.cjs`);require(`../set-locale-CxIt8D8X.cjs`),require(`../dataset-icon-B0jNtKtL.cjs`),require(`../data-broker-CaAKW_nK.cjs`),require(`../dataset-selector-list-Bvfo3EJg.cjs`),require(`../dataset-selector-row-B3Jk4Vxd.cjs`),require(`../ai-interaction-textarea-DR8UM5gD.cjs`),exports.LuzmoAiChat=e.t;
@@ -5,4 +5,3 @@ declare global {
5
5
  }
6
6
  }
7
7
  export { LuzmoAiChat } from './ai-chat';
8
- export type { ChatMessage } from './ai-chat';
@@ -25,7 +25,7 @@
25
25
  })();
26
26
  import "../base-rg2x95aL.js";
27
27
  import "../focus-visible-D1pJhWEh.js";
28
- import { t as LuzmoAiChat } from "../ai-chat-CRtaUBRF.js";
28
+ import { t as LuzmoAiChat } from "../ai-chat-DIP8tuL0.js";
29
29
  import "../set-locale-4N3tMOqw.js";
30
30
  import "../dataset-icon-CYzmHzrn.js";
31
31
  import "../data-broker-JnZCs0yK.js";
@@ -596,7 +596,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
596
596
  },
597
597
  options: {
598
598
  available_datasets: t,
599
- ...t.length > 0 && { datasetId: t[0] },
599
+ ...t.length > 0 && { dataset_id: t[0] },
600
600
  ...this.chart && { chart: {
601
601
  ...this.chart,
602
602
  title: this.chart.title || this.chart.options.title,
@@ -18,7 +18,7 @@
18
18
  * SOFTWARE.
19
19
  * */
20
20
  const e=require(`./chunk-BzfTdyRg.cjs`),t=require(`./base-CMapUjQp.cjs`),n=require(`./decorate-Dq4-zbi1.cjs`);require(`@luzmo/lucero/chat-message`);let r=require(`lit`),i=require(`lit/decorators.js`),a=require(`lit/directives/unsafe-html.js`);var{entries:o,setPrototypeOf:s,isFrozen:c,getPrototypeOf:l,getOwnPropertyDescriptor:u}=Object,{freeze:d,seal:f,create:ee}=Object,{apply:te,construct:ne}=typeof Reflect<`u`&&Reflect;d||=function(e){return e},f||=function(e){return e},te||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},ne||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var re=y(Array.prototype.forEach),ie=y(Array.prototype.lastIndexOf),ae=y(Array.prototype.pop),p=y(Array.prototype.push),oe=y(Array.prototype.splice),m=y(String.prototype.toLowerCase),se=y(String.prototype.toString),ce=y(String.prototype.match),h=y(String.prototype.replace),le=y(String.prototype.indexOf),ue=y(String.prototype.trim),g=y(Object.prototype.hasOwnProperty),_=y(RegExp.prototype.test),v=b(TypeError);function y(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return te(e,t,r)}}function b(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ne(e,n)}}function x(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m;s&&s(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(c(t)||(t[r]=e),i=e)}e[i]=!0}return e}function de(e){for(let t=0;t<e.length;t++)g(e,t)||(e[t]=null);return e}function S(e){let t=ee(null);for(let[n,r]of o(e))g(e,n)&&(Array.isArray(r)?t[n]=de(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=S(r):t[n]=r);return t}function C(e,t){for(;e!==null;){let n=u(e,t);if(n){if(n.get)return y(n.get);if(typeof n.value==`function`)return y(n.value)}e=l(e)}function n(){return null}return n}var fe=d(`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(`.`)),pe=d(`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=d([`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`]),he=d([`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`]),ge=d(`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(`.`)),_e=d([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ve=d([`#text`]),ye=d(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.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.slot`.split(`.`)),be=d(`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.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.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-rendering.textlength.type.u1.u2.unicode.values.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(`.`)),xe=d(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.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(`.`)),w=d([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Se=f(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ce=f(/<%[\w\W]*|[\w\W]*%>/gm),we=f(/\$\{[\w\W]*/gm),T=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),E=f(/^aria-[\-\w]+$/),Te=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),D=f(/^(?:\w+script|data):/i),O=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ee=f(/^html$/i),De=f(/^[a-z][.\w]*(-[.\w]+)+$/i),Oe=Object.freeze({__proto__:null,ARIA_ATTR:E,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:De,DATA_ATTR:T,DOCTYPE_NAME:Ee,ERB_EXPR:Ce,IS_ALLOWED_URI:Te,IS_SCRIPT_OR_DATA:D,MUSTACHE_EXPR:Se,TMPLIT_EXPR:we}),k={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ke=function(){return typeof window>`u`?null:window},Ae=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}},je=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Me(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ke(),t=e=>Me(e);if(t.version=`3.3.1`,t.removed=[],!e||!e.document||e.document.nodeType!==k.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:te,DOMParser:ne,trustedTypes:y}=e,b=l.prototype,de=C(b,`cloneNode`),Se=C(b,`remove`),Ce=C(b,`nextSibling`),we=C(b,`childNodes`),T=C(b,`parentNode`);if(typeof s==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let E,D=``,{implementation:O,createNodeIterator:De,createDocumentFragment:Ne,getElementsByTagName:Pe}=n,{importNode:A}=r,j=je();t.isSupported=typeof o==`function`&&typeof T==`function`&&O&&O.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Fe,ERB_EXPR:Ie,TMPLIT_EXPR:Le,DATA_ATTR:Re,ARIA_ATTR:ze,IS_SCRIPT_OR_DATA:Be,ATTR_WHITESPACE:Ve,CUSTOM_ELEMENT:He}=Oe,{IS_ALLOWED_URI:Ue}=Oe,M=null,We=x({},[...fe,...pe,...me,...ge,...ve]),N=null,Ge=x({},[...ye,...be,...xe,...w]),P=Object.seal(ee(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}})),F=null,Ke=null,I=Object.seal(ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),qe=!0,Je=!0,Ye=!1,Xe=!0,L=!1,R=!0,z=!1,Ze=!1,Qe=!1,B=!1,V=!1,H=!1,$e=!0,et=!1,tt=!0,U=!1,W={},G=null,nt=x({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),rt=null,it=x({},[`audio`,`video`,`img`,`source`,`image`,`track`]),at=null,ot=x({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),st=`http://www.w3.org/1998/Math/MathML`,ct=`http://www.w3.org/2000/svg`,K=`http://www.w3.org/1999/xhtml`,q=K,lt=!1,ut=null,dt=x({},[st,ct,K],se),ft=x({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),pt=x({},[`annotation-xml`]),mt=x({},[`title`,`style`,`font`,`a`,`script`]),J=null,ht=[`application/xhtml+xml`,`text/html`],Y=null,X=null,gt=n.createElement(`form`),_t=function(e){return e instanceof RegExp||e instanceof Function},vt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(X&&X===e)){if((!e||typeof e!=`object`)&&(e={}),e=S(e),J=ht.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=J===`application/xhtml+xml`?se:m,M=g(e,`ALLOWED_TAGS`)?x({},e.ALLOWED_TAGS,Y):We,N=g(e,`ALLOWED_ATTR`)?x({},e.ALLOWED_ATTR,Y):Ge,ut=g(e,`ALLOWED_NAMESPACES`)?x({},e.ALLOWED_NAMESPACES,se):dt,at=g(e,`ADD_URI_SAFE_ATTR`)?x(S(ot),e.ADD_URI_SAFE_ATTR,Y):ot,rt=g(e,`ADD_DATA_URI_TAGS`)?x(S(it),e.ADD_DATA_URI_TAGS,Y):it,G=g(e,`FORBID_CONTENTS`)?x({},e.FORBID_CONTENTS,Y):nt,F=g(e,`FORBID_TAGS`)?x({},e.FORBID_TAGS,Y):S({}),Ke=g(e,`FORBID_ATTR`)?x({},e.FORBID_ATTR,Y):S({}),W=g(e,`USE_PROFILES`)?e.USE_PROFILES:!1,qe=e.ALLOW_ARIA_ATTR!==!1,Je=e.ALLOW_DATA_ATTR!==!1,Ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Xe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,L=e.SAFE_FOR_TEMPLATES||!1,R=e.SAFE_FOR_XML!==!1,z=e.WHOLE_DOCUMENT||!1,B=e.RETURN_DOM||!1,V=e.RETURN_DOM_FRAGMENT||!1,H=e.RETURN_TRUSTED_TYPE||!1,Qe=e.FORCE_BODY||!1,$e=e.SANITIZE_DOM!==!1,et=e.SANITIZE_NAMED_PROPS||!1,tt=e.KEEP_CONTENT!==!1,U=e.IN_PLACE||!1,Ue=e.ALLOWED_URI_REGEXP||Te,q=e.NAMESPACE||K,ft=e.MATHML_TEXT_INTEGRATION_POINTS||ft,pt=e.HTML_INTEGRATION_POINTS||pt,P=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(P.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(P.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L&&(Je=!1),V&&(B=!0),W&&(M=x({},ve),N=[],W.html===!0&&(x(M,fe),x(N,ye)),W.svg===!0&&(x(M,pe),x(N,be),x(N,w)),W.svgFilters===!0&&(x(M,me),x(N,be),x(N,w)),W.mathMl===!0&&(x(M,ge),x(N,xe),x(N,w))),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?I.tagCheck=e.ADD_TAGS:(M===We&&(M=S(M)),x(M,e.ADD_TAGS,Y))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?I.attributeCheck=e.ADD_ATTR:(N===Ge&&(N=S(N)),x(N,e.ADD_ATTR,Y))),e.ADD_URI_SAFE_ATTR&&x(at,e.ADD_URI_SAFE_ATTR,Y),e.FORBID_CONTENTS&&(G===nt&&(G=S(G)),x(G,e.FORBID_CONTENTS,Y)),e.ADD_FORBID_CONTENTS&&(G===nt&&(G=S(G)),x(G,e.ADD_FORBID_CONTENTS,Y)),tt&&(M[`#text`]=!0),z&&x(M,[`html`,`head`,`body`]),M.table&&(x(M,[`tbody`]),delete F.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw v(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw v(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);E=e.TRUSTED_TYPES_POLICY,D=E.createHTML(``)}else E===void 0&&(E=Ae(y,i)),E!==null&&typeof D==`string`&&(D=E.createHTML(``));d&&d(e),X=e}},yt=x({},[...pe,...me,...he]),bt=x({},[...ge,..._e]),xt=function(e){let t=T(e);(!t||!t.tagName)&&(t={namespaceURI:q,tagName:`template`});let n=m(e.tagName),r=m(t.tagName);return ut[e.namespaceURI]?e.namespaceURI===ct?t.namespaceURI===K?n===`svg`:t.namespaceURI===st?n===`svg`&&(r===`annotation-xml`||ft[r]):!!yt[n]:e.namespaceURI===st?t.namespaceURI===K?n===`math`:t.namespaceURI===ct?n===`math`&&pt[r]:!!bt[n]:e.namespaceURI===K?t.namespaceURI===ct&&!pt[r]||t.namespaceURI===st&&!ft[r]?!1:!bt[n]&&(mt[n]||!yt[n]):!!(J===`application/xhtml+xml`&&ut[e.namespaceURI]):!1},Z=function(e){p(t.removed,{element:e});try{T(e).removeChild(e)}catch{Se(e)}},Q=function(e,n){try{p(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{p(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(B||V)try{Z(n)}catch{}else try{n.setAttribute(e,``)}catch{}},St=function(e){let t=null,r=null;if(Qe)e=`<remove></remove>`+e;else{let t=ce(e,/^[\r\n\t ]+/);r=t&&t[0]}J===`application/xhtml+xml`&&q===K&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=E?E.createHTML(e):e;if(q===K)try{t=new ne().parseFromString(i,J)}catch{}if(!t||!t.documentElement){t=O.createDocument(q,`template`,null);try{t.documentElement.innerHTML=lt?D:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),q===K?Pe.call(t,z?`html`:`body`)[0]:z?t.documentElement:a},Ct=function(e){return De.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof te&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof f)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Tt=function(e){return typeof c==`function`&&e instanceof c};function $(e,n,r){re(e,e=>{e.call(t,n,r,X)})}let Et=function(e){let n=null;if($(j.beforeSanitizeElements,e,null),wt(e))return Z(e),!0;let r=Y(e.nodeName);if($(j.uponSanitizeElement,e,{tagName:r,allowedTags:M}),R&&e.hasChildNodes()&&!Tt(e.firstElementChild)&&_(/<[/\w!]/g,e.innerHTML)&&_(/<[/\w!]/g,e.textContent)||e.nodeType===k.progressingInstruction||R&&e.nodeType===k.comment&&_(/<[/\w]/g,e.data))return Z(e),!0;if(!(I.tagCheck instanceof Function&&I.tagCheck(r))&&(!M[r]||F[r])){if(!F[r]&&Ot(r)&&(P.tagNameCheck instanceof RegExp&&_(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r)))return!1;if(tt&&!G[r]){let t=T(e)||e.parentNode,n=we(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=de(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,Ce(e))}}}return Z(e),!0}return e instanceof l&&!xt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&_(/<\/no(script|embed|frames)/i,e.innerHTML)?(Z(e),!0):(L&&e.nodeType===k.text&&(n=e.textContent,re([Fe,Ie,Le],e=>{n=h(n,e,` `)}),e.textContent!==n&&(p(t.removed,{element:e.cloneNode()}),e.textContent=n)),$(j.afterSanitizeElements,e,null),!1)},Dt=function(e,t,r){if($e&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;if(!(Je&&!Ke[t]&&_(Re,t))&&!(qe&&_(ze,t))&&!(I.attributeCheck instanceof Function&&I.attributeCheck(t,e))){if(!N[t]||Ke[t]){if(!(Ot(e)&&(P.tagNameCheck instanceof RegExp&&_(P.tagNameCheck,e)||P.tagNameCheck instanceof Function&&P.tagNameCheck(e))&&(P.attributeNameCheck instanceof RegExp&&_(P.attributeNameCheck,t)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(t,e))||t===`is`&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&_(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r))))return!1}else if(!at[t]&&!_(Ue,h(r,Ve,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&le(r,`data:`)===0&&rt[e])&&!(Ye&&!_(Be,h(r,Ve,``)))&&r)return!1}return!0},Ot=function(e){return e!==`annotation-xml`&&ce(e,He)},kt=function(e){$(j.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||wt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Y(a),l=s,u=a===`value`?l:ue(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,$(j.uponSanitizeAttribute,e,r),u=r.attrValue,et&&(c===`id`||c===`name`)&&(Q(a,e),u=`user-content-`+u),R&&_(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Q(a,e);continue}if(c===`attributename`&&ce(u,`href`)){Q(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Q(a,e);continue}if(!Xe&&_(/\/>/i,u)){Q(a,e);continue}L&&re([Fe,Ie,Le],e=>{u=h(u,e,` `)});let d=Y(e.nodeName);if(!Dt(d,c,u)){Q(a,e);continue}if(E&&typeof y==`object`&&typeof y.getAttributeType==`function`&&!o)switch(y.getAttributeType(d,c)){case`TrustedHTML`:u=E.createHTML(u);break;case`TrustedScriptURL`:u=E.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),wt(e)?Z(e):ae(t.removed)}catch{Q(a,e)}}$(j.afterSanitizeAttributes,e,null)},At=function e(t){let n=null,r=Ct(t);for($(j.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)$(j.uponSanitizeShadowNode,n,null),Et(n),kt(n),n.content instanceof a&&e(n.content);$(j.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,s=null,l=null;if(lt=!e,lt&&(e=`<!-->`),typeof e!=`string`&&!Tt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw v(`dirty is not a string, aborting`)}else throw v(`toString is not a function`);if(!t.isSupported)return e;if(Ze||vt(n),t.removed=[],typeof e==`string`&&(U=!1),U){if(e.nodeName){let t=Y(e.nodeName);if(!M[t]||F[t])throw v(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof c)i=St(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===k.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!B&&!L&&!z&&e.indexOf(`<`)===-1)return E&&H?E.createHTML(e):e;if(i=St(e),!i)return B?null:H?D:``}i&&Qe&&Z(i.firstChild);let u=Ct(U?e:i);for(;s=u.nextNode();)Et(s),kt(s),s.content instanceof a&&At(s.content);if(U)return e;if(B){if(V)for(l=Ne.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(N.shadowroot||N.shadowrootmode)&&(l=A.call(r,l,!0)),l}let d=z?i.outerHTML:i.innerHTML;return z&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&_(Ee,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
21
- `+d),L&&re([Fe,Ie,Le],e=>{d=h(d,e,` `)}),E&&H?E.createHTML(d):d},t.setConfig=function(){vt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ze=!0},t.clearConfig=function(){X=null,Ze=!1},t.isValidAttribute=function(e,t,n){return X||vt({}),Dt(Y(e),Y(t),n)},t.addHook=function(e,t){typeof t==`function`&&p(j[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=ie(j[e],t);return n===-1?void 0:oe(j[e],n,1)[0]}return ae(j[e])},t.removeHooks=function(e){j[e]=[]},t.removeAllHooks=function(){j=je()},t}var Ne=Me(),Pe=`:host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;display:flex;overflow:auto}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb),.08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none}`,A=class extends t.i{constructor(...e){super(...e),this.messages=[],this.selectedDatasets=[],this.placeholder=`Describe your change`,this.disabled=!1,this.showAssistantContextMenu=!1,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this.hideDatasetButton=!1,this.modelPreference=`performance`,this.conversationId=null,this.chart=null,this._isGenerating=!1,this._textareaValue=``}static{this.styles=(0,r.unsafeCSS)(Pe)}static{this.tagName=`luzmo-ai-chat`}_generateMessageId(){return`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}async _sendMessage(e,t){let n=`${this.apiUrl}/0.1.0/aimessage`,r={key:this.authKey,token:this.authToken,action:`create`,version:`0.1.0`,properties:{content:{role:`user`,content:e},...!!this.conversationId&&{conversation_id:this.conversationId}},options:{available_datasets:t,...t.length>0&&{datasetId:t[0]},...this.chart&&{chart:{...this.chart,title:this.chart.title||this.chart.options.title,filters:this.chart.filterGroups||[],aichartId:this.chart.aichartId||``}},model_preference:this.modelPreference}},i=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${i.status}`)}return await i.json()}async _addUserMessage(e,t){let n={id:this._generateMessageId(),type:`user`,message:e};this.messages=[...this.messages,n],this._textareaValue=``,this.dispatchEvent(new CustomEvent(`luzmo-message-sent`,{detail:{message:n,selectedDatasets:t},bubbles:!0,composed:!0})),await this.updateComplete,this._scrollToBottom()}_prepareForAIResponse(){this._isGenerating=!0;let e={id:this._generateMessageId(),type:`ai`,message:``};return this.messages=[...this.messages,e],e}_handleChartResponse(e,t){this.dispatchEvent(new CustomEvent(`luzmo-chart-generated`,{detail:{aiSampleChart:e},bubbles:!0,composed:!0})),e.message&&(t.message=e.message,this.messages=[...this.messages.slice(0,-1),{...t}],this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,done:!0},bubbles:!0,composed:!0})))}_handleErrorResponse(e,t){let n=null;if(e.functionResponse?.error){let t=e.functionResponse.explanation;t&&typeof t==`string`&&(n=e.functionResponse.explanation)}else n=e.functionResponse;n&&(t.message=n,this.messages=[...this.messages.slice(0,-1),{...t}]),this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,done:!0},bubbles:!0,composed:!0}))}_processAIResponse(e,t){e.generatedChart===void 0?(e.functionResponse?.error!==void 0||typeof e.functionResponse==`string`)&&this._handleErrorResponse(e,t):this._handleChartResponse(e,t)}_handleAPIError(e){console.error(`AI Chart Generation Error:`,e);let t={id:this._generateMessageId(),type:`ai`,message:`${e instanceof Error?e.message:`Unknown error`}`};this.messages=[...this.messages,t],this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,error:e},bubbles:!0,composed:!0}))}async _finalizeAIResponse(){this._isGenerating=!1,await this.updateComplete,this._scrollToBottom()}async _handlePromptSubmitted(e){let{prompt:t,selectedDatasets:n}=e.detail;await this._addUserMessage(t,n);let r=await this._prepareForAIResponse();try{let e=n.map(e=>e.id),i=await this._sendMessage(t,e);this._processAIResponse(i,r)}catch(e){this._handleAPIError(e)}finally{await this._finalizeAIResponse()}}_scrollToBottom(){let e=this.shadowRoot?.querySelector(`.chat-messages-container`);e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})})}_sanitizeMessage(e){return Ne.sanitize(e,{ALLOWED_TAGS:[`p`,`br`,`strong`,`em`,`b`,`i`,`u`,`s`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`a`],ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`iframe`,`object`,`embed`,`form`,`input`,`button`],FORBID_ATTR:[`onerror`,`onload`,`onclick`,`onmouseover`,`onfocus`,`onblur`]})}_renderMessages(){return this.messages.map(e=>e.type===`user`?r.html`
21
+ `+d),L&&re([Fe,Ie,Le],e=>{d=h(d,e,` `)}),E&&H?E.createHTML(d):d},t.setConfig=function(){vt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ze=!0},t.clearConfig=function(){X=null,Ze=!1},t.isValidAttribute=function(e,t,n){return X||vt({}),Dt(Y(e),Y(t),n)},t.addHook=function(e,t){typeof t==`function`&&p(j[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=ie(j[e],t);return n===-1?void 0:oe(j[e],n,1)[0]}return ae(j[e])},t.removeHooks=function(e){j[e]=[]},t.removeAllHooks=function(){j=je()},t}var Ne=Me(),Pe=`:host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;display:flex;overflow:auto}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb),.08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none}`,A=class extends t.i{constructor(...e){super(...e),this.messages=[],this.selectedDatasets=[],this.placeholder=`Describe your change`,this.disabled=!1,this.showAssistantContextMenu=!1,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this.hideDatasetButton=!1,this.modelPreference=`performance`,this.conversationId=null,this.chart=null,this._isGenerating=!1,this._textareaValue=``}static{this.styles=(0,r.unsafeCSS)(Pe)}static{this.tagName=`luzmo-ai-chat`}_generateMessageId(){return`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}async _sendMessage(e,t){let n=`${this.apiUrl}/0.1.0/aimessage`,r={key:this.authKey,token:this.authToken,action:`create`,version:`0.1.0`,properties:{content:{role:`user`,content:e},...!!this.conversationId&&{conversation_id:this.conversationId}},options:{available_datasets:t,...t.length>0&&{dataset_id:t[0]},...this.chart&&{chart:{...this.chart,title:this.chart.title||this.chart.options.title,filters:this.chart.filterGroups||[],aichartId:this.chart.aichartId||``}},model_preference:this.modelPreference}},i=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`},mode:`cors`,body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.message||`API request failed with status ${i.status}`)}return await i.json()}async _addUserMessage(e,t){let n={id:this._generateMessageId(),type:`user`,message:e};this.messages=[...this.messages,n],this._textareaValue=``,this.dispatchEvent(new CustomEvent(`luzmo-message-sent`,{detail:{message:n,selectedDatasets:t},bubbles:!0,composed:!0})),await this.updateComplete,this._scrollToBottom()}_prepareForAIResponse(){this._isGenerating=!0;let e={id:this._generateMessageId(),type:`ai`,message:``};return this.messages=[...this.messages,e],e}_handleChartResponse(e,t){this.dispatchEvent(new CustomEvent(`luzmo-chart-generated`,{detail:{aiSampleChart:e},bubbles:!0,composed:!0})),e.message&&(t.message=e.message,this.messages=[...this.messages.slice(0,-1),{...t}],this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,done:!0},bubbles:!0,composed:!0})))}_handleErrorResponse(e,t){let n=null;if(e.functionResponse?.error){let t=e.functionResponse.explanation;t&&typeof t==`string`&&(n=e.functionResponse.explanation)}else n=e.functionResponse;n&&(t.message=n,this.messages=[...this.messages.slice(0,-1),{...t}]),this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,done:!0},bubbles:!0,composed:!0}))}_processAIResponse(e,t){e.generatedChart===void 0?(e.functionResponse?.error!==void 0||typeof e.functionResponse==`string`)&&this._handleErrorResponse(e,t):this._handleChartResponse(e,t)}_handleAPIError(e){console.error(`AI Chart Generation Error:`,e);let t={id:this._generateMessageId(),type:`ai`,message:`${e instanceof Error?e.message:`Unknown error`}`};this.messages=[...this.messages,t],this.dispatchEvent(new CustomEvent(`luzmo-response-received`,{detail:{message:t,error:e},bubbles:!0,composed:!0}))}async _finalizeAIResponse(){this._isGenerating=!1,await this.updateComplete,this._scrollToBottom()}async _handlePromptSubmitted(e){let{prompt:t,selectedDatasets:n}=e.detail;await this._addUserMessage(t,n);let r=await this._prepareForAIResponse();try{let e=n.map(e=>e.id),i=await this._sendMessage(t,e);this._processAIResponse(i,r)}catch(e){this._handleAPIError(e)}finally{await this._finalizeAIResponse()}}_scrollToBottom(){let e=this.shadowRoot?.querySelector(`.chat-messages-container`);e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})})}_sanitizeMessage(e){return Ne.sanitize(e,{ALLOWED_TAGS:[`p`,`br`,`strong`,`em`,`b`,`i`,`u`,`s`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`a`],ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`iframe`,`object`,`embed`,`form`,`input`,`button`],FORBID_ATTR:[`onerror`,`onload`,`onclick`,`onmouseover`,`onfocus`,`onblur`]})}_renderMessages(){return this.messages.map(e=>e.type===`user`?r.html`
22
22
  <luzmo-chat-message
23
23
  avatar-placement="bottom"
24
24
  position="right"
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./base-CMapUjQp.cjs`),require(`./focus-visible-3ACCHno4.cjs`);const e=require(`./ai-chat-BHqwiaBZ.cjs`),t=require(`./localize-1PfTYVMY.cjs`);require(`./set-locale-CxIt8D8X.cjs`);const n=require(`./dataset-icon-B0jNtKtL.cjs`);require(`./data-broker-CaAKW_nK.cjs`);const r=require(`./dataset-selector-list-Bvfo3EJg.cjs`),i=require(`./dataset-selector-row-B3Jk4Vxd.cjs`),a=require(`./ai-interaction-textarea-DR8UM5gD.cjs`),o=require(`./formatter-W9wqX_XR.cjs`),s=require(`./decompose-numeric-format-B3nb3XKf.cjs`),c=require(`./display-settings-BWdCfQRh.cjs`),l=require(`./display-settings-binning-CcUEzCkd.cjs`),u=require(`./display-settings-datetime-dZfDL8It.cjs`);require(`./periods.const-DuqtQKfs.cjs`);const d=require(`./display-settings-grand-totals-DFiotIJp.cjs`);require(`./calculate-data-field-icon-DS7blwAS.cjs`);const f=require(`./display-settings-numeric-DwJIG4uR.cjs`),p=require(`./period-over-period-condition.const-Ol98e4ut.cjs`),m=require(`./display-settings-period-over-period-BYfmTB4-.cjs`);require(`./get-css-variable-DoFqEmSY.cjs`);const h=require(`./draggable-data-field-level-BO1-eZO-.cjs`),g=require(`./draggable-data-field-2xM4c6pA.cjs`),_=require(`./convert-datasets-to-data-fields-BUkvN0FO.cjs`),v=require(`./load-data-fields-for-datasets-bjHqVU_h.cjs`),y=require(`./draggable-data-fields-panel-CzCuGTHQ.cjs`),b=require(`./slot-menu-BhHDTdgv.cjs`),x=require(`./grid-pwuAERDo.cjs`),S=require(`./slot-menu-list-O_XT3zMp.cjs`),C=require(`./droppable-slot-BP6x2S2j.cjs`);require(`./slot-labels.const-C0RxWf1A.cjs`);const w=require(`./edit-option-CwVS9NRz.cjs`),T=require(`./themes-B_h9LMQi.cjs`),E=require(`./edit-item-CrBLVcIZ.cjs`),ee=require(`./edit-filters-BhjfcMxd.cjs`),D=require(`./filter-expression-picker-DBCdudya.cjs`),O=require(`./data-fields-select-CbHMVgby.cjs`),k=require(`./filter-value-picker-B4LmMYyJ.cjs`),A=require(`./filter-value-picker-datetime-CvBmsA16.cjs`),j=require(`./utils-D_kokiZV.cjs`),M=require(`./filter-value-picker-hierarchy-Qzn2z03C.cjs`),N=require(`./filter-value-picker-numeric-BTzL1LGZ.cjs`),P=require(`./filter-item-HpjTLiy8.cjs`);require(`./edit-option-base-whtMN4oN.cjs`);const F=require(`./edit-option-action-button-group-1azj6aol.cjs`),I=require(`./edit-option-color-palette-picker-Drhzeany.cjs`),L=require(`./edit-option-color-picker-Qk2lvG0J.cjs`),R=require(`./edit-option-color-range-LQOMzgfA.cjs`),z=require(`./edit-option-multi-language-field-rU8OggmU.cjs`),B=require(`./edit-option-number-field-DhyncBML.cjs`),V=require(`./edit-option-picker-wPPmC2jF.cjs`),H=require(`./edit-option-position-picker-BHy57n3I.cjs`),U=require(`./edit-option-positions-number-field-CRe5aeKo.cjs`),W=require(`./edit-option-radio-button-group-JjvPvrMH.cjs`),G=require(`./edit-option-slider-CpLvI2vd.cjs`),K=require(`./edit-option-switch-WUlgboed.cjs`),q=require(`./edit-option-text-field-Z7xEk86g.cjs`),J=require(`./item-data-drop-panel-C2gLU36C.cjs`),Y=require(`./slot-contents-picker-BGV1Jpku.cjs`),X=require(`./item-data-picker-panel-CJiBXxuH.cjs`),Z=require(`./viz-item-menu-ChpfPq-7.cjs`);require(`./types.cjs`);const Q=[{key:`general`,label:`General`},{key:`filters`,label:`Filters`},{key:`bar-column`,label:`Bar & Column Charts`},{key:`line`,label:`Line Charts`},{key:`scatter-bubble`,label:`Scatter & Bubble Plots`},{key:`area`,label:`Area Charts`},{key:`pie-donut`,label:`Pie & Donut`},{key:`gauges`,label:`Gauges`},{key:`map`,label:`Map Charts`},{key:`hierarchical`,label:`Hierarchical Charts`},{key:`special`,label:`Special Charts`},{key:`financial`,label:`Financial Charts`}],$=[{type:`area-chart`,label:`Area Chart`},{type:`bar-chart`,label:`Bar Chart`},{type:`box-plot`,label:`Box Plot`},{type:`bubble-chart`,label:`Bubble Chart`},{type:`bullet-chart`,label:`Bullet Chart`},{type:`choropleth-map`,label:`Choropleth Map`},{type:`circle-pack-chart`,label:`Circle Pack Chart`},{type:`circular-gauge`,label:`Circular Gauge`},{type:`column-chart`,label:`Column Chart`},{type:`combination-chart`,label:`Combination Chart`},{type:`conditional-number`,label:`Conditional Number`},{type:`date-comparison-filter`,label:`Date Comparison Filter`},{type:`date-filter`,label:`Date Filter`},{type:`donut-chart`,label:`Donut Chart`},{type:`dropdown-filter`,label:`Dropdown Filter`},{type:`evolution-number`,label:`Evolution Number`},{type:`funnel-chart`,label:`Funnel Chart`},{type:`heat-map`,label:`Heat Map`},{type:`heat-table`,label:`Heat Table`},{type:`hexbin-map`,label:`Hexbin Map`},{type:`image`,label:`Image`},{type:`line-chart`,label:`Line Chart`},{type:`marker-map`,label:`Marker Map`},{type:`ohlc-chart`,label:`OHLC Chart`},{type:`parallel-coordinates-plot`,label:`Parallel Coordinates Plot`},{type:`pivot-table`,label:`Pivot Table`},{type:`pyramid-chart`,label:`Pyramid Chart`},{type:`radar-chart`,label:`Radar Chart`},{type:`regular-table`,label:`Regular Table`},{type:`route-map`,label:`Route Map`},{type:`sankey-diagram`,label:`Sankey Diagram`},{type:`scatter-plot`,label:`Scatter Plot`},{type:`search-filter`,label:`Search Filter`},{type:`slicer-filter`,label:`Slicer Filter`},{type:`slider-filter`,label:`Slider Filter`},{type:`speedometer-chart`,label:`Speedometer Chart`},{type:`spike-map`,label:`Spike Map`},{type:`strip-plot`,label:`Strip Plot`},{type:`sunburst-chart`,label:`Sunburst Chart`},{type:`symbol-map`,label:`Symbol Map`},{type:`text`,label:`Text`},{type:`treemap-chart`,label:`Treemap Chart`},{type:`video`,label:`Video`},{type:`wordcloud-chart`,label:`Wordcloud Chart`}],te=[{item:`text`,type:`text`,label:`Text`,group:`general`},{item:`image`,type:`image`,label:`Image`,group:`general`},{item:`evolution-number`,type:`evolution-number`,label:`Number with evolution`,group:`general`},{item:`video`,type:`video`,label:`Video`,group:`general`},{item:`regular-table`,type:`regular-table`,label:`Regular Table`,group:`general`},{item:`pivot-table`,type:`pivot-table`,label:`Pivot Table`,group:`general`},{item:`spacer`,type:`spacer`,label:`Spacer`,group:`general`},{item:`date-comparison-filter`,type:`date-comparison-filter`,label:`Date Comparison Filter`,group:`filters`},{item:`date-filter`,type:`date-filter`,label:`Date Filter`,group:`filters`},{item:`slider-filter`,type:`slider-filter`,label:`Slider Filter`,group:`filters`},{item:`search-filter`,type:`search-filter`,label:`Search Filter`,group:`filters`},{item:`dropdown-filter`,type:`dropdown-filter`,label:`Dropdown Filter`,group:`filters`},{item:`slicer-filter-vertical`,type:`slicer`,label:`Slicer Filter`,group:`filters`,options:{layout:{alignment:`vertical`}}},{item:`slicer-filter-horizontal`,type:`slicer`,label:`Slicer Filter Horizontal`,group:`filters`,options:{layout:{alignment:`horizontal`}}},{item:`slicer-filter-table`,type:`slicer`,label:`Slicer Filter Table`,group:`filters`,options:{layout:{alignment:`table`}}},{item:`rank-slicer-filter`,type:`slicer`,label:`Rank Slicer Filter`,group:`filters`,options:{layout:{alignment:`rank-vertical`}}},{item:`bar-chart`,type:`bar-chart`,label:`Bar Chart`,group:`bar-column`},{item:`grouped-bar-chart`,type:`bar-chart`,label:`Grouped Bar Chart`,group:`bar-column`,options:{mode:`grouped`}},{item:`stacked-bar-chart`,type:`bar-chart`,label:`Stacked Bar Chart`,group:`bar-column`,options:{mode:`stacked`}},{item:`column-chart`,type:`column-chart`,label:`Column Chart`,group:`bar-column`},{item:`grouped-column-chart`,type:`column-chart`,label:`Grouped Column Chart`,group:`bar-column`,options:{mode:`grouped`}},{item:`stacked-column-chart`,type:`column-chart`,label:`Stacked Column Chart`,group:`bar-column`,options:{mode:`stacked`}},{item:`line-chart`,type:`line-chart`,label:`Line Chart`,group:`line`},{item:`grouped-line-chart`,type:`line-chart`,label:`Grouped Line Chart`,group:`line`,options:{mode:`grouped`}},{item:`scatter-plot`,type:`scatter-plot`,label:`Scatter Plot`,group:`scatter-bubble`},{item:`scatter-group`,type:`scatter-plot`,label:`Scatter Group`,group:`scatter-bubble`},{item:`bubble-plot`,type:`scatter-plot`,label:`Bubble Plot`,group:`scatter-bubble`},{item:`colored-bubble-plot`,type:`scatter-plot`,label:`Colored Bubble Plot`,group:`scatter-bubble`},{item:`area-chart`,type:`area-chart`,label:`Area Chart`,group:`area`},{item:`stacked-area-chart`,type:`area-chart`,label:`Stacked Area Chart`,group:`area`,options:{mode:`stacked`}},{item:`100-area-chart`,type:`area-chart`,label:`100% Stacked Area Chart`,group:`area`,options:{mode:`100%`}},{item:`streamgraph`,type:`area-chart`,label:`Streamgraph`,group:`area`},{item:`pie-chart`,type:`donut-chart`,label:`Pie Chart`,group:`pie-donut`},{item:`donut-chart`,type:`donut-chart`,label:`Donut Chart`,group:`pie-donut`},{item:`semi-pie-chart`,type:`donut-chart`,label:`Semi Pie Chart`,group:`pie-donut`},{item:`semi-donut-chart`,type:`donut-chart`,label:`Semi Donut Chart`,group:`pie-donut`},{item:`bullet-chart`,type:`bullet-chart`,label:`Bullet Chart`,group:`gauges`},{item:`circular-gauge`,type:`circular-gauge`,label:`Circular Gauge`,group:`gauges`},{item:`conditional-number`,type:`conditional-number`,label:`Conditional Number`,group:`gauges`},{item:`speedometer-chart`,type:`speedometer-chart`,label:`Speedometer`,group:`gauges`},{item:`choropleth-map`,type:`choropleth-map`,label:`Choropleth Map`,group:`map`},{item:`symbol-map`,type:`symbol-map`,label:`Symbol Map`,group:`map`},{item:`marker-map`,type:`marker-map`,label:`Marker Map`,group:`map`},{item:`hexbin-map`,type:`hexbin-map`,label:`Hexbin Map`,group:`map`},{item:`heat-map`,type:`heat-map`,label:`Heat Map`,group:`map`},{item:`route-map`,type:`route-map`,label:`Route Map`,group:`map`},{item:`spike-map`,type:`spike-map`,label:`Spike Map`,group:`map`},{item:`treemap-chart`,type:`treemap-chart`,label:`Treemap Chart`,group:`hierarchical`},{item:`sunburst-chart`,type:`sunburst-chart`,label:`Sunburst Chart`,group:`hierarchical`},{item:`circle-pack-chart`,type:`circle-pack-chart`,label:`Circle Pack Chart`,group:`hierarchical`},{item:`combination-chart`,type:`combination-chart`,label:`Combination Chart`,group:`special`},{item:`parallel-coordinates-plot`,type:`parallel-coordinates-plot`,label:`Parallel Coordinates Plot`,group:`special`},{item:`bubble-chart`,type:`bubble-chart`,label:`Bubble Chart`,group:`special`},{item:`strip-plot`,type:`strip-plot`,label:`Strip Plot`,group:`special`},{item:`radar-chart`,type:`radar-chart`,label:`Radar Chart`,group:`special`},{item:`pyramid-chart`,type:`pyramid-chart`,label:`Pyramid Chart`,group:`special`},{item:`funnel-chart`,type:`funnel-chart`,label:`Funnel Chart`,group:`special`},{item:`alluvial-diagram`,type:`alluvial-diagram`,label:`Alluvial Diagram`,group:`special`},{item:`sankey-diagram`,type:`sankey-diagram`,label:`Sankey Diagram`,group:`special`},{item:`venn-diagram`,type:`venn-diagram`,label:`Venn Diagram`,group:`special`},{item:`box-plot`,type:`box-plot`,label:`Box Plot`,group:`special`},{item:`heat-table`,type:`heat-table`,label:`Heat Table`,group:`special`},{item:`wordcloud-chart`,type:`wordcloud-chart`,label:`Wordcloud Chart`,group:`special`},{item:`ohlc-chart`,type:`ohlc-chart`,label:`OHLC Chart`,group:`financial`},{item:`candlestick-chart`,type:`ohlc-chart`,label:`Candlestick Chart`,group:`financial`}];exports.LuzmoAiChat=e.t,Object.defineProperty(exports,`LuzmoAiInteractionTextarea`,{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,`LuzmoDataFieldsSelect`,{enumerable:!0,get:function(){return O.t}}),exports.LuzmoDatasetIcon=n.t,exports.LuzmoDatasetSelectorList=r.t,exports.LuzmoDatasetSelectorRow=i.t,exports.LuzmoDisplaySettings=c.t,Object.defineProperty(exports,`LuzmoDisplaySettingsBinning`,{enumerable:!0,get:function(){return l.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsDatetime`,{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsGrandTotals`,{enumerable:!0,get:function(){return d.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsNumeric`,{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsPeriodOverPeriod`,{enumerable:!0,get:function(){return m.t}}),Object.defineProperty(exports,`LuzmoDraggableDataField`,{enumerable:!0,get:function(){return g.t}}),exports.LuzmoDraggableDataFieldLevel=h.t,Object.defineProperty(exports,`LuzmoDraggableDataFieldsPanel`,{enumerable:!0,get:function(){return y.t}}),Object.defineProperty(exports,`LuzmoDroppableSlot`,{enumerable:!0,get:function(){return C.t}}),Object.defineProperty(exports,`LuzmoEditFilters`,{enumerable:!0,get:function(){return ee.t}}),exports.LuzmoEditItem=E.t,exports.LuzmoEditOption=w.t,exports.LuzmoEditOptionActionButtonGroup=F.t,exports.LuzmoEditOptionColorPalettePicker=I.t,exports.LuzmoEditOptionColorPicker=L.t,exports.LuzmoEditOptionColorRange=R.t,exports.LuzmoEditOptionMultiLangField=z.t,exports.LuzmoEditOptionNumberField=B.t,exports.LuzmoEditOptionPicker=V.t,exports.LuzmoEditOptionPositionPicker=H.t,exports.LuzmoEditOptionPositionsNumberField=U.t,exports.LuzmoEditOptionRadioButtonGroup=W.t,exports.LuzmoEditOptionSlider=G.t,exports.LuzmoEditOptionSwitch=K.t,exports.LuzmoEditOptionTextField=q.t,Object.defineProperty(exports,`LuzmoFilterExpressionPicker`,{enumerable:!0,get:function(){return D.t}}),Object.defineProperty(exports,`LuzmoFilterItem`,{enumerable:!0,get:function(){return P.t}}),exports.LuzmoFilterValuePicker=k.t,exports.LuzmoFilterValuePickerDatetime=A.t,Object.defineProperty(exports,`LuzmoFilterValuePickerHierarchy`,{enumerable:!0,get:function(){return M.t}}),Object.defineProperty(exports,`LuzmoFilterValuePickerNumeric`,{enumerable:!0,get:function(){return N.t}}),exports.LuzmoGrid=x.t,Object.defineProperty(exports,`LuzmoGridItemActionsMenu`,{enumerable:!0,get:function(){return x.n}}),Object.defineProperty(exports,`LuzmoItemDataDropPanel`,{enumerable:!0,get:function(){return J.t}}),Object.defineProperty(exports,`LuzmoItemDataPickerPanel`,{enumerable:!0,get:function(){return X.t}}),Object.defineProperty(exports,`LuzmoSlotContentsPicker`,{enumerable:!0,get:function(){return Y.t}}),exports.LuzmoSlotMenu=b.t,exports.LuzmoSlotMenuList=S.t,Object.defineProperty(exports,`LuzmoVizItemMenu`,{enumerable:!0,get:function(){return Z.t}}),exports.PeriodOverPeriodCondition=p.t,exports.convertDatasetsToDataFields=_.t,exports.decomposeNumericFormat=s.t,exports.formatter=o.t,exports.getTheme=T.t,exports.itemGroups=Q,exports.itemList=te,exports.itemTypes=$,exports.loadDataFieldsForDatasets=v.t,exports.localize=t.t,exports.switchItem=j.t,exports.systemThemeIds=T.n;
20
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./base-CMapUjQp.cjs`),require(`./focus-visible-3ACCHno4.cjs`);const e=require(`./ai-chat-Kvx4go3B.cjs`),t=require(`./localize-1PfTYVMY.cjs`);require(`./set-locale-CxIt8D8X.cjs`);const n=require(`./dataset-icon-B0jNtKtL.cjs`);require(`./data-broker-CaAKW_nK.cjs`);const r=require(`./dataset-selector-list-Bvfo3EJg.cjs`),i=require(`./dataset-selector-row-B3Jk4Vxd.cjs`),a=require(`./ai-interaction-textarea-DR8UM5gD.cjs`),o=require(`./formatter-W9wqX_XR.cjs`),s=require(`./decompose-numeric-format-B3nb3XKf.cjs`),c=require(`./display-settings-BWdCfQRh.cjs`),l=require(`./display-settings-binning-CcUEzCkd.cjs`),u=require(`./display-settings-datetime-dZfDL8It.cjs`);require(`./periods.const-DuqtQKfs.cjs`);const d=require(`./display-settings-grand-totals-DFiotIJp.cjs`);require(`./calculate-data-field-icon-DS7blwAS.cjs`);const f=require(`./display-settings-numeric-DwJIG4uR.cjs`),p=require(`./period-over-period-condition.const-Ol98e4ut.cjs`),m=require(`./display-settings-period-over-period-BYfmTB4-.cjs`);require(`./get-css-variable-DoFqEmSY.cjs`);const h=require(`./draggable-data-field-level-BO1-eZO-.cjs`),g=require(`./draggable-data-field-2xM4c6pA.cjs`),_=require(`./convert-datasets-to-data-fields-BUkvN0FO.cjs`),v=require(`./load-data-fields-for-datasets-bjHqVU_h.cjs`),y=require(`./draggable-data-fields-panel-CzCuGTHQ.cjs`),b=require(`./slot-menu-BhHDTdgv.cjs`),x=require(`./grid-pwuAERDo.cjs`),S=require(`./slot-menu-list-O_XT3zMp.cjs`),C=require(`./droppable-slot-BP6x2S2j.cjs`);require(`./slot-labels.const-C0RxWf1A.cjs`);const w=require(`./edit-option-CwVS9NRz.cjs`),T=require(`./themes-B_h9LMQi.cjs`),E=require(`./edit-item-CrBLVcIZ.cjs`),ee=require(`./edit-filters-BhjfcMxd.cjs`),D=require(`./filter-expression-picker-DBCdudya.cjs`),O=require(`./data-fields-select-CbHMVgby.cjs`),k=require(`./filter-value-picker-B4LmMYyJ.cjs`),A=require(`./filter-value-picker-datetime-CvBmsA16.cjs`),j=require(`./utils-D_kokiZV.cjs`),M=require(`./filter-value-picker-hierarchy-Qzn2z03C.cjs`),N=require(`./filter-value-picker-numeric-BTzL1LGZ.cjs`),P=require(`./filter-item-HpjTLiy8.cjs`);require(`./edit-option-base-whtMN4oN.cjs`);const F=require(`./edit-option-action-button-group-1azj6aol.cjs`),I=require(`./edit-option-color-palette-picker-Drhzeany.cjs`),L=require(`./edit-option-color-picker-Qk2lvG0J.cjs`),R=require(`./edit-option-color-range-LQOMzgfA.cjs`),z=require(`./edit-option-multi-language-field-rU8OggmU.cjs`),B=require(`./edit-option-number-field-DhyncBML.cjs`),V=require(`./edit-option-picker-wPPmC2jF.cjs`),H=require(`./edit-option-position-picker-BHy57n3I.cjs`),U=require(`./edit-option-positions-number-field-CRe5aeKo.cjs`),W=require(`./edit-option-radio-button-group-JjvPvrMH.cjs`),G=require(`./edit-option-slider-CpLvI2vd.cjs`),K=require(`./edit-option-switch-WUlgboed.cjs`),q=require(`./edit-option-text-field-Z7xEk86g.cjs`),J=require(`./item-data-drop-panel-C2gLU36C.cjs`),Y=require(`./slot-contents-picker-BGV1Jpku.cjs`),X=require(`./item-data-picker-panel-CJiBXxuH.cjs`),Z=require(`./viz-item-menu-ChpfPq-7.cjs`);require(`./types.cjs`);const Q=[{key:`general`,label:`General`},{key:`filters`,label:`Filters`},{key:`bar-column`,label:`Bar & Column Charts`},{key:`line`,label:`Line Charts`},{key:`scatter-bubble`,label:`Scatter & Bubble Plots`},{key:`area`,label:`Area Charts`},{key:`pie-donut`,label:`Pie & Donut`},{key:`gauges`,label:`Gauges`},{key:`map`,label:`Map Charts`},{key:`hierarchical`,label:`Hierarchical Charts`},{key:`special`,label:`Special Charts`},{key:`financial`,label:`Financial Charts`}],$=[{type:`area-chart`,label:`Area Chart`},{type:`bar-chart`,label:`Bar Chart`},{type:`box-plot`,label:`Box Plot`},{type:`bubble-chart`,label:`Bubble Chart`},{type:`bullet-chart`,label:`Bullet Chart`},{type:`choropleth-map`,label:`Choropleth Map`},{type:`circle-pack-chart`,label:`Circle Pack Chart`},{type:`circular-gauge`,label:`Circular Gauge`},{type:`column-chart`,label:`Column Chart`},{type:`combination-chart`,label:`Combination Chart`},{type:`conditional-number`,label:`Conditional Number`},{type:`date-comparison-filter`,label:`Date Comparison Filter`},{type:`date-filter`,label:`Date Filter`},{type:`donut-chart`,label:`Donut Chart`},{type:`dropdown-filter`,label:`Dropdown Filter`},{type:`evolution-number`,label:`Evolution Number`},{type:`funnel-chart`,label:`Funnel Chart`},{type:`heat-map`,label:`Heat Map`},{type:`heat-table`,label:`Heat Table`},{type:`hexbin-map`,label:`Hexbin Map`},{type:`image`,label:`Image`},{type:`line-chart`,label:`Line Chart`},{type:`marker-map`,label:`Marker Map`},{type:`ohlc-chart`,label:`OHLC Chart`},{type:`parallel-coordinates-plot`,label:`Parallel Coordinates Plot`},{type:`pivot-table`,label:`Pivot Table`},{type:`pyramid-chart`,label:`Pyramid Chart`},{type:`radar-chart`,label:`Radar Chart`},{type:`regular-table`,label:`Regular Table`},{type:`route-map`,label:`Route Map`},{type:`sankey-diagram`,label:`Sankey Diagram`},{type:`scatter-plot`,label:`Scatter Plot`},{type:`search-filter`,label:`Search Filter`},{type:`slicer-filter`,label:`Slicer Filter`},{type:`slider-filter`,label:`Slider Filter`},{type:`speedometer-chart`,label:`Speedometer Chart`},{type:`spike-map`,label:`Spike Map`},{type:`strip-plot`,label:`Strip Plot`},{type:`sunburst-chart`,label:`Sunburst Chart`},{type:`symbol-map`,label:`Symbol Map`},{type:`text`,label:`Text`},{type:`treemap-chart`,label:`Treemap Chart`},{type:`video`,label:`Video`},{type:`wordcloud-chart`,label:`Wordcloud Chart`}],te=[{item:`text`,type:`text`,label:`Text`,group:`general`},{item:`image`,type:`image`,label:`Image`,group:`general`},{item:`evolution-number`,type:`evolution-number`,label:`Number with evolution`,group:`general`},{item:`video`,type:`video`,label:`Video`,group:`general`},{item:`regular-table`,type:`regular-table`,label:`Regular Table`,group:`general`},{item:`pivot-table`,type:`pivot-table`,label:`Pivot Table`,group:`general`},{item:`spacer`,type:`spacer`,label:`Spacer`,group:`general`},{item:`date-comparison-filter`,type:`date-comparison-filter`,label:`Date Comparison Filter`,group:`filters`},{item:`date-filter`,type:`date-filter`,label:`Date Filter`,group:`filters`},{item:`slider-filter`,type:`slider-filter`,label:`Slider Filter`,group:`filters`},{item:`search-filter`,type:`search-filter`,label:`Search Filter`,group:`filters`},{item:`dropdown-filter`,type:`dropdown-filter`,label:`Dropdown Filter`,group:`filters`},{item:`slicer-filter-vertical`,type:`slicer`,label:`Slicer Filter`,group:`filters`,options:{layout:{alignment:`vertical`}}},{item:`slicer-filter-horizontal`,type:`slicer`,label:`Slicer Filter Horizontal`,group:`filters`,options:{layout:{alignment:`horizontal`}}},{item:`slicer-filter-table`,type:`slicer`,label:`Slicer Filter Table`,group:`filters`,options:{layout:{alignment:`table`}}},{item:`rank-slicer-filter`,type:`slicer`,label:`Rank Slicer Filter`,group:`filters`,options:{layout:{alignment:`rank-vertical`}}},{item:`bar-chart`,type:`bar-chart`,label:`Bar Chart`,group:`bar-column`},{item:`grouped-bar-chart`,type:`bar-chart`,label:`Grouped Bar Chart`,group:`bar-column`,options:{mode:`grouped`}},{item:`stacked-bar-chart`,type:`bar-chart`,label:`Stacked Bar Chart`,group:`bar-column`,options:{mode:`stacked`}},{item:`column-chart`,type:`column-chart`,label:`Column Chart`,group:`bar-column`},{item:`grouped-column-chart`,type:`column-chart`,label:`Grouped Column Chart`,group:`bar-column`,options:{mode:`grouped`}},{item:`stacked-column-chart`,type:`column-chart`,label:`Stacked Column Chart`,group:`bar-column`,options:{mode:`stacked`}},{item:`line-chart`,type:`line-chart`,label:`Line Chart`,group:`line`},{item:`grouped-line-chart`,type:`line-chart`,label:`Grouped Line Chart`,group:`line`,options:{mode:`grouped`}},{item:`scatter-plot`,type:`scatter-plot`,label:`Scatter Plot`,group:`scatter-bubble`},{item:`scatter-group`,type:`scatter-plot`,label:`Scatter Group`,group:`scatter-bubble`},{item:`bubble-plot`,type:`scatter-plot`,label:`Bubble Plot`,group:`scatter-bubble`},{item:`colored-bubble-plot`,type:`scatter-plot`,label:`Colored Bubble Plot`,group:`scatter-bubble`},{item:`area-chart`,type:`area-chart`,label:`Area Chart`,group:`area`},{item:`stacked-area-chart`,type:`area-chart`,label:`Stacked Area Chart`,group:`area`,options:{mode:`stacked`}},{item:`100-area-chart`,type:`area-chart`,label:`100% Stacked Area Chart`,group:`area`,options:{mode:`100%`}},{item:`streamgraph`,type:`area-chart`,label:`Streamgraph`,group:`area`},{item:`pie-chart`,type:`donut-chart`,label:`Pie Chart`,group:`pie-donut`},{item:`donut-chart`,type:`donut-chart`,label:`Donut Chart`,group:`pie-donut`},{item:`semi-pie-chart`,type:`donut-chart`,label:`Semi Pie Chart`,group:`pie-donut`},{item:`semi-donut-chart`,type:`donut-chart`,label:`Semi Donut Chart`,group:`pie-donut`},{item:`bullet-chart`,type:`bullet-chart`,label:`Bullet Chart`,group:`gauges`},{item:`circular-gauge`,type:`circular-gauge`,label:`Circular Gauge`,group:`gauges`},{item:`conditional-number`,type:`conditional-number`,label:`Conditional Number`,group:`gauges`},{item:`speedometer-chart`,type:`speedometer-chart`,label:`Speedometer`,group:`gauges`},{item:`choropleth-map`,type:`choropleth-map`,label:`Choropleth Map`,group:`map`},{item:`symbol-map`,type:`symbol-map`,label:`Symbol Map`,group:`map`},{item:`marker-map`,type:`marker-map`,label:`Marker Map`,group:`map`},{item:`hexbin-map`,type:`hexbin-map`,label:`Hexbin Map`,group:`map`},{item:`heat-map`,type:`heat-map`,label:`Heat Map`,group:`map`},{item:`route-map`,type:`route-map`,label:`Route Map`,group:`map`},{item:`spike-map`,type:`spike-map`,label:`Spike Map`,group:`map`},{item:`treemap-chart`,type:`treemap-chart`,label:`Treemap Chart`,group:`hierarchical`},{item:`sunburst-chart`,type:`sunburst-chart`,label:`Sunburst Chart`,group:`hierarchical`},{item:`circle-pack-chart`,type:`circle-pack-chart`,label:`Circle Pack Chart`,group:`hierarchical`},{item:`combination-chart`,type:`combination-chart`,label:`Combination Chart`,group:`special`},{item:`parallel-coordinates-plot`,type:`parallel-coordinates-plot`,label:`Parallel Coordinates Plot`,group:`special`},{item:`bubble-chart`,type:`bubble-chart`,label:`Bubble Chart`,group:`special`},{item:`strip-plot`,type:`strip-plot`,label:`Strip Plot`,group:`special`},{item:`radar-chart`,type:`radar-chart`,label:`Radar Chart`,group:`special`},{item:`pyramid-chart`,type:`pyramid-chart`,label:`Pyramid Chart`,group:`special`},{item:`funnel-chart`,type:`funnel-chart`,label:`Funnel Chart`,group:`special`},{item:`alluvial-diagram`,type:`alluvial-diagram`,label:`Alluvial Diagram`,group:`special`},{item:`sankey-diagram`,type:`sankey-diagram`,label:`Sankey Diagram`,group:`special`},{item:`venn-diagram`,type:`venn-diagram`,label:`Venn Diagram`,group:`special`},{item:`box-plot`,type:`box-plot`,label:`Box Plot`,group:`special`},{item:`heat-table`,type:`heat-table`,label:`Heat Table`,group:`special`},{item:`wordcloud-chart`,type:`wordcloud-chart`,label:`Wordcloud Chart`,group:`special`},{item:`ohlc-chart`,type:`ohlc-chart`,label:`OHLC Chart`,group:`financial`},{item:`candlestick-chart`,type:`ohlc-chart`,label:`Candlestick Chart`,group:`financial`}];exports.LuzmoAiChat=e.t,Object.defineProperty(exports,`LuzmoAiInteractionTextarea`,{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,`LuzmoDataFieldsSelect`,{enumerable:!0,get:function(){return O.t}}),exports.LuzmoDatasetIcon=n.t,exports.LuzmoDatasetSelectorList=r.t,exports.LuzmoDatasetSelectorRow=i.t,exports.LuzmoDisplaySettings=c.t,Object.defineProperty(exports,`LuzmoDisplaySettingsBinning`,{enumerable:!0,get:function(){return l.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsDatetime`,{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsGrandTotals`,{enumerable:!0,get:function(){return d.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsNumeric`,{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,`LuzmoDisplaySettingsPeriodOverPeriod`,{enumerable:!0,get:function(){return m.t}}),Object.defineProperty(exports,`LuzmoDraggableDataField`,{enumerable:!0,get:function(){return g.t}}),exports.LuzmoDraggableDataFieldLevel=h.t,Object.defineProperty(exports,`LuzmoDraggableDataFieldsPanel`,{enumerable:!0,get:function(){return y.t}}),Object.defineProperty(exports,`LuzmoDroppableSlot`,{enumerable:!0,get:function(){return C.t}}),Object.defineProperty(exports,`LuzmoEditFilters`,{enumerable:!0,get:function(){return ee.t}}),exports.LuzmoEditItem=E.t,exports.LuzmoEditOption=w.t,exports.LuzmoEditOptionActionButtonGroup=F.t,exports.LuzmoEditOptionColorPalettePicker=I.t,exports.LuzmoEditOptionColorPicker=L.t,exports.LuzmoEditOptionColorRange=R.t,exports.LuzmoEditOptionMultiLangField=z.t,exports.LuzmoEditOptionNumberField=B.t,exports.LuzmoEditOptionPicker=V.t,exports.LuzmoEditOptionPositionPicker=H.t,exports.LuzmoEditOptionPositionsNumberField=U.t,exports.LuzmoEditOptionRadioButtonGroup=W.t,exports.LuzmoEditOptionSlider=G.t,exports.LuzmoEditOptionSwitch=K.t,exports.LuzmoEditOptionTextField=q.t,Object.defineProperty(exports,`LuzmoFilterExpressionPicker`,{enumerable:!0,get:function(){return D.t}}),Object.defineProperty(exports,`LuzmoFilterItem`,{enumerable:!0,get:function(){return P.t}}),exports.LuzmoFilterValuePicker=k.t,exports.LuzmoFilterValuePickerDatetime=A.t,Object.defineProperty(exports,`LuzmoFilterValuePickerHierarchy`,{enumerable:!0,get:function(){return M.t}}),Object.defineProperty(exports,`LuzmoFilterValuePickerNumeric`,{enumerable:!0,get:function(){return N.t}}),exports.LuzmoGrid=x.t,Object.defineProperty(exports,`LuzmoGridItemActionsMenu`,{enumerable:!0,get:function(){return x.n}}),Object.defineProperty(exports,`LuzmoItemDataDropPanel`,{enumerable:!0,get:function(){return J.t}}),Object.defineProperty(exports,`LuzmoItemDataPickerPanel`,{enumerable:!0,get:function(){return X.t}}),Object.defineProperty(exports,`LuzmoSlotContentsPicker`,{enumerable:!0,get:function(){return Y.t}}),exports.LuzmoSlotMenu=b.t,exports.LuzmoSlotMenuList=S.t,Object.defineProperty(exports,`LuzmoVizItemMenu`,{enumerable:!0,get:function(){return Z.t}}),exports.PeriodOverPeriodCondition=p.t,exports.convertDatasetsToDataFields=_.t,exports.decomposeNumericFormat=s.t,exports.formatter=o.t,exports.getTheme=T.t,exports.itemGroups=Q,exports.itemList=te,exports.itemTypes=$,exports.loadDataFieldsForDatasets=v.t,exports.localize=t.t,exports.switchItem=j.t,exports.systemThemeIds=T.n;
@@ -25,7 +25,7 @@
25
25
  })();
26
26
  import "./base-rg2x95aL.js";
27
27
  import "./focus-visible-D1pJhWEh.js";
28
- import { t as LuzmoAiChat } from "./ai-chat-CRtaUBRF.js";
28
+ import { t as LuzmoAiChat } from "./ai-chat-DIP8tuL0.js";
29
29
  import { t as localize } from "./localize-CTTwlzBP.js";
30
30
  import "./set-locale-4N3tMOqw.js";
31
31
  import { t as LuzmoDatasetIcon } from "./dataset-icon-CYzmHzrn.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzmo/analytics-components-kit",
3
- "version": "1.0.1-alpha.135",
3
+ "version": "1.0.1-alpha.136",
4
4
  "type": "module",
5
5
  "main": "./components/index.js",
6
6
  "module": "./components/index.js",
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export type { Column, ColumnSubtype, ColumnType, GenericSlotContent, ItemFilterGroup, SlotName, ThemeConfig, VizItemSlots, VizItemType } from '@luzmo/dashboard-contents-types';
9
9
  export type { ElementSize, Placement } from '@luzmo/lucero';
10
+ export type * from './types/ai-chat.types';
10
11
  export type * from './types/data-field-events.types';
11
12
  export type * from './types/dataset-data-field.types';
12
13
  export type * from './types/dataset.types';
package/react/types.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
 
21
21
  export type { ElementSize, Placement } from '@luzmo/lucero';
22
22
 
23
+ export type * from './types/ai-chat.types';
23
24
  export type * from './types/data-field-events.types';
24
25
  export type * from './types/dataset-data-field.types';
25
26
  export type * from './types/dataset.types';
@@ -0,0 +1,43 @@
1
+ export interface ChatMessage {
2
+ id?: string;
3
+ type: 'user' | 'ai';
4
+ message: string;
5
+ }
6
+ export interface LuzmoChart {
7
+ version: string;
8
+ type: string;
9
+ position: {
10
+ sizeX: number;
11
+ sizeY: number;
12
+ row: number;
13
+ col: number;
14
+ };
15
+ title: Record<string, unknown>;
16
+ options: Record<string, unknown>;
17
+ content: Record<string, unknown>;
18
+ slots: Array<{
19
+ name: string;
20
+ content: unknown[];
21
+ }>;
22
+ filterGroups?: Array<{
23
+ condition: string;
24
+ filters: Array<{
25
+ expression: string;
26
+ parameters: unknown[];
27
+ }>;
28
+ }>;
29
+ update?: boolean;
30
+ aichartId?: string;
31
+ }
32
+ export interface AISampleChart {
33
+ error?: string;
34
+ generatedChart: Record<string, unknown> & {
35
+ feedback: unknown;
36
+ };
37
+ question: string;
38
+ functionCall: string;
39
+ functionResponse: any;
40
+ feedback: unknown;
41
+ conversationId?: string;
42
+ message?: string;
43
+ }
package/types.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export type { Column, ColumnSubtype, ColumnType, GenericSlotContent, ItemFilterGroup, SlotName, ThemeConfig, VizItemSlots, VizItemType } from '@luzmo/dashboard-contents-types';
9
9
  export type { ElementSize, Placement } from '@luzmo/lucero';
10
+ export type * from './types/ai-chat.types';
10
11
  export type * from './types/data-field-events.types';
11
12
  export type * from './types/dataset-data-field.types';
12
13
  export type * from './types/dataset.types';