soliddesigner 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{$ as h,$a as ha,$b as hb,$c as hc,$d as hd,$e as he,$f as hf,$g as ig,$h as ih,$i as ii,Aa as I,Ab as Ia,Ac as Ib,Ad as Ic,Ae as Id,Af as Ie,Ag as Jf,Ah as Jg,Ai as Jh,Ba as J,Bb as Ja,Bc as Jb,Bd as Jc,Be as Jd,Bf as Je,Bg as Kf,Bh as Kg,Bi as Kh,Ca as K,Cb as Ka,Cc as Kb,Cd as Kc,Ce as Kd,Cf as Ke,Cg as Lf,Ch as Lg,Ci as Lh,Da as L,Db as La,Dc as Lb,Dd as Lc,De as Ld,Df as Le,Dg as Mf,Dh as Mg,Di as Mh,Ea as M,Eb as Ma,Ec as Mb,Ed as Mc,Ee as Md,Ef as Me,Eg as Nf,Eh as Ng,Ei as Nh,Fa as N,Fb as Na,Fc as Nb,Fd as Nc,Fe as Nd,Ff as Ne,Fg as Of,Fh as Og,Fi as Oh,Ga as O,Gb as Oa,Gc as Ob,Gd as Oc,Ge as Od,Gf as Oe,Gg as Pf,Gh as Pg,Gi as Ph,Ha as P,Hb as Pa,Hc as Pb,Hd as Pc,He as Pd,Hf as Pe,Hg as Qf,Hh as Qg,Hi as Qh,Ia as Q,Ib as Qa,Ic as Qb,Id as Qc,Ie as Qd,If as Qe,Ig as Rf,Ih as Rg,Ii as Rh,Ja as R,Jb as Ra,Jc as Rb,Jd as Rc,Je as Rd,Jf as Re,Jg as Sf,Jh as Sg,Ji as Sh,Ka as S,Kb as Sa,Kc as Sb,Kd as Sc,Ke as Sd,Kf as Se,Kg as Tf,Kh as Tg,Ki as Th,La as T,Lb as Ta,Lc as Tb,Ld as Tc,Le as Td,Lf as Te,Lg as Uf,Lh as Ug,Li as Uh,Ma as U,Mb as Ua,Mc as Ub,Md as Uc,Me as Ud,Mf as Ue,Mg as Vf,Mh as Vg,Mi as Vh,Na as V,Nb as Va,Nc as Vb,Nd as Vc,Ne as Vd,Nf as Ve,Ng as Wf,Nh as Wg,Ni as Wh,Oa as W,Ob as Wa,Oc as Wb,Od as Wc,Oe as Wd,Of as We,Og as Xf,Oh as Xg,Oi as Xh,Pa as X,Pb as Xa,Pc as Xb,Pd as Xc,Pe as Xd,Pf as Xe,Pg as Yf,Ph as Yg,Pi as Yh,Qa as Y,Qb as Ya,Qc as Yb,Qd as Yc,Qe as Yd,Qf as Ye,Qg as Zf,Qh as Zg,Qi as Zh,Ra as Z,Rb as Za,Rc as Zb,Rd as Zc,Re as Zd,Rf as Ze,Rg as _f,Rh as _g,Ri as _h,Sa as _,Sb as _a,Sc as _b,Sd as _c,Se as _d,Sf as _e,Sg as $f,Sh as $g,Si as $h,Ta as $,Tb as $a,Tc as $b,Td as $c,Te as $d,Tf as $e,Tg as ag,Th as ah,Ti as ai,Ua as aa,Ub as ab,Uc as ac,Ud as ad,Ue as ae,Uf as af,Ug as bg,Uh as bh,Ui as bi,Va as ba,Vb as bb,Vc as bc,Vd as bd,Ve as be,Vf as bf,Vg as cg,Vh as ch,Vi as ci,Wa as ca,Wb as cb,Wc as cc,Wd as cd,We as ce,Wf as cf,Wg as dg,Wh as dh,Wi as di,X as d,Xa as da,Xb as db,Xc as dc,Xd as dd,Xe as de,Xf as df,Xg as eg,Xh as eh,Xi as ei,Y as e,Ya as ea,Yb as eb,Yc as ec,Yd as ed,Ye as ee,Yf as ef,Yg as fg,Yh as fh,Yi as fi,Z as f,Za as fa,Zb as fb,Zc as fc,Zd as fd,Ze as fe,Zf as ff,Zg as gg,Zh as gh,Zi as gi,_ as g,_a as ga,_b as gb,_c as gc,_d as gd,_e as ge,_f as gf,_g as hg,_h as hh,_i as hi,aa as i,ab as ia,ac as ib,ad as ic,ae as id,af as ie,ag as jf,ah as jg,ai as jh,aj as ji,ba as j,bb as ja,bc as jb,bd as jc,be as jd,bf as je,bg as kf,bh as kg,bi as kh,bj as ki,ca as k,cb as ka,cc as kb,cd as kc,ce as kd,cf as ke,cg as lf,ch as lg,ci as lh,cj as li,da as l,db as la,dc as lb,dd as lc,de as ld,df as le,dg as mf,dh as mg,di as mh,dj as mi,ea as m,eb as ma,ec as mb,ed as mc,ee as md,ef as me,eg as nf,eh as ng,ei as nh,ej as ni,f as a,fa as n,fb as na,fc as nb,fd as nc,fe as nd,ff as ne,fg as of,fh as og,fi as oh,fj as oi,g as b,ga as o,gb as oa,gc as ob,gd as oc,ge as od,gf as oe,gg as pf,gh as pg,gi as ph,gj as pi,h as c,ha as p,hb as pa,hc as pb,hd as pc,he as pd,hf as pe,hg as qf,hh as qg,hi as qh,hj as qi,ia as q,ib as qa,ic as qb,id as qc,ie as qd,if as qe,ig as rf,ih as rg,ii as rh,ij as ri,ja as r,jb as ra,jc as rb,jd as rc,je as rd,jf as re,jg as sf,jh as sg,ji as sh,jj as si,ka as s,kb as sa,kc as sb,kd as sc,ke as sd,kf as se,kg as tf,kh as tg,ki as th,kj as ti,la as t,lb as ta,lc as tb,ld as tc,le as td,lf as te,lg as uf,lh as ug,li as uh,ma as u,mb as ua,mc as ub,md as uc,me as ud,mf as ue,mg as vf,mh as vg,mi as vh,na as v,nb as va,nc as vb,nd as vc,ne as vd,nf as ve,ng as wf,nh as wg,ni as wh,oa as w,ob as wa,oc as wb,od as wc,oe as wd,of as we,og as xf,oh as xg,oi as xh,pa as x,pb as xa,pc as xb,pd as xc,pe as xd,pf as xe,pg as yf,ph as yg,pi as yh,qa as y,qb as ya,qc as yb,qd as yc,qe as yd,qf as ye,qg as zf,qh as zg,qi as zh,ra as z,rb as za,rc as zb,rd as zc,re as zd,rf as ze,rg as Af,rh as Ag,ri as Ah,sa as A,sb as Aa,sc as Ab,sd as Ac,se as Ad,sf as Ae,sg as Bf,sh as Bg,si as Bh,ta as B,tb as Ba,tc as Bb,td as Bc,te as Bd,tf as Be,tg as Cf,th as Cg,ti as Ch,ua as C,ub as Ca,uc as Cb,ud as Cc,ue as Cd,uf as Ce,ug as Df,uh as Dg,ui as Dh,va as D,vb as Da,vc as Db,vd as Dc,ve as Dd,vf as De,vg as Ef,vh as Eg,vi as Eh,wa as E,wb as Ea,wc as Eb,wd as Ec,we as Ed,wf as Ee,wg as Ff,wh as Fg,wi as Fh,xa as F,xb as Fa,xc as Fb,xd as Fc,xe as Fd,xf as Fe,xg as Gf,xh as Gg,xi as Gh,ya as G,yb as Ga,yc as Gb,yd as Gc,ye as Gd,yf as Ge,yg as Hf,yh as Hg,yi as Hh,za as H,zb as Ha,zc as Hb,zd as Hc,ze as Hd,zf as He,zg as If,zh as Ig,zi as Ih}from"./chunk-B3PWEOJU.js";export{Wa as ANIMATION_MODULE_TYPE,qd as APP_BOOTSTRAP_LISTENER,Sa as APP_ID,nd as APP_INITIALIZER,hb as AfterRenderPhase,pd as ApplicationInitStatus,Hh as ApplicationModule,td as ApplicationRef,ma as Attribute,Tg as COMPILER_OPTIONS,Xa as CSP_NONCE,tb as CUSTOM_ELEMENTS_SCHEMA,La as ChangeDetectionStrategy,sh as ChangeDetectorRef,Sg as Compiler,Ug as CompilerFactory,Ig as Component,cc as ComponentFactory,dc as ComponentFactoryResolver,bc as ComponentRef,xc as ContentChild,wc as ContentChildren,ah as DEFAULT_CURRENCY_CODE,zh as DebugElement,wh as DebugEventListener,yh as DebugNode,Bh as DefaultIterableDiffer,sa as DestroyRef,Hg as Directive,M as ENVIRONMENT_INITIALIZER,Ga as ElementRef,vh as EmbeddedViewRef,U as EnvironmentInjector,Aa as ErrorHandler,xa as EventEmitter,ra as HOST_TAG_NAME,L as Host,qa as HostAttributeToken,Mg as HostBinding,Ng as HostListener,N as INJECTOR,H as Inject,C as InjectFlags,na as Injectable,u as InjectionToken,pa as Injector,Kg as Input,Ch as IterableDiffers,Dh as KeyValueDiffers,$g as LOCALE_ID,dh as MissingTranslationStrategy,Rg as ModuleWithComponentFactories,ub as NO_ERRORS_SCHEMA,Og as NgModule,Hc as NgModuleFactory,Gc as NgModuleRef,sd as NgProbeToken,ya as NgZone,I as Optional,Lg as Output,Ca as OutputEmitterRef,Va as PACKAGE_ROOT_URL,Ua as PLATFORM_ID,Ta as PLATFORM_INITIALIZER,wa as PendingTasks,Jg as Pipe,fh as PlatformRef,vc as Query,Ka as QueryList,ri as REQUEST,ti as REQUEST_CONTEXT,si as RESPONSE_INIT,fc as Renderer2,ec as RendererFactory2,Yb as RendererStyleFlags2,$h as ResourceStatus,gc as Sanitizer,Jb as SecurityContext,J as Self,aa as SimpleChange,K as SkipSelf,bh as TRANSLATIONS,ch as TRANSLATIONS_FORMAT,ac as TemplateRef,hd as Testability,id as TestabilityRegistry,$a as TransferState,Z as Type,Qg as VERSION,Pg as Version,zc as ViewChild,yc as ViewChildren,pc as ViewContainerRef,sb as ViewEncapsulation,uh as ViewRef,kb as afterNextRender,jb as afterRender,ni as afterRenderEffect,xh as asNativeElements,X as assertInInjectionContext,gb as assertNotInReactiveContext,ih as assertPlatform,Ph as booleanAttribute,Xh as computed,sc as contentChild,tc as contentChildren,oi as createComponent,Mc as createEnvironmentInjector,Ic as createNgModule,Jc as createNgModuleRef,gh as createPlatform,hh as createPlatformFactory,o as defineInjectable,kh as destroyPlatform,_h as effect,ph as enableProdMode,l as forwardRef,Ah as getDebugNode,qh as getModuleFactory,rh as getNgModuleById,jh as getPlatform,S as importProvidersFrom,F as inject,Fa as input,oh as isDevMode,Ha as isSignal,P as isStandalone,ai as linkedSignal,Q as makeEnvironmentProviders,_a as makeStateKey,qi as mergeApplicationConfig,uc as model,Qh as numberAttribute,Ea as output,Gh as platformCore,od as provideAppInitializer,R as provideEnvironmentInitializer,nh as provideExperimentalCheckNoChangesForDebug,_g as provideExperimentalZonelessChangeDetection,mh as providePlatformInitializer,Yg as provideZoneChangeDetection,pi as reflectComponentType,m as resolveForwardRef,bi as resource,W as runInInjectionContext,jd as setTestabilityGetter,Ja as signal,Wh as untracked,qc as viewChild,rc as viewChildren,ib as \u0275AfterRenderManager,Lh as \u0275CLIENT_RENDER_MODE_FLAG,$ as \u0275CONTAINER_HEADER_OFFSET,ta as \u0275ChangeDetectionScheduler,Zg as \u0275ChangeDetectionSchedulerImpl,cc as \u0275ComponentFactory,cd as \u0275Console,Ke as \u0275DEFAULT_LOCALE_ID,Yc as \u0275DEFER_BLOCK_CONFIG,Xc as \u0275DEFER_BLOCK_DEPENDENCY_INTERCEPTOR,ob as \u0275DEHYDRATED_BLOCK_REGISTRY,mb as \u0275DeferBlockBehavior,lb as \u0275DeferBlockState,eh as \u0275ENABLE_ROOT_COMPONENT_BOOTSTRAP,kd as \u0275EffectScheduler,qb as \u0275HydrationStatus,Za as \u0275IMAGE_CONFIG,Ya as \u0275IMAGE_CONFIG_DEFAULTS,T as \u0275INJECTOR_SCOPE,g as \u0275INPUT_SIGNAL_BRAND_WRITE_TYPE,Ba as \u0275INTERNAL_APPLICATION_ERROR_HANDLER,ab as \u0275IS_HYDRATION_DOM_REUSE_ENABLED,bb as \u0275IS_INCREMENTAL_HYDRATION_ENABLED,cb as \u0275JSACTION_BLOCK_ELEMENT_MAP,nb as \u0275JSACTION_EVENT_CONTRACT,Ma as \u0275LContext,Je as \u0275LocaleDataIndex,Yh as \u0275MicrotaskEffectScheduler,x as \u0275NG_COMP_DEF,y as \u0275NG_DIR_DEF,B as \u0275NG_ELEMENT_ID,t as \u0275NG_INJ_DEF,A as \u0275NG_MOD_DEF,z as \u0275NG_PIPE_DEF,s as \u0275NG_PROV_DEF,kc as \u0275NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,Wb as \u0275NO_CHANGE,Lc as \u0275NgModuleFactory,za as \u0275NoopNgZone,Rh as \u0275PERFORMANCE_MARK_PREFIX,Wg as \u0275PROVIDED_NG_ZONE,va as \u0275PendingTasksInternal,V as \u0275R3Injector,_ as \u0275ReflectionCapabilities,nc as \u0275Render3ComponentFactory,oc as \u0275Render3ComponentRef,Kc as \u0275Render3NgModuleRef,ci as \u0275ResourceImpl,e as \u0275RuntimeError,a as \u0275SIGNAL,pb as \u0275SSR_CONTENT_INTEGRITY_MARKER,fd as \u0275TESTABILITY,gd as \u0275TESTABILITY_GETTER,Wc as \u0275TimerScheduler,db as \u0275TracingAction,eb as \u0275TracingService,ic as \u0275USE_RUNTIME_DEPS_TRACKER_FOR_JIT,Zb as \u0275ViewRef,d as \u0275XSS_SECURITY_URL,ua as \u0275ZONELESS_ENABLED,Ib as \u0275_sanitizeHtml,Hb as \u0275_sanitizeUrl,Ab as \u0275allowSanitizationBypassAndThrow,Kh as \u0275annotateForHydration,Cb as \u0275bypassSanitizationTrustHtml,Gb as \u0275bypassSanitizationTrustResourceUrl,Eb as \u0275bypassSanitizationTrustScript,Db as \u0275bypassSanitizationTrustStyle,Fb as \u0275bypassSanitizationTrustUrl,Cc as \u0275clearResolutionOfComponentResourcesQueue,Eg as \u0275compileComponent,Fg as \u0275compileDirective,yg as \u0275compileNgModule,zg as \u0275compileNgModuleDefs,Vg as \u0275compileNgModuleFactory,Gg as \u0275compilePipe,G as \u0275convertToBitFlags,oa as \u0275createInjector,lh as \u0275createOrReusePlatformInjector,Eh as \u0275defaultIterableDiffers,Fh as \u0275defaultKeyValueDiffers,jc as \u0275depsTracker,ud as \u0275detectChangesInViewIfRequired,Uc as \u0275devModeEqual,Vh as \u0275disableProfiling,Uh as \u0275enableProfiling,Fe as \u0275findLocaleData,xg as \u0275flushModuleScopingQueueAsMuchAsPossible,f as \u0275formatRuntimeError,Ag as \u0275generateStandaloneInDeclarationsError,$c as \u0275getAsyncClassMetadataFn,di as \u0275getClosestComponentName,O as \u0275getComponentDef,Ah as \u0275getDebugNode,dd as \u0275getDeferBlocks,Oa as \u0275getDirectives,Ra as \u0275getDocument,Pa as \u0275getHostElement,q as \u0275getInjectableDef,Na as \u0275getLContext,Ge as \u0275getLocaleCurrencyCode,He as \u0275getLocalePluralCase,Da as \u0275getOutputDestroyRef,Bb as \u0275getSanitizationBypassType,wb as \u0275getUnknownElementStrictMode,yb as \u0275getUnknownPropertyStrictMode,i as \u0275global,th as \u0275injectChangeDetectorRef,Ih as \u0275internalCreateApplication,Xg as \u0275internalProvideZoneChangeDetection,rd as \u0275isBoundToModule,Bc as \u0275isComponentDefPendingResolution,w as \u0275isEnvironmentProviders,r as \u0275isInjectable,hc as \u0275isNgModule,ld as \u0275isPromise,md as \u0275isSubscribable,_b as \u0275isViewDirty,$b as \u0275markForRefresh,Zh as \u0275microtaskEffect,h as \u0275noSideEffects,Cg as \u0275patchComponentDefWithScope,fb as \u0275performanceMarkFeature,ed as \u0275publishExternalGlobalUtil,rb as \u0275readHydrationInfo,Ee as \u0275registerLocaleData,Zc as \u0275renderDeferBlockState,Bg as \u0275resetCompiledComponents,wg as \u0275resetJitOptions,Ac as \u0275resolveComponentResources,Dc as \u0275restoreComponentResolutionQueue,Fc as \u0275setAllowDuplicateNgModuleIdsForTest,b as \u0275setAlternateWeakRefImpl,tg as \u0275setClassDebugInfo,bd as \u0275setClassMetadata,ad as \u0275setClassMetadataAsync,c as \u0275setCurrentInjector,Qa as \u0275setDocument,v as \u0275setInjectorProfilerContext,Le as \u0275setLocaleId,vb as \u0275setUnknownElementStrictMode,xb as \u0275setUnknownPropertyStrictMode,Sh as \u0275startMeasuring,Th as \u0275stopMeasuring,ca as \u0275store,j as \u0275stringify,Dg as \u0275transitiveScopesFor,vd as \u0275triggerResourceLoading,k as \u0275truncateMiddle,Ie as \u0275unregisterLocaleData,zb as \u0275unwrapSafeValue,Ia as \u0275unwrapWritableSignal,Mh as \u0275withDomHydration,Jh as \u0275withEventReplay,Nh as \u0275withI18nSupport,Oh as \u0275withIncrementalHydration,Sc as \u0275\u0275CopyDefinitionFeature,_f as \u0275\u0275ExternalStylesFeature,Y as \u0275\u0275FactoryTarget,Tc as \u0275\u0275HostDirectivesFeature,Rc as \u0275\u0275InheritDefinitionFeature,ba as \u0275\u0275NgOnChangesFeature,Zf as \u0275\u0275ProvidersFeature,Xb as \u0275\u0275advance,Yf as \u0275\u0275attachSourceLocations,Td as \u0275\u0275attribute,Ud as \u0275\u0275attributeInterpolate1,Vd as \u0275\u0275attributeInterpolate2,Wd as \u0275\u0275attributeInterpolate3,Xd as \u0275\u0275attributeInterpolate4,Yd as \u0275\u0275attributeInterpolate5,Zd as \u0275\u0275attributeInterpolate6,_d as \u0275\u0275attributeInterpolate7,$d as \u0275\u0275attributeInterpolate8,ae as \u0275\u0275attributeInterpolateV,fe as \u0275\u0275classMap,ge as \u0275\u0275classMapInterpolate1,he as \u0275\u0275classMapInterpolate2,ie as \u0275\u0275classMapInterpolate3,je as \u0275\u0275classMapInterpolate4,ke as \u0275\u0275classMapInterpolate5,le as \u0275\u0275classMapInterpolate6,me as \u0275\u0275classMapInterpolate7,ne as \u0275\u0275classMapInterpolate8,oe as \u0275\u0275classMapInterpolateV,de as \u0275\u0275classProp,pe as \u0275\u0275componentInstance,qe as \u0275\u0275conditional,gf as \u0275\u0275contentQuery,lf as \u0275\u0275contentQuerySignal,Vf as \u0275\u0275declareLet,wd as \u0275\u0275defer,_c as \u0275\u0275deferEnableTimerScheduling,Ad as \u0275\u0275deferHydrateNever,Md as \u0275\u0275deferHydrateOnHover,Dd as \u0275\u0275deferHydrateOnIdle,Gd as \u0275\u0275deferHydrateOnImmediate,Pd as \u0275\u0275deferHydrateOnInteraction,Jd as \u0275\u0275deferHydrateOnTimer,Sd as \u0275\u0275deferHydrateOnViewport,zd as \u0275\u0275deferHydrateWhen,Kd as \u0275\u0275deferOnHover,Bd as \u0275\u0275deferOnIdle,Ed as \u0275\u0275deferOnImmediate,Nd as \u0275\u0275deferOnInteraction,Hd as \u0275\u0275deferOnTimer,Qd as \u0275\u0275deferOnViewport,Ld as \u0275\u0275deferPrefetchOnHover,Cd as \u0275\u0275deferPrefetchOnIdle,Fd as \u0275\u0275deferPrefetchOnImmediate,Od as \u0275\u0275deferPrefetchOnInteraction,Id as \u0275\u0275deferPrefetchOnTimer,Rd as \u0275\u0275deferPrefetchOnViewport,yd as \u0275\u0275deferPrefetchWhen,xd as \u0275\u0275deferWhen,Nc as \u0275\u0275defineComponent,Pc as \u0275\u0275defineDirective,n as \u0275\u0275defineInjectable,p as \u0275\u0275defineInjector,Oc as \u0275\u0275defineNgModule,Qc as \u0275\u0275definePipe,lc as \u0275\u0275directiveInject,ea as \u0275\u0275disableBindings,xe as \u0275\u0275element,Ae as \u0275\u0275elementContainer,ze as \u0275\u0275elementContainerEnd,ye as \u0275\u0275elementContainerStart,we as \u0275\u0275elementEnd,ve as \u0275\u0275elementStart,da as \u0275\u0275enableBindings,sg as \u0275\u0275getComponentDepsFactory,Be as \u0275\u0275getCurrentView,ka as \u0275\u0275getInheritedFactory,ug as \u0275\u0275getReplaceMetadataURL,Ce as \u0275\u0275hostProperty,Oe as \u0275\u0275i18n,Re as \u0275\u0275i18nApply,Pe as \u0275\u0275i18nAttributes,Ne as \u0275\u0275i18nEnd,Qe as \u0275\u0275i18nExp,Se as \u0275\u0275i18nPostprocess,Me as \u0275\u0275i18nStart,D as \u0275\u0275inject,la as \u0275\u0275injectAttribute,mc as \u0275\u0275invalidFactory,E as \u0275\u0275invalidFactoryDep,Te as \u0275\u0275listener,kf as \u0275\u0275loadQuery,ja as \u0275\u0275namespaceHTML,ia as \u0275\u0275namespaceMathML,ha as \u0275\u0275namespaceSVG,Ve as \u0275\u0275nextContext,fi as \u0275\u0275ngDeclareClassMetadata,gi as \u0275\u0275ngDeclareClassMetadataAsync,hi as \u0275\u0275ngDeclareComponent,ei as \u0275\u0275ngDeclareDirective,ii as \u0275\u0275ngDeclareFactory,ji as \u0275\u0275ngDeclareInjectable,ki as \u0275\u0275ngDeclareInjector,li as \u0275\u0275ngDeclareNgModule,mi as \u0275\u0275ngDeclarePipe,lg as \u0275\u0275pipe,mg as \u0275\u0275pipeBind1,ng as \u0275\u0275pipeBind2,og as \u0275\u0275pipeBind3,pg as \u0275\u0275pipeBind4,qg as \u0275\u0275pipeBindV,Xe as \u0275\u0275projection,We as \u0275\u0275projectionDef,be as \u0275\u0275property,Ye as \u0275\u0275propertyInterpolate,Ze as \u0275\u0275propertyInterpolate1,_e as \u0275\u0275propertyInterpolate2,$e as \u0275\u0275propertyInterpolate3,af as \u0275\u0275propertyInterpolate4,bf as \u0275\u0275propertyInterpolate5,cf as \u0275\u0275propertyInterpolate6,df as \u0275\u0275propertyInterpolate7,ef as \u0275\u0275propertyInterpolate8,ff as \u0275\u0275propertyInterpolateV,bg as \u0275\u0275pureFunction0,cg as \u0275\u0275pureFunction1,dg as \u0275\u0275pureFunction2,eg as \u0275\u0275pureFunction3,fg as \u0275\u0275pureFunction4,gg as \u0275\u0275pureFunction5,hg as \u0275\u0275pureFunction6,ig as \u0275\u0275pureFunction7,jg as \u0275\u0275pureFunction8,kg as \u0275\u0275pureFunctionV,nf as \u0275\u0275queryAdvance,jf as \u0275\u0275queryRefresh,Xf as \u0275\u0275readContextLet,of as \u0275\u0275reference,Ec as \u0275\u0275registerNgModuleType,ue as \u0275\u0275repeater,te as \u0275\u0275repeaterCreate,se as \u0275\u0275repeaterTrackByIdentity,re as \u0275\u0275repeaterTrackByIndex,vg as \u0275\u0275replaceMetadata,ga as \u0275\u0275resetView,Vb as \u0275\u0275resolveBody,Ub as \u0275\u0275resolveDocument,Tb as \u0275\u0275resolveWindow,fa as \u0275\u0275restoreView,Kb as \u0275\u0275sanitizeHtml,Nb as \u0275\u0275sanitizeResourceUrl,Ob as \u0275\u0275sanitizeScript,Lb as \u0275\u0275sanitizeStyle,Mb as \u0275\u0275sanitizeUrl,Rb as \u0275\u0275sanitizeUrlOrResourceUrl,$f as \u0275\u0275setComponentScope,ag as \u0275\u0275setNgModuleScope,Wf as \u0275\u0275storeLet,ee as \u0275\u0275styleMap,pf as \u0275\u0275styleMapInterpolate1,qf as \u0275\u0275styleMapInterpolate2,rf as \u0275\u0275styleMapInterpolate3,sf as \u0275\u0275styleMapInterpolate4,tf as \u0275\u0275styleMapInterpolate5,uf as \u0275\u0275styleMapInterpolate6,vf as \u0275\u0275styleMapInterpolate7,wf as \u0275\u0275styleMapInterpolate8,xf as \u0275\u0275styleMapInterpolateV,ce as \u0275\u0275styleProp,yf as \u0275\u0275stylePropInterpolate1,zf as \u0275\u0275stylePropInterpolate2,Af as \u0275\u0275stylePropInterpolate3,Bf as \u0275\u0275stylePropInterpolate4,Cf as \u0275\u0275stylePropInterpolate5,Df as \u0275\u0275stylePropInterpolate6,Ef as \u0275\u0275stylePropInterpolate7,Ff as \u0275\u0275stylePropInterpolate8,Gf as \u0275\u0275stylePropInterpolateV,Ue as \u0275\u0275syntheticHostListener,De as \u0275\u0275syntheticHostProperty,Vc as \u0275\u0275template,rg as \u0275\u0275templateRefExtractor,Hf as \u0275\u0275text,If as \u0275\u0275textInterpolate,Jf as \u0275\u0275textInterpolate1,Kf as \u0275\u0275textInterpolate2,Lf as \u0275\u0275textInterpolate3,Mf as \u0275\u0275textInterpolate4,Nf as \u0275\u0275textInterpolate5,Of as \u0275\u0275textInterpolate6,Pf as \u0275\u0275textInterpolate7,Qf as \u0275\u0275textInterpolate8,Rf as \u0275\u0275textInterpolateV,Pb as \u0275\u0275trustConstantHtml,Qb as \u0275\u0275trustConstantResourceUrl,Tf as \u0275\u0275twoWayBindingSet,Uf as \u0275\u0275twoWayListener,Sf as \u0275\u0275twoWayProperty,Sb as \u0275\u0275validateAttribute,hf as \u0275\u0275viewQuery,mf as \u0275\u0275viewQuerySignal};
@@ -0,0 +1 @@
1
+ import{A as S,E as X,J as W,T as Y,V as I,W as q,X as J,m as k,y as R}from"./chunk-W44TPOFU.js";import{$a as V,Bb as x,Ec as N,Fd as C,Lf as c,Nd as y,Nf as l,Oi as M,Pc as d,Ri as b,Ve as _,Xe as H,Za as p,_a as m,a as E,b as L,bb as B,ch as $,dh as j,if as w,kf as F,lf as U,mf as A,nf as o,of as s,pb as h,pf as u,tf as z,xa as g,yg as f,zg as v}from"./chunk-B3PWEOJU.js";var D=class a{index;imageUrl;isCurrent=!1;selectPage=new h;dragStarted=new h;dropped=new h;contextMenuEvent=new h;dragOver=!1;dropSide=null;saveService=g(I);cacheBuster="";constructor(){b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e;this.isCurrent&&t>0&&(this.cacheBuster=`t=${t}`)})}get displayImageUrl(){if(!this.cacheBuster||!this.imageUrl)return this.imageUrl;let e=this.imageUrl.includes("?")?"&":"?";return`${this.imageUrl}${e}${this.cacheBuster}`}onDragStart(e){this.dragStarted.emit(this.index),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}onDragOver(e){e.preventDefault(),this.dragOver=!0;let t=e.currentTarget.getBoundingClientRect(),i=t.left+t.width/2;this.dropSide=e.clientX<i?"before":"after"}onDrop(e){e.preventDefault(),this.dropSide&&this.dropped.emit({targetIndex:this.index,side:this.dropSide}),this.onDragEnd()}onDragLeave(){this.dragOver=!1,this.dropSide=null}onDragEnd(){this.dragOver=!1,this.dropSide=null}onContextMenu(e){e.preventDefault(),this.contextMenuEvent.emit({event:e,index:this.index})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-item"]],inputs:{index:"index",imageUrl:"imageUrl",isCurrent:"isCurrent"},outputs:{selectPage:"selectPage",dragStarted:"dragStarted",dropped:"dropped",contextMenuEvent:"contextMenuEvent"},decls:4,vars:8,consts:[["draggable","true",1,"page-grid-item",3,"dragstart","dragover","dragleave","drop","dragend","click","contextmenu"],["alt","Page Thumbnail","loading","lazy",1,"page-image",3,"src"],[1,"page-number"]],template:function(t,i){t&1&&(o(0,"div",0),c("dragstart",function(r){return i.onDragStart(r)})("dragover",function(r){return i.onDragOver(r)})("dragleave",function(){return i.onDragLeave()})("drop",function(r){return i.onDrop(r)})("dragend",function(){return i.onDragEnd()})("click",function(){return i.selectPage.emit(i.index)})("contextmenu",function(r){return i.onContextMenu(r)}),u(1,"img",1),o(2,"span",2),f(3),s()()),t&2&&(H("current",i.isCurrent)("drag-before",i.dragOver&&i.dropSide==="before")("drag-after",i.dragOver&&i.dropSide==="after"),d(),_("src",i.displayImageUrl,N),d(2),v(i.index+1))},dependencies:[k,S],styles:[`[_nghost-%COMP%]{display:block}.page-grid-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);padding:var(--spacing-xs) 0;display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);align-items:center;cursor:move;margin:0;position:relative;transition:transform .2s,background-color .2s;box-sizing:border-box}.page-grid-item[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-3)}.page-grid-item.current[_ngcontent-%COMP%]{border-color:var(--active)}.page-image[_ngcontent-%COMP%]{background-color:#fff;border-radius:0;pointer-events:none;height:calc(100% - 2 * var(--spacing-xs) - 15px);width:auto;max-width:100%;object-fit:contain}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white)}.page-grid-item[_ngcontent-%COMP%]:before, .page-grid-item[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;width:4px;background:var(--active);z-index:100;opacity:0;transition:opacity .2s;border-radius:2px}.page-grid-item.drag-before[_ngcontent-%COMP%]:before{left:-4px;opacity:1}.page-grid-item.drag-after[_ngcontent-%COMP%]:after{right:-4px;opacity:1}[_nghost-%COMP%]:nth-child(odd) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-right:0!important;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:2px 0 5px #0003}[_nghost-%COMP%]:nth-child(odd) .page-image[_ngcontent-%COMP%]{margin-left:auto;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='100%25' y1='0' x2='100%25' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='34' x2='100%25' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='68' x2='100%25' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='64' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='102' x2='100%25' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='136' x2='100%25' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='170' x2='100%25' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='0' x2='0' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-right:0}[_nghost-%COMP%]:nth-child(2n) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-left:0!important;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:-2px 0 5px #0003}[_nghost-%COMP%]:nth-child(2n) .page-image[_ngcontent-%COMP%]{margin-right:auto;background-image:url("data:image/svg+xml, %3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='0' y1='0' x2='0' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='34' x2='0' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='68' x2='0' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='94' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='102' x2='0' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='136' x2='0' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='170' x2='0' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='100%25' y1='0' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-left:0}`]})};function ne(a,e){a&1&&u(0,"div",26)}function re(a,e){if(a&1){let t=z();o(0,"app-page-grid-item",28),c("selectPage",function(n){p(t);let r=l(3);return m(r.goToPage(n))})("dragStarted",function(n){p(t);let r=l(3);return m(r.onDragStart(n))})("dropped",function(n){p(t);let r=l(3);return m(r.onDrop(n))})("contextMenuEvent",function(n){p(t);let r=l(3);return m(r.onPageContextMenu(n))}),s()}if(a&2){let t=l().$implicit,i=l(2);_("index",t.index)("imageUrl",i.pageImageUrls()[t.index])("isCurrent",t.index===i.currentPageIndex())}}function ae(a,e){if(a&1&&y(0,ne,1,0,"div",26)(1,re,1,3,"app-page-grid-item",27),a&2){let t=e.$implicit;w(t.isFake?0:1)}}function oe(a,e){if(a&1&&(o(0,"div",17),U(1,ae,2,1,null,null,F),s()),a&2){let t=e.$implicit;d(),A(t)}}function se(a,e){a&1&&(o(0,"div",24),u(1,"div",29),s())}function de(a,e){if(a&1){let t=z();o(0,"app-confirm-delete-modal",30),c("confirm",function(){p(t);let n=l();return m(n.confirmDelete())})("cancel",function(){p(t);let n=l();return m(n.cancelDelete())}),s()}}var K=class a{appParams=g(X);assetsService=g(Y);modalService=g(W);saveService=g(I);onPageSelect;isLoading=x(!1);pages=x([]);currentPageIndex=M(()=>{let e=this.appParams.pageGuid();return this.pages().findIndex(i=>i.documentPageGuid===e)});pageSpreads=M(()=>{let e=this.pages(),t=[{isFake:!0}];e.forEach((n,r)=>{t.push(L(E({},n),{index:r}))});let i=[];for(let n=0;n<t.length;n+=2)i.push(t.slice(n,n+2));return i});pageCacheBusters=x({});sessionBuster=`s=${Date.now()}`;pageImageUrls=M(()=>{let e=this.pageCacheBusters();return this.pages().map(t=>{let i=t.publicationTemplateUrl;if(!i)return"";let n=t.documentPageGuid,r=e[n]||this.sessionBuster,P=i.includes("?")?"&":"?";return`${i}${P}${r}`})});dragSourceIndex=null;contextMenuVisible=!1;contextMenuPosition={x:0,y:0};contextMenuPageIndex=null;showDeleteConfirm=x(!1);deleteIndex=null;constructor(){b(()=>{let t=this.appParams.params().documentData;t&&Array.isArray(t)&&this.pages.set([...t])}),b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e,i=this.pages()[this.currentPageIndex()];if(i&&t>0){let n=i.documentPageGuid;this.pageCacheBusters.update(r=>L(E({},r),{[n]:`t=${t}`}))}})}ngOnInit(){}addPage(){let e=this.appParams.guid;e&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(e).subscribe(t=>{t?this.refreshPages():this.isLoading.set(!1)}))}addPageBefore(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+1).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}addPageAfter(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+2).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}duplicatePage(e){let t=this.appParams.guid,i=this.pages()[e];!t||!i||(this.isLoading.set(!0),this.assetsService.duplicateDocumentPage(t,i.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}))}deletePage(e){this.deleteIndex=e,this.showDeleteConfirm.set(!0)}confirmDelete(){if(this.deleteIndex===null)return;let e=this.deleteIndex,t=this.pages()[e],i=this.appParams.guid;if(!i||!t){this.cancelDelete();return}this.isLoading.set(!0),this.assetsService.deleteDocumentPage(i,t.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}),this.cancelDelete()}cancelDelete(){this.showDeleteConfirm.set(!1),this.deleteIndex=null}refreshPages(){let e=this.appParams.guid;e&&this.assetsService.getSVGDocumentPages(e).subscribe(t=>{t&&t.template&&this.appParams.setParams({documentData:[...t.template]}),this.isLoading.set(!1)})}close(){this.modalService.close()}goToPage(e){this.onPageSelect&&this.onPageSelect(e),this.close()}onDragStart(e){this.dragSourceIndex=e}onDrop(e){if(this.dragSourceIndex===null)return;let t=this.dragSourceIndex,i=e.targetIndex;if(e.side==="after"&&i++,i===t||i===t+1){this.dragSourceIndex=null;return}let n=this.appParams.guid;if(!n)return;let r=this.pages(),P=r[t];if(!P)return;let Q=P.documentPageGuid,O=i;t<i&&O--;let Z=O+1;this.pages.update(G=>{let T=[...G],[ee]=T.splice(t,1);return T.splice(O,0,ee),T}),this.isLoading.set(!0),this.assetsService.moveDocumentPage(n,Q,Z).subscribe({next:G=>{G?this.refreshPages():(this.pages.set(r),this.isLoading.set(!1))},error:()=>{this.pages.set(r),this.isLoading.set(!1)}}),this.dragSourceIndex=null}onPageContextMenu(e){this.contextMenuPosition={x:e.event.clientX,y:e.event.clientY},this.contextMenuPageIndex=e.index,this.contextMenuVisible=!0}onContextMenuAction(e){switch(e.action){case"open":this.goToPage(e.index);break;case"insert-before":this.addPageBefore(e.index);break;case"insert-after":this.addPageAfter(e.index);break;case"duplicate":this.duplicatePage(e.index);break;case"delete":this.deletePage(e.index);break}this.contextMenuVisible=!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-modal"]],inputs:{onPageSelect:"onPageSelect"},decls:33,vars:12,consts:[["id","page-grid-backdrop",3,"click"],["id","page-grid",3,"click"],["id","page-grid-title"],["id","icon-page-grid",1,"icon"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x","3","y","3","width","5","height","5","fill","var(--white)"],["x","9.5","y","3","width","5","height","5","fill","var(--white)"],["x","16","y","3","width","5","height","5","fill","var(--white)"],["x","3","y","9.5","width","5","height","5","fill","var(--white)"],["x","9.5","y","9.5","width","5","height","5","fill","var(--white)"],["x","16","y","9.5","width","5","height","5","fill","var(--white)"],["x","3","y","16","width","5","height","5","fill","var(--white)"],["x","9.5","y","16","width","5","height","5","fill","var(--white)"],["x","16","y","16","width","5","height","5","fill","var(--white)"],["id","title-page-grid"],["id","close-page-grid",1,"close-btn",3,"click"],[1,"page-grid-content"],[1,"page-spread"],[1,"page-grid-item-add",3,"click"],[1,"page-grid-item-add-page"],["width","48","height","48","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x1","12","y1","5","x2","12","y2","19","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],["x1","5","y1","12","x2","19","y2","12","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],[1,"page-number"],[1,"page-grid-loader"],[3,"action","closeMenu","visible","position","pageIndex","isCurrentPage"],[1,"page-grid-fake-item"],[3,"index","imageUrl","isCurrent"],[3,"selectPage","dragStarted","dropped","contextMenuEvent","index","imageUrl","isCurrent"],[1,"spinner"],[3,"confirm","cancel"]],template:function(t,i){t&1&&(o(0,"div",0),c("click",function(){return i.close()}),o(1,"div",1),c("click",function(r){return r.stopPropagation()}),o(2,"div",2)(3,"span",3),V(),o(4,"svg",4),u(5,"rect",5)(6,"rect",6)(7,"rect",7)(8,"rect",8)(9,"rect",9)(10,"rect",10)(11,"rect",11)(12,"rect",12)(13,"rect",13),s()(),B(),o(14,"span",14),f(15),$(16,"translate"),s(),o(17,"button",15),c("click",function(){return i.close()}),f(18," \xD7 "),s()(),o(19,"div",16),U(20,oe,3,0,"div",17,F),o(22,"div",18),c("click",function(){return i.addPage()}),o(23,"div",19),V(),o(24,"svg",20),u(25,"line",21)(26,"line",22),s()(),B(),o(27,"span",23),f(28),$(29,"translate"),s()()()(),y(30,se,2,0,"div",24),s(),o(31,"app-page-context-menu",25),c("action",function(r){return i.onContextMenuAction(r)})("closeMenu",function(){return i.contextMenuVisible=!1}),s(),y(32,de,1,0,"app-confirm-delete-modal")),t&2&&(d(15),v(j(16,8,"GLOBAL.PAGES.GRID_VIEW")),d(5),A(i.pageSpreads()),d(8),v(j(29,10,"GLOBAL.PAGES.ADD_PAGE")),d(2),w(i.isLoading()?30:-1),d(),_("visible",i.contextMenuVisible)("position",i.contextMenuPosition)("pageIndex",i.contextMenuPageIndex)("isCurrentPage",i.contextMenuPageIndex===i.currentPageIndex()),d(),w(i.showDeleteConfirm()?32:-1))},dependencies:[k,S,R,D,q,J],styles:["#page-grid-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;z-index:2000;display:flex;justify-content:center;align-items:center}#page-grid[_ngcontent-%COMP%]{position:absolute;top:var(--spacing-s);left:var(--spacing-s);right:var(--spacing-s);bottom:var(--spacing-s);width:calc(100vw - 2 * var(--spacing-s));height:calc(100vh - 2 * var(--spacing-s));background-color:var(--gray-5);border-radius:var(--radius-s);padding:0 20px;display:flex;flex-direction:column;opacity:1;transition:opacity .5s ease;pointer-events:auto;overflow-y:auto;box-sizing:border-box}#page-grid-title[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding-top:var(--spacing-s);flex-shrink:0}#page-grid-title[_ngcontent-%COMP%] #icon-page-grid[_ngcontent-%COMP%]{background:var(--gray-3);border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center}#page-grid-title[_ngcontent-%COMP%] #title-page-grid[_ngcontent-%COMP%]{font-size:var(--font-size-medium);font-weight:var(--font-weight-bold);color:var(--white);margin-top:var(--spacing-s);margin-bottom:var(--spacing-xs);margin-left:var(--spacing-xs)!important}#close-page-grid[_ngcontent-%COMP%]{margin-left:auto;background:none;border:none;font-size:32px;cursor:pointer;color:var(--white)}.page-grid-content[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center;padding-bottom:40px;gap:var(--spacing-m)}.page-spread[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-end}.page-grid-content[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:var(--spacing-s)}.page-grid-fake-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);border-top-right-radius:0;border-bottom-right-radius:0;padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);border-right:0;align-items:center;margin:0;box-sizing:border-box;box-shadow:2px 0 5px #0003}.page-grid-item-add[_ngcontent-%COMP%]{background-color:var(--gray-3);border-radius:var(--radius-xs);padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:none;align-items:center;cursor:pointer;margin:var(--spacing-s) 0;box-sizing:border-box;transition:transform .2s,background-color .2s}.page-grid-item-add[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-2)}.page-grid-item-add-page[_ngcontent-%COMP%]{display:flex;align-content:center;flex-direction:column;justify-content:center;align-items:center;width:120px;height:180px;background:#fff;border:2px solid black;box-sizing:border-box;min-width:130px;min-height:186px}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white);text-align:center}.page-grid-loader[_ngcontent-%COMP%]{position:absolute;inset:0;background:#0006;display:flex;justify-content:center;align-items:center;z-index:3000;border-radius:var(--radius-s)}.spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:4px solid rgba(255,255,255,.3);border-top:4px solid var(--white);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})};export{K as PageGridModalComponent};
@@ -0,0 +1,85 @@
1
+ import{$a as wn,Ad as Ln,Ag as zt,B as kt,Bb as T,Bf as Ue,C as Bt,D as bn,Fd as ye,G as at,Gd as Ee,Hd as ce,I as N,Ia as yn,Id as Be,J as lt,L as Ie,Lf as B,M as Vt,Ma as En,Mc as Cn,Nd as Ve,Nf as j,Ni as Wt,Oa as Dn,Of as Nn,Oi as ht,Pc as V,Pf as Rn,Qc as Tn,R as Gt,Ri as pt,Sh as Mn,T as ke,Uc as jt,Va as vn,Ve as ue,We as Fn,Xe as On,Y as Q,Yc as An,Za as $,Zc as Ht,_a as z,a as S,b as O,bb as Sn,cb as ct,ch as J,dd as I,dh as Y,e as H,fa as v,ha as be,hb as ut,hd as dt,ji as ft,k as mn,ma as P,n as X,nb as Ut,nf as L,of as k,pb as re,pf as De,s as gn,t as A,tf as Ge,ti as xn,ui as qt,v as le,va as C,x as ot,xa as w,xf as $t,y as x,yb as he,yd as _n,yg as q,zg as ee}from"./chunk-B3PWEOJU.js";var ve=new P("");var kn=null;function mt(){return kn}function Gr(r){kn??=r}var Kt=class{},Zt=(()=>{class r{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:()=>w(Bn),providedIn:"platform"})}return r})();var Bn=(()=>{class r extends Zt{_location;_history;_doc=w(ve);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return mt().getBaseHref(this._doc)}onPopState(e){let n=mt().getGlobalEventTarget(this._doc,"window");return n.addEventListener("popstate",e,!1),()=>n.removeEventListener("popstate",e)}onHashChange(e){let n=mt().getGlobalEventTarget(this._doc,"window");return n.addEventListener("hashchange",e,!1),()=>n.removeEventListener("hashchange",e)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(e){this._location.pathname=e}pushState(e,n,i){this._history.pushState(e,n,i)}replaceState(e,n,i){this._history.replaceState(e,n,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:()=>new r,providedIn:"platform"})}return r})();function Vn(r,t){return r?t?r.endsWith("/")?t.startsWith("/")?r+t.slice(1):r+t:t.startsWith("/")?r+t:`${r}/${t}`:r:t}function Pn(r){let t=r.search(/#|\?|$/);return r[t-1]==="/"?r.slice(0,t-1)+r.slice(t):r}function de(r){return r&&r[0]!=="?"?`?${r}`:r}var gt=(()=>{class r{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:()=>w(Un),providedIn:"root"})}return r})(),Gn=new P(""),Un=(()=>{class r extends gt{_platformLocation;_baseHref;_removeListenerFns=[];constructor(e,n){super(),this._platformLocation=e,this._baseHref=n??this._platformLocation.getBaseHrefFromDOM()??w(ve).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return Vn(this._baseHref,e)}path(e=!1){let n=this._platformLocation.pathname+de(this._platformLocation.search),i=this._platformLocation.hash;return i&&e?`${n}${i}`:n}pushState(e,n,i,s){let o=this.prepareExternalUrl(i+de(s));this._platformLocation.pushState(e,n,o)}replaceState(e,n,i,s){let o=this.prepareExternalUrl(i+de(s));this._platformLocation.replaceState(e,n,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(n){return new(n||r)(C(Zt),C(Gn,8))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),jn=(()=>{class r{_subject=new X;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(e){this._locationStrategy=e;let n=this._locationStrategy.getBaseHref();this._basePath=Hr(Pn(In(n))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,n=""){return this.path()==this.normalize(e+de(n))}normalize(e){return r.stripTrailingSlash(jr(this._basePath,In(e)))}prepareExternalUrl(e){return e&&e[0]!=="/"&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,n="",i=null){this._locationStrategy.pushState(i,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+de(n)),i)}replaceState(e,n="",i=null){this._locationStrategy.replaceState(i,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+de(n)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription??=this.subscribe(n=>{this._notifyUrlChangeListeners(n.url,n.state)}),()=>{let n=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(n,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",n){this._urlChangeListeners.forEach(i=>i(e,n))}subscribe(e,n,i){return this._subject.subscribe({next:e,error:n??void 0,complete:i??void 0})}static normalizeQueryParams=de;static joinWithSlash=Vn;static stripTrailingSlash=Pn;static \u0275fac=function(n){return new(n||r)(C(gt))};static \u0275prov=v({token:r,factory:()=>Ur(),providedIn:"root"})}return r})();function Ur(){return new jn(C(gt))}function jr(r,t){if(!r||!t.startsWith(r))return t;let e=t.substring(r.length);return e===""||["/",";","?","#"].includes(e[0])?e:t}function In(r){return r.replace(/\/index.html$/,"")}function Hr(r){if(new RegExp("^(https?:)?//").test(r)){let[,e]=r.split(/\/\/[^\/]+/);return e}return r}var Qt=function(r){return r[r.Decimal=0]="Decimal",r[r.Percent=1]="Percent",r[r.Currency=2]="Currency",r[r.Scientific=3]="Scientific",r}(Qt||{});var te={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function we(r,t){let e=$t(r),n=e[Ue.NumberSymbols][t];if(typeof n>"u"){if(t===te.CurrencyDecimal)return e[Ue.NumberSymbols][te.Decimal];if(t===te.CurrencyGroup)return e[Ue.NumberSymbols][te.Group]}return n}function Zn(r,t){return $t(r)[Ue.NumberFormats][t]}var $r=/^(\d+)?\.((\d+)(-(\d+))?)?$/,Hn=22,bt=".",je="0",zr=";",qr=",",Jt="#";function Wr(r,t,e,n,i,s,o=!1){let a="",l=!1;if(!isFinite(r))a=we(e,te.Infinity);else{let c=Jr(r);o&&(c=Zr(c));let f=t.minInt,d=t.minFrac,u=t.maxFrac;if(s){let g=s.match($r);if(g===null)throw new Error(`${s} is not a valid digit info`);let E=g[1],D=g[3],_=g[5];E!=null&&(f=Yt(E)),D!=null&&(d=Yt(D)),_!=null?u=Yt(_):D!=null&&d>u&&(u=d)}Yr(c,d,u);let h=c.digits,m=c.integerLen,b=c.exponent,y=[];for(l=h.every(g=>!g);m<f;m++)h.unshift(0);for(;m<0;m++)h.unshift(0);m>0?y=h.splice(m,h.length):(y=h,h=[0]);let p=[];for(h.length>=t.lgSize&&p.unshift(h.splice(-t.lgSize,h.length).join(""));h.length>t.gSize;)p.unshift(h.splice(-t.gSize,h.length).join(""));h.length&&p.unshift(h.join("")),a=p.join(we(e,n)),y.length&&(a+=we(e,i)+y.join("")),b&&(a+=we(e,te.Exponential)+"+"+b)}return r<0&&!l?a=t.negPre+a+t.negSuf:a=t.posPre+a+t.posSuf,a}function Jn(r,t,e){let n=Zn(t,Qt.Decimal),i=Kr(n,we(t,te.MinusSign));return Wr(r,i,t,te.Group,te.Decimal,e)}function Kr(r,t="-"){let e={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=r.split(zr),i=n[0],s=n[1],o=i.indexOf(bt)!==-1?i.split(bt):[i.substring(0,i.lastIndexOf(je)+1),i.substring(i.lastIndexOf(je)+1)],a=o[0],l=o[1]||"";e.posPre=a.substring(0,a.indexOf(Jt));for(let f=0;f<l.length;f++){let d=l.charAt(f);d===je?e.minFrac=e.maxFrac=f+1:d===Jt?e.maxFrac=f+1:e.posSuf+=d}let c=a.split(qr);if(e.gSize=c[1]?c[1].length:0,e.lgSize=c[2]||c[1]?(c[2]||c[1]).length:0,s){let f=i.length-e.posPre.length-e.posSuf.length,d=s.indexOf(Jt);e.negPre=s.substring(0,d).replace(/'/g,""),e.negSuf=s.slice(d+f).replace(/'/g,"")}else e.negPre=t+e.posPre,e.negSuf=e.posSuf;return e}function Zr(r){if(r.digits[0]===0)return r;let t=r.digits.length-r.integerLen;return r.exponent?r.exponent+=2:(t===0?r.digits.push(0,0):t===1&&r.digits.push(0),r.integerLen+=2),r}function Jr(r){let t=Math.abs(r)+"",e=0,n,i,s,o,a;for((i=t.indexOf(bt))>-1&&(t=t.replace(bt,"")),(s=t.search(/e/i))>0?(i<0&&(i=s),i+=+t.slice(s+1),t=t.substring(0,s)):i<0&&(i=t.length),s=0;t.charAt(s)===je;s++);if(s===(a=t.length))n=[0],i=1;else{for(a--;t.charAt(a)===je;)a--;for(i-=s,n=[],o=0;s<=a;s++,o++)n[o]=Number(t.charAt(s))}return i>Hn&&(n=n.splice(0,Hn-1),e=i-1,i=1),{digits:n,exponent:e,integerLen:i}}function Yr(r,t,e){if(t>e)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${e}).`);let n=r.digits,i=n.length-r.integerLen,s=Math.min(Math.max(t,i),e),o=s+r.integerLen,a=n[o];if(o>0){n.splice(Math.max(r.integerLen,o));for(let d=o;d<n.length;d++)n[d]=0}else{i=Math.max(0,i),r.integerLen=1,n.length=Math.max(1,o=s+1),n[0]=0;for(let d=1;d<o;d++)n[d]=0}if(a>=5)if(o-1<0){for(let d=0;d>o;d--)n.unshift(0),r.integerLen++;n.unshift(1),r.integerLen++}else n[o-1]++;for(;i<Math.max(0,s);i++)n.push(0);let l=s!==0,c=t+r.integerLen,f=n.reduceRight(function(d,u,h,m){return u=u+d,m[h]=u<10?u:u-10,l&&(m[h]===0&&h>=c?m.pop():l=!1),u>=10?1:0},0);f&&(n.unshift(f),r.integerLen++)}function Yt(r){let t=parseInt(r);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+r);return t}var Xt=/\s+/,$n=[],Xr=(()=>{class r{_ngEl;_renderer;initialClasses=$n;rawClass;stateMap=new Map;constructor(e,n){this._ngEl=e,this._renderer=n}set klass(e){this.initialClasses=e!=null?e.trim().split(Xt):$n}set ngClass(e){this.rawClass=typeof e=="string"?e.trim().split(Xt):e}ngDoCheck(){for(let n of this.initialClasses)this._updateState(n,!0);let e=this.rawClass;if(Array.isArray(e)||e instanceof Set)for(let n of e)this._updateState(n,!0);else if(e!=null)for(let n of Object.keys(e))this._updateState(n,!!e[n]);this._applyStateDiff()}_updateState(e,n){let i=this.stateMap.get(e);i!==void 0?(i.enabled!==n&&(i.changed=!0,i.enabled=n),i.touched=!0):this.stateMap.set(e,{enabled:n,changed:!0,touched:!0})}_applyStateDiff(){for(let e of this.stateMap){let n=e[0],i=e[1];i.changed?(this._toggleClass(n,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(n,!1),this.stateMap.delete(n)),i.touched=!1}}_toggleClass(e,n){e=e.trim(),e.length>0&&e.split(Xt).forEach(i=>{n?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(n){return new(n||r)(I(he),I(Ht))};static \u0275dir=ce({type:r,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return r})(),Qr=(()=>{class r{_viewContainerRef;ngComponentOutlet=null;ngComponentOutletInputs;ngComponentOutletInjector;ngComponentOutletContent;ngComponentOutletNgModule;ngComponentOutletNgModuleFactory;_componentRef;_moduleRef;_inputsUsed=new Map;get componentInstance(){return this._componentRef?.instance??null}constructor(e){this._viewContainerRef=e}_needToReCreateNgModuleInstance(e){return e.ngComponentOutletNgModule!==void 0||e.ngComponentOutletNgModuleFactory!==void 0}_needToReCreateComponentInstance(e){return e.ngComponentOutlet!==void 0||e.ngComponentOutletContent!==void 0||e.ngComponentOutletInjector!==void 0||this._needToReCreateNgModuleInstance(e)}ngOnChanges(e){if(this._needToReCreateComponentInstance(e)&&(this._viewContainerRef.clear(),this._inputsUsed.clear(),this._componentRef=void 0,this.ngComponentOutlet)){let n=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;this._needToReCreateNgModuleInstance(e)&&(this._moduleRef?.destroy(),this.ngComponentOutletNgModule?this._moduleRef=Ln(this.ngComponentOutletNgModule,zn(n)):this.ngComponentOutletNgModuleFactory?this._moduleRef=this.ngComponentOutletNgModuleFactory.create(zn(n)):this._moduleRef=void 0),this._componentRef=this._viewContainerRef.createComponent(this.ngComponentOutlet,{injector:n,ngModuleRef:this._moduleRef,projectableNodes:this.ngComponentOutletContent})}}ngDoCheck(){if(this._componentRef){if(this.ngComponentOutletInputs)for(let e of Object.keys(this.ngComponentOutletInputs))this._inputsUsed.set(e,!0);this._applyInputStateDiff(this._componentRef)}}ngOnDestroy(){this._moduleRef?.destroy()}_applyInputStateDiff(e){for(let[n,i]of this._inputsUsed)i?(e.setInput(n,this.ngComponentOutletInputs[n]),this._inputsUsed.set(n,!1)):(e.setInput(n,void 0),this._inputsUsed.delete(n))}static \u0275fac=function(n){return new(n||r)(I(dt))};static \u0275dir=ce({type:r,selectors:[["","ngComponentOutlet",""]],inputs:{ngComponentOutlet:"ngComponentOutlet",ngComponentOutletInputs:"ngComponentOutletInputs",ngComponentOutletInjector:"ngComponentOutletInjector",ngComponentOutletContent:"ngComponentOutletContent",ngComponentOutletNgModule:"ngComponentOutletNgModule",ngComponentOutletNgModuleFactory:"ngComponentOutletNgModuleFactory"},exportAs:["ngComponentOutlet"],features:[vn]})}return r})();function zn(r){return r.get(_n).injector}var yt=class{$implicit;ngForOf;index;count;constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},Yn=(()=>{class r{_viewContainer;_template;_differs;set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(e,n,i){this._viewContainer=e,this._template=n,this._differs=i}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let e=this._ngForOf;!this._differ&&e&&(this._differ=this._differs.find(e).create(this.ngForTrackBy))}if(this._differ){let e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){let n=this._viewContainer;e.forEachOperation((i,s,o)=>{if(i.previousIndex==null)n.createEmbeddedView(this._template,new yt(i.item,this._ngForOf,-1,-1),o===null?void 0:o);else if(o==null)n.remove(s===null?void 0:s);else if(s!==null){let a=n.get(s);n.move(a,o),qn(a,i)}});for(let i=0,s=n.length;i<s;i++){let a=n.get(i).context;a.index=i,a.count=s,a.ngForOf=this._ngForOf}e.forEachIdentityChange(i=>{let s=n.get(i.currentIndex);qn(s,i)})}static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||r)(I(dt),I(jt),I(xn))};static \u0275dir=ce({type:r,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return r})();function qn(r,t){r.context.$implicit=t.item}var He=(()=>{class r{_viewContainer;_context=new Et;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(e,n){this._viewContainer=e,this._thenTemplateRef=n}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){Wn(e,!1),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){Wn(e,!1),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||r)(I(dt),I(jt))};static \u0275dir=ce({type:r,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return r})(),Et=class{$implicit=null;ngIf=null};function Wn(r,t){if(r&&!r.createEmbeddedView)throw new Q(2020,!1)}var ei=(()=>{class r{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(e,n,i){this._ngEl=e,this._differs=n,this._renderer=i}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){let e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,n){let[i,s]=e.split("."),o=i.indexOf("-")===-1?void 0:Tn.DashCase;n!=null?this._renderer.setStyle(this._ngEl.nativeElement,i,s?`${n}${s}`:n,o):this._renderer.removeStyle(this._ngEl.nativeElement,i,o)}_applyChanges(e){e.forEachRemovedItem(n=>this._setStyle(n.key,null)),e.forEachAddedItem(n=>this._setStyle(n.key,n.currentValue)),e.forEachChangedItem(n=>this._setStyle(n.key,n.currentValue))}static \u0275fac=function(n){return new(n||r)(I(he),I(qt),I(Ht))};static \u0275dir=ce({type:r,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return r})();function ti(r,t){return new Q(2100,!1)}function ni(r,t){return{key:r,value:t}}var ri=(()=>{class r{differs;constructor(e){this.differs=e}differ;keyValues=[];compareFn=Kn;transform(e,n=Kn){if(!e||!(e instanceof Map)&&typeof e!="object")return null;this.differ??=this.differs.find(e).create();let i=this.differ.diff(e),s=n!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(o=>{this.keyValues.push(ni(o.key,o.currentValue))})),(i||s)&&(n&&this.keyValues.sort(n),this.compareFn=n),this.keyValues}static \u0275fac=function(n){return new(n||r)(I(qt,16))};static \u0275pipe=Be({name:"keyvalue",type:r,pure:!1})}return r})();function Kn(r,t){let e=r.key,n=t.key;if(e===n)return 0;if(e==null)return 1;if(n==null)return-1;if(typeof e=="string"&&typeof n=="string")return e<n?-1:1;if(typeof e=="number"&&typeof n=="number")return e-n;if(typeof e=="boolean"&&typeof n=="boolean")return e<n?-1:1;let i=String(e),s=String(n);return i==s?0:i<s?-1:1}var ii=(()=>{class r{_locale;constructor(e){this._locale=e}transform(e,n,i){if(!si(e))return null;i||=this._locale;try{let s=oi(e);return Jn(s,i,n)}catch(s){throw ti(r,s.message)}}static \u0275fac=function(n){return new(n||r)(I(Mn,16))};static \u0275pipe=Be({name:"number",type:r,pure:!0})}return r})();function si(r){return!(r==null||r===""||r!==r)}function oi(r){if(typeof r=="string"&&!isNaN(Number(r)-parseFloat(r)))return Number(r);if(typeof r!="number")throw new Error(`${r} is not a number`);return r}var pe=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=Ee({type:r});static \u0275inj=be({})}return r})();function en(r,t){t=encodeURIComponent(t);for(let e of r.split(";")){let n=e.indexOf("="),[i,s]=n==-1?[e,""]:[e.slice(0,n),e.slice(n+1)];if(i.trim()===t)return decodeURIComponent(s)}return null}var Xn="browser",Qn="server";function ai(r){return r===Xn}function li(r){return r===Qn}var $e=class{};var We=class{},nr=(()=>{class r{handle(e){return e.key}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),Se=class{},rr=(()=>{class r extends Se{compile(e,n){return e}compileTranslations(e,n){return e}static \u0275fac=(()=>{let e;return function(i){return(e||(e=ct(r)))(i||r)}})();static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),Ce=class{},ir=(()=>{class r extends Ce{getTranslation(e){return A({})}static \u0275fac=(()=>{let e;return function(i){return(e||(e=ct(r)))(i||r)}})();static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})();function Ke(r,t){if(r===t)return!0;if(r===null||t===null)return!1;if(r!==r&&t!==t)return!0;let e=typeof r,n=typeof t,i;if(e==n&&e=="object")if(Array.isArray(r)){if(!Array.isArray(t))return!1;if((i=r.length)==t.length){for(let s=0;s<i;s++)if(!Ke(r[s],t[s]))return!1;return!0}}else{if(Array.isArray(t))return!1;if(ie(r)&&ie(t)){let s=Object.create(null);for(let o in r){if(!Ke(r[o],t[o]))return!1;s[o]=!0}for(let o in t)if(!(o in s)&&typeof t[o]<"u")return!1;return!0}}return!1}function W(r){return typeof r<"u"&&r!==null}function tr(r){return r!==void 0}function ie(r){return qe(r)&&!me(r)&&r!==null}function qe(r){return typeof r=="object"&&r!==null}function me(r){return Array.isArray(r)}function Ze(r){return typeof r=="string"}function ci(r){return typeof r=="function"}function Dt(r){if(me(r))return r.map(t=>Dt(t));if(ie(r)){let t={};return Object.keys(r).forEach(e=>{t[e]=Dt(r[e])}),t}else return r}function sn(r,t){if(!qe(r))return Dt(t);let e=Dt(r);return qe(e)&&qe(t)&&Object.keys(t).forEach(n=>{ie(t[n])?n in r?e[n]=sn(r[n],t[n]):Object.assign(e,{[n]:t[n]}):Object.assign(e,{[n]:t[n]})}),e}function sr(r,t){let e=t.split(".");t="";do{t+=e.shift();let n=!e.length;if(W(r)){if(ie(r)&&tr(r[t])&&(ie(r[t])||me(r[t])||n)){r=r[t],t="";continue}if(me(r)){let i=parseInt(t,10);if(tr(r[i])&&(ie(r[i])||me(r[i])||n)){r=r[i],t="";continue}}}if(n){r=void 0;continue}t+="."}while(e.length);return r}function ui(r,t,e){return sn(r,di(t,e))}function di(r,t){return r.split(".").reduceRight((e,n)=>({[n]:e}),t)}var Te=class{},or=(()=>{class r extends Te{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,n){if(Ze(e))return this.interpolateString(e,n);if(ci(e))return this.interpolateFunction(e,n)}interpolateFunction(e,n){return e(n)}interpolateString(e,n){return n?e.replace(this.templateMatcher,(i,s)=>{let o=this.getInterpolationReplacement(n,s);return o!==void 0?o:i}):e}getInterpolationReplacement(e,n){return this.formatValue(sr(e,n))}formatValue(e){if(Ze(e))return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(e===null)return"null";if(me(e))return e.join(", ");if(qe(e))return typeof e.toString=="function"&&e.toString!==Object.prototype.toString?e.toString():JSON.stringify(e)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=ct(r)))(i||r)}})();static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),tn=(()=>{class r{_onTranslationChange=new X;_onLangChange=new X;_onFallbackLangChange=new X;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(e){return this.translations[e]}setTranslations(e,n,i){this.translations[e]=i&&this.hasTranslationFor(e)?sn(this.translations[e],n):n,this.addLanguages([e]),this._onTranslationChange.next({lang:e,translations:this.getTranslations(e)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(e,n=!0){this.fallbackLang=e,n&&this._onFallbackLangChange.next({lang:e,translations:this.translations[e]})}setCurrentLang(e,n=!0){this.currentLang=e,n&&this._onLangChange.next({lang:e,translations:this.translations[e]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(e){this.languages=Array.from(new Set([...this.languages,...e]))}hasTranslationFor(e){return typeof this.translations[e]<"u"}deleteTranslations(e){delete this.translations[e]}getTranslation(e){let n=this.getValue(this.currentLang,e);return n===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(n=this.getValue(this.fallbackLang,e)),n}getValue(e,n){return sr(this.getTranslations(e),n)}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),nn=new P("TRANSLATE_CONFIG"),ze=r=>le(r)?r:A(r);var vt=(()=>{class r{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=w(Ce);compiler=w(Se);parser=w(Te);missingTranslationHandler=w(We);store=w(tn);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let e=S({extend:!1,fallbackLang:null},w(nn,{optional:!0}));e.lang&&this.use(e.lang),e.fallbackLang&&this.setFallbackLang(e.fallbackLang),e.extend&&(this.extend=!0)}setFallbackLang(e){this.getFallbackLang()||this.store.setFallbackLang(e,!1);let n=this.loadOrExtendLanguage(e);return le(n)?(n.pipe(Ie(1)).subscribe({next:()=>{this.store.setFallbackLang(e)},error:()=>{}}),n):(this.store.setFallbackLang(e),A(this.store.getTranslations(e)))}use(e){this.lastUseLanguage=e,this.getCurrentLang()||this.store.setCurrentLang(e,!1);let n=this.loadOrExtendLanguage(e);return le(n)?(n.pipe(Ie(1)).subscribe({next:()=>{this.changeLang(e)},error:()=>{}}),n):(this.changeLang(e),A(this.store.getTranslations(e)))}loadOrExtendLanguage(e){if(!this.store.hasTranslationFor(e)||this.extend)return this._translationRequests[e]=this._translationRequests[e]||this.loadAndCompileTranslations(e),this._translationRequests[e]}changeLang(e){e===this.lastUseLanguage&&this.store.setCurrentLang(e)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(e){this.pending=!0;let n=this.currentLoader.getTranslation(e).pipe(Gt(1),Ie(1));return this.loadingTranslations=n.pipe(x(i=>this.compiler.compileTranslations(i,e)),Gt(1),Ie(1)),this.loadingTranslations.subscribe({next:i=>{this.store.setTranslations(e,i,this.extend),this.pending=!1},error:i=>{this.pending=!1}}),n}setTranslation(e,n,i=!1){let s=this.compiler.compileTranslations(n,e);this.store.setTranslations(e,s,i||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(e){this.store.addLanguages(e)}getParsedResultForKey(e,n){let i=this.getTextToInterpolate(e);if(W(i))return this.runInterpolation(i,n);let s=this.missingTranslationHandler.handle(S({key:e,translateService:this},n!==void 0&&{interpolateParams:n}));return s!==void 0?s:e}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(e){return this.store.getTranslation(e)}runInterpolation(e,n){if(W(e))return me(e)?this.runInterpolationOnArray(e,n):ie(e)?this.runInterpolationOnDict(e,n):this.parser.interpolate(e,n)}runInterpolationOnArray(e,n){return e.map(i=>this.runInterpolation(i,n))}runInterpolationOnDict(e,n){let i={};for(let s in e){let o=this.runInterpolation(e[s],n);o!==void 0&&(i[s]=o)}return i}getParsedResult(e,n){return e instanceof Array?this.getParsedResultForArray(e,n):this.getParsedResultForKey(e,n)}getParsedResultForArray(e,n){let i={},s=!1;for(let a of e)i[a]=this.getParsedResultForKey(a,n),s=s||le(i[a]);if(!s)return i;let o=e.map(a=>ze(i[a]));return bn(o).pipe(x(a=>{let l={};return a.forEach((c,f)=>{l[e[f]]=c}),l}))}get(e,n){if(!W(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(lt(()=>ze(this.getParsedResult(e,n)))):ze(this.getParsedResult(e,n))}getStreamOnTranslationChange(e,n){if(!W(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return kt(Bt(()=>this.get(e,n)),this.onTranslationChange.pipe(ke(()=>{let i=this.getParsedResult(e,n);return ze(i)})))}stream(e,n){if(!W(e)||!e.length)throw new Error('Parameter "key" required');return kt(Bt(()=>this.get(e,n)),this.onLangChange.pipe(ke(()=>{let i=this.getParsedResult(e,n);return ze(i)})))}instant(e,n){if(!W(e)||e.length===0)throw new Error('Parameter "key" is required and cannot be empty');let i=this.getParsedResult(e,n);return le(i)?Array.isArray(e)?e.reduce((s,o)=>(s[o]=o,s),{}):e:i}set(e,n,i=this.getCurrentLang()){this.store.setTranslations(i,ui(this.store.getTranslations(i),e,Ze(n)?this.compiler.compile(n,i):this.compiler.compileTranslations(n,i)),!1)}reloadLang(e){return this.resetLang(e),this.loadAndCompileTranslations(e)}resetLang(e){delete this._translationRequests[e],this.store.deleteTranslations(e)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let e=this.getBrowserCultureLang();return e?e.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return r.getBrowserLang()}getBrowserCultureLang(){return r.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(e){return this.setFallbackLang(e)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(n){return new(n||r)};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),Qo=(()=>{class r{translateService=w(vt);element=w(he);_ref=w(ft);key;lastParams;currentParams;onLangChangeSub;onFallbackLangChangeSub;onTranslationChangeSub;set translate(e){e&&(this.key=e,this.checkNodes())}set translateParams(e){Ke(this.currentParams,e)||(this.currentParams=e,this.checkNodes(!0))}constructor(){this.onTranslationChangeSub||(this.onTranslationChangeSub=this.translateService.onTranslationChange.subscribe(e=>{e.lang===this.translateService.currentLang&&this.checkNodes(!0,e.translations)})),this.onLangChangeSub||(this.onLangChangeSub=this.translateService.onLangChange.subscribe(e=>{this.checkNodes(!0,e.translations)})),this.onFallbackLangChangeSub||(this.onFallbackLangChangeSub=this.translateService.onFallbackLangChange.subscribe(e=>{this.checkNodes(!0)}))}ngAfterViewChecked(){this.checkNodes()}checkNodes(e=!1,n){let i=this.element.nativeElement.childNodes;i.length||(this.setContent(this.element.nativeElement,this.key),i=this.element.nativeElement.childNodes),i.forEach(s=>{let o=s;if(o.nodeType===3){let a;if(e&&(o.lastKey=null),W(o.lookupKey))a=o.lookupKey;else if(this.key)a=this.key;else{let l=this.getContent(o),c=l.trim();c.length&&(o.lookupKey=c,l!==o.currentValue?(a=c,o.originalContent=l||o.originalContent):o.originalContent&&(a=o.originalContent.trim()))}this.updateValue(a,o,n)}})}updateValue(e,n,i){if(e){if(n.lastKey===e&&this.lastParams===this.currentParams)return;this.lastParams=this.currentParams;let s=o=>{(o!==e||!n.lastKey)&&(n.lastKey=e),n.originalContent||(n.originalContent=this.getContent(n)),Ze(o)?n.currentValue=o:W(o)?n.currentValue=JSON.stringify(o):n.currentValue=n.originalContent||e,this.setContent(n,this.key?n.currentValue:n.originalContent.replace(e,n.currentValue)),this._ref.markForCheck()};if(W(i)){let o=this.translateService.getParsedResult(e,this.currentParams);le(o)?o.subscribe({next:s}):s(o)}else this.translateService.get(e,this.currentParams).subscribe(s)}}getContent(e){return W(e.textContent)?e.textContent:e.data}setContent(e,n){W(e.textContent)?e.textContent=n:e.data=n}ngOnDestroy(){this.onLangChangeSub&&this.onLangChangeSub.unsubscribe(),this.onFallbackLangChangeSub&&this.onFallbackLangChangeSub.unsubscribe(),this.onTranslationChangeSub&&this.onTranslationChangeSub.unsubscribe()}static \u0275fac=function(n){return new(n||r)};static \u0275dir=ce({type:r,selectors:[["","translate",""],["","ngx-translate",""]],inputs:{translate:"translate",translateParams:"translateParams"}})}return r})(),Ae=(()=>{class r{translate=w(vt);_ref=w(ft);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(e,n,i){let s=o=>{this.value=o!==void 0?o:e,this.lastKey=e,this._ref.markForCheck()};if(i){let o=this.translate.getParsedResult(e,n);le(o)?o.subscribe(s):s(o)}this.translate.get(e,n).subscribe(s)}transform(e,...n){if(!e||!e.length)return e;if(Ke(e,this.lastKey)&&Ke(n,this.lastParams))return this.value;let i;if(W(n[0])&&n.length)if(Ze(n[0])&&n[0].length){let s=n[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{i=JSON.parse(s)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${n[0]}`)}}else ie(n[0])&&(i=n[0]);return this.lastKey=e,this.lastParams=n,this.updateValue(e,i),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(s=>{(this.lastKey&&s.lang===this.translate.getCurrentLang()||s.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(s=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(n){return new(n||r)};static \u0275pipe=Be({name:"translate",type:r,pure:!1});static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})();function ar(r){return{provide:Ce,useClass:r}}function lr(r){return{provide:Se,useClass:r}}function cr(r){return{provide:Te,useClass:r}}function ur(r){return{provide:We,useClass:r}}function ea(r={}){return rn(S({compiler:lr(rr),parser:cr(or),loader:ar(ir),missingTranslationHandler:ur(nr)},r),!0)}function rn(r={},t){let e=[];r.loader&&e.push(r.loader),r.compiler&&e.push(r.compiler),r.parser&&e.push(r.parser),r.missingTranslationHandler&&e.push(r.missingTranslationHandler),t&&e.push(tn),(r.useDefaultLang||r.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),r.useDefaultLang===!0&&r.defaultLanguage&&(r.fallbackLang=r.defaultLanguage));let n={fallbackLang:r.fallbackLang??null,lang:r.lang,extend:r.extend??!1};return e.push({provide:nn,useValue:n}),e.push({provide:vt,useClass:vt,deps:[tn,Ce,Se,Te,We,nn]}),e}var _e=(()=>{class r{static forRoot(e={}){return{ngModule:r,providers:[...rn(S({compiler:lr(rr),parser:cr(or),loader:ar(ir),missingTranslationHandler:ur(nr)},e),!0)]}}static forChild(e={}){return{ngModule:r,providers:[...rn(e,e.isolate??!1)]}}static \u0275fac=function(n){return new(n||r)};static \u0275mod=Ee({type:r});static \u0275inj=be({})}return r})();var ne=class r{params=T({});pageGuid=T("");setParams(t){this.params.update(e=>S(S({},e),t))}updateTemplateName(t){this.params.update(e=>{let n=e.templateData?O(S({},e.templateData),{publicationTemplateName:t}):{publicationTemplateName:t};return O(S({},e),{templateData:n})})}get token(){return this.params().token}get type(){return this.params().type}get guid(){return this.params().guid}get apiUrl(){return this.params().apiUrl}get language(){return this.params().language}get templateData(){return this.params().templateData}get documentData(){return this.params().documentData}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var dr=class r{modalState=new X;modalState$=this.modalState.asObservable();open(t,e){this.modalState.next({component:t,data:e})}close(){this.modalState.next(null)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Fe=class{},Je=class{},F=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
2
+ `).forEach(e=>{let n=e.indexOf(":");if(n>0){let i=e.slice(0,n),s=e.slice(n+1).trim();this.addHeaderEntry(i,s)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let i=(t.op==="a"?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":let s=t.value;if(!s)this.headers.delete(e),this.normalizedNames.delete(e);else{let o=this.headers.get(e);if(!o)return;o=o.filter(a=>s.indexOf(a)===-1),o.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,o)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(s=>s.toString()),i=t.toLowerCase();this.headers.set(i,n),this.maybeSetNormalizedName(t,i)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var St=class{encodeKey(t){return fr(t)}encodeValue(t){return fr(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function fi(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(i=>{let s=i.indexOf("="),[o,a]=s==-1?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,s)),t.decodeValue(i.slice(s+1))],l=e.get(o)||[];l.push(a),e.set(o,l)}),e}var hi=/%(\d[a-f0-9])/gi,pi={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function fr(r){return encodeURIComponent(r).replace(hi,(t,e)=>pi[e]??t)}function wt(r){return`${r}`}var se=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new St,t.fromString){if(t.fromObject)throw new Q(2805,!1);this.map=fi(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],i=Array.isArray(n)?n.map(wt):[wt(n)];this.map.set(e,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let i=t[n];Array.isArray(i)?i.forEach(s=>{e.push({param:n,value:s,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(wt(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],i=n.indexOf(wt(t.value));i!==-1&&n.splice(i,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var Ct=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function mi(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function hr(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function pr(r){return typeof Blob<"u"&&r instanceof Blob}function mr(r){return typeof FormData<"u"&&r instanceof FormData}function gi(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var gr="Content-Type",br="Accept",Er="X-Request-URL",Dr="text/plain",vr="application/json",bi=`${vr}, ${Dr}, */*`,Le=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,i){this.url=e,this.method=t.toUpperCase();let s;if(mi(this.method)||i?(this.body=n!==void 0?n:null,s=i):s=n,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),this.transferCache=s.transferCache),this.headers??=new F,this.context??=new Ct,!this.params)this.params=new se,this.urlWithParams=e;else{let o=this.params.toString();if(o.length===0)this.urlWithParams=e;else{let a=e.indexOf("?"),l=a===-1?"?":a<e.length-1?"&":"";this.urlWithParams=e+l+o}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||hr(this.body)||pr(this.body)||mr(this.body)||gi(this.body)?this.body:this.body instanceof se?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||mr(this.body)?null:pr(this.body)?this.body.type||null:hr(this.body)?null:typeof this.body=="string"?Dr:this.body instanceof se?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?vr:null}clone(t={}){let e=t.method||this.method,n=t.url||this.url,i=t.responseType||this.responseType,s=t.transferCache??this.transferCache,o=t.body!==void 0?t.body:this.body,a=t.withCredentials??this.withCredentials,l=t.reportProgress??this.reportProgress,c=t.headers||this.headers,f=t.params||this.params,d=t.context??this.context;return t.setHeaders!==void 0&&(c=Object.keys(t.setHeaders).reduce((u,h)=>u.set(h,t.setHeaders[h]),c)),t.setParams&&(f=Object.keys(t.setParams).reduce((u,h)=>u.set(h,t.setParams[h]),f)),new r(e,n,o,{params:f,headers:c,context:d,reportProgress:l,responseType:i,withCredentials:a,transferCache:s})}},ge=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(ge||{}),Oe=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new F,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},Tt=class r extends Oe{constructor(t={}){super(t)}type=ge.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},Ye=class r extends Oe{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=ge.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},Xe=class extends Oe{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},yi=200,Ei=204;function ln(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Ne=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,i={}){let s;if(e instanceof Le)s=e;else{let l;i.headers instanceof F?l=i.headers:l=new F(i.headers);let c;i.params&&(i.params instanceof se?c=i.params:c=new se({fromObject:i.params})),s=new Le(e,n,i.body!==void 0?i.body:null,{headers:l,context:i.context,params:c,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache})}let o=A(s).pipe(lt(l=>this.handler.handle(l)));if(e instanceof Le||i.observe==="events")return o;let a=o.pipe(at(l=>l instanceof Ye));switch(i.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(x(l=>{if(l.body!==null&&!(l.body instanceof ArrayBuffer))throw new Q(2806,!1);return l.body}));case"blob":return a.pipe(x(l=>{if(l.body!==null&&!(l.body instanceof Blob))throw new Q(2807,!1);return l.body}));case"text":return a.pipe(x(l=>{if(l.body!==null&&typeof l.body!="string")throw new Q(2808,!1);return l.body}));case"json":default:return a.pipe(x(l=>l.body))}case"response":return a;default:throw new Q(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new se().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,i={}){return this.request("PATCH",e,ln(i,n))}post(e,n,i={}){return this.request("POST",e,ln(i,n))}put(e,n,i={}){return this.request("PUT",e,ln(i,n))}static \u0275fac=function(n){return new(n||r)(C(Fe))};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})();var Di=new P("");function wr(r,t){return t(r)}function vi(r,t){return(e,n)=>t.intercept(e,{handle:i=>r(i,n)})}function wi(r,t,e){return(n,i)=>Dn(e,()=>t(n,s=>r(s,i)))}var Sr=new P(""),un=new P(""),Cr=new P(""),dn=new P("",{providedIn:"root",factory:()=>!0});function Si(){let r=null;return(t,e)=>{r===null&&(r=(w(Sr,{optional:!0})??[]).reduceRight(vi,wr));let n=w(Ut);if(w(dn)){let s=n.add();return r(t,e).pipe(Vt(()=>n.remove(s)))}else return r(t,e)}}var At=(()=>{class r extends Fe{backend;injector;chain=null;pendingTasks=w(Ut);contributeToStability=w(dn);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(un),...this.injector.get(Cr,[])]));this.chain=n.reduceRight((i,s)=>wi(i,s,this.injector),wr)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,i=>this.backend.handle(i)).pipe(Vt(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(C(Je),C(En))};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})();var Ci=/^\)\]\}',?\n/,Ti=RegExp(`^${Er}:`,"m");function Ai(r){return"responseURL"in r&&r.responseURL?r.responseURL:Ti.test(r.getAllResponseHeaders())?r.getResponseHeader(Er):null}var cn=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new Q(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?gn(n.\u0275loadImpl()):A(null)).pipe(ke(()=>new mn(s=>{let o=n.build();if(o.open(e.method,e.urlWithParams),e.withCredentials&&(o.withCredentials=!0),e.headers.forEach((b,y)=>o.setRequestHeader(b,y.join(","))),e.headers.has(br)||o.setRequestHeader(br,bi),!e.headers.has(gr)){let b=e.detectContentTypeHeader();b!==null&&o.setRequestHeader(gr,b)}if(e.responseType){let b=e.responseType.toLowerCase();o.responseType=b!=="json"?b:"text"}let a=e.serializeBody(),l=null,c=()=>{if(l!==null)return l;let b=o.statusText||"OK",y=new F(o.getAllResponseHeaders()),p=Ai(o)||e.url;return l=new Tt({headers:y,status:o.status,statusText:b,url:p}),l},f=()=>{let{headers:b,status:y,statusText:p,url:g}=c(),E=null;y!==Ei&&(E=typeof o.response>"u"?o.responseText:o.response),y===0&&(y=E?yi:0);let D=y>=200&&y<300;if(e.responseType==="json"&&typeof E=="string"){let _=E;E=E.replace(Ci,"");try{E=E!==""?JSON.parse(E):null}catch(G){E=_,D&&(D=!1,E={error:G,text:E})}}D?(s.next(new Ye({body:E,headers:b,status:y,statusText:p,url:g||void 0})),s.complete()):s.error(new Xe({error:E,headers:b,status:y,statusText:p,url:g||void 0}))},d=b=>{let{url:y}=c(),p=new Xe({error:b,status:o.status||0,statusText:o.statusText||"Unknown Error",url:y||void 0});s.error(p)},u=!1,h=b=>{u||(s.next(c()),u=!0);let y={type:ge.DownloadProgress,loaded:b.loaded};b.lengthComputable&&(y.total=b.total),e.responseType==="text"&&o.responseText&&(y.partialText=o.responseText),s.next(y)},m=b=>{let y={type:ge.UploadProgress,loaded:b.loaded};b.lengthComputable&&(y.total=b.total),s.next(y)};return o.addEventListener("load",f),o.addEventListener("error",d),o.addEventListener("timeout",d),o.addEventListener("abort",d),e.reportProgress&&(o.addEventListener("progress",h),a!==null&&o.upload&&o.upload.addEventListener("progress",m)),o.send(a),s.next({type:ge.Sent}),()=>{o.removeEventListener("error",d),o.removeEventListener("abort",d),o.removeEventListener("load",f),o.removeEventListener("timeout",d),e.reportProgress&&(o.removeEventListener("progress",h),a!==null&&o.upload&&o.upload.removeEventListener("progress",m)),o.readyState!==o.DONE&&o.abort()}})))}static \u0275fac=function(n){return new(n||r)(C($e))};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),Tr=new P(""),_i="XSRF-TOKEN",Li=new P("",{providedIn:"root",factory:()=>_i}),Fi="X-XSRF-TOKEN",Oi=new P("",{providedIn:"root",factory:()=>Fi}),Qe=class{},Ni=(()=>{class r{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n){this.doc=e,this.cookieName=n}getToken(){let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=en(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(C(ve),C(Li))};static \u0275prov=v({token:r,factory:r.\u0275fac})}return r})(),Ri=/^(?:https?:)?\/\//i;function Mi(r,t){if(!w(Tr)||r.method==="GET"||r.method==="HEAD"||Ri.test(r.url))return t(r);let e=w(Qe).getToken(),n=w(Oi);return e!=null&&!r.headers.has(n)&&(r=r.clone({headers:r.headers.set(n,e)})),t(r)}var fn=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(fn||{});function xi(r,t){return{\u0275kind:r,\u0275providers:t}}function Ar(...r){let t=[Ne,cn,At,{provide:Fe,useExisting:At},{provide:Je,useFactory:()=>w(Di,{optional:!0})??w(cn)},{provide:un,useValue:Mi,multi:!0},{provide:Tr,useValue:!0},{provide:Qe,useClass:Ni}];for(let e of r)t.push(...e.\u0275providers);return yn(t)}var yr=new P("");function _r(){return xi(fn.LegacyInterceptors,[{provide:yr,useFactory:Si},{provide:un,useExisting:yr,multi:!0}])}var Pi=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=Ee({type:r});static \u0275inj=be({providers:[Ar(_r())]})}return r})();var _t=class r{constructor(t,e){this.http=t;this.appParams=e}getSVGTemplate(t){let e=`${this.appParams.apiUrl}DataSheets/${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(N(s=>(console.error("Error in getSVGTemplate",s),A(null))))}getTemplateBackgroundsList(t){let e=`${this.appParams.apiUrl}DataSheets/backgrounds/template?templateId=${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(N(s=>(console.error("Error in getTemplateBackgroundsList",s),A(null))))}getSVGDocumentPages(t){let e=`${this.appParams.apiUrl}dam/documents/${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(N(s=>(console.error("Error in getSVGDocumentPages",s),A(null))))}getTemplateDimensions(){let t=`${this.appParams.apiUrl}DataSheets/templateDimensions`,e=this.appParams.token,n=new F({Authorization:`bearer ${e}`});return this.http.get(t,{headers:n}).pipe(N(i=>(console.error("Error in getTemplateDimensions",i),A(null))))}saveDocument(t,e){switch(t){case"productblock":t="productblocks";break;case"background":t="backgrounds";break;case"cover":t="coverpages";break;case"marketing":t="marketing";break;case"document":t="documents";break;default:break}let n=`${this.appParams.apiUrl}DataSheets/upload/${t.toLowerCase()}`,i=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.post(n,e,{headers:i}).pipe(N(s=>(console.error("Error saving document",s),A(null))))}loadSvgFromUrl(t){let e=Date.now(),n=t.includes("?")?"&":"?",i=`${t}${n}date=${e}`;return this.http.get(i,{responseType:"text"}).pipe(N(s=>(console.error("Error loading SVG from URL",s),A(""))))}addDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),s={assetGuid:t};return e!=null&&(s.start=e),this.http.post(n,s,{headers:i}).pipe(x(o=>o?.addPageToDocument),N(o=>(console.error("Error adding document page",o),A(null))))}duplicateDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.post(n,{assetGuid:t,fileGuid:e},{headers:i}).pipe(x(s=>s?.addPageToDocument),N(s=>(console.error("Error duplicating document page",s),A(null))))}moveDocumentPage(t,e,n){let i=`${this.appParams.apiUrl}Dam/documents/page/${t}/${e}/${n}`,s=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.put(i,null,{headers:s}).pipe(x(o=>o?.movePageOfDocument),N(o=>(console.error("Error moving document page",o),A(null))))}deleteDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page/${t}/${e}`,i=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.delete(n,{headers:i}).pipe(x(s=>s?.deletePageOfDocument),N(s=>(console.error("Error deleting document page",s),A(null))))}updateTemplateField(t,e){let n=`${this.appParams.apiUrl}DataSheets/field`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.put(n,{publicationTemplateGuid:this.appParams.guid,fieldName:t,fieldValue:e},{headers:i}).pipe(N(s=>(console.error("Error updating template field",s),A(null))))}getTemplates(){let t=`${this.appParams.apiUrl}DataSheets/publicationstemplates`,e=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.get(t,{headers:e}).pipe(x(n=>n?.Gabarits||[]),N(n=>(console.error("Error fetching templates",n),A([]))))}publishYoubooky(){let t=`${this.appParams.apiUrl}DataSheets/youbooky`,e=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),n={documentGuid:this.appParams.guid,isPublication:!1};return this.http.post(t,n,{headers:e}).pipe(N(i=>(console.error("Error publishing to Youbooky",i),A(null))))}checkPdfExistence(){let t=`${this.appParams.apiUrl}Dam/documents/exist/${this.appParams.guid}`,e=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.get(t,{headers:e}).pipe(N(n=>(console.error("Error checking PDF existence",n),A(null))))}generatePdf(t=!1,e="rgb"){let n=`${this.appParams.apiUrl}DataSheets/generate/svg`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),s={source:6,sourceGuid:this.appParams.guid,type:1,highDefinition:t,imageColorProfile:e,language:this.appParams.language};return this.http.post(n,s,{headers:i}).pipe(N(o=>(console.error("Error generating PDF",o),A(null))))}static \u0275fac=function(e){return new(e||r)(C(Ne),C(ne))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var et="1.104";function Bi(r,t){let e=r.getAttribute("data-sp-version");if(!e){let o=r.getAttribute("version");e=o&&o!=="1.1"?o:"1.0"}let n=["1.0","1.1","1.101","1.102","1.103","1.104"],i=n.indexOf(e);if(i===-1)return console.warn("Unknown version:",e),!1;if(i===n.length-1)return r.setAttribute("data-sp-version",e),r.setAttribute("version","1.1"),!1;let s=!1;for(let o=i+1;o<n.length;o++){let a=n[o],l=Gi[a];typeof l=="function"&&(l(r,t),r.setAttribute("data-sp-version",a),r.setAttribute("version","1.1"),s=!0)}return s}var Fr=["B","I","U","FONT"];function Or(r,t){if(!r.trim())return null;let e=document.createElement("tspan"),n=e,i=t.slice();for(let s=i.length-1;s>=0;s--){let o=document.createElement(i[s].nodeName.toLowerCase());for(let a of Array.from(i[s].attributes))o.setAttribute(a.name,a.value);n.appendChild(o),n=o}return n.textContent=r,e}function Vi(r){let t=/\{\{([^}]+)\}\}/g,e=[];function n(i,s=[]){if(i.nodeType===Node.TEXT_NODE){let o=i.textContent||"",a=0,l;for(;(l=t.exec(o))!==null;){let d=o.slice(a,l.index),u=l[0];a=t.lastIndex;let h=null;d&&(h=Or(d,s)),h||(h=document.createElement("tspan")),e.push(h);let m=l[1],b=s.every(p=>Fr.includes(p.nodeName)),y=document.createElement("tspan");if(y.setAttribute("class","textAttribute"),y.setAttribute("contenteditable","false"),y.setAttribute("data-info",m),y.setAttribute("data-show-text","true"),b){let p=y;for(let g=s.length-1;g>=0;g--){let E=document.createElement(s[g].nodeName.toLowerCase());for(let D of Array.from(s[g].attributes))E.setAttribute(D.name,D.value);p.appendChild(E),p=E}p.textContent=m}else y.textContent=m;e.push(y)}let c=o.slice(a),f=null;c&&(f=Or(c,s)),f||(f=document.createElement("tspan")),e.push(f)}else if(i.nodeType===Node.ELEMENT_NODE&&Fr.includes(i.nodeName))for(let o of Array.from(i.childNodes))n(o,[...s,i]);else for(let o of Array.from(i.childNodes))n(o,s)}return n(r),e}var Gi={"1.1":(r,t)=>{},"1.101":(r,t)=>{r.querySelectorAll('foreignObject[data-type="text"] > div > *:not(div)').forEach(i=>{let s=document.createElement("div");s.innerHTML=i.outerHTML,s.setAttribute("data-info",i.getAttribute("data-info")||""),i.replaceWith(s)}),r.querySelectorAll('foreignObject[data-type="text"] > div > div:not(.textAttribute)').forEach(i=>{let s=document.createElement("div");s.innerHTML=i.innerHTML;let o=Vi(s).filter(l=>l!==null),a=document.createElement("div");a.setAttribute("data-info",i.getAttribute("data-info")||""),o.forEach(l=>a.appendChild(l)),i.replaceWith(a)})},"1.102":(r,t)=>{let e=/(.*?)\{\{(.*?)\}\}(.*)/;r.querySelectorAll('foreignObject[data-type="variantsTable"]').forEach(i=>{let s=i.querySelector("tbody");if(!s||s.children.length<2)return;Array.from(s.children[1].children).forEach(a=>{let l=a.querySelector(".cellContent");if(!l)return;let f=(l.textContent||"").match(e);f&&(l.innerHTML=`<tspan></tspan><tspan class="textAttribute">${f[2]}</tspan><tspan></tspan>`)})})},"1.103":(r,t)=>{r.querySelectorAll('foreignObject[data-type="productTable"]').forEach(n=>{let i=n.querySelector("tbody");if(!i)return;Array.from(i.querySelectorAll("tr")).forEach(o=>{if(o.classList.contains("columns-index-row"))return;Array.from(o.children).forEach(l=>{if(l.classList.contains("row-index-cell"))return;let c=l,f=c.textContent?.trim();if(!f)return;let d=/\{\{(.+?)\}\}/g,u=0,h="";h+="<tspan></tspan>";let m;for(;(m=d.exec(f))!==null;){let y=f.slice(u,m.index),p=m[1];y&&(h+=`<tspan>${y}</tspan>`),h+=`<tspan class="textAttribute" contenteditable="false">${p}</tspan>`,u=d.lastIndex}let b=f.slice(u);b&&(h+=`<tspan>${b}</tspan>`),h+="<tspan></tspan>",c.innerHTML=h})})})},"1.104":(r,t)=>{r.querySelectorAll('foreignObject[data-type="variantsTable"] table, foreignObject[data-type="productTable"] table').forEach(l=>{let c=l;c.style.removeProperty("height"),c.style.minWidth==="var(--min-width)"&&c.style.removeProperty("min-width")}),r.querySelectorAll('foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(l=>{l.style.removeProperty("--min-width")}),r.querySelectorAll('foreignObject[data-type="productTable"] .wrap').forEach(l=>{l.removeAttribute("style")});let s=r.querySelectorAll('foreignObject[data-type="variantsTable"] table td, foreignObject[data-type="variantsTable"] table th');if(s.forEach(l=>{let c=l;(c.style.padding==="0px"||c.style.padding==="0")&&(c.style.removeProperty("padding"),c.getAttribute("style")||c.removeAttribute("style"))}),s.forEach(l=>{l.classList.contains("fixed-width")&&(l.classList.remove("fixed-width"),l.classList.length===0&&l.removeAttribute("class"))}),r.querySelectorAll('foreignObject[data-type="variantsTable"] table td div.wrap, foreignObject[data-type="variantsTable"] table th div.wrap').forEach(l=>{l.removeAttribute("style")}),r.querySelectorAll('foreignObject[data-type="variantsTable"] table td > div div, foreignObject[data-type="variantsTable"] table th > div div').forEach(l=>{let c=l;c.style.whiteSpace==="pre-wrap"&&(c.style.removeProperty("white-space"),c.getAttribute("style")||c.removeAttribute("style"))}),t&&t.publicationTemplateSettingVariants)try{let l=typeof t.publicationTemplateSettingVariants=="string"?JSON.parse(t.publicationTemplateSettingVariants):t.publicationTemplateSettingVariants;l?.backgroundVariation&&r.querySelectorAll('foreignObject[data-type="variantsTable"] table, table[data-type="variantsTable"], foreignObject[data-type="productTable"] table, table[data-type="productTable"]').forEach(f=>{if(l.backgroundVariation.hasVariation){f.setAttribute("data-background-variation","true");let d=l.backgroundVariation.backgroundColor;if(d)if(d.startsWith("rgb")){let u=d.replace(/^rgba?\(|\s+|\)$/g,"").split(","),h=parseInt(u[0]||"0",10).toString(16).padStart(2,"0"),m=parseInt(u[1]||"0",10).toString(16).padStart(2,"0"),b=parseInt(u[2]||"0",10).toString(16).padStart(2,"0");f.setAttribute("data-background-variation-color",`#${h}${m}${b}`)}else f.setAttribute("data-background-variation-color",d)}else f.setAttribute("data-background-variation","false")})}catch(l){console.warn("Could not parse publicationTemplateSettingVariants",l)}}};function Ui(r){r.querySelectorAll('foreignObject[data-type="text"], foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(e=>{e.querySelectorAll("tspan.textAttribute").forEach(n=>{let i=n;for(;i.children.length>0;)i=i.children[0];let o=i.innerHTML.replace(/^\{\{(.*)\}\}$/,"$1");i.innerHTML=o,i.setAttribute("data-info",o)})})}function Nr(r){r.querySelectorAll('foreignObject[data-type="text"], foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(e=>{e.querySelectorAll("tspan.textAttribute").forEach(n=>{let i=n;for(;i.children.length>0;)i=i.children[0];let s=i.innerHTML;!s.startsWith("{{")&&!s.endsWith("}}")&&(i.innerHTML=`{{${s}}}`,i.setAttribute("data-info",`{{${s}}}`))})})}function ji(r){r.querySelectorAll("[data-type='text']").forEach(e=>{let n=e.querySelector("style");n&&n.remove()})}function Hi(r){let t=r.querySelector("#Block");t&&t.remove()}function $i(r){let t=Array.from(r.children).filter(e=>e.tagName.toLowerCase()==="g"&&!e.hasAttribute("data-side"));if(t.length===1)t[0].removeAttribute("id");else if(t.length>1){let e=0;t.forEach(n=>{if(!n.id){let i=1;for(;r.querySelector(`#group_${i}`);)i++;let s=`group_${i}`;n.setAttribute("id",s),e++}})}t.forEach(e=>{e.style.pointerEvents="all"})}function Wa(r,t){Wi(r),Ji(r),Hi(r);let e=Bi(r,t);return Ui(r),ji(r),qi(r),zi(r),$i(r),Ki(r),e}function zi(r){r.querySelectorAll("style").forEach(e=>e.remove())}function qi(r){let t=Array.from(r.querySelectorAll("g")),e=null;if(e=t.find(n=>{if(n.getAttribute("data-side")==="left")return!0;let i=n.querySelector("title");return i&&i.textContent?.trim()==="Layer 1"})||null,!e){let i=Array.from(r.children).filter(s=>s.tagName.toLowerCase()!=="defs").filter(s=>s.tagName.toLowerCase()==="g");i.length>0&&(e=i[0])}}function Wi(r){Zi(r)}function Ki(r){let t=r.getAttribute("fill"),e=r.style.backgroundColor;(!t||t==="none"||t==="transparent")&&(!e||e==="none"||e==="transparent")&&(r.style.backgroundColor="#FFFFFF")}function Zi(r){let t=r.querySelectorAll('foreignObject[data-type="text"]')}function Ji(r){r.querySelectorAll("*").forEach(e=>{if(e instanceof SVGElement&&e.hasAttribute("style")){let n=e.getAttribute("style");n&&n.split(";").forEach(s=>{let o=s.split(":");if(o.length>1){let a=o[0].trim(),l=o.slice(1).join(":").trim();a&&l&&["fill","stroke","stroke-width","opacity","font-size","font-family"].includes(a)&&(e.hasAttribute(a)||e.setAttribute(a,l))}})}})}function Ka(r){return r=r.replace(/<DIV/g,"<div").replace(/<\/DIV/g,"</div").replace(/<SPAN/g,"<tspan").replace(/<\/SPAN/g,"</tspan").replace(/<span/g,"<tspan").replace(/<\/span/g,"</tspan").replace(/<TSPAN/g,"<tspan").replace(/<\/TSPAN/g,"</tspan").replace(/<I>/g,"<i>").replace(/<\/I>/g,"</i>").replace(/<B>/g,"<b>").replace(/<\/B>/g,"</b>").replace(/<U>/g,"<u>").replace(/<\/U>/g,"</u>").replace(/<col(?!group)([^>]*)\/>/g,"<col$1>").replace(/<col(?!group)([^>]*)>/g,"<col$1/>"),r=r.replace(/{{Modèle code \(Déclinaison\)}}/g,"{{R\xE9f\xE9rence (D\xE9clinaison)}}"),r=r.replace(/{{Model code \(Variant\)}}/g,"{{Reference (Variant)}}"),r=r.replace(/{{Código de modelo SKU \(Declinación\)}}/g,"{{Referencia (Declinaci\xF3n)}}"),r=r.replace(/{{Modelcode \(Varianten\)}}/g,"{{Referentie (Varianten)}}"),r}function Yi(r){let t="",e=0;for(;;){let n=r.indexOf("<!--",e);if(n===-1){t+=r.slice(e);break}t+=r.slice(e,n);let i=r.indexOf("-->",n+4);if(i===-1){t+=r.slice(n);break}e=i+3}return t}function Xi(r){let t="<TSPAN",e=t.length,n="",i=0;for(;;){let s=r.indexOf(t,i);if(s===-1){n+=r.slice(i);break}let o=s,a=!0;for(;a;){for(a=!1;o>0&&(r[o-1]===" "||r[o-1]===" "||r[o-1]===`
3
+ `||r[o-1]==="\r");)o--,a=!0;let l="-->";if(o>=l.length&&r.slice(o-l.length,o)===l){let c=r.lastIndexOf("<!--",o-l.length);c!==-1&&c<o&&(o=c,a=!0)}}o>0&&r[o-1]===">"?n+=r.slice(i,o):n+=r.slice(i,s),n+=t,i=s+e}return n}function Rr(r){return r=Yi(r),r=r.replace(/<div([^>]*)\s*\/>/gi,"<div$1></div>"),r=r.replace(/<font([^>]*)\s*\/>/gi,"<font$1></font>"),r=r.replace(/<b(?=\s|\/)([^>]*)\/>/gi,"<b$1></b>"),r=r.replace(/<br(?=\s|\/)([^>]*)\/>/gi,"<br$1></br>"),r=r.replace(/<tspan\b/gi,"<TSPAN"),r=r.replace(/<\/tspan\s*>/gi,"</TSPAN>"),r=r.replace(/<TSPAN\b([^>]*)>([\s\S]*?)<\/TSPAN>/gi,(t,e,n)=>{let i=n.replace(/\s*\n\s*/g,"");return`<TSPAN${e}>${i}</TSPAN>`}),r=Xi(r),r=r.replace(/<TSPAN([^>]*)\s*\/>/gi,"<TSPAN$1></TSPAN>"),r=r.replace(/{{Référence \(Déclinaison\)}}/g,"{{Mod\xE8le code (D\xE9clinaison)}}"),r=r.replace(/{{Reference \(Variant\)}}/g,"{{Model code (Variant)}}"),r=r.replace(/{{Referencia \(Declinación\)}}/g,"{{C\xF3digo de modelo SKU (Declinaci\xF3n)}}"),r=r.replace(/{{Referentie \(Varianten\)}}/g,"{{Modelcode (Varianten)}}"),r=r.replace(/xmlns:undefined="[^"]*"/g,""),r=r.replace(/&quot;/g,"'"),r=r.replace(/font-family:\s*['"]*([^;'"\n\r]+?)['"]*(?=[;"]|$)/g,(t,e)=>{let n=e.trim();return n.includes(" ")?`font-family: '${n}'`:`font-family: ${n}`}),r=r.replace(/<line\b[^>]*\bclass="[^"]*\bsnappingLine\b[^"]*"[^>]*>[\s\S]*?<\/line>/g,""),r=r.replace(/<col(?!group)([^>]*?)(?<!\/)>/g,"<col$1/>"),r=r.replace(/<img([^>]*?)(?<!\/)>/g,"<img$1/>"),r=r.replace(/&nbsp;/g," "),r=r.replace(/<br\s*\/?>\s*<\/br>/g,"<br/>"),r=r.replace(/<br>/g,"<br/>"),r=Qi(r),r}function Qi(r){return r.replace(/font-family:\s*['"]?([^;'"\n\r]+?)['"]?(?=[;"]|$)/g,(t,e)=>{let n=e.trim();return`font-family: ${n.includes(" ")?`'${n}'`:n}`})}var M=class{static canvasService;static documentRoot;static setDocumentRoot(t){this.documentRoot=t}static setCanvasService(t){this.canvasService=t}static getDocumentRoot(){return this.documentRoot}static getElementById(t){if(!t)return null;let e=this.getDocumentRoot();return e&&"getElementById"in e?e.getElementById(t):e&&"querySelector"in e?e.querySelector(`[id="${t}"]`):document.getElementById(t)}static getSelection(){let t=this.getDocumentRoot();if(t&&typeof t.getSelection=="function"){let e=t.getSelection();if(e)return e}return window.getSelection()}static create(t,e={}){e.id=this.getNextId(e["data-type"]||t);let n=document.createElementNS("http://www.w3.org/2000/svg",t);for(let i in e)e.hasOwnProperty(i)&&n.setAttribute(i,e[i]);return n}static findParent(t,e){let n=t.parentNode;for(;n;){if(n.nodeName.toLowerCase()===e.toLowerCase())return n;n=n.parentNode}return null}static getElementType(t){return t?t.getAttribute("data-type")||t.tagName.toLowerCase():null}static getNextId(t){let n=this.canvasService?.drawingGroup||this.getDocumentRoot()?.querySelector(".drawing-layer");if(!n){console.warn("No container found for element type: "+t);let o=this.getDocumentRoot()||document,a=1,l=`${t}_${a}`;for(;o.querySelector(`#${l}`);)a++,l=`${t}_${a}`;return l}t==="dynamicImage"&&(t="image");let i=1,s=`${t}_${i}`;for(;n.querySelector(`#${s}`);)i++,s=`${t}_${i}`;return s}static cloneWithNewIds(t,e=new Set){let n=t.cloneNode(!0),i=this.canvasService?.drawingGroup||this.getDocumentRoot()?.querySelector(".drawing-layer"),s=a=>{let l=a;l==="dynamicImage"&&(l="image");let c=1,f=`${l}_${c}`;for(;i&&i.querySelector(`#${f}`)||e.has(f);)c++,f=`${l}_${c}`;return e.add(f),f},o=a=>{if(a.hasAttribute("id")){let l=this.getElementType(a)||a.tagName.toLowerCase();a.setAttribute("id",s(l))}Array.from(a.children).forEach(l=>{l instanceof SVGElement&&o(l)})};return o(n),n}static getRotation(t){let e=t.getAttribute("transform");if(!e)return 0;let n=e.match(/rotate\(([-+]?\d*\.?\d+)/);return n?Number.parseFloat(n[1]):0}static setAttribute(t,e,n){if(!t)return;let i=this.getElementType(t);switch(e){case"x":this.setX(t,i,n);break;case"y":this.setY(t,i,n);break;case"width":this.setWidth(t,i,n);break;case"height":this.setHeight(t,i,n);break;case"rotation":this.setRotation(t,n);break;case"fill":this.setFill(t,String(n));break;case"stroke":this.setStroke(t,String(n));break;default:t.setAttribute(e,String(n));break}}static setX(t,e,n){if(e==="circle"){let s=Number(t.getAttribute("r")||0);t.setAttribute("cx",String(Number(n)+s))}else if(e==="ellipse"){let s=Number(t.getAttribute("rx")||0);t.setAttribute("cx",String(Number(n)+s))}else if(e==="path"||e==="g"||e==="line"){let s=0;e==="line"?s=Number(t.getAttribute("x1")||0):s=t.getBBox().x;let o=Number(n)-s;Math.abs(o)>.001&&this.shiftElement(t,o,0)}else t.setAttribute("x",String(n));let i=this.getRotation(t);Math.abs(i)>.001&&this.setRotation(t,i)}static setY(t,e,n){if(e==="circle"){let s=Number(t.getAttribute("r")||0);t.setAttribute("cy",String(Number(n)+s))}else if(e==="ellipse"){let s=Number(t.getAttribute("ry")||0);t.setAttribute("cy",String(Number(n)+s))}else if(e==="path"||e==="g"||e==="line"){let s=0;e==="line"?s=Number(t.getAttribute("y1")||0):s=t.getBBox().y;let o=Number(n)-s;Math.abs(o)>.001&&this.shiftElement(t,0,o)}else t.setAttribute("y",String(n));let i=this.getRotation(t);Math.abs(i)>.001&&this.setRotation(t,i)}static shiftElement(t,e,n){if(Math.abs(e)<.001&&Math.abs(n)<.001)return;let i=this.getElementType(t);if(i==="g")Array.from(t.children).forEach(o=>{o instanceof SVGElement&&this.shiftElement(o,e,n)});else if(i==="path"){let o=t.getAttribute("d")||"";t.setAttribute("d",this.shiftPath(o,e,n))}else if(i==="circle"||i==="ellipse"){let o=Number(t.getAttribute("cx")||0),a=Number(t.getAttribute("cy")||0);t.setAttribute("cx",String(o+e)),t.setAttribute("cy",String(a+n))}else if(i==="line"){let o=Number(t.getAttribute("x1")||0),a=Number(t.getAttribute("y1")||0),l=Number(t.getAttribute("x2")||0),c=Number(t.getAttribute("y2")||0);t.setAttribute("x1",String(o+e)),t.setAttribute("y1",String(a+n)),t.setAttribute("x2",String(l+e)),t.setAttribute("y2",String(c+n))}else{let o=Number(t.getAttribute("x")||0),a=Number(t.getAttribute("y")||0);t.setAttribute("x",String(o+e)),t.setAttribute("y",String(a+n))}let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static setWidth(t,e,n){let i=Number(n);if(e==="circle"){let o=Number(t.getAttribute("r")||0),a=i/2,l=Number(t.getAttribute("cx")||0);t.setAttribute("cx",String(l-o+a)),t.setAttribute("r",String(a))}else if(e==="ellipse"){let o=Number(t.getAttribute("rx")||0),a=i/2,l=Number(t.getAttribute("cx")||0);t.setAttribute("cx",String(l-o+a)),t.setAttribute("rx",String(a))}else if(e==="path"||e==="g"){let o=t.getBBox();if(o.width>0){let a=i/o.width;this.scaleElement(t,a,1,o.x,o.y)}}else t.setAttribute("width",String(n));let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static setHeight(t,e,n){let i=Number(n);if(e==="circle"){let o=Number(t.getAttribute("r")||0),a=i/2,l=Number(t.getAttribute("cy")||0);t.setAttribute("cy",String(l-o+a)),t.setAttribute("r",String(a))}else if(e==="ellipse"){let o=Number(t.getAttribute("ry")||0),a=i/2,l=Number(t.getAttribute("cy")||0);t.setAttribute("cy",String(l-o+a)),t.setAttribute("ry",String(a))}else if(e==="path"||e==="g"){let o=t.getBBox();if(o.height>0){let a=i/o.height;this.scaleElement(t,1,a,o.x,o.y)}}else t.setAttribute("height",String(n));let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static scaleElement(t,e,n,i,s){if(Math.abs(e-1)<.001&&Math.abs(n-1)<.001)return;let o=this.getElementType(t);if(o==="g")Array.from(t.children).forEach(l=>{l instanceof SVGElement&&this.scaleElement(l,e,n,i,s)});else if(o==="path"){let l=t.getBBox(),c=t.getAttribute("d")||"",f=l.width*e,d=l.height*n,u=i+(l.x-i)*e,h=s+(l.y-s)*n;t.setAttribute("d",this.scalePath(c,l,u,h,f,d))}else if(o==="circle"){let l=Number(t.getAttribute("cx")||0),c=Number(t.getAttribute("cy")||0),f=Number(t.getAttribute("r")||0);t.setAttribute("cx",String(i+(l-i)*e)),t.setAttribute("cy",String(s+(c-s)*n)),t.setAttribute("r",String(f*Math.sqrt(e*n)))}else if(o==="ellipse"){let l=Number(t.getAttribute("cx")||0),c=Number(t.getAttribute("cy")||0),f=Number(t.getAttribute("rx")||0),d=Number(t.getAttribute("ry")||0);t.setAttribute("cx",String(i+(l-i)*e)),t.setAttribute("cy",String(s+(c-s)*n)),t.setAttribute("rx",String(f*e)),t.setAttribute("ry",String(d*n))}else if(o==="line"){let l=Number(t.getAttribute("x1")||0),c=Number(t.getAttribute("y1")||0),f=Number(t.getAttribute("x2")||0),d=Number(t.getAttribute("y2")||0);t.setAttribute("x1",String(i+(l-i)*e)),t.setAttribute("y1",String(s+(c-s)*n)),t.setAttribute("x2",String(i+(f-i)*e)),t.setAttribute("y2",String(s+(d-s)*n))}else{let l=Number(t.getAttribute("x")||0),c=Number(t.getAttribute("y")||0),f=Number(t.getAttribute("width")||0),d=Number(t.getAttribute("height")||0);t.setAttribute("x",String(i+(l-i)*e)),t.setAttribute("y",String(s+(c-s)*n)),t.setAttribute("width",String(f*e)),t.setAttribute("height",String(d*n))}let a=this.getRotation(t);Math.abs(a)>.001&&this.setRotation(t,a)}static setRotation(t,e){let n=Number(e),i=t.getBBox?t.getBBox():{x:0,y:0,width:0,height:0},s=i.x+i.width/2,o=i.y+i.height/2,a=t.getAttribute("transform")||"";if(a=a.replace(/rotate\([^)]+\)/g,"").trim(),Math.abs(n)>.001){let l=`rotate(${n} ${s} ${o})`;t.setAttribute("transform",`${a} ${l}`.trim())}else a?t.setAttribute("transform",a):t.removeAttribute("transform")}static shiftPath(t,e,n){return this.transformPath(t,1,1,e,n)}static scalePath(t,e,n,i,s,o){let a=e.width===0?1:s/e.width,l=e.height===0?1:o/e.height,c=n-e.x*a,f=i-e.y*l;return this.transformPath(t,a,l,c,f)}static transformPath(t,e,n,i,s){let o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g,a,l="",c=!0;for(;(a=o.exec(t))!==null;){let f=a[1],d=a[2].trim(),u=d?d.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[]:[],h=f.toUpperCase(),m=f===f.toLowerCase()&&h!=="Z",b=[];switch(h){case"M":for(let p=0;p<u.length;p+=2){let g=m;c&&p===0&&(g=!1),g?b.push(u[p]*e,u[p+1]*n):b.push(u[p]*e+i,u[p+1]*n+s)}c&&(c=!1);break;case"L":case"T":for(let p=0;p<u.length;p+=2)m?b.push(u[p]*e,u[p+1]*n):b.push(u[p]*e+i,u[p+1]*n+s);c&&(c=!1);break;case"H":for(let p=0;p<u.length;p++)b.push(m?u[p]*e:u[p]*e+i);break;case"V":for(let p=0;p<u.length;p++)b.push(m?u[p]*n:u[p]*n+s);break;case"C":for(let p=0;p<u.length;p+=6)m?(b.push(u[p]*e,u[p+1]*n),b.push(u[p+2]*e,u[p+3]*n),b.push(u[p+4]*e,u[p+5]*n)):(b.push(u[p]*e+i,u[p+1]*n+s),b.push(u[p+2]*e+i,u[p+3]*n+s),b.push(u[p+4]*e+i,u[p+5]*n+s));break;case"S":case"Q":for(let p=0;p<u.length;p+=4)m?(b.push(u[p]*e,u[p+1]*n),b.push(u[p+2]*e,u[p+3]*n)):(b.push(u[p]*e+i,u[p+1]*n+s),b.push(u[p+2]*e+i,u[p+3]*n+s));break;case"A":for(let p=0;p<u.length;p+=7){b.push(Math.abs(u[p]*e),Math.abs(u[p+1]*n)),b.push(u[p+2]),b.push(u[p+3]);let g=u[p+4];e*n<0&&(g=g===1?0:1),b.push(g),m?b.push(u[p+5]*e,u[p+6]*n):b.push(u[p+5]*e+i,u[p+6]*n+s)}break;case"Z":break}let y=b.map(p=>Number.isInteger(p)?p:Number(p.toFixed(3)));l+=f+y.join(" ")+" "}return l.trim()}static setStyle(t,e,n){t&&t.style.setProperty(e,String(n))}static getStyle(t,e){return t?t.style.getPropertyValue(e):null}static getFill(t){if(!t)return null;let e=this.getElementType(t);return e&&["rect","circle","ellipse","path","polygon","polyline","line"].includes(e)?t.getAttribute("fill")||t.style.fill:t.style.fill||t.getAttribute("fill")}static setFill(t,e){if(!t)return;let n=this.getElementType(t);n&&["rect","circle","ellipse","path","polygon","polyline","line"].includes(n)?(t.setAttribute("fill",e),t.style.fill=""):t.style.fill=e}static getStroke(t){if(!t)return null;let e=this.getElementType(t);return e&&["rect","circle","ellipse","path","polygon","polyline","line"].includes(e)?t.getAttribute("stroke")||t.style.stroke:t.style.stroke||t.getAttribute("stroke")}static setStroke(t,e){if(!t)return;let n=this.getElementType(t);n&&["rect","circle","ellipse","path","polygon","polyline","line"].includes(n)?(t.setAttribute("stroke",e),t.style.stroke=""):t.style.stroke=e}static removeAttribute(t,e){t.removeAttribute(e)}static toggleVisibility(t){if(!t)return;t.getAttribute("display")!=="none"?t.setAttribute("display","none"):t.removeAttribute("display")}static toggleLock(t){if(!t)return;t.getAttribute("data-protected")==="true"?t.removeAttribute("data-protected"):t.setAttribute("data-protected","true")}};var tt=class{static isCtrlOrCmd(t){return t.ctrlKey||t.metaKey}static isShift(t){return t.shiftKey}static isAlt(t){return t.altKey}static getShortcutString(t){let e=this.isCtrlOrCmd(t)?"cmd_":"",n=t.key.toLowerCase();if(["control","meta","shift","alt"].includes(n))return n;let i=this.isShift(t)?"shift_":"",s=this.isAlt(t)?"alt_":"";return`${e}${i}${s}${n}`}};var Re=class r{_eventBus=new X;constructor(){this.initGlobalListeners()}emit(t,e){this._eventBus.next({type:t,payload:e})}on(t){return this._eventBus.asObservable().pipe(at(e=>e.type===t),x(e=>e.payload))}get all$(){return this._eventBus.asObservable()}initGlobalListeners(){window.addEventListener("keydown",t=>this.handleKeyDown(t)),window.addEventListener("keyup",t=>this.handleKeyUp(t)),document.addEventListener("paste",t=>this.handlePaste(t))}handlePaste(t){let e=t.composedPath&&t.composedPath().length>0?t.composedPath()[0]:t.target;e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable||this.emit("SHORTCUT_PASTE")}handleKeyDown(t){let e=tt.getShortcutString(t);if(t.repeat&&!["arrowleft","arrowright","arrowup","arrowdown","shift_arrowleft","shift_arrowright","shift_arrowup","shift_arrowdown","backspace","delete"].includes(e))return;if(e==="alt"){this.emit("SHORTCUT_ALT_DOWN"),M.getElementById("svg-editor")?.classList.add("altPressed");return}let n=t.composedPath&&t.composedPath().length>0?t.composedPath()[0]:t.target;if((n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.isContentEditable)&&!["cmd_s","cmd_z","cmd_y","cmd_shift_z","escape"].includes(e))return;let s=!0;switch(e){case"m":this.emit("SHORTCUT_TOOL_PAN");break;case"v":this.emit("SHORTCUT_TOOL_SELECT");break;case"t":this.emit("SHORTCUT_TOOL_TEXT");break;case"r":this.emit("SHORTCUT_TOOL_RECT");break;case"o":this.emit("SHORTCUT_TOOL_ELLIPSE");break;case"l":this.emit("SHORTCUT_TOOL_LINE");break;case"n":this.emit("SHORTCUT_TOOL_PENCIL");break;case"p":this.emit("SHORTCUT_TOOL_PATH");break;case"i":this.emit("SHORTCUT_TOOL_IMAGE");break;case"b":this.emit("SHORTCUT_TOOL_BARCODE");break;case"q":this.emit("SHORTCUT_TOOL_QRCODE");break;case"shift_x":this.emit("SHORTCUT_SWITCH_PAINT");break;case"cmd_s":this.emit("SHORTCUT_SAVE");break;case"cmd_z":this.emit("SHORTCUT_UNDO");break;case"cmd_y":this.emit("SHORTCUT_REDO");break;case"cmd_shift_z":this.emit("SHORTCUT_REDO");break;case"cmd_c":this.emit("SHORTCUT_COPY");break;case"cmd_v":this.emit("SHORTCUT_PASTE");break;case"cmd_x":this.emit("SHORTCUT_CUT");break;case"cmd_d":this.emit("SHORTCUT_DUPLICATE");break;case"cmd_u":this.emit("SHORTCUT_VIEW_SOURCE");break;case"cmd_a":this.emit("SHORTCUT_SELECT_ALL");break;case"cmd_g":this.emit("SHORTCUT_GROUP");break;case"cmd_shift_g":this.emit("SHORTCUT_UNGROUP");break;case"cmd_k":this.emit("SHORTCUT_PLACE_IMAGE");break;case"backspace":case"delete":this.emit("SHORTCUT_DELETE");break;case"cmd_arrowleft":this.emit("SHORTCUT_ROTATE",-1);break;case"cmd_arrowright":this.emit("SHORTCUT_ROTATE",1);break;case"cmd_shift_arrowleft":this.emit("SHORTCUT_ROTATE",-5);break;case"cmd_shift_arrowright":this.emit("SHORTCUT_ROTATE",5);break;case"shift_o":this.emit("SHORTCUT_CYCLE_ELEMENT",0);break;case"shift_p":this.emit("SHORTCUT_CYCLE_ELEMENT",1);break;case"shift_r":this.emit("SHORTCUT_TOGGLE_RULERS");break;case"cmd_+":this.emit("SHORTCUT_ZOOM_IN");break;case"cmd_-":this.emit("SHORTCUT_ZOOM_OUT");break;case"cmd_=":this.emit("SHORTCUT_ZOOM_RESET");break;case"arrowleft":this.emit("SHORTCUT_NUDGE",{dx:-1,dy:0});break;case"arrowright":this.emit("SHORTCUT_NUDGE",{dx:1,dy:0});break;case"arrowup":this.emit("SHORTCUT_NUDGE",{dx:0,dy:-1});break;case"arrowdown":this.emit("SHORTCUT_NUDGE",{dx:0,dy:1});break;case"shift_arrowleft":this.emit("SHORTCUT_JUMP",{dx:-10,dy:0});break;case"shift_arrowright":this.emit("SHORTCUT_JUMP",{dx:10,dy:0});break;case"shift_arrowup":this.emit("SHORTCUT_JUMP",{dx:0,dy:-10});break;case"shift_arrowdown":this.emit("SHORTCUT_JUMP",{dx:0,dy:10});break;case"cmd_arrowup":this.emit("SHORTCUT_BRING_FORWARD");break;case"cmd_arrowdown":this.emit("SHORTCUT_SEND_BACKWARD");break;case"cmd_shift_arrowup":this.emit("SHORTCUT_BRING_TO_FRONT");break;case"cmd_shift_arrowdown":this.emit("SHORTCUT_SEND_TO_BACK");break;case"cmd_b":this.emit("SHORTCUT_TEXT_BOLD");break;case"cmd_i":this.emit("SHORTCUT_TEXT_ITALIC");break;case"escape":case"enter":this.emit("SHORTCUT_ESCAPE_MODE");break;case"shift_?":case"cmd_shift_?":case"ctrl_?":this.emit("SHORTCUT_HELP");break;case" ":this.emit("SHORTCUT_PAN_START");break;default:s=!1}s&&t.preventDefault()}handleKeyUp(t){let e=t.composedPath&&t.composedPath().length>0?t.composedPath()[0]:t.target;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return;let i=tt.getShortcutString(t);i==="alt"&&(this.emit("SHORTCUT_ALT_UP"),M.getElementById("svg-editor")?.classList.remove("altPressed")),i===" "&&this.emit("SHORTCUT_PAN_STOP")}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Me=class r{appParams=w(ne);properties=T({width:800,height:600,unit:this.getInitialUnit(),backgroundColor:"#ffffff",marginVertical:0,headerHeight:0,footerHeight:0,marginLeft:0,marginRight:0,bleedMargin:0,side:"left"});getInitialUnit(){let t=this.appParams.params(),e=["px","cm","mm","in"],n=(t.unit||"mm").toLowerCase();return e.includes(n)?n:"mm"}constructor(){}get dimensions(){return this.properties}updateDimensions(t,e){this.properties.update(n=>O(S({},n),{width:t,height:e,viewBox:`0 0 ${t} ${e}`}))}updateUnit(t){this.properties.update(e=>O(S({},e),{unit:t}))}updateProperty(t,e){this.properties.update(n=>{let i=O(S({},n),{[t]:e});return(t==="width"||t==="height")&&(i.viewBox=`0 0 ${i.width} ${i.height}`),i})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var nt=class r{config=T({showGrid:!0,showRulers:!0,showWireframe:!1,showMargins:!0,snapToGrid:!1,theme:"light"});updateConfig(t){this.config.update(e=>S(S({},e),t))}toggleGrid(){this.config.update(t=>O(S({},t),{showGrid:!t.showGrid}))}toggleRulers(){this.config.update(t=>O(S({},t),{showRulers:!t.showRulers}))}toggleWireframe(){this.config.update(t=>O(S({},t),{showWireframe:!t.showWireframe}))}toggleMargins(){this.config.update(t=>O(S({},t),{showMargins:!t.showMargins}))}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Lt=class r{selectedElements=T([]);updated=T(0);count=ht(()=>this.selectedElements().length);isEmpty=ht(()=>this.count()===0);first=ht(()=>this.selectedElements()[0]||null);select(t){this.selectedElements.set(t)}add(t){this.selectedElements.update(e=>e.includes(t)?e:[...e,t])}toggle(t){this.selectedElements.update(e=>e.indexOf(t)>-1?e.filter(i=>i!==t):[...e,t])}clear(){this.selectedElements.set([])}triggerUpdate(){this.updated.update(t=>t+1)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var xe=class r{constructor(){}toSvgColor(t){return t}hexToRgba(t){t=t.trim(),t.startsWith("#")&&(t=t.substring(1));let e=0,n=0,i=0,s=1;return t.length===3||t.length===4?(e=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16),t.length===4&&(s=parseInt(t[3]+t[3],16)/255)):(t.length===6||t.length===8)&&(e=parseInt(t.substring(0,2),16),n=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),t.length===8&&(s=parseInt(t.substring(6,8),16)/255)),{r:e,g:n,b:i,a:s}}rgbaToHex(t){let{r:e,g:n,b:i,a:s}=t,o=l=>{let c=Math.round(l).toString(16);return c.length===1?"0"+c:c},a="#"+o(e)+o(n)+o(i);return s<1&&(a+=o(Math.round(s*255))),a}rgbToHsv(t,e,n){t/=255,e/=255,n/=255;let i=Math.max(t,e,n),s=Math.min(t,e,n),o=0,a,l=i,c=i-s;if(a=i===0?0:c/i,i===s)o=0;else{switch(i){case t:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-t)/c+2;break;case n:o=(t-e)/c+4;break}o/=6}return{h:o*360,s:a*100,v:l*100}}hsvToRgb(t,e,n){let i,s,o;t=t/360,e=e/100,n=n/100;let a=Math.floor(t*6),l=t*6-a,c=n*(1-e),f=n*(1-l*e),d=n*(1-(1-l)*e);switch(a%6){case 0:i=n,s=d,o=c;break;case 1:i=f,s=n,o=c;break;case 2:i=c,s=n,o=d;break;case 3:i=c,s=f,o=n;break;case 4:i=d,s=c,o=n;break;case 5:i=n,s=c,o=f;break}return{r:Math.round(i*255),g:Math.round(s*255),b:Math.round(o*255)}}rgbToHsl(t,e,n){t/=255,e/=255,n/=255;let i=Math.max(t,e,n),s=Math.min(t,e,n),o=0,a,l=(i+s)/2;if(i===s)o=a=0;else{let c=i-s;switch(a=l>.5?c/(2-i-s):c/(i+s),i){case t:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-t)/c+2;break;case n:o=(t-e)/c+4;break}o/=6}return{h:Math.round(o*360),s:Math.round(a*100),l:Math.round(l*100)}}hslToRgb(t,e,n){let i,s,o;if(t/=360,e/=100,n/=100,e===0)i=s=o=n;else{let a=(f,d,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?f+(d-f)*6*u:u<.5?d:u<.6666666666666666?f+(d-f)*(.6666666666666666-u)*6:f),l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;i=a(c,l,t+1/3),s=a(c,l,t),o=a(c,l,t-1/3)}return{r:Math.round(i*255),g:Math.round(s*255),b:Math.round(o*255)}}rgbToCmyk(t,e,n){let i=1-t/255,s=1-e/255,o=1-n/255,a=Math.min(i,Math.min(s,o));return i=(i-a)/(1-a)||0,s=(s-a)/(1-a)||0,o=(o-a)/(1-a)||0,{c:Math.round(i*100),m:Math.round(s*100),y:Math.round(o*100),k:Math.round(a*100)}}cmykToRgb(t,e,n,i){t=t/100,e=e/100,n=n/100,i=i/100;let s=255*(1-t)*(1-i),o=255*(1-e)*(1-i),a=255*(1-n)*(1-i);return{r:Math.round(s),g:Math.round(o),b:Math.round(a)}}isHex(t){return typeof t!="string"?!1:(t=t.trim(),/^#([0-9A-F]{3}){1,2}$/i.test(t)||/^#([0-9A-F]{4}){1,2}$/i.test(t))}isRgb(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("rgb"):typeof t=="object"&&t!==null&&"r"in t&&"g"in t&&"b"in t}isHsl(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("hsl"):typeof t=="object"&&t!==null&&"h"in t&&"s"in t&&"l"in t}isHsv(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("hsv"):typeof t=="object"&&t!==null&&"h"in t&&"s"in t&&"v"in t}isCmyk(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("cmyk"):typeof t=="object"&&t!==null&&"c"in t&&"m"in t&&"y"in t&&"k"in t}toRgba(t){if(!t)return{r:0,g:0,b:0,a:1};if(typeof t=="string"){t=t.trim().toLowerCase();let e={white:"#ffffff",black:"#000000",red:"#ff0000",green:"#00ff00",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",transparent:"#00000000"};e[t]&&(t=e[t])}if(this.isHex(t))return this.hexToRgba(t);if(this.isRgb(t))return typeof t=="string"?this.parseRgbString(t):{r:Number(t.r),g:Number(t.g),b:Number(t.b),a:t.a!==void 0?Number(t.a):1};if(this.isHsl(t)){if(typeof t=="string")return this.parseHslString(t);let e=this.hslToRgb(t.h,t.s,t.l);return O(S({},e),{a:t.a!==void 0?Number(t.a):1})}if(this.isHsv(t)){if(typeof t=="string")return this.parseHsvString(t);let e=this.hsvToRgb(t.h,t.s,t.v);return O(S({},e),{a:t.a!==void 0?Number(t.a):1})}if(this.isCmyk(t)){if(typeof t=="string")return this.parseCmykString(t);let e=this.cmykToRgb(t.c,t.m,t.y,t.k);return O(S({},e),{a:1})}return{r:0,g:0,b:0,a:1}}toHex(t){let e=this.toRgba(t);return this.rgbaToHex(e)}toHsl(t){let e=this.toRgba(t),n=this.rgbToHsl(e.r,e.g,e.b);return O(S({},n),{a:e.a})}toHsv(t){let e=this.toRgba(t),n=this.rgbToHsv(e.r,e.g,e.b);return O(S({},n),{a:e.a})}toCmyk(t){let e=this.toRgba(t);return this.rgbToCmyk(e.r,e.g,e.b)}parseRgbString(t){let e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return e?{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10),a:e[4]?parseFloat(e[4]):1}:{r:0,g:0,b:0,a:1}}parseHslString(t){let e=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%(?:,\s*([\d.]+))?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=e[4]?parseFloat(e[4]):1,a=this.hslToRgb(n,i,s);return O(S({},a),{a:o})}return{r:0,g:0,b:0,a:1}}parseHsvString(t){let e=t.match(/hsva?\((\d+),\s*(\d+)%?,\s*(\d+)%?(?:,\s*([\d.]+))?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=e[4]?parseFloat(e[4]):1,a=this.hsvToRgb(n,i,s);return O(S({},a),{a:o})}return{r:0,g:0,b:0,a:1}}parseCmykString(t){let e=t.match(/cmyk\((\d+)%?,\s*(\d+)%?,\s*(\d+)%?,\s*(\d+)%?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=parseInt(e[4],10),a=this.cmykToRgb(n,i,s,o);return O(S({},a),{a:1})}return{r:0,g:0,b:0,a:1}}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var fe=class r{_svgElement=null;_wrapperElement=null;_transform={x:0,y:0,scale:1};zoomLevel=T(1);panOffset=T({x:0,y:0});baseScale=T(1);isReady=T(!1);currentContext=T(null);modifiedPulse=T(0);isSilent=T(!0);versionUpgraded=T(!1);disabledElems=[];docService=w(Me);eventsService=w(Re);selectionStore=w(Lt);colorService=w(xe);injector=w(ut);constructor(){this.eventsService.on("SHORTCUT_DELETE").subscribe(()=>this.deleteSelectedElements()),this.eventsService.on("SHORTCUT_NUDGE").subscribe(t=>this.nudgeSelectedElements(t.dx,t.dy)),this.eventsService.on("SHORTCUT_JUMP").subscribe(t=>this.nudgeSelectedElements(t.dx,t.dy)),this.eventsService.on("SHORTCUT_ROTATE").subscribe(t=>this.rotateSelectedElements(t)),this.eventsService.on("SHORTCUT_SELECT_ALL").subscribe(()=>this.selectAllElements()),this.eventsService.on("SHORTCUT_ZOOM_RESET").subscribe(()=>this.zoomReset()),this.eventsService.on("SHORTCUT_BRING_TO_FRONT").subscribe(()=>this.bringToFront()),this.eventsService.on("SHORTCUT_SEND_TO_BACK").subscribe(()=>this.sendToBack()),this.eventsService.on("SHORTCUT_BRING_FORWARD").subscribe(()=>this.bringForward()),this.eventsService.on("SHORTCUT_SEND_BACKWARD").subscribe(()=>this.sendBackward()),this.eventsService.on("SHORTCUT_CYCLE_ELEMENT").subscribe(t=>this.cycleSelectedElement(t)),pt(()=>{let t=this.docService.properties(),e=`${t.width}-${t.height}-${t.doublePage}`;Wt(()=>{this.isReady()&&this.modifiedPulse.update(n=>n+1)})})}get svgElement(){if(!this._svgElement)throw new Error("Canvas not initialized. Call setSvgElement() first.");return this._svgElement}get wrapperElement(){if(!this._wrapperElement)throw new Error("Wrapper element not set. Call setWrapperElement() first.");return this._wrapperElement}setSvgElement(t){this._svgElement=t,this.isReady.set(!0);let e=t.querySelector("g.drawing-layer");this.setContext(e||t),this.initMutationObserver(t)}_mutationObserver=null;initMutationObserver(t){this._mutationObserver&&this._mutationObserver.disconnect(),this._mutationObserver=new MutationObserver(()=>{this.modifiedPulse.update(e=>e+1)}),this._mutationObserver.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["fill","stroke","style"]})}setContext(t){if(this.leaveContext(),!t)return;this.currentContext.set(t);let e=this.drawingGroup;if(!e||t===e)return;let n=t;for(;n&&n!==e;){let i=n.parentElement;i&&Array.from(i.children).forEach(s=>{if(s!==n&&s instanceof SVGGraphicsElement){let o=s.getAttribute("opacity");this.disabledElems.push({elem:s,origOpac:o}),s.setAttribute("opacity",(Number.parseFloat(o||"1")*.33).toFixed(2)),s.style.pointerEvents="none"}}),n=i}}leaveContext(){this.disabledElems.forEach(({elem:t,origOpac:e})=>{e?t.setAttribute("opacity",e):t.removeAttribute("opacity"),t.style.pointerEvents="inherit"}),this.disabledElems=[]}setWrapperElement(t){this._wrapperElement=t,this._wrapperElement.addEventListener("wheel",this.handleWheel.bind(this),{passive:!1})}destroy(){this._wrapperElement&&this._wrapperElement.removeEventListener("wheel",this.handleWheel.bind(this))}get drawingGroup(){return this._svgElement?this._svgElement.querySelector("g.drawing-layer"):null}get activeContainer(){let t=this.currentContext(),e=this.drawingGroup;if(t&&e&&t===e){let n=this.docService.properties().side||"left",i=Array.from(e.children).find(s=>s.tagName.toLowerCase()==="g"&&s.getAttribute("data-side")===n);if(i instanceof SVGGElement)return i}return t||e||this.svgElement}getSvgPoint(t,e,n){if(!this._svgElement)throw new Error("SVG not ready");let i=this._svgElement.createSVGPoint();i.x=t,i.y=e;let o=(n||this._svgElement).getScreenCTM();return o?i.matrixTransform(o.inverse()):i}screenToLocal(t,e,n){if(!this._svgElement)throw new Error("SVG not ready");let i=this._svgElement.createSVGPoint();return i.x=t,i.y=e,i.matrixTransform(n.inverse())}handleWheel(t){if(t.preventDefault(),t.ctrlKey||t.metaKey){let n=-Math.sign(t.deltaY),i=Math.exp(n*.1);this.zoom(i,t.clientX,t.clientY)}else this.pan(-t.deltaX,-t.deltaY)}zoom(t,e,n){if(!this._svgElement)return;let i=this._transform.scale,s=i*t,o=s/this.baseScale();if(o<.05||o>16)return;let a=this._svgElement.getBoundingClientRect(),l=e-a.left,c=n-a.top,f=s/i;this._transform.x+=l*(1-f),this._transform.y+=c*(1-f),this._transform.scale=s,this.zoomLevel.set(s),this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}pan(t,e){this._transform.x+=t,this._transform.y+=e,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}updateTransform(){this._svgElement&&(this._svgElement.style.transform=`translate(${this._transform.x}px, ${this._transform.y}px) scale(${this._transform.scale})`)}getTransform(){return S({},this._transform)}groupElements(t){if(!t||t.length===0||!t[0].parentElement)return null;let n=[...t].sort((s,o)=>s===o?0:s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),i=document.createElementNS("http://www.w3.org/2000/svg","g");return i.id=M.getNextId("group"),n[0].before(i),n.forEach(s=>i.appendChild(s)),i}alignElements(t,e,n){!t||t.length===0||(t.forEach(i=>{let s=i.getBBox();switch(e){case"left":M.setAttribute(i,"x",n.x);break;case"center":M.setAttribute(i,"x",n.x+n.width/2-s.width/2);break;case"right":M.setAttribute(i,"x",n.x+n.width-s.width);break;case"top":M.setAttribute(i,"y",n.y);break;case"middle":M.setAttribute(i,"y",n.y+n.height/2-s.height/2);break;case"bottom":M.setAttribute(i,"y",n.y+n.height-s.height);break}}),this.modifiedPulse.update(i=>i+1))}ungroupElement(t){if(!t.parentElement)return[];let n=Array.from(t.children);return n.forEach(i=>{t.before(i)}),t.remove(),n}migrateLegacyToDoublePage(){let t=this.drawingGroup;if(!t||Array.from(t.children).some(l=>l.hasAttribute&&l.hasAttribute("data-side")))return;let n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("data-side","left");let i=document.createElementNS("http://www.w3.org/2000/svg","g");i.setAttribute("data-side","right");let s=[],o=l=>{l.tagName.toLowerCase()==="g"&&!l.id&&!l.hasAttribute("data-gsvg")&&!l.hasAttribute("app-table")?Array.from(l.children).forEach(o):s.push(l)};Array.from(t.children).forEach(o),t.innerHTML="";let a=new Set;s.forEach(l=>{l.id&&a.add(l.id),l.querySelectorAll("[id]").forEach(c=>{a.add(c.id)})}),s.forEach(l=>{if(n.appendChild(l),l instanceof SVGElement){let c=M.cloneWithNewIds(l,a);i.appendChild(c)}}),t.appendChild(n),t.appendChild(i)}deleteSelectedElements(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.forEach(e=>e.remove()),this.selectionStore.clear(),this.modifiedPulse.update(e=>e+1))}nudgeSelectedElements(t,e){let n=this.selectionStore.selectedElements();n.length!==0&&(n.forEach(i=>{M.shiftElement(i,t,e)}),this.modifiedPulse.update(i=>i+1))}rotateSelectedElements(t){let e=this.selectionStore.selectedElements();e.length!==0&&(e.forEach(n=>{let i=M.getRotation(n);M.setAttribute(n,"rotation",i+t)}),this.modifiedPulse.update(n=>n+1))}selectAllElements(){let t=this.currentContext();if(!t)return;let e=Array.from(t.children).filter(n=>!(n instanceof SVGGraphicsElement)||!n.id||n.hasAttribute("data-side")?!1:!this.isLockedOrOverlay(n));this.selectionStore.select(e)}zoomReset(){if(!this._svgElement||!this._wrapperElement)return;let t=this.baseScale();this._transform.scale=t,this.zoomLevel.set(t);let e=this.docService.properties().width,n=this.docService.properties().height,i=this._wrapperElement.clientWidth,s=this._wrapperElement.clientHeight,o=getComputedStyle(this._wrapperElement),a=parseFloat(o.getPropertyValue("--container-width"))||300,l=parseFloat(o.getPropertyValue("--spacing-s"))||12,f=this.injector.get(nt).config().showRulers,d=f?30:0,u=a+2*l+d,h=a+2*l,m=l+(f?30:0),b=l,y=e*t,p=n*t,g=u+(i-u-h)/2,E=m+(s-m-b)/2;this._transform.x=g-y/2,this._transform.y=E-p/2,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}bringToFront(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t.forEach(e=>{let n=e.parentElement;n&&n.appendChild(e)}),this.modifiedPulse.update(e=>e+1))}sendToBack(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1),t.forEach(e=>{let n=e.parentElement;n&&n.insertBefore(e,n.firstElementChild)}),this.modifiedPulse.update(e=>e+1))}bringForward(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1),t.forEach(e=>{let n=e.nextElementSibling;n&&!t.includes(n)&&n.after(e)}),this.modifiedPulse.update(e=>e+1))}sendBackward(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t.forEach(e=>{let n=e.previousElementSibling;n&&!t.includes(n)&&n.before(e)}),this.modifiedPulse.update(e=>e+1))}cycleSelectedElement(t){let e=this.currentContext();if(!e)return;let n=Array.from(e.children).filter(o=>!(o instanceof SVGGraphicsElement)||!o.id||o.hasAttribute("data-side")?!1:!this.isLockedOrOverlay(o));if(n.length===0)return;let i=this.selectionStore.first(),s=0;if(i){let o=n.indexOf(i);t===0?s=(o+1)%n.length:s=(o-1+n.length)%n.length}this.selectionStore.select([n[s]])}loadedSvg=null;creationOverlayRect=null;startDrawingSelection(t,e){if(!this.isReady())return;this.finishDrawingSelection(),this.creationOverlayRect=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.creationOverlayRect.setAttribute("id","creation-band-overlay"),this.creationOverlayRect.setAttribute("fill","transparent"),this.creationOverlayRect.setAttribute("stroke","var(--active)"),this.creationOverlayRect.setAttribute("stroke-width","1"),this.creationOverlayRect.setAttribute("x",String(t)),this.creationOverlayRect.setAttribute("y",String(e)),this.creationOverlayRect.setAttribute("width","0"),this.creationOverlayRect.setAttribute("height","0"),this.creationOverlayRect.style.pointerEvents="none";let n=this._svgElement?.querySelector(".overlay-layer");n?n.appendChild(this.creationOverlayRect):this._svgElement?.appendChild(this.creationOverlayRect)}updateDrawingSelection(t,e,n,i){this.creationOverlayRect&&(this.creationOverlayRect.setAttribute("x",String(t)),this.creationOverlayRect.setAttribute("y",String(e)),this.creationOverlayRect.setAttribute("width",String(n)),this.creationOverlayRect.setAttribute("height",String(i)))}finishDrawingSelection(){this.creationOverlayRect&&(this.creationOverlayRect.remove(),this.creationOverlayRect=null),this.isReady()&&this._svgElement?.querySelectorAll("#creation-band-overlay")?.forEach(e=>e.remove())}fitToScreen(){if(!this.wrapperElement||!this._svgElement)return;let t=this.wrapperElement.clientWidth,e=this.wrapperElement.clientHeight;if(t===0||e===0){requestAnimationFrame(()=>this.fitToScreen());return}let n=this.docService.properties().width,i=this.docService.properties().height;if(!n||!i||n===0||i===0)return;let s=getComputedStyle(this.wrapperElement),o=parseFloat(s.getPropertyValue("--container-width"))||300,a=parseFloat(s.getPropertyValue("--spacing-s"))||12,c=this.injector.get(nt).config().showRulers,f=c?30:0,d=o+2*a+f,u=o+2*a,h=a+(c?30:0),m=a,b=t-d-u-40,y=e-h-m-40,p=b/n,g=y/i,E=Math.min(p,g);this.baseScale.set(E);let D=E*.9;this._transform.scale=D,this.zoomLevel.set(D);let _=n*D,G=i*D,K=d+(t-d-u)/2,U=h+(e-h-m)/2;this._transform.x=K-_/2,this._transform.y=U-G/2,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}panToSide(t){if(!this._svgElement||!this._wrapperElement)return;let e=this.docService.properties().width,n=this._transform.scale,i=this._wrapperElement.clientWidth,s=e/2,o=0;t==="left"?o=s/2*n:o=(s+s/2)*n,this._transform.x=i/2-o;let a=this.docService.properties().height*n;this._transform.y=(this._wrapperElement.clientHeight-a)/2,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}isLockedOrOverlay(t){return t.getAttribute("data-protected")==="true"||!!t.closest('[data-protected="true"]')||!!t.closest(".overlay-layer")||!!t.closest("[app-grid-overlay]")}findSelectableElement(t){let e=this.currentContext();if(!e)return null;let n=t;for(;n&&n!==this._svgElement&&n!==e;){if(n instanceof SVGGraphicsElement&&n.id&&!n.hasAttribute("data-side")&&!this.isLockedOrOverlay(n)){let i=n,s=n.parentElement;for(;s&&s!==e;){if(s.hasAttribute("data-side")){s=s.parentElement;continue}s instanceof SVGGraphicsElement&&s.id&&!this.isLockedOrOverlay(s)&&(i=s),s=s.parentElement}return i}n=n.parentElement}return null}_usedColorsCache=[];_lastColorPulse=-1;getMostUsedColors(t=8){let e=this.drawingGroup;if(!e)return[];if(this._lastColorPulse===this.modifiedPulse())return this._usedColorsCache;let n={},i=e.querySelectorAll("*"),s=o=>{if(!(!o||o==="none"||o==="transparent"||o.startsWith("url(")||o.startsWith("var(")))try{let a=this.colorService.toHex(o).toLowerCase();n[a]=(n[a]||0)+1}catch{}};return i.forEach(o=>{s(o.getAttribute("fill")),s(o.getAttribute("stroke"));let a=o.style;a.fill&&s(a.fill),a.stroke&&s(a.stroke)}),this._usedColorsCache=Object.entries(n).sort((o,a)=>a[1]-o[1]).slice(0,t).map(o=>o[0]),this._lastColorPulse=this.modifiedPulse(),this._usedColorsCache}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ft=class r{injector=w(ut);canvasService=w(fe);generateThumbnail(t=800,e=.3,n){return H(this,null,function*(){let i=this.canvasService.svgElement;if(!i)throw new Error("SVG element not found");n?console.log("ThumbnailService: Using provided SVG string"):(console.log("ThumbnailService: Calling saveService.getSvgString()"),n=this.injector.get(Ot).getSvgString());let a=new DOMParser().parseFromString(n||"","image/svg+xml").documentElement;this.cleanForThumbnail(a),yield this.inlineImages(a);let l=parseFloat(i.getAttribute("width")||"100"),c=parseFloat(i.getAttribute("height")||"100"),f=l/c||1,d=Math.min(l,t),u=d/f;n=new XMLSerializer().serializeToString(a);let h="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n);return new Promise((m,b)=>{let y=new Image;y.onload=()=>{try{let p=document.createElement("canvas");p.width=d,p.height=u;let g=p.getContext("2d");if(!g){b(new Error("Could not get canvas context"));return}g.imageSmoothingEnabled=!0,g.imageSmoothingQuality="high",g.fillStyle="white",g.fillRect(0,0,d,u),g.drawImage(y,0,0,d,u),p.toBlob(E=>{E?m(E):b(new Error("Canvas toBlob failed"))},"image/webp",e)}catch(p){console.error("Canvas export failed",p),b(p)}},y.onerror=p=>{b(new Error("Image loading failed for thumbnail"))},y.src=h})})}cleanForThumbnail(t){this.injectPageVariables(t),t.querySelectorAll("style").forEach(n=>{let i=n.textContent||"";i=i.replace(/@import[^;]+;/gi,""),i=i.replace(/url\(\s*["']?(?!data:|#)[^)]+\)/gi,"none"),n.textContent=i}),t.querySelectorAll("script, link, iframe, object, embed").forEach(n=>n.remove());let e=this.canvasService.svgElement;t.setAttribute("width",e.getAttribute("width")||"0"),t.setAttribute("height",e.getAttribute("height")||"0")}injectPageVariables(t){let e=document.documentElement,n=getComputedStyle(e),i=["--active","--gray-1","--gray-2","--gray-3","--gray-4","--gray-5","--white","--black","--radius-s","--radius-m"],s=`:root {
4
+ `;i.forEach(a=>{let l=n.getPropertyValue(a).trim();l&&(s+=` ${a}: ${l};
5
+ `)}),s+=`}
6
+ `;let o=document.createElementNS("http://www.w3.org/2000/svg","style");o.textContent=s,t.insertBefore(o,t.firstChild)}inlineImages(t){return H(this,null,function*(){let e=[];t.querySelectorAll("img, image").forEach(n=>{let i=n instanceof HTMLImageElement,s=i?n.src:n.getAttribute("href");s&&!s.startsWith("data:")&&e.push(this.toDataUrl(s).then(o=>{i?n.src=o:n.setAttribute("href",o)}).catch(()=>n.remove()))}),t.querySelectorAll('[style*="background-image"]').forEach(n=>{let i=n,o=i.style.backgroundImage.match(/url\(\s*["']?([^"']+)["']?\s*\)/);o&&o[1]&&!o[1].startsWith("data:")&&e.push(this.toDataUrl(o[1]).then(a=>{i.style.backgroundImage=`url("${a}")`}).catch(()=>{i.style.backgroundImage="none"}))}),yield Promise.all(e)})}toDataUrl(t){return H(this,null,function*(){try{let e=yield fetch(t);if(!e.ok)throw new Error("Fetch failed");let n=yield e.blob();return new Promise((i,s)=>{let o=new FileReader;o.onloadend=()=>i(o.result),o.onerror=s,o.readAsDataURL(n)})}catch{throw new Error("Could not convert to data url")}})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Nt=class r{notifications=T([]);show(t,e="info",n=3e3){let i=Math.random().toString(36).substring(2,9),s={id:i,type:e,message:t,closing:!1};this.notifications.update(o=>[...o,s]),n>0&&setTimeout(()=>{this.close(i)},n)}success(t,e=3e3){this.show(t,"success",e)}info(t,e=3e3){this.show(t,"info",e)}warning(t,e=3e3){this.show(t,"warning",e)}error(t,e=3e3){this.show(t,"error",e)}close(t){this.notifications.update(e=>e.map(n=>n.id===t?O(S({},n),{closing:!0}):n)),setTimeout(()=>{this.notifications.update(e=>e.filter(n=>n.id!==t))},400)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Rt=class r{constructor(t,e){this.http=t;this.appParams=e}get headers(){return new F({Authorization:`bearer ${this.appParams.token}`})}getFonts(){let t=`${this.appParams.apiUrl}Publications/fonts`;return this.http.get(t,{headers:this.headers}).pipe(x(e=>e.fonts||[]),N(e=>(console.error("Error fetching fonts",e),A([]))))}addFont(t){let e=`${this.appParams.apiUrl}Publications/fonts`;return this.http.post(e,t,{headers:this.headers}).pipe(N(n=>(console.error("Error adding font",n),A(null))))}updateFont(t){let e=`${this.appParams.apiUrl}Publications/fonts`,n=this.headers.set("Content-Type","application/json");return this.http.put(e,t,{headers:n}).pipe(x(i=>i),N(i=>(console.error("Error updating font",i),A(null))))}deleteFont(t){let e=`${this.appParams.apiUrl}Publications/fonts/${t}`;return this.http.delete(e,{headers:this.headers}).pipe(x(n=>n),N(n=>(console.error("Error deleting font",n),A(null))))}getFontAsBase64(t,e,n){return this.http.get(e,{headers:this.headers,responseType:"arraybuffer"}).pipe(x(i=>({base64:btoa(new Uint8Array(i).reduce((o,a)=>o+String.fromCharCode(a),"")),fontName:t,fontFilename:n})),N(i=>(console.error("Error fetching font as base64",i),A(null))))}static \u0275fac=function(e){return new(e||r)(C(Ne),C(ne))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Mt=class r{constructor(t){this.fontApiService=t}fontsNames=T(["sans-serif","serif","monospace"]);availableFonts=T({});fontsImported=[];customFontFaces={};baseFonts=[{fontName:"sans-serif"},{fontName:"serif"},{fontName:"monospace"},{fontName:"Arial"},{fontName:"Helvetica"},{fontName:"Times New Roman"},{fontName:"Courier New"},{fontName:"Verdana"},{fontName:"Georgia"},{fontName:"Comic Sans MS"},{fontName:"Trebuchet MS"},{fontName:"Arial Black"},{fontName:"Impact"},{fontName:"Abril Fatface"},{fontName:"Aclonica"},{fontName:"Alkatra"},{fontName:"Alegreya"},{fontName:"Alumni Sans"},{fontName:"Andada Pro"},{fontName:"Anek Bangla"},{fontName:"Antonio"},{fontName:"Archivo"},{fontName:"Arimo"},{fontName:"Asap"},{fontName:"Assistant"},{fontName:"Azeret Mono"},{fontName:"Besley"},{fontName:"Big Shoulders Display"},{fontName:"Bitter"},{fontName:"Bodoni Moda"},{fontName:"Brygada 1918"},{fontName:"Cabin"},{fontName:"Catamaran"},{fontName:"Caveat"},{fontName:"Changa"},{fontName:"Cinzel"},{fontName:"Comfortaa"},{fontName:"Commissioner"},{fontName:"Crimson Pro"},{fontName:"Cuprum"},{fontName:"Dancing Script"},{fontName:"Domine"},{fontName:"Dosis"},{fontName:"EB Garamond"},{fontName:"El Messiri"},{fontName:"Encode Sans"},{fontName:"Epilogue"},{fontName:"Exo"},{fontName:"Faustina"},{fontName:"Fira Code"},{fontName:"Fraunces"},{fontName:"Gemunu Libre"},{fontName:"Georama"},{fontName:"Glory"},{fontName:"Gluten"},{fontName:"Grandstander"},{fontName:"Grenze Gotisch"},{fontName:"Hahmlet"},{fontName:"Heebo"},{fontName:"Hepta Slab"},{fontName:"Ibarra Real Nova"},{fontName:"Imbue"},{fontName:"Inconsolata"},{fontName:"Inter"},{fontName:"JetBrains Mono"},{fontName:"Josefin Sans"},{fontName:"Josefin Slab"},{fontName:"Jost"},{fontName:"Jura"},{fontName:"Karla"},{fontName:"Kreon"},{fontName:"Kufam"},{fontName:"Kumbh Sans"},{fontName:"Lemonada"},{fontName:"Lexend"},{fontName:"Libre Franklin"},{fontName:"Literata"},{fontName:"Lora"},{fontName:"Manrope"},{fontName:"Manuale"},{fontName:"Markazi Text"},{fontName:"Maven Pro"},{fontName:"Merriweather Sans"},{fontName:"Mulish"},{fontName:"MuseoModerno"},{fontName:"Newsreader"},{fontName:"Noto Sans Display"},{fontName:"Noto Sans Mono"},{fontName:"Noto Serif Display"},{fontName:"Open Sans"},{fontName:"Orbitron"},{fontName:"Oswald"},{fontName:"Oxanium"},{fontName:"Petrona"},{fontName:"Piazzolla"},{fontName:"Playfair Display"},{fontName:"Podkova"},{fontName:"Public Sans"},{fontName:"Quicksand"},{fontName:"Raleway"},{fontName:"Rasa"},{fontName:"Recursive"},{fontName:"Red Hat Display"},{fontName:"Red Hat Text"},{fontName:"Red Rose"},{fontName:"Reem Kufi"},{fontName:"Roboto Mono"},{fontName:"Roboto Slab"},{fontName:"Rokkitt"},{fontName:"Rosario"},{fontName:"Rubik"},{fontName:"Ruda"},{fontName:"STIX Two Text"},{fontName:"Saira"},{fontName:"Sansita Swashed"},{fontName:"Signika"},{fontName:"Sora"},{fontName:"Space Grotesk"},{fontName:"Spartan"},{fontName:"Stick No Bills"},{fontName:"Syne"},{fontName:"Texturina"},{fontName:"Tourney"},{fontName:"Trispace"},{fontName:"Truculenta"},{fontName:"Urbanist"},{fontName:"Varta"},{fontName:"Vollkorn"},{fontName:"Work Sans"},{fontName:"Yaldevi"},{fontName:"Yanone Kaffeesatz"},{fontName:"Yrsa"}];init(){return H(this,null,function*(){yield this.loadFonts();let t=Object.values(this.availableFonts());this.injectGoogleFontsPreconnect(),this.injectAllGoogleFonts(t),this.injectDocumentFonts(t)})}loadFonts(){return H(this,null,function*(){try{let t=yield ot(this.fontApiService.getFonts()),n=(Array.isArray(t)?t:[]).reduce((o,a)=>{let{fontName:l,fontFilename:c,fontUrl:f,fontPath:d,publicationFontGuid:u,publicationFontId:h,fontGuid:m}=a;return o[l]={fontName:l,fontFilename:c,fontUrl:f,fontPath:d,publicationFontGuid:u,publicationFontId:h,fontGuid:m||u,axes:{ital:{name:"Italic",range:[0,1],value:0},wght:{name:"Weight",range:[400,900],value:400}}},o},{}),i=S({},n);this.baseFonts.forEach(o=>{i[o.fontName]||(i[o.fontName]=o)}),this.availableFonts.set(i),this.injectAllGoogleFonts(t);let s=Object.keys(i).sort();this.fontsNames.set([...new Set(["sans-serif","serif","monospace",...s])]);for(let o of Object.keys(n)){let a=n[o];a.fontUrl&&this.loadCustomFont(a)}}catch(t){console.error("Failed to load fonts",t)}})}injectGoogleFontsPreconnect(){if(!document.getElementById("google-fonts-preconnect")){let t=document.createElement("link");t.id="google-fonts-preconnect",t.rel="preconnect",t.href="https://fonts.googleapis.com",document.head.appendChild(t);let e=document.createElement("link");e.rel="preconnect",e.href="https://fonts.gstatic.com",e.crossOrigin="anonymous",document.head.appendChild(e)}}loadCustomFont(t){return H(this,null,function*(){if(!(!t.fontUrl||!t.fontFilename))try{let e=yield ot(this.fontApiService.getFontAsBase64(t.fontName,t.fontUrl,t.fontFilename));if(e&&e.base64){let{mime:n,type:i}=this.getFontMimeAndType(t.fontUrl),s=`
7
+ @font-face {
8
+ font-family: '${t.fontName}';
9
+ src: url('data:${n};base64,${e.base64}') format('${i}');
10
+ font-weight: normal;
11
+ font-style: normal;
12
+ }
13
+ `;if(this.customFontFaces[t.fontName]=s,!this.isFontAlreadyInDocument(t.fontName)){let o=document.createElement("style");o.innerHTML=s,document.head.appendChild(o)}}}catch(e){console.error(`Failed to load custom font: ${t.fontName}`,e)}})}deleteFont(t){return H(this,null,function*(){let e=t.fontGuid||t.publicationFontGuid||t.fontName;yield ot(this.fontApiService.deleteFont(e)),yield this.loadFonts()})}getFontMimeAndType(t){switch(t.split(".").pop()?.toLowerCase()){case"otf":return{mime:"font/otf",type:"opentype"};case"ttf":return{mime:"font/ttf",type:"truetype"};case"woff":return{mime:"font/woff",type:"woff"};case"woff2":return{mime:"font/woff2",type:"woff2"};default:return{mime:"application/octet-stream",type:"truetype"}}}isFontAlreadyInDocument(t){return Array.from(document.styleSheets).some(e=>{try{return Array.from(e.cssRules||[]).some(n=>n.cssText.includes(`font-family: '${t}'`)||n.cssText.includes(`font-family: "${t}"`))}catch{return!1}})}getGoogleFontLink(t){return`https://fonts.googleapis.com/css2?family=${t.replace(/ /g,"+")}`}injectGoogleFont(t){let e=`google-font-${t.replace(/ /g,"-").toLowerCase()}`;if(!document.getElementById(e)){let n=document.createElement("link");n.id=e,n.rel="stylesheet",n.href=this.getGoogleFontLink(t),document.head.appendChild(n)}}injectAllGoogleFonts(t){t.forEach(e=>{!e.fontUrl&&e.fontName!=="sans-serif"&&e.fontName!=="serif"&&e.fontName!=="monospace"&&this.injectGoogleFont(e.fontName)})}injectDocumentFonts(t){t.forEach(e=>{e.fontUrl&&this.loadCustomFont(e)})}isGoogleFont(t){let e=t.replace(/['"]/g,""),i=this.availableFonts()[e];return i?!i.fontUrl:this.baseFonts.some(s=>s.fontName===e)}getCustomFontUrlFace(t){let e=t.replace(/['"]/g,"").toLowerCase(),n=this.availableFonts(),i=Object.keys(n).find(s=>s.toLowerCase()===e);if(i){let s=n[i];if(s.fontUrl){let o=s.fontUrl.split(".").pop()?.toLowerCase(),a="truetype";return o==="otf"?a="opentype":o==="woff"?a="woff":o==="woff2"&&(a="woff2"),`
14
+ @font-face {
15
+ font-family: '${s.fontName}';
16
+ src: url('${s.fontUrl}') format('${a}');
17
+ font-weight: normal;
18
+ font-style: normal;
19
+ font-display: swap;
20
+ }
21
+ `}}return null}static \u0275fac=function(e){return new(e||r)(C(Rt))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var rt=29,os=`--vertical-padding:5px; --horizontal-padding:5px; min-width: var(--min-width); --indexSize: ${rt}px; border-collapse: collapse;`,hn={"font-size":"16px","font-family":"serif",color:"rgb(0, 0, 0)","text-align":"left","justify-content":"normal","align-items":"normal","font-weight":"400","font-style":"normal","text-decoration":"none solid rgb(0, 0, 0)","background-color":"transparent","border-width":"1px","border-color":"rgb(0, 0, 0)","border-style":"solid"},as=["font-size","font-family","color","text-align","justify-content","align-items","font-weight","font-style","text-decoration","background-color","border-top-width","border-top-color","border-top-style","border-right-width","border-right-color","border-right-style","border-bottom-width","border-bottom-color","border-bottom-style","border-left-width","border-left-color","border-left-style","padding-top","padding-right","padding-bottom","padding-left"],xr=`<svg class="open" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
22
+ <path d="M3.72727 6H10.2727C10.2727 6 11 6 11 6.88889V13.1111C11 13.1111 11 14 10.2727 14H3.72727C3.72727 14 3 14 3 13.1111V6.88889C3 6.88889 3 6 3.72727 6Z" fill="var(--gray-15)" stroke="none"/>
23
+ <path d="M13 5V3.97726C13 3.35957 12.7192 2.77538 12.2369 2.38951L12.102 2.28162C11.19 1.55199 9.87521 1.6248 9.04932 2.45067V2.45067C8.69759 2.80238 8.49999 3.27941 8.49999 3.77682V6" stroke="var(--gray-15)" stroke-linecap="round" stroke-linejoin="round"/>
24
+ </svg>`,Pr=`<svg class="close" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
25
+ <path d="M3.72727 6H10.2727C10.2727 6 11 6 11 6.88889V13.1111C11 13.1111 11 14 10.2727 14H3.72727C3.72727 14 3 14 3 13.1111V6.88889C3 6.88889 3 6 3.72727 6Z" fill="var(--gray-15)" stroke="none"/>
26
+ <path d="M9 5.8V4.0869C9 3.64531 8.83333 3.22 8.53332 2.89598L8.43577 2.79063C7.5745 1.86045 6.07979 1.94229 5.32522 2.96093V2.96093C5.11401 3.24606 5 3.5915 5 3.94634V7" stroke="var(--gray-15)" stroke-linecap="square" stroke-linejoin="round"/>
27
+ </svg>`,xt=class r{constructor(t,e,n){this.canvasService=e;this.colorService=n;this.renderer=t.createRenderer(null,null)}renderer;createProductTable(t,e,n,i,s){return this._createTable(t,e,n,i,"productTable",s)}createVariantsTable(t,e,n,i,s){return this._createTable(t,e,n,i,"variantsTable",s)}_createTable(t,e,n,i,s,o){let a=2,l=2,c=null;o&&(c=o.querySelector("table"),c&&(a=Array.from((c.querySelector("tr")||{children:[]}).children).filter(D=>!D.classList.contains("row-index-cell")).length,l=c.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").length));let f=os;if(o&&c){let D=c.style.getPropertyValue("--vertical-padding"),_=c.style.getPropertyValue("--horizontal-padding");f+=`; --vertical-padding: ${D&&D.trim()?D:"5px"}; --horizontal-padding: ${_&&_.trim()?_:"5px"}`}let d="<colgroup>";for(let D=0;D<a;D++){let _="auto";if(c){let G=c.querySelectorAll("colgroup col"),K=c.querySelector(".columns-index-row")?1:0;G[D+K]&&(_=G[D+K].style.width||"auto")}d+=`<col style="width:${_}; ${_!=="auto"?"max-width:"+_:""}" />`}d+="</colgroup>";let u=c?Array.from(c.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)")):[],h="";for(let D=0;D<l;D++){let _=u[D]&&u[D].style.minHeight||"10px",G="";u[D]?G=u[D].classList.contains("header-row")?' class="header-row"':"":s==="variantsTable"&&D===0&&(G=' class="header-row"'),h+=`<tr${G} style="min-height:${_}">`;let K=u[D]?Array.from(u[D].children).filter(U=>!U.classList.contains("row-index-cell")):[];for(let U=0;U<a;U++){let oe="",ae="",Pe="";if(K[U]){let Z=K[U],it=Z.querySelector(".cellContent");if(oe=it?it.innerHTML:Z.innerHTML||"",Z.style){let Vr=window.getComputedStyle(Z);Pe=as.map(pn=>`${pn}:${Vr.getPropertyValue(pn)}`).join(";")}let st=Z;st.colSpan>1&&(ae+=` colspan="${st.colSpan}"`),st.rowSpan>1&&(ae+=` rowspan="${st.rowSpan}"`),Z.classList.contains("hidden")&&(ae+=' class="hidden"'),Pe&&(ae+=` style="${Pe}"`),Z.dataset.parentColIndex&&(ae+=` data-parent-col-index="${Z.dataset.parentColIndex}"`),Z.dataset.parentRowIndex&&(ae+=` data-parent-row-index="${Z.dataset.parentRowIndex}"`)}else Pe=Object.entries(hn).map(([Z,it])=>`${Z}:${it}`).join(";"),s==="variantsTable"&&D===0?U===0?oe="R\xE9f\xE9rence":U===1?oe="Prix":oe=`Title ${U+1}`:s==="variantsTable"&&D===1&&(U===0?oe='<tspan></tspan><tspan class="textAttribute" data-type="text">R\xE9f\xE9rence (D\xE9clinaison)</tspan><tspan></tspan>':U===1?oe='<tspan></tspan><tspan class="textAttribute" data-type="text">Prix</tspan><tspan></tspan>':oe=`<tspan></tspan><tspan class="textAttribute" data-type="text">Variable ${U+1}</tspan><tspan></tspan>`),ae=` style="${Pe}"`;h+=`<td${ae}>`,h+='<div class="wrap">',h+=`<div class="cellContent">${oe}</div>`,h+="</div></td>"}h+="</tr>"}let m=`<table class="product-table" data-type="${s}" data-already-edited="false" style="${f}" xmlns="http://www.w3.org/1999/xhtml">`+d+"<tbody>"+h+"</tbody></table>",b=Math.max(n,200),y=Math.max(i,80),p=M.create("foreignObject",{x:t.toString(),y:e.toString(),width:b.toString(),height:y.toString(),"data-type":s}),g=this.renderer.createElement("div","http://www.w3.org/1999/xhtml");g.style.overflow="hidden",g.style.pointerEvents="none",g.innerHTML=m,p.appendChild(g);let E=this.canvasService.activeContainer;return E&&this.renderer.appendChild(E,p),setTimeout(()=>this.resizeTableContainer(p),0),p}addRow(t,e,n=!1){if(!(t.tagName==="TABLE"?t:t.querySelector("table")))return;let s=t.querySelectorAll("td.selected, th.selected"),o=null;if(s.length&&!n)o=e==="afterend"?s[s.length-1].parentElement:s[0].parentElement;else{let h=t.querySelectorAll("tr");o=e==="afterend"?h[h.length-1]:h[1]}if(!o)return;let a=t.querySelector(".columns-index-row"),l=a?a.children.length-1:2,c=document.createElement("tr");c.style.minHeight="10px";let f=document.createElement("td");f.classList.add("row-index-cell");let d=document.createElement("span");d.classList.add("index-view");let u=document.createElement("span");u.classList.add("row-resize"),f.appendChild(d),f.appendChild(u),c.appendChild(f);for(let h=0;h<l;h++){let m=document.createElement("td");Object.entries(hn).forEach(([b,y])=>{m.style.setProperty(b,y)}),m.innerHTML='<div class="wrap"><div class="cellContent"></div></div>',c.appendChild(m)}o.insertAdjacentElement(e,c),this.rewriteRowIndexes(t)}removeRow(t){let e=t.querySelectorAll("td.selected, th.selected"),n=[];e.forEach(i=>{let s=i.parentElement;s&&!n.includes(s)&&n.push(s)});for(let i of n){if(t.querySelectorAll("tr").length<=2)break;for(let s of Array.from(i.children))if(s.rowSpan>1&&this.splitCells(t,s),s.classList.contains("hidden")){let o=[s.dataset.parentColIndex,s.dataset.parentRowIndex];if(o[0]&&o[1]){let a=t.querySelectorAll("tr")[parseInt(o[1])].children[parseInt(o[0])];a&&(a.rowSpan-=1)}}i.remove()}this.rewriteRowIndexes(t)}moveRow(t,e){let n=t.querySelectorAll("td.selected, th.selected"),i=[];n.forEach(s=>{let o=s.parentElement;o&&!i.includes(o)&&i.push(o)}),e==="down"&&(i=i.reverse());for(let s of i)if(e==="up"){let o=s.previousElementSibling;if(!o||o.classList.contains("columns-index-row")||o.classList.contains("spacing-row"))return;o.insertAdjacentElement("beforebegin",s)}else{let o=s.nextElementSibling;if(!o)return;o.insertAdjacentElement("afterend",s)}this.rewriteRowIndexes(t)}addColumn(t,e,n=!1){let i=t.tagName==="TABLE"?t:t.querySelector("table");if(!i)return;let s=t.querySelectorAll("td.selected, th.selected"),o=(t.querySelector(".columns-index-row")?.children.length??2)-1,a;if(s.length&&!n){a=Array.prototype.indexOf.call(s[0].parentNode.children,s[0]);for(let d of Array.from(s)){let u=Array.prototype.indexOf.call(d.parentNode.children,d);a=e==="beforebegin"?Math.min(a,u):Math.max(a,u)}}else a=e==="beforebegin"?1:o;let l=this._getColumnByIndex(i,a),c=t.querySelectorAll("colgroup col");for(let d=0;d<l.length;d++){if(!l[d])continue;let u=l[d].parentElement;if(u?.classList.contains("columns-index-row")){let h=document.createElement("td");h.classList.add("col-index-cell");let m=document.createElement("span");m.classList.add("index-view");let b=document.createElement("span");b.classList.add("col-resize");let y=document.createElement("span");y.className="lockIcon",y.innerHTML=`${Pr}${xr}`,h.appendChild(y),h.appendChild(m),h.appendChild(b),l[d].insertAdjacentElement(e,h)}else if(u?.classList.contains("spacing-row")){let h=document.createElement("td");l[d].insertAdjacentElement(e,h)}else{let h=l[d].style,m=document.createElement("td");m.style.setProperty("font-size",h.fontSize||"16px"),m.style.setProperty("font-family",h.fontFamily||"serif"),m.style.setProperty("color",h.color||"rgb(0, 0, 0)"),m.style.setProperty("text-align",h.textAlign||"left"),m.style.setProperty("justify-content",h.justifyContent||"normal"),m.style.setProperty("align-items",h.alignItems||"normal"),m.style.setProperty("font-weight",h.fontWeight||"400"),m.style.setProperty("font-style",h.fontStyle||"normal"),m.style.setProperty("text-decoration",h.textDecoration||"none solid rgb(0, 0, 0)"),m.style.setProperty("background-color",h.backgroundColor||"rgba(0, 0, 0, 0)"),m.style.setProperty("border-width",h.borderWidth||"1px"),m.style.setProperty("border-color",h.borderColor||"rgb(0, 0, 0)"),m.style.setProperty("border-style",h.borderStyle||"solid"),m.innerHTML='<div class="wrap"><div class="cellContent"></div></div>',(t.dataset?.type||t.querySelector("table")?.dataset?.type)==="variantsTable"&&u===t.querySelectorAll("tr")[3]&&(m.querySelector(".cellContent").innerHTML='<tspan></tspan><tspan class="textAttribute" data-type="text"></tspan><tspan></tspan>'),l[d].insertAdjacentElement(e,m)}}let f=document.createElement("col");f.style.width="auto",c[a]&&c[a].insertAdjacentElement(e,f),this.rewriteColumnsIndexes(t)}removeColumn(t,e=-1){let n=t.tagName==="TABLE"?t:t.querySelector("table");if(!n)return;let i=[];e!==-1?i.push(e):t.querySelectorAll("td.selected, th.selected").forEach(o=>{let a=Array.prototype.indexOf.call(o.parentNode.children,o);i.includes(a)||i.push(a)});for(let s=i.length-1;s>=0;s--){let o=t.querySelectorAll("colgroup col"),a=i[s],l=this._getColumnByIndex(n,a);if((t.querySelector("tr")?.children.length??0)<=2)break;for(let c of l)c&&(c.rowSpan>1&&this.splitCells(t,c),c.remove());o[a]&&o[a].remove()}this.rewriteColumnsIndexes(t)}moveColumn(t,e){let n=t.tagName==="TABLE"?t:t.querySelector("table");if(!n)return;let i=t.querySelectorAll("td.selected, th.selected"),s=[];i.forEach(o=>{let a=Array.prototype.indexOf.call(o.parentNode.children,o);s.includes(a)||s.push(a)}),e==="right"&&(s=s.reverse());for(let o of s){let a=this._getColumnByIndex(n,o),l=t.querySelectorAll("colgroup col");if(e==="left"){let c=this._getColumnByIndex(n,o-1);if(!c[1]||c[1].classList.contains("row-index-cell"))return;for(let f=0;f<a.length;f++)c[f]&&a[f]&&c[f].insertAdjacentElement("beforebegin",a[f]);l[o-1]&&l[o]&&l[o-1].insertAdjacentElement("beforebegin",l[o])}else{let c=this._getColumnByIndex(n,o+1);if(!c[0])return;for(let f=0;f<a.length;f++)c[f]&&a[f]&&c[f].insertAdjacentElement("afterend",a[f]);l[o+1]&&l[o]&&l[o+1].insertAdjacentElement("afterend",l[o])}}this.rewriteColumnsIndexes(t)}mergeCells(t){let e=Array.from(t.querySelectorAll("td.selected, th.selected"));if(e.length<2)return;let n=t.querySelectorAll("tr");if(e.some(m=>m.colSpan!==1||m.rowSpan!==1||m.classList.contains("hidden")))return;let s=1/0,o=1/0,a=-1/0,l=-1/0;e.forEach(m=>{let b=Array.prototype.indexOf.call(m.parentNode.children,m),y=Array.prototype.indexOf.call(m.parentNode.parentNode.children,m.parentNode);s=Math.min(s,b),o=Math.min(o,y),a=Math.max(a,b),l=Math.max(l,y)});let c=a-s+1,f=l-o+1,d=n[o].children[s];d.colSpan=c,d.rowSpan=f;let u=Array.prototype.indexOf.call(d.parentNode.children,d),h=Array.prototype.indexOf.call(d.parentNode.parentNode.children,d.parentNode);for(let m of e)m!==d&&(m.classList.add("hidden"),m.dataset.parentColIndex=String(u),m.dataset.parentRowIndex=String(h))}splitCells(t,e){let n=e??t.querySelector("td.selected, th.selected");if(!n)return;let i=t.querySelectorAll("tr"),s=n.colSpan,o=n.rowSpan;if(s<=1&&o<=1)return;let a=Array.prototype.indexOf.call(n.parentNode.children,n),l=Array.prototype.indexOf.call(n.parentNode.parentNode.children,n.parentNode);for(let c=0;c<o;c++)for(let f=0;f<s;f++){let d=i[l+c];if(!d)continue;let u=d.children[a+f];u&&(u.classList.remove("hidden"),u.classList.remove("d-none"),delete u.dataset.parentColIndex,delete u.dataset.parentRowIndex)}n.colSpan=1,n.rowSpan=1}applyStyleToSelected(t,e,n,i){let s=t.querySelectorAll("td.selected, th.selected");if(s.length===0)return;let o=i!==void 0&&s[0].style.getPropertyValue(e)===n;s.forEach(a=>{let l=o?i??n:n;a.style.setProperty(e,l)})}applyBorderStylesToSelected(t,e,n,i=["all"]){let s=Array.from(t.querySelectorAll("td.selected")),o=Array.from(t.querySelectorAll("tr")),a=o.map(l=>Array.from(l.children));s.forEach(l=>{let c=l.parentElement;if(!c)return;let f=o.indexOf(c),d=Array.prototype.indexOf.call(c.children,l),u=l.rowSpan||1,h=l.colSpan||1;if(i.includes("all"))l.style.setProperty(e,n),["top","bottom","left","right"].forEach(m=>{this._syncAdjacentBorder(a,s,e,n,m,f,d,u,h)});else for(let m of i){let b=e.replace("border","border-"+m);l.style.setProperty(b,n),this._syncAdjacentBorder(a,s,e,n,m,f,d,u,h)}})}_syncAdjacentBorder(t,e,n,i,s,o,a,l,c){let f=[],d="";if(s==="top"){d="bottom";for(let u=a;u<a+c;u++)f.push(this._getVisibleCell(t,o-1,u))}else if(s==="bottom"){d="top";for(let u=a;u<a+c;u++)f.push(this._getVisibleCell(t,o+l,u))}else if(s==="left"){d="right";for(let u=o;u<o+l;u++)f.push(this._getVisibleCell(t,u,a-1))}else if(s==="right"){d="left";for(let u=o;u<o+l;u++)f.push(this._getVisibleCell(t,u,a+c))}f.forEach(u=>{u&&!e.includes(u)&&u.style.setProperty(n.replace("border","border-"+d),i)})}_getVisibleCell(t,e,n){if(e<0||e>=t.length||n<0||n>=t[e].length)return null;let i=t[e][n];if(!i)return null;if(i.classList.contains("hidden")){let s=i.dataset.parentRowIndex,o=i.dataset.parentColIndex;return s!==void 0&&o!==void 0&&t[parseInt(s)][parseInt(o)]||null}return i}clearTableStyle(t){t.querySelectorAll("td").forEach(n=>{n.removeAttribute("style"),n.children[0]&&n.children[0].removeAttribute("style"),n.removeAttribute("colspan"),n.removeAttribute("rowspan"),n.classList.remove("hidden"),delete n.dataset.parentColIndex,delete n.dataset.parentRowIndex}),t.querySelectorAll("colgroup col").forEach(n=>{n.style.width="10px"}),t.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").forEach(n=>{n.style.minHeight="10px"})}clearTable(t){t.querySelectorAll("td:not(:has(.index-view)) .cellContent").forEach(e=>{e.innerHTML=""}),this.clearTableStyle(t),t.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").forEach(e=>{e.style.minHeight="10px"}),t.querySelectorAll("colgroup col").forEach(e=>{e.style.width="10px",e.style.removeProperty("max-width"),e.style.removeProperty("min-width")})}setDefaultStyleToCell(t){Object.entries(hn).forEach(([e,n])=>{t.style.setProperty(e,n)})}resizeTableContainer(t){let e=t.querySelector("table");if(!e||e.getAttribute("data-locked")==="true")return;let n=this.canvasService.zoomLevel(),i=e.getBoundingClientRect();i.width>0&&i.height>0&&(t.setAttribute("width",String(i.width*(1/n))),t.setAttribute("height",String(i.height*(1/n))))}setTableEditMode(t){let e=t.querySelector("table");e&&(e.classList.add("edit-mode"),t.setAttribute("width",String(Number(t.getAttribute("width"))+rt)),t.setAttribute("height",String(Number(t.getAttribute("height"))+rt+10)),setTimeout(()=>this.resizeTableContainer(t),100),this.rewriteRowIndexes(t))}removeTableEditMode(t){let e=t.querySelector("table");if(!e)return;let n=e.querySelector(".cell-edit-input");n&&this.removeEditInput(n.closest("td")),e.classList.remove("edit-mode"),t.querySelectorAll(".selected").forEach(i=>i.classList.remove("selected")),this.resizeTableContainer(t)}getTableSize(t){let e=(t.querySelector(".columns-index-row")?.children.length??2)-1;return{rows:t.querySelectorAll("tr").length-1,cols:e}}setTableSize(t,e,n){let i=t.tagName==="TABLE"?t:t.querySelector("table");if(!i)return;let s=i.dataset?.type==="variantsTable",o=this.getTableSize(t);if(s&&(e=3),e>o.rows)for(let a=o.rows;a<e;a++)this.addRow(t,"afterend",!0);else if(e<o.rows){let a=t.querySelectorAll("tr");for(let l=a.length-1;l>e;l--)a[l].remove()}if(n>o.cols)for(let a=o.cols;a<n;a++)this.addColumn(t,"afterend",!0);else if(n<o.cols)for(let a=o.cols;a>n;a--){this._getColumnByIndex(i,a).forEach(f=>f?.remove());let c=t.querySelectorAll("colgroup col");c[a]&&c[a].remove()}this.rewriteRowIndexes(t),this.rewriteColumnsIndexes(t)}setEditInput(t){let e=t.children[0];if(!e)return;let n=e.querySelector(".cellContent");n&&(n.setAttribute("contenteditable","true"),n.classList.add("cell-edit-input"),n.querySelectorAll(".textAttribute").forEach(i=>{i.setAttribute("contenteditable","false"),i.style.userSelect="none"}),n.focus())}removeEditInput(t){let e=t.querySelector(".cell-edit-input");e&&(e.removeAttribute("contenteditable"),e.classList.remove("cell-edit-input"),e.querySelectorAll(".textAttribute").forEach(n=>{n.removeAttribute("contenteditable"),n.style.userSelect=""}),e.innerHTML=e.innerHTML)}selectCells(t,e){this.deselectAllCells(t),e.forEach(n=>n.classList.add("selected"))}deselectAllCells(t){t.querySelectorAll("td.selected, th.selected").forEach(e=>e.classList.remove("selected")),t.querySelectorAll(".cell-edit-input").forEach(e=>{e.removeAttribute("contenteditable"),e.classList.remove("cell-edit-input")})}rewriteRowIndexes(t){let e=t.querySelectorAll(".row-index-cell"),n=t.querySelector("table")?.dataset.type==="variantsTable";e.forEach((i,s)=>{let o=i.querySelector(".index-view");o&&(n&&s===0?o.textContent="":o.textContent=String(s+(n?0:1)))})}rewriteColumnsIndexes(t){t.querySelectorAll(".col-index-cell").forEach((n,i)=>{let s=n.querySelector(".index-view");s&&(s.textContent=this._colIndexToLetter(i))})}exportTable(t){let e=t.tagName==="TABLE"?t:t.querySelector("table");if(!e)return"";let n=e.cloneNode(!0);n.classList.remove("edit-mode"),n.querySelectorAll(".spacing-row").forEach(o=>o.remove()),n.querySelectorAll("tr").forEach(o=>{o.querySelectorAll(".wrap").forEach(a=>{a.style.removeProperty("width")}),o.style.minHeight||(o.style.minHeight="10px")});let i=n.querySelector(".columns-index-row"),s=!!i;if(i&&i.remove(),n.querySelectorAll(".row-index-cell").forEach(o=>o.remove()),n.querySelectorAll(".index-view").forEach(o=>o.remove()),n.querySelectorAll(".col-resize").forEach(o=>o.remove()),n.querySelectorAll(".row-resize").forEach(o=>o.remove()),n.querySelectorAll(".lockIcon").forEach(o=>o.remove()),s){let o=n.querySelector("colgroup col");o&&o.remove()}if(n.querySelectorAll("colgroup col").forEach(o=>{o.style.minWidth="30px"}),n.querySelectorAll(".hidden").forEach(o=>{o.style.display="none"}),n.querySelectorAll(".selected").forEach(o=>o.classList.remove("selected")),n.querySelectorAll(".cell-edit-input").forEach(o=>{o.removeAttribute("contenteditable"),o.classList.remove("cell-edit-input")}),n.querySelectorAll("td .wrap").forEach(o=>{o.removeAttribute("style")}),s){let o=parseFloat(n.style.minWidth);isNaN(o)||(n.style.minWidth=String(o-rt)+"px")}return n.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),n.outerHTML}enableEditMode(t){let e=t.dataset.type==="variantsTable"||t.dataset.type==="variantTable"||t.closest("foreignObject")?.dataset.type==="variantsTable";if(t.classList.add("edit-mode"),t.querySelectorAll("td:not(.col-index-cell):not(.row-index-cell):not(.selectAll), th:not(.col-index-cell):not(.row-index-cell):not(.selectAll)").forEach(d=>{if(!d.querySelector(".wrap")){let u=d.innerHTML;d.innerHTML='<div class="wrap"><div class="cellContent"></div></div>';let h=d.querySelector(".cellContent");h.innerHTML=u}}),t.querySelector(".columns-index-row"))return;let n=Array.from(t.querySelectorAll("tr")).filter(d=>!d.classList.contains("spacing-row")),i=0;n.length>0&&(i=Array.from(n[0].children).filter(d=>!d.classList.contains("row-index-cell")).length);let s=t.querySelector("colgroup");if(!s){s=document.createElement("colgroup");for(let d=0;d<i;d++){let u=document.createElement("col");u.style.width="auto",s.appendChild(u)}t.prepend(s)}let o=document.createElement("col");o.style.width="30px",o.style.minWidth="30px",s.prepend(o);let a=document.createElement("tr");a.className="columns-index-row",a.innerHTML='<td class="selectAll"><span class="index-view"></span></td>';for(let d=0;d<i;d++)a.innerHTML+=`<td class="col-index-cell"><span class="index-view">${this._colIndexToLetter(d)}</span><span class="col-resize"></span><span class="lockIcon">${Pr}${xr}</span></td>`;let l=t.querySelector("thead");l?l.prepend(a):(t.querySelector("tbody")||t).prepend(a);let c=0;if(Array.from(t.querySelectorAll("tr")).forEach(d=>{if(d.classList.contains("columns-index-row")||d.classList.contains("spacing-row"))return;let u=document.createElement(d.parentElement?.tagName==="THEAD"?"th":"td");u.className="row-index-cell";let h=e&&c===0?"":String(c+(e?0:1));u.innerHTML=`<span class="index-view">${h}</span><span class="row-resize"></span>`,d.prepend(u),c++}),e&&!t.querySelector(".spacing-row")){let d=document.createElement("tr");d.className="spacing-row",d.style.height="8px";let u=t.querySelectorAll("tr");if(u.length>2){let h=u[2];h.parentNode?.insertBefore(d,h)}}t.querySelectorAll(".hidden").forEach(d=>{d.style.display="table-cell"});let f=parseFloat(t.style.minWidth);isNaN(f)||(t.style.minWidth=f+rt+"px")}_colIndexToLetter(t){let e="",n=t;for(;n>=0;)e=String.fromCharCode(65+n%26)+e,n=Math.floor(n/26)-1;return e}_getColumnByIndex(t,e){let n=t.querySelectorAll("tr"),i=[];return n.forEach(s=>{s.children[e]&&i.push(s.children[e])}),i}exportVariantsTableSettings(t){let e=t.querySelector("table");if(!e)return null;let n=(o,a="rgb(255, 255, 255)")=>{if(!o||o==="transparent"||o==="rgba(0, 0, 0, 0)")return a;let l=this.colorService.toRgba(o);return l.a===0?"rgba(0, 0, 0, 0)":`rgb(${l.r}, ${l.g}, ${l.b})`},i={showHeader:e.getAttribute("data-show-header")!=="false",hideEmptyCells:e.getAttribute("data-remove-empty-cells")==="true",backgroundVariation:{hasVariation:e.getAttribute("data-background-variation")==="true",backgroundColor:n(e.getAttribute("data-background-variation-color")||"#ffffff","rgba(0, 0, 0, 0)")},globalBorder:{color:e.dataset.globalBorderColor||"black",stroke:e.dataset.globalBorderStyle||"solid",width:e.dataset.globalBorderSize||"1px"},width:t.getAttribute("width"),padding:{horizontal:e.style.getPropertyValue("--horizontal-padding"),vertical:e.style.getPropertyValue("--vertical-padding")}},s=e.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)");return Array.from(s).forEach((o,a)=>{let l=o.querySelectorAll("td, th"),c=a===0?"headerRow":"bodyRow",f=[];Array.from(l).forEach(d=>{let u=d;if(u.classList.contains("row-index-cell"))return;let h=window.getComputedStyle(u),m={text:{alignment:h.textAlign||"left",verticalAlignment:h.verticalAlign||h.alignItems||"top",style:h.fontStyle||"normal",weight:h.fontWeight||"400",decoration:h.textDecoration||"none",color:n(h.color,"rgb(0, 0, 0)"),font:h.fontFamily.split(",")[0].replace(/'/g,"").replace(/"/g,"").trim()||"serif",size:h.fontSize||"16px"},border:{color:n(h.borderColor||"black","rgb(0, 0, 0)"),stroke:h.borderStyle||"solid",width:h.borderWidth||"1px"},backgroundColor:n(h.backgroundColor,"rgba(0, 0, 0, 0)")},b=u.querySelector(".cellContent");if(b){let p=b.textContent||"";m.fieldName=p.replace(/{{(.*)}}/g,"$1").trim()}if(c==="headerRow"){let p=Array.prototype.indexOf.call(o.children,u),g=e.querySelector("colgroup");if(g){let E=g.children[p];E&&(m.width=E.style.width)}}let y=u;u.classList.contains("hidden")&&(m.display=!1),y.colSpan>1&&(m.colSpan=y.colSpan),y.rowSpan>1&&(m.rowSpan=y.rowSpan),f.push(m)}),i[c]=f}),i}static \u0275fac=function(e){return new(e||r)(C(An),C(fe),C(xe))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Pt=class r{isLoading=T(!1);hasError=T(!1);errorKey=T("");isCanvasLoading=T(!1);canvasHasError=T(!1);canvasErrorKey=T("");showLoader(){this.isLoading.set(!0),this.hasError.set(!1),this.errorKey.set("")}hideLoader(){this.isLoading.set(!1)}showError(t){this.isLoading.set(!1),this.hasError.set(!0),this.errorKey.set(t)}showCanvasLoader(){this.isCanvasLoading.set(!0),this.canvasHasError.set(!1),this.canvasErrorKey.set("")}hideCanvasLoader(){this.isCanvasLoading.set(!1)}showCanvasError(t){this.isCanvasLoading.set(!1),this.canvasHasError.set(!0),this.canvasErrorKey.set(t)}reset(){this.isLoading.set(!1),this.hasError.set(!1),this.errorKey.set(""),this.isCanvasLoading.set(!1),this.canvasHasError.set(!1),this.canvasErrorKey.set("")}static \u0275fac=function(e){return new(e||r)};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ot=class r{constructor(t,e,n,i,s,o,a,l,c){this.canvasService=t;this.appParams=e;this.docService=n;this.assetsService=i;this.notificationService=s;this.eventsService=o;this.fontService=a;this.tableService=l;this.loadingService=c;pt(()=>{let f=this.canvasService.modifiedPulse();if(this.canvasService.isSilent()){this.lastPulse=f;return}f>this.lastPulse?(this.lastPulse=f,import("./chunk-HQAPYEAU.js").then(({untracked:u})=>{u(()=>{this.setDirty(!0)})})):this.lastPulse=f}),this.eventsService.on("SHORTCUT_SAVE").subscribe(()=>{this.save()})}isDirty=T(!1);saveSuccessPulse=T({guid:"",count:0});lastPulse=0;thumbnailService=w(Ft);setDirty(t){this.isDirty.set(t)}getSvgString(){if(!this.canvasService.isReady())return"";let t=this.canvasService.svgElement,e=t.cloneNode(!0);Array.from(e.children).forEach(g=>{g.tagName.toLowerCase()!=="defs"&&(g.classList.contains("drawing-layer")||g.remove())}),e.style.removeProperty("transform"),e.style.removeProperty("background-color"),e.setAttribute("data-sp-version",et),e.setAttribute("version","1.1");let n=this.docService.properties().doublePage||!1;e.setAttribute("data-double-page",String(n)),e.querySelectorAll(".se-selection-box, .se-handler, #canvasGrid, #selection-outline, .page-divider, #creation-band-overlay").forEach(g=>g.remove()),Nr(e),Array.from(e.querySelectorAll('g[data-gsvg="true"]')).forEach(g=>{let E=g.attributes.length;for(let D=0;D<g.attributes.length;D++)(g.attributes[D].name==="id"||g.attributes[D].name==="style")&&E--;if(E<=0&&g.children.length>0){let D=g.children[0];g.replaceWith(D)}}),Array.from(e.getElementsByTagName("foreignObject")).forEach(g=>{g.removeAttribute("fill"),g.removeAttribute("stroke")});let i=t.getAttribute("width")||"0",s=t.getAttribute("height")||"0",o=e.getElementById("Block");if(o)o.setAttribute("fill","none");else{let g=document.createElementNS("http://www.w3.org/2000/svg","rect");g.setAttribute("id","Block"),g.setAttribute("x","0"),g.setAttribute("y","0"),g.setAttribute("width",i),g.setAttribute("height",s),g.setAttribute("fill","none"),e.insertBefore(g,e.firstChild)}let a=Math.random().toString(36).substring(2,9);e.setAttribute("id",a);let l=new Set;e.querySelectorAll('[style*="font-family"]').forEach(g=>{let E=g.style.fontFamily;E&&E.split(",").forEach(D=>{let _=D.trim().replace(/['"]/g,"");_&&l.add(_)})}),e.querySelectorAll("[font-family]").forEach(g=>{let E=g.getAttribute("font-family");E&&E.split(",").forEach(D=>{let _=D.trim().replace(/['"]/g,"");_&&l.add(_)})});let c=Array.from(l),f=c.filter(g=>this.fontService.isGoogleFont(g)),d=c.filter(g=>!this.fontService.isGoogleFont(g)),u="";if(f.length>0){let g=f.filter(E=>!["serif","sans-serif","monospace"].includes(E.toLowerCase())).map(E=>E.replace(/ /g,"+")).join("|");g&&(u=`@import url("https://fonts.googleapis.com/css?family=${g}:400,400i,700,700i&display=swap");
28
+ `)}d.forEach(g=>{let E=this.fontService.getCustomFontUrlFace(g);E&&(u+=E+`
29
+ `)});let h=`
30
+ ${u}
31
+
32
+ #${a} foreignObject * {
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ #${a} foreignObject table {
37
+ table-layout: fixed;
38
+ min-height: inherit;
39
+ min-width: var(--min-width);
40
+ border-collapse: collapse;
41
+ }
42
+ #${a} foreignObject td, #${a} foreignObject th {
43
+ line-height: 120%;
44
+ overflow: hidden;
45
+ text-align: left;
46
+ padding: 5px;
47
+ border-width: 0.8px;
48
+ border-color: rgb(0, 0, 0);
49
+ border-style: solid;
50
+ font-family: "serif";
51
+ font-size: 16px;
52
+ color: rgb(0, 0, 0);
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ text-decoration: none solid rgb(0, 0, 0);
56
+ background-color: transparent;
57
+ min-height: inherit;
58
+ }
59
+ #${a} foreignObject .cellContent {
60
+ display: flex;
61
+ align-items: inherit;
62
+ justify-content: inherit;
63
+ width: 100%;
64
+ height: 100%;
65
+ flex-direction: column;
66
+ }
67
+ #${a} foreignObject .cellContent div {
68
+ width: max-content;
69
+ }
70
+ #${a} [locked='true'].fake-textarea > * {
71
+ max-width: 100%;
72
+ }
73
+ #${a} .fake-textarea,
74
+ #${a} .fake-textarea div {
75
+ width: 100%;
76
+ }
77
+ #${a} .fake-textarea {
78
+ display: flex;
79
+ flex-direction: column;
80
+ overflow-wrap: break-word;
81
+ outline: none;
82
+ height: 100%;
83
+ width: 100%;
84
+ }
85
+ `,m=document.createElementNS("http://www.w3.org/2000/svg","style");m.setAttribute("id","style-"+a),m.textContent=h,e.insertBefore(m,e.firstChild);let b=g=>{if(g.nodeType===Node.COMMENT_NODE){g.parentNode?.removeChild(g);return}if(g.nodeType===Node.ELEMENT_NODE){let D=g,_=D.attributes;if(_)for(let G=_.length-1;G>=0;G--){let K=_[G].name;(K.startsWith("_ngcontent")||K.startsWith("_nghost")||K.startsWith("ng-reflect-"))&&D.removeAttribute(K)}}Array.from(g.childNodes).forEach(D=>b(D))};b(e);let y=e.outerHTML;if(y=Rr(y),(this.appParams.type||"documents").toLowerCase()!=="background"){let g=M.getDocumentRoot().querySelector("svg style");if(g){let E=g.cloneNode(!0);b(E),y=y.replace(/<svg[^>]*>/,`$&${E.outerHTML}`)}}return y}save(){return H(this,null,function*(){if(this.loadingService.canvasHasError()){this.notificationService.error("Impossible de sauvegarder : une erreur est survenue lors du chargement de la page.");return}let t=this.getSvgString();if(!t)return;let e=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),n=this.appParams.type||"document",i=this.appParams.guid||"",s=this.appParams.pageGuid?this.appParams.pageGuid().toString():"1",o=new FormData;o.append("file",e,n=="document"?i:this.appParams.templateData.publicationTemplateName),o.append("publicationTemplateguid",i),o.append(n=="document"?"pageGuid":"pageId",n=="document"?s:"1"),this.assetsService.saveDocument(n,o).subscribe({next:a=>{if(a===null)this.notificationService.error("Erreur lors de la sauvegarde du document.");else if(this.notificationService.success("Document sauvegard\xE9 avec succ\xE8s !"),this.setDirty(!1),this.saveSuccessPulse.set({guid:s,count:this.saveSuccessPulse().count+1}),n!=="document"){let l=this.appParams.templateData?.publicationTemplateVersion;(this.canvasService.versionUpgraded()||!l)&&["background","cover","marketing","productblock"].includes(n)&&this.assetsService.updateTemplateField("publicationTemplateVersion",et).subscribe({next:()=>{console.log("Template version updated to",et),this.canvasService.versionUpgraded.set(!1),this.appParams.templateData&&(this.appParams.templateData.publicationTemplateVersion=et)},error:u=>console.error("Error updating template version",u)});let f=M.getDocumentRoot().querySelector('[data-type="variantsTable"]');if(f){let d=this.tableService.exportVariantsTableSettings(f);d&&this.assetsService.updateTemplateField("publicationTemplateSettingVariants",JSON.stringify(d)).subscribe({next:()=>console.log("Variants settings updated"),error:u=>console.error("Error updating variants settings",u)})}}},error:a=>{this.notificationService.error("Erreur lors de la sauvegarde du document.")}})})}static \u0275fac=function(e){return new(e||r)(C(fe),C(ne),C(Me),C(_t),C(Nt),C(Re),C(Mt),C(xt),C(Pt))};static \u0275prov=v({token:r,factory:r.\u0275fac,providedIn:"root"})};function us(r,t){if(r&1){let e=Ge();L(0,"div",1),B("contextmenu",function(i){return $(e),z(i.preventDefault())}),L(1,"div",2),B("click",function(){$(e);let i=j();return z(i.onAction("open"))}),L(2,"span"),q(3),J(4,"translate"),k()(),De(5,"div",3),L(6,"div",2),B("click",function(){$(e);let i=j();return z(i.onAction("insert-before"))}),L(7,"span"),q(8),J(9,"translate"),k()(),L(10,"div",2),B("click",function(){$(e);let i=j();return z(i.onAction("insert-after"))}),L(11,"span"),q(12),J(13,"translate"),k()(),De(14,"div",3),L(15,"div",2),B("click",function(){$(e);let i=j();return z(i.onAction("duplicate"))}),L(16,"span"),q(17),J(18,"translate"),k()(),De(19,"div",3),L(20,"div",4),B("click",function(){$(e);let i=j();return z(i.onAction("delete"))}),L(21,"span"),q(22),J(23,"translate"),k()()()}if(r&2){let e=j();Fn("top",e.position.y,"px")("left",e.position.x,"px"),V(3),ee(Y(4,11,"GLOBAL.PAGES.OPEN")),V(5),ee(Y(9,13,"GLOBAL.PAGES.INSERT_BEFORE")),V(4),ee(Y(13,15,"GLOBAL.PAGES.INSERT_AFTER")),V(5),ee(Y(18,17,"GLOBAL.PAGES.DUPLICATE")),V(3),On("disabled",e.isCurrentPage),V(2),ee(Y(23,19,"GLOBAL.PAGES.DELETE"))}}var Ir=class r{constructor(t){this.elementRef=t}visible=!1;position={x:0,y:0};pageIndex=null;isCurrentPage=!1;action=new re;closeMenu=new re;onDocumentClick(t){if(this.visible){let e=t.composedPath?t.composedPath():[];(e.length>0?e.includes(this.elementRef.nativeElement):this.elementRef.nativeElement.contains(t.target))||this.closeMenu.emit()}}onAction(t){t==="delete"&&this.isCurrentPage||(this.pageIndex!==null&&this.action.emit({action:t,index:this.pageIndex}),this.closeMenu.emit())}static \u0275fac=function(e){return new(e||r)(I(he))};static \u0275cmp=ye({type:r,selectors:[["app-page-context-menu"]],hostBindings:function(e,n){e&1&&B("mousedown",function(s){return n.onDocumentClick(s)},!1,Cn)},inputs:{visible:"visible",position:"position",pageIndex:"pageIndex",isCurrentPage:"isCurrentPage"},outputs:{action:"action",closeMenu:"closeMenu"},decls:1,vars:1,consts:[["class","context-menu",3,"top","left","contextmenu",4,"ngIf"],[1,"context-menu",3,"contextmenu"],[1,"menu-item",3,"click"],[1,"separator"],[1,"menu-item","delete",3,"click"]],template:function(e,n){e&1&&Ve(0,us,24,21,"div",0),e&2&&ue("ngIf",n.visible)},dependencies:[pe,He,_e,Ae],styles:[".context-menu[_ngcontent-%COMP%]{position:fixed;background:var(--gray-4);border:1px solid var(--gray-3);border-radius:var(--radius-m);box-shadow:0 4px 12px #0006;z-index:3000;min-width:180px;padding:4px 0;color:var(--white);-webkit-user-select:none;user-select:none}.menu-item[_ngcontent-%COMP%]{padding:8px 12px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;font-size:13px;transition:background-color .1s ease}.menu-item[_ngcontent-%COMP%]:hover{background:var(--active);color:var(--white)}.menu-item.delete[_ngcontent-%COMP%]:hover{background:#e53935}.menu-item.disabled[_ngcontent-%COMP%]{opacity:.4;cursor:not-allowed;pointer-events:none}.menu-item.disabled[_ngcontent-%COMP%]:hover{background:transparent}.separator[_ngcontent-%COMP%]{height:1px;background-color:var(--gray-3);margin:4px 0}"]})};var ds=["*"];function fs(r,t){if(r&1){let e=Ge();L(0,"div",7)(1,"button",8),B("click",function(){$(e);let i=j(2);return z(i.close())}),q(2),J(3,"translate"),k(),L(4,"button",9),B("click",function(){$(e);let i=j(2);return z(i.submit())}),q(5),J(6,"translate"),k()()}if(r&2){let e=j(2);V(2),zt(" ",Y(3,3,"CANCEL")," "),V(2),ue("disabled",e.isSubmitDisabled),V(),zt(" ",Y(6,5,"CONFIRM")," ")}}function hs(r,t){if(r&1){let e=Ge();L(0,"div",1),B("click",function(){$(e);let i=j();return z(i.close())}),L(1,"div",2),B("click",function(i){return $(e),z(i.stopPropagation())}),L(2,"div",3)(3,"h3"),q(4),k(),L(5,"button",4),B("click",function(){$(e);let i=j();return z(i.close())}),q(6,"\xD7"),k()(),L(7,"div",5),Rn(8),k(),Ve(9,fs,7,7,"div",6),k()()}if(r&2){let e=j();V(4),ee(e.title),V(5),ue("ngIf",e.showFooter)}}var It=class r{title="Modal";isOpen=!1;showFooter=!0;isSubmitDisabled=!1;closeEvent=new re;submitEvent=new re;close(){this.closeEvent.emit(),this.isOpen=!1}submit(){this.submitEvent.emit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=ye({type:r,selectors:[["app-basic-modal"]],inputs:{title:"title",isOpen:"isOpen",showFooter:"showFooter",isSubmitDisabled:"isSubmitDisabled"},outputs:{closeEvent:"closeEvent",submitEvent:"submitEvent"},ngContentSelectors:ds,decls:1,vars:1,consts:[["class","modal-backdrop",3,"click",4,"ngIf"],[1,"modal-backdrop",3,"click"],[1,"modal-content",3,"click"],[1,"modal-header"],[1,"close-btn",3,"click"],[1,"modal-body"],["class","modal-footer",4,"ngIf"],[1,"modal-footer"],[1,"cancel-btn",3,"click"],[1,"save-btn",3,"click","disabled"]],template:function(e,n){e&1&&(Nn(),Ve(0,hs,10,2,"div",0)),e&2&&ue("ngIf",n.isOpen)},dependencies:[pe,He,_e,Ae],styles:[".modal-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--white-alpha-medium);display:flex;justify-content:center;align-items:center;z-index:2000}.modal-content[_ngcontent-%COMP%]{background:var(--gray-5);border-radius:var(--radius-s);min-width:300px;box-shadow:var(--shadow);color:var(--white)}.modal-header[_ngcontent-%COMP%]{padding:var(--spacing-m);border-bottom:1px solid var(--gray-3);display:flex;justify-content:space-between;align-items:center}.modal-body[_ngcontent-%COMP%]{padding:var(--spacing-m)}.modal-footer[_ngcontent-%COMP%]{padding:var(--spacing-s) var(--spacing-m);border-top:1px solid var(--gray-3);display:flex;justify-content:flex-end;gap:var(--spacing-s)}h3[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-regular);font-weight:var(--font-weight-semi-bold)}.close-btn[_ngcontent-%COMP%]{background:none;border:none;font-size:24px;cursor:pointer;color:var(--white);transition:color .2s}.close-btn[_ngcontent-%COMP%]:hover{color:var(--error)}.cancel-btn[_ngcontent-%COMP%]{background:var(--gray-4);color:var(--white);border:none;padding:var(--spacing-s) var(--spacing-m);border-radius:var(--radius-s);cursor:pointer;transition:background .2s}.cancel-btn[_ngcontent-%COMP%]:hover{background:var(--gray-3)}.save-btn[_ngcontent-%COMP%]{background:var(--active);color:var(--white);border:none;padding:var(--spacing-s) var(--spacing-m);border-radius:var(--radius-s);cursor:pointer;transition:background .2s}.save-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--active-hover)}.save-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};var Br=class r{message;confirm=new re;cancel=new re;onConfirm(){this.confirm.emit()}onCancel(){this.cancel.emit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=ye({type:r,selectors:[["app-confirm-delete-modal"]],inputs:{message:"message"},outputs:{confirm:"confirm",cancel:"cancel"},decls:9,vars:7,consts:[[3,"closeEvent","submitEvent","title","isOpen"],[1,"confirm-content"],[1,"warning-icon"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12 9V14M12 17.01L12.01 16.9986M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33975 16C2.56995 17.3333 3.53223 19 5.07183 19Z","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"]],template:function(e,n){e&1&&(L(0,"app-basic-modal",0),J(1,"translate"),B("closeEvent",function(){return n.onCancel()})("submitEvent",function(){return n.onConfirm()}),L(2,"div",1)(3,"div",2),wn(),L(4,"svg",3),De(5,"path",4),k()(),Sn(),L(6,"p"),q(7),J(8,"translate"),k()()()),e&2&&(ue("title",Y(1,3,"GLOBAL.PAGES.DELETE_CONFIRM_TITLE"))("isOpen",!0),V(7),ee(n.message||Y(8,5,"GLOBAL.PAGES.DELETE_CONFIRM_MSG")))},dependencies:[pe,_e,Ae,It],styles:[".confirm-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--spacing-m) 0}.warning-icon[_ngcontent-%COMP%]{width:48px;height:48px;background:#e539351a;color:var(--error);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:var(--spacing-m)}.warning-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:28px;height:28px}p[_ngcontent-%COMP%]{margin:0;color:var(--gray-1);font-size:14px;line-height:1.5;max-width:250px}[_nghost-%COMP%] .save-btn{background-color:var(--error)!important}[_nghost-%COMP%] .save-btn:hover{background-color:var(--error)!important}"]})};export{ve as a,mt as b,Gr as c,Kt as d,jn as e,Xr as f,Qr as g,Yn as h,He as i,ei as j,ri as k,ii as l,pe as m,en as n,Xn as o,ai as p,li as q,$e as r,F as s,Ne as t,Ar as u,Pi as v,vt as w,Qo as x,Ae as y,ea as z,_e as A,Lt as B,M as C,Re as D,ne as E,Me as F,nt as G,xe as H,fe as I,dr as J,It as K,xt as L,Rt as M,Mt as N,Nt as O,$i as P,Wa as Q,Ka as R,Ft as S,_t as T,Pt as U,Ot as V,Ir as W,Br as X};