quarc/tests/e2e/app/dist/main.js

90 lines
81 KiB
JavaScript

function provideRouter(routes2,options){var _a,_b,_c,_d;const injector=Injector.get();return window.__quarc.router?options?.pluginId?((_b=window.__quarc).plugins??(_b.plugins={}),(_c=window.__quarc.plugins)[_d=options.pluginId]??(_c[_d]={}),window.__quarc.plugins[options.pluginId].routes=routes2,window.__quarc.plugins[options.pluginId].routingMode=options.routingMode??"internal","root"===options.routingMode&&window.__quarc.router.resetConfig([...window.__quarc.router.config,...routes2])):window.__quarc.router.resetConfig([...window.__quarc.router.config,...routes2]):(_a=window.__quarc).router??(_a.router=new Router(routes2)),injector.registerShared(Router,window.__quarc.router),injector.registerShared(RouterLink,RouterLink),window.__quarc.router}function getScopeRegistry(){return window.__quarcScopeRegistry||(window.__quarcScopeRegistry={counter:0,scopeMap:new Map,injectedStyles:new Set}),window.__quarcScopeRegistry}function getUniqueScopeId(compiledScopeId){
const registry=getScopeRegistry();return registry.scopeMap.has(compiledScopeId)||registry.scopeMap.set(compiledScopeId,"q"+registry.counter++),registry.scopeMap.get(compiledScopeId)}function createInputSignal(propertyName,component,initialValue,options){let currentValue=initialValue;const alias=options?.alias??propertyName,transform=options?.transform,getter=()=>{const element=component._nativeElement,inputSignal=element?.__inputs?.[alias];if(inputSignal){const rawValue=inputSignal();currentValue=transform?transform(rawValue):rawValue}else if(element){const attrValue=element.getAttribute(alias);null!==attrValue&&(currentValue=transform?transform(attrValue):attrValue)}return currentValue};return getter[INPUT_SIGNAL]=!0,getter}function inputFn(propertyNameOrInitialValue,componentOrOptions,initialValue,options){
return"string"==typeof propertyNameOrInitialValue&&componentOrOptions&&"_nativeElement"in componentOrOptions?createInputSignal(propertyNameOrInitialValue,componentOrOptions,initialValue,options):createInputSignal("",{},propertyNameOrInitialValue,componentOrOptions)}function inputRequired(propertyNameOrOptions,componentOrOptions,options){return"string"==typeof propertyNameOrOptions&&componentOrOptions&&"_nativeElement"in componentOrOptions?createInputSignal(propertyNameOrOptions,componentOrOptions,void 0,options):createInputSignal("",{},void 0,propertyNameOrOptions)}function getCurrentEffect(){return window.__quarc.currentEffect??null}function setCurrentEffect(effect3){window.__quarc.currentEffect=effect3}function signal(initialValue,options){let value=initialValue;const subscribers=new Set,equal=options?.equal??Object.is,getter=()=>{const current=getCurrentEffect();return current&&subscribers.add(current),value};return getter[SIGNAL]=!0,getter.set=newValue=>{
equal(value,newValue)||(value=newValue,notifySubscribers(subscribers))},getter.update=updateFn=>{getter.set(updateFn(value))},getter.asReadonly=()=>{const readonlyGetter=()=>getter();return readonlyGetter[SIGNAL]=!0,readonlyGetter},getter}function computed(computation,options){let cachedValue,isDirty=!0;const subscribers=new Set,equal=options?.equal??Object.is,internalEffect={destroy:()=>{},_run:()=>{isDirty=!0,notifySubscribers(subscribers)}},recompute=()=>{const previousEffect=getCurrentEffect();setCurrentEffect(internalEffect);try{const newValue=computation();equal(cachedValue,newValue)||(cachedValue=newValue)}finally{setCurrentEffect(previousEffect)}isDirty=!1};recompute();const getter=()=>{const current=getCurrentEffect();return current&&subscribers.add(current),isDirty&&recompute(),cachedValue};return getter[SIGNAL]=!0,getter}function effect2(effectFn,options){let isDestroyed=!1;const runEffect=()=>{if(isDestroyed)return;const previousEffect=getCurrentEffect()
;setCurrentEffect(effectRef);try{effectFn()}finally{setCurrentEffect(previousEffect)}},effectRef={destroy:()=>{isDestroyed=!0},_run:runEffect};return runEffect(),effectRef}function notifySubscribers(subscribers){const toRun=Array.from(subscribers);for(const subscriber of toRun)subscriber._run?.()}function loadExternalScript(url){return new Promise((resolve,reject)=>{const script=document.createElement("script");script.src=url,script.type="module",script.async=!0,script.onload=()=>resolve(),script.onerror=()=>reject(Error("Failed to load: "+url)),document.head.appendChild(script)})}async function tryLoadExternalScripts(urls){const urlList=Array.isArray(urls)?urls:[urls];for(const url of urlList)try{return void await loadExternalScript(url)}catch{}}async function bootstrapApplication(component,options){var _a;const instance=Core.bootstrap(component,options?.providers);return options?.externalUrls&&tryLoadExternalScripts(options.externalUrls),
options?.enablePlugins&&(window.__quarc??(window.__quarc={}),window.__quarc.Core=Core,(_a=window.__quarc).plugins??(_a.plugins={})),instance}var RouterLink,ActivatedRouteSnapshot,ActivatedRoute,RouteMatcher,RouterOutlet,RouterLinkActive,WebComponentFactory,_Core,Core,WebComponent2,DirectiveRegistry,DirectiveRunner,PipeRegistry,INPUT_SIGNAL,input,OUTPUT_EMITTER,SIGNAL,ComponentUtils,TemplateFragment,UpperCasePipe,LowerCasePipe,JsonPipe,CamelCasePipe,PascalCasePipe,SnakeCasePipe,KebabCasePipe,SubstrPipe,DatePipe,AppComponent,HomeComponent,UpperCaseTestComponent,LowerCaseTestComponent,JsonTestComponent,CaseTestComponent,DateTestComponent,SubstrTestComponent,ChainTestComponent,routes,appConfig,Injector=class _Injector{constructor(){this.instanceCache={},this.dependencyCache={},this.sharedInstances=this.getSharedInstances()}getSharedInstances(){var _a;return(_a=window.__quarc).sharedInstances??(_a.sharedInstances={}),window.__quarc.sharedInstances}static get(){
return _Injector.instance||(_Injector.instance=new _Injector),_Injector.instance}createInstance(classType){return this.createInstanceWithProviders(classType,[])}findProvider(token,providers){const tokenName="string"==typeof token?token:token.__quarc_original_name__||token.name;return providers.find(p=>("string"==typeof p.provide?p.provide:p.provide.__quarc_original_name__||p.provide.name)===tokenName)}resolveProviderValue(provider,providers){if("useValue"in provider)return provider.useValue;if("useFactory"in provider&&provider.useFactory)return provider.useFactory();if("useExisting"in provider&&provider.useExisting){const existingToken=provider.useExisting,existingProvider=this.findProvider(existingToken,providers);if(existingProvider)return this.resolveProviderValue(existingProvider,providers);const existingKey="string"==typeof existingToken?existingToken:existingToken.__quarc_original_name__||existingToken.name;return this.sharedInstances[existingKey]||this.instanceCache[existingKey]
}return"useClass"in provider&&provider.useClass?this.createInstanceWithProviders(provider.useClass,providers):void 0}createInstanceWithProviders(classType,providers){if(!classType)throw Error("[DI] createInstanceWithProviders called with undefined classType");try{const instance=new classType(...this.resolveDependenciesWithProviders(classType,providers)),key=classType.__quarc_original_name__||classType.name;return this.instanceCache[key]=instance,instance}catch(error){const className=this.getReadableClassName(classType),dependencyInfo=this.getDependencyInfo(classType);throw Error(`[DI] Failed to create instance of "${className}" with providers: ${error.message}\nDependencies: ${dependencyInfo}`)}}getReadableClassName(classType){const staticOriginalName=classType.__quarc_original_name__;if(staticOriginalName)return staticOriginalName;const originalName=classType.__quarc_original_name__;if(originalName)return originalName;const constructorName=classType?.name
;if(constructorName&&"Unknown"!==constructorName&&constructorName.length>1)return constructorName;const metadata=classType._quarcComponent?.[0]||classType._quarcDirective?.[0];return metadata?.selector?metadata.selector+" (class)":"Unknown class"}getDependencyInfo(classType){try{const paramTypes=this.getConstructorParameterTypes(classType);return 0===paramTypes.length?"none":paramTypes.map((depType,index)=>void 0===depType?`index ${index}: undefined`:`index ${index}: ${depType}`).join(", ")}catch(depError){return"failed to resolve: "+depError.message}}resolveDependencies(classType){const key=classType.__quarc_original_name__||classType.name;if(this.dependencyCache[key])return this.dependencyCache[key].map(token=>{if("string"==typeof token)throw Error("[DI] Cannot resolve string token in global context: "+token);return this.createInstance(token)});const tokens=this.getConstructorParameterTypes(classType);return this.dependencyCache[key]=tokens,tokens.map(token=>{
if("string"==typeof token)throw Error("[DI] Cannot resolve string token in global context: "+token);return this.createInstance(token)})}resolveDependenciesWithProviders(classType,providers){return this.getConstructorParameterTypes(classType).map(token=>this.resolveDependency(token,providers))}resolveDependency(token,providers){const tokenName="string"==typeof token?token:token.__quarc_original_name__||token.name,provider=this.findProvider(token,providers);return provider?this.resolveProviderValue(provider,providers):this.sharedInstances[tokenName]?this.sharedInstances[tokenName]:this.instanceCache[tokenName]?this.instanceCache[tokenName]:this.createInstanceWithProviders(token,providers)}getConstructorParameterTypes(classType){const className=classType?.name||"Unknown";if(!classType)throw Error("[DI] Cannot resolve dependencies: classType is undefined");if(classType.__di_params__){const params=classType.__di_params__
;for(let i=0;i<params.length;i++)if(void 0===params[i])throw Error(`[DI] Cannot resolve dependency at index ${i} for class "${className}". The dependency type is undefined. This usually means:\n 1. Circular dependency between modules\n 2. The dependency class is not exported or imported correctly\n 3. The import is type-only but used for DI`);return params}const reflectMetadata=Reflect.getMetadata;return reflectMetadata&&reflectMetadata("design:paramtypes",classType)||[]}register(classType,instance){const key=classType.__quarc_original_name__||classType.name;this.instanceCache[key]=instance}registerShared(classType,instance){const key=classType.__quarc_original_name__||classType.name;this.sharedInstances[key]=instance}clear(){this.instanceCache={},this.dependencyCache={}}},ComponentRegistry=class _ComponentRegistry{constructor(){this.components=new Map,this.componentsBySelector=new Map}static get(){
return _ComponentRegistry.instance||(_ComponentRegistry.instance=new _ComponentRegistry),_ComponentRegistry.instance}register(type,instance){const dependencies=type._quarcComponent[0].imports||[];this.components.set(type,{type:type,instance:instance,loaded:!1,dependencies:dependencies}),this.componentsBySelector.set(type._quarcComponent[0].selector,type)}markAsLoaded(type,webComponent){const metadata=this.components.get(type);metadata&&(metadata.loaded=!0,metadata.webComponent=webComponent)}isLoaded(type){return this.components.get(type)?.loaded??!1}getMetadata(type){return this.components.get(type)}getBySelector(selector){const type=this.componentsBySelector.get(selector);return type?this.components.get(type):void 0}getWebComponent(type){return this.components.get(type)?.webComponent}getDependencies(type){return this.components.get(type)?.dependencies??[]}getAllDependencies(type){const visited=new Set,dependencies=[],collectDependencies=componentType=>{
visited.has(componentType)||(visited.add(componentType),this.getDependencies(componentType).forEach(dep=>{dependencies.push(dep),collectDependencies(dep)}))};return collectDependencies(type),dependencies}clear(){this.components.clear(),this.componentsBySelector.clear()}getAll(){return Array.from(this.components.values())}},Subject=class{constructor(){this.observers=new Set}next(value){for(const observer of this.observers)observer(value)}subscribe(observer){return this.observers.add(observer),{unsubscribe:()=>{this.observers.delete(observer)}}}complete(){this.observers.clear()}},BehaviorSubject=class extends Subject{constructor(currentValue){super(),this.currentValue=currentValue}next(value){this.currentValue=value,super.next(value)}subscribe(observer){return observer(this.currentValue),super.subscribe(observer)}getValue(){return this.currentValue}},Router=class{constructor(config){this.config=config,this.events$=new Subject,this.routes=signal([]),this.activeRoutes=signal([]),
this.rootOutlets=new Set,this.currentUrl=signal("/"),this.activatedRoutePaths=computed(()=>this.activeRoutes().map(route=>this.generateAbsolutePath(route))),this.currentUrl.set(location.pathname),this.setupPopStateListener(),this.initializeRouteParents(this.config,null),this.routes.set(this.config)}initializeRouteParents(routes2,parent){for(const route of routes2)route.parent=parent,route.children&&this.initializeRouteParents(route.children,route)}generateAbsolutePath(route){const routes2=[];for(routes2.push(route);route.parent;)routes2.push(route),route=route.parent;return routes2.reverse(),routes2.map(route2=>route2.path||"").filter(path=>path.length>0).join("/")}resetConfig(routes2){this.config=routes2,this.initializeRouteParents(routes2,null),this.routes.set([...routes2]),this.refresh()}refresh(){this.emitNavigationEvent(this.currentUrl())}isRouteMatch(activatedRoute,route){
return activatedRoute.routeConfig===route||activatedRoute.path===route.path&&activatedRoute.component===route.component&&activatedRoute.loadComponent===route.loadComponent}registerActiveRoute(route){const current=this.activeRoutes();current.includes(route)||this.activeRoutes.set([...current,route])}unregisterActiveRoute(route){const current=this.activeRoutes();this.activeRoutes.set(current.filter(r=>r!==route))}clearActiveRoutes(){this.activeRoutes.set([])}withoutLeadingSlash(path){return path.startsWith("/")?path.slice(1):path}setupPopStateListener(){window.addEventListener("popstate",()=>{this.emitNavigationEvent(location.pathname)})}emitNavigationEvent(newUrl){const event={url:newUrl,previousUrl:this.currentUrl()};this.currentUrl.set(newUrl),this.events$.next(event),this.notifyRootOutlets(event)}notifyRootOutlets(event){for(const outlet of this.rootOutlets)outlet.onNavigationChange(event)}registerRootOutlet(outlet){this.rootOutlets.add(outlet)}unregisterRootOutlet(outlet){
this.rootOutlets.delete(outlet)}navigateByUrl(url,extras){return new Promise(resolve=>{let finalUrl=url;if(!url.startsWith("/"))if(extras?.relativeTo){const basePath=extras.relativeTo.snapshot.url.join("/");finalUrl=basePath?"/"+basePath+"/"+url:"/"+url}else finalUrl="/"+url;finalUrl=finalUrl.replace(/\/+/g,"/"),finalUrl.length>1&&finalUrl.endsWith("/")&&(finalUrl=finalUrl.slice(0,-1)),extras?.skipLocationChange||(extras?.replaceUrl?history.replaceState(finalUrl,"",finalUrl):history.pushState(finalUrl,"",finalUrl)),this.emitNavigationEvent(finalUrl),resolve(!0)})}navigate(commands,extras){const url=this.createUrlFromCommands(commands,extras);return this.navigateByUrl(url,extras)}createUrlFromCommands(commands,extras){let path;if(path=extras?.relativeTo?"/"+(extras.relativeTo.snapshot.url.join("/")||"")+"/"+commands.join("/"):"/"+commands.join("/"),extras?.queryParams){const queryString=this.serializeQueryParams(extras.queryParams);queryString&&(path+="?"+queryString)}return path}
serializeQueryParams(params,prefix=""){const parts=[];for(const[key,value]of Object.entries(params)){if(null==value)continue;const paramKey=prefix?`${prefix}[${key}]`:key;"object"!=typeof value||Array.isArray(value)?parts.push(`${encodeURIComponent(paramKey)}=${encodeURIComponent(value+"")}`):parts.push(this.serializeQueryParams(value,paramKey))}return parts.filter(p=>p).join("&")}};window.__quarc??(window.__quarc={}),(RouterLink=class{constructor(router,_nativeElement,activatedRoute){this.router=router,this._nativeElement=_nativeElement,this.activatedRoute=activatedRoute,this.routerLink=input("routerLink",this),this._nativeElement.addEventListener("click",event=>{this.onClick(event)})}ngOnInit(){}ngOnDestroy(){}onClick(event){event.preventDefault()
;const link=this.routerLink(),commands=Array.isArray(link)?link:[link],routeForNavigation=null!==this._nativeElement.closest("app-sidebar")?this.findActivatedRouteFromDOM():this.activatedRoute||this.getCurrentActivatedRoute()||this.findActivatedRouteFromDOM(),extras=routeForNavigation?{relativeTo:routeForNavigation}:void 0;this.router.navigate(commands,extras).then(success=>{}).catch(error=>{})}getCurrentActivatedRoute(){const stack=window.__quarc?.activatedRouteStack;return stack&&stack.length>0?stack[stack.length-1]:null}findActivatedRouteFromDOM(){let currentElement=this._nativeElement;for(;currentElement;){if("router-outlet"===currentElement.tagName.toLowerCase()){const routerOutlet=currentElement.componentInstance;if(routerOutlet&&"activatedRoute"in routerOutlet){const route=routerOutlet.activatedRoute;return this._nativeElement.closest("app-sidebar"),(routerOutlet.parentRoute||route)??null}}currentElement=currentElement.parentElement}return null}
}).__di_params__=["Router","HTMLElement","ActivatedRoute"],RouterLink._quarcDirective=[{selector:"[routerLink]"}],RouterLink.__quarc_original_name__="RouterLink",ActivatedRouteSnapshot=class{constructor(path="",params={},queryParams={},fragment=null,url=[],routeConfig=null){this.path=path,this.params=params,this.queryParams=queryParams,this.fragment=fragment,this.url=url,this.routeConfig=routeConfig}},ActivatedRoute=class{constructor(){this.__quarc_original_name__="ActivatedRoute",this.parent=null,this.outlet="primary",this._params=new BehaviorSubject({}),this._queryParams=new BehaviorSubject({}),this._fragment=new BehaviorSubject(null),this._url=new BehaviorSubject([]),this._snapshot=new ActivatedRouteSnapshot}get params(){return this._params}get queryParams(){return this._queryParams}get fragment(){return this._fragment}get url(){return this._url}get snapshot(){return this._snapshot}get routeConfig(){return this._snapshot.routeConfig??null}
updateSnapshot(path,params,queryParams,fragment,url,routeConfig){const paramsChanged=!this.areParamsEqual(this._snapshot.params,params),queryParamsChanged=!this.areParamsEqual(this._snapshot.queryParams,queryParams),fragmentChanged=this._snapshot.fragment!==fragment;this._snapshot.url.join("/"),url.join("/"),this._snapshot=new ActivatedRouteSnapshot(path,params,queryParams,fragment,url,routeConfig??null),paramsChanged&&this._params.next(params),queryParamsChanged&&this._queryParams.next(queryParams),fragmentChanged&&this._fragment.next(fragment),this._url.next(url)}areParamsEqual(params1,params2){const keys1=Object.keys(params1),keys2=Object.keys(params2);return keys1.length===keys2.length&&keys1.every(key=>params1[key]===params2[key])}},RouteMatcher=class{static matchRoutesRecursive(routes2,urlSegments,currentSegmentIndex,matchedRoutes){const result=this.findMatchingRoute(routes2,urlSegments,currentSegmentIndex,null,{},{});result&&matchedRoutes.push(result.route)}
static async findMatchingRouteAsync(routes2,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData){const remainingSegments=urlSegments.length-currentSegmentIndex;for(const route of routes2){const routeSegments=(route.path||"").split("/").filter(segment=>segment.length>0);if(0===routeSegments.length)continue;if(!this.doesRouteMatch(routeSegments,urlSegments,currentSegmentIndex))continue;const result=await this.processRouteAsync(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result}for(const route of routes2){const routeSegments=(route.path||"").split("/").filter(segment=>segment.length>0);if(0!==routeSegments.length)continue;const hasComponent=!(!route.component&&!route.loadComponent),hasChildren=!(!route.children&&!route.loadChildren);if(!(hasComponent&&remainingSegments>0)){if(!hasComponent&&hasChildren&&remainingSegments>0){
const result=await this.processRouteAsync(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result;continue}if(0===remainingSegments){const result=await this.processRouteAsync(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result}}}return null}static async processRouteAsync(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData){const params={...accumulatedParams};this.extractParams(routeSegments,urlSegments,currentSegmentIndex,params);const data={...accumulatedData,...route.data},nextSegmentIndex=currentSegmentIndex+routeSegments.length;if(route.component||route.loadComponent)return{route:this.createActivatedRoute(route,params,data,urlSegments,currentSegmentIndex,routeSegments.length,parentRoute),consumedSegments:nextSegmentIndex,hasComponent:!0};let children=[]
;if(route.children?children=route.children:route.loadChildren&&(children=await route.loadChildren()),children.length>0){const intermediateRoute=this.createActivatedRoute(route,params,data,urlSegments,currentSegmentIndex,routeSegments.length,parentRoute),childResult=await this.findMatchingRouteAsync(children,urlSegments,nextSegmentIndex,intermediateRoute,params,data);if(childResult)return childResult}return null}static findMatchingRoute(routes2,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData){const remainingSegments=urlSegments.length-currentSegmentIndex;for(const route of routes2){const routeSegments=(route.path||"").split("/").filter(segment=>segment.length>0);if(0===routeSegments.length)continue;if(!this.doesRouteMatch(routeSegments,urlSegments,currentSegmentIndex))continue;const result=this.processRoute(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result}for(const route of routes2){
const routeSegments=(route.path||"").split("/").filter(segment=>segment.length>0);if(0!==routeSegments.length)continue;const hasComponent=!(!route.component&&!route.loadComponent),hasChildren=!!route.children;if(!(hasComponent&&remainingSegments>0)){if(!hasComponent&&hasChildren&&remainingSegments>0){const result=this.processRoute(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result;continue}if(0===remainingSegments){const result=this.processRoute(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData);if(result)return result}}}return null}static processRoute(route,routeSegments,urlSegments,currentSegmentIndex,parentRoute,accumulatedParams,accumulatedData){const params={...accumulatedParams};this.extractParams(routeSegments,urlSegments,currentSegmentIndex,params);const data={...accumulatedData,...route.data},nextSegmentIndex=currentSegmentIndex+routeSegments.length
;if(route.component||route.loadComponent)return{route:this.createActivatedRoute(route,params,data,urlSegments,currentSegmentIndex,routeSegments.length,parentRoute),consumedSegments:nextSegmentIndex,hasComponent:!0};if(route.children&&route.children.length>0){const intermediateRoute=this.createActivatedRoute(route,params,data,urlSegments,currentSegmentIndex,routeSegments.length,parentRoute),childResult=this.findMatchingRoute(route.children,urlSegments,nextSegmentIndex,intermediateRoute,params,data);if(childResult)return childResult}return null}static createActivatedRoute(route,params,data,urlSegments,startIndex,segmentCount,parentRoute){const activatedRoute=new ActivatedRoute;return activatedRoute.path=route.path,activatedRoute.component=route.component,activatedRoute.loadComponent=route.loadComponent,activatedRoute.loadChildren=route.loadChildren,activatedRoute.data=data,activatedRoute.parent=parentRoute,route.children&&(activatedRoute.children=route.children),
activatedRoute.updateSnapshot(route.path??"",params,{},null,urlSegments.slice(startIndex,startIndex+segmentCount),route),route.parent=parentRoute??void 0,activatedRoute}static doesRouteMatch(routeSegments,urlSegments,startIndex){if(0===routeSegments.length&&startIndex>=urlSegments.length)return!0;if(startIndex+routeSegments.length>urlSegments.length)return!1;for(let i=0;i<routeSegments.length;i++){const routeSegment=routeSegments[i],urlSegment=urlSegments[startIndex+i];if(!routeSegment.startsWith(":")&&routeSegment!==urlSegment)return!1}return!0}static extractParams(routeSegments,urlSegments,startIndex,params){for(let i=0;i<routeSegments.length;i++){const routeSegment=routeSegments[i],urlSegment=urlSegments[startIndex+i];routeSegment.startsWith(":")&&(params[routeSegment.substring(1)]=urlSegment)}}},(RouterOutlet=class{constructor(router,element){this.router=router,this.element=element,this.urlSegments=[],this.parentUrlSegments=[],this.parentRoutes=[],
this.navigationChange$=new Subject,this.childOutlets=new Set,this.isRootOutlet=!1,this.initialize()}async initialize(){this.element.innerHTML="";const parentRouterOutlet=this.getParentRouterOutlet();if(parentRouterOutlet){if(this.parentRouterOutlet=parentRouterOutlet,this.parentUrlSegments=parentRouterOutlet.urlSegments,parentRouterOutlet.registerChildOutlet(this),!parentRouterOutlet.activatedRoute)throw Error("Parent ActivatedRoute not set!");this.parentRoute=parentRouterOutlet.activatedRoute,this.parentRoutes=await this.loadRoutes(parentRouterOutlet.activatedRoute)}else this.isRootOutlet=!0,this.router.registerRootOutlet(this),this.parentUrlSegments=location.pathname.split("/").filter(segment=>segment.length>0),this.parentRoutes=this.router.config,this.parentRoute=void 0;const matchedRoutes=await this.getMatchedRoutes();await this.updateContent(matchedRoutes)}onNavigationChange(event){this.handleNavigationChange(event)}async handleNavigationChange(event){
const newUrlSegments=event.url.split("?")[0].split("#")[0].split("/").filter(segment=>segment.length>0),queryParams=this.parseQueryParams(event.url),fragment=this.parseFragment(event.url);this.parentRouterOutlet?(this.parentUrlSegments=this.parentRouterOutlet.urlSegments,this.parentRouterOutlet.activatedRoute&&(this.parentRoute=this.parentRouterOutlet.activatedRoute,this.parentRoutes=await this.loadRoutes(this.parentRouterOutlet.activatedRoute))):(this.parentUrlSegments=newUrlSegments,this.parentRoutes=this.router.config,this.parentRoute=void 0);const matchedRoutes=await this.getMatchedRoutes(),newRoute=matchedRoutes[0],newParams=newRoute?.snapshot.params??{};if(this.hasComponentChanged(this.activatedRoute,newRoute)||!this.activatedRoute)await this.updateContent(matchedRoutes);else if(this.activatedRoute&&newRoute){const routeUrlSegments=newRoute.url.getValue()
;this.activatedRoute.updateSnapshot(newRoute.path??"",newParams,queryParams,fragment||null,routeUrlSegments,newRoute.routeConfig??void 0),this.urlSegments=this.calculateUrlSegments()}this.navigationChange$.next(event),this.notifyChildOutlets(event)}hasComponentChanged(current,next){return!(!current&&!next||current&&next&&(current.component??current.loadComponent)===(next.component??next.loadComponent)&&this.getFullParentPath(current)===this.getFullParentPath(next))}getFullParentPath(route){const paths=[];let current=route.parent;for(;current;)current.path&&paths.unshift(current.path),current=current.parent;return paths.join("/")}parseQueryParams(url){const queryString=url.split("?")[1]?.split("#")[0]??"",params={};if(!queryString)return params;for(const pair of queryString.split("&")){const[key,value]=pair.split("=");key&&(params[decodeURIComponent(key)]=decodeURIComponent(value??""))}return params}parseFragment(url){return url.split("#")[1]??""}areParamsEqual(params1,params2){
if(!params1&&!params2)return!0;if(!params1||!params2)return!1;const keys1=Object.keys(params1),keys2=Object.keys(params2);return keys1.length===keys2.length&&keys1.every(key=>params1[key]===params2[key])}notifyChildOutlets(event){for(const child of this.childOutlets)child.onNavigationChange(event)}registerChildOutlet(outlet){this.childOutlets.add(outlet)}unregisterChildOutlet(outlet){this.childOutlets.delete(outlet)}async updateContent(matchedRoutes){this.childOutlets.clear(),this.activatedRoute&&(this.router.unregisterActiveRoute(this.activatedRoute),this.popActivatedRouteFromStack(this.activatedRoute),this.activatedRoute=void 0),matchedRoutes.length>0?(this.activatedRoute=matchedRoutes[0],this.urlSegments=this.calculateUrlSegments(),this.router.registerActiveRoute(this.activatedRoute),this.pushActivatedRouteToStack(this.activatedRoute)):this.urlSegments=this.parentUrlSegments,await this.renderComponents(matchedRoutes)}pushActivatedRouteToStack(route){var _a
;(_a=window.__quarc).activatedRouteStack??(_a.activatedRouteStack=[]),window.__quarc.activatedRouteStack.push(route)}popActivatedRouteFromStack(route){if(!window.__quarc.activatedRouteStack)return;const index=window.__quarc.activatedRouteStack.indexOf(route);-1!==index&&window.__quarc.activatedRouteStack.splice(index,1)}calculateUrlSegments(){if(!this.activatedRoute?.path)return this.parentUrlSegments;const consumedSegments=this.activatedRoute.url.getValue().length;return this.parentUrlSegments.slice(consumedSegments)}async loadRoutes(route){let routes2=[];route.children?routes2=route.children:route.loadChildren&&(routes2=await route.loadChildren());for(const r of routes2)r.parent=route;return routes2}getParentRouterOutlet(){let parent=this.element.parentElement;for(;parent;){if("router-outlet"===parent.tagName.toLowerCase())return parent.componentInstance;parent=parent.parentElement}return null}async getMatchedRoutes(){
const result=await RouteMatcher.findMatchingRouteAsync(this.parentRoutes,this.parentUrlSegments,0,this.parentRouterOutlet?.activatedRoute??null,{},{});return result?[result.route]:[]}async renderComponents(matchedRoutes){const tags=[];for(const route of matchedRoutes){const selector=await this.resolveComponentSelector(route);selector&&tags.push(`<${selector}></${selector}>`)}this.element.innerHTML=tags.join("")}async resolveComponentSelector(route){if("string"==typeof route.component)return route.component;if("function"==typeof route.component&&!this.isComponentType(route.component))return await route.component();let componentType;return route.component&&this.isComponentType(route.component)?componentType=route.component:route.loadComponent&&(componentType=await route.loadComponent()),componentType?(WebComponentFactory.registerWithDependencies(componentType),componentType._quarcComponent[0].selector):null}isComponentType(component){
return"function"==typeof component&&"_quarcComponent"in component}destroy(){this.activatedRoute&&(this.router.unregisterActiveRoute(this.activatedRoute),this.popActivatedRouteFromStack(this.activatedRoute)),this.isRootOutlet?this.router.unregisterRootOutlet(this):this.parentRouterOutlet&&this.parentRouterOutlet.unregisterChildOutlet(this),this.navigationChange$.complete(),this.childOutlets.clear()}}).__di_params__=["Router","HTMLElement"],RouterOutlet._quarcComponent=[{selector:"router-outlet",style:"router-outlet{ display: contents; }",template:""}],RouterOutlet._scopeId="cxbv0wn",RouterOutlet.__quarc_original_name__="RouterOutlet",(RouterLinkActive=class{constructor(router,_nativeElement){this.router=router,this._nativeElement=_nativeElement,this.routerLinkActive=input("routerLinkActive",this,"routerLinkActive",this,""),this.routerLinkActiveOptions=input("routerLinkActiveOptions",this,"routerLinkActiveOptions",this,{}),this.updateActiveState(),
this.subscription=this.router.events$.subscribe(()=>{this.updateActiveState()}),effect2(()=>{this.routerLinkActive(),this.routerLinkActiveOptions(),this.updateActiveState()})}ngOnDestroy(){this.subscription?.unsubscribe()}updateActiveState(){const isActive=this.checkIsActive(),activeClass=this.routerLinkActive();activeClass&&(isActive?this._nativeElement.classList.add(activeClass):this._nativeElement.classList.remove(activeClass))}checkIsActive(){let routerLinkValue;const inputs=this._nativeElement.__inputs;if(inputs?.routerLink&&(routerLinkValue=inputs.routerLink()),routerLinkValue||(routerLinkValue=this._nativeElement.getAttribute("router-link")||this._nativeElement.getAttribute("routerLink")||void 0),!routerLinkValue)return!1;const linkPath=Array.isArray(routerLinkValue)?routerLinkValue.join("/"):routerLinkValue,currentUrl=this.normalizeUrl(location.pathname),linkUrl=this.normalizeUrl(linkPath)
;return this.routerLinkActiveOptions().exact?currentUrl===linkUrl:currentUrl===linkUrl||currentUrl.startsWith(linkUrl+"/")}normalizeUrl(url){let normalized=url.startsWith("/")?url:"/"+url;return normalized.length>1&&normalized.endsWith("/")&&(normalized=normalized.slice(0,-1)),normalized}}).__di_params__=["Router","HTMLElement"],RouterLinkActive._quarcDirective=[{selector:"[routerLinkActive]"}],RouterLinkActive.__quarc_original_name__="RouterLinkActive",WebComponentFactory=class _WebComponentFactory{static get registeredComponents(){var _a;return(_a=window.__quarc).registeredComponents??(_a.registeredComponents=new Map),window.__quarc.registeredComponents}static get componentTypes(){var _a;return(_a=window.__quarc).componentTypes??(_a.componentTypes=new Map),window.__quarc.componentTypes}static registerWithDependencies(componentType){const selector=ComponentUtils.getSelector(componentType),tagName=ComponentUtils.selectorToTagName(selector)
;if(this.registeredComponents.has(tagName))return!1;const componentMeta=componentType._quarcComponent?.[0];if(!componentMeta)return!1;const imports=componentMeta.imports||[];for(const importItem of imports)if(ComponentUtils.isComponentType(importItem)){const depType=importItem;this.registerWithDependencies(depType)}return this.tryRegister(componentType)}static tryRegister(componentType){const selector=ComponentUtils.getSelector(componentType),tagName=ComponentUtils.selectorToTagName(selector);if(this.registeredComponents.has(tagName))return!1;try{const WebComponentClass=class extends WebComponent2{constructor(){super()}connectedCallback(){const compType=_WebComponentFactory.componentTypes.get(tagName);if(compType&&!this.isInitialized()){const instance=_WebComponentFactory.createComponentInstance(compType,this);this.setComponentInstance(instance,compType)}super.connectedCallback()}};return customElements.define(tagName,WebComponentClass),
this.registeredComponents.set(tagName,WebComponentClass),this.componentTypes.set(tagName,componentType),!0}catch(error){return!1}}static getWebComponentInstances(){var _a;return(_a=window.__quarc).webComponentInstances??(_a.webComponentInstances=new Map),window.__quarc.webComponentInstances}static generateWebComponentId(){var _a;return(_a=window.__quarc).webComponentIdCounter??(_a.webComponentIdCounter=0),"wc-"+window.__quarc.webComponentIdCounter++}static createComponentInstance(componentType,element){const injector=Injector.get(),webComponent=element,webComponentId=this.generateWebComponentId();this.getWebComponentInstances().set(webComponentId,webComponent);const localProviders=[{provide:HTMLElement,useValue:element},{provide:ActivatedRoute,useValue:this.findActivatedRouteFromElement(element)}],componentMeta=componentType._quarcComponent?.[0]
;if(componentMeta?.providers)for(const providerType of componentMeta.providers)"function"==typeof providerType&&(localProviders.some(p=>p.provide===providerType)||localProviders.push({provide:providerType,useClass:providerType}));return injector.createInstanceWithProviders(componentType,localProviders)}static findActivatedRouteFromElement(element){let currentElement=element;const elementPath=[];for(;currentElement;){if(elementPath.push(`${currentElement.tagName.toLowerCase()}${currentElement.id?"#"+currentElement.id:""}${currentElement.className?"."+currentElement.className.replace(/\s+/g,"."):""}`),"router-outlet"===currentElement.tagName.toLowerCase()){const routerOutlet=currentElement.componentInstance;if(routerOutlet&&"activatedRoute"in routerOutlet)return routerOutlet.activatedRoute??null}currentElement=currentElement.parentElement}const stack=window.__quarc?.activatedRouteStack;return stack&&stack.length>0?stack[stack.length-1]:null}static create(componentType,selector){
const targetSelector=selector??ComponentUtils.getSelector(componentType),tagName=ComponentUtils.selectorToTagName(targetSelector);this.registerWithDependencies(componentType);let element=document.querySelector(tagName);return element||(element=document.createElement(tagName),document.body.appendChild(element)),element}static createInElement(componentType,parent){const tagName=ComponentUtils.selectorToTagName(ComponentUtils.getSelector(componentType));this.registerWithDependencies(componentType);const element=document.createElement(tagName);return parent.appendChild(element),element}static createFromElement(componentType,element){const tagName=ComponentUtils.selectorToTagName(ComponentUtils.getSelector(componentType));if(this.registerWithDependencies(componentType),element.tagName.toLowerCase()===tagName){const webComponent=element;if(!webComponent.isInitialized()){const instance=this.createComponentInstance(componentType,webComponent)
;webComponent.setComponentInstance(instance,componentType)}return webComponent}const newElement=document.createElement(tagName);return element.replaceWith(newElement),newElement}static isRegistered(selector){const tagName=ComponentUtils.selectorToTagName(selector);return this.registeredComponents.has(tagName)}static getRegisteredTagName(selector){const tagName=ComponentUtils.selectorToTagName(selector);return this.registeredComponents.has(tagName)?tagName:void 0}},(_Core=class _Core{constructor(component){this.component=component,this.injector=Injector.get(),this.registry=ComponentRegistry.get(),this.registry.register(component),this.instance={}}static bootstrap(component,providers,element){_Core.MainComponent=component;const instance=new _Core(component),registry=ComponentRegistry.get();registry.getAllDependencies(component).forEach(dep=>{registry.isLoaded(dep)||instance.preloadComponent(dep)}),
element??(element=document.querySelector(component._quarcComponent[0].selector)??document.body);const webComponent=instance.createWebComponent(element);return _Core.mainWebComponent=webComponent,registry.markAsLoaded(component,webComponent),instance}preloadComponent(componentType){this.registry.register(componentType)}createWebComponent(element){const webComponent=WebComponentFactory.createFromElement(this.component,element);return this.webComponent=webComponent,webComponent}static getMainWebComponent(){return _Core.mainWebComponent}getWebComponent(){return this.webComponent}static loadComponent(componentType,element){Injector.get();const registry=ComponentRegistry.get();let metadata=registry.getMetadata(componentType);if(metadata||(registry.register(componentType),metadata=registry.getMetadata(componentType)),metadata&&!metadata.loaded){const targetElement=element??document.querySelector(componentType._quarcComponent[0].selector)
;if(!targetElement)throw Error("Cannot find element for component: "+componentType._quarcComponent[0].selector);const webComponent=WebComponentFactory.createFromElement(componentType,targetElement);return registry.markAsLoaded(componentType,webComponent),webComponent}return metadata.webComponent}static getRegistry(){return ComponentRegistry.get()}}).MainComponent=null,_Core.mainWebComponent=null,Core=_Core,WebComponent2=class extends HTMLElement{constructor(){super(),this._initialized=!1,this.directiveInstances=[],this.isRendering=!1}setComponentInstance(component,componentType){this.componentInstance=component,this.componentType=componentType,componentType._scopeId&&(this.compiledScopeId=componentType._scopeId,this.runtimeScopeId=getUniqueScopeId(componentType._scopeId)),this.initialize()}getComponentOptions(){return this.componentType._quarcComponent[0]}isInitialized(){return this._initialized}connectedCallback(){this.componentInstance&&this.initialize()}disconnectedCallback(){
this.destroy()}initialize(){if(!this.componentInstance||!this.componentType||this._initialized)return;const encapsulation=this.componentType._quarcComponent[0].encapsulation??2;1!==encapsulation||this._shadowRoot?2===encapsulation&&this.runtimeScopeId&&this.setAttribute("_nghost-"+this.runtimeScopeId,""):this._shadowRoot=this.attachShadow({mode:"open"}),this.initializePipes(),this._initialized=!0,this.renderComponent()}initializePipes(){if(!this.componentInstance||!this.componentType)return;const pipes=this.componentType._quarcPipes||[],pipeRegistry=PipeRegistry.get(),pipeInstances={};for(const pipeType of pipes){pipeRegistry.register(pipeType);const metadata=pipeRegistry.getPipeMetadata(pipeType);if(metadata){const pipeInstance=new pipeType;pipeInstances[metadata.name]=pipeInstance}}this.componentInstance._pipes=pipeInstances}renderComponent(){if(!this.componentInstance||!this.componentType)return
;const style=this.componentType._quarcComponent[0].style??"",encapsulation=this.componentType._quarcComponent[0].encapsulation??2,renderTarget=this._shadowRoot??this;if(style)if(1===encapsulation){const styleElement=document.createElement("style");styleElement.textContent=style,renderTarget.appendChild(styleElement)}else if(2===encapsulation&&this.runtimeScopeId){const registry=getScopeRegistry();if(!registry.injectedStyles.has(this.runtimeScopeId)){const styleElement=document.createElement("style");styleElement.textContent=this.transformScopeAttributes(style),styleElement.setAttribute("data-scope-id",this.runtimeScopeId),document.head.appendChild(styleElement),registry.injectedStyles.add(this.runtimeScopeId)}}else if(0===encapsulation){const styleElement=document.createElement("style");styleElement.textContent=style,renderTarget.appendChild(styleElement)}this.renderEffect=effect2(()=>this.renderTemplate()),queueMicrotask(()=>{this.callNgOnInit()})}renderTemplate(){
if(!this.componentInstance||!this.componentType)return;if(this.isRendering)return;this.isRendering=!0;const template=this.componentType._quarcComponent[0].template??"",encapsulation=this.componentType._quarcComponent[0].encapsulation??2,renderTarget=this._shadowRoot??this;for(DirectiveRunner.destroyInstances(this.directiveInstances),this.directiveInstances=[],TemplateFragment.destroyEffects(renderTarget);renderTarget.firstChild;)renderTarget.removeChild(renderTarget.firstChild);new TemplateFragment(renderTarget,this.componentInstance,template).render(),2===encapsulation&&this.runtimeScopeId&&this.applyScopeAttributes(renderTarget),this.isRendering=!1,queueMicrotask(()=>{this.applyDirectives()})}rerender(){this.componentInstance&&this.componentType&&this._initialized&&this.renderTemplate()}applyDirectives(){const directives=this.componentType?._quarcDirectives;if(!directives||0===directives.length||!this.runtimeScopeId)return;const renderTarget=this._shadowRoot??this
;this.directiveInstances=DirectiveRunner.apply(renderTarget,this.runtimeScopeId,directives)}getAttributes(){return Array.from(this.attributes).map(a=>({name:a.name,value:a.value}))}toChildInfo(el){return{tagName:el.tagName.toLowerCase(),element:el,attributes:Array.from(el.attributes).map(a=>({name:a.name,value:a.value})),textContent:el.textContent}}getChildElements(){return Array.from((this._shadowRoot??this).querySelectorAll("*")).map(e=>this.toChildInfo(e))}getChildElementsByTagName(tag){return this.getChildElements().filter(c=>c.tagName===tag.toLowerCase())}getChildElementsBySelector(sel){return Array.from((this._shadowRoot??this).querySelectorAll(sel)).map(e=>this.toChildInfo(e))}getHostElement(){return this}getShadowRoot(){return this._shadowRoot}applyScopeAttributes(c){if(!this.runtimeScopeId)return;const a="_ngcontent-"+this.runtimeScopeId;c.querySelectorAll("*").forEach(e=>e.setAttribute(a,"")),Array.from(c.children).forEach(e=>e.setAttribute(a,""))}
transformScopeAttributes(css){return this.compiledScopeId&&this.runtimeScopeId?css.replace(RegExp("_nghost-"+this.compiledScopeId,"g"),"_nghost-"+this.runtimeScopeId).replace(RegExp("_ngcontent-"+this.compiledScopeId,"g"),"_ngcontent-"+this.runtimeScopeId):css}destroy(){this.callNgOnDestroy(),this.renderEffect?.destroy(),DirectiveRunner.destroyInstances(this.directiveInstances),this.directiveInstances=[];const renderTarget=this._shadowRoot??this;for(TemplateFragment.destroyEffects(renderTarget);renderTarget.firstChild;)renderTarget.removeChild(renderTarget.firstChild);this._initialized=!1}callNgOnInit(){this.componentInstance&&"ngOnInit"in this.componentInstance&&this.componentInstance.ngOnInit()}callNgOnDestroy(){this.componentInstance&&"ngOnDestroy"in this.componentInstance&&this.componentInstance.ngOnDestroy()}},DirectiveRegistry=class _DirectiveRegistry{constructor(){this.directives=new Map}static get(){
return _DirectiveRegistry.instance||(_DirectiveRegistry.instance=new _DirectiveRegistry),_DirectiveRegistry.instance}register(directiveType){if(this.directives.has(directiveType))return;const options=directiveType._quarcDirective?.[0];if(!options)return;const selectorMatcher=this.createSelectorMatcher(options.selector);this.directives.set(directiveType,{type:directiveType,options:options,selectorMatcher:selectorMatcher})}createSelectorMatcher(selector){if(selector.startsWith("[")&&selector.endsWith("]")){const attrName=selector.slice(1,-1);return el=>el.hasAttribute(attrName)}if(selector.startsWith(".")){const className=selector.slice(1);return el=>el.classList.contains(className)}return selector.includes("["),el=>el.matches(selector)}getMatchingDirectives(element){const matching=[];for(const metadata of this.directives.values())metadata.selectorMatcher(element)&&matching.push(metadata);return matching}getDirectiveMetadata(directiveType){return this.directives.get(directiveType)}
isRegistered(directiveType){return this.directives.has(directiveType)}getSelector(directiveType){return this.directives.get(directiveType)?.options.selector}},(DirectiveRunner=class{static apply(hostElement,scopeId,directiveTypes){const instances=[];for(const directiveType of directiveTypes)this.registry.register(directiveType);for(const directiveType of directiveTypes){const selector=directiveType._quarcDirective?.[0]?.selector;if(!selector)continue;const combinedSelector=`[_ngcontent-${scopeId}]${selector}, ${this.convertToDataBindSelector(selector,scopeId)}`,elements=hostElement.querySelectorAll(combinedSelector);for(const el of Array.from(elements)){const instance=this.createDirectiveForElement(directiveType,el);instance&&instances.push(instance)}}return instances}static createDirectiveForElement(directiveType,element){const injector=Injector.get(),localProviders=[{provide:HTMLElement,useValue:element}],activatedRoute=this.findActivatedRouteFromElement(element)
;localProviders.push({provide:ActivatedRoute,useValue:activatedRoute});const directive=injector.createInstanceWithProviders(directiveType,localProviders);directive._nativeElement=element;const instance={directive:directive,element:element,type:directiveType,effects:[]};return this.bindInputs(instance,element),this.bindHostListeners(instance,element),this.bindHostBindings(instance,element),directive.ngOnInit&&directive.ngOnInit(),instance}static bindInputs(instance,element){const options=instance.type._quarcDirective?.[0],inputs=options?.inputs??[],directive=instance.directive;for(const inputName of inputs){const attrValue=element.getAttribute(`[${inputName}]`)??element.getAttribute(inputName);null!==attrValue&&("function"==typeof directive[inputName]&&directive[inputName].set?directive[inputName].set(attrValue):directive[inputName]=attrValue)}}static bindHostListeners(instance,element){const directive=instance.directive,proto=Object.getPrototypeOf(directive)
;if(proto.__hostListeners)for(const[eventName,methodName]of Object.entries(proto.__hostListeners)){const handler=event=>{"function"==typeof directive[methodName]&&directive[methodName](event)};element.addEventListener(eventName,handler)}}static bindHostBindings(instance,element){const directive=instance.directive,proto=Object.getPrototypeOf(directive);if(proto.__hostBindings)for(const[propertyName,hostProperty]of Object.entries(proto.__hostBindings)){const eff=effect2(()=>{const value="function"==typeof directive[propertyName]?directive[propertyName]():directive[propertyName];if(hostProperty.startsWith("class.")){const className=hostProperty.slice(6);value?element.classList.add(className):element.classList.remove(className)}else if(hostProperty.startsWith("style.")){const styleProp=hostProperty.slice(6);element.style.setProperty(styleProp,value??"")}else if(hostProperty.startsWith("attr.")){const attrName=hostProperty.slice(5)
;null!=value?element.setAttribute(attrName,value+""):element.removeAttribute(attrName)}else element[hostProperty]=value});instance.effects.push(eff)}}static destroyInstances(instances){for(const instance of instances){for(const eff of instance.effects)eff.destroy();instance.directive.ngOnDestroy&&instance.directive.ngOnDestroy()}}static convertToDataBindSelector(selector,scopeId){const attrMatch=selector.match(/^\[(\w+)\]$/);if(attrMatch){const attrName=attrMatch[1];return`[_ngcontent-${scopeId}][${this.camelToKebab(attrName)}]`}return`[_ngcontent-${scopeId}]${selector}`}static camelToKebab(str){return str.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}static findActivatedRouteFromElement(element){let currentElement=element;for(;currentElement;){if("router-outlet"===currentElement.tagName.toLowerCase()){const routerOutlet=currentElement.componentInstance;if(routerOutlet&&"activatedRoute"in routerOutlet)return routerOutlet.activatedRoute??null}
currentElement=currentElement.parentElement}const stack=window.__quarc?.activatedRouteStack;return stack&&stack.length>0?stack[stack.length-1]:null}}).registry=DirectiveRegistry.get(),PipeRegistry=class _PipeRegistry{constructor(){this.pipes=new Map,this.pipeMetadata=new Map}static get(){return _PipeRegistry.instance||(_PipeRegistry.instance=new _PipeRegistry),_PipeRegistry.instance}register(pipeType){const metadata=pipeType._quarcPipe?.[0];if(!metadata)return;const pipeName=metadata.name,pure=!1!==metadata.pure;this.pipes.set(pipeName,pipeType),this.pipeMetadata.set(pipeType,{name:pipeName,pure:pure})}getPipe(name){return this.pipes.get(name)}getPipeMetadata(pipeType){return this.pipeMetadata.get(pipeType)}getAllPipes(){return new Map(this.pipes)}},INPUT_SIGNAL=Symbol("inputSignal"),inputFn.required=inputRequired,input=inputFn,OUTPUT_EMITTER=Symbol("outputEmitter"),SIGNAL=Symbol("signal"),ComponentUtils=class{static selectorToTagName(selector){
return selector.toLowerCase().replace(/[^a-z0-9-]/g,"-")}static isComponentType(item){return!("function"!=typeof item||!item._quarcComponent)||!(!item||"object"!=typeof item||!item._quarcComponent)}static getSelector(componentType){return componentType._quarcComponent?.[0]?.selector||""}},TemplateFragment=class _TemplateFragment{constructor(container,component,template){for(this.ngContainerMarkers=[],this.currentContext=null,this.container=container,this.component=component,this.template=template??"",this.originalContent=document.createDocumentFragment();container.firstChild;)this.originalContent.appendChild(container.firstChild);container.templateFragment=this,container.component=component,container.template=this.template,container.originalContent=this.originalContent}render(){if(!this.template)return;const templateElement=document.createElement("template");templateElement.innerHTML=this.template;const renderedContent=templateElement.content.cloneNode(!0)
;this.processStructuralDirectives(renderedContent);const tempContainer=document.createElement("div");for(;renderedContent.firstChild;)tempContainer.appendChild(renderedContent.firstChild);for(this.processPropertyBindings(tempContainer);tempContainer.firstChild;)this.container.appendChild(tempContainer.firstChild)}processStructuralDirectives(fragment){this.processSelectFor(fragment);const ngContainers=Array.from(fragment.querySelectorAll("ng-container"));for(const c of ngContainers)this.processNgContainer(c)}processSelectFor(fragment){for(const s of Array.from(fragment.querySelectorAll("select,optgroup"))){const w=document.createTreeWalker(s,NodeFilter.SHOW_COMMENT),m=[];let n;for(;n=w.nextNode();)(n.textContent||"").startsWith("F:")&&m.push(n);for(const c of m)this.expandFor(s,c)}}expandFor(p,m){const[,v,e]=(m.textContent||"").split(":"),t=[];let c=m.nextSibling;for(;c&&(8!==c.nodeType||"/F"!==c.textContent);)1===c.nodeType&&t.push(c),c=c.nextSibling;if(t.length)try{
const items=this.evaluateExpression(e);if(!items)return;for(const i of Array.isArray(items)?items:Object.values(items))for(const el of t){const cl=el.cloneNode(!0);cl.__quarcContext={[v]:i},p.insertBefore(cl,m)}t.forEach(x=>x.remove()),m.remove(),c?.parentNode?.removeChild(c)}catch{}}processNgContainer(ngContainer){const ngIfAttr=ngContainer.getAttribute("*ngIf"),ngForAttr=ngContainer.getAttribute("*ngFor"),parent=ngContainer.parentNode;if(!parent)return;let markerComment="ng-container-start";ngIfAttr&&(markerComment+=` *ngIf="${ngIfAttr}"`),ngForAttr&&(markerComment+=` *ngFor="${ngForAttr}"`);const startMarker=document.createComment(markerComment),endMarker=document.createComment("ng-container-end"),originalTemplate=ngContainer.innerHTML;if(this.ngContainerMarkers.push({startMarker:startMarker,endMarker:endMarker,condition:ngIfAttr||void 0,originalTemplate:originalTemplate,ngForExpression:ngForAttr||void 0}),parent.insertBefore(startMarker,ngContainer),
ngForAttr)this.processNgForDirective(ngContainer,ngForAttr,parent,endMarker);else if(ngIfAttr)this.processNgIfDirective(ngContainer,ngIfAttr,parent,endMarker);else{for(;ngContainer.firstChild;)parent.insertBefore(ngContainer.firstChild,ngContainer);parent.insertBefore(endMarker,ngContainer),ngContainer.remove()}}processNgIfDirective(ngContainer,ngIfExpression,parent,endMarker){const parentContext=ngContainer.__quarcContext,{condition:condition,aliasVariable:aliasVariable}=this.parseNgIfExpression(ngIfExpression);try{const value=this.evaluateExpressionWithContext(condition,parentContext);if(!value)return parent.insertBefore(endMarker,ngContainer),void ngContainer.remove();if(aliasVariable){const ctx={...parentContext,[aliasVariable]:value},content=ngContainer.childNodes,nodes=[];for(;content.length>0;)nodes.push(content[0]),parent.insertBefore(content[0],ngContainer);for(const node of nodes)1===node.nodeType&&(node.__quarcContext=ctx,this.propagateContextToChildren(node,ctx))
}else for(;ngContainer.firstChild;)parent.insertBefore(ngContainer.firstChild,ngContainer);parent.insertBefore(endMarker,ngContainer),ngContainer.remove()}catch{parent.insertBefore(endMarker,ngContainer),ngContainer.remove()}}parseNgIfExpression(expression){const letMatch=expression.match(/^(.+);\s*let\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*$/);return letMatch?{condition:letMatch[1].trim(),aliasVariable:letMatch[2].trim()}:{condition:expression.trim()}}propagateContextToChildren(element,ctx){const children=element.querySelectorAll("*");for(const child of Array.from(children))child.__quarcContext=ctx}processNgForDirective(ngContainer,ngForExpression,parent,endMarker){const forPart=ngForExpression.split(";").map(part=>part.trim())[0],forOfMatch=forPart.match(/^let\s+(\w+)\s+of\s+(.+)$/),forInMatch=forPart.match(/^let\s+(\w+)\s+in\s+(.+)$/),match=forOfMatch||forInMatch,isForIn=!!forInMatch;if(!match)return parent.insertBefore(endMarker,ngContainer),void ngContainer.remove()
;const variableName=match[1],iterableExpression=match[2],loopTemplate=ngContainer.innerHTML,startMarker=document.createComment("ngFor-start: "+ngForExpression),parentContext=ngContainer.__quarcContext;parent.insertBefore(startMarker,ngContainer),parent.insertBefore(endMarker,ngContainer),ngContainer.remove(),this.registerEffect(this.container,effect2(()=>{let current=startMarker.nextSibling;for(;current&&current!==endMarker;){const next=current.nextSibling;1===current.nodeType&&_TemplateFragment.destroyEffects(current),current.parentNode?.removeChild(current),current=next}try{const iterable=this.evaluateExpressionWithContext(iterableExpression,parentContext);if(null==iterable)return;const fragment=document.createDocumentFragment();if(isForIn)for(const key in iterable)({}).hasOwnProperty.call(iterable,key)&&this.renderForItem(fragment,loopTemplate,variableName,key,parentContext);else{const items=Array.isArray(iterable)?iterable:Object.values(iterable)
;for(const item of items)this.renderForItem(fragment,loopTemplate,variableName,item,parentContext)}parent.insertBefore(fragment,endMarker),this.reapplyDirectives()}catch{}}))}getWebComponent(){let el=this.container;for(;el;){if(el instanceof WebComponent2)return el;el=el.parentElement}return null}reapplyDirectives(){const webComponent=this.getWebComponent();webComponent&&queueMicrotask(()=>webComponent.applyDirectives())}renderForItem(fragment,template,variableName,value,parentContext){const ctx={...parentContext,[variableName]:value},t=document.createElement("template");t.innerHTML=template;const content=t.content;for(const el of Array.from(content.querySelectorAll("*")))el.__quarcContext=ctx;this.processStructuralDirectivesWithContext(content,ctx);const tempDiv=document.createElement("div");for(;content.firstChild;)tempDiv.appendChild(content.firstChild);for(this.processPropertyBindings(tempDiv),
this.applyScopeAttributes(tempDiv);tempDiv.firstChild;)fragment.appendChild(tempDiv.firstChild)}getScopeId(){let el=this.container;for(;el;){for(const attr of Array.from(el.attributes))if(attr.name.startsWith("_nghost-"))return attr.name.substring(8);el=el.parentElement}return null}applyScopeAttributes(container){const scopeId=this.getScopeId();if(!scopeId)return;const attr="_ngcontent-"+scopeId;container.querySelectorAll("*").forEach(e=>e.setAttribute(attr,"")),Array.from(container.children).forEach(e=>e.setAttribute(attr,""))}processStructuralDirectivesWithContext(fragment,ctx){const ngContainers=Array.from(fragment.querySelectorAll("ng-container"));for(const c of ngContainers)c.__quarcContext=ctx,this.processNgContainer(c)}evaluateCondition(condition){try{return Function("component",`with(component) { return ${condition}; }`)(this.component)}catch{return!1}}evaluateConditionWithContext(condition,ctx){try{const mergedContext={...this.component,...ctx||{}}
;return Function("c",`with(c) { return ${condition}; }`)(mergedContext)}catch{return!1}}rerenderFragment(markerIndex){if(markerIndex<0||markerIndex>=this.ngContainerMarkers.length)return;const marker=this.ngContainerMarkers[markerIndex],{startMarker:startMarker,endMarker:endMarker,condition:condition,originalTemplate:originalTemplate}=marker;let currentNode=startMarker.nextSibling;for(;currentNode&&currentNode!==endMarker;){const nextNode=currentNode.nextSibling;currentNode.remove(),currentNode=nextNode}if(!condition||this.evaluateCondition(condition)){const tempContainer=document.createElement("div");tempContainer.innerHTML=originalTemplate;const fragment=document.createDocumentFragment();for(;tempContainer.firstChild;)fragment.appendChild(tempContainer.firstChild);const tempWrapper=document.createElement("div");tempWrapper.appendChild(fragment),this.processPropertyBindings(tempWrapper);const parent=startMarker.parentNode
;if(parent)for(;tempWrapper.firstChild;)parent.insertBefore(tempWrapper.firstChild,endMarker)}}rerenderAllFragments(){for(let i=0;i<this.ngContainerMarkers.length;i++)this.rerenderFragment(i)}getFragmentMarkers(){return this.ngContainerMarkers}processPropertyBindings(container){const allElements=Array.from(container.querySelectorAll("*"));for(const element of allElements)this.currentContext=this.buildContextForElement(element),this.processElementBindings(element),this.currentContext=null}buildContextForElement(el){const chain=[];let c=el;for(;c&&(c.__quarcContext&&chain.unshift(c.__quarcContext),!c.component);)c=c.parentElement;const ctx=Object.create(this.component);for(const x of chain)Object.assign(ctx,x);return ctx}processElementBindings(element){const attributesToRemove=[],attributes=Array.from(element.attributes);for(const attr of attributes)if(attr.name.startsWith("(")&&attr.name.endsWith(")"))this.processOutputBinding(element,attr.name,attr.value),
attributesToRemove.push(attr.name);else if(attr.name.startsWith("[")&&attr.name.endsWith("]")){const propertyName=attr.name.slice(1,-1),expression=attr.value;if(propertyName.startsWith("attr."))this.processAttrBinding(element,propertyName.slice(5),expression);else if(propertyName.startsWith("style."))this.processStyleBinding(element,propertyName.slice(6),expression);else if(propertyName.startsWith("class."))this.processClassBinding(element,propertyName.slice(6),expression);else if(this.isCustomElement(element))this.processInputBinding(element,propertyName,expression);else{const camelCaseName=this.kebabToCamel(propertyName);this.processDomPropertyBinding(element,camelCaseName,expression),this.processInputBinding(element,camelCaseName,expression),this.setInputAttribute(element,propertyName,expression)}attributesToRemove.push(attr.name)}else if("data-bind"===attr.name)this.processDataBind(element,attr.value),attributesToRemove.push(attr.name);else if(attr.name.startsWith("data-input-")){
const propertyName=attr.name.slice(11);this.processInputBinding(element,propertyName,attr.value),attributesToRemove.push(attr.name)}else if(attr.name.startsWith("data-on-")){const eventName=attr.name.slice(8);this.processDataOutputBinding(element,eventName,attr.value),attributesToRemove.push(attr.name)}else"data-quarc-attr-bindings"===attr.name&&(this.processQuarcAttrBindings(element,attr.value),attributesToRemove.push(attr.name));for(const attrName of attributesToRemove)element.removeAttribute(attrName)}processQuarcAttrBindings(el,json){try{const b=JSON.parse(json.replace(/&apos;/g,"'").replace(/'/g,'"'));for(const{attr:attr,expr:expr}of b)this.setAttr(el,attr,this.eval(expr))}catch{}}isCustomElement(element){return element.tagName.includes("-")}processOutputBinding(element,attrName,expression){const eventName=this.camelToKebab(attrName.slice(1,-1));this.processDataOutputBinding(element,eventName,expression)}processDataOutputBinding(el,ev,expr){
const ctx=this.currentContext??this.component;el.addEventListener(ev,e=>{try{Function("c","$event",`with(c){return ${expr}}`)(ctx,e.detail??e)}catch{}})}processDataBind(el,expr){const ctx=this.currentContext??this.component;this.registerEffect(el,effect2(()=>{try{el.innerHTML=(this.evalWithContext(expr,ctx)??"")+""}catch{}}))}processInputBinding(el,prop,expr){el.__inputs||(el.__inputs={});const ctx=this.currentContext??this.component,s=signal(this.evalWithContext(expr,ctx));el.__inputs[prop]=s,this.registerEffect(el,effect2(()=>{try{s.set(this.evalWithContext(expr,ctx))}catch{}}))}processAttrBinding(el,attr,expr){const ctx=this.currentContext??this.component;this.registerEffect(el,effect2(()=>{try{this.setAttr(el,attr,this.evalWithContext(expr,ctx))}catch{}}))}setAttr(el,attr,v){null==v||!1===v?el.removeAttribute(attr):el.setAttribute(attr,!0===v?"":v+"")}eval(expr){return Function("c",`with(c){return ${expr}}`)(this.currentContext??this.component)}evalWithContext(expr,ctx){
return Function("c",`with(c){return ${expr}}`)(ctx)}registerEffect(el,effectRef){el.__effects||(el.__effects=[]),el.__effects.push(effectRef)}processStyleBinding(el,prop,expr){const ctx=this.currentContext??this.component,p=prop.replace(/([A-Z])/g,"-$1").toLowerCase();this.registerEffect(el,effect2(()=>{try{const v=this.evalWithContext(expr,ctx);null==v||!1===v?el.style.removeProperty(p):el.style.setProperty(p,v+"")}catch{}}))}processClassBinding(el,cls,expr){const ctx=this.currentContext??this.component;this.registerEffect(el,effect2(()=>{try{this.evalWithContext(expr,ctx)?el.classList.add(cls):el.classList.remove(cls)}catch{}}))}processDomPropertyBinding(el,prop,expr){const ctx=this.currentContext??this.component,resolvedProp={innerhtml:"innerHTML",textcontent:"textContent",innertext:"innerText",classname:"className"}[prop.toLowerCase()]??prop;this.registerEffect(el,effect2(()=>{try{el[resolvedProp]=this.evalWithContext(expr,ctx)}catch{}}))}evaluateExpression(expr){try{
return this.eval(expr)}catch{return}}evaluateExpressionWithContext(expr,ctx){try{const mergedContext={...this.component,...ctx||{}};return Function("c",`with(c){return ${expr}}`)(mergedContext)}catch{return}}static getOrCreate(container,component,template){return container.templateFragment?container.templateFragment:new _TemplateFragment(container,component,template)}static destroyEffects(container){const allElements=container.querySelectorAll("*");for(const el of Array.from(allElements)){const htmlEl=el;if(htmlEl.__effects){for(const e of htmlEl.__effects)e.destroy();htmlEl.__effects=[]}}if(container.__effects){for(const e of container.__effects)e.destroy();container.__effects=[]}}camelToKebab(str){return str.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}kebabToCamel(str){return str.replace(/-([a-z])/g,(_,letter)=>letter.toUpperCase())}setInputAttribute(el,attrName,expr){const ctx=this.currentContext??this.component;this.registerEffect(el,effect2(()=>{try{
const value=this.evalWithContext(expr,ctx);null==value||!1===value?el.removeAttribute(attrName):!0===value?el.setAttribute(attrName,""):"object"==typeof value?el.setAttribute(attrName,JSON.stringify(value)):el.setAttribute(attrName,value+"")}catch{}}))}},(UpperCasePipe=class{transform(value){return null==value?"":(value+"").toUpperCase()}})._quarcPipe=[{name:"uppercase"}],(LowerCasePipe=class{transform(value){return null==value?"":(value+"").toLowerCase()}})._quarcPipe=[{name:"lowercase"}],(JsonPipe=class{transform(value){try{return JSON.stringify(value,null,2)}catch(e){return value+""}}})._quarcPipe=[{name:"json"}],(CamelCasePipe=class{transform(value){return null==value?"":(value+"").replace(/[-_\s]+(.)?/g,(_,char)=>char?char.toUpperCase():"").replace(/^[A-Z]/,char=>char.toLowerCase())}})._quarcPipe=[{name:"camelcase"}],(PascalCasePipe=class{transform(value){
return null==value?"":(value+"").replace(/[-_\s]+(.)?/g,(_,char)=>char?char.toUpperCase():"").replace(/^[a-z]/,char=>char.toUpperCase())}})._quarcPipe=[{name:"pascalcase"}],(SnakeCasePipe=class{transform(value){return null==value?"":(value+"").replace(/([A-Z])/g,"_$1").replace(/[-\s]+/g,"_").replace(/^_/,"").toLowerCase()}})._quarcPipe=[{name:"snakecase"}],(KebabCasePipe=class{transform(value){return null==value?"":(value+"").replace(/([A-Z])/g,"-$1").replace(/[_\s]+/g,"-").replace(/^-/,"").toLowerCase()}})._quarcPipe=[{name:"kebabcase"}],(SubstrPipe=class{transform(value,start,length){if(null==value)return"";const str=value+"";return void 0!==length?str.substr(start,length):str.substr(start)}})._quarcPipe=[{name:"substr"}],(DatePipe=class{transform(value,format="medium"){if(null==value)return"";const date=value instanceof Date?value:new Date(value);if(isNaN(date.getTime()))return value+"";switch(format){case"short":return this.formatShort(date);case"medium":
return this.formatMedium(date);case"long":return this.formatLong(date);case"full":return this.formatFull(date);case"shortDate":return this.formatShortDate(date);case"mediumDate":return this.formatMediumDate(date);case"longDate":return this.formatLongDate(date);case"fullDate":return this.formatFullDate(date);case"shortTime":return this.formatShortTime(date);case"mediumTime":return this.formatMediumTime(date);default:return this.formatCustom(date,format)}}pad(num,size=2){return(num+"").padStart(size,"0")}formatShort(date){return`${this.pad(date.getMonth()+1)}/${this.pad(date.getDate())}/${date.getFullYear().toString().substr(2)}, ${this.formatShortTime(date)}`}formatMedium(date){return`${this.getMonthShort(date)} ${date.getDate()}, ${date.getFullYear()}, ${this.formatMediumTime(date)}`}formatLong(date){return`${this.getMonthLong(date)} ${date.getDate()}, ${date.getFullYear()} at ${this.formatMediumTime(date)}`}formatFull(date){
return`${this.getDayLong(date)}, ${this.getMonthLong(date)} ${date.getDate()}, ${date.getFullYear()} at ${this.formatMediumTime(date)}`}formatShortDate(date){return`${this.pad(date.getMonth()+1)}/${this.pad(date.getDate())}/${date.getFullYear().toString().substr(2)}`}formatMediumDate(date){return`${this.getMonthShort(date)} ${date.getDate()}, ${date.getFullYear()}`}formatLongDate(date){return`${this.getMonthLong(date)} ${date.getDate()}, ${date.getFullYear()}`}formatFullDate(date){return`${this.getDayLong(date)}, ${this.getMonthLong(date)} ${date.getDate()}, ${date.getFullYear()}`}formatShortTime(date){const hours=date.getHours(),minutes=date.getMinutes(),ampm=hours>=12?"PM":"AM";return`${hours%12||12}:${this.pad(minutes)} ${ampm}`}formatMediumTime(date){const hours=date.getHours(),minutes=date.getMinutes(),seconds=date.getSeconds(),ampm=hours>=12?"PM":"AM";return`${hours%12||12}:${this.pad(minutes)}:${this.pad(seconds)} ${ampm}`}getMonthShort(date){
return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][date.getMonth()]}getMonthLong(date){return["January","February","March","April","May","June","July","August","September","October","November","December"][date.getMonth()]}getDayLong(date){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][date.getDay()]}formatCustom(date,format){
return format.replace(/yyyy/g,date.getFullYear()+"").replace(/yy/g,(date.getFullYear()+"").substr(2)).replace(/MM/g,this.pad(date.getMonth()+1)).replace(/M/g,date.getMonth()+1+"").replace(/dd/g,this.pad(date.getDate())).replace(/d/g,date.getDate()+"").replace(/HH/g,this.pad(date.getHours())).replace(/H/g,date.getHours()+"").replace(/hh/g,this.pad(date.getHours()%12||12)).replace(/h/g,(date.getHours()%12||12)+"").replace(/mm/g,this.pad(date.getMinutes())).replace(/m/g,date.getMinutes()+"").replace(/ss/g,this.pad(date.getSeconds())).replace(/s/g,date.getSeconds()+"").replace(/a/g,date.getHours()>=12?"PM":"AM")}})._quarcPipe=[{name:"date"}],(AppComponent=class{})._quarcComponent=[{selector:"app-root",
template:'\n <nav>\n <a href="/">Home</a> |\n <a href="/uppercase">UpperCase</a> |\n <a href="/lowercase">LowerCase</a> |\n <a href="/json">JSON</a> |\n <a href="/case">Case</a> |\n <a href="/date">Date</a> |\n <a href="/substr">Substr</a> |\n <a href="/chain">Chain</a>\n </nav>\n <router-outlet></router-outlet>\n ',imports:[RouterOutlet]}],AppComponent._scopeId="c7z3d6i",AppComponent._quarcDirectives=[RouterOutlet],AppComponent.__quarc_original_name__="AppComponent",(HomeComponent=class{})._quarcComponent=[{selector:"app-home",template:'\n <h1>E2E Pipes Test Suite</h1>\n <p>Navigate to test different pipes</p>\n <div id="test-status">ready</div>\n '}],HomeComponent._scopeId="c3as1bp",HomeComponent.__quarc_original_name__="HomeComponent",(UpperCaseTestComponent=class{constructor(){this.text=signal("quarc framework"),this.nullValue=signal(null)}
getText(){return"from method"}})._quarcComponent=[{selector:"app-uppercase-test",
template:'\n <h2>UpperCase Pipe Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: Hardcoded string</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(\'hello world\')"></span></div>\n <div class="expected">HELLO WORLD</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: Signal value</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(text())"></span></div>\n <div class="expected">QUARC FRAMEWORK</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Method call</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(getText())"></span></div>\n <div class="expected">FROM METHOD</div>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: With || operator</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(nullValue() || \'default\')"></span></div>\n <div class="expected">DEFAULT</div>\n </div>\n ',
imports:[UpperCasePipe]}],UpperCaseTestComponent._scopeId="cqln131",UpperCaseTestComponent._quarcDirectives=[UpperCasePipe],UpperCaseTestComponent.__quarc_original_name__="UpperCaseTestComponent",(LowerCaseTestComponent=class{constructor(){this.text=signal("QUARC FRAMEWORK")}getText(){return"FROM METHOD"}})._quarcComponent=[{selector:"app-lowercase-test",
template:'\n <h2>LowerCase Pipe Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: Hardcoded string</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'lowercase\']?.transform(\'HELLO WORLD\')"></span></div>\n <div class="expected">hello world</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: Signal value</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'lowercase\']?.transform(text())"></span></div>\n <div class="expected">quarc framework</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Method call</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'lowercase\']?.transform(getText())"></span></div>\n <div class="expected">from method</div>\n </div>\n ',imports:[LowerCasePipe]}],LowerCaseTestComponent._scopeId="c2cyq3o",LowerCaseTestComponent._quarcDirectives=[LowerCasePipe],
LowerCaseTestComponent.__quarc_original_name__="LowerCaseTestComponent",(JsonTestComponent=class{constructor(){this.obj=signal({name:"Test",value:123}),this.arr=signal([1,2,3])}getObject(){return{method:!0}}})._quarcComponent=[{selector:"app-json-test",
template:'\n <h2>JSON Pipe Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: Number literal</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform(123)"></span></pre>\n <pre class="expected">123</pre>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: String literal</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform("string")"></span></pre>\n <pre class="expected">"string"</pre>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Boolean literal</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform(true)"></span></pre>\n <pre class="expected">true</pre>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: Object from signal</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform(obj())"></span></pre>\n <pre class="expected">{"name":"Test","value":123}</pre>\n </div>\n\n <div class="test" id="test-5">\n <h3>Test 5: Array from signal</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform(arr())"></span></pre>\n <pre class="expected">[1,2,3]</pre>\n </div>\n\n <div class="test" id="test-6">\n <h3>Test 6: Object from method</h3>\n <pre class="result"><span [inner-text]="_pipes?.[\'json\']?.transform(getObject())"></span></pre>\n <pre class="expected">{"method":true}</pre>\n </div>\n ',
imports:[JsonPipe]}],JsonTestComponent._scopeId="c5mjt4r",JsonTestComponent._quarcDirectives=[JsonPipe],JsonTestComponent.__quarc_original_name__="JsonTestComponent",(CaseTestComponent=class{constructor(){this.text=signal("test-value")}})._quarcComponent=[{selector:"app-case-test",
template:'\n <h2>Case Pipes Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: CamelCase</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'camelcase\']?.transform(\'hello-world\')"></span></div>\n <div class="expected">helloWorld</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: PascalCase</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'pascalcase\']?.transform(\'hello-world\')"></span></div>\n <div class="expected">HelloWorld</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: SnakeCase</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'snakecase\']?.transform(\'helloWorld\')"></span></div>\n <div class="expected">hello_world</div>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: KebabCase</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'kebabcase\']?.transform(\'helloWorld\')"></span></div>\n <div class="expected">hello-world</div>\n </div>\n\n <div class="test" id="test-5">\n <h3>Test 5: CamelCase from signal</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'camelcase\']?.transform(text())"></span></div>\n <div class="expected">testValue</div>\n </div>\n ',
imports:[CamelCasePipe,PascalCasePipe,SnakeCasePipe,KebabCasePipe]}],CaseTestComponent._scopeId="c6to77h",CaseTestComponent._quarcDirectives=[CamelCasePipe,PascalCasePipe,SnakeCasePipe,KebabCasePipe],CaseTestComponent.__quarc_original_name__="CaseTestComponent",(DateTestComponent=class{constructor(){this.date=signal(new Date("2024-01-15T14:30:45"))}getDate(){return new Date("2024-01-15T14:30:45")}})._quarcComponent=[{selector:"app-date-test",
template:'\n <h2>Date Pipe Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: Custom format yyyy-MM-dd</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'date\']?.transform(date(), \'yyyy-MM-dd\')"></span></div>\n <div class="expected">2024-01-15</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: Custom format HH:mm:ss</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'date\']?.transform(date(), \'HH, mm, ss\')"></span></div>\n <div class="expected">14:30:45</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Short date</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'date\']?.transform(date(), \'shortDate\')"></span></div>\n <div class="expected-pattern">01/15/24</div>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: From method</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'date\']?.transform(getDate(), \'yyyy-MM-dd\')"></span></div>\n <div class="expected">2024-01-15</div>\n </div>\n ',
imports:[DatePipe]}],DateTestComponent._scopeId="cnqmpoh",DateTestComponent._quarcDirectives=[DatePipe],DateTestComponent.__quarc_original_name__="DateTestComponent",(SubstrTestComponent=class{constructor(){this.text=signal("quarc framework")}getText(){return"from method call"}})._quarcComponent=[{selector:"app-substr-test",
template:'\n <h2>Substr Pipe Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: Hardcoded with start and length</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(\'hello world\', 0, 5)"></span></div>\n <div class="expected">hello</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: Hardcoded with start only</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(\'hello world\', 6)"></span></div>\n <div class="expected">world</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Signal value</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(text(), 0, 10)"></span></div>\n <div class="expected">quarc fram</div>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: Method call</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(getText(), 5, 6)"></span></div>\n <div class="expected">method</div>\n </div>\n ',
imports:[SubstrPipe]}],SubstrTestComponent._scopeId="cku4wzg",SubstrTestComponent._quarcDirectives=[SubstrPipe],SubstrTestComponent.__quarc_original_name__="SubstrTestComponent",(ChainTestComponent=class{constructor(){this.text=signal("HELLO-WORLD")}getText(){return"test value"}})._quarcComponent=[{selector:"app-chain-test",
template:'\n <h2>Pipe Chain Test</h2>\n\n <div class="test" id="test-1">\n <h3>Test 1: lowercase | uppercase</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(_pipes?.[\'lowercase\']?.transform(\'Hello\'))"></span></div>\n <div class="expected">HELLO</div>\n </div>\n\n <div class="test" id="test-2">\n <h3>Test 2: uppercase | substr</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(_pipes?.[\'uppercase\']?.transform(\'hello world\'), 0, 5)"></span></div>\n <div class="expected">HELLO</div>\n </div>\n\n <div class="test" id="test-3">\n <h3>Test 3: Signal with chain</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'camelcase\']?.transform(_pipes?.[\'lowercase\']?.transform(text()))"></span></div>\n <div class="expected">helloWorld</div>\n </div>\n\n <div class="test" id="test-4">\n <h3>Test 4: Method with chain</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'substr\']?.transform(_pipes?.[\'uppercase\']?.transform(getText()), 0, 4)"></span></div>\n <div class="expected">TEST</div>\n </div>\n\n <div class="test" id="test-5">\n <h3>Test 5: Triple chain</h3>\n <div class="result"><span [inner-text]="_pipes?.[\'uppercase\']?.transform(_pipes?.[\'camelcase\']?.transform(_pipes?.[\'lowercase\']?.transform(\'HELLO-WORLD\')))"></span></div>\n <div class="expected">HELLOWORLD</div>\n </div>\n ',
imports:[UpperCasePipe,LowerCasePipe,SubstrPipe,CamelCasePipe]}],ChainTestComponent._scopeId="cjw5ze4",ChainTestComponent._quarcDirectives=[UpperCasePipe,LowerCasePipe,SubstrPipe,CamelCasePipe],ChainTestComponent.__quarc_original_name__="ChainTestComponent",bootstrapApplication(AppComponent,appConfig={providers:[provideRouter(routes=[{path:"",component:HomeComponent},{path:"uppercase",component:UpperCaseTestComponent},{path:"lowercase",component:LowerCaseTestComponent},{path:"json",component:JsonTestComponent},{path:"case",component:CaseTestComponent},{path:"date",component:DateTestComponent},{path:"substr",component:SubstrTestComponent},{path:"chain",component:ChainTestComponent}])]});