PageSourceSearch

https://manas-ds-social-listening-engine-v2.hf.space/assets/index-DT-PGBOg.js

js manas-ds-social-listening-engine-v2.hf.space collected 2026-10-04 17:05:41 UTC 9,323 bytes, 1 lines download raw bytes

1import{a1 as I,Y as A,a2 as f,a3 as k,a4 as L}from"./i18n-Cp0K4Pzb.js";import{H as Z,Q as $,a5 as K,a6 as N,a7 as V,P as X,a8 as tt,J as st,I as it,a9 as et,F as rt}from"./i18n-Cp0K4Pzb.js";import{aa as R,Z as U,$ as W,G as u}from"./index-CTFdGFMX.js";import{d as j}from"./index-tFQomdd2.js";const q={walkthrough:"tabs",walkthroughstep:"tabitem"};function g(t){const s=new URL(t.root),i=s.pathname.endsWith("/")?s.pathname:s.pathname+"/",e=t.api_prefix.startsWith("/")?t.api_prefix:"/"+t.api_prefix;return new URL(i.slice(0,-1)+e,s.origin).toString()}class Q{#p;#i;#e;reactive_formatter=s=>s;#t;client;#a=R();get root(){return U(this.#a)}set root(s){W(this.#a,s,!0)}root_untracked;#l=new Set;#c=new Set;#u=[];#h=new Map;#s=new Map;#r=new Map;#o;component_ids;initial_tabs={};components_to_register=new Set;ready;ready_resolve;resolved=!1;#n=new Set;constructor(s,i,e,r,n,o,p){this.ready=new Promise(l=>{this.ready_resolve=l}),this.reactive_formatter=o;const a=g(r);this.#t={...r,api_url:a},this.#p=s,this.#i=i,this.#e=e,this.#o=p,this.root=this.create_node({id:i.id,children:[]},new Map,!0);for(const l of s)l.props.visible!=!1&&this.components_to_register.add(l.id);this.client=n,this.prepare();const h=s.reduce((l,c)=>(l.set(c.id,c),l),new Map);this.root.children=this.#i.children.map(l=>this.traverse(l,c=>this.create_node(c,h,!1,this.reactive_formatter))),this.component_ids=s.map(l=>l.id),this.initial_tabs={},m(this.root,this.initial_tabs),this.postprocess(this.root),this.root_untracked=this.root}reload(s,i,e,r){this.#i=i,this.#p=s;const n=g(r);this.#t={...r,api_url:n},this.#e=e,this.root=this.create_node({id:i.id,children:[]},new Map,!0);for(const p of s)p.props.visible!=!1&&this.components_to_register.add(p.id);this.prepare();const o=s.reduce((p,a)=>(p.set(a.id,a),p),new Map);this.root.children=this.#i.children.map(p=>this.traverse(p,a=>this.create_node(a,o,!1,this.reactive_formatter))),this.component_ids=s.map(p=>p.id),this.initial_tabs={},m(this.root,this.initial_tabs),this.postprocess(this.root)}register_component(s,i,e){this.#s.set(s,i),this.#h.set(s,e),this.components_to_register.delete(s);const r=this.#r.get(s);r&&(this.#r.delete(s),u().then(()=>{const n=this.#s.get(s);n&&n(r)})),this.components_to_register.size===0&&!this.resolved&&(this.resolved=!0,this.ready_resolve())}prepare(){const[s,i]=I(this.#e);this.#l=s,this.#c=i}process(){}postprocess(s){this.root=this.traverse(s,[i=>v(i,this.#t.api_url),i=>D(i,this.components_to_register),i=>w(i,this.initial_tabs),i=>this.find_attached_events(i,this.#e),i=>F(i,this.components_to_register,this.#n)])}find_attached_events(s,i){const e=i.filter(r=>r.targets.find(([n])=>n===s.id)).map(r=>{const n=r.targets.find(([o])=>o===s.id);return n?n[1]:null}).filter(Boolean);return s.props.shared_props.attached_events=e,s}traverse(s,i){function e(r,n,o){const p=n(r);return"children"in r&&r.children.length>0&&(p.children=r.children?.map(a=>o(a,n))||[]),p}if(Array.isArray(i)){let r=s;for(const n of i)r=e(r,n,this.traverse.bind(this));return r}else return e(s,i,this.traverse.bind(this))}create_node(s,i,e=!1,r){let n;if(e?n={type:"column",id:s.id,props:{visible:!0,root:"",theme_mode:"light",scale:this.#t.fill_height?1:null},component_class_id:"column",key:null}:n=i.get(s.id),!n)throw new Error(`Component with ID ${s.id} not found`);r&&(n.props.i18n=r,n.props.i18n_store=A);const o=B(s.id,n.props,[this.#l,this.#c],this.client,this.#t.api_url,{...this.#t,register_component:this.register_component.bind(this),dispatcher:this.#o.bind(this)}),p=q[n.type]||n.type,a=o.shared_props.visible!==!1?f(n.type,n.component_class_id,this.#t.api_url||""):null;return{id:s.id,type:p,props:o,children:[],show_progress_on:null,component_class_id:n.component_class_id||n.type,component:o.shared_props.visible!==!1&&a?.component||null,runtime:a?.runtime||!1,key:n.key,rendered_in:n.rendered_in,documentation:n.documentation,original_visibility:o.shared_props.visible}}rerender(s,i){const e=s.reduce((p,a)=>(p.set(a.id,a),p),new Map),r=this.traverse(i,p=>this.create_node(p,e,!1,this.reactive_formatter));m(r,this.initial_tabs);const n=this.traverse(r,p=>
1w(p,this.initial_tabs)),o=_(this.root,n.id);if(!o)throw new Error("Rerender failed: root node not found in current tree");o.children=n.children}async update_state(s,i,e=!0){const r=_(this.root,s);let n=!1;e&&!r?.component&&(await u(),this.root=this.traverse(this.root,[p=>C(p,s,i.visible),p=>v(p,this.#t.api_url)]),await u(),n=!0);const o=this.#s.get(s);if(o)o&&o(i);else{const p=r?.props.props.value,a=M(i);for(const c in a.shared_props)r.props.shared_props[c]=a.shared_props[c];for(const c in a.props)r.props.props[c]=a.props[c];const{loading_status:h,...l}=i;if(Object.keys(l).length>0){const c=this.#r.get(s)||{};this.#r.set(s,{...c,...l})}"value"in i&&!j(p,i.value)&&this.#o(s,"change",null),r?.type==="tabitem"&&this.#_(s,r)}!e||n||(await u(),await this.update_visibility(r,i))}async update_visibility(s,i){s.children.forEach(e=>{const r=this.#s.get(e.id);r&&r(i),this.update_visibility(e,i)})}#_(s,i){const e=S(this.root,s);if(!e||e.type!=="tabs")return;const r=e.props.props.initial_tabs;if(!r)return;const n=r.findIndex(l=>l.component_id===i.id);if(n===-1)return;const o=i.props.props.i18n,p=i.props.shared_props.label,a="original_visibility"in i?i.original_visibility:i.props.shared_props.visible;r[n]={label:o?o(p):p,id:i.props.props.id,elem_id:i.props.shared_props.elem_id,visible:a,interactive:i.props.shared_props.interactive,scale:i.props.shared_props.scale||null,component_id:i.id},e.props.props.initial_tabs=[...r];const h=this.#s.get(e.id);h&&h({initial_tabs:e.props.props.initial_tabs})}async get_state(s){const i=this.#h.get(s),e=_(this.root,s);return!i&&!e?null:i?await i():e?Promise.resolve({value:e.props.props.value}):null}async render_previously_invisible_children(s){const i=_(this.root,s);i&&(!this.#n.has(i.id)&&!E(i,this.#n)||(b(i,this.#n,!0),x(i,this.#t.api_url)))}}function b(t,s,i=!1){if(t.props.shared_props.visible=s.has(t.id)?!0:t.props.shared_props.visible,t.type==="tabs"){const e=t.props.props.selected??t.props.props.initial_tabs?.[0]?.id;t.children.forEach(r=>{r.type==="tabitem"&&(r.props.props.id===e||r.id===e)&&b(r,s,!1)})}else t.type==="accordion"&&t.props.props.open===!1&&!i||t.children.forEach(e=>{b(e,s,!1)})}function E(t,s){for(const i of t.children)if(s.has(i.id)||E(i,s))return!0;return!1}function x(t,s){t.props.shared_props.visible&&!t.component&&(t.component=f(t.type,t.component_class_id,s)),t.children.forEach(i=>x(i,s))}function z(t,s,i){return s?s.reduce((e,r)=>(e[r]=async(...n)=>(n.length===1&&(n=n[0]),await i.component_server(t,r,n)),e),{}):{}}function M(t){const s={},i={};for(const e in t)if(e==="id"||e==="autoscroll")i[e]=t[e];else if(k.includes(e)){const r=e;s[r]=t[e]}else i[e]=t[e];return{shared_props:s,props:i}}function B(t,s,i,e,r,n={}){const{shared_props:o,props:p}=M(s);o.server=z(t,s.server_fns,e);for(const a in n)if(k.includes(a)){const h=a;o[h]=n[a]}else p[a]=n[a];return o.client=e,o.id=t,o.interactive=L(t,o.interactive,p.value,i),o.load_component=(a,h,l)=>f(a,l||"",r,h),o.visible=o.visible===void 0?!0:o.visible,o.loading_status={},{shared_props:o,props:p}}function v(t,s){if(t.props.shared_props.visible&&!t.component){const i=f(t.type,t.component_class_id,s),e={...t,component:i.component,children:[]};return t.children&&(e.children=t.children.map(r=>v(r,s))),e}else return t}function C(t,s,i){return t.id==s&&(t.props.shared_props.visible=i),t}function d(t,s){s.delete(t.id),t.children&&t.children.forEach(i=>d(i,s))}function D(t,s){return t.props.shared_props.visible!==!0&&d(t,s),t}function y(t,s){return t.props.shared_props.visible===!0&&(s.add(t.id),t.props.shared_props.visible=!1),t.children.forEach(i=>{y(i,s)}),t}function F(t,s,i){return t.type==="accordion"&&t.props.props.open===!1&&(d(t,s),t.children&&t.children.forEach(e=>{y(e,i)})),t.type==="tabs"&&t.children.forEach(e=>{e.type==="tabitem"&&e.props.props.id!==(t.props.props.selected||t.props.props.initial_tabs[0].id)&&(d(e,s),y(e,i))}),t}function w(t,s){if(t.type==="tabs"&&t.id in s){const i=s[t.id].sort((e,r)=>e.order-r.order);t.props.props.initial_tabs=i}else t.type==="tabitem"&&(t.props.props.component_id=t.id);return t}function P(t,s,i,e){if(i!==null&&t.type==="tabitem"){i in s||(s[i]=[]),"id"in t.props.props||(t.props.props.id=t.id);const r=t.props.props.i18n,n=t.props.shared_props.label;s[i].push({label:r?r(n):n,id:t.props.props.id,elem_id:t.props.shared_props.elem_id,visible:t.props.shared_props.visible,interactive:t.props.shared_props.interactive,scale:t.props.shared_props.scale||null,component_id:t.id}),t.props.props.order=e}
1t.children&&t.children.forEach((r,n)=>{P(r,s,t.type==="tabs"?t.id:null,t.type==="tabs"?n:null)})}function m(t,s){function i(e){"children"in e&&e.children.length>0&&e.children?.forEach(r=>P(r,s,e.type==="tabs"?e.id:null,null))}return i(t)}function _(t,s){if(t.id===s)return t;if(t.children)for(const i of t.children){const e=_(i,s);if(e)return e}return null}function S(t,s){if(t.children)for(const i of t.children){if(i.id===s)return t;const e=S(i,s);if(e)return e}return null}export{Q as AppTree,Z as Embed,$ as changeLocale,K as get_initial_locale,N as i18n_marker,V as is_translation_metadata,X as language_choices,tt as load_translations,st as mount_css,it as prefix_css,et as process_langs,rt as setupi18n};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.