PageSourceSearch

https://yousri52-reward-management-service.hf.space/assets/index-BlQXYsaG.js

js yousri52-reward-management-service.hf.space collected 2026-10-03 17:32:19 UTC 9,345 bytes, 1 lines download raw bytes

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