dascom-le-editor 0.0.44 → 0.0.45

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.
@@ -413,10 +413,10 @@ ${sg}`:lg)}throw ag},onCacheKey:ag=>generateFormatCacheKey(eg,gg,ag)}}function g
413
413
  * (c) 2026 kazuya kawaguchi
414
414
  * Released under the MIT License.
415
415
  */const VERSION="11.4.6";function initFeatureFlags(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(getGlobalThis().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(getGlobalThis().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1)}const I18nErrorCodes={UNEXPECTED_RETURN_TYPE:CORE_ERROR_CODES_EXTEND_POINT,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function createI18nError(tg,...eg){return createCompileError(tg,null,process.env.NODE_ENV!=="production"?{messages:errorMessages,args:eg}:void 0)}const errorMessages={[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[I18nErrorCodes.INVALID_ARGUMENT]:"Invalid argument",[I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[I18nErrorCodes.NOT_INSTALLED]:"Need to install with `app.use` function",[I18nErrorCodes.UNEXPECTED_ERROR]:"Unexpected error",[I18nErrorCodes.REQUIRED_VALUE]:"Required in value: {0}",[I18nErrorCodes.INVALID_VALUE]:"Invalid value",[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},TranslateVNodeSymbol=makeSymbol("__translateVNode"),DatetimePartsSymbol=makeSymbol("__datetimeParts"),NumberPartsSymbol=makeSymbol("__numberParts"),EnableEmitter=makeSymbol("__enableEmitter"),DisableEmitter=makeSymbol("__disableEmitter"),SetPluralRulesSymbol=makeSymbol("__setPluralRules"),InejctWithOptionSymbol=makeSymbol("__injectWithOption"),DisposeSymbol=makeSymbol("__dispose"),I18nWarnCodes={FALLBACK_TO_ROOT:CORE_WARN_CODES_EXTEND_POINT,NOT_FOUND_PARENT_SCOPE:CORE_WARN_CODES_EXTEND_POINT+1,IGNORE_OBJ_FLATTEN:CORE_WARN_CODES_EXTEND_POINT+2,DEPRECATE_LEGACY_MODE:CORE_WARN_CODES_EXTEND_POINT+3,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:CORE_WARN_CODES_EXTEND_POINT+4,DUPLICATE_USE_I18N_CALLING:CORE_WARN_CODES_EXTEND_POINT+5},warnMessages={[I18nWarnCodes.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[I18nWarnCodes.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[I18nWarnCodes.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
416
- About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",[I18nWarnCodes.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."};function getWarnMessage(tg,...eg){return format$1(warnMessages[tg],...eg)}function handleFlatJson(tg){if(!isObject$2(tg)||isMessageAST(tg))return tg;for(const eg in tg)if(hasOwn(tg,eg))if(!eg.includes("."))isObject$2(tg[eg])&&handleFlatJson(tg[eg]);else{const gg=eg.split("."),ig=gg.length-1;let ng=tg,og=!1;for(let ag=0;ag<ig;ag++){if(gg[ag]==="__proto__")throw new Error(`unsafe key: ${gg[ag]}`);if(gg[ag]in ng||(ng[gg[ag]]=create$1()),!isObject$2(ng[gg[ag]])){process.env.NODE_ENV!=="production"&&warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN,{key:gg[ag]})),og=!0;break}ng=ng[gg[ag]]}if(og||(isMessageAST(ng)?AST_NODE_PROPS_KEYS.includes(gg[ig])||delete tg[eg]:(ng[gg[ig]]=tg[eg],delete tg[eg])),!isMessageAST(ng)){const ag=ng[gg[ig]];isObject$2(ag)&&handleFlatJson(ag)}}return tg}function getLocaleMessages(tg,eg){const{messages:gg,__i18n:ig,messageResolver:ng,flatJson:og}=eg,ag=isPlainObject$1(gg)?gg:isArray$1(ig)?create$1():{[tg]:create$1()};if(isArray$1(ig)&&ig.forEach(Ig=>{if("locale"in Ig&&"resource"in Ig){const{locale:sg,resource:Cg}=Ig;sg?(ag[sg]=ag[sg]||create$1(),deepCopy(Cg,ag[sg])):deepCopy(Cg,ag)}else isString$2(Ig)&&deepCopy(JSON.parse(Ig),ag)}),ng==null&&og)for(const Ig in ag)hasOwn(ag,Ig)&&handleFlatJson(ag[Ig]);return ag}function getComponentOptions(tg){return tg.type}function adjustI18nResources(tg,eg,gg){let ig=isObject$2(eg.messages)?eg.messages:create$1();"__i18nGlobal"in gg&&(ig=getLocaleMessages(tg.locale.value,{messages:ig,__i18n:gg.__i18nGlobal}));const ng=Object.keys(ig);ng.length&&ng.forEach(og=>{tg.mergeLocaleMessage(og,ig[og])});{if(isObject$2(eg.datetimeFormats)){const og=Object.keys(eg.datetimeFormats);og.length&&og.forEach(ag=>{tg.mergeDateTimeFormat(ag,eg.datetimeFormats[ag])})}if(isObject$2(eg.numberFormats)){const og=Object.keys(eg.numberFormats);og.length&&og.forEach(ag=>{tg.mergeNumberFormat(ag,eg.numberFormats[ag])})}}}function createTextNode(tg){return createVNode(Text,null,tg,0)}function getCurrentInstance(){return getCurrentInstance$1()}const DEVTOOLS_META="__INTLIFY_META__",NOOP_RETURN_ARRAY=()=>[],NOOP_RETURN_FALSE=()=>!1;let composerID=0;function defineCoreMissingHandler(tg){return((eg,gg,ig,ng)=>tg(gg,ig,getCurrentInstance()||void 0,ng))}const getMetaInfo=()=>{const tg=getCurrentInstance();let eg=null;return tg&&(eg=getComponentOptions(tg)[DEVTOOLS_META])?{[DEVTOOLS_META]:eg}:null};function createComposer(tg={}){const{__root:eg,__injectWithOption:gg}=tg,ig=eg===void 0,ng=tg.flatJson,og=inBrowser$1?ref:shallowRef;let ag=isBoolean$1(tg.inheritLocale)?tg.inheritLocale:!0;const Ig=og(eg&&ag?eg.locale.value:isString$2(tg.locale)?tg.locale:DEFAULT_LOCALE$1),sg=og(eg&&ag?eg.fallbackLocale.value:isString$2(tg.fallbackLocale)||isArray$1(tg.fallbackLocale)||isPlainObject$1(tg.fallbackLocale)||tg.fallbackLocale===!1?tg.fallbackLocale:Ig.value),Cg=og(getLocaleMessages(Ig.value,tg)),lg=og(isPlainObject$1(tg.datetimeFormats)?tg.datetimeFormats:{[Ig.value]:{}}),Ag=og(isPlainObject$1(tg.numberFormats)?tg.numberFormats:{[Ig.value]:{}});let cg=eg?eg.missingWarn:isBoolean$1(tg.missingWarn)||isRegExp$1(tg.missingWarn)?tg.missingWarn:!0,rg=eg?eg.fallbackWarn:isBoolean$1(tg.fallbackWarn)||isRegExp$1(tg.fallbackWarn)?tg.fallbackWarn:!0,ug=eg?eg.fallbackRoot:isBoolean$1(tg.fallbackRoot)?tg.fallbackRoot:!0,dg=!!tg.fallbackFormat,bg=isFunction(tg.missing)?tg.missing:null,mg=isFunction(tg.missing)?defineCoreMissingHandler(tg.missing):null,hg=isFunction(tg.postTranslation)?tg.postTranslation:null,pg=eg?eg.warnHtmlMessage:isBoolean$1(tg.warnHtmlMessage)?tg.warnHtmlMessage:!0,fg=!!tg.escapeParameter;const wg=eg?eg.modifiers:isPlainObject$1(tg.modifiers)?tg.modifiers:{};let Gg=tg.pluralRules||eg&&eg.pluralRules,Zg;Zg=(()=>{ig&&setFallbackContext(null);const oa={version:VERSION,locale:Ig.value,fallbackLocale:sg.value,messages:Cg.value,modifiers:wg,pluralRules:Gg,missing:mg===null?void 0:mg,missingWarn:cg,fallbackWarn:rg,fallbackFormat:dg,unresolving:!0,postTranslation:hg===null?void 0:hg,warnHtmlMessage:pg,escapeParameter:fg,messageResolver:tg.messageResolver,messageCompiler:tg.messageCompiler,__meta:{framework:"vue"}};oa.datetimeFormats=lg.value,oa.numberFormats=Ag.value,oa.__datetimeFormatters=isPlainObject$1(Zg)?Zg.__datetimeFormatters:void 0,oa.__numberFormatters=isPlainObject$1(Zg)?Zg.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(oa.__v_emitter=isPlainObject$1(Zg)?Zg.__v_emitter:void 0);const ha=createCoreContext(oa);return ig&&setFallbackContext(ha),ha})(),updateFallbackLocale(Zg,Ig.value,sg.value);function Bg(){return[Ig.value,sg.value,Cg.value,lg.value,Ag.value]}const Wg=computed({get:()=>Ig.value,set:oa=>{Zg.locale=oa,Ig.value=oa}}),$g=computed({get:()=>sg.value,set:oa=>{Zg.fallbackLocale=oa,sg.value=oa,updateFallbackLocale(Zg,Ig.value,oa)}}),Ng=computed(()=>Cg.value),vg=computed(()=>lg.value),Xg=computed(()=>Ag.value);function Vg(){return isFunction(hg)?hg:null}function Mg(oa){hg=oa,Zg.postTranslation=oa}function Rg(){return bg}function Sg(oa){oa!==null&&(mg=defineCoreMissingHandler(oa)),bg=oa,Zg.missing=mg}function Yg(oa,ha){return oa!=="translate"||!ha.resolvedMessage}const xg=(oa,ha,nI,cI,dI,pI)=>{Bg();let Ug;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,ig||(Zg.fallbackContext=eg?getFallbackContext():void 0),Ug=oa(Zg)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,ig||(Zg.fallbackContext=void 0)}if(nI!=="translate exists"&&isNumber$2(Ug)&&Ug===NOT_REOSLVED||nI==="translate exists"&&!Ug){const[La,aI]=ha();if(process.env.NODE_ENV!=="production"&&eg&&isString$2(La)&&Yg(nI,aI)&&(ug&&(isTranslateFallbackWarn(rg,La)||isTranslateMissingWarn(cg,La))&&warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT,{key:La,type:nI})),process.env.NODE_ENV!=="production")){const{__v_emitter:CI}=Zg;CI&&ug&&CI.emit("fallback",{type:nI,key:La,to:"global",groupId:`${nI}:${La}`})}return eg&&ug?cI(eg):dI(La)}else{if(pI(Ug))return Ug;throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE)}};function Og(...oa){return xg(ha=>Reflect.apply(translate$1,null,[ha,...oa]),()=>parseTranslateArgs(...oa),"translate",ha=>Reflect.apply(ha.t,ha,[...oa]),ha=>ha,ha=>isString$2(ha))}function Kg(...oa){const[ha,nI,cI]=oa;if(cI&&!isObject$2(cI))throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);return Og(ha,nI,assign$2({resolvedMessage:!0},cI||{}))}function Dg(...oa){return xg(ha=>Reflect.apply(datetime,null,[ha,...oa]),()=>parseDateTimeArgs(...oa),"datetime format",ha=>Reflect.apply(ha.d,ha,[...oa]),()=>MISSING_RESOLVE_VALUE,ha=>isString$2(ha)||isArray$1(ha))}function Fg(...oa){return xg(ha=>Reflect.apply(number,null,[ha,...oa]),()=>parseNumberArgs(...oa),"number format",ha=>Reflect.apply(ha.n,ha,[...oa]),()=>MISSING_RESOLVE_VALUE,ha=>isString$2(ha)||isArray$1(ha))}function Tg(oa){return oa.map(ha=>isString$2(ha)||isNumber$2(ha)||isBoolean$1(ha)?createTextNode(String(ha)):ha)}const Eg={normalize:Tg,interpolate:oa=>oa,type:"vnode"};function co(...oa){return xg(ha=>{let nI;const cI=ha;try{cI.processor=Eg,nI=Reflect.apply(translate$1,null,[cI,...oa])}finally{cI.processor=null}return nI},()=>parseTranslateArgs(...oa),"translate",ha=>ha[TranslateVNodeSymbol](...oa),ha=>[createTextNode(ha)],ha=>isArray$1(ha))}function da(...oa){return xg(ha=>Reflect.apply(number,null,[ha,...oa]),()=>parseNumberArgs(...oa),"number format",ha=>ha[NumberPartsSymbol](...oa),NOOP_RETURN_ARRAY,ha=>isString$2(ha)||isArray$1(ha))}function ma(...oa){return xg(ha=>Reflect.apply(datetime,null,[ha,...oa]),()=>parseDateTimeArgs(...oa),"datetime format",ha=>ha[DatetimePartsSymbol](...oa),NOOP_RETURN_ARRAY,ha=>isString$2(ha)||isArray$1(ha))}function pa(oa){Gg=oa,Zg.pluralRules=Gg}function eI(oa,ha){return xg(()=>{if(!oa)return!1;const nI=isString$2(ha)?ha:Ig.value,cI=isString$2(ha)?[nI]:fallbackWithLocaleChain(Zg,sg.value,nI);for(let dI=0;dI<cI.length;dI++){const pI=uo(cI[dI]);let Ug=Zg.messageResolver(pI,oa);if(Ug===null&&(Ug=pI[oa]),isMessageAST(Ug)||isMessageFunction(Ug)||isString$2(Ug))return!0}return!1},()=>[oa],"translate exists",nI=>Reflect.apply(nI.te,nI,[oa,ha]),NOOP_RETURN_FALSE,nI=>isBoolean$1(nI))}function Qg(oa){let ha=null;const nI=fallbackWithLocaleChain(Zg,sg.value,Ig.value);for(let cI=0;cI<nI.length;cI++){const dI=Cg.value[nI[cI]]||{},pI=Zg.messageResolver(dI,oa);if(pI!=null){ha=pI;break}}return ha}function Ca(oa){const ha=Qg(oa);return ha??(eg?eg.tm(oa)||{}:{})}function uo(oa){return Cg.value[oa]||{}}function eo(oa,ha){if(ng){const nI={[oa]:ha};for(const cI in nI)hasOwn(nI,cI)&&handleFlatJson(nI[cI]);ha=nI[oa]}Cg.value[oa]=ha,Zg.messages=Cg.value}function no(oa,ha){Cg.value[oa]=Cg.value[oa]||{};const nI={[oa]:ha};if(ng)for(const cI in nI)hasOwn(nI,cI)&&handleFlatJson(nI[cI]);ha=nI[oa],deepCopy(ha,Cg.value[oa]),Zg.messages=Cg.value}function kg(oa){return lg.value[oa]||{}}function Lg(oa,ha){lg.value[oa]=ha,Zg.datetimeFormats=lg.value,clearDateTimeFormat(Zg,oa,ha)}function Pg(oa,ha){lg.value[oa]=assign$2(lg.value[oa]||{},ha),Zg.datetimeFormats=lg.value,clearDateTimeFormat(Zg,oa,ha)}function ua(oa){return Ag.value[oa]||{}}function ya(oa,ha){Ag.value[oa]=ha,Zg.numberFormats=Ag.value,clearNumberFormat(Zg,oa,ha)}function oI(oa,ha){Ag.value[oa]=assign$2(Ag.value[oa]||{},ha),Zg.numberFormats=Ag.value,clearNumberFormat(Zg,oa,ha)}composerID++,eg&&inBrowser$1&&(watch(eg.locale,oa=>{ag&&(Ig.value=oa,Zg.locale=oa,updateFallbackLocale(Zg,Ig.value,sg.value))}),watch(eg.fallbackLocale,oa=>{ag&&(sg.value=oa,Zg.fallbackLocale=oa,updateFallbackLocale(Zg,Ig.value,sg.value))}));const iI={id:composerID,locale:Wg,fallbackLocale:$g,get inheritLocale(){return ag},set inheritLocale(oa){ag=oa,oa&&eg&&(Ig.value=eg.locale.value,sg.value=eg.fallbackLocale.value,updateFallbackLocale(Zg,Ig.value,sg.value))},get availableLocales(){return Object.keys(Cg.value).sort()},messages:Ng,get modifiers(){return wg},get pluralRules(){return Gg||{}},get isGlobal(){return ig},get missingWarn(){return cg},set missingWarn(oa){cg=oa,Zg.missingWarn=cg},get fallbackWarn(){return rg},set fallbackWarn(oa){rg=oa,Zg.fallbackWarn=rg},get fallbackRoot(){return ug},set fallbackRoot(oa){ug=oa},get fallbackFormat(){return dg},set fallbackFormat(oa){dg=oa,Zg.fallbackFormat=dg},get warnHtmlMessage(){return pg},set warnHtmlMessage(oa){pg=oa,Zg.warnHtmlMessage=oa},get escapeParameter(){return fg},set escapeParameter(oa){fg=oa,Zg.escapeParameter=oa},t:Og,getLocaleMessage:uo,setLocaleMessage:eo,mergeLocaleMessage:no,getPostTranslationHandler:Vg,setPostTranslationHandler:Mg,getMissingHandler:Rg,setMissingHandler:Sg,[SetPluralRulesSymbol]:pa};return iI.datetimeFormats=vg,iI.numberFormats=Xg,iI.rt=Kg,iI.te=eI,iI.tm=Ca,iI.d=Dg,iI.n=Fg,iI.getDateTimeFormat=kg,iI.setDateTimeFormat=Lg,iI.mergeDateTimeFormat=Pg,iI.getNumberFormat=ua,iI.setNumberFormat=ya,iI.mergeNumberFormat=oI,iI[InejctWithOptionSymbol]=gg,iI[TranslateVNodeSymbol]=co,iI[DatetimePartsSymbol]=ma,iI[NumberPartsSymbol]=da,process.env.NODE_ENV!=="production"&&(iI[EnableEmitter]=oa=>{Zg.__v_emitter=oa},iI[DisableEmitter]=()=>{Zg.__v_emitter=void 0}),iI}const VUE_I18N_COMPONENT_TYPES="vue-i18n: composer properties",VueDevToolsLabels={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},VueDevToolsPlaceholders={"vue-i18n-resource-inspector":"Search for scopes ..."},VueDevToolsTimelineColors={"vue-i18n-timeline":16764185};let devtoolsApi;async function enableDevTools(tg,eg){return new Promise((gg,ig)=>{try{setupDevtoolsPlugin({id:"vue-devtools-plugin-vue-i18n",label:VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[VUE_I18N_COMPONENT_TYPES],app:tg},ng=>{devtoolsApi=ng,ng.on.visitComponentTree(({componentInstance:ag,treeNode:Ig})=>{updateComponentTreeTags(ag,Ig,eg)}),ng.on.inspectComponent(({componentInstance:ag,instanceData:Ig})=>{ag.__VUE_I18N__&&Ig&&(eg.mode==="legacy"?ag.__VUE_I18N__!==eg.global.__composer&&inspectComposer(Ig,ag.__VUE_I18N__):inspectComposer(Ig,ag.__VUE_I18N__))}),ng.addInspector({id:"vue-i18n-resource-inspector",label:VueDevToolsLabels["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:VueDevToolsPlaceholders["vue-i18n-resource-inspector"]}),ng.on.getInspectorTree(ag=>{ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector"&&registerScope(ag,eg)});const og=new Map;ng.on.getInspectorState(async ag=>{if(ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector")if(ng.unhighlightElement(),inspectScope(ag,eg),ag.nodeId==="global"){if(!og.has(ag.app)){const[Ig]=await ng.getComponentInstances(ag.app);og.set(ag.app,Ig)}ng.highlightElement(og.get(ag.app))}else{const Ig=getComponentInstance$1(ag.nodeId,eg);Ig&&ng.highlightElement(Ig)}}),ng.on.editInspectorState(ag=>{ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector"&&editScope(ag,eg)}),ng.addTimelineLayer({id:"vue-i18n-timeline",label:VueDevToolsLabels["vue-i18n-timeline"],color:VueDevToolsTimelineColors["vue-i18n-timeline"]}),gg(!0)})}catch(ng){console.error(ng),ig(!1)}})}function getI18nScopeLable(tg){return tg.type.name||tg.type.displayName||tg.type.__file||"Anonymous"}function updateComponentTreeTags(tg,eg,gg){const ig=gg.mode==="composition"?gg.global:gg.global.__composer;if(tg&&tg.__VUE_I18N__&&tg.__VUE_I18N__!==ig){const ng={label:`i18n (${getI18nScopeLable(tg)} Scope)`,textColor:0,backgroundColor:16764185};eg.tags.push(ng)}}function inspectComposer(tg,eg){const gg=VUE_I18N_COMPONENT_TYPES;tg.state.push({type:gg,key:"locale",editable:!0,value:eg.locale.value}),tg.state.push({type:gg,key:"availableLocales",editable:!1,value:eg.availableLocales}),tg.state.push({type:gg,key:"fallbackLocale",editable:!0,value:eg.fallbackLocale.value}),tg.state.push({type:gg,key:"inheritLocale",editable:!0,value:eg.inheritLocale}),tg.state.push({type:gg,key:"messages",editable:!1,value:getLocaleMessageValue(eg.messages.value)}),tg.state.push({type:gg,key:"datetimeFormats",editable:!1,value:eg.datetimeFormats.value}),tg.state.push({type:gg,key:"numberFormats",editable:!1,value:eg.numberFormats.value})}function getLocaleMessageValue(tg){const eg={};return Object.keys(tg).forEach(gg=>{const ig=tg[gg];isFunction(ig)&&"source"in ig?eg[gg]=getMessageFunctionDetails(ig):isMessageAST(ig)&&ig.loc&&ig.loc.source?eg[gg]=ig.loc.source:isObject$2(ig)?eg[gg]=getLocaleMessageValue(ig):eg[gg]=ig}),eg}const ESC={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function escape$1(tg){return tg.replace(/[<>"&]/g,escapeChar)}function escapeChar(tg){return ESC[tg]||tg}function getMessageFunctionDetails(tg){return{_custom:{type:"function",display:`<span>ƒ</span> ${tg.source?`("${escape$1(tg.source)}")`:"(?)"}`}}}function registerScope(tg,eg){tg.rootNodes.push({id:"global",label:"Global Scope"});const gg=eg.mode==="composition"?eg.global:eg.global.__composer;for(const[ig,ng]of eg.__instances){const og=eg.mode==="composition"?ng:ng.__composer;gg!==og&&tg.rootNodes.push({id:og.id.toString(),label:`${getI18nScopeLable(ig)} Scope`})}}function getComponentInstance$1(tg,eg){let gg=null;if(tg!=="global"){for(const[ig,ng]of eg.__instances.entries())if(ng.id.toString()===tg){gg=ig;break}}return gg}function getComposer$2(tg,eg){if(tg==="global")return eg.mode==="composition"?eg.global:eg.global.__composer;{const gg=Array.from(eg.__instances.values()).find(ig=>ig.id.toString()===tg);return gg?eg.mode==="composition"?gg:gg.__composer:null}}function inspectScope(tg,eg){const gg=getComposer$2(tg.nodeId,eg);return gg&&(tg.state=makeScopeInspectState(gg)),null}function makeScopeInspectState(tg){const eg={},gg="Locale related info",ig=[{type:gg,key:"locale",editable:!0,value:tg.locale.value},{type:gg,key:"fallbackLocale",editable:!0,value:tg.fallbackLocale.value},{type:gg,key:"availableLocales",editable:!1,value:tg.availableLocales},{type:gg,key:"inheritLocale",editable:!0,value:tg.inheritLocale}];eg[gg]=ig;const ng="Locale messages info",og=[{type:ng,key:"messages",editable:!1,value:getLocaleMessageValue(tg.messages.value)}];eg[ng]=og;{const ag="Datetime formats info",Ig=[{type:ag,key:"datetimeFormats",editable:!1,value:tg.datetimeFormats.value}];eg[ag]=Ig;const sg="Datetime formats info",Cg=[{type:sg,key:"numberFormats",editable:!1,value:tg.numberFormats.value}];eg[sg]=Cg}return eg}function addTimelineEvent(tg,eg){if(devtoolsApi){let gg;eg&&"groupId"in eg&&(gg=eg.groupId,delete eg.groupId),devtoolsApi.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:tg,groupId:gg,time:Date.now(),meta:{},data:eg||{},logType:tg==="compile-error"?"error":tg==="fallback"||tg==="missing"?"warning":"default"}})}}function editScope(tg,eg){const gg=getComposer$2(tg.nodeId,eg);if(gg){const[ig]=tg.path;ig==="locale"&&isString$2(tg.state.value)?gg.locale.value=tg.state.value:ig==="fallbackLocale"&&(isString$2(tg.state.value)||isArray$1(tg.state.value)||isObject$2(tg.state.value))?gg.fallbackLocale.value=tg.state.value:ig==="inheritLocale"&&isBoolean$1(tg.state.value)&&(gg.inheritLocale=tg.state.value)}}function convertComposerOptions(tg){const eg=isString$2(tg.locale)?tg.locale:DEFAULT_LOCALE$1,gg=isString$2(tg.fallbackLocale)||isArray$1(tg.fallbackLocale)||isPlainObject$1(tg.fallbackLocale)||tg.fallbackLocale===!1?tg.fallbackLocale:eg,ig=isFunction(tg.missing)?tg.missing:void 0,ng=isBoolean$1(tg.silentTranslationWarn)||isRegExp$1(tg.silentTranslationWarn)?!tg.silentTranslationWarn:!0,og=isBoolean$1(tg.silentFallbackWarn)||isRegExp$1(tg.silentFallbackWarn)?!tg.silentFallbackWarn:!0,ag=isBoolean$1(tg.fallbackRoot)?tg.fallbackRoot:!0,Ig=!!tg.formatFallbackMessages,sg=isPlainObject$1(tg.modifiers)?tg.modifiers:{},Cg=tg.pluralizationRules,lg=isFunction(tg.postTranslation)?tg.postTranslation:void 0,Ag=isString$2(tg.warnHtmlInMessage)?tg.warnHtmlInMessage!=="off":!0,cg=!!tg.escapeParameterHtml,rg=isBoolean$1(tg.sync)?tg.sync:!0;let ug=tg.messages;if(isPlainObject$1(tg.sharedMessages)){const wg=tg.sharedMessages;ug=Object.keys(wg).reduce((Zg,yg)=>{const Bg=Zg[yg]||(Zg[yg]={});return assign$2(Bg,wg[yg]),Zg},ug||{})}const{__i18n:dg,__root:bg,__injectWithOption:mg}=tg,hg=tg.datetimeFormats,pg=tg.numberFormats,fg=tg.flatJson;return{locale:eg,fallbackLocale:gg,messages:ug,flatJson:fg,datetimeFormats:hg,numberFormats:pg,missing:ig,missingWarn:ng,fallbackWarn:og,fallbackRoot:ag,fallbackFormat:Ig,modifiers:sg,pluralRules:Cg,postTranslation:lg,warnHtmlMessage:Ag,escapeParameter:cg,messageResolver:tg.messageResolver,inheritLocale:rg,__i18n:dg,__root:bg,__injectWithOption:mg}}function createVueI18n(tg={}){const eg=createComposer(convertComposerOptions(tg)),{__extender:gg}=tg,ig={id:eg.id,get locale(){return eg.locale.value},set locale(ng){eg.locale.value=ng},get fallbackLocale(){return eg.fallbackLocale.value},set fallbackLocale(ng){eg.fallbackLocale.value=ng},get messages(){return eg.messages.value},get datetimeFormats(){return eg.datetimeFormats.value},get numberFormats(){return eg.numberFormats.value},get availableLocales(){return eg.availableLocales},get missing(){return eg.getMissingHandler()},set missing(ng){eg.setMissingHandler(ng)},get silentTranslationWarn(){return isBoolean$1(eg.missingWarn)?!eg.missingWarn:eg.missingWarn},set silentTranslationWarn(ng){eg.missingWarn=isBoolean$1(ng)?!ng:ng},get silentFallbackWarn(){return isBoolean$1(eg.fallbackWarn)?!eg.fallbackWarn:eg.fallbackWarn},set silentFallbackWarn(ng){eg.fallbackWarn=isBoolean$1(ng)?!ng:ng},get modifiers(){return eg.modifiers},get formatFallbackMessages(){return eg.fallbackFormat},set formatFallbackMessages(ng){eg.fallbackFormat=ng},get postTranslation(){return eg.getPostTranslationHandler()},set postTranslation(ng){eg.setPostTranslationHandler(ng)},get sync(){return eg.inheritLocale},set sync(ng){eg.inheritLocale=ng},get warnHtmlInMessage(){return eg.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(ng){eg.warnHtmlMessage=ng!=="off"},get escapeParameterHtml(){return eg.escapeParameter},set escapeParameterHtml(ng){eg.escapeParameter=ng},get pluralizationRules(){return eg.pluralRules||{}},__composer:eg,t(...ng){return Reflect.apply(eg.t,eg,[...ng])},rt(...ng){return Reflect.apply(eg.rt,eg,[...ng])},te(ng,og){return eg.te(ng,og)},tm(ng){return eg.tm(ng)},getLocaleMessage(ng){return eg.getLocaleMessage(ng)},setLocaleMessage(ng,og){eg.setLocaleMessage(ng,og)},mergeLocaleMessage(ng,og){eg.mergeLocaleMessage(ng,og)},d(...ng){return Reflect.apply(eg.d,eg,[...ng])},getDateTimeFormat(ng){return eg.getDateTimeFormat(ng)},setDateTimeFormat(ng,og){eg.setDateTimeFormat(ng,og)},mergeDateTimeFormat(ng,og){eg.mergeDateTimeFormat(ng,og)},n(...ng){return Reflect.apply(eg.n,eg,[...ng])},getNumberFormat(ng){return eg.getNumberFormat(ng)},setNumberFormat(ng,og){eg.setNumberFormat(ng,og)},mergeNumberFormat(ng,og){eg.mergeNumberFormat(ng,og)}};return ig.__extender=gg,process.env.NODE_ENV!=="production"&&(ig.__enableEmitter=ng=>{const og=eg;og[EnableEmitter]&&og[EnableEmitter](ng)},ig.__disableEmitter=()=>{const ng=eg;ng[DisableEmitter]&&ng[DisableEmitter]()}),ig}function defineMixin(tg,eg,gg){return{beforeCreate(){const ig=getCurrentInstance();if(!ig)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ng=this.$options;if(ng.i18n){const og=ng.i18n;if(ng.__i18n&&(og.__i18n=ng.__i18n),og.__root=eg,this===this.$root)this.$i18n=mergeToGlobal(tg,og);else{og.__injectWithOption=!0,og.__extender=gg.__vueI18nExtend,this.$i18n=createVueI18n(og);const ag=this.$i18n;ag.__extender&&(ag.__disposer=ag.__extender(this.$i18n))}}else if(ng.__i18n)if(this===this.$root)this.$i18n=mergeToGlobal(tg,ng);else{this.$i18n=createVueI18n({__i18n:ng.__i18n,__injectWithOption:!0,__extender:gg.__vueI18nExtend,__root:eg});const og=this.$i18n;og.__extender&&(og.__disposer=og.__extender(this.$i18n))}else this.$i18n=tg;ng.__i18nGlobal&&adjustI18nResources(eg,ng,ng),this.$t=(...og)=>this.$i18n.t(...og),this.$rt=(...og)=>this.$i18n.rt(...og),this.$te=(og,ag)=>this.$i18n.te(og,ag),this.$d=(...og)=>this.$i18n.d(...og),this.$n=(...og)=>this.$i18n.n(...og),this.$tm=og=>this.$i18n.tm(og),gg.__setInstance(ig,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$i18n){const ig=getCurrentInstance();if(!ig)return;const ng=this.$i18n;ig.__VUE_I18N__=ng.__composer;const og=this.__v_emitter=createEmitter();ng.__enableEmitter&&ng.__enableEmitter(og),og.on("*",addTimelineEvent)}},unmounted(){const ig=getCurrentInstance();if(!ig)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ng=this.$i18n;process.env.NODE_ENV!=="production"&&ig.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",addTimelineEvent),delete this.__v_emitter),ng&&(ng.__disableEmitter&&ng.__disableEmitter(),delete ig.__VUE_I18N__)),ng&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,ng!=null&&ng.__disposer&&(ng.__disposer(),delete ng.__disposer,delete ng.__extender),gg.__deleteInstance(ig),delete this.$i18n)}}}function mergeToGlobal(tg,eg){tg.locale=eg.locale||tg.locale,tg.fallbackLocale=eg.fallbackLocale||tg.fallbackLocale,tg.missing=eg.missing||tg.missing,tg.silentTranslationWarn=eg.silentTranslationWarn||tg.silentFallbackWarn,tg.silentFallbackWarn=eg.silentFallbackWarn||tg.silentFallbackWarn,tg.formatFallbackMessages=eg.formatFallbackMessages||tg.formatFallbackMessages,tg.postTranslation=eg.postTranslation||tg.postTranslation,tg.warnHtmlInMessage=eg.warnHtmlInMessage||tg.warnHtmlInMessage,tg.escapeParameterHtml=eg.escapeParameterHtml||tg.escapeParameterHtml,tg.sync=eg.sync||tg.sync,tg.__composer[SetPluralRulesSymbol](eg.pluralizationRules||tg.pluralizationRules);const gg=getLocaleMessages(tg.locale,{messages:eg.messages,__i18n:eg.__i18n});return Object.keys(gg).forEach(ig=>tg.mergeLocaleMessage(ig,gg[ig])),eg.datetimeFormats&&Object.keys(eg.datetimeFormats).forEach(ig=>tg.mergeDateTimeFormat(ig,eg.datetimeFormats[ig])),eg.numberFormats&&Object.keys(eg.numberFormats).forEach(ig=>tg.mergeNumberFormat(ig,eg.numberFormats[ig])),tg}const baseFormatProps={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:tg=>tg==="parent"||tg==="global",default:"parent"},i18n:{type:Object}};function getInterpolateArg({slots:tg},eg){return eg.length===1&&eg[0]==="default"?(tg.default?tg.default():[]).reduce((ig,ng)=>[...ig,...ng.type===Fragment?ng.children:[ng]],[]):eg.reduce((gg,ig)=>{const ng=tg[ig];return ng&&(gg[ig]=ng()),gg},create$1())}function getFragmentableTag(){return Fragment}const TranslationImpl=defineComponent({name:"i18n-t",props:assign$2({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:tg=>isNumber$2(tg)||!isNaN(tg)}},baseFormatProps),setup(tg,eg){const{slots:gg,attrs:ig}=eg,ng=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return()=>{const og=()=>{const sg=Object.keys(gg).filter(Ag=>Ag[0]!=="_"),Cg=create$1();tg.locale&&(Cg.locale=tg.locale),tg.plural!==void 0&&(Cg.plural=isString$2(tg.plural)?+tg.plural:tg.plural);const lg=getInterpolateArg(eg,sg);return ng[TranslateVNodeSymbol](tg.keypath,lg,Cg)},ag=assign$2(create$1(),ig),Ig=isString$2(tg.tag)||isObject$2(tg.tag)?tg.tag:getFragmentableTag();return isObject$2(Ig)?h$2(Ig,ag,{default:og}):h$2(Ig,ag,og())}}}),Translation=TranslationImpl;function isVNode(tg){return isArray$1(tg)&&!isString$2(tg[0])}function renderFormatter(tg,eg,gg,ig){const{slots:ng,attrs:og}=eg;return()=>{const ag=()=>{const Cg={part:!0};let lg=create$1();tg.locale&&(Cg.locale=tg.locale),isString$2(tg.format)?Cg.key=tg.format:isObject$2(tg.format)&&(isString$2(tg.format.key)&&(Cg.key=tg.format.key),lg=Object.keys(tg.format).reduce((rg,ug)=>gg.includes(ug)?assign$2(create$1(),rg,{[ug]:tg.format[ug]}):rg,create$1()));const Ag=ig(tg.value,Cg,lg);let cg=[Cg.key];return isArray$1(Ag)?cg=Ag.map((rg,ug)=>{const dg=ng[rg.type],bg=dg?dg({[rg.type]:rg.value,index:ug,parts:Ag}):[rg.value];return isVNode(bg)&&(bg[0].key=`${rg.type}-${ug}`),bg}):isString$2(Ag)&&(cg=[Ag]),cg},Ig=assign$2(create$1(),og),sg=isString$2(tg.tag)||isObject$2(tg.tag)?tg.tag:getFragmentableTag();return isObject$2(sg)?h$2(sg,Ig,{default:ag}):h$2(sg,Ig,ag())}}const NumberFormatImpl=defineComponent({name:"i18n-n",props:assign$2({value:{type:Number,required:!0},format:{type:[String,Object]}},baseFormatProps),setup(tg,eg){const gg=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return renderFormatter(tg,eg,NUMBER_FORMAT_OPTIONS_KEYS,(...ig)=>gg[NumberPartsSymbol](...ig))}}),NumberFormat=NumberFormatImpl;function getComposer$1(tg,eg){const gg=tg;if(tg.mode==="composition")return gg.__getInstance(eg)||tg.global;{const ig=gg.__getInstance(eg);return ig!=null?ig.__composer:tg.global.__composer}}function vTDirective(tg){const eg=ag=>{process.env.NODE_ENV!=="production"&&warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:Ig,value:sg}=ag;if(!Ig||!Ig.$)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const Cg=getComposer$1(tg,Ig.$),lg=parseValue(sg);return[Reflect.apply(Cg.t,Cg,[...makeParams(lg)]),Cg]};return{created:(ag,Ig)=>{const[sg,Cg]=eg(Ig);inBrowser$1&&(ag.__i18nWatcher=watch(Cg.locale,()=>{Ig.instance&&Ig.instance.$forceUpdate()})),ag.__composer=Cg,ag.textContent=sg},unmounted:ag=>{inBrowser$1&&ag.__i18nWatcher&&(ag.__i18nWatcher(),ag.__i18nWatcher=void 0,delete ag.__i18nWatcher),ag.__composer&&(ag.__composer=void 0,delete ag.__composer)},beforeUpdate:(ag,{value:Ig})=>{if(ag.__composer){const sg=ag.__composer,Cg=parseValue(Ig);ag.textContent=Reflect.apply(sg.t,sg,[...makeParams(Cg)])}},getSSRProps:ag=>{const[Ig]=eg(ag);return{textContent:Ig}}}}function parseValue(tg){if(isString$2(tg))return{path:tg};if(isPlainObject$1(tg)){if(!("path"in tg))throw createI18nError(I18nErrorCodes.REQUIRED_VALUE,"path");return tg}else throw createI18nError(I18nErrorCodes.INVALID_VALUE)}function makeParams(tg){const{path:eg,locale:gg,args:ig,choice:ng,plural:og}=tg,ag={},Ig=ig||{};return isString$2(gg)&&(ag.locale=gg),isNumber$2(ng)&&(ag.plural=ng),isNumber$2(og)&&(ag.plural=og),[eg,Ig,ag]}function apply(tg,eg,...gg){const ig=isPlainObject$1(gg[0])?gg[0]:{};(isBoolean$1(ig.globalInstall)?ig.globalInstall:!0)&&([Translation.name,"I18nT"].forEach(og=>tg.component(og,Translation)),[NumberFormat.name,"I18nN"].forEach(og=>tg.component(og,NumberFormat)),[DatetimeFormat.name,"I18nD"].forEach(og=>tg.component(og,DatetimeFormat))),tg.directive("t",vTDirective(eg))}const I18nInjectionKey=makeSymbol("global-vue-i18n");function createI18n(tg={}){const eg=__VUE_I18N_LEGACY_API__&&isBoolean$1(tg.legacy)?tg.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&eg&&warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_LEGACY_MODE));const gg=isBoolean$1(tg.globalInjection)?tg.globalInjection:!0,ig=new Map,[ng,og]=createGlobal(tg,eg),ag=makeSymbol(process.env.NODE_ENV!=="production"?"vue-i18n":"");function Ig(Ag){return ig.get(Ag)||null}function sg(Ag,cg){ig.set(Ag,cg)}function Cg(Ag){ig.delete(Ag)}const lg={get mode(){return __VUE_I18N_LEGACY_API__&&eg?"legacy":"composition"},async install(Ag,...cg){if(process.env.NODE_ENV!=="production"&&(Ag.__VUE_I18N__=lg),Ag.__VUE_I18N_SYMBOL__=ag,Ag.provide(Ag.__VUE_I18N_SYMBOL__,lg),isPlainObject$1(cg[0])){const dg=cg[0];lg.__composerExtend=dg.__composerExtend,lg.__vueI18nExtend=dg.__vueI18nExtend}let rg=null;!eg&&gg&&(rg=injectGlobalFields(Ag,lg.global)),__VUE_I18N_FULL_INSTALL__&&apply(Ag,lg,...cg),__VUE_I18N_LEGACY_API__&&eg&&Ag.mixin(defineMixin(og,og.__composer,lg));const ug=Ag.unmount;if(Ag.unmount=()=>{rg&&rg(),lg.dispose(),ug()},process.env.NODE_ENV!=="production"){if(!await enableDevTools(Ag,lg))throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const bg=createEmitter();if(eg){const mg=og;mg.__enableEmitter&&mg.__enableEmitter(bg)}else{const mg=og;mg[EnableEmitter]&&mg[EnableEmitter](bg)}bg.on("*",addTimelineEvent)}},get global(){return og},dispose(){ng.stop()},__instances:ig,__getInstance:Ig,__setInstance:sg,__deleteInstance:Cg};return lg}function useI18n(tg={}){const eg=getCurrentInstance();if(eg==null)throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);if(!eg.isCE&&eg.appContext.app!=null&&!eg.appContext.app.__VUE_I18N_SYMBOL__)throw createI18nError(I18nErrorCodes.NOT_INSTALLED);const gg=getI18nInstance(eg),ig=getGlobalComposer(gg),ng=getComponentOptions(eg),og=getScope$1(tg,ng);if(og==="global")return adjustI18nResources(ig,tg,ng),ig;if(og==="parent"){let sg=getComposer(gg,eg,tg.__useComponent);return sg==null&&(process.env.NODE_ENV!=="production"&&warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE)),sg=ig),sg}if(og==="isolated"){if(gg.mode!=="composition")throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const sg=gg,Cg=assign$2({},tg),lg=getComposer(gg,eg);Cg.__root=lg||ig;const Ag=createComposer(Cg);sg.__composerExtend&&(Ag[DisposeSymbol]=sg.__composerExtend(Ag));let cg=null;if(process.env.NODE_ENV!=="production"){cg=createEmitter();const ug=Ag;ug[EnableEmitter]&&ug[EnableEmitter](cg),cg.on("*",addTimelineEvent)}return getCurrentScope()&&onScopeDispose(()=>{if(process.env.NODE_ENV!=="production"){cg&&cg.off("*",addTimelineEvent);const dg=Ag;dg[DisableEmitter]&&dg[DisableEmitter]()}const ug=Ag[DisposeSymbol];ug&&(ug(),delete Ag[DisposeSymbol])}),Ag}const ag=gg;let Ig=ag.__getInstance(eg);if(Ig==null){const sg=assign$2({},tg);"__i18n"in ng&&(sg.__i18n=ng.__i18n),ig&&(sg.__root=ig),Ig=createComposer(sg),ag.__composerExtend&&(Ig[DisposeSymbol]=ag.__composerExtend(Ig)),setupLifeCycle(ag,eg,Ig),ag.__setInstance(eg,Ig)}else process.env.NODE_ENV!=="production"&&og==="local"&&warn(getWarnMessage(I18nWarnCodes.DUPLICATE_USE_I18N_CALLING));return Ig}function createGlobal(tg,eg){const gg=effectScope(),ig=__VUE_I18N_LEGACY_API__&&eg?gg.run(()=>createVueI18n(tg)):gg.run(()=>createComposer(tg));if(ig==null)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);return[gg,ig]}function getI18nInstance(tg){const eg=inject(tg.isCE?I18nInjectionKey:tg.appContext.app.__VUE_I18N_SYMBOL__);if(!eg)throw createI18nError(tg.isCE?I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE:I18nErrorCodes.UNEXPECTED_ERROR);return eg}function getScope$1(tg,eg){return isEmptyObject$1(tg)?"__i18n"in eg?"local":"global":tg.useScope?tg.useScope:"local"}function getGlobalComposer(tg){return tg.mode==="composition"?tg.global:tg.global.__composer}function getComposer(tg,eg,gg=!1){let ig=null;const ng=eg.root;let og=getParentComponentInstance(eg,gg);for(;og!=null;){const ag=tg;if(tg.mode==="composition")ig=ag.__getInstance(og);else if(__VUE_I18N_LEGACY_API__){const Ig=ag.__getInstance(og);Ig!=null&&(ig=Ig.__composer,gg&&ig&&!ig[InejctWithOptionSymbol]&&(ig=null))}if(ig!=null||ng===og)break;og=og.parent}return ig}function getParentComponentInstance(tg,eg=!1){return tg==null?null:eg&&tg.vnode.ctx||tg.parent}function setupLifeCycle(tg,eg,gg){let ig=null;onMounted(()=>{if(process.env.NODE_ENV!=="production"){eg.__VUE_I18N__=gg,ig=createEmitter();const ng=gg;ng[EnableEmitter]&&ng[EnableEmitter](ig),ig.on("*",addTimelineEvent)}},eg),onUnmounted(()=>{const ng=gg;process.env.NODE_ENV!=="production"&&(ig&&ig.off("*",addTimelineEvent),ng[DisableEmitter]&&ng[DisableEmitter](),delete eg.__VUE_I18N__),tg.__deleteInstance(eg);const og=ng[DisposeSymbol];og&&(og(),delete ng[DisposeSymbol])},eg)}const globalExportProps=["locale","fallbackLocale","availableLocales"],globalExportMethods=["t","rt","d","n","tm","te"];function injectGlobalFields(tg,eg){const gg=Object.create(null);return globalExportProps.forEach(ng=>{const og=Object.getOwnPropertyDescriptor(eg,ng);if(!og)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ag=isRef$1(og.value)?{get(){return og.value.value},set(Ig){og.value.value=Ig}}:{get(){return og.get&&og.get()}};Object.defineProperty(gg,ng,ag)}),tg.config.globalProperties.$i18n=gg,globalExportMethods.forEach(ng=>{const og=Object.getOwnPropertyDescriptor(eg,ng);if(!og||!og.value)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);Object.defineProperty(tg.config.globalProperties,`$${ng}`,og)}),()=>{delete tg.config.globalProperties.$i18n,globalExportMethods.forEach(ng=>{delete tg.config.globalProperties[`$${ng}`]})}}const DatetimeFormatImpl=defineComponent({name:"i18n-d",props:assign$2({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},baseFormatProps),setup(tg,eg){const gg=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return renderFormatter(tg,eg,DATETIME_FORMAT_OPTIONS_KEYS,(...ig)=>gg[DatetimePartsSymbol](...ig))}}),DatetimeFormat=DatetimeFormatImpl;if(initFeatureFlags(),registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const tg=getGlobalThis();tg.__INTLIFY__=!0,setDevToolsHook(tg.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const dateTimeFormats={"zh-CN":{short:{year:"numeric",month:"2-digit",day:"2-digit"}},"en-US":{short:{year:"numeric",month:"2-digit",day:"2-digit"}},"ja-JP":{short:{year:"numeric",month:"2-digit",day:"2-digit"}}},numberFormats={"zh-CN":{decimal:{style:"decimal",maximumFractionDigits:2}},"en-US":{decimal:{style:"decimal",maximumFractionDigits:2}},"ja-JP":{decimal:{style:"decimal",maximumFractionDigits:2}}},DEFAULT_LOCALE="zh-CN";function normalizeLocale(tg){const eg=String(tg??"").trim().replaceAll("_","-").toLowerCase();return eg==="en"||eg.startsWith("en-")?"en-US":eg==="zh"||eg.startsWith("zh-")?"zh-CN":eg==="ja"||eg.startsWith("ja-")?"ja-JP":DEFAULT_LOCALE}function detectBrowserLocale(tg=(eg=>(eg=globalThis.navigator)==null?void 0:eg.languages)()??[]){const gg=tg.find(ig=>/^(zh|en|ja)(-|_|$)/i.test(ig));return normalizeLocale(gg)}function cloneValue(tg){return Array.isArray(tg)?tg.map(cloneValue):tg!==null&&typeof tg=="object"?mergeTrees(tg):tg}function isTree(tg){return tg!==null&&typeof tg=="object"&&!Array.isArray(tg)}function mergeTrees(tg,eg){const gg=Object.fromEntries(Object.entries(tg).map(([ig,ng])=>[ig,cloneValue(ng)]));if(!eg)return gg;for(const[ig,ng]of Object.entries(eg)){const og=gg[ig];gg[ig]=isTree(og)&&isTree(ng)?mergeTrees(og,ng):cloneValue(ng)}return gg}const actions$2={confirm:"确认",cancel:"取消",close:"关闭",save:"保存",delete:"删除",continue:"继续",refresh:"刷新",select:"选择",create:"新建",custom:"自定义",set:"设置"},dialog$2={prompt:"提示",defaultContent:"这是默认对话框内容"},feedback$2={notice:"提示",setSuccess:"设置成功"},prompts$5={enter:"请输入"},locale$2={zhCN:"简体中文",enUS:"English"},tabs$5={closingTitle:"你正在关闭标签页",closePrompt:"是否要关闭标签页[{name}]的内容?",savePrompt:"是否要保存标签页[{name}]的内容?",closeAll:"关闭所有标签页"},commonUi$2={clipArrow:"箭头",clipMark:"标志",clipPunctuation:"标点符号",clipSequence:"序号",color:"颜色",opacity:"透明度",canvasUnavailable:"无法获取 canvas 上下文",addElement:"添加元素",selectRelatedId:"选择关联的元素ID",relatedName:"关联元素名:",none:"无",textSlice:"文本截取",moveUp:"上移",moveDown:"下移",start:"开始",end:"结束",cropImage:"裁剪图片",keepAspectRatio:"保持图片宽高比例",crop:"裁剪",renamePrompt:"重命名请输入",invalidProperty:"属性值错误",customPlaceholder:"请自定义",databaseView:"数据库视图",databasePath:"数据库路径",dataTable:"数据表",totalRows:"共 {count} 条",sequence:"序号",upgrade:"升级",requestAuthorization:"申请授权",generateAuthorization:"生成授权信息",importAuthorizationFile:"导入授权文件",authorizationFilePath:"授权文件地址:",companyName:"公司名称",enterCompanyName:"输入公司名称",contact:"联系人",enterContact:"输入联系人",phone:"联系电话",enterPhone:"输入联系电话",email:"邮箱",enterEmail:"输入邮箱",submit:"提交",sendQrCode:"请发送二维码截图给运营人员,来生成授权文件",regenerateAuthorization:"重新生成授权信息",companyNameRequired:"请输入公司名称",contactRequired:"请输入联系人",phoneRequired:"请输入联系电话",phoneInvalid:"请输入正确联系电话",emailRequired:"请输入邮箱",emailInvalid:"请输入正确邮箱",authorizationUpgradeSuccess:"授权升级成功",preview:"预览",clickPreview:"点击查看预览",fill:"填充",backgroundFill:"背景填充",stroke:"描边",strokeStyle:"描边样式",strokeWidth:"描边线宽",dashLength:"线段长度",dash:"线段",gapLength:"间隔长度",gap:"间隔",sdkVersion:"SDK 版本",newFile:"新建文件",doNotSave:"不保存"},newStep$2={preview:"预览:",labelSize:"标签尺寸",millimeters:"毫米",invalidDimensions:"错误,页面尺寸有误,请调整标签尺寸,边距,间距等",newFile:"新建文件",openFile:"打开文件",openTemplate:"打开模板",oneLabelPerPage:"每页一个标签",multipleLabelsPerPage:"每页多个标签",rows:"行:",columns:"列:",printOrder:"打印顺序:",startCorner:"起始边角:",preferredDirection:"首选方向:",leftTop:"左上",leftBottom:"左下",rightTop:"右上",rightBottom:"右下",horizontal:"水平",vertical:"垂直",hasMarginsQuestion:"页面是否包含侧边距?",hasMargins:"有,标签页面包含侧边距",noMargins:"无,标签不含有侧边距",marginSize:"侧边距尺寸",left:"左:",right:"右:",top:"上:",bottom:"下:",rectangle:"矩形",roundedRectangle:"圆角矩形",ellipse:"椭圆",pageWidth:"页面宽度:",pageHeight:"页面高度:",printDirection:"打印方向",portrait:"纵向",landscape:"横向",width:"宽度:",height:"高度:",manual:"手动设置",spacing:"间距",horizontalSpacing:"水平间距:",verticalSpacing:"垂直间距:",margins:"边距:",fileNamePrompt:"请输入文件名:"},zhCommon={actions:actions$2,dialog:dialog$2,feedback:feedback$2,prompts:prompts$5,locale:locale$2,tabs:tabs$5,commonUi:commonUi$2,newStep:newStep$2},file$5="文件",edit$2="编辑",print$2="打印(P)",database$2="数据库",databaseView$2="数据库视图",refreshDatabase$2="刷新数据库",labelSettings$5="标签属性设置",fileWithKey$2="文件(F)",editWithKey$2="编辑(E)",viewWithKey$2="视图(V)",toolsWithKey$2="工具(T)",helpWithKey$2="帮助(H)",open$3="打开(O)",save$2="保存(S)",saveAs$3="另存为(A)",downloadTemplate$2="下载模板",uploadCloud$2="上传到我的云模板",undo$2="撤销(Z)",redo$2="恢复(R)",copy$6="复制(C)",paste$2="粘贴(V)",cut$2="剪切(X)",exportImage$2="导出图片",objectProps$2="对象属性",zoom$2="缩放",zoomIn$2="放大",zoomOut$2="缩小",zoomAuto$2="自动缩放",ruler$2="标尺",grid$2="网格",visible$2="可见",helpIndex$2="帮助索引",about$2="关于LabelEditor",closeAll$2="关闭所有标签页",minimize$2="最小化",restore$2="还原",maximize$2="最大化",close$2="关闭",zhMenu={file:file$5,edit:edit$2,print:print$2,database:database$2,databaseView:databaseView$2,refreshDatabase:refreshDatabase$2,labelSettings:labelSettings$5,fileWithKey:fileWithKey$2,editWithKey:editWithKey$2,viewWithKey:viewWithKey$2,toolsWithKey:toolsWithKey$2,helpWithKey:helpWithKey$2,new:"新建(N)",open:open$3,save:save$2,saveAs:saveAs$3,downloadTemplate:downloadTemplate$2,uploadCloud:uploadCloud$2,undo:undo$2,redo:redo$2,copy:copy$6,paste:paste$2,cut:cut$2,delete:"删除(D)",exportImage:exportImage$2,objectProps:objectProps$2,zoom:zoom$2,zoomIn:zoomIn$2,zoomOut:zoomOut$2,zoomAuto:zoomAuto$2,ruler:ruler$2,grid:grid$2,visible:visible$2,helpIndex:helpIndex$2,about:about$2,closeAll:closeAll$2,minimize:minimize$2,restore:restore$2,maximize:maximize$2,close:close$2},remaining$2={upperLayer:"上联",lowerLayer:"下联",doubleClickText:"请双击输入内容",imageLoadFailed:"图片加载失败",emptyCannotSave:"空文件不能保存",emptyCannotExport:"空文件不能导出图片",unnamed:"未命名",savedToMyTemplates:"已保存到我的模板",missingCloudId:"云模板 ID 丢失,无法保存",saveSuccess:"保存成功",saveFileFailed:"保存文件失败",fileNotWritable:"文件不可写",saveFile:"保存文件",labelFilter:"标签(*.LEX)",savedFile:"保存文件成功",thumbnailFailed:"生成缩略图失败",saveImage:"保存图片",imageFilter:"图片(*.png)",saveFailed:"保存失败",alreadyOpen:"该文件已打开",openFailed:"文件打开失败",cloudTemplate:"云模板",closeAllTabs:"关闭所有标签页",newFileNumber:"新建文件{number}",serverError:"服务器异常",serverConnectError:"连接服务器异常,请查看网络是否正常",methodUnavailable:"方法 {method} 未实现或不可用",barcodeVersion:"版本",barcodeGrid:"列数x行数",barcodeRows:"行数",barcodeColumns:"列数"},label$2="标签",newLabel$2="新建标签",cloudLabel$2="云标签",labelFileFilter$2="标签(*.LEX)",labelSettings$4="标签属性设置",labelEditSettings$2="标签编辑设置",labelSize$2="标签尺寸",labelWidth$2="标签宽度",labelHeight$2="标签高度",labelShape$2="标签形状",labelsPerPage$2="每页标签数",oneLabelPerPage$2="每页一个标签",multipleLabelsPerPage$2="每页多个标签",pageHasMargins$2="有,标签页面包含侧边距",pageHasNoMargins$2="无,标签不含有侧边距",labelSideMargin$2="标签侧边距",varnishLayer$2="光油图层",varnishPanel$2="光油配置面板",specialist$2={laser:{title:"激光配置",selectPreset:"选择预设参数",deletedWarning:'激光配置"{deletedNames}"已被删除,使用它的对象将恢复默认参数',limitWarning:"超出激光配置上限({maxPresets}),部分新预设未导入",fields:{repeatTimes:"打标次数",scanSpeed:"激光速度",jumpSpeed:"跳转速度",power:"功率",frequency:"频率",pulseWidth:"脉宽",openLightDelay:"开光延迟",closeLightDelay:"关光延迟",endDelay:"结束延迟",cornerDelay:"拐角延迟",jumpDelay:"跳转延迟"}},varnish:{none:"无",portraitOutline:"人像轮廓",enabled:"有",colorOverlay:"彩色覆盖",fullOverlay:"全覆盖"}},templateName$5="标签模板_{name}",instantEditPrint$2="即编即打印",instantScanPrint$2="即扫即打印",linkedContentReadonly$2="有关联来源无法编辑内容",qrCodeContent$2="QR Code内容",defaults$2={layer:"图层 {sequence}"},objectNames$2={text:"文本",textname:"名字",image:"图片",rect:"矩形",triangle:"三角形",table:"表格",circle:"圆形",line:"直线",barcode:"条码",barcode2d:"二维码",counter:"日期计数器",group:"组合"},image$2={settings:"图片设置",keepRatio:"保持图片长宽比例",flipHorizontal:"水平翻转",flipVertical:"垂直翻转",grayscale:"灰度",sharpen:"黑白图清晰度优化",anchorAlignment:"锚点对齐方式",anchorSettings:"锚点设置",alignment:"对齐方式:",crop:"图片裁剪",replace:"更换图片",selectFile:"选择文件",selectClipArt:"选择剪贴图",selectTitle:"选择图片",fileType:"图片",selectFailed:"选择图片失败",selectRequired:"请选择图片",unsupportedType:"不支持的文件类型",processingFailed:"文件处理失败: {detail}",canvasCreateFailed:"画布创建失败",temporaryCanvasCreateFailed:"临时画布创建失败",decodeFailed:"图片解码失败",readFailed:"文件读取失败",align:{leftTop:"左上角",topCenter:"顶部中心",rightTop:"右上角",leftCenter:"左边中心",center:"中心",rightCenter:"右边中心",leftBottom:"左下角",bottomCenter:"底部中心",rightBottom:"右下角"}},wizard$2={previous:"上一步",next:"下一步",finish:"完成",welcome:"欢迎大家使用Label Editor",chooseTask:"请你选择需要做的任务",labelsPerPageStep:"每页标签数--指定纸张属性",sideMarginStep:"侧边距--指定标签侧边距",shapeStep:"标签形状--指定标签形状",spacingStep:"模板尺寸和间距--指定模板尺寸和间距"},tabs$4={page:"页面",layoutOrder:"布局与顺序",shape:"形状",margin:"边距",spacing:"间距"},shell$2={objectList:"对象列表",rename:"重命名",settings:"设置",fillStroke:"填充描边",backgroundColor:"背景色",backgroundImage:"背景图片",replace:"更换",clear:"清除",cover:"铺满",borderPattern:"描边图案",layers:"图层",renameLayer:"重命名图层",layerNamePlaceholder:"请输入图层名称",noStroke:"无描边",patternNumber:"图案 {number}",replaceImage:"更换图片",viewBarcode:"查看一维码内容",enterBarcode:"请输入一维码内容",viewQrCode:"查看二维码内容",enterQrCode:"请输入二维码内容",maxLayers:"最多支持 {count} 个图层",deleteLayer:"删除图层",deleteLayerConfirm:"确定要删除「{name}」吗?",updateSuccess:"更新成功",untitled:"未命名",uploadCloudSuccess:"上传到我的云模板成功",uploadFailed:"上传失败",cloudIdMissing:"云模板 ID 丢失,无法下载",downloadTemplate:"下载模板",downloadSuccess:"下载成功",downloadFailed:"下载失败",createCanvasFirst:"请先创建一个画布",undefinedAction:"未定义的操作: {action}",fileOpenFailed:"文件打开失败",openFile:"打开文件",textPrompt:"请双击输入文字",text:"文本",selectTool:"选择(V)",panTool:`移动画布(H)
417
- 按住空格可临时移动`,print:"打印",saveFile:"保存文件",newFile:"新建文件",rect:"矩形",triangle:"三角形",circle:"圆形",line:"线",textTool:"文字",table:"表格",barcode:"条码",qrCode:"二维码",picture:"图片",counter:"日期计数器",variable:"变量",database:"数据库",databaseView:"数据库视图",refreshDatabase:"刷新数据库",firstRecord:"第一条记录",previousRecord:"上一条记录",nextRecord:"下一条记录",lastRecord:"最后一条记录",name:"名字"},feature$2={dateFormat:"日期格式",addVariable:"新增变量",importImage:"导入图片",imagePath:"图片路径: {path}",externalInputChineseFormatUnsupported:"外部输入不支持含有中文格式",copyId:"复制ID",cell:"单元格",cellIndex:"单元格 {index}",cellPosition:"{row} 行 {column} 列"},copy$5={"532cd474d1":"起始值","911dd68193":"序号长度","6078bac61a":"增量",de61aa8e1c:"预览","8e35f2b9f3":"十六进制","68c1392da2":"数值写入",fe992493bf:"字符写入","9d2601c843":"格式",b6fed9af83:"日期","4a570eab6a":"日作为数字且没有前导零",ec27904da4:"日作为数字且有前导零",d741bd3dfc:"日名称为缩写的本地化","792c34e70d":"周一",c3405710e0:"周日","50e83fe09b":"日名称为非缩写的本地化",dded7a4890:"星期一",d9636d4a90:"星期日","6c386a81be":"月作为数字且没有前导零",bf35a6483e:"月作为数字且有前导零",dc2d993af6:"月称为缩写的本地化","5b17a06153":"十月",dfef764f33:"十一月","7d0ccf16f3":"月称为非缩写的本地化.","76a16869e0":"年份为两位数字","617517584f":"年份为四位数字.","3de91c80ce":"小时且没有前导零","71b6771bc7":"显示","5ebd64c830":"小时且有前导零",e1f6bc2677:"分钟且没有前导零.","472e0cbc27":"分钟且有前导零.",ff4b6ad7d6:"秒且没有前导零.","28ba129d4e":"秒且有前导零.",bcba353efd:"毫秒且没有前导零.","273d567f9c":"毫秒且有前导零.","7f5c242027":"使用 上午",e4780194e0:"下午 显示.a","312ba03084":"将被",e214ee22dd:"上午","3fbe3edfc5":"或者","1dfaab6548":"下午","3d88094723":"替代.",fb2a23dc16:"时区","46930b1ccf":"例如",fa747dfcf3:"计数类型","7a4dc8253f":"数字","8bdf1760f0":"字母","83a8f475e3":"填充字符","90a2f53d3a":"尾填充字符","8b0db67871":"当前值","29e1d3d9f0":"增量值","39a52f2df5":"数据位","57f15bb774":"采用零填充",a3ccf702c5:"数据源","700c93d882":"外部输入支持的格式",c8d09cf955:"默认",f4dbbc63a5:"数据库","7bb7346e15":"外部输入",ef258428cd:"计数器",a74a77bc7f:"文本、计时器、日期组合","2d0366384f":"二维码",b1085310cb:"条码",b418ca60d4:"变量","382f4b5559":"请选择","6a954390e3":"表",ad3ee64830:"列","6bd6e44cbc":"选择关联的元素ID","850e2546c3":"关联条码ID",a424315147:"关联后,不能编辑内容","20bc33c7ba":"关联条码:","4b822f835d":"关联二维码ID",e5346f5159:"关联二维码:","9f6e8dba88":"请选择Key","8cef5cc20b":"导入变量","1cebaf21fb":"导入json文件",a25ed32d21:"清除数据",b56d9ac6c5:"确认","4d0b4688c7":"取消","184a9c08ac":"是否清除所有变量",cce10d7b40:"文件导入失败","609d669223":"存在重复的 key,请修改后再确认",b088a3713a:"选择字体",f670b2adc0:"加粗",af5a2c8bff:"斜体",c85de9e58a:"删除线","9bc18ae51e":"下划线",f4d3dab8e0:"文字","07f568dada":"文字颜色",c9c7630d2c:"文字字体","34098a184f":"文字字号","0fa1d514a5":"一维码类型","0c5279c8ae":"一维码文字设置","576ccdb1f1":"字号",f7af330e8f:"二维码类型",cc288c9c8e:"二维码纠错等级",d480c424f8:"二维码值文本设置","4e3a37477c":"显示二维码值","89c41faeea":"模块像素",fb54f6f959:"长宽比例","020af9c5f4":"龙贝码纠错等级","204ca8e993":"QrCode纠错等级","3276f518f5":"按图片长宽比例导入",a41a0c9fd2:"选择剪贴图","446d1e1236":"请选择图片","18104edf89":"选择图片",be8da62ea1:"图片",e423d0e04e:"选择图片失败","17ad570546":"打印计数器",d84a63fd99:"打印日期",bc90a3957d:"键盘输入","5585698377":"下午 显示","9978b8a700":"圆角","579f280b5d":"行数","150074c2e8":"表格","2a2b777ae4":"行","1082f4e944":"直线","12c09d0341":"虚线","72077749f7":"无","83100cd7eb":"上方插行","5d80537a38":"下方插行",bdc0e99b04:"删除当前行",eee6dec245:"删除当前列","199013c934":"左侧插列","45989304d7":"右侧插列",cee8bcba20:"字体大小",b534c8636c:"行高",c86f1b361f:"字距","6d93ab3fba":"文字间距","5937a2c95a":"文字位置","413f8db65f":"左对齐","5be891c540":"居中对齐","70fe40dec2":"右对齐",a9d35ab0a6:"顶部","435b2d8982":"底部","443bde0f4c":"文字对齐","989d1affa0":"版本","0965832369":"日期偏移","6f14c2641c":"年",d9b59879f3:"月","15917f3b32":"日","86ec1ca75c":"宽度",eea51aa44b:"高度",cb165f5ca1:"旋转角度","5268436bdf":"水平居中对齐","8a9aed3516":"水平平均对齐",ceb66a60f6:"顶部对齐","2cd89127c4":"垂直居中对齐","5d2078e01c":"底部对齐",f8735a4579:"垂直平均对齐","3ffbbe25d5":"画布水平居中","7cd8c94d34":"画布垂直居中","9474979eb3":"区域水平居中","73678a1e04":"区域垂直居中","41654e0268":"基础信息","067f80c392":"列数","68d87ec64c":"列宽",db63adaf4c:"双击单元格后编辑","046ca7db56":"上边",b3ceb938fb:"右边","343b383f1d":"下边","8566923239":"左边","68238a67bc":"字体色","97c8abc1b8":"圆弧半径(正值向上弯,负值向下弯)","83cc65b13f":"单行","918a0c837b":"段落","7d9b9e079f":"圆弧排列","0a84571f3e":"尺寸模式","1b95368e24":"倍数拉伸","2c06479d15":"自由拉伸","3d17580e06":"一维码高度(mm)","4e28691ff7":"一维码高","5f397a20e8":"条码与文本间距(mm)","60a48b31d9":"一维码与文字间距"},zhEditor={remaining:remaining$2,label:label$2,newLabel:newLabel$2,cloudLabel:cloudLabel$2,labelFileFilter:labelFileFilter$2,labelSettings:labelSettings$4,labelEditSettings:labelEditSettings$2,labelSize:labelSize$2,labelWidth:labelWidth$2,labelHeight:labelHeight$2,labelShape:labelShape$2,labelsPerPage:labelsPerPage$2,oneLabelPerPage:oneLabelPerPage$2,multipleLabelsPerPage:multipleLabelsPerPage$2,pageHasMargins:pageHasMargins$2,pageHasNoMargins:pageHasNoMargins$2,labelSideMargin:labelSideMargin$2,varnishLayer:varnishLayer$2,varnishPanel:varnishPanel$2,specialist:specialist$2,templateName:templateName$5,instantEditPrint:instantEditPrint$2,instantScanPrint:instantScanPrint$2,linkedContentReadonly:linkedContentReadonly$2,qrCodeContent:qrCodeContent$2,defaults:defaults$2,objectNames:objectNames$2,image:image$2,wizard:wizard$2,tabs:tabs$4,shell:shell$2,feature:feature$2,copy:copy$5},title$8="打印",preview$2="打印预览",file$4="打印文件:",range$3="打印范围",copies$2="打印份数",content$2="打印内容",toFile$2="打印到文件",direction$2="打印方向",order$2="打印顺序",counter$5="打印计数器",date$5="打印日期",cancel$2="取消打印",connecting$5="正在与打印机连接",connectingPrinter$2="正在连接打印机....",printing$2="正在打印中....",complete$2="打印完成",pageComplete$2="打印第{page}页完成",maximumRows$2="页码范围最大可打印行数为:{rows}行",rewind$2="回卷",separateLayers$2="分图层打印",multipleLabels$2="多标签打印",sendTemplate$2="发送模板",selectDriver$2="选择驱动",advancedOptions$2="高级选项",paperSavingMode$2="省纸模式",enabled$2="开启",disabled$2="关闭",serialCount$2="序列号数量",startRecord$2="开始记录",endRecord$2="结束记录",pageRange$2="页码范围",rangeExample$2="例如:1-3,8,10 格式",copyCount$2="份数",template$2="模板",templateName$4="模板名称",currentAssociations$2="当前关联:",sheetRows$2="{sheet} 表有 {rows} 行数据;",driver$2="驱动:",task$2="任务:",taskComplete$2="任务完成",success$2="成功:",failed$2="失败:",progress$2="进度:",firstPage$2="第一页",previousPage$2="上一页",currentPage$2="当前页",nextPage$2="下一页",lastPage$2="最后一页",firstImage$2="第一张",previousImage$2="上一张",currentImage$2="当前图片",nextImage$2="下一张",lastImage$2="最后一张",pageSummary$2="第 {current}/{totalPages} 页,共 {total} 张",previewGenerating$2="正在生成打印预览...",previewFailed$2="生成打印预览失败",saveTemplateFile$2="保存模板文件",templateFileFilter$2="模板文件",templateSaved$2="模板保存成功",templateSent$2="发送模板成功",errors$2={connectFailed:"连接打印机失败",tidReadFailed:"读取 TID 失败",pageFailed:"打印第 {page} 页失败",templateSendFailed:"发送模板失败",missingDriver:"请选择驱动",emptyCanvas:"空画布不能打印或预览",missingTemplateName:"请输入模板名称",startAfterEnd:"开始页码不能大于结束页码",rangeExceeded:"超过最大打印页码范围",invalidPage:"无效的页码",invalidPageFormat:"页码格式不正确",invalidDriverResponse:"获取不到 JSON 返回"},zhPrint={title:title$8,preview:preview$2,file:file$4,range:range$3,copies:copies$2,content:content$2,toFile:toFile$2,direction:direction$2,order:order$2,counter:counter$5,date:date$5,continue:"继续打印",cancel:cancel$2,connecting:connecting$5,connectingPrinter:connectingPrinter$2,printing:printing$2,complete:complete$2,pageComplete:pageComplete$2,maximumRows:maximumRows$2,rewind:rewind$2,separateLayers:separateLayers$2,multipleLabels:multipleLabels$2,sendTemplate:sendTemplate$2,selectDriver:selectDriver$2,default:"默认",advancedOptions:advancedOptions$2,paperSavingMode:paperSavingMode$2,enabled:enabled$2,disabled:disabled$2,serialCount:serialCount$2,startRecord:startRecord$2,endRecord:endRecord$2,pageRange:pageRange$2,rangeExample:rangeExample$2,copyCount:copyCount$2,template:template$2,templateName:templateName$4,currentAssociations:currentAssociations$2,sheetRows:sheetRows$2,driver:driver$2,task:task$2,taskComplete:taskComplete$2,success:success$2,failed:failed$2,progress:progress$2,firstPage:firstPage$2,previousPage:previousPage$2,currentPage:currentPage$2,nextPage:nextPage$2,lastPage:lastPage$2,firstImage:firstImage$2,previousImage:previousImage$2,currentImage:currentImage$2,nextImage:nextImage$2,lastImage:lastImage$2,pageSummary:pageSummary$2,previewGenerating:previewGenerating$2,previewFailed:previewFailed$2,saveTemplateFile:saveTemplateFile$2,templateFileFilter:templateFileFilter$2,templateSaved:templateSaved$2,templateSent:templateSent$2,errors:errors$2},title$7="数据库",type$2="数据库类型",name$2="数据库名字",view$2="数据库视图",path$2="数据库路径:",serverAddress$2="数据库服务器地址",serverPort$2="数据库服务器端口",userName$2="数据库用户名",password$2="数据库用户密码",select$2="选择数据库",connect$2="连接",serverUrl$2="服务器 URL",filePath$2="文件路径",serverAddressPlaceholder$2="服务器地址",serverPortPlaceholder$2="服务器端口",selectFile$2="选择文件",sheet$2="表:",column$2="列:",hex$2="十六进制",numericWrite$2="数值写入",characterWrite$2="字符写入",deleteCharacters$2="删除字符",sheetInstructions$2="选择工作表,然后指定数据在该工作表上的排列方式",previewRows$2="预览(10 行)",selectedSheets$2="你已选择以下表",addAnotherPrompt$2="您是否需要继续添加其他表",addAnotherYes$2="是的,我需要选择另一个表",addAnotherNo$2="不,我已选择完成",selectFailed$2="选择数据库失败",connecting$4="正在连接数据库中",connectionSuccess$2="数据库连接成功",connectionFailed$5="数据库连接失败",prompts$4={excelFile:"请选择 Excel 文件",dbFile:"请选择 db 文件",serverAddress:"请输入数据库服务器地址",serverPort:"请输入数据库服务器端口",name:"请输入数据库名",userName:"请输入数据库用户名",password:"请输入数据库用户密码"},zhDatabase={title:title$7,type:type$2,name:name$2,view:view$2,path:path$2,serverAddress:serverAddress$2,serverPort:serverPort$2,userName:userName$2,password:password$2,select:select$2,connect:connect$2,serverUrl:serverUrl$2,filePath:filePath$2,serverAddressPlaceholder:serverAddressPlaceholder$2,serverPortPlaceholder:serverPortPlaceholder$2,selectFile:selectFile$2,sheet:sheet$2,column:column$2,hex:hex$2,numericWrite:numericWrite$2,characterWrite:characterWrite$2,deleteCharacters:deleteCharacters$2,sheetInstructions:sheetInstructions$2,previewRows:previewRows$2,selectedSheets:selectedSheets$2,addAnotherPrompt:addAnotherPrompt$2,addAnotherYes:addAnotherYes$2,addAnotherNo:addAnotherNo$2,selectFailed:selectFailed$2,connecting:connecting$4,connectionSuccess:connectionSuccess$2,connectionFailed:connectionFailed$5,prompts:prompts$4},title$6="射频标签",safeArea$2="安全区",counter$4="计数器",settings$2="RFID标签设置",production$2="RFID标签制作",uhfPrint$2="UHF-RFID打印",protocol$2="RFID标签协议标准",readOffset$2="RFID标签识读偏移",writeContent$2="标签写入内容",tid$2="标签信息区(TID)",longbeiContent$2="龙贝码内容",longbeiErrorCorrection$2="龙贝码纠错等级",guojun$2="国军",databaseSource$2="数据库",status$2="状态",power$2="功率",readPower$2="读取功率",writePower$2="写入功率",getCurrentValue$2="获取设备当前值",crcValidation$2="RFID数据带CRC校验",commandPassword$2="口令",oldCommandPassword$2="旧口令",newCommandPassword$2="新口令",enterOldCommandPassword$2="输入旧口令",enterNewCommandPassword$2="输入新口令",accessPassword$2="访问密码",oldPassword$2="旧密码",newPassword$2="新密码",manualInput$2="人工输入",enterEightDigitPassword$2="请输入8位密码",savePasswordToFile$2="保存密码到文件",regionPermissions$2="区域权限设置",epcRegion$2="编码区(EPC)",userRegion$2="用户区(User)",reservedRegion$2="保留区(Reserved)",lock$2="锁定",permanentLock$2="永久锁定",neverLock$2="永不锁定",changeKillPassword$2="修改Kill密码",killPassword$2="Kill密码",paddingMethod$2="补位方式",defaultPadding$2="默认",padStart$3="前补",padEnd$2="后补",dataSource$2="数据源",hexadecimal$2="十六进制",text$2="文本",date$4="日期",sequenceGenerator$2="序号生成器",enterData$2="请输入数据",minimumPaddingDigits$2="最小补位位数",readWrite$2="可读可写",readOnly$2="可读不可写",configureMemoryProperties$2="配置存储区属性",configureSecurityMode$2="配置安全模式",noAuthentication$2="不需要认证",authenticationWithoutSecureCommunication$2="需要认证,不需要安全通信",authenticationWithSecureCommunication$2="需要认证,需要安全通信",unsavedSwitchConfirm$2="有未保存的设置项,是否要继续切换?",deviceDetectionFailed$2="设备检测失败,错误码:{code},错误信息:{detail}",noPrinterFound$2="没有枚举到打印机",connectionFailed$4="连接失败,错误码:{code},错误信息:{detail}",connectedTo$2="连接到:{device}",oldAndNewPasswordRequired$2="新密码和旧密码不能为空",savePasswordSuccess$2="保存密码成功",savePasswordFailed$2="保存密码失败",passwordRequired$2="密码不能为空",oldPasswordEightDigits$2="旧密码长度必须是8位",newPasswordEightDigits$2="新密码长度必须是8位",killPasswordEightDigits$2="Kill密码长度必须是8位",oldCommandPasswordEightDigits$2="旧口令长度必须是8位",newCommandPasswordEightDigits$2="新口令长度必须是8位",newCommandRequiredForAccessChange$2="修改访问新密码,必须填写新口令",oldCommandRequiredForAccessChange$2="修改访问新密码,必须填写旧口令",changeKillPasswordConfirm$2="是否确定要修改Kill密码?",paddingMultipleOfFour$2="补位数据位数必须是4的倍数",setFailedWithDetail$2="设置失败:{detail}",getFailedWithDetail$2="获取失败:{detail}",zhRfid={title:title$6,safeArea:safeArea$2,counter:counter$4,settings:settings$2,production:production$2,uhfPrint:uhfPrint$2,protocol:protocol$2,readOffset:readOffset$2,writeContent:writeContent$2,tid:tid$2,longbeiContent:longbeiContent$2,longbeiErrorCorrection:longbeiErrorCorrection$2,guojun:guojun$2,databaseSource:databaseSource$2,status:status$2,power:power$2,readPower:readPower$2,writePower:writePower$2,getCurrentValue:getCurrentValue$2,crcValidation:crcValidation$2,commandPassword:commandPassword$2,oldCommandPassword:oldCommandPassword$2,newCommandPassword:newCommandPassword$2,enterOldCommandPassword:enterOldCommandPassword$2,enterNewCommandPassword:enterNewCommandPassword$2,accessPassword:accessPassword$2,oldPassword:oldPassword$2,newPassword:newPassword$2,manualInput:manualInput$2,enterEightDigitPassword:enterEightDigitPassword$2,savePasswordToFile:savePasswordToFile$2,regionPermissions:regionPermissions$2,epcRegion:epcRegion$2,userRegion:userRegion$2,reservedRegion:reservedRegion$2,lock:lock$2,permanentLock:permanentLock$2,neverLock:neverLock$2,changeKillPassword:changeKillPassword$2,killPassword:killPassword$2,paddingMethod:paddingMethod$2,defaultPadding:defaultPadding$2,padStart:padStart$3,padEnd:padEnd$2,dataSource:dataSource$2,hexadecimal:hexadecimal$2,text:text$2,date:date$4,sequenceGenerator:sequenceGenerator$2,enterData:enterData$2,minimumPaddingDigits:minimumPaddingDigits$2,readWrite:readWrite$2,readOnly:readOnly$2,configureMemoryProperties:configureMemoryProperties$2,configureSecurityMode:configureSecurityMode$2,noAuthentication:noAuthentication$2,authenticationWithoutSecureCommunication:authenticationWithoutSecureCommunication$2,authenticationWithSecureCommunication:authenticationWithSecureCommunication$2,unsavedSwitchConfirm:unsavedSwitchConfirm$2,deviceDetectionFailed:deviceDetectionFailed$2,noPrinterFound:noPrinterFound$2,connectionFailed:connectionFailed$4,connectedTo:connectedTo$2,oldAndNewPasswordRequired:oldAndNewPasswordRequired$2,savePasswordSuccess:savePasswordSuccess$2,savePasswordFailed:savePasswordFailed$2,passwordRequired:passwordRequired$2,oldPasswordEightDigits:oldPasswordEightDigits$2,newPasswordEightDigits:newPasswordEightDigits$2,killPasswordEightDigits:killPasswordEightDigits$2,oldCommandPasswordEightDigits:oldCommandPasswordEightDigits$2,newCommandPasswordEightDigits:newCommandPasswordEightDigits$2,newCommandRequiredForAccessChange:newCommandRequiredForAccessChange$2,oldCommandRequiredForAccessChange:oldCommandRequiredForAccessChange$2,changeKillPasswordConfirm:changeKillPasswordConfirm$2,paddingMultipleOfFour:paddingMultipleOfFour$2,setFailedWithDetail:setFailedWithDetail$2,getFailedWithDetail:getFailedWithDetail$2},invalidPageSize$2="页面尺寸有误,请调整标签尺寸,边距,间距等",pageExceedsSettings$2="错误,超出设置的页面,请调整标签尺寸,边距,间距等",emptyCanvas$2="空画布不能打印或预览",printFailed$2="打印第{page}页失败",pageRangeExceeded$2="超过最大打印页码范围",printerUnavailable$2="没有枚举到打印机",printerConnectionFailed$2="连接不上打印机",databaseSelectionFailed$2="选择数据库失败",networkTimeout$2="请求超时,请检查网络后重试",unknown$2="操作失败,请重试",unknownWithCode$2="操作失败(错误码:{code}),请重试",zhErrors={invalidPageSize:invalidPageSize$2,pageExceedsSettings:pageExceedsSettings$2,emptyCanvas:emptyCanvas$2,printFailed:printFailed$2,pageRangeExceeded:pageRangeExceeded$2,printerUnavailable:printerUnavailable$2,printerConnectionFailed:printerConnectionFailed$2,databaseSelectionFailed:databaseSelectionFailed$2,networkTimeout:networkTimeout$2,unknown:unknown$2,unknownWithCode:unknownWithCode$2},actions$1={confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",delete:"Delete",continue:"Continue",refresh:"Refresh",select:"Select",create:"New",custom:"Custom",set:"Set"},dialog$1={prompt:"Prompt",defaultContent:"Dialog content"},feedback$1={notice:"Notice",setSuccess:"Set successfully"},prompts$3={enter:"Please enter"},locale$1={zhCN:"Simplified Chinese",enUS:"English"},tabs$3={closingTitle:"You are closing a label tab",closePrompt:"Close the contents of label tab [{name}]?",savePrompt:"Save the contents of label tab [{name}]?",closeAll:"Close all label tabs"},commonUi$1={clipArrow:"Arrows",clipMark:"Symbols",clipPunctuation:"Punctuation",clipSequence:"Numbers",color:"Color",opacity:"Opacity",canvasUnavailable:"Unable to access the canvas context",addElement:"Add element",selectRelatedId:"Select a related element ID",relatedName:"Related element:",none:"None",textSlice:"Extract text",moveUp:"Move up",moveDown:"Move down",start:"Start",end:"End",cropImage:"Crop image",keepAspectRatio:"Keep image aspect ratio",crop:"Crop",renamePrompt:"Enter a new name",invalidProperty:"Invalid property value",customPlaceholder:"Add custom content",databaseView:"Database view",databasePath:"Database path",dataTable:"Data table",totalRows:"{count} rows",sequence:"No.",upgrade:"Upgrade",requestAuthorization:"Request authorization",generateAuthorization:"Generate authorization information",importAuthorizationFile:"Import authorization file",authorizationFilePath:"Authorization file path:",companyName:"Company name",enterCompanyName:"Enter company name",contact:"Contact",enterContact:"Enter contact",phone:"Phone",enterPhone:"Enter phone number",email:"Email",enterEmail:"Enter email",submit:"Submit",sendQrCode:"Send a screenshot of the QR code to the operations team to generate an authorization file",regenerateAuthorization:"Regenerate authorization information",companyNameRequired:"Enter a company name",contactRequired:"Enter a contact",phoneRequired:"Enter a phone number",phoneInvalid:"Enter a valid phone number",emailRequired:"Enter an email address",emailInvalid:"Enter a valid email address",authorizationUpgradeSuccess:"Authorization upgraded successfully",preview:"Preview",clickPreview:"Click to preview",fill:"Fill",backgroundFill:"Background fill",stroke:"Stroke",strokeStyle:"Stroke style",strokeWidth:"Stroke width",dashLength:"Dash length",dash:"Dash",gapLength:"Gap length",gap:"Gap",sdkVersion:"SDK Version",newFile:"New file",doNotSave:"Don't save"},newStep$1={preview:"Preview:",labelSize:"Label size",millimeters:"mm",invalidDimensions:"Invalid page dimensions. Adjust the label size, margins, or spacing.",newFile:"New file",openFile:"Open file",openTemplate:"Open template",oneLabelPerPage:"One label per page",multipleLabelsPerPage:"Multiple labels per page",rows:"Rows:",columns:"Columns:",printOrder:"Print order:",startCorner:"Start corner:",preferredDirection:"Preferred direction:",leftTop:"Top left",leftBottom:"Bottom left",rightTop:"Top right",rightBottom:"Bottom right",horizontal:"Horizontal",vertical:"Vertical",hasMarginsQuestion:"Does the page include margins?",hasMargins:"Yes, the label page includes margins",noMargins:"No, the label has no margins",marginSize:"Margin size",left:"Left:",right:"Right:",top:"Top:",bottom:"Bottom:",rectangle:"Rectangle",roundedRectangle:"Rounded rectangle",ellipse:"Ellipse",pageWidth:"Page width:",pageHeight:"Page height:",printDirection:"Print direction",portrait:"Portrait",landscape:"Landscape",width:"Width:",height:"Height:",manual:"Set manually",spacing:"Spacing",horizontalSpacing:"Horizontal spacing:",verticalSpacing:"Vertical spacing:",margins:"Margins:",fileNamePrompt:"Enter file name:"},enCommon={actions:actions$1,dialog:dialog$1,feedback:feedback$1,prompts:prompts$3,locale:locale$1,tabs:tabs$3,commonUi:commonUi$1,newStep:newStep$1},file$3="File",edit$1="Edit",print$1="Print (P)",database$1="Database",databaseView$1="Database view",refreshDatabase$1="Refresh database",labelSettings$3="Label settings",fileWithKey$1="File (F)",editWithKey$1="Edit (E)",viewWithKey$1="View (V)",toolsWithKey$1="Tools (T)",helpWithKey$1="Help (H)",open$2="Open (O)",save$1="Save (S)",saveAs$2="Save as (A)",downloadTemplate$1="Download template",uploadCloud$1="Upload to My Cloud Templates",undo$1="Undo (Z)",redo$1="Redo (R)",copy$4="Copy (C)",paste$1="Paste (V)",cut$1="Cut (X)",exportImage$1="Export image",objectProps$1="Object properties",zoom$1="Zoom",zoomIn$1="Zoom in",zoomOut$1="Zoom out",zoomAuto$1="Auto zoom",ruler$1="Ruler",grid$1="Grid",visible$1="Visible",helpIndex$1="Help index",about$1="About Label Editor",closeAll$1="Close all tabs",minimize$1="Minimize",restore$1="Restore",maximize$1="Maximize",close$1="Close",enMenu={file:file$3,edit:edit$1,print:print$1,database:database$1,databaseView:databaseView$1,refreshDatabase:refreshDatabase$1,labelSettings:labelSettings$3,fileWithKey:fileWithKey$1,editWithKey:editWithKey$1,viewWithKey:viewWithKey$1,toolsWithKey:toolsWithKey$1,helpWithKey:helpWithKey$1,new:"New (N)",open:open$2,save:save$1,saveAs:saveAs$2,downloadTemplate:downloadTemplate$1,uploadCloud:uploadCloud$1,undo:undo$1,redo:redo$1,copy:copy$4,paste:paste$1,cut:cut$1,delete:"Delete (D)",exportImage:exportImage$1,objectProps:objectProps$1,zoom:zoom$1,zoomIn:zoomIn$1,zoomOut:zoomOut$1,zoomAuto:zoomAuto$1,ruler:ruler$1,grid:grid$1,visible:visible$1,helpIndex:helpIndex$1,about:about$1,closeAll:closeAll$1,minimize:minimize$1,restore:restore$1,maximize:maximize$1,close:close$1},remaining$1={upperLayer:"Upper label",lowerLayer:"Lower label",doubleClickText:"Double-click to enter content",imageLoadFailed:"Image failed to load",emptyCannotSave:"An empty file cannot be saved",emptyCannotExport:"An empty file cannot be exported",unnamed:"Untitled",savedToMyTemplates:"Saved to My Templates",missingCloudId:"Cloud template ID is missing; unable to save",saveSuccess:"Saved successfully",saveFileFailed:"Failed to save file",fileNotWritable:"File is not writable",saveFile:"Save file",labelFilter:"Label (*.LEX)",savedFile:"File saved successfully",thumbnailFailed:"Failed to generate thumbnail",saveImage:"Save image",imageFilter:"Image (*.png)",saveFailed:"Save failed",alreadyOpen:"This file is already open",openFailed:"Failed to open file",cloudTemplate:"Cloud template",closeAllTabs:"Close all tabs",newFileNumber:"New file {number}",serverError:"Server error",serverConnectError:"Server connect error",methodUnavailable:"Method {method} is not implemented or unavailable",barcodeVersion:"Version",barcodeGrid:"Columns x rows",barcodeRows:"Rows",barcodeColumns:"Columns"},label$1="Label",newLabel$1="New label",cloudLabel$1="Cloud label",labelFileFilter$1="Labels (*.LEX)",labelSettings$2="Label settings",labelEditSettings$1="Label editing settings",labelSize$1="Label size",labelWidth$1="Label width",labelHeight$1="Label height",labelShape$1="Label shape",labelsPerPage$1="Labels per page",oneLabelPerPage$1="One label per page",multipleLabelsPerPage$1="Multiple labels per page",pageHasMargins$1="Yes, the label page includes margins",pageHasNoMargins$1="No, the label has no margins",labelSideMargin$1="Label side margin",varnishLayer$1="Varnish layer",varnishPanel$1="Varnish settings panel",specialist$1={laser:{title:"Laser settings",selectPreset:"Select a preset",deletedWarning:'Laser configuration "{deletedNames}" was deleted. Objects using it will return to the default parameters.',limitWarning:"The laser configuration limit ({maxPresets}) was exceeded. Some new presets were not imported.",fields:{repeatTimes:"Marking repetitions",scanSpeed:"Laser speed",jumpSpeed:"Jump speed",power:"Power",frequency:"Frequency",pulseWidth:"Pulse width",openLightDelay:"Laser-on delay",closeLightDelay:"Laser-off delay",endDelay:"End delay",cornerDelay:"Corner delay",jumpDelay:"Jump delay"}},varnish:{none:"None",portraitOutline:"Portrait outline",enabled:"On",colorOverlay:"Color overlay",fullOverlay:"Full overlay"}},templateName$3="Label template {name}",instantEditPrint$1="Edit and print instantly",instantScanPrint$1="Scan and print instantly",linkedContentReadonly$1="Content with a linked source cannot be edited",qrCodeContent$1="QR Code content",defaults$1={layer:"Layer {sequence}"},objectNames$1={text:"Text",textname:"Name",image:"Image",rect:"Rectangle",triangle:"Triangle",table:"Table",circle:"Circle",line:"Line",barcode:"Barcode",barcode2d:"QR code",counter:"Date counter",group:"Group"},image$1={settings:"Image settings",keepRatio:"Keep image aspect ratio",flipHorizontal:"Flip horizontally",flipVertical:"Flip vertically",grayscale:"Grayscale",sharpen:"Optimize monochrome clarity",anchorAlignment:"Anchor alignment",anchorSettings:"Anchor settings",alignment:"Alignment: ",crop:"Crop image",replace:"Replace image",selectFile:"Select file",selectClipArt:"Select clip art",selectTitle:"Select image",fileType:"Image",selectFailed:"Failed to select image",selectRequired:"Please select an image",unsupportedType:"Unsupported file type",processingFailed:"File processing failed: {detail}",canvasCreateFailed:"Failed to create canvas",temporaryCanvasCreateFailed:"Failed to create temporary canvas",decodeFailed:"Failed to decode image",readFailed:"Failed to read file",align:{leftTop:"Top left",topCenter:"Top center",rightTop:"Top right",leftCenter:"Center left",center:"Center",rightCenter:"Center right",leftBottom:"Bottom left",bottomCenter:"Bottom center",rightBottom:"Bottom right"}},wizard$1={previous:"Previous",next:"Next",finish:"Finish",welcome:"Welcome to Label Editor",chooseTask:"Choose a task",labelsPerPageStep:"Labels per page -- specify paper properties",sideMarginStep:"Side margins -- specify label margins",shapeStep:"Label shape -- specify label shape",spacingStep:"Template size and spacing -- specify template size and spacing"},tabs$2={page:"Page",layoutOrder:"Layout",shape:"Shape",margin:"Margin",spacing:"Spacing"},shell$1={objectList:"Object list",rename:"Rename",settings:"Settings",fillStroke:"Fill & stroke",backgroundColor:"Background color",backgroundImage:"Background image",replace:"Replace",clear:"Clear",cover:"Cover",borderPattern:"Border pattern",layers:"Layers",renameLayer:"Rename layer",layerNamePlaceholder:"Enter layer name",noStroke:"No stroke",patternNumber:"Pattern {number}",replaceImage:"Replace image",viewBarcode:"View barcode content",enterBarcode:"Enter barcode content",viewQrCode:"View QR code content",enterQrCode:"Enter QR code content",maxLayers:"A maximum of {count} layers is supported",deleteLayer:"Delete layer",deleteLayerConfirm:"Delete “{name}”?",updateSuccess:"Updated successfully",untitled:"Untitled",uploadCloudSuccess:"Uploaded to My Cloud Templates",uploadFailed:"Upload failed",cloudIdMissing:"Cloud template ID is missing; download is unavailable",downloadTemplate:"Download template",downloadSuccess:"Download successful",downloadFailed:"Download failed",createCanvasFirst:"Create a canvas first",undefinedAction:"Undefined action: {action}",fileOpenFailed:"Failed to open file",openFile:"Open file",textPrompt:"Double-click to enter text",text:"Text",selectTool:"Select (V)",panTool:`Pan canvas (H)
418
- Hold Space to pan temporarily`,print:"Print",saveFile:"Save file",newFile:"New file",rect:"Rectangle",triangle:"Triangle",circle:"Circle",line:"Line",textTool:"Text",table:"Table",barcode:"Barcode",qrCode:"QR code",picture:"Image",counter:"Date counter",variable:"Variable",database:"Database",databaseView:"Database view",refreshDatabase:"Refresh database",firstRecord:"First record",previousRecord:"Previous record",nextRecord:"Next record",lastRecord:"Last record",name:"Name"},feature$1={dateFormat:"Date format",addVariable:"Add variable",importImage:"Import image",imagePath:"Image path: {path}",externalInputChineseFormatUnsupported:"External input does not support formats containing Chinese characters",copyId:"Copy ID",cell:"Cell",cellIndex:"Cell {index}",cellPosition:"Row {row}, column {column}"},copy$3={"532cd474d1":"Start value","911dd68193":"Sequence length","6078bac61a":"Increment",de61aa8e1c:"Preview","8e35f2b9f3":"Hexadecimal","68c1392da2":"Write as number",fe992493bf:"Write as characters","9d2601c843":"Format",b6fed9af83:"Date","4a570eab6a":"Day as a number without a leading zero",ec27904da4:"Day as a number with a leading zero",d741bd3dfc:"Localized abbreviated day name","792c34e70d":"Mon",c3405710e0:"Sun","50e83fe09b":"Localized full day name",dded7a4890:"Monday",d9636d4a90:"Sunday","6c386a81be":"Month as a number without a leading zero",bf35a6483e:"Month as a number with a leading zero",dc2d993af6:"Localized abbreviated month name","5b17a06153":"Oct",dfef764f33:"Nov","7d0ccf16f3":"Localized full month name.","76a16869e0":"Two-digit year","617517584f":"Four-digit year.","3de91c80ce":"Hour without a leading zero","71b6771bc7":"displayed","5ebd64c830":"Hour with a leading zero",e1f6bc2677:"Minute without a leading zero.","472e0cbc27":"Minute with a leading zero.",ff4b6ad7d6:"Second without a leading zero.","28ba129d4e":"Second with a leading zero.",bcba353efd:"Millisecond without leading zeros.","273d567f9c":"Millisecond with leading zeros.","7f5c242027":"Use AM",e4780194e0:"PM display; a","312ba03084":"is replaced by",e214ee22dd:"AM","3fbe3edfc5":"or","1dfaab6548":"PM","3d88094723":".",fb2a23dc16:"Time zone","46930b1ccf":"for example",fa747dfcf3:"Counter type","7a4dc8253f":"Number","8bdf1760f0":"Letter","83a8f475e3":"Prefix","90a2f53d3a":"Suffix","8b0db67871":"Current value","29e1d3d9f0":"Increment","39a52f2df5":"Digits","57f15bb774":"Pad with zeros",a3ccf702c5:"Data source","700c93d882":"Formats supported by external input",c8d09cf955:"Default",f4dbbc63a5:"Database","7bb7346e15":"External input",ef258428cd:"Counter",a74a77bc7f:"Text, counter, and date combination","2d0366384f":"QR code",b1085310cb:"Barcode",b418ca60d4:"Variable","382f4b5559":"Please select","6a954390e3":"Table",ad3ee64830:"Column","6bd6e44cbc":"Select an element ID","850e2546c3":"Linked barcode ID",a424315147:"Content cannot be edited after linking","20bc33c7ba":"Linked barcode: ","4b822f835d":"Linked QR code ID",e5346f5159:"Linked QR code: ","9f6e8dba88":"Select a key","8cef5cc20b":"Import variables","1cebaf21fb":"Import JSON file",a25ed32d21:"Clear data",b56d9ac6c5:"Confirm","4d0b4688c7":"Cancel","184a9c08ac":"Clear all variables?",cce10d7b40:"File import failed","609d669223":"Duplicate keys exist. Edit them before confirming.",b088a3713a:"Select font",f670b2adc0:"Bold",af5a2c8bff:"Italic",c85de9e58a:"Strikethrough","9bc18ae51e":"Underline",f4d3dab8e0:"Text","07f568dada":"Text color",c9c7630d2c:"Text font","34098a184f":"Text size","0fa1d514a5":"Barcode type","0c5279c8ae":"Barcode text settings","576ccdb1f1":"Font size",f7af330e8f:"QR code type",cc288c9c8e:"QR code error correction level",d480c424f8:"QR code value text settings","4e3a37477c":"Show QR code value","89c41faeea":"Module pixels",fb54f6f959:"Aspect ratio","020af9c5f4":"LongBei code error correction level","204ca8e993":"QR code error correction level","3276f518f5":"Import using the image aspect ratio",a41a0c9fd2:"Select clip art","446d1e1236":"Please select an image","18104edf89":"Select image",be8da62ea1:"Image",e423d0e04e:"Failed to select image","17ad570546":"Print counter",d84a63fd99:"Print date",bc90a3957d:"Keyboard input","5585698377":"PM display","9978b8a700":"Corner radius","579f280b5d":"Rows","150074c2e8":"Table","2a2b777ae4":"Row","1082f4e944":"Solid","12c09d0341":"Dashed","72077749f7":"None","83100cd7eb":"Insert row above","5d80537a38":"Insert row below",bdc0e99b04:"Delete current row",eee6dec245:"Delete current column","199013c934":"Insert column left","45989304d7":"Insert column right",cee8bcba20:"Font size",b534c8636c:"Line height",c86f1b361f:"Character spacing","6d93ab3fba":"Character spacing","5937a2c95a":"Text position","413f8db65f":"Align left","5be891c540":"Align center","70fe40dec2":"Align right",a9d35ab0a6:"Top","435b2d8982":"Bottom","443bde0f4c":"Text alignment","989d1affa0":"Version","0965832369":"Date offset","6f14c2641c":"Year",d9b59879f3:"Month","15917f3b32":"Day","86ec1ca75c":"Width",eea51aa44b:"Height",cb165f5ca1:"Rotation angle","5268436bdf":"Align horizontal center","8a9aed3516":"Distribute horizontally",ceb66a60f6:"Align top","2cd89127c4":"Align vertical center","5d2078e01c":"Align bottom",f8735a4579:"Distribute vertically","3ffbbe25d5":"Center horizontally on canvas","7cd8c94d34":"Center vertically on canvas","9474979eb3":"Center horizontally in area","73678a1e04":"Center vertically in area","41654e0268":"Basic information","067f80c392":"Columns","68d87ec64c":"Column width",db63adaf4c:"Double-click a cell to edit","046ca7db56":"Top",b3ceb938fb:"Right","343b383f1d":"Bottom","8566923239":"Left","68238a67bc":"Font color","97c8abc1b8":"Arc radius (positive bends up, negative bends down)","83cc65b13f":"Single line","918a0c837b":"Paragraph","7d9b9e079f":"Arc layout","0a84571f3e":"Size mode","1b95368e24":"Scale","2c06479d15":"Free","3d17580e06":"Barcode height (mm)","4e28691ff7":"Barcode height","5f397a20e8":"Barcode-text gap (mm)","60a48b31d9":"Barcode-text gap"},enEditor={remaining:remaining$1,label:label$1,newLabel:newLabel$1,cloudLabel:cloudLabel$1,labelFileFilter:labelFileFilter$1,labelSettings:labelSettings$2,labelEditSettings:labelEditSettings$1,labelSize:labelSize$1,labelWidth:labelWidth$1,labelHeight:labelHeight$1,labelShape:labelShape$1,labelsPerPage:labelsPerPage$1,oneLabelPerPage:oneLabelPerPage$1,multipleLabelsPerPage:multipleLabelsPerPage$1,pageHasMargins:pageHasMargins$1,pageHasNoMargins:pageHasNoMargins$1,labelSideMargin:labelSideMargin$1,varnishLayer:varnishLayer$1,varnishPanel:varnishPanel$1,specialist:specialist$1,templateName:templateName$3,instantEditPrint:instantEditPrint$1,instantScanPrint:instantScanPrint$1,linkedContentReadonly:linkedContentReadonly$1,qrCodeContent:qrCodeContent$1,defaults:defaults$1,objectNames:objectNames$1,image:image$1,wizard:wizard$1,tabs:tabs$2,shell:shell$1,feature:feature$1,copy:copy$3},title$5="Print",preview$1="Preview",file$2="Print file:",range$2="Print range",copies$1="Copies",content$1="Print content",toFile$1="Print to file",direction$1="Print direction",order$1="Print order",counter$3="Print counter",date$3="Print date",cancel$1="Cancel printing",connecting$3="Connecting to printer",connectingPrinter$1="Connecting to printer...",printing$1="Printing...",complete$1="Printing complete",pageComplete$1="Page {page} printed",maximumRows$1="Maximum printable rows in the page range: {rows}",rewind$1="Rewind",separateLayers$1="Print layers separately",multipleLabels$1="Print multiple labels",sendTemplate$1="Send template",selectDriver$1="Select driver",advancedOptions$1="Advanced options",paperSavingMode$1="Paper saving mode",enabled$1="On",disabled$1="Off",serialCount$1="Serial number count",startRecord$1="Start record",endRecord$1="End record",pageRange$1="Page range",rangeExample$1="Example: 1-3,8,10",copyCount$1="Copy count",template$1="Template",templateName$2="Template name",currentAssociations$1="Current associations:",sheetRows$1="{sheet} has {rows} rows; ",driver$1="Driver:",task$1="Task:",taskComplete$1="Task complete",success$1="Succeeded:",failed$1="Failed:",progress$1="Progress:",firstPage$1="First page",previousPage$1="Previous page",currentPage$1="Current page",nextPage$1="Next page",lastPage$1="Last page",firstImage$1="First image",previousImage$1="Previous image",currentImage$1="Current image",nextImage$1="Next image",lastImage$1="Last image",pageSummary$1="Page {current}/{totalPages}, {total} images total",previewGenerating$1="Generating print preview...",previewFailed$1="Failed to generate print preview",saveTemplateFile$1="Save template file",templateFileFilter$1="Template files",templateSaved$1="Template saved",templateSent$1="Template sent",errors$1={connectFailed:"Failed to connect to printer",tidReadFailed:"Failed to read TID",pageFailed:"Failed to print page {page}",templateSendFailed:"Failed to send template",missingDriver:"Select a driver",emptyCanvas:"An empty canvas cannot be printed or previewed",missingTemplateName:"Enter a template name",startAfterEnd:"The start page cannot be after the end page",rangeExceeded:"The maximum print page range was exceeded",invalidPage:"Invalid page number",invalidPageFormat:"Invalid page range format",invalidDriverResponse:"No JSON response received"},enPrint={title:title$5,preview:preview$1,file:file$2,range:range$2,copies:copies$1,content:content$1,toFile:toFile$1,direction:direction$1,order:order$1,counter:counter$3,date:date$3,continue:"Continue printing",cancel:cancel$1,connecting:connecting$3,connectingPrinter:connectingPrinter$1,printing:printing$1,complete:complete$1,pageComplete:pageComplete$1,maximumRows:maximumRows$1,rewind:rewind$1,separateLayers:separateLayers$1,multipleLabels:multipleLabels$1,sendTemplate:sendTemplate$1,selectDriver:selectDriver$1,default:"Default",advancedOptions:advancedOptions$1,paperSavingMode:paperSavingMode$1,enabled:enabled$1,disabled:disabled$1,serialCount:serialCount$1,startRecord:startRecord$1,endRecord:endRecord$1,pageRange:pageRange$1,rangeExample:rangeExample$1,copyCount:copyCount$1,template:template$1,templateName:templateName$2,currentAssociations:currentAssociations$1,sheetRows:sheetRows$1,driver:driver$1,task:task$1,taskComplete:taskComplete$1,success:success$1,failed:failed$1,progress:progress$1,firstPage:firstPage$1,previousPage:previousPage$1,currentPage:currentPage$1,nextPage:nextPage$1,lastPage:lastPage$1,firstImage:firstImage$1,previousImage:previousImage$1,currentImage:currentImage$1,nextImage:nextImage$1,lastImage:lastImage$1,pageSummary:pageSummary$1,previewGenerating:previewGenerating$1,previewFailed:previewFailed$1,saveTemplateFile:saveTemplateFile$1,templateFileFilter:templateFileFilter$1,templateSaved:templateSaved$1,templateSent:templateSent$1,errors:errors$1},title$4="Database",type$1="Database type",name$1="Database name",view$1="Database view",path$1="Database path:",serverAddress$1="Database server address",serverPort$1="Database server port",userName$1="Database user name",password$1="Database password",select$1="Select database",connect$1="Connect",serverUrl$1="Server URL",filePath$1="File path",serverAddressPlaceholder$1="Server address",serverPortPlaceholder$1="Server port",selectFile$1="Select file",sheet$1="Table:",column$1="Column:",hex$1="Hexadecimal",numericWrite$1="Write as number",characterWrite$1="Write as text",deleteCharacters$1="Delete characters",sheetInstructions$1="Select a worksheet, then specify how its data is arranged",previewRows$1="Preview (10 rows)",selectedSheets$1="You selected the following tables",addAnotherPrompt$1="Would you like to add another table?",addAnotherYes$1="Yes, select another table",addAnotherNo$1="No, selection is complete",selectFailed$1="Failed to select database",connecting$2="Connecting to database",connectionSuccess$1="Database connected",connectionFailed$3="Database connection failed",prompts$2={excelFile:"Select an Excel file",dbFile:"Select a db file",serverAddress:"Enter the database server address",serverPort:"Enter the database server port",name:"Enter the database name",userName:"Enter the database user name",password:"Enter the database password"},enDatabase={title:title$4,type:type$1,name:name$1,view:view$1,path:path$1,serverAddress:serverAddress$1,serverPort:serverPort$1,userName:userName$1,password:password$1,select:select$1,connect:connect$1,serverUrl:serverUrl$1,filePath:filePath$1,serverAddressPlaceholder:serverAddressPlaceholder$1,serverPortPlaceholder:serverPortPlaceholder$1,selectFile:selectFile$1,sheet:sheet$1,column:column$1,hex:hex$1,numericWrite:numericWrite$1,characterWrite:characterWrite$1,deleteCharacters:deleteCharacters$1,sheetInstructions:sheetInstructions$1,previewRows:previewRows$1,selectedSheets:selectedSheets$1,addAnotherPrompt:addAnotherPrompt$1,addAnotherYes:addAnotherYes$1,addAnotherNo:addAnotherNo$1,selectFailed:selectFailed$1,connecting:connecting$2,connectionSuccess:connectionSuccess$1,connectionFailed:connectionFailed$3,prompts:prompts$2},title$3="RFID label",safeArea$1="Safe area",counter$2="Counter",settings$1="RFID label settings",production$1="RFID label production",uhfPrint$1="UHF RFID printing",protocol$1="RFID label protocol standard",readOffset$1="RFID label read offset",writeContent$1="Label write content",tid$1="Tag identifier (TID)",longbeiContent$1="Longbei code content",longbeiErrorCorrection$1="Longbei code error-correction level",guojun$1="Guojun",databaseSource$1="Database",status$1="Status",power$1="Power",readPower$1="Read power",writePower$1="Write power",getCurrentValue$1="Get current device value",crcValidation$1="RFID data CRC validation",commandPassword$1="Command password",oldCommandPassword$1="Old command password",newCommandPassword$1="New command password",enterOldCommandPassword$1="Enter old command password",enterNewCommandPassword$1="Enter new command password",accessPassword$1="Access password",oldPassword$1="Old password",newPassword$1="New password",manualInput$1="Manual input",enterEightDigitPassword$1="Enter an 8-digit password",savePasswordToFile$1="Save password",regionPermissions$1="Region permissions",epcRegion$1="EPC region",userRegion$1="User region",reservedRegion$1="Reserved region",lock$1="Lock",permanentLock$1="Permanent lock",neverLock$1="Never lock",changeKillPassword$1="Change Kill password",killPassword$1="Kill password",paddingMethod$1="Padding method",defaultPadding$1="Default",padStart$2="Pad start",padEnd$1="Pad end",dataSource$1="Data source",hexadecimal$1="Hexadecimal",text$1="Text",date$2="Date",sequenceGenerator$1="Sequence generator",enterData$1="Enter data",minimumPaddingDigits$1="Minimum padding digits",readWrite$1="Readable and writable",readOnly$1="Read-only",configureMemoryProperties$1="Configure memory properties",configureSecurityMode$1="Configure security mode",noAuthentication$1="No authentication",authenticationWithoutSecureCommunication$1="Authentication without secure communication",authenticationWithSecureCommunication$1="Authentication with secure communication",unsavedSwitchConfirm$1="There are unsaved settings. Continue switching?",deviceDetectionFailed$1="Device detection failed. Error code: {code}; details: {detail}",noPrinterFound$1="No printer was found",connectionFailed$2="Connection failed. Error code: {code}; details: {detail}",connectedTo$1="Connected to: {device}",oldAndNewPasswordRequired$1="Old and new passwords cannot both be empty",savePasswordSuccess$1="Password saved successfully",savePasswordFailed$1="Failed to save password",passwordRequired$1="Password is required",oldPasswordEightDigits$1="Old password must be 8 digits",newPasswordEightDigits$1="New password must be 8 digits",killPasswordEightDigits$1="Kill password must be 8 digits",oldCommandPasswordEightDigits$1="Old command password must be 8 digits",newCommandPasswordEightDigits$1="New command password must be 8 digits",newCommandRequiredForAccessChange$1="A new command password is required to change the access password",oldCommandRequiredForAccessChange$1="The old command password is required to change the access password",changeKillPasswordConfirm$1="Change the Kill password?",paddingMultipleOfFour$1="Padding length must be a multiple of 4",setFailedWithDetail$1="Set failed: {detail}",getFailedWithDetail$1="Get failed: {detail}",enRfid={title:title$3,safeArea:safeArea$1,counter:counter$2,settings:settings$1,production:production$1,uhfPrint:uhfPrint$1,protocol:protocol$1,readOffset:readOffset$1,writeContent:writeContent$1,tid:tid$1,longbeiContent:longbeiContent$1,longbeiErrorCorrection:longbeiErrorCorrection$1,guojun:guojun$1,databaseSource:databaseSource$1,status:status$1,power:power$1,readPower:readPower$1,writePower:writePower$1,getCurrentValue:getCurrentValue$1,crcValidation:crcValidation$1,commandPassword:commandPassword$1,oldCommandPassword:oldCommandPassword$1,newCommandPassword:newCommandPassword$1,enterOldCommandPassword:enterOldCommandPassword$1,enterNewCommandPassword:enterNewCommandPassword$1,accessPassword:accessPassword$1,oldPassword:oldPassword$1,newPassword:newPassword$1,manualInput:manualInput$1,enterEightDigitPassword:enterEightDigitPassword$1,savePasswordToFile:savePasswordToFile$1,regionPermissions:regionPermissions$1,epcRegion:epcRegion$1,userRegion:userRegion$1,reservedRegion:reservedRegion$1,lock:lock$1,permanentLock:permanentLock$1,neverLock:neverLock$1,changeKillPassword:changeKillPassword$1,killPassword:killPassword$1,paddingMethod:paddingMethod$1,defaultPadding:defaultPadding$1,padStart:padStart$2,padEnd:padEnd$1,dataSource:dataSource$1,hexadecimal:hexadecimal$1,text:text$1,date:date$2,sequenceGenerator:sequenceGenerator$1,enterData:enterData$1,minimumPaddingDigits:minimumPaddingDigits$1,readWrite:readWrite$1,readOnly:readOnly$1,configureMemoryProperties:configureMemoryProperties$1,configureSecurityMode:configureSecurityMode$1,noAuthentication:noAuthentication$1,authenticationWithoutSecureCommunication:authenticationWithoutSecureCommunication$1,authenticationWithSecureCommunication:authenticationWithSecureCommunication$1,unsavedSwitchConfirm:unsavedSwitchConfirm$1,deviceDetectionFailed:deviceDetectionFailed$1,noPrinterFound:noPrinterFound$1,connectionFailed:connectionFailed$2,connectedTo:connectedTo$1,oldAndNewPasswordRequired:oldAndNewPasswordRequired$1,savePasswordSuccess:savePasswordSuccess$1,savePasswordFailed:savePasswordFailed$1,passwordRequired:passwordRequired$1,oldPasswordEightDigits:oldPasswordEightDigits$1,newPasswordEightDigits:newPasswordEightDigits$1,killPasswordEightDigits:killPasswordEightDigits$1,oldCommandPasswordEightDigits:oldCommandPasswordEightDigits$1,newCommandPasswordEightDigits:newCommandPasswordEightDigits$1,newCommandRequiredForAccessChange:newCommandRequiredForAccessChange$1,oldCommandRequiredForAccessChange:oldCommandRequiredForAccessChange$1,changeKillPasswordConfirm:changeKillPasswordConfirm$1,paddingMultipleOfFour:paddingMultipleOfFour$1,setFailedWithDetail:setFailedWithDetail$1,getFailedWithDetail:getFailedWithDetail$1},invalidPageSize$1="Invalid page size. Adjust the label size, margins, or spacing.",pageExceedsSettings$1="The page exceeds the configured area. Adjust the label size, margins, or spacing.",emptyCanvas$1="An empty canvas cannot be printed or previewed",printFailed$1="Failed to print page {page}",pageRangeExceeded$1="Maximum print page range exceeded",printerUnavailable$1="No printer was found",printerConnectionFailed$1="Unable to connect to printer",databaseSelectionFailed$1="Failed to select database",networkTimeout$1="The request timed out. Check the network and try again.",unknown$1="Something went wrong. Please try again.",unknownWithCode$1="Something went wrong (code: {code}). Please try again.",enErrors={invalidPageSize:invalidPageSize$1,pageExceedsSettings:pageExceedsSettings$1,emptyCanvas:emptyCanvas$1,printFailed:printFailed$1,pageRangeExceeded:pageRangeExceeded$1,printerUnavailable:printerUnavailable$1,printerConnectionFailed:printerConnectionFailed$1,databaseSelectionFailed:databaseSelectionFailed$1,networkTimeout:networkTimeout$1,unknown:unknown$1,unknownWithCode:unknownWithCode$1},actions={confirm:"確認",cancel:"キャンセル",close:"閉じる",save:"保存",delete:"削除",continue:"続行",refresh:"更新",select:"選択",create:"新規作成",custom:"カスタム",set:"設定"},dialog={prompt:"ヒント",defaultContent:"これはデフォルトのダイアログ内容です"},feedback={notice:"お知らせ",setSuccess:"設定に成功しました"},prompts$1={enter:"入力してください"},locale={zhCN:"简体中文",enUS:"English"},tabs$1={closingTitle:"タブを閉じています",closePrompt:"タブ[{name}]の内容を閉じますか?",savePrompt:"タブ[{name}]の内容を保存しますか?",closeAll:"すべてのタブを閉じる"},commonUi={clipArrow:"矢印",clipMark:"マーク",clipPunctuation:"句読点",clipSequence:"連番",color:"色",opacity:"透明度",canvasUnavailable:"Canvas コンテキストを取得できません",addElement:"要素を追加",selectRelatedId:"関連付ける要素IDを選択",relatedName:"関連要素名:",none:"なし",textSlice:"テキスト切り取り",moveUp:"上に移動",moveDown:"下に移動",start:"開始",end:"終了",cropImage:"画像を切り抜き",keepAspectRatio:"画像の縦横比を保持",crop:"切り抜き",renamePrompt:"名前を入力してください",invalidProperty:"属性値エラー",customPlaceholder:"カスタム設定",databaseView:"データベース表示",databasePath:"データベースパス",dataTable:"データテーブル",totalRows:"全 {count} 件",sequence:"連番",upgrade:"アップグレード",requestAuthorization:"認証を申請",generateAuthorization:"認証情報を生成",importAuthorizationFile:"認証ファイルをインポート",authorizationFilePath:"ライセンスファイルパス",companyName:"会社名",enterCompanyName:"会社名を入力",contact:"連絡先",enterContact:"連絡先を入力",phone:"電話番号",enterPhone:"電話番号を入力",email:"メール",enterEmail:"メールアドレスを入力",submit:"送信",sendQrCode:"QRコードのスクリーンショットを運用担当者に送信して認証ファイルを生成してください",regenerateAuthorization:"認証情報を再生成",companyNameRequired:"会社名を入力してください",contactRequired:"連絡先を入力してください",phoneRequired:"電話番号を入力してください",phoneInvalid:"正しい電話番号を入力してください",emailRequired:"メールアドレスを入力してください",emailInvalid:"正しいメールアドレスを入力してください",authorizationUpgradeSuccess:"ライセンス更新完了",preview:"プレビュー",clickPreview:"クリックしてプレビューを表示",fill:"塗りつぶし",backgroundFill:"背景塗りつぶし",stroke:"ストローク",strokeStyle:"ストロークスタイル",strokeWidth:"ストローク幅",dashLength:"線分の長さ",dash:"線分",gapLength:"間隔の長さ",gap:"間隔",sdkVersion:"SDK バージョン",newFile:"新規ファイル",doNotSave:"保存しない"},newStep={preview:"プレビュー:",labelSize:"ラベルサイズ",millimeters:"mm",invalidDimensions:"エラー:ページサイズが正しくありません。ラベルサイズ、余白、間隔などを調整してください",newFile:"新規ファイル",openFile:"ファイルを開く",openTemplate:"テンプレートを開く",oneLabelPerPage:"1ページに1ラベル",multipleLabelsPerPage:"1ページに複数ラベル",rows:"行:",columns:"列:",printOrder:"印刷順序:",startCorner:"開始位置:",preferredDirection:"優先方向:",leftTop:"左上",leftBottom:"左下",rightTop:"右上",rightBottom:"右下",horizontal:"水平",vertical:"垂直",hasMarginsQuestion:"ページにサイドマージンは含まれますか?",hasMargins:"はい、ラベルページにはサイドマージンが含まれます",noMargins:"無し、ラベル右マージンなし",marginSize:"サイドマージンサイズ",left:"左:",right:"右:",top:"上:",bottom:"下:",rectangle:"長方形",roundedRectangle:"角丸長方形",ellipse:"楕円",pageWidth:"ページ幅:",pageHeight:"ページ高さ:",printDirection:"印刷方向",portrait:"縦方向",landscape:"横",width:"幅:",height:"高さ:",manual:"手動設定",spacing:"間隔",horizontalSpacing:"水平間隔:",verticalSpacing:"垂直間隔:",margins:"余白:",fileNamePrompt:"ファイル名を入力してください:"},jaCommon={actions,dialog,feedback,prompts:prompts$1,locale,tabs:tabs$1,commonUi,newStep},file$1="ファイル",edit="編集",print="印刷(P)",database="データベース",databaseView="データベース表示",refreshDatabase="データベースを更新",labelSettings$1="ラベルプロパティ設定",fileWithKey="ファイル(F)",editWithKey="編集(E)",viewWithKey="表示(V)",toolsWithKey="ツール(T)",helpWithKey="ヘルプ(H)",open$1="開く(O)",save="保存(S)",saveAs$1="名前を付けて保存(A)",downloadTemplate="テンプレートをダウンロード",uploadCloud="クラウドテンプレートにアップロード",undo="元に戻す(Z)",redo="やり直す(R)",copy$2="コピー(C)",paste="貼り付け(V)",cut="切り取り(X)",exportImage="画像をエクスポート",objectProps="オブジェクトプロパティ",zoom="ズーム",zoomIn="拡大",zoomOut="縮小",zoomAuto="自動ズーム",ruler="定規",grid="グリッド",visible="表示",helpIndex="ヘルプインデックス",about="LabelEditorについて",closeAll="すべてのタブを閉じる",minimize="最小化",restore="元のサイズに戻す",maximize="最大化",close="閉じる",jaMenu={file:file$1,edit,print,database,databaseView,refreshDatabase,labelSettings:labelSettings$1,fileWithKey,editWithKey,viewWithKey,toolsWithKey,helpWithKey,new:"新規(N)",open:open$1,save,saveAs:saveAs$1,downloadTemplate,uploadCloud,undo,redo,copy:copy$2,paste,cut,delete:"削除(D)",exportImage,objectProps,zoom,zoomIn,zoomOut,zoomAuto,ruler,grid,visible,helpIndex,about,closeAll,minimize,restore,maximize,close},remaining={upperLayer:"上層",lowerLayer:"下層",doubleClickText:"ダブルクリックして入力",imageLoadFailed:"画像の読み込みに失敗しました",emptyCannotSave:"空のファイルは保存できません",emptyCannotExport:"空のファイルは画像をエクスポートできません",unnamed:"無題",savedToMyTemplates:"マイテンプレートに保存しました",missingCloudId:"クラウドテンプレートIDが見つからないため保存できません",saveSuccess:"保存に成功しました",saveFileFailed:"ファイルの保存に失敗しました",fileNotWritable:"ファイルに書き込みできません",saveFile:"ファイルを保存",labelFilter:"ラベル(*.LEX)",savedFile:"ファイルの保存に成功しました",thumbnailFailed:"サムネイルの生成に失敗しました",saveImage:"画像を保存",imageFilter:"画像(*.png)",saveFailed:"保存に失敗しました",alreadyOpen:"このファイルは既に開かれています",openFailed:"ファイルを開けませんでした",cloudTemplate:"クラウドテンプレート",closeAllTabs:"すべてのタブを閉じる",newFileNumber:"新規ファイル{number}",serverError:"サーバーエラー",serverConnectError:"连接服务器异常,请查看网络是否正常",methodUnavailable:"メソッド {method} は未実装または利用できません",barcodeVersion:"バージョン",barcodeGrid:"列数×行数",barcodeRows:"行数",barcodeColumns:"列数"},label="ラベル",newLabel="新規ラベル",cloudLabel="クラウドラベル",labelFileFilter="ラベル(*.LEX)",labelSettings="ラベルプロパティ設定",labelEditSettings="ラベル編集設定",labelSize="ラベルサイズ",labelWidth="ラベル幅",labelHeight="ラベル高さ",labelShape="ラベル形状",labelsPerPage="1ページあたりのラベル数",oneLabelPerPage="1ページに1ラベル",multipleLabelsPerPage="1ページに複数ラベル",pageHasMargins="はい、ラベルページにサイドマージンが含まれます",pageHasNoMargins="いいえ、ラベルにサイドマージンはありません",labelSideMargin="ラベルのサイドマージン",varnishLayer="ニス層",varnishPanel="ニス設定パネル",specialist={laser:{title:"レーザー設定",selectPreset:"プリセットパラメータを選択",deletedWarning:'レーザー設定 "{deletedNames}" は削除されました。使用しているオブジェクトはデフォルトパラメータに戻ります',limitWarning:"レーザー設定の上限({maxPresets})を超えました。一部の新プリセットはインポートされませんでした",fields:{repeatTimes:"マーキング回数",scanSpeed:"レーザー速度",jumpSpeed:"ジャンプ速度",power:"パワー",frequency:"周波数",pulseWidth:"パルス幅",openLightDelay:"発光遅延",closeLightDelay:"消灯遅延",endDelay:"終了遅延",cornerDelay:"コーナー遅延",jumpDelay:"ジャンプ遅延"}},varnish:{none:"なし",portraitOutline:"ポートレート輪郭",enabled:"あり",colorOverlay:"カラーオーバーレイ",fullOverlay:"全面オーバーレイ"}},templateName$1="ラベルテンプレート_{name}",instantEditPrint="編集してすぐ印刷",instantScanPrint="スキャンしてすぐ印刷",linkedContentReadonly="関連元があるためコンテンツを編集できません",qrCodeContent="QRコード内容",defaults={layer:"レイヤー {sequence}"},objectNames={text:"テキスト",textname:"名前",image:"画像",rect:"長方形",triangle:"三角形",table:"テーブル",circle:"円",line:"直線",barcode:"バーコード",barcode2d:"二次元コード",counter:"日付カウンター",group:"グループ"},image={settings:"画像設定",keepRatio:"画像の縦横比を保持",flipHorizontal:"水平反転",flipVertical:"垂直反転",grayscale:"グレースケール",sharpen:"白黒図の鮮明度最適化",anchorAlignment:"アンカー配置",anchorSettings:"アンカー設定",alignment:"配置:",crop:"画像切り抜き",replace:"画像を交換",selectFile:"ファイルを選択",selectClipArt:"クリップアートを選択",selectTitle:"画像を選択",fileType:"画像",selectFailed:"画像の選択に失敗しました",selectRequired:"画像を選択してください",unsupportedType:"サポートされていないファイル形式です",processingFailed:"ファイル処理に失敗しました: {detail}",canvasCreateFailed:"キャンバスの作成に失敗しました",temporaryCanvasCreateFailed:"一時キャンバスの作成に失敗しました",decodeFailed:"画像のデコードに失敗しました",readFailed:"ファイルの読み取りに失敗しました",align:{leftTop:"左上",topCenter:"上部中央",rightTop:"右上",leftCenter:"左中央",center:"中央",rightCenter:"右中央",leftBottom:"左下",bottomCenter:"下部中央",rightBottom:"右下"}},wizard={previous:"前へ",next:"次へ",finish:"完了",welcome:"Label Editorへようこそ",chooseTask:"実行するタスクを選択してください",labelsPerPageStep:"1ページあたりのラベル数 - 用紙属性を指定",sideMarginStep:"サイドマージン - ラベルのサイドマージンを指定",shapeStep:"ラベル形状 - ラベルの形状を指定",spacingStep:"テンプレートサイズと間隔 - テンプレートのサイズと間隔を指定"},tabs={page:"ページ",layoutOrder:"レイアウトと順序",shape:"形状",margin:"余白",spacing:"間隔"},shell={objectList:"オブジェクトリスト",rename:"名前変更",settings:"設定",fillStroke:"塗りつぶしとストローク",backgroundColor:"背景色",backgroundImage:"背景画像",replace:"交換",clear:"クリア",cover:"全面表示",borderPattern:"ストロークパターン",layers:"レイヤー",renameLayer:"レイヤー名を変更",layerNamePlaceholder:"レイヤー名を入力してください",noStroke:"ストロークなし",patternNumber:"パターン {number}",replaceImage:"画像を交換",viewBarcode:"バーコード内容を表示",enterBarcode:"バーコード内容を入力してください",viewQrCode:"QRコード内容を表示",enterQrCode:"QRコード内容を入力してください",maxLayers:"最大 {count} レイヤーまでサポート",deleteLayer:"レイヤーを削除",deleteLayerConfirm:"「{name}」を削除してもよろしいですか?",updateSuccess:"更新に成功しました",untitled:"無題",uploadCloudSuccess:"クラウドテンプレートへのアップロードに成功しました",uploadFailed:"アップロードに失敗しました",cloudIdMissing:"クラウドテンプレートIDが見つからないためダウンロードできません",downloadTemplate:"テンプレートをダウンロード",downloadSuccess:"ダウンロードに成功しました",downloadFailed:"ダウンロードに失敗しました",createCanvasFirst:"先にキャンバスを作成してください",undefinedAction:"未定義の操作: {action}",fileOpenFailed:"ファイルを開けませんでした",openFile:"ファイルを開く",textPrompt:"ダブルクリックしてテキストを入力",text:"テキスト",selectTool:"選択(V)",panTool:`キャンバス移動(H)
419
- スペースキーを押すと一時的に移動`,print:"印刷",saveFile:"ファイルを保存",newFile:"新規ファイル",rect:"長方形",triangle:"三角形",circle:"円",line:"線",textTool:"テキスト",table:"テーブル",barcode:"バーコード",qrCode:"QRコード",picture:"画像",counter:"日付カウンター",variable:"変数",database:"データベース",databaseView:"データベース表示",refreshDatabase:"データベースを更新",firstRecord:"最初のレコード",previousRecord:"前のレコード",nextRecord:"次のレコード",lastRecord:"最後のレコード",name:"名前"},feature={dateFormat:"日付形式",addVariable:"変数を追加",importImage:"画像をインポート",imagePath:"画像パス: {path}",externalInputChineseFormatUnsupported:"外部入力は中国語形式に対応していません",copyId:"IDをコピー",cell:"セル",cellIndex:"セル {index}",cellPosition:"{row} 行 {column} 列"},copy$1={"532cd474d1":"開始値","911dd68193":"連番桁数","6078bac61a":"増分",de61aa8e1c:"プレビュー","8e35f2b9f3":"16進数","68c1392da2":"数値書き込み",fe992493bf:"文字書き込み","9d2601c843":"形式",b6fed9af83:"日付","4a570eab6a":"日(ゼロ埋めなしの数字)",ec27904da4:"日を数字表記、先頭ゼロ付き",d741bd3dfc:"日(短縮ローカライズ名称)","792c34e70d":"月曜",c3405710e0:"日曜","50e83fe09b":"日(非短縮ローカライズ名称)",dded7a4890:"月曜日",d9636d4a90:"日曜日","6c386a81be":"月(ゼロ埋めなしの数字)",bf35a6483e:"月(ゼロ埋めありの数字)",dc2d993af6:"月(短縮ローカライズ名称)","5b17a06153":"10月",dfef764f33:"11月","7d0ccf16f3":"月(非短縮ローカライズ名称)","76a16869e0":"年(2桁)","617517584f":"年(4桁)","3de91c80ce":"時(ゼロ埋めなし)","71b6771bc7":"表示","5ebd64c830":"時(ゼロ埋めあり)",e1f6bc2677:"分(ゼロ埋めなし)","472e0cbc27":"分(ゼロ埋めあり)",ff4b6ad7d6:"秒(ゼロ埋めなし)","28ba129d4e":"秒(ゼロ埋めあり)",bcba353efd:"ミリ秒(ゼロ埋めなし)","273d567f9c":"ミリ秒(ゼロ埋めあり)","7f5c242027":"午前",e4780194e0:"午後表示 a","312ba03084":"で",e214ee22dd:"午前","3fbe3edfc5":"または","1dfaab6548":"午後","3d88094723":"置き換えられます",fb2a23dc16:"タイムゾーン","46930b1ccf":"例",fa747dfcf3:"カウントタイプ","7a4dc8253f":"数字","8bdf1760f0":"英字","83a8f475e3":"埋め文字","90a2f53d3a":"末尾埋め文字","8b0db67871":"現在値","29e1d3d9f0":"増分値","39a52f2df5":"データビット","57f15bb774":"ゼロ埋め",a3ccf702c5:"データソース","700c93d882":"外部入力対応形式",c8d09cf955:"デフォルト",f4dbbc63a5:"データベース","7bb7346e15":"外部入力",ef258428cd:"カウンター",a74a77bc7f:"テキスト、タイマー、日付の組み合わせ","2d0366384f":"QRコード",b1085310cb:"バーコード",b418ca60d4:"変数","382f4b5559":"選択してください","6a954390e3":"テーブル",ad3ee64830:"列","6bd6e44cbc":"関連付ける要素IDを選択","850e2546c3":"関連バーコードID",a424315147:"関連付け後はコンテンツを編集できません","20bc33c7ba":"関連バーコード:","4b822f835d":"関連QRコードID",e5346f5159:"関連QRコード:","9f6e8dba88":"Keyを選択してください","8cef5cc20b":"変数をインポート","1cebaf21fb":"jsonファイルをインポート",a25ed32d21:"データをクリア",b56d9ac6c5:"確認","4d0b4688c7":"キャンセル","184a9c08ac":"すべての変数をクリアしますか?",cce10d7b40:"ファイルのインポートに失敗しました","609d669223":"重複するkeyがあります。修正してから確認してください",b088a3713a:"フォントを選択",f670b2adc0:"太字",af5a2c8bff:"斜体",c85de9e58a:"取り消し線","9bc18ae51e":"下線",f4d3dab8e0:"テキスト","07f568dada":"文字色",c9c7630d2c:"テキストフォント","34098a184f":"テキストサイズ","0fa1d514a5":"一次元コードタイプ","0c5279c8ae":"一次元コードテキスト設定","576ccdb1f1":"フォントサイズ",f7af330e8f:"二次元コードタイプ",cc288c9c8e:"QRコード誤り訂正レベル",d480c424f8:"QRコード値テキスト設定","4e3a37477c":"QRコード値を表示","89c41faeea":"モジュールピクセル",fb54f6f959:"縦横比","020af9c5f4":"ロンベイコード誤り訂正レベル","204ca8e993":"QRコード誤り訂正レベル","3276f518f5":"画像の縦横比でインポート",a41a0c9fd2:"クリップアートを選択","446d1e1236":"画像を選択してください","18104edf89":"画像を選択",be8da62ea1:"画像",e423d0e04e:"画像の選択に失敗しました","17ad570546":"印刷カウンター",d84a63fd99:"印刷日付",bc90a3957d:"キーボード入力","5585698377":"午後 表示","9978b8a700":"角丸","579f280b5d":"行数","150074c2e8":"テーブル","2a2b777ae4":"行","1082f4e944":"直線","12c09d0341":"点線","72077749f7":"なし","83100cd7eb":"上に行を挿入","5d80537a38":"下に行を挿入",bdc0e99b04:"現在の行を削除",eee6dec245:"現在の列を削除","199013c934":"左に列を挿入","45989304d7":"右に列を挿入",cee8bcba20:"フォントサイズ",b534c8636c:"行の高さ",c86f1b361f:"文字間隔","6d93ab3fba":"テキスト間隔","5937a2c95a":"テキスト位置","413f8db65f":"左揃え","5be891c540":"中央揃え","70fe40dec2":"右揃え",a9d35ab0a6:"上部","435b2d8982":"下部","443bde0f4c":"テキスト配置","989d1affa0":"バージョン","0965832369":"日付オフセット","6f14c2641c":"年",d9b59879f3:"月","15917f3b32":"日","86ec1ca75c":"幅",eea51aa44b:"高さ",cb165f5ca1:"回転角度","5268436bdf":"水平中央揃え","8a9aed3516":"水平等間隔配置",ceb66a60f6:"上揃え","2cd89127c4":"垂直中央揃え","5d2078e01c":"下揃え",f8735a4579:"垂直等間隔配置","3ffbbe25d5":"キャンバス水平中央","7cd8c94d34":"キャンバス垂直中央","9474979eb3":"エリア水平中央","73678a1e04":"エリア垂直中央","41654e0268":"基本情報","067f80c392":"列数","68d87ec64c":"列幅",db63adaf4c:"セルをダブルクリックして編集","046ca7db56":"上辺",b3ceb938fb:"右辺","343b383f1d":"下辺","8566923239":"左辺","68238a67bc":"文字色","97c8abc1b8":"円弧半径(正の値は上向き、負の値は下向きの曲線)","83cc65b13f":"単行","918a0c837b":"段落","7d9b9e079f":"円弧配置","0a84571f3e":"尺寸模式","1b95368e24":"倍数拉伸","2c06479d15":"自由拉伸","3d17580e06":"一维码高度(mm)","4e28691ff7":"一维码高","5f397a20e8":"条码与文本间距(mm)","60a48b31d9":"一维码与文字间距"},jaEditor={remaining,label,newLabel,cloudLabel,labelFileFilter,labelSettings,labelEditSettings,labelSize,labelWidth,labelHeight,labelShape,labelsPerPage,oneLabelPerPage,multipleLabelsPerPage,pageHasMargins,pageHasNoMargins,labelSideMargin,varnishLayer,varnishPanel,specialist,templateName:templateName$1,instantEditPrint,instantScanPrint,linkedContentReadonly,qrCodeContent,defaults,objectNames,image,wizard,tabs,shell,feature,copy:copy$1},title$2="印刷",preview="印刷プレビュー",file="印刷ファイル:",range$1="印刷範囲",copies="印刷部数",content="印刷内容",toFile="ファイルに出力",direction="印刷方向",order="印刷順序",counter$1="印刷カウンター",date$1="印刷日付",cancel="印刷をキャンセル",connecting$1="プリンターに接続中",connectingPrinter="プリンターに接続中....",printing="印刷中....",complete="印刷が完了しました",pageComplete="{page}ページ目の印刷が完了しました",maximumRows="ページ範囲の最大印刷行数:{rows}行",rewind="巻き戻し",separateLayers="レイヤー別印刷",multipleLabels="マルチラベル印刷",sendTemplate="テンプレートを送信",selectDriver="ドライバーを選択",advancedOptions="詳細設定",paperSavingMode="省紙モード",enabled="有効",disabled="無効",serialCount="シリアル番号数",startRecord="開始レコード",endRecord="終了レコード",pageRange="ページ範囲",rangeExample="例:1-3,8,10 形式",copyCount="部数",template="テンプレート",templateName="テンプレート名",currentAssociations="現在の関連:",sheetRows="{sheet} テーブルに {rows} 行のデータがあります;",driver="ドライバー:",task="タスク:",taskComplete="タスク完了",success="成功:",failed="失敗:",progress="進捗:",firstPage="最初のページ",previousPage="前のページ",currentPage="現在のページ",nextPage="次のページ",lastPage="最後のページ",firstImage="最初の画像",previousImage="前の画像",currentImage="現在の画像",nextImage="次の画像",lastImage="最後の画像",pageSummary="{current}/{totalPages} ページ、全 {total} 枚",previewGenerating="印刷プレビューを生成中...",previewFailed="印刷プレビューの生成に失敗しました",saveTemplateFile="テンプレートファイルを保存",templateFileFilter="テンプレートファイル",templateSaved="テンプレートの保存に成功しました",templateSent="テンプレートの送信に成功しました",errors={connectFailed:"プリンターへの接続に失敗しました",tidReadFailed:"TID の読み取りに失敗しました",pageFailed:"{page}ページ目の印刷に失敗しました",templateSendFailed:"テンプレートの送信に失敗しました",missingDriver:"ドライバーを選択してください",emptyCanvas:"空のキャンバスは印刷またはプレビューできません",missingTemplateName:"テンプレート名を入力してください",startAfterEnd:"開始ページは終了ページより大きくできません",rangeExceeded:"最大印刷ページ範囲を超えました",invalidPage:"無効なページ番号です",invalidPageFormat:"ページ番号の形式が正しくありません",invalidDriverResponse:"JSON レスポンスを取得できません"},jaPrint={title:title$2,preview,file,range:range$1,copies,content,toFile,direction,order,counter:counter$1,date:date$1,continue:"印刷を続行",cancel,connecting:connecting$1,connectingPrinter,printing,complete,pageComplete,maximumRows,rewind,separateLayers,multipleLabels,sendTemplate,selectDriver,default:"デフォルト",advancedOptions,paperSavingMode,enabled,disabled,serialCount,startRecord,endRecord,pageRange,rangeExample,copyCount,template,templateName,currentAssociations,sheetRows,driver,task,taskComplete,success,failed,progress,firstPage,previousPage,currentPage,nextPage,lastPage,firstImage,previousImage,currentImage,nextImage,lastImage,pageSummary,previewGenerating,previewFailed,saveTemplateFile,templateFileFilter,templateSaved,templateSent,errors},title$1="データベース",type="データベースタイプ",name="データベース名",view="データベース表示",path="データベースパス:",serverAddress="データベースサーバーアドレス",serverPort="データベースサーバーポート",userName="データベースユーザー名",password="データベースユーザーパスワード",select="データベースを選択",connect="接続",serverUrl="サーバーURL",filePath="ファイルパス",serverAddressPlaceholder="サーバーアドレス",serverPortPlaceholder="サーバーポート",selectFile="ファイルを選択",sheet="テーブル:",column="列:",hex="16進数",numericWrite="数値書き込み",characterWrite="文字書き込み",deleteCharacters="文字を削除",sheetInstructions="ワークシートを選択し、そのシート上のデータの配置方法を指定してください",previewRows="プレビュー(10行)",selectedSheets="以下のテーブルを選択しました",addAnotherPrompt="他のテーブルを追加しますか?",addAnotherYes="はい、別のテーブルを選択します",addAnotherNo="いいえ、選択を完了しました",selectFailed="データベースの選択に失敗しました",connecting="データベースに接続中",connectionSuccess="データベースの接続に成功しました",connectionFailed$1="データベースの接続に失敗しました",prompts={excelFile:"Excelファイルを選択してください",dbFile:"dbファイルを選択してください",serverAddress:"データベースサーバーアドレスを入力してください",serverPort:"データベースサーバーポートを入力してください",name:"データベース名を入力してください",userName:"データベースユーザー名を入力してください",password:"データベースユーザーパスワードを入力してください"},jaDatabase={title:title$1,type,name,view,path,serverAddress,serverPort,userName,password,select,connect,serverUrl,filePath,serverAddressPlaceholder,serverPortPlaceholder,selectFile,sheet,column,hex,numericWrite,characterWrite,deleteCharacters,sheetInstructions,previewRows,selectedSheets,addAnotherPrompt,addAnotherYes,addAnotherNo,selectFailed,connecting,connectionSuccess,connectionFailed:connectionFailed$1,prompts},title="RFIDタグ",safeArea="セーフエリア",counter="カウンター",settings="RFIDタグ設定",production="RFIDタグ作成",uhfPrint="UHF-RFID印刷",protocol="RFIDタグプロトコル標準",readOffset="RFIDタグ読み取りオフセット",writeContent="タグ書き込み内容",tid="タグ情報エリア(TID)",longbeiContent="ロンベイコード内容",longbeiErrorCorrection="ロンベイコード誤り訂正レベル",guojun="国軍",databaseSource="データベース",status="ステータス",power="パワー",readPower="読み取りパワー",writePower="書き込みパワー",getCurrentValue="デバイスの現在値を取得",crcValidation="RFIDデータCRCチェックあり",commandPassword="コマンドパスワード",oldCommandPassword="旧コマンドパスワード",newCommandPassword="新コマンドパスワード",enterOldCommandPassword="旧コマンドパスワードを入力",enterNewCommandPassword="新コマンドパスワードを入力",accessPassword="アクセスパスワード",oldPassword="旧パスワード",newPassword="新パスワード",manualInput="手動入力",enterEightDigitPassword="8桁のパスワードを入力してください",savePasswordToFile="パスワードをファイルに保存",regionPermissions="エリア権限設定",epcRegion="コードエリア(EPC)",userRegion="ユーザーエリア(User)",reservedRegion="予約エリア(Reserved)",lock="ロック",permanentLock="永久ロック",neverLock="ロックしない",changeKillPassword="Killパスワードを変更",killPassword="Killパスワード",paddingMethod="埋め方法",defaultPadding="デフォルト",padStart$1="前埋め",padEnd="後埋め",dataSource="データソース",hexadecimal="16進数",text="テキスト",date="日付",sequenceGenerator="連番ジェネレーター",enterData="データを入力してください",minimumPaddingDigits="最小埋め桁数",readWrite="読み取り/書き込み可能",readOnly="読み取り専用",configureMemoryProperties="ストレージエリアのプロパティを設定",configureSecurityMode="セキュリティモードを設定",noAuthentication="認証不要",authenticationWithoutSecureCommunication="認証が必要、セキュア通信は不要",authenticationWithSecureCommunication="認証が必要、セキュア通信が必要",unsavedSwitchConfirm="未保存の設定項目があります。切り替えを続行しますか?",deviceDetectionFailed="デバイス検出に失敗しました。エラーコード:{code}、エラー詳細:{detail}",noPrinterFound="プリンターが見つかりませんでした",connectionFailed="接続に失敗しました。エラーコード:{code}、エラー詳細:{detail}",connectedTo="接続先:{device}",oldAndNewPasswordRequired="新パスワードと旧パスワードは空にできません",savePasswordSuccess="パスワードの保存に成功しました",savePasswordFailed="パスワードの保存に失敗しました",passwordRequired="パスワードは空にできません",oldPasswordEightDigits="旧パスワードは8桁である必要があります",newPasswordEightDigits="新パスワードは8桁である必要があります",killPasswordEightDigits="Killパスワードは8桁である必要があります",oldCommandPasswordEightDigits="旧コマンドパスワードは8桁である必要があります",newCommandPasswordEightDigits="新コマンドパスワードは8桁である必要があります",newCommandRequiredForAccessChange="アクセス新パスワードを変更するには、新コマンドパスワードを入力する必要があります",oldCommandRequiredForAccessChange="アクセス新パスワードを変更するには、旧コマンドパスワードを入力する必要があります",changeKillPasswordConfirm="Killパスワードを変更してもよろしいですか?",paddingMultipleOfFour="埋めデータの桁数は4の倍数である必要があります",setFailedWithDetail="設定に失敗しました:{detail}",getFailedWithDetail="取得に失敗しました:{detail}",jaRfid={title,safeArea,counter,settings,production,uhfPrint,protocol,readOffset,writeContent,tid,longbeiContent,longbeiErrorCorrection,guojun,databaseSource,status,power,readPower,writePower,getCurrentValue,crcValidation,commandPassword,oldCommandPassword,newCommandPassword,enterOldCommandPassword,enterNewCommandPassword,accessPassword,oldPassword,newPassword,manualInput,enterEightDigitPassword,savePasswordToFile,regionPermissions,epcRegion,userRegion,reservedRegion,lock,permanentLock,neverLock,changeKillPassword,killPassword,paddingMethod,defaultPadding,padStart:padStart$1,padEnd,dataSource,hexadecimal,text,date,sequenceGenerator,enterData,minimumPaddingDigits,readWrite,readOnly,configureMemoryProperties,configureSecurityMode,noAuthentication,authenticationWithoutSecureCommunication,authenticationWithSecureCommunication,unsavedSwitchConfirm,deviceDetectionFailed,noPrinterFound,connectionFailed,connectedTo,oldAndNewPasswordRequired,savePasswordSuccess,savePasswordFailed,passwordRequired,oldPasswordEightDigits,newPasswordEightDigits,killPasswordEightDigits,oldCommandPasswordEightDigits,newCommandPasswordEightDigits,newCommandRequiredForAccessChange,oldCommandRequiredForAccessChange,changeKillPasswordConfirm,paddingMultipleOfFour,setFailedWithDetail,getFailedWithDetail},invalidPageSize="ページサイズが正しくありません。ラベルサイズ、余白、間隔などを調整してください",pageExceedsSettings="エラー:設定されたページを超えています。ラベルサイズ、余白、間隔などを調整してください",emptyCanvas="空のキャンバスは印刷またはプレビューできません",printFailed="{page}ページ目の印刷に失敗しました",pageRangeExceeded="最大印刷ページ範囲を超えました",printerUnavailable="プリンターが見つかりませんでした",printerConnectionFailed="プリンターに接続できません",databaseSelectionFailed="データベースの選択に失敗しました",networkTimeout="リクエストがタイムアウトしました。ネットワークを確認して再試行してください",unknown="操作に失敗しました。再試行してください",unknownWithCode="操作に失敗しました(エラーコード:{code})。再試行してください",jaErrors={invalidPageSize,pageExceedsSettings,emptyCanvas,printFailed,pageRangeExceeded,printerUnavailable,printerConnectionFailed,databaseSelectionFailed,networkTimeout,unknown,unknownWithCode},baseMessages={"zh-CN":{common:zhCommon,menu:zhMenu,editor:zhEditor,print:zhPrint,database:zhDatabase,rfid:zhRfid,errors:zhErrors},"en-US":{common:enCommon,menu:enMenu,editor:enEditor,print:enPrint,database:enDatabase,rfid:enRfid,errors:enErrors},"ja-JP":{common:jaCommon,menu:jaMenu,editor:jaEditor,print:jaPrint,database:jaDatabase,rfid:jaRfid,errors:jaErrors}};function createDascomI18n({locale:tg=DEFAULT_LOCALE,messages:eg={},missingWarn:gg=!0}={}){const ig={"zh-CN":mergeTrees(baseMessages["zh-CN"],eg["zh-CN"]),"en-US":mergeTrees(baseMessages["en-US"],eg["en-US"]),"ja-JP":mergeTrees(baseMessages["ja-JP"],eg["ja-JP"])};return createI18n({legacy:!1,locale:tg,fallbackLocale:DEFAULT_LOCALE,messages:ig,datetimeFormats:dateTimeFormats,numberFormats,missingWarn:gg})}function mergeDascomI18nMessages(tg,eg={}){for(const gg of["zh-CN","en-US","ja-JP"]){const ig=eg[gg];if(!ig)continue;const ng=tg.global.getLocaleMessage(gg);tg.global.setLocaleMessage(gg,mergeTrees(ng,ig))}}const isRecord=tg=>typeof tg=="object"&&tg!==null;function firstText(...tg){for(const eg of tg)if(typeof eg=="string"&&eg.trim())return eg.trim()}function firstCode(...tg){for(const eg of tg){if(typeof eg=="string"&&eg.trim())return eg.trim();if(typeof eg=="number"&&Number.isFinite(eg))return eg}}function getErrorParts(tg){if(typeof tg=="string")return{detail:tg.trim()||void 0};if(tg instanceof Error)return{code:firstCode(tg.code),detail:firstText(tg.message)};if(!isRecord(tg))return{};const eg=isRecord(tg.response)?tg.response:void 0,gg=isRecord(tg.data)?tg.data:isRecord(eg==null?void 0:eg.data)?eg.data:void 0,ig=isRecord(tg.payload)?tg.payload:void 0;return{code:firstCode(tg.code,tg.status,eg==null?void 0:eg.status,gg==null?void 0:gg.code,ig==null?void 0:ig.code),detail:firstText(tg.message,tg.error,typeof tg.payload=="string"?tg.payload:void 0,ig==null?void 0:ig.message,ig==null?void 0:ig.error,gg==null?void 0:gg.message,gg==null?void 0:gg.error,typeof(eg==null?void 0:eg.data)=="string"?eg.data:void 0)}}const orderedMatchers=[({code:tg,detail:eg})=>/^(?:ETIMEDOUT|ECONNABORTED)$/i.test(String(tg??""))||/(?:timeout|timed out|请求超时|网络超时)/i.test(eg??"")?"errors.networkTimeout":void 0,({detail:tg})=>/^(?:连接不上打印机|无法连接打印机|Unable to connect to printer)$/i.test(tg??"")?"errors.printerConnectionFailed":void 0,({detail:tg})=>/^(?:没有枚举到打印机|未找到打印机|No printer was found)$/i.test(tg??"")?"errors.printerUnavailable":void 0];function toSafeError(tg,eg){const gg=getErrorParts(tg);for(const ig of orderedMatchers){const ng=ig(gg);if(ng)return{key:ng,code:gg.code,logDetail:tg}}return{key:gg.code==null?"errors.unknown":"errors.unknownWithCode",code:gg.code,logDetail:tg}}const editorMessages={"zh-CN":{},"en-US":{}};let activeController=null;function translate(tg,eg){return(activeController==null?void 0:activeController.translate(tg,eg))??tg}function getActiveEditorLocale(){return(activeController==null?void 0:activeController.locale.value)??"zh-CN"}function activateEditorI18n(tg){return activeController=tg,()=>{activeController===tg&&(activeController=null)}}function normalizeEditorLocale(tg){return/^(zh|en|ja)([-_]|$)/i.test(String(tg??"").trim())||console.warn(`[LabelEditor] Unsupported locale "${tg}"; using zh-CN`),normalizeLocale(tg)}function createEditorI18n(tg,eg={}){const gg=ref(tg==null?detectBrowserLocale():normalizeEditorLocale(tg)),ig=createDascomI18n({locale:gg.value,messages:editorMessages});return mergeDascomI18nMessages(ig,eg),{i18n:ig,locale:gg,translate(og,ag){return String(ig.global.t(og,ag??{}))},setMessages(og){mergeDascomI18nMessages(ig,og)},setLocale(og){const ag=normalizeEditorLocale(og);return gg.value=ag,ig.global.locale.value=ag,ag}}}function getEditorAntLocale(tg){return getAntdLocale(normalizeLocale(tg.value))}function useEditorAntLocale(tg){return computed(()=>getEditorAntLocale(tg))}function bindLocaleToElement(tg,eg){const gg=eg.getAttribute("lang"),ig=watch(tg,ng=>eg.setAttribute("lang",ng),{immediate:!0,flush:"sync"});return()=>{ig(),gg==null?eg.removeAttribute("lang"):eg.setAttribute("lang",gg)}}function reuseEditorWithLocale(tg,eg){return eg!=null&&tg.setLocale(eg),tg}function mountEditorApplication(tg,eg,gg,ig){let ng=null;try{return ig(),ng=bindLocaleToElement(gg.locale,eg),tg.mount(eg),ng}catch(og){ng==null||ng();try{tg.unmount()}catch{}throw og}}const normalizeShowLaser=tg=>tg==null?0:typeof tg=="boolean"?tg?16:0:typeof tg=="number"&&tg>0?tg:0,config=reactive({width:85.6,height:54,dpi:203,showVarnish:!1,showLaser:0,layerMaxCount:1,separateLayerMode:!1,layerStyleIndependent:!1,separateLayerCount:2,separateLayerNames:[],enabledTools:null,disabledTools:[],visibleMenus:null,enabledMenuItems:null,disabledMenuItems:[]});function setEditorConfig(tg){if(tg.width!=null&&(config.width=tg.width),tg.height!=null&&(config.height=tg.height),tg.dpi!=null&&(config.dpi=tg.dpi),tg.showVarnish!=null&&(config.showVarnish=tg.showVarnish),tg.separateLayerMode!=null&&(config.separateLayerMode=!!tg.separateLayerMode),tg.layerStyleIndependent!=null&&(config.layerStyleIndependent=!!tg.layerStyleIndependent),tg.layerMaxCount!=null){const eg=Number(tg.layerMaxCount);config.layerMaxCount=Number.isFinite(eg)&&eg>=1?Math.floor(eg):1}if(tg.separateLayerCount!=null){const eg=Number(tg.separateLayerCount);config.separateLayerCount=Number.isFinite(eg)&&eg>=1?Math.floor(eg):2}else config.separateLayerMode&&tg.layerMaxCount!=null&&(config.separateLayerCount=config.layerMaxCount);tg.separateLayerNames!=null&&(config.separateLayerNames=Array.isArray(tg.separateLayerNames)?tg.separateLayerNames.map(eg=>String(eg||"").trim()).filter(Boolean):[]),config.separateLayerMode&&(config.layerMaxCount=config.separateLayerCount),tg.showLaser!=null&&(config.showLaser=normalizeShowLaser(tg.showLaser)),tg.enabledTools!=null&&(config.enabledTools=tg.enabledTools),tg.disabledTools!=null&&(config.disabledTools=tg.disabledTools),tg.visibleMenus!=null&&(config.visibleMenus=tg.visibleMenus),tg.enabledMenuItems!=null&&(config.enabledMenuItems=tg.enabledMenuItems),tg.disabledMenuItems!=null&&(config.disabledMenuItems=tg.disabledMenuItems)}function getEditorConfig(){return config}function isToolEnabled(tg){return config.enabledTools&&config.enabledTools.length>0?config.enabledTools.includes(tg):config.disabledTools.length>0?!config.disabledTools.includes(tg):!0}function isMenuVisible(tg){return config.visibleMenus?config.visibleMenus.includes(tg):!0}function isMenuItemVisible(tg){return config.enabledMenuItems&&config.enabledMenuItems.length>0?config.enabledMenuItems.includes(tg):config.disabledMenuItems.length>0?!config.disabledMenuItems.includes(tg):!0}const _externalLaserList=ref([]),_laserPresets=ref([]),_lastSyncResult=ref(null);function setLaserConfigList(tg){return _externalLaserList.value=tg,_laserPresets.value.length>0?syncExternalPresets():{deletedNames:[],allOutdatedNames:[],newPresets:[]}}function getExternalLaserList(){return _externalLaserList}function getLaserPresets(){return _laserPresets}function getLaserMaxPresets(){return config.showLaser>0?config.showLaser:0}function getLastSyncResult(){return _lastSyncResult}function syncExternalPresets(){const tg=new Set(_externalLaserList.value.map(og=>og.configId)),eg=new Set(_laserPresets.value.map(og=>og.configId)),gg=_externalLaserList.value.filter(og=>!eg.has(og.configId)),ig=_laserPresets.value.filter(og=>!tg.has(og.configId)),ng=ig.map(og=>og.configName);return gg.length>0&&(_laserPresets.value=[..._laserPresets.value,...gg]),ig.length>0&&(_laserPresets.value=_laserPresets.value.filter(og=>tg.has(og.configId))),_lastSyncResult.value={deletedNames:ng,allOutdatedNames:ng,newPresets:gg},{deletedNames:ng,allOutdatedNames:ng,newPresets:gg}}function setLaserPresets(tg){_laserPresets.value=tg}function resetLaserPresetsFromExternal(){_laserPresets.value=JSON.parse(JSON.stringify(_externalLaserList.value))}const state$3=reactive({config:{layerMaxCount:1}});function getLayerMaxCount(tg){const eg=tg??state$3.config.layerMaxCount??1,gg=Number(eg);return!Number.isFinite(gg)||gg<1?1:Math.floor(gg)}function getSysConfigState(){return state$3.config}function setSysConfigState(tg){state$3.config={...tg,DPI:getEditorConfig().dpi,layerMaxCount:getLayerMaxCount(tg==null?void 0:tg.layerMaxCount)}}function getSysState(){return state$3}function t(tg,eg,gg){return(eg=(function(ig){var ng=(function(og,ag){if(typeof og!="object"||!og)return og;var Ig=og[Symbol.toPrimitive];if(Ig!==void 0){var sg=Ig.call(og,ag);if(typeof sg!="object")return sg;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ag==="string"?String:Number)(og)})(ig,"string");return typeof ng=="symbol"?ng:ng+""})(eg))in tg?Object.defineProperty(tg,eg,{value:gg,enumerable:!0,configurable:!0,writable:!0}):tg[eg]=gg,tg}function e(tg,eg){var gg=Object.keys(tg);if(Object.getOwnPropertySymbols){var ig=Object.getOwnPropertySymbols(tg);eg&&(ig=ig.filter((function(ng){return Object.getOwnPropertyDescriptor(tg,ng).enumerable}))),gg.push.apply(gg,ig)}return gg}function s$1(tg){for(var eg=1;eg<arguments.length;eg++){var gg=arguments[eg]!=null?arguments[eg]:{};eg%2?e(Object(gg),!0).forEach((function(ig){t(tg,ig,gg[ig])})):Object.getOwnPropertyDescriptors?Object.defineProperties(tg,Object.getOwnPropertyDescriptors(gg)):e(Object(gg)).forEach((function(ig){Object.defineProperty(tg,ig,Object.getOwnPropertyDescriptor(gg,ig))}))}return tg}function i(tg,eg){if(tg==null)return{};var gg,ig,ng=(function(ag,Ig){if(ag==null)return{};var sg={};for(var Cg in ag)if({}.hasOwnProperty.call(ag,Cg)){if(Ig.indexOf(Cg)>=0)continue;sg[Cg]=ag[Cg]}return sg})(tg,eg);if(Object.getOwnPropertySymbols){var og=Object.getOwnPropertySymbols(tg);for(ig=0;ig<og.length;ig++)gg=og[ig],eg.indexOf(gg)>=0||{}.propertyIsEnumerable.call(tg,gg)&&(ng[gg]=tg[gg])}return ng}function r(tg,eg){return eg||(eg=tg.slice(0)),Object.freeze(Object.defineProperties(tg,{raw:{value:Object.freeze(eg)}}))}let n$1=class{constructor(){t(this,"browserShadowBlurConstant",1),t(this,"DPI",96),t(this,"devicePixelRatio",typeof window<"u"?window.devicePixelRatio:1),t(this,"perfLimitSizeTotal",2097152),t(this,"maxCacheSideLimit",4096),t(this,"minCacheSideLimit",256),t(this,"disableStyleCopyPaste",!1),t(this,"enableGLFiltering",!0),t(this,"textureSize",4096),t(this,"forceGLPutImageData",!1),t(this,"cachesBoundsOfCurve",!1),t(this,"fontPaths",{}),t(this,"NUM_FRACTION_DIGITS",4)}};const o=new class extends n$1{constructor(tg){super(),this.configure(tg)}configure(){let tg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object.assign(this,tg)}addFonts(){let tg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fontPaths=s$1(s$1({},this.fontPaths),tg)}removeFonts(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach((tg=>{delete this.fontPaths[tg]}))}clearFonts(){this.fontPaths={}}restoreDefaults(tg){const eg=new n$1,gg=(tg==null?void 0:tg.reduce(((ig,ng)=>(ig[ng]=eg[ng],ig)),{}))||eg;this.configure(gg)}},a=function(tg){for(var eg=arguments.length,gg=new Array(eg>1?eg-1:0),ig=1;ig<eg;ig++)gg[ig-1]=arguments[ig];return console[tg]("fabric",...gg)};class h extends Error{constructor(eg,gg){super("fabric: ".concat(eg),gg)}}class c extends h{constructor(eg){super("".concat(eg," 'options.signal' is in 'aborted' state"))}}let l$1=class{};class u extends l$1{testPrecision(eg,gg){const ig="precision ".concat(gg,` float;
416
+ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",[I18nWarnCodes.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."};function getWarnMessage(tg,...eg){return format$1(warnMessages[tg],...eg)}function handleFlatJson(tg){if(!isObject$2(tg)||isMessageAST(tg))return tg;for(const eg in tg)if(hasOwn(tg,eg))if(!eg.includes("."))isObject$2(tg[eg])&&handleFlatJson(tg[eg]);else{const gg=eg.split("."),ig=gg.length-1;let ng=tg,og=!1;for(let ag=0;ag<ig;ag++){if(gg[ag]==="__proto__")throw new Error(`unsafe key: ${gg[ag]}`);if(gg[ag]in ng||(ng[gg[ag]]=create$1()),!isObject$2(ng[gg[ag]])){process.env.NODE_ENV!=="production"&&warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN,{key:gg[ag]})),og=!0;break}ng=ng[gg[ag]]}if(og||(isMessageAST(ng)?AST_NODE_PROPS_KEYS.includes(gg[ig])||delete tg[eg]:(ng[gg[ig]]=tg[eg],delete tg[eg])),!isMessageAST(ng)){const ag=ng[gg[ig]];isObject$2(ag)&&handleFlatJson(ag)}}return tg}function getLocaleMessages(tg,eg){const{messages:gg,__i18n:ig,messageResolver:ng,flatJson:og}=eg,ag=isPlainObject$1(gg)?gg:isArray$1(ig)?create$1():{[tg]:create$1()};if(isArray$1(ig)&&ig.forEach(Ig=>{if("locale"in Ig&&"resource"in Ig){const{locale:sg,resource:Cg}=Ig;sg?(ag[sg]=ag[sg]||create$1(),deepCopy(Cg,ag[sg])):deepCopy(Cg,ag)}else isString$2(Ig)&&deepCopy(JSON.parse(Ig),ag)}),ng==null&&og)for(const Ig in ag)hasOwn(ag,Ig)&&handleFlatJson(ag[Ig]);return ag}function getComponentOptions(tg){return tg.type}function adjustI18nResources(tg,eg,gg){let ig=isObject$2(eg.messages)?eg.messages:create$1();"__i18nGlobal"in gg&&(ig=getLocaleMessages(tg.locale.value,{messages:ig,__i18n:gg.__i18nGlobal}));const ng=Object.keys(ig);ng.length&&ng.forEach(og=>{tg.mergeLocaleMessage(og,ig[og])});{if(isObject$2(eg.datetimeFormats)){const og=Object.keys(eg.datetimeFormats);og.length&&og.forEach(ag=>{tg.mergeDateTimeFormat(ag,eg.datetimeFormats[ag])})}if(isObject$2(eg.numberFormats)){const og=Object.keys(eg.numberFormats);og.length&&og.forEach(ag=>{tg.mergeNumberFormat(ag,eg.numberFormats[ag])})}}}function createTextNode(tg){return createVNode(Text,null,tg,0)}function getCurrentInstance(){return getCurrentInstance$1()}const DEVTOOLS_META="__INTLIFY_META__",NOOP_RETURN_ARRAY=()=>[],NOOP_RETURN_FALSE=()=>!1;let composerID=0;function defineCoreMissingHandler(tg){return((eg,gg,ig,ng)=>tg(gg,ig,getCurrentInstance()||void 0,ng))}const getMetaInfo=()=>{const tg=getCurrentInstance();let eg=null;return tg&&(eg=getComponentOptions(tg)[DEVTOOLS_META])?{[DEVTOOLS_META]:eg}:null};function createComposer(tg={}){const{__root:eg,__injectWithOption:gg}=tg,ig=eg===void 0,ng=tg.flatJson,og=inBrowser$1?ref:shallowRef;let ag=isBoolean$1(tg.inheritLocale)?tg.inheritLocale:!0;const Ig=og(eg&&ag?eg.locale.value:isString$2(tg.locale)?tg.locale:DEFAULT_LOCALE$1),sg=og(eg&&ag?eg.fallbackLocale.value:isString$2(tg.fallbackLocale)||isArray$1(tg.fallbackLocale)||isPlainObject$1(tg.fallbackLocale)||tg.fallbackLocale===!1?tg.fallbackLocale:Ig.value),Cg=og(getLocaleMessages(Ig.value,tg)),lg=og(isPlainObject$1(tg.datetimeFormats)?tg.datetimeFormats:{[Ig.value]:{}}),Ag=og(isPlainObject$1(tg.numberFormats)?tg.numberFormats:{[Ig.value]:{}});let cg=eg?eg.missingWarn:isBoolean$1(tg.missingWarn)||isRegExp$1(tg.missingWarn)?tg.missingWarn:!0,rg=eg?eg.fallbackWarn:isBoolean$1(tg.fallbackWarn)||isRegExp$1(tg.fallbackWarn)?tg.fallbackWarn:!0,ug=eg?eg.fallbackRoot:isBoolean$1(tg.fallbackRoot)?tg.fallbackRoot:!0,dg=!!tg.fallbackFormat,bg=isFunction(tg.missing)?tg.missing:null,mg=isFunction(tg.missing)?defineCoreMissingHandler(tg.missing):null,hg=isFunction(tg.postTranslation)?tg.postTranslation:null,pg=eg?eg.warnHtmlMessage:isBoolean$1(tg.warnHtmlMessage)?tg.warnHtmlMessage:!0,fg=!!tg.escapeParameter;const wg=eg?eg.modifiers:isPlainObject$1(tg.modifiers)?tg.modifiers:{};let Gg=tg.pluralRules||eg&&eg.pluralRules,Zg;Zg=(()=>{ig&&setFallbackContext(null);const oa={version:VERSION,locale:Ig.value,fallbackLocale:sg.value,messages:Cg.value,modifiers:wg,pluralRules:Gg,missing:mg===null?void 0:mg,missingWarn:cg,fallbackWarn:rg,fallbackFormat:dg,unresolving:!0,postTranslation:hg===null?void 0:hg,warnHtmlMessage:pg,escapeParameter:fg,messageResolver:tg.messageResolver,messageCompiler:tg.messageCompiler,__meta:{framework:"vue"}};oa.datetimeFormats=lg.value,oa.numberFormats=Ag.value,oa.__datetimeFormatters=isPlainObject$1(Zg)?Zg.__datetimeFormatters:void 0,oa.__numberFormatters=isPlainObject$1(Zg)?Zg.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(oa.__v_emitter=isPlainObject$1(Zg)?Zg.__v_emitter:void 0);const ha=createCoreContext(oa);return ig&&setFallbackContext(ha),ha})(),updateFallbackLocale(Zg,Ig.value,sg.value);function Bg(){return[Ig.value,sg.value,Cg.value,lg.value,Ag.value]}const Wg=computed({get:()=>Ig.value,set:oa=>{Zg.locale=oa,Ig.value=oa}}),$g=computed({get:()=>sg.value,set:oa=>{Zg.fallbackLocale=oa,sg.value=oa,updateFallbackLocale(Zg,Ig.value,oa)}}),Ng=computed(()=>Cg.value),vg=computed(()=>lg.value),Xg=computed(()=>Ag.value);function Vg(){return isFunction(hg)?hg:null}function Mg(oa){hg=oa,Zg.postTranslation=oa}function Rg(){return bg}function Sg(oa){oa!==null&&(mg=defineCoreMissingHandler(oa)),bg=oa,Zg.missing=mg}function Yg(oa,ha){return oa!=="translate"||!ha.resolvedMessage}const xg=(oa,ha,nI,cI,dI,pI)=>{Bg();let Ug;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,ig||(Zg.fallbackContext=eg?getFallbackContext():void 0),Ug=oa(Zg)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,ig||(Zg.fallbackContext=void 0)}if(nI!=="translate exists"&&isNumber$2(Ug)&&Ug===NOT_REOSLVED||nI==="translate exists"&&!Ug){const[La,aI]=ha();if(process.env.NODE_ENV!=="production"&&eg&&isString$2(La)&&Yg(nI,aI)&&(ug&&(isTranslateFallbackWarn(rg,La)||isTranslateMissingWarn(cg,La))&&warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT,{key:La,type:nI})),process.env.NODE_ENV!=="production")){const{__v_emitter:CI}=Zg;CI&&ug&&CI.emit("fallback",{type:nI,key:La,to:"global",groupId:`${nI}:${La}`})}return eg&&ug?cI(eg):dI(La)}else{if(pI(Ug))return Ug;throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE)}};function Og(...oa){return xg(ha=>Reflect.apply(translate$1,null,[ha,...oa]),()=>parseTranslateArgs(...oa),"translate",ha=>Reflect.apply(ha.t,ha,[...oa]),ha=>ha,ha=>isString$2(ha))}function Kg(...oa){const[ha,nI,cI]=oa;if(cI&&!isObject$2(cI))throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);return Og(ha,nI,assign$2({resolvedMessage:!0},cI||{}))}function Dg(...oa){return xg(ha=>Reflect.apply(datetime,null,[ha,...oa]),()=>parseDateTimeArgs(...oa),"datetime format",ha=>Reflect.apply(ha.d,ha,[...oa]),()=>MISSING_RESOLVE_VALUE,ha=>isString$2(ha)||isArray$1(ha))}function Fg(...oa){return xg(ha=>Reflect.apply(number,null,[ha,...oa]),()=>parseNumberArgs(...oa),"number format",ha=>Reflect.apply(ha.n,ha,[...oa]),()=>MISSING_RESOLVE_VALUE,ha=>isString$2(ha)||isArray$1(ha))}function Tg(oa){return oa.map(ha=>isString$2(ha)||isNumber$2(ha)||isBoolean$1(ha)?createTextNode(String(ha)):ha)}const Eg={normalize:Tg,interpolate:oa=>oa,type:"vnode"};function co(...oa){return xg(ha=>{let nI;const cI=ha;try{cI.processor=Eg,nI=Reflect.apply(translate$1,null,[cI,...oa])}finally{cI.processor=null}return nI},()=>parseTranslateArgs(...oa),"translate",ha=>ha[TranslateVNodeSymbol](...oa),ha=>[createTextNode(ha)],ha=>isArray$1(ha))}function da(...oa){return xg(ha=>Reflect.apply(number,null,[ha,...oa]),()=>parseNumberArgs(...oa),"number format",ha=>ha[NumberPartsSymbol](...oa),NOOP_RETURN_ARRAY,ha=>isString$2(ha)||isArray$1(ha))}function ma(...oa){return xg(ha=>Reflect.apply(datetime,null,[ha,...oa]),()=>parseDateTimeArgs(...oa),"datetime format",ha=>ha[DatetimePartsSymbol](...oa),NOOP_RETURN_ARRAY,ha=>isString$2(ha)||isArray$1(ha))}function pa(oa){Gg=oa,Zg.pluralRules=Gg}function eI(oa,ha){return xg(()=>{if(!oa)return!1;const nI=isString$2(ha)?ha:Ig.value,cI=isString$2(ha)?[nI]:fallbackWithLocaleChain(Zg,sg.value,nI);for(let dI=0;dI<cI.length;dI++){const pI=uo(cI[dI]);let Ug=Zg.messageResolver(pI,oa);if(Ug===null&&(Ug=pI[oa]),isMessageAST(Ug)||isMessageFunction(Ug)||isString$2(Ug))return!0}return!1},()=>[oa],"translate exists",nI=>Reflect.apply(nI.te,nI,[oa,ha]),NOOP_RETURN_FALSE,nI=>isBoolean$1(nI))}function Qg(oa){let ha=null;const nI=fallbackWithLocaleChain(Zg,sg.value,Ig.value);for(let cI=0;cI<nI.length;cI++){const dI=Cg.value[nI[cI]]||{},pI=Zg.messageResolver(dI,oa);if(pI!=null){ha=pI;break}}return ha}function Ca(oa){const ha=Qg(oa);return ha??(eg?eg.tm(oa)||{}:{})}function uo(oa){return Cg.value[oa]||{}}function eo(oa,ha){if(ng){const nI={[oa]:ha};for(const cI in nI)hasOwn(nI,cI)&&handleFlatJson(nI[cI]);ha=nI[oa]}Cg.value[oa]=ha,Zg.messages=Cg.value}function no(oa,ha){Cg.value[oa]=Cg.value[oa]||{};const nI={[oa]:ha};if(ng)for(const cI in nI)hasOwn(nI,cI)&&handleFlatJson(nI[cI]);ha=nI[oa],deepCopy(ha,Cg.value[oa]),Zg.messages=Cg.value}function kg(oa){return lg.value[oa]||{}}function Lg(oa,ha){lg.value[oa]=ha,Zg.datetimeFormats=lg.value,clearDateTimeFormat(Zg,oa,ha)}function Pg(oa,ha){lg.value[oa]=assign$2(lg.value[oa]||{},ha),Zg.datetimeFormats=lg.value,clearDateTimeFormat(Zg,oa,ha)}function ua(oa){return Ag.value[oa]||{}}function ya(oa,ha){Ag.value[oa]=ha,Zg.numberFormats=Ag.value,clearNumberFormat(Zg,oa,ha)}function oI(oa,ha){Ag.value[oa]=assign$2(Ag.value[oa]||{},ha),Zg.numberFormats=Ag.value,clearNumberFormat(Zg,oa,ha)}composerID++,eg&&inBrowser$1&&(watch(eg.locale,oa=>{ag&&(Ig.value=oa,Zg.locale=oa,updateFallbackLocale(Zg,Ig.value,sg.value))}),watch(eg.fallbackLocale,oa=>{ag&&(sg.value=oa,Zg.fallbackLocale=oa,updateFallbackLocale(Zg,Ig.value,sg.value))}));const iI={id:composerID,locale:Wg,fallbackLocale:$g,get inheritLocale(){return ag},set inheritLocale(oa){ag=oa,oa&&eg&&(Ig.value=eg.locale.value,sg.value=eg.fallbackLocale.value,updateFallbackLocale(Zg,Ig.value,sg.value))},get availableLocales(){return Object.keys(Cg.value).sort()},messages:Ng,get modifiers(){return wg},get pluralRules(){return Gg||{}},get isGlobal(){return ig},get missingWarn(){return cg},set missingWarn(oa){cg=oa,Zg.missingWarn=cg},get fallbackWarn(){return rg},set fallbackWarn(oa){rg=oa,Zg.fallbackWarn=rg},get fallbackRoot(){return ug},set fallbackRoot(oa){ug=oa},get fallbackFormat(){return dg},set fallbackFormat(oa){dg=oa,Zg.fallbackFormat=dg},get warnHtmlMessage(){return pg},set warnHtmlMessage(oa){pg=oa,Zg.warnHtmlMessage=oa},get escapeParameter(){return fg},set escapeParameter(oa){fg=oa,Zg.escapeParameter=oa},t:Og,getLocaleMessage:uo,setLocaleMessage:eo,mergeLocaleMessage:no,getPostTranslationHandler:Vg,setPostTranslationHandler:Mg,getMissingHandler:Rg,setMissingHandler:Sg,[SetPluralRulesSymbol]:pa};return iI.datetimeFormats=vg,iI.numberFormats=Xg,iI.rt=Kg,iI.te=eI,iI.tm=Ca,iI.d=Dg,iI.n=Fg,iI.getDateTimeFormat=kg,iI.setDateTimeFormat=Lg,iI.mergeDateTimeFormat=Pg,iI.getNumberFormat=ua,iI.setNumberFormat=ya,iI.mergeNumberFormat=oI,iI[InejctWithOptionSymbol]=gg,iI[TranslateVNodeSymbol]=co,iI[DatetimePartsSymbol]=ma,iI[NumberPartsSymbol]=da,process.env.NODE_ENV!=="production"&&(iI[EnableEmitter]=oa=>{Zg.__v_emitter=oa},iI[DisableEmitter]=()=>{Zg.__v_emitter=void 0}),iI}const VUE_I18N_COMPONENT_TYPES="vue-i18n: composer properties",VueDevToolsLabels={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},VueDevToolsPlaceholders={"vue-i18n-resource-inspector":"Search for scopes ..."},VueDevToolsTimelineColors={"vue-i18n-timeline":16764185};let devtoolsApi;async function enableDevTools(tg,eg){return new Promise((gg,ig)=>{try{setupDevtoolsPlugin({id:"vue-devtools-plugin-vue-i18n",label:VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[VUE_I18N_COMPONENT_TYPES],app:tg},ng=>{devtoolsApi=ng,ng.on.visitComponentTree(({componentInstance:ag,treeNode:Ig})=>{updateComponentTreeTags(ag,Ig,eg)}),ng.on.inspectComponent(({componentInstance:ag,instanceData:Ig})=>{ag.__VUE_I18N__&&Ig&&(eg.mode==="legacy"?ag.__VUE_I18N__!==eg.global.__composer&&inspectComposer(Ig,ag.__VUE_I18N__):inspectComposer(Ig,ag.__VUE_I18N__))}),ng.addInspector({id:"vue-i18n-resource-inspector",label:VueDevToolsLabels["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:VueDevToolsPlaceholders["vue-i18n-resource-inspector"]}),ng.on.getInspectorTree(ag=>{ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector"&&registerScope(ag,eg)});const og=new Map;ng.on.getInspectorState(async ag=>{if(ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector")if(ng.unhighlightElement(),inspectScope(ag,eg),ag.nodeId==="global"){if(!og.has(ag.app)){const[Ig]=await ng.getComponentInstances(ag.app);og.set(ag.app,Ig)}ng.highlightElement(og.get(ag.app))}else{const Ig=getComponentInstance$1(ag.nodeId,eg);Ig&&ng.highlightElement(Ig)}}),ng.on.editInspectorState(ag=>{ag.app===tg&&ag.inspectorId==="vue-i18n-resource-inspector"&&editScope(ag,eg)}),ng.addTimelineLayer({id:"vue-i18n-timeline",label:VueDevToolsLabels["vue-i18n-timeline"],color:VueDevToolsTimelineColors["vue-i18n-timeline"]}),gg(!0)})}catch(ng){console.error(ng),ig(!1)}})}function getI18nScopeLable(tg){return tg.type.name||tg.type.displayName||tg.type.__file||"Anonymous"}function updateComponentTreeTags(tg,eg,gg){const ig=gg.mode==="composition"?gg.global:gg.global.__composer;if(tg&&tg.__VUE_I18N__&&tg.__VUE_I18N__!==ig){const ng={label:`i18n (${getI18nScopeLable(tg)} Scope)`,textColor:0,backgroundColor:16764185};eg.tags.push(ng)}}function inspectComposer(tg,eg){const gg=VUE_I18N_COMPONENT_TYPES;tg.state.push({type:gg,key:"locale",editable:!0,value:eg.locale.value}),tg.state.push({type:gg,key:"availableLocales",editable:!1,value:eg.availableLocales}),tg.state.push({type:gg,key:"fallbackLocale",editable:!0,value:eg.fallbackLocale.value}),tg.state.push({type:gg,key:"inheritLocale",editable:!0,value:eg.inheritLocale}),tg.state.push({type:gg,key:"messages",editable:!1,value:getLocaleMessageValue(eg.messages.value)}),tg.state.push({type:gg,key:"datetimeFormats",editable:!1,value:eg.datetimeFormats.value}),tg.state.push({type:gg,key:"numberFormats",editable:!1,value:eg.numberFormats.value})}function getLocaleMessageValue(tg){const eg={};return Object.keys(tg).forEach(gg=>{const ig=tg[gg];isFunction(ig)&&"source"in ig?eg[gg]=getMessageFunctionDetails(ig):isMessageAST(ig)&&ig.loc&&ig.loc.source?eg[gg]=ig.loc.source:isObject$2(ig)?eg[gg]=getLocaleMessageValue(ig):eg[gg]=ig}),eg}const ESC={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function escape$1(tg){return tg.replace(/[<>"&]/g,escapeChar)}function escapeChar(tg){return ESC[tg]||tg}function getMessageFunctionDetails(tg){return{_custom:{type:"function",display:`<span>ƒ</span> ${tg.source?`("${escape$1(tg.source)}")`:"(?)"}`}}}function registerScope(tg,eg){tg.rootNodes.push({id:"global",label:"Global Scope"});const gg=eg.mode==="composition"?eg.global:eg.global.__composer;for(const[ig,ng]of eg.__instances){const og=eg.mode==="composition"?ng:ng.__composer;gg!==og&&tg.rootNodes.push({id:og.id.toString(),label:`${getI18nScopeLable(ig)} Scope`})}}function getComponentInstance$1(tg,eg){let gg=null;if(tg!=="global"){for(const[ig,ng]of eg.__instances.entries())if(ng.id.toString()===tg){gg=ig;break}}return gg}function getComposer$2(tg,eg){if(tg==="global")return eg.mode==="composition"?eg.global:eg.global.__composer;{const gg=Array.from(eg.__instances.values()).find(ig=>ig.id.toString()===tg);return gg?eg.mode==="composition"?gg:gg.__composer:null}}function inspectScope(tg,eg){const gg=getComposer$2(tg.nodeId,eg);return gg&&(tg.state=makeScopeInspectState(gg)),null}function makeScopeInspectState(tg){const eg={},gg="Locale related info",ig=[{type:gg,key:"locale",editable:!0,value:tg.locale.value},{type:gg,key:"fallbackLocale",editable:!0,value:tg.fallbackLocale.value},{type:gg,key:"availableLocales",editable:!1,value:tg.availableLocales},{type:gg,key:"inheritLocale",editable:!0,value:tg.inheritLocale}];eg[gg]=ig;const ng="Locale messages info",og=[{type:ng,key:"messages",editable:!1,value:getLocaleMessageValue(tg.messages.value)}];eg[ng]=og;{const ag="Datetime formats info",Ig=[{type:ag,key:"datetimeFormats",editable:!1,value:tg.datetimeFormats.value}];eg[ag]=Ig;const sg="Datetime formats info",Cg=[{type:sg,key:"numberFormats",editable:!1,value:tg.numberFormats.value}];eg[sg]=Cg}return eg}function addTimelineEvent(tg,eg){if(devtoolsApi){let gg;eg&&"groupId"in eg&&(gg=eg.groupId,delete eg.groupId),devtoolsApi.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:tg,groupId:gg,time:Date.now(),meta:{},data:eg||{},logType:tg==="compile-error"?"error":tg==="fallback"||tg==="missing"?"warning":"default"}})}}function editScope(tg,eg){const gg=getComposer$2(tg.nodeId,eg);if(gg){const[ig]=tg.path;ig==="locale"&&isString$2(tg.state.value)?gg.locale.value=tg.state.value:ig==="fallbackLocale"&&(isString$2(tg.state.value)||isArray$1(tg.state.value)||isObject$2(tg.state.value))?gg.fallbackLocale.value=tg.state.value:ig==="inheritLocale"&&isBoolean$1(tg.state.value)&&(gg.inheritLocale=tg.state.value)}}function convertComposerOptions(tg){const eg=isString$2(tg.locale)?tg.locale:DEFAULT_LOCALE$1,gg=isString$2(tg.fallbackLocale)||isArray$1(tg.fallbackLocale)||isPlainObject$1(tg.fallbackLocale)||tg.fallbackLocale===!1?tg.fallbackLocale:eg,ig=isFunction(tg.missing)?tg.missing:void 0,ng=isBoolean$1(tg.silentTranslationWarn)||isRegExp$1(tg.silentTranslationWarn)?!tg.silentTranslationWarn:!0,og=isBoolean$1(tg.silentFallbackWarn)||isRegExp$1(tg.silentFallbackWarn)?!tg.silentFallbackWarn:!0,ag=isBoolean$1(tg.fallbackRoot)?tg.fallbackRoot:!0,Ig=!!tg.formatFallbackMessages,sg=isPlainObject$1(tg.modifiers)?tg.modifiers:{},Cg=tg.pluralizationRules,lg=isFunction(tg.postTranslation)?tg.postTranslation:void 0,Ag=isString$2(tg.warnHtmlInMessage)?tg.warnHtmlInMessage!=="off":!0,cg=!!tg.escapeParameterHtml,rg=isBoolean$1(tg.sync)?tg.sync:!0;let ug=tg.messages;if(isPlainObject$1(tg.sharedMessages)){const wg=tg.sharedMessages;ug=Object.keys(wg).reduce((Zg,yg)=>{const Bg=Zg[yg]||(Zg[yg]={});return assign$2(Bg,wg[yg]),Zg},ug||{})}const{__i18n:dg,__root:bg,__injectWithOption:mg}=tg,hg=tg.datetimeFormats,pg=tg.numberFormats,fg=tg.flatJson;return{locale:eg,fallbackLocale:gg,messages:ug,flatJson:fg,datetimeFormats:hg,numberFormats:pg,missing:ig,missingWarn:ng,fallbackWarn:og,fallbackRoot:ag,fallbackFormat:Ig,modifiers:sg,pluralRules:Cg,postTranslation:lg,warnHtmlMessage:Ag,escapeParameter:cg,messageResolver:tg.messageResolver,inheritLocale:rg,__i18n:dg,__root:bg,__injectWithOption:mg}}function createVueI18n(tg={}){const eg=createComposer(convertComposerOptions(tg)),{__extender:gg}=tg,ig={id:eg.id,get locale(){return eg.locale.value},set locale(ng){eg.locale.value=ng},get fallbackLocale(){return eg.fallbackLocale.value},set fallbackLocale(ng){eg.fallbackLocale.value=ng},get messages(){return eg.messages.value},get datetimeFormats(){return eg.datetimeFormats.value},get numberFormats(){return eg.numberFormats.value},get availableLocales(){return eg.availableLocales},get missing(){return eg.getMissingHandler()},set missing(ng){eg.setMissingHandler(ng)},get silentTranslationWarn(){return isBoolean$1(eg.missingWarn)?!eg.missingWarn:eg.missingWarn},set silentTranslationWarn(ng){eg.missingWarn=isBoolean$1(ng)?!ng:ng},get silentFallbackWarn(){return isBoolean$1(eg.fallbackWarn)?!eg.fallbackWarn:eg.fallbackWarn},set silentFallbackWarn(ng){eg.fallbackWarn=isBoolean$1(ng)?!ng:ng},get modifiers(){return eg.modifiers},get formatFallbackMessages(){return eg.fallbackFormat},set formatFallbackMessages(ng){eg.fallbackFormat=ng},get postTranslation(){return eg.getPostTranslationHandler()},set postTranslation(ng){eg.setPostTranslationHandler(ng)},get sync(){return eg.inheritLocale},set sync(ng){eg.inheritLocale=ng},get warnHtmlInMessage(){return eg.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(ng){eg.warnHtmlMessage=ng!=="off"},get escapeParameterHtml(){return eg.escapeParameter},set escapeParameterHtml(ng){eg.escapeParameter=ng},get pluralizationRules(){return eg.pluralRules||{}},__composer:eg,t(...ng){return Reflect.apply(eg.t,eg,[...ng])},rt(...ng){return Reflect.apply(eg.rt,eg,[...ng])},te(ng,og){return eg.te(ng,og)},tm(ng){return eg.tm(ng)},getLocaleMessage(ng){return eg.getLocaleMessage(ng)},setLocaleMessage(ng,og){eg.setLocaleMessage(ng,og)},mergeLocaleMessage(ng,og){eg.mergeLocaleMessage(ng,og)},d(...ng){return Reflect.apply(eg.d,eg,[...ng])},getDateTimeFormat(ng){return eg.getDateTimeFormat(ng)},setDateTimeFormat(ng,og){eg.setDateTimeFormat(ng,og)},mergeDateTimeFormat(ng,og){eg.mergeDateTimeFormat(ng,og)},n(...ng){return Reflect.apply(eg.n,eg,[...ng])},getNumberFormat(ng){return eg.getNumberFormat(ng)},setNumberFormat(ng,og){eg.setNumberFormat(ng,og)},mergeNumberFormat(ng,og){eg.mergeNumberFormat(ng,og)}};return ig.__extender=gg,process.env.NODE_ENV!=="production"&&(ig.__enableEmitter=ng=>{const og=eg;og[EnableEmitter]&&og[EnableEmitter](ng)},ig.__disableEmitter=()=>{const ng=eg;ng[DisableEmitter]&&ng[DisableEmitter]()}),ig}function defineMixin(tg,eg,gg){return{beforeCreate(){const ig=getCurrentInstance();if(!ig)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ng=this.$options;if(ng.i18n){const og=ng.i18n;if(ng.__i18n&&(og.__i18n=ng.__i18n),og.__root=eg,this===this.$root)this.$i18n=mergeToGlobal(tg,og);else{og.__injectWithOption=!0,og.__extender=gg.__vueI18nExtend,this.$i18n=createVueI18n(og);const ag=this.$i18n;ag.__extender&&(ag.__disposer=ag.__extender(this.$i18n))}}else if(ng.__i18n)if(this===this.$root)this.$i18n=mergeToGlobal(tg,ng);else{this.$i18n=createVueI18n({__i18n:ng.__i18n,__injectWithOption:!0,__extender:gg.__vueI18nExtend,__root:eg});const og=this.$i18n;og.__extender&&(og.__disposer=og.__extender(this.$i18n))}else this.$i18n=tg;ng.__i18nGlobal&&adjustI18nResources(eg,ng,ng),this.$t=(...og)=>this.$i18n.t(...og),this.$rt=(...og)=>this.$i18n.rt(...og),this.$te=(og,ag)=>this.$i18n.te(og,ag),this.$d=(...og)=>this.$i18n.d(...og),this.$n=(...og)=>this.$i18n.n(...og),this.$tm=og=>this.$i18n.tm(og),gg.__setInstance(ig,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$i18n){const ig=getCurrentInstance();if(!ig)return;const ng=this.$i18n;ig.__VUE_I18N__=ng.__composer;const og=this.__v_emitter=createEmitter();ng.__enableEmitter&&ng.__enableEmitter(og),og.on("*",addTimelineEvent)}},unmounted(){const ig=getCurrentInstance();if(!ig)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ng=this.$i18n;process.env.NODE_ENV!=="production"&&ig.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",addTimelineEvent),delete this.__v_emitter),ng&&(ng.__disableEmitter&&ng.__disableEmitter(),delete ig.__VUE_I18N__)),ng&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,ng!=null&&ng.__disposer&&(ng.__disposer(),delete ng.__disposer,delete ng.__extender),gg.__deleteInstance(ig),delete this.$i18n)}}}function mergeToGlobal(tg,eg){tg.locale=eg.locale||tg.locale,tg.fallbackLocale=eg.fallbackLocale||tg.fallbackLocale,tg.missing=eg.missing||tg.missing,tg.silentTranslationWarn=eg.silentTranslationWarn||tg.silentFallbackWarn,tg.silentFallbackWarn=eg.silentFallbackWarn||tg.silentFallbackWarn,tg.formatFallbackMessages=eg.formatFallbackMessages||tg.formatFallbackMessages,tg.postTranslation=eg.postTranslation||tg.postTranslation,tg.warnHtmlInMessage=eg.warnHtmlInMessage||tg.warnHtmlInMessage,tg.escapeParameterHtml=eg.escapeParameterHtml||tg.escapeParameterHtml,tg.sync=eg.sync||tg.sync,tg.__composer[SetPluralRulesSymbol](eg.pluralizationRules||tg.pluralizationRules);const gg=getLocaleMessages(tg.locale,{messages:eg.messages,__i18n:eg.__i18n});return Object.keys(gg).forEach(ig=>tg.mergeLocaleMessage(ig,gg[ig])),eg.datetimeFormats&&Object.keys(eg.datetimeFormats).forEach(ig=>tg.mergeDateTimeFormat(ig,eg.datetimeFormats[ig])),eg.numberFormats&&Object.keys(eg.numberFormats).forEach(ig=>tg.mergeNumberFormat(ig,eg.numberFormats[ig])),tg}const baseFormatProps={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:tg=>tg==="parent"||tg==="global",default:"parent"},i18n:{type:Object}};function getInterpolateArg({slots:tg},eg){return eg.length===1&&eg[0]==="default"?(tg.default?tg.default():[]).reduce((ig,ng)=>[...ig,...ng.type===Fragment?ng.children:[ng]],[]):eg.reduce((gg,ig)=>{const ng=tg[ig];return ng&&(gg[ig]=ng()),gg},create$1())}function getFragmentableTag(){return Fragment}const TranslationImpl=defineComponent({name:"i18n-t",props:assign$2({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:tg=>isNumber$2(tg)||!isNaN(tg)}},baseFormatProps),setup(tg,eg){const{slots:gg,attrs:ig}=eg,ng=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return()=>{const og=()=>{const sg=Object.keys(gg).filter(Ag=>Ag[0]!=="_"),Cg=create$1();tg.locale&&(Cg.locale=tg.locale),tg.plural!==void 0&&(Cg.plural=isString$2(tg.plural)?+tg.plural:tg.plural);const lg=getInterpolateArg(eg,sg);return ng[TranslateVNodeSymbol](tg.keypath,lg,Cg)},ag=assign$2(create$1(),ig),Ig=isString$2(tg.tag)||isObject$2(tg.tag)?tg.tag:getFragmentableTag();return isObject$2(Ig)?h$2(Ig,ag,{default:og}):h$2(Ig,ag,og())}}}),Translation=TranslationImpl;function isVNode(tg){return isArray$1(tg)&&!isString$2(tg[0])}function renderFormatter(tg,eg,gg,ig){const{slots:ng,attrs:og}=eg;return()=>{const ag=()=>{const Cg={part:!0};let lg=create$1();tg.locale&&(Cg.locale=tg.locale),isString$2(tg.format)?Cg.key=tg.format:isObject$2(tg.format)&&(isString$2(tg.format.key)&&(Cg.key=tg.format.key),lg=Object.keys(tg.format).reduce((rg,ug)=>gg.includes(ug)?assign$2(create$1(),rg,{[ug]:tg.format[ug]}):rg,create$1()));const Ag=ig(tg.value,Cg,lg);let cg=[Cg.key];return isArray$1(Ag)?cg=Ag.map((rg,ug)=>{const dg=ng[rg.type],bg=dg?dg({[rg.type]:rg.value,index:ug,parts:Ag}):[rg.value];return isVNode(bg)&&(bg[0].key=`${rg.type}-${ug}`),bg}):isString$2(Ag)&&(cg=[Ag]),cg},Ig=assign$2(create$1(),og),sg=isString$2(tg.tag)||isObject$2(tg.tag)?tg.tag:getFragmentableTag();return isObject$2(sg)?h$2(sg,Ig,{default:ag}):h$2(sg,Ig,ag())}}const NumberFormatImpl=defineComponent({name:"i18n-n",props:assign$2({value:{type:Number,required:!0},format:{type:[String,Object]}},baseFormatProps),setup(tg,eg){const gg=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return renderFormatter(tg,eg,NUMBER_FORMAT_OPTIONS_KEYS,(...ig)=>gg[NumberPartsSymbol](...ig))}}),NumberFormat=NumberFormatImpl;function getComposer$1(tg,eg){const gg=tg;if(tg.mode==="composition")return gg.__getInstance(eg)||tg.global;{const ig=gg.__getInstance(eg);return ig!=null?ig.__composer:tg.global.__composer}}function vTDirective(tg){const eg=ag=>{process.env.NODE_ENV!=="production"&&warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:Ig,value:sg}=ag;if(!Ig||!Ig.$)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const Cg=getComposer$1(tg,Ig.$),lg=parseValue(sg);return[Reflect.apply(Cg.t,Cg,[...makeParams(lg)]),Cg]};return{created:(ag,Ig)=>{const[sg,Cg]=eg(Ig);inBrowser$1&&(ag.__i18nWatcher=watch(Cg.locale,()=>{Ig.instance&&Ig.instance.$forceUpdate()})),ag.__composer=Cg,ag.textContent=sg},unmounted:ag=>{inBrowser$1&&ag.__i18nWatcher&&(ag.__i18nWatcher(),ag.__i18nWatcher=void 0,delete ag.__i18nWatcher),ag.__composer&&(ag.__composer=void 0,delete ag.__composer)},beforeUpdate:(ag,{value:Ig})=>{if(ag.__composer){const sg=ag.__composer,Cg=parseValue(Ig);ag.textContent=Reflect.apply(sg.t,sg,[...makeParams(Cg)])}},getSSRProps:ag=>{const[Ig]=eg(ag);return{textContent:Ig}}}}function parseValue(tg){if(isString$2(tg))return{path:tg};if(isPlainObject$1(tg)){if(!("path"in tg))throw createI18nError(I18nErrorCodes.REQUIRED_VALUE,"path");return tg}else throw createI18nError(I18nErrorCodes.INVALID_VALUE)}function makeParams(tg){const{path:eg,locale:gg,args:ig,choice:ng,plural:og}=tg,ag={},Ig=ig||{};return isString$2(gg)&&(ag.locale=gg),isNumber$2(ng)&&(ag.plural=ng),isNumber$2(og)&&(ag.plural=og),[eg,Ig,ag]}function apply(tg,eg,...gg){const ig=isPlainObject$1(gg[0])?gg[0]:{};(isBoolean$1(ig.globalInstall)?ig.globalInstall:!0)&&([Translation.name,"I18nT"].forEach(og=>tg.component(og,Translation)),[NumberFormat.name,"I18nN"].forEach(og=>tg.component(og,NumberFormat)),[DatetimeFormat.name,"I18nD"].forEach(og=>tg.component(og,DatetimeFormat))),tg.directive("t",vTDirective(eg))}const I18nInjectionKey=makeSymbol("global-vue-i18n");function createI18n(tg={}){const eg=__VUE_I18N_LEGACY_API__&&isBoolean$1(tg.legacy)?tg.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&eg&&warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_LEGACY_MODE));const gg=isBoolean$1(tg.globalInjection)?tg.globalInjection:!0,ig=new Map,[ng,og]=createGlobal(tg,eg),ag=makeSymbol(process.env.NODE_ENV!=="production"?"vue-i18n":"");function Ig(Ag){return ig.get(Ag)||null}function sg(Ag,cg){ig.set(Ag,cg)}function Cg(Ag){ig.delete(Ag)}const lg={get mode(){return __VUE_I18N_LEGACY_API__&&eg?"legacy":"composition"},async install(Ag,...cg){if(process.env.NODE_ENV!=="production"&&(Ag.__VUE_I18N__=lg),Ag.__VUE_I18N_SYMBOL__=ag,Ag.provide(Ag.__VUE_I18N_SYMBOL__,lg),isPlainObject$1(cg[0])){const dg=cg[0];lg.__composerExtend=dg.__composerExtend,lg.__vueI18nExtend=dg.__vueI18nExtend}let rg=null;!eg&&gg&&(rg=injectGlobalFields(Ag,lg.global)),__VUE_I18N_FULL_INSTALL__&&apply(Ag,lg,...cg),__VUE_I18N_LEGACY_API__&&eg&&Ag.mixin(defineMixin(og,og.__composer,lg));const ug=Ag.unmount;if(Ag.unmount=()=>{rg&&rg(),lg.dispose(),ug()},process.env.NODE_ENV!=="production"){if(!await enableDevTools(Ag,lg))throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const bg=createEmitter();if(eg){const mg=og;mg.__enableEmitter&&mg.__enableEmitter(bg)}else{const mg=og;mg[EnableEmitter]&&mg[EnableEmitter](bg)}bg.on("*",addTimelineEvent)}},get global(){return og},dispose(){ng.stop()},__instances:ig,__getInstance:Ig,__setInstance:sg,__deleteInstance:Cg};return lg}function useI18n(tg={}){const eg=getCurrentInstance();if(eg==null)throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);if(!eg.isCE&&eg.appContext.app!=null&&!eg.appContext.app.__VUE_I18N_SYMBOL__)throw createI18nError(I18nErrorCodes.NOT_INSTALLED);const gg=getI18nInstance(eg),ig=getGlobalComposer(gg),ng=getComponentOptions(eg),og=getScope$1(tg,ng);if(og==="global")return adjustI18nResources(ig,tg,ng),ig;if(og==="parent"){let sg=getComposer(gg,eg,tg.__useComponent);return sg==null&&(process.env.NODE_ENV!=="production"&&warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE)),sg=ig),sg}if(og==="isolated"){if(gg.mode!=="composition")throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const sg=gg,Cg=assign$2({},tg),lg=getComposer(gg,eg);Cg.__root=lg||ig;const Ag=createComposer(Cg);sg.__composerExtend&&(Ag[DisposeSymbol]=sg.__composerExtend(Ag));let cg=null;if(process.env.NODE_ENV!=="production"){cg=createEmitter();const ug=Ag;ug[EnableEmitter]&&ug[EnableEmitter](cg),cg.on("*",addTimelineEvent)}return getCurrentScope()&&onScopeDispose(()=>{if(process.env.NODE_ENV!=="production"){cg&&cg.off("*",addTimelineEvent);const dg=Ag;dg[DisableEmitter]&&dg[DisableEmitter]()}const ug=Ag[DisposeSymbol];ug&&(ug(),delete Ag[DisposeSymbol])}),Ag}const ag=gg;let Ig=ag.__getInstance(eg);if(Ig==null){const sg=assign$2({},tg);"__i18n"in ng&&(sg.__i18n=ng.__i18n),ig&&(sg.__root=ig),Ig=createComposer(sg),ag.__composerExtend&&(Ig[DisposeSymbol]=ag.__composerExtend(Ig)),setupLifeCycle(ag,eg,Ig),ag.__setInstance(eg,Ig)}else process.env.NODE_ENV!=="production"&&og==="local"&&warn(getWarnMessage(I18nWarnCodes.DUPLICATE_USE_I18N_CALLING));return Ig}function createGlobal(tg,eg){const gg=effectScope(),ig=__VUE_I18N_LEGACY_API__&&eg?gg.run(()=>createVueI18n(tg)):gg.run(()=>createComposer(tg));if(ig==null)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);return[gg,ig]}function getI18nInstance(tg){const eg=inject(tg.isCE?I18nInjectionKey:tg.appContext.app.__VUE_I18N_SYMBOL__);if(!eg)throw createI18nError(tg.isCE?I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE:I18nErrorCodes.UNEXPECTED_ERROR);return eg}function getScope$1(tg,eg){return isEmptyObject$1(tg)?"__i18n"in eg?"local":"global":tg.useScope?tg.useScope:"local"}function getGlobalComposer(tg){return tg.mode==="composition"?tg.global:tg.global.__composer}function getComposer(tg,eg,gg=!1){let ig=null;const ng=eg.root;let og=getParentComponentInstance(eg,gg);for(;og!=null;){const ag=tg;if(tg.mode==="composition")ig=ag.__getInstance(og);else if(__VUE_I18N_LEGACY_API__){const Ig=ag.__getInstance(og);Ig!=null&&(ig=Ig.__composer,gg&&ig&&!ig[InejctWithOptionSymbol]&&(ig=null))}if(ig!=null||ng===og)break;og=og.parent}return ig}function getParentComponentInstance(tg,eg=!1){return tg==null?null:eg&&tg.vnode.ctx||tg.parent}function setupLifeCycle(tg,eg,gg){let ig=null;onMounted(()=>{if(process.env.NODE_ENV!=="production"){eg.__VUE_I18N__=gg,ig=createEmitter();const ng=gg;ng[EnableEmitter]&&ng[EnableEmitter](ig),ig.on("*",addTimelineEvent)}},eg),onUnmounted(()=>{const ng=gg;process.env.NODE_ENV!=="production"&&(ig&&ig.off("*",addTimelineEvent),ng[DisableEmitter]&&ng[DisableEmitter](),delete eg.__VUE_I18N__),tg.__deleteInstance(eg);const og=ng[DisposeSymbol];og&&(og(),delete ng[DisposeSymbol])},eg)}const globalExportProps=["locale","fallbackLocale","availableLocales"],globalExportMethods=["t","rt","d","n","tm","te"];function injectGlobalFields(tg,eg){const gg=Object.create(null);return globalExportProps.forEach(ng=>{const og=Object.getOwnPropertyDescriptor(eg,ng);if(!og)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);const ag=isRef$1(og.value)?{get(){return og.value.value},set(Ig){og.value.value=Ig}}:{get(){return og.get&&og.get()}};Object.defineProperty(gg,ng,ag)}),tg.config.globalProperties.$i18n=gg,globalExportMethods.forEach(ng=>{const og=Object.getOwnPropertyDescriptor(eg,ng);if(!og||!og.value)throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);Object.defineProperty(tg.config.globalProperties,`$${ng}`,og)}),()=>{delete tg.config.globalProperties.$i18n,globalExportMethods.forEach(ng=>{delete tg.config.globalProperties[`$${ng}`]})}}const DatetimeFormatImpl=defineComponent({name:"i18n-d",props:assign$2({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},baseFormatProps),setup(tg,eg){const gg=tg.i18n||useI18n({useScope:tg.scope,__useComponent:!0});return renderFormatter(tg,eg,DATETIME_FORMAT_OPTIONS_KEYS,(...ig)=>gg[DatetimePartsSymbol](...ig))}}),DatetimeFormat=DatetimeFormatImpl;if(initFeatureFlags(),registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const tg=getGlobalThis();tg.__INTLIFY__=!0,setDevToolsHook(tg.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const dateTimeFormats={"zh-CN":{short:{year:"numeric",month:"2-digit",day:"2-digit"}},"en-US":{short:{year:"numeric",month:"2-digit",day:"2-digit"}},"ja-JP":{short:{year:"numeric",month:"2-digit",day:"2-digit"}}},numberFormats={"zh-CN":{decimal:{style:"decimal",maximumFractionDigits:2}},"en-US":{decimal:{style:"decimal",maximumFractionDigits:2}},"ja-JP":{decimal:{style:"decimal",maximumFractionDigits:2}}},DEFAULT_LOCALE="zh-CN";function normalizeLocale(tg){const eg=String(tg??"").trim().replaceAll("_","-").toLowerCase();return eg==="en"||eg.startsWith("en-")?"en-US":eg==="zh"||eg.startsWith("zh-")?"zh-CN":eg==="ja"||eg.startsWith("ja-")?"ja-JP":DEFAULT_LOCALE}function detectBrowserLocale(tg=(eg=>(eg=globalThis.navigator)==null?void 0:eg.languages)()??[]){const gg=tg.find(ig=>/^(zh|en|ja)(-|_|$)/i.test(ig));return normalizeLocale(gg)}function cloneValue(tg){return Array.isArray(tg)?tg.map(cloneValue):tg!==null&&typeof tg=="object"?mergeTrees(tg):tg}function isTree(tg){return tg!==null&&typeof tg=="object"&&!Array.isArray(tg)}function mergeTrees(tg,eg){const gg=Object.fromEntries(Object.entries(tg).map(([ig,ng])=>[ig,cloneValue(ng)]));if(!eg)return gg;for(const[ig,ng]of Object.entries(eg)){const og=gg[ig];gg[ig]=isTree(og)&&isTree(ng)?mergeTrees(og,ng):cloneValue(ng)}return gg}const actions$2={confirm:"确认",cancel:"取消",close:"关闭",save:"保存",delete:"删除",continue:"继续",refresh:"刷新",select:"选择",create:"新建",custom:"自定义",set:"设置"},dialog$2={prompt:"提示",defaultContent:"这是默认对话框内容"},feedback$2={notice:"提示",setSuccess:"设置成功"},prompts$5={enter:"请输入"},locale$2={zhCN:"简体中文",enUS:"English"},tabs$5={closingTitle:"你正在关闭标签页",closePrompt:"是否要关闭标签页[{name}]的内容?",savePrompt:"是否要保存标签页[{name}]的内容?",closeAll:"关闭所有标签页"},commonUi$2={clipArrow:"箭头",clipMark:"标志",clipPunctuation:"标点符号",clipSequence:"序号",color:"颜色",opacity:"透明度",canvasUnavailable:"无法获取 canvas 上下文",addElement:"添加元素",selectRelatedId:"选择关联的元素ID",relatedName:"关联元素名:",none:"无",textSlice:"文本截取",moveUp:"上移",moveDown:"下移",start:"开始",end:"结束",cropImage:"裁剪图片",keepAspectRatio:"保持图片宽高比例",crop:"裁剪",renamePrompt:"重命名请输入",invalidProperty:"属性值错误",customPlaceholder:"请自定义",databaseView:"数据库视图",databasePath:"数据库路径",dataTable:"数据表",totalRows:"共 {count} 条",sequence:"序号",upgrade:"升级",requestAuthorization:"申请授权",generateAuthorization:"生成授权信息",importAuthorizationFile:"导入授权文件",authorizationFilePath:"授权文件地址:",companyName:"公司名称",enterCompanyName:"输入公司名称",contact:"联系人",enterContact:"输入联系人",phone:"联系电话",enterPhone:"输入联系电话",email:"邮箱",enterEmail:"输入邮箱",submit:"提交",sendQrCode:"请发送二维码截图给运营人员,来生成授权文件",regenerateAuthorization:"重新生成授权信息",companyNameRequired:"请输入公司名称",contactRequired:"请输入联系人",phoneRequired:"请输入联系电话",phoneInvalid:"请输入正确联系电话",emailRequired:"请输入邮箱",emailInvalid:"请输入正确邮箱",authorizationUpgradeSuccess:"授权升级成功",preview:"预览",clickPreview:"点击查看预览",fill:"填充",backgroundFill:"背景填充",stroke:"描边",strokeStyle:"描边样式",strokeWidth:"描边线宽",dashLength:"线段长度",dash:"线段",gapLength:"间隔长度",gap:"间隔",sdkVersion:"SDK 版本",newFile:"新建文件",doNotSave:"不保存"},newStep$2={preview:"预览:",labelSize:"标签尺寸",millimeters:"毫米",invalidDimensions:"错误,页面尺寸有误,请调整标签尺寸,边距,间距等",newFile:"新建文件",openFile:"打开文件",openTemplate:"打开模板",oneLabelPerPage:"每页一个标签",multipleLabelsPerPage:"每页多个标签",rows:"行:",columns:"列:",printOrder:"打印顺序:",startCorner:"起始边角:",preferredDirection:"首选方向:",leftTop:"左上",leftBottom:"左下",rightTop:"右上",rightBottom:"右下",horizontal:"水平",vertical:"垂直",hasMarginsQuestion:"页面是否包含侧边距?",hasMargins:"有,标签页面包含侧边距",noMargins:"无,标签不含有侧边距",marginSize:"侧边距尺寸",left:"左:",right:"右:",top:"上:",bottom:"下:",rectangle:"矩形",roundedRectangle:"圆角矩形",ellipse:"椭圆",pageWidth:"页面宽度:",pageHeight:"页面高度:",printDirection:"打印方向",portrait:"纵向",landscape:"横向",width:"宽度:",height:"高度:",manual:"手动设置",spacing:"间距",horizontalSpacing:"水平间距:",verticalSpacing:"垂直间距:",margins:"边距:",fileNamePrompt:"请输入文件名:"},zhCommon={actions:actions$2,dialog:dialog$2,feedback:feedback$2,prompts:prompts$5,locale:locale$2,tabs:tabs$5,commonUi:commonUi$2,newStep:newStep$2},file$5="文件",edit$2="编辑",print$2="打印(P)",database$2="数据库",databaseView$2="数据库视图",refreshDatabase$2="刷新数据库",labelSettings$5="标签属性设置",fileWithKey$2="文件(F)",editWithKey$2="编辑(E)",viewWithKey$2="视图(V)",toolsWithKey$2="工具(T)",helpWithKey$2="帮助(H)",open$3="打开(O)",save$2="保存(S)",saveAs$3="另存为(A)",downloadTemplate$2="下载模板",uploadCloud$2="上传到我的云模板",undo$2="撤销(Z)",redo$2="恢复(R)",copy$6="复制(C)",paste$2="粘贴(V)",cut$2="剪切(X)",exportImage$2="导出图片",objectProps$2="对象属性",zoom$2="缩放",zoomIn$2="放大",zoomOut$2="缩小",zoomAuto$2="自动缩放",ruler$2="标尺",grid$2="网格",visible$2="可见",helpIndex$2="帮助索引",about$2="关于LabelEditor",closeAll$2="关闭所有标签页",minimize$2="最小化",restore$2="还原",maximize$2="最大化",close$2="关闭",zhMenu={file:file$5,edit:edit$2,print:print$2,database:database$2,databaseView:databaseView$2,refreshDatabase:refreshDatabase$2,labelSettings:labelSettings$5,fileWithKey:fileWithKey$2,editWithKey:editWithKey$2,viewWithKey:viewWithKey$2,toolsWithKey:toolsWithKey$2,helpWithKey:helpWithKey$2,new:"新建(N)",open:open$3,save:save$2,saveAs:saveAs$3,downloadTemplate:downloadTemplate$2,uploadCloud:uploadCloud$2,undo:undo$2,redo:redo$2,copy:copy$6,paste:paste$2,cut:cut$2,delete:"删除(D)",exportImage:exportImage$2,objectProps:objectProps$2,zoom:zoom$2,zoomIn:zoomIn$2,zoomOut:zoomOut$2,zoomAuto:zoomAuto$2,ruler:ruler$2,grid:grid$2,visible:visible$2,helpIndex:helpIndex$2,about:about$2,closeAll:closeAll$2,minimize:minimize$2,restore:restore$2,maximize:maximize$2,close:close$2},remaining$2={upperLayer:"上联",lowerLayer:"下联",doubleClickText:"请双击输入内容",imageLoadFailed:"图片加载失败",emptyCannotSave:"空文件不能保存",emptyCannotExport:"空文件不能导出图片",unnamed:"未命名",savedToMyTemplates:"已保存到我的模板",missingCloudId:"云模板 ID 丢失,无法保存",saveSuccess:"保存成功",saveFileFailed:"保存文件失败",fileNotWritable:"文件不可写",saveFile:"保存文件",labelFilter:"标签(*.LEX)",savedFile:"保存文件成功",thumbnailFailed:"生成缩略图失败",saveImage:"保存图片",imageFilter:"图片(*.png)",saveFailed:"保存失败",alreadyOpen:"该文件已打开",openFailed:"文件打开失败",cloudTemplate:"云模板",closeAllTabs:"关闭所有标签页",newFileNumber:"新建文件{number}",serverError:"服务器异常",serverConnectError:"连接服务器异常,请查看网络是否正常",methodUnavailable:"方法 {method} 未实现或不可用",barcodeVersion:"版本",barcodeGrid:"列数x行数",barcodeRows:"行数",barcodeColumns:"列数"},label$2="标签",newLabel$2="新建标签",cloudLabel$2="云标签",labelFileFilter$2="标签(*.LEX)",labelSettings$4="标签属性设置",labelEditSettings$2="标签编辑设置",labelSize$2="标签尺寸",labelWidth$2="标签宽度",labelHeight$2="标签高度",labelShape$2="标签形状",labelsPerPage$2="每页标签数",oneLabelPerPage$2="每页一个标签",multipleLabelsPerPage$2="每页多个标签",pageHasMargins$2="有,标签页面包含侧边距",pageHasNoMargins$2="无,标签不含有侧边距",labelSideMargin$2="标签侧边距",varnishLayer$2="光油图层",varnishPanel$2="光油配置面板",specialist$2={laser:{title:"激光配置",selectPreset:"选择预设参数",deletedWarning:'激光配置"{deletedNames}"已被删除,使用它的对象将恢复默认参数',limitWarning:"超出激光配置上限({maxPresets}),部分新预设未导入",noPreset:"暂无激光预设",fields:{repeatTimes:"打标次数",scanSpeed:"激光速度",jumpSpeed:"跳转速度",power:"功率",frequency:"频率",pulseWidth:"脉宽",openLightDelay:"开光延迟",closeLightDelay:"关光延迟",endDelay:"结束延迟",cornerDelay:"拐角延迟",jumpDelay:"跳转延迟"}},varnish:{none:"无",portraitOutline:"人像轮廓",enabled:"有",colorOverlay:"彩色覆盖",fullOverlay:"全覆盖"}},templateName$5="标签模板_{name}",instantEditPrint$2="即编即打印",instantScanPrint$2="即扫即打印",linkedContentReadonly$2="有关联来源无法编辑内容",qrCodeContent$2="QR Code内容",defaults$2={layer:"图层 {sequence}"},objectNames$2={text:"文本",textname:"名字",image:"图片",rect:"矩形",triangle:"三角形",table:"表格",circle:"圆形",line:"直线",barcode:"条码",barcode2d:"二维码",counter:"日期计数器",group:"组合"},contextMenu$2={delete:"删除",lock:"锁定对象",unlock:"解锁对象",layers:"图层管理",bringForward:"上一个",sendBackwards:"下一个",bringToFront:"置顶",sendToBack:"置底",group:"成组",ungroup:"拆分"},image$2={settings:"图片设置",keepRatio:"保持图片长宽比例",flipHorizontal:"水平翻转",flipVertical:"垂直翻转",grayscale:"灰度",sharpen:"黑白图清晰度优化",anchorAlignment:"锚点对齐方式",anchorSettings:"锚点设置",alignment:"对齐方式:",crop:"图片裁剪",replace:"更换图片",selectFile:"选择文件",selectClipArt:"选择剪贴图",selectTitle:"选择图片",fileType:"图片",selectFailed:"选择图片失败",selectRequired:"请选择图片",unsupportedType:"不支持的文件类型",processingFailed:"文件处理失败: {detail}",canvasCreateFailed:"画布创建失败",temporaryCanvasCreateFailed:"临时画布创建失败",decodeFailed:"图片解码失败",readFailed:"文件读取失败",align:{leftTop:"左上角",topCenter:"顶部中心",rightTop:"右上角",leftCenter:"左边中心",center:"中心",rightCenter:"右边中心",leftBottom:"左下角",bottomCenter:"底部中心",rightBottom:"右下角"}},wizard$2={previous:"上一步",next:"下一步",finish:"完成",welcome:"欢迎大家使用Label Editor",chooseTask:"请你选择需要做的任务",labelsPerPageStep:"每页标签数--指定纸张属性",sideMarginStep:"侧边距--指定标签侧边距",shapeStep:"标签形状--指定标签形状",spacingStep:"模板尺寸和间距--指定模板尺寸和间距"},tabs$4={page:"页面",layoutOrder:"布局与顺序",shape:"形状",margin:"边距",spacing:"间距"},shell$2={objectList:"对象列表",rename:"重命名",settings:"设置",fillStroke:"填充描边",backgroundColor:"背景色",backgroundImage:"背景图片",replace:"更换",clear:"清除",cover:"铺满",borderPattern:"描边图案",layers:"图层",renameLayer:"重命名图层",layerNamePlaceholder:"请输入图层名称",noStroke:"无描边",patternNumber:"图案 {number}",replaceImage:"更换图片",viewBarcode:"查看一维码内容",enterBarcode:"请输入一维码内容",viewQrCode:"查看二维码内容",enterQrCode:"请输入二维码内容",maxLayers:"最多支持 {count} 个图层",deleteLayer:"删除图层",deleteLayerConfirm:"确定要删除「{name}」吗?",updateSuccess:"更新成功",untitled:"未命名",uploadCloudSuccess:"上传到我的云模板成功",uploadFailed:"上传失败",cloudIdMissing:"云模板 ID 丢失,无法下载",downloadTemplate:"下载模板",downloadSuccess:"下载成功",downloadFailed:"下载失败",createCanvasFirst:"请先创建一个画布",undefinedAction:"未定义的操作: {action}",fileOpenFailed:"文件打开失败",openFile:"打开文件",textPrompt:"请双击输入文字",text:"文本",selectTool:"选择(V)",panTool:`移动画布(H)
417
+ 按住空格可临时移动`,print:"打印",saveFile:"保存文件",newFile:"新建文件",rect:"矩形",triangle:"三角形",circle:"圆形",line:"线",textTool:"文字",table:"表格",barcode:"条码",qrCode:"二维码",picture:"图片",counter:"日期计数器",variable:"变量",database:"数据库",databaseView:"数据库视图",refreshDatabase:"刷新数据库",firstRecord:"第一条记录",previousRecord:"上一条记录",nextRecord:"下一条记录",lastRecord:"最后一条记录",name:"名字"},feature$2={dateFormat:"日期格式",addVariable:"新增变量",importImage:"导入图片",imagePath:"图片路径: {path}",externalInputChineseFormatUnsupported:"外部输入不支持含有中文格式",copyId:"复制ID",cell:"单元格",cellIndex:"单元格 {index}",cellPosition:"{row} 行 {column} 列"},copy$5={"532cd474d1":"起始值","911dd68193":"序号长度","6078bac61a":"增量",de61aa8e1c:"预览","8e35f2b9f3":"十六进制","68c1392da2":"数值写入",fe992493bf:"字符写入","9d2601c843":"格式",b6fed9af83:"日期","4a570eab6a":"日作为数字且没有前导零",ec27904da4:"日作为数字且有前导零",d741bd3dfc:"日名称为缩写的本地化","792c34e70d":"周一",c3405710e0:"周日","50e83fe09b":"日名称为非缩写的本地化",dded7a4890:"星期一",d9636d4a90:"星期日","6c386a81be":"月作为数字且没有前导零",bf35a6483e:"月作为数字且有前导零",dc2d993af6:"月称为缩写的本地化","5b17a06153":"十月",dfef764f33:"十一月","7d0ccf16f3":"月称为非缩写的本地化.","76a16869e0":"年份为两位数字","617517584f":"年份为四位数字.","3de91c80ce":"小时且没有前导零","71b6771bc7":"显示","5ebd64c830":"小时且有前导零",e1f6bc2677:"分钟且没有前导零.","472e0cbc27":"分钟且有前导零.",ff4b6ad7d6:"秒且没有前导零.","28ba129d4e":"秒且有前导零.",bcba353efd:"毫秒且没有前导零.","273d567f9c":"毫秒且有前导零.","7f5c242027":"使用 上午",e4780194e0:"下午 显示.a","312ba03084":"将被",e214ee22dd:"上午","3fbe3edfc5":"或者","1dfaab6548":"下午","3d88094723":"替代.",fb2a23dc16:"时区","46930b1ccf":"例如",fa747dfcf3:"计数类型","7a4dc8253f":"数字","8bdf1760f0":"字母","83a8f475e3":"填充字符","90a2f53d3a":"尾填充字符","8b0db67871":"当前值","29e1d3d9f0":"增量值","39a52f2df5":"数据位","57f15bb774":"采用零填充",a3ccf702c5:"数据源","700c93d882":"外部输入支持的格式",c8d09cf955:"默认",f4dbbc63a5:"数据库","7bb7346e15":"外部输入",ef258428cd:"计数器",a74a77bc7f:"文本、计时器、日期组合","2d0366384f":"二维码",b1085310cb:"条码",b418ca60d4:"变量","382f4b5559":"请选择","6a954390e3":"表",ad3ee64830:"列","6bd6e44cbc":"选择关联的元素ID","850e2546c3":"关联条码ID",a424315147:"关联后,不能编辑内容","20bc33c7ba":"关联条码:","4b822f835d":"关联二维码ID",e5346f5159:"关联二维码:","9f6e8dba88":"请选择Key","8cef5cc20b":"导入变量","1cebaf21fb":"导入json文件",a25ed32d21:"清除数据",b56d9ac6c5:"确认","4d0b4688c7":"取消","184a9c08ac":"是否清除所有变量",cce10d7b40:"文件导入失败","609d669223":"存在重复的 key,请修改后再确认",b088a3713a:"选择字体",f670b2adc0:"加粗",af5a2c8bff:"斜体",c85de9e58a:"删除线","9bc18ae51e":"下划线",f4d3dab8e0:"文字","07f568dada":"文字颜色",c9c7630d2c:"文字字体","34098a184f":"文字字号","0fa1d514a5":"一维码类型","0c5279c8ae":"一维码文字设置","576ccdb1f1":"字号",f7af330e8f:"二维码类型",cc288c9c8e:"二维码纠错等级",d480c424f8:"二维码值文本设置","4e3a37477c":"显示二维码值","89c41faeea":"模块像素",fb54f6f959:"长宽比例","020af9c5f4":"龙贝码纠错等级","204ca8e993":"QrCode纠错等级","3276f518f5":"按图片长宽比例导入",a41a0c9fd2:"选择剪贴图","446d1e1236":"请选择图片","18104edf89":"选择图片",be8da62ea1:"图片",e423d0e04e:"选择图片失败","17ad570546":"打印计数器",d84a63fd99:"打印日期",bc90a3957d:"键盘输入","5585698377":"下午 显示","9978b8a700":"圆角","579f280b5d":"行数","150074c2e8":"表格","2a2b777ae4":"行","1082f4e944":"直线","12c09d0341":"虚线","72077749f7":"无","83100cd7eb":"上方插行","5d80537a38":"下方插行",bdc0e99b04:"删除当前行",eee6dec245:"删除当前列","199013c934":"左侧插列","45989304d7":"右侧插列",cee8bcba20:"字体大小",b534c8636c:"行高",c86f1b361f:"字距","6d93ab3fba":"文字间距","5937a2c95a":"文字位置","413f8db65f":"左对齐","5be891c540":"居中对齐","70fe40dec2":"右对齐",a9d35ab0a6:"顶部","435b2d8982":"底部","443bde0f4c":"文字对齐","989d1affa0":"版本","0965832369":"日期偏移","6f14c2641c":"年",d9b59879f3:"月","15917f3b32":"日","86ec1ca75c":"宽度",eea51aa44b:"高度",cb165f5ca1:"旋转角度","5268436bdf":"水平居中对齐","8a9aed3516":"水平平均对齐",ceb66a60f6:"顶部对齐","2cd89127c4":"垂直居中对齐","5d2078e01c":"底部对齐",f8735a4579:"垂直平均对齐","3ffbbe25d5":"画布水平居中","7cd8c94d34":"画布垂直居中","9474979eb3":"区域水平居中","73678a1e04":"区域垂直居中","41654e0268":"基础信息","067f80c392":"列数","68d87ec64c":"列宽",db63adaf4c:"双击单元格后编辑","046ca7db56":"上边",b3ceb938fb:"右边","343b383f1d":"下边","8566923239":"左边","68238a67bc":"字体色","97c8abc1b8":"圆弧半径(正值向上弯,负值向下弯)","83cc65b13f":"单行","918a0c837b":"段落","7d9b9e079f":"圆弧排列","0a84571f3e":"尺寸模式","1b95368e24":"倍数拉伸","2c06479d15":"自由拉伸","3d17580e06":"一维码高度(mm)","4e28691ff7":"一维码高","5f397a20e8":"条码与文本间距(mm)","60a48b31d9":"一维码与文字间距"},zhEditor={remaining:remaining$2,label:label$2,newLabel:newLabel$2,cloudLabel:cloudLabel$2,labelFileFilter:labelFileFilter$2,labelSettings:labelSettings$4,labelEditSettings:labelEditSettings$2,labelSize:labelSize$2,labelWidth:labelWidth$2,labelHeight:labelHeight$2,labelShape:labelShape$2,labelsPerPage:labelsPerPage$2,oneLabelPerPage:oneLabelPerPage$2,multipleLabelsPerPage:multipleLabelsPerPage$2,pageHasMargins:pageHasMargins$2,pageHasNoMargins:pageHasNoMargins$2,labelSideMargin:labelSideMargin$2,varnishLayer:varnishLayer$2,varnishPanel:varnishPanel$2,specialist:specialist$2,templateName:templateName$5,instantEditPrint:instantEditPrint$2,instantScanPrint:instantScanPrint$2,linkedContentReadonly:linkedContentReadonly$2,qrCodeContent:qrCodeContent$2,defaults:defaults$2,objectNames:objectNames$2,contextMenu:contextMenu$2,image:image$2,wizard:wizard$2,tabs:tabs$4,shell:shell$2,feature:feature$2,copy:copy$5},title$8="打印",preview$2="打印预览",file$4="打印文件:",range$3="打印范围",copies$2="打印份数",content$2="打印内容",toFile$2="打印到文件",direction$2="打印方向",order$2="打印顺序",counter$5="打印计数器",date$5="打印日期",cancel$2="取消打印",connecting$5="正在与打印机连接",connectingPrinter$2="正在连接打印机....",printing$2="正在打印中....",complete$2="打印完成",pageComplete$2="打印第{page}页完成",maximumRows$2="页码范围最大可打印行数为:{rows}行",rewind$2="回卷",separateLayers$2="分图层打印",multipleLabels$2="多标签打印",sendTemplate$2="发送模板",selectDriver$2="选择驱动",advancedOptions$2="高级选项",paperSavingMode$2="省纸模式",enabled$2="开启",disabled$2="关闭",serialCount$2="序列号数量",startRecord$2="开始记录",endRecord$2="结束记录",pageRange$2="页码范围",rangeExample$2="例如:1-3,8,10 格式",copyCount$2="份数",template$2="模板",templateName$4="模板名称",currentAssociations$2="当前关联:",sheetRows$2="{sheet} 表有 {rows} 行数据;",driver$2="驱动:",task$2="任务:",taskComplete$2="任务完成",success$2="成功:",failed$2="失败:",progress$2="进度:",firstPage$2="第一页",previousPage$2="上一页",currentPage$2="当前页",nextPage$2="下一页",lastPage$2="最后一页",firstImage$2="第一张",previousImage$2="上一张",currentImage$2="当前图片",nextImage$2="下一张",lastImage$2="最后一张",pageSummary$2="第 {current}/{totalPages} 页,共 {total} 张",previewGenerating$2="正在生成打印预览...",previewFailed$2="生成打印预览失败",saveTemplateFile$2="保存模板文件",templateFileFilter$2="模板文件",templateSaved$2="模板保存成功",templateSent$2="发送模板成功",errors$2={connectFailed:"连接打印机失败",tidReadFailed:"读取 TID 失败",pageFailed:"打印第 {page} 页失败",templateSendFailed:"发送模板失败",missingDriver:"请选择驱动",emptyCanvas:"空画布不能打印或预览",missingTemplateName:"请输入模板名称",startAfterEnd:"开始页码不能大于结束页码",rangeExceeded:"超过最大打印页码范围",invalidPage:"无效的页码",invalidPageFormat:"页码格式不正确",invalidDriverResponse:"获取不到 JSON 返回"},zhPrint={title:title$8,preview:preview$2,file:file$4,range:range$3,copies:copies$2,content:content$2,toFile:toFile$2,direction:direction$2,order:order$2,counter:counter$5,date:date$5,continue:"继续打印",cancel:cancel$2,connecting:connecting$5,connectingPrinter:connectingPrinter$2,printing:printing$2,complete:complete$2,pageComplete:pageComplete$2,maximumRows:maximumRows$2,rewind:rewind$2,separateLayers:separateLayers$2,multipleLabels:multipleLabels$2,sendTemplate:sendTemplate$2,selectDriver:selectDriver$2,default:"默认",advancedOptions:advancedOptions$2,paperSavingMode:paperSavingMode$2,enabled:enabled$2,disabled:disabled$2,serialCount:serialCount$2,startRecord:startRecord$2,endRecord:endRecord$2,pageRange:pageRange$2,rangeExample:rangeExample$2,copyCount:copyCount$2,template:template$2,templateName:templateName$4,currentAssociations:currentAssociations$2,sheetRows:sheetRows$2,driver:driver$2,task:task$2,taskComplete:taskComplete$2,success:success$2,failed:failed$2,progress:progress$2,firstPage:firstPage$2,previousPage:previousPage$2,currentPage:currentPage$2,nextPage:nextPage$2,lastPage:lastPage$2,firstImage:firstImage$2,previousImage:previousImage$2,currentImage:currentImage$2,nextImage:nextImage$2,lastImage:lastImage$2,pageSummary:pageSummary$2,previewGenerating:previewGenerating$2,previewFailed:previewFailed$2,saveTemplateFile:saveTemplateFile$2,templateFileFilter:templateFileFilter$2,templateSaved:templateSaved$2,templateSent:templateSent$2,errors:errors$2},title$7="数据库",type$2="数据库类型",name$2="数据库名字",view$2="数据库视图",path$2="数据库路径:",serverAddress$2="数据库服务器地址",serverPort$2="数据库服务器端口",userName$2="数据库用户名",password$2="数据库用户密码",select$2="选择数据库",connect$2="连接",serverUrl$2="服务器 URL",filePath$2="文件路径",serverAddressPlaceholder$2="服务器地址",serverPortPlaceholder$2="服务器端口",selectFile$2="选择文件",sheet$2="表:",column$2="列:",hex$2="十六进制",numericWrite$2="数值写入",characterWrite$2="字符写入",deleteCharacters$2="删除字符",sheetInstructions$2="选择工作表,然后指定数据在该工作表上的排列方式",previewRows$2="预览(10 行)",selectedSheets$2="你已选择以下表",addAnotherPrompt$2="您是否需要继续添加其他表",addAnotherYes$2="是的,我需要选择另一个表",addAnotherNo$2="不,我已选择完成",selectFailed$2="选择数据库失败",connecting$4="正在连接数据库中",connectionSuccess$2="数据库连接成功",connectionFailed$5="数据库连接失败",prompts$4={excelFile:"请选择 Excel 文件",dbFile:"请选择 db 文件",serverAddress:"请输入数据库服务器地址",serverPort:"请输入数据库服务器端口",name:"请输入数据库名",userName:"请输入数据库用户名",password:"请输入数据库用户密码"},zhDatabase={title:title$7,type:type$2,name:name$2,view:view$2,path:path$2,serverAddress:serverAddress$2,serverPort:serverPort$2,userName:userName$2,password:password$2,select:select$2,connect:connect$2,serverUrl:serverUrl$2,filePath:filePath$2,serverAddressPlaceholder:serverAddressPlaceholder$2,serverPortPlaceholder:serverPortPlaceholder$2,selectFile:selectFile$2,sheet:sheet$2,column:column$2,hex:hex$2,numericWrite:numericWrite$2,characterWrite:characterWrite$2,deleteCharacters:deleteCharacters$2,sheetInstructions:sheetInstructions$2,previewRows:previewRows$2,selectedSheets:selectedSheets$2,addAnotherPrompt:addAnotherPrompt$2,addAnotherYes:addAnotherYes$2,addAnotherNo:addAnotherNo$2,selectFailed:selectFailed$2,connecting:connecting$4,connectionSuccess:connectionSuccess$2,connectionFailed:connectionFailed$5,prompts:prompts$4},title$6="射频标签",safeArea$2="安全区",counter$4="计数器",settings$2="RFID标签设置",production$2="RFID标签制作",uhfPrint$2="UHF-RFID打印",protocol$2="RFID标签协议标准",readOffset$2="RFID标签识读偏移",writeContent$2="标签写入内容",tid$2="标签信息区(TID)",longbeiContent$2="龙贝码内容",longbeiErrorCorrection$2="龙贝码纠错等级",guojun$2="国军",databaseSource$2="数据库",status$2="状态",power$2="功率",readPower$2="读取功率",writePower$2="写入功率",getCurrentValue$2="获取设备当前值",crcValidation$2="RFID数据带CRC校验",commandPassword$2="口令",oldCommandPassword$2="旧口令",newCommandPassword$2="新口令",enterOldCommandPassword$2="输入旧口令",enterNewCommandPassword$2="输入新口令",accessPassword$2="访问密码",oldPassword$2="旧密码",newPassword$2="新密码",manualInput$2="人工输入",enterEightDigitPassword$2="请输入8位密码",savePasswordToFile$2="保存密码到文件",regionPermissions$2="区域权限设置",epcRegion$2="编码区(EPC)",userRegion$2="用户区(User)",reservedRegion$2="保留区(Reserved)",lock$2="锁定",permanentLock$2="永久锁定",neverLock$2="永不锁定",changeKillPassword$2="修改Kill密码",killPassword$2="Kill密码",paddingMethod$2="补位方式",defaultPadding$2="默认",padStart$3="前补",padEnd$2="后补",dataSource$2="数据源",hexadecimal$2="十六进制",text$2="文本",date$4="日期",sequenceGenerator$2="序号生成器",enterData$2="请输入数据",minimumPaddingDigits$2="最小补位位数",readWrite$2="可读可写",readOnly$2="可读不可写",configureMemoryProperties$2="配置存储区属性",configureSecurityMode$2="配置安全模式",noAuthentication$2="不需要认证",authenticationWithoutSecureCommunication$2="需要认证,不需要安全通信",authenticationWithSecureCommunication$2="需要认证,需要安全通信",unsavedSwitchConfirm$2="有未保存的设置项,是否要继续切换?",deviceDetectionFailed$2="设备检测失败,错误码:{code},错误信息:{detail}",noPrinterFound$2="没有枚举到打印机",connectionFailed$4="连接失败,错误码:{code},错误信息:{detail}",connectedTo$2="连接到:{device}",oldAndNewPasswordRequired$2="新密码和旧密码不能为空",savePasswordSuccess$2="保存密码成功",savePasswordFailed$2="保存密码失败",passwordRequired$2="密码不能为空",oldPasswordEightDigits$2="旧密码长度必须是8位",newPasswordEightDigits$2="新密码长度必须是8位",killPasswordEightDigits$2="Kill密码长度必须是8位",oldCommandPasswordEightDigits$2="旧口令长度必须是8位",newCommandPasswordEightDigits$2="新口令长度必须是8位",newCommandRequiredForAccessChange$2="修改访问新密码,必须填写新口令",oldCommandRequiredForAccessChange$2="修改访问新密码,必须填写旧口令",changeKillPasswordConfirm$2="是否确定要修改Kill密码?",paddingMultipleOfFour$2="补位数据位数必须是4的倍数",setFailedWithDetail$2="设置失败:{detail}",getFailedWithDetail$2="获取失败:{detail}",zhRfid={title:title$6,safeArea:safeArea$2,counter:counter$4,settings:settings$2,production:production$2,uhfPrint:uhfPrint$2,protocol:protocol$2,readOffset:readOffset$2,writeContent:writeContent$2,tid:tid$2,longbeiContent:longbeiContent$2,longbeiErrorCorrection:longbeiErrorCorrection$2,guojun:guojun$2,databaseSource:databaseSource$2,status:status$2,power:power$2,readPower:readPower$2,writePower:writePower$2,getCurrentValue:getCurrentValue$2,crcValidation:crcValidation$2,commandPassword:commandPassword$2,oldCommandPassword:oldCommandPassword$2,newCommandPassword:newCommandPassword$2,enterOldCommandPassword:enterOldCommandPassword$2,enterNewCommandPassword:enterNewCommandPassword$2,accessPassword:accessPassword$2,oldPassword:oldPassword$2,newPassword:newPassword$2,manualInput:manualInput$2,enterEightDigitPassword:enterEightDigitPassword$2,savePasswordToFile:savePasswordToFile$2,regionPermissions:regionPermissions$2,epcRegion:epcRegion$2,userRegion:userRegion$2,reservedRegion:reservedRegion$2,lock:lock$2,permanentLock:permanentLock$2,neverLock:neverLock$2,changeKillPassword:changeKillPassword$2,killPassword:killPassword$2,paddingMethod:paddingMethod$2,defaultPadding:defaultPadding$2,padStart:padStart$3,padEnd:padEnd$2,dataSource:dataSource$2,hexadecimal:hexadecimal$2,text:text$2,date:date$4,sequenceGenerator:sequenceGenerator$2,enterData:enterData$2,minimumPaddingDigits:minimumPaddingDigits$2,readWrite:readWrite$2,readOnly:readOnly$2,configureMemoryProperties:configureMemoryProperties$2,configureSecurityMode:configureSecurityMode$2,noAuthentication:noAuthentication$2,authenticationWithoutSecureCommunication:authenticationWithoutSecureCommunication$2,authenticationWithSecureCommunication:authenticationWithSecureCommunication$2,unsavedSwitchConfirm:unsavedSwitchConfirm$2,deviceDetectionFailed:deviceDetectionFailed$2,noPrinterFound:noPrinterFound$2,connectionFailed:connectionFailed$4,connectedTo:connectedTo$2,oldAndNewPasswordRequired:oldAndNewPasswordRequired$2,savePasswordSuccess:savePasswordSuccess$2,savePasswordFailed:savePasswordFailed$2,passwordRequired:passwordRequired$2,oldPasswordEightDigits:oldPasswordEightDigits$2,newPasswordEightDigits:newPasswordEightDigits$2,killPasswordEightDigits:killPasswordEightDigits$2,oldCommandPasswordEightDigits:oldCommandPasswordEightDigits$2,newCommandPasswordEightDigits:newCommandPasswordEightDigits$2,newCommandRequiredForAccessChange:newCommandRequiredForAccessChange$2,oldCommandRequiredForAccessChange:oldCommandRequiredForAccessChange$2,changeKillPasswordConfirm:changeKillPasswordConfirm$2,paddingMultipleOfFour:paddingMultipleOfFour$2,setFailedWithDetail:setFailedWithDetail$2,getFailedWithDetail:getFailedWithDetail$2},invalidPageSize$2="页面尺寸有误,请调整标签尺寸,边距,间距等",pageExceedsSettings$2="错误,超出设置的页面,请调整标签尺寸,边距,间距等",emptyCanvas$2="空画布不能打印或预览",printFailed$2="打印第{page}页失败",pageRangeExceeded$2="超过最大打印页码范围",printerUnavailable$2="没有枚举到打印机",printerConnectionFailed$2="连接不上打印机",databaseSelectionFailed$2="选择数据库失败",networkTimeout$2="请求超时,请检查网络后重试",unknown$2="操作失败,请重试",unknownWithCode$2="操作失败(错误码:{code}),请重试",zhErrors={invalidPageSize:invalidPageSize$2,pageExceedsSettings:pageExceedsSettings$2,emptyCanvas:emptyCanvas$2,printFailed:printFailed$2,pageRangeExceeded:pageRangeExceeded$2,printerUnavailable:printerUnavailable$2,printerConnectionFailed:printerConnectionFailed$2,databaseSelectionFailed:databaseSelectionFailed$2,networkTimeout:networkTimeout$2,unknown:unknown$2,unknownWithCode:unknownWithCode$2},actions$1={confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",delete:"Delete",continue:"Continue",refresh:"Refresh",select:"Select",create:"New",custom:"Custom",set:"Set"},dialog$1={prompt:"Prompt",defaultContent:"Dialog content"},feedback$1={notice:"Notice",setSuccess:"Set successfully"},prompts$3={enter:"Please enter"},locale$1={zhCN:"Simplified Chinese",enUS:"English"},tabs$3={closingTitle:"You are closing a label tab",closePrompt:"Close the contents of label tab [{name}]?",savePrompt:"Save the contents of label tab [{name}]?",closeAll:"Close all label tabs"},commonUi$1={clipArrow:"Arrows",clipMark:"Symbols",clipPunctuation:"Punctuation",clipSequence:"Numbers",color:"Color",opacity:"Opacity",canvasUnavailable:"Unable to access the canvas context",addElement:"Add element",selectRelatedId:"Select a related element ID",relatedName:"Related element:",none:"None",textSlice:"Extract text",moveUp:"Move up",moveDown:"Move down",start:"Start",end:"End",cropImage:"Crop image",keepAspectRatio:"Keep image aspect ratio",crop:"Crop",renamePrompt:"Enter a new name",invalidProperty:"Invalid property value",customPlaceholder:"Add custom content",databaseView:"Database view",databasePath:"Database path",dataTable:"Data table",totalRows:"{count} rows",sequence:"No.",upgrade:"Upgrade",requestAuthorization:"Request authorization",generateAuthorization:"Generate authorization information",importAuthorizationFile:"Import authorization file",authorizationFilePath:"Authorization file path:",companyName:"Company name",enterCompanyName:"Enter company name",contact:"Contact",enterContact:"Enter contact",phone:"Phone",enterPhone:"Enter phone number",email:"Email",enterEmail:"Enter email",submit:"Submit",sendQrCode:"Send a screenshot of the QR code to the operations team to generate an authorization file",regenerateAuthorization:"Regenerate authorization information",companyNameRequired:"Enter a company name",contactRequired:"Enter a contact",phoneRequired:"Enter a phone number",phoneInvalid:"Enter a valid phone number",emailRequired:"Enter an email address",emailInvalid:"Enter a valid email address",authorizationUpgradeSuccess:"Authorization upgraded successfully",preview:"Preview",clickPreview:"Click to preview",fill:"Fill",backgroundFill:"Background fill",stroke:"Stroke",strokeStyle:"Stroke style",strokeWidth:"Stroke width",dashLength:"Dash length",dash:"Dash",gapLength:"Gap length",gap:"Gap",sdkVersion:"SDK Version",newFile:"New file",doNotSave:"Don't save"},newStep$1={preview:"Preview:",labelSize:"Label size",millimeters:"mm",invalidDimensions:"Invalid page dimensions. Adjust the label size, margins, or spacing.",newFile:"New file",openFile:"Open file",openTemplate:"Open template",oneLabelPerPage:"One label per page",multipleLabelsPerPage:"Multiple labels per page",rows:"Rows:",columns:"Columns:",printOrder:"Print order:",startCorner:"Start corner:",preferredDirection:"Preferred direction:",leftTop:"Top left",leftBottom:"Bottom left",rightTop:"Top right",rightBottom:"Bottom right",horizontal:"Horizontal",vertical:"Vertical",hasMarginsQuestion:"Does the page include margins?",hasMargins:"Yes, the label page includes margins",noMargins:"No, the label has no margins",marginSize:"Margin size",left:"Left:",right:"Right:",top:"Top:",bottom:"Bottom:",rectangle:"Rectangle",roundedRectangle:"Rounded rectangle",ellipse:"Ellipse",pageWidth:"Page width:",pageHeight:"Page height:",printDirection:"Print direction",portrait:"Portrait",landscape:"Landscape",width:"Width:",height:"Height:",manual:"Set manually",spacing:"Spacing",horizontalSpacing:"Horizontal spacing:",verticalSpacing:"Vertical spacing:",margins:"Margins:",fileNamePrompt:"Enter file name:"},enCommon={actions:actions$1,dialog:dialog$1,feedback:feedback$1,prompts:prompts$3,locale:locale$1,tabs:tabs$3,commonUi:commonUi$1,newStep:newStep$1},file$3="File",edit$1="Edit",print$1="Print (P)",database$1="Database",databaseView$1="Database view",refreshDatabase$1="Refresh database",labelSettings$3="Label settings",fileWithKey$1="File (F)",editWithKey$1="Edit (E)",viewWithKey$1="View (V)",toolsWithKey$1="Tools (T)",helpWithKey$1="Help (H)",open$2="Open (O)",save$1="Save (S)",saveAs$2="Save as (A)",downloadTemplate$1="Download template",uploadCloud$1="Upload to My Cloud Templates",undo$1="Undo (Z)",redo$1="Redo (R)",copy$4="Copy (C)",paste$1="Paste (V)",cut$1="Cut (X)",exportImage$1="Export image",objectProps$1="Object properties",zoom$1="Zoom",zoomIn$1="Zoom in",zoomOut$1="Zoom out",zoomAuto$1="Auto zoom",ruler$1="Ruler",grid$1="Grid",visible$1="Visible",helpIndex$1="Help index",about$1="About Label Editor",closeAll$1="Close all tabs",minimize$1="Minimize",restore$1="Restore",maximize$1="Maximize",close$1="Close",enMenu={file:file$3,edit:edit$1,print:print$1,database:database$1,databaseView:databaseView$1,refreshDatabase:refreshDatabase$1,labelSettings:labelSettings$3,fileWithKey:fileWithKey$1,editWithKey:editWithKey$1,viewWithKey:viewWithKey$1,toolsWithKey:toolsWithKey$1,helpWithKey:helpWithKey$1,new:"New (N)",open:open$2,save:save$1,saveAs:saveAs$2,downloadTemplate:downloadTemplate$1,uploadCloud:uploadCloud$1,undo:undo$1,redo:redo$1,copy:copy$4,paste:paste$1,cut:cut$1,delete:"Delete (D)",exportImage:exportImage$1,objectProps:objectProps$1,zoom:zoom$1,zoomIn:zoomIn$1,zoomOut:zoomOut$1,zoomAuto:zoomAuto$1,ruler:ruler$1,grid:grid$1,visible:visible$1,helpIndex:helpIndex$1,about:about$1,closeAll:closeAll$1,minimize:minimize$1,restore:restore$1,maximize:maximize$1,close:close$1},remaining$1={upperLayer:"Upper label",lowerLayer:"Lower label",doubleClickText:"Double-click to enter content",imageLoadFailed:"Image failed to load",emptyCannotSave:"An empty file cannot be saved",emptyCannotExport:"An empty file cannot be exported",unnamed:"Untitled",savedToMyTemplates:"Saved to My Templates",missingCloudId:"Cloud template ID is missing; unable to save",saveSuccess:"Saved successfully",saveFileFailed:"Failed to save file",fileNotWritable:"File is not writable",saveFile:"Save file",labelFilter:"Label (*.LEX)",savedFile:"File saved successfully",thumbnailFailed:"Failed to generate thumbnail",saveImage:"Save image",imageFilter:"Image (*.png)",saveFailed:"Save failed",alreadyOpen:"This file is already open",openFailed:"Failed to open file",cloudTemplate:"Cloud template",closeAllTabs:"Close all tabs",newFileNumber:"New file {number}",serverError:"Server error",serverConnectError:"Server connect error",methodUnavailable:"Method {method} is not implemented or unavailable",barcodeVersion:"Version",barcodeGrid:"Columns x rows",barcodeRows:"Rows",barcodeColumns:"Columns"},label$1="Label",newLabel$1="New label",cloudLabel$1="Cloud label",labelFileFilter$1="Labels (*.LEX)",labelSettings$2="Label settings",labelEditSettings$1="Label editing settings",labelSize$1="Label size",labelWidth$1="Label width",labelHeight$1="Label height",labelShape$1="Label shape",labelsPerPage$1="Labels per page",oneLabelPerPage$1="One label per page",multipleLabelsPerPage$1="Multiple labels per page",pageHasMargins$1="Yes, the label page includes margins",pageHasNoMargins$1="No, the label has no margins",labelSideMargin$1="Label side margin",varnishLayer$1="Varnish layer",varnishPanel$1="Varnish settings panel",specialist$1={laser:{title:"Laser settings",selectPreset:"Select a preset",deletedWarning:'Laser configuration "{deletedNames}" was deleted. Objects using it will return to the default parameters.',limitWarning:"The laser configuration limit ({maxPresets}) was exceeded. Some new presets were not imported.",noPreset:"No laser preset available",fields:{repeatTimes:"Marking repetitions",scanSpeed:"Laser speed",jumpSpeed:"Jump speed",power:"Power",frequency:"Frequency",pulseWidth:"Pulse width",openLightDelay:"Laser-on delay",closeLightDelay:"Laser-off delay",endDelay:"End delay",cornerDelay:"Corner delay",jumpDelay:"Jump delay"}},varnish:{none:"None",portraitOutline:"Portrait outline",enabled:"On",colorOverlay:"Color overlay",fullOverlay:"Full overlay"}},templateName$3="Label template {name}",instantEditPrint$1="Edit and print instantly",instantScanPrint$1="Scan and print instantly",linkedContentReadonly$1="Content with a linked source cannot be edited",qrCodeContent$1="QR Code content",defaults$1={layer:"Layer {sequence}"},objectNames$1={text:"Text",textname:"Name",image:"Image",rect:"Rectangle",triangle:"Triangle",table:"Table",circle:"Circle",line:"Line",barcode:"Barcode",barcode2d:"QR code",counter:"Date counter",group:"Group"},contextMenu$1={delete:"Delete",lock:"Lock object",unlock:"Unlock object",layers:"Layer management",bringForward:"Bring forward",sendBackwards:"Send backwards",bringToFront:"Bring to front",sendToBack:"Send to back",group:"Group",ungroup:"Ungroup"},image$1={settings:"Image settings",keepRatio:"Keep image aspect ratio",flipHorizontal:"Flip horizontally",flipVertical:"Flip vertically",grayscale:"Grayscale",sharpen:"Optimize monochrome clarity",anchorAlignment:"Anchor alignment",anchorSettings:"Anchor settings",alignment:"Alignment: ",crop:"Crop image",replace:"Replace image",selectFile:"Select file",selectClipArt:"Select clip art",selectTitle:"Select image",fileType:"Image",selectFailed:"Failed to select image",selectRequired:"Please select an image",unsupportedType:"Unsupported file type",processingFailed:"File processing failed: {detail}",canvasCreateFailed:"Failed to create canvas",temporaryCanvasCreateFailed:"Failed to create temporary canvas",decodeFailed:"Failed to decode image",readFailed:"Failed to read file",align:{leftTop:"Top left",topCenter:"Top center",rightTop:"Top right",leftCenter:"Center left",center:"Center",rightCenter:"Center right",leftBottom:"Bottom left",bottomCenter:"Bottom center",rightBottom:"Bottom right"}},wizard$1={previous:"Previous",next:"Next",finish:"Finish",welcome:"Welcome to Label Editor",chooseTask:"Choose a task",labelsPerPageStep:"Labels per page -- specify paper properties",sideMarginStep:"Side margins -- specify label margins",shapeStep:"Label shape -- specify label shape",spacingStep:"Template size and spacing -- specify template size and spacing"},tabs$2={page:"Page",layoutOrder:"Layout",shape:"Shape",margin:"Margin",spacing:"Spacing"},shell$1={objectList:"Object list",rename:"Rename",settings:"Settings",fillStroke:"Fill & stroke",backgroundColor:"Background color",backgroundImage:"Background image",replace:"Replace",clear:"Clear",cover:"Cover",borderPattern:"Border pattern",layers:"Layers",renameLayer:"Rename layer",layerNamePlaceholder:"Enter layer name",noStroke:"No stroke",patternNumber:"Pattern {number}",replaceImage:"Replace image",viewBarcode:"View barcode content",enterBarcode:"Enter barcode content",viewQrCode:"View QR code content",enterQrCode:"Enter QR code content",maxLayers:"A maximum of {count} layers is supported",deleteLayer:"Delete layer",deleteLayerConfirm:"Delete “{name}”?",updateSuccess:"Updated successfully",untitled:"Untitled",uploadCloudSuccess:"Uploaded to My Cloud Templates",uploadFailed:"Upload failed",cloudIdMissing:"Cloud template ID is missing; download is unavailable",downloadTemplate:"Download template",downloadSuccess:"Download successful",downloadFailed:"Download failed",createCanvasFirst:"Create a canvas first",undefinedAction:"Undefined action: {action}",fileOpenFailed:"Failed to open file",openFile:"Open file",textPrompt:"Double-click to enter text",text:"Text",selectTool:"Select (V)",panTool:`Pan canvas (H)
418
+ Hold Space to pan temporarily`,print:"Print",saveFile:"Save file",newFile:"New file",rect:"Rectangle",triangle:"Triangle",circle:"Circle",line:"Line",textTool:"Text",table:"Table",barcode:"Barcode",qrCode:"QR code",picture:"Image",counter:"Date counter",variable:"Variable",database:"Database",databaseView:"Database view",refreshDatabase:"Refresh database",firstRecord:"First record",previousRecord:"Previous record",nextRecord:"Next record",lastRecord:"Last record",name:"Name"},feature$1={dateFormat:"Date format",addVariable:"Add variable",importImage:"Import image",imagePath:"Image path: {path}",externalInputChineseFormatUnsupported:"External input does not support formats containing Chinese characters",copyId:"Copy ID",cell:"Cell",cellIndex:"Cell {index}",cellPosition:"Row {row}, column {column}"},copy$3={"532cd474d1":"Start value","911dd68193":"Sequence length","6078bac61a":"Increment",de61aa8e1c:"Preview","8e35f2b9f3":"Hexadecimal","68c1392da2":"Write as number",fe992493bf:"Write as characters","9d2601c843":"Format",b6fed9af83:"Date","4a570eab6a":"Day as a number without a leading zero",ec27904da4:"Day as a number with a leading zero",d741bd3dfc:"Localized abbreviated day name","792c34e70d":"Mon",c3405710e0:"Sun","50e83fe09b":"Localized full day name",dded7a4890:"Monday",d9636d4a90:"Sunday","6c386a81be":"Month as a number without a leading zero",bf35a6483e:"Month as a number with a leading zero",dc2d993af6:"Localized abbreviated month name","5b17a06153":"Oct",dfef764f33:"Nov","7d0ccf16f3":"Localized full month name.","76a16869e0":"Two-digit year","617517584f":"Four-digit year.","3de91c80ce":"Hour without a leading zero","71b6771bc7":"displayed","5ebd64c830":"Hour with a leading zero",e1f6bc2677:"Minute without a leading zero.","472e0cbc27":"Minute with a leading zero.",ff4b6ad7d6:"Second without a leading zero.","28ba129d4e":"Second with a leading zero.",bcba353efd:"Millisecond without leading zeros.","273d567f9c":"Millisecond with leading zeros.","7f5c242027":"Use AM",e4780194e0:"PM display; a","312ba03084":"is replaced by",e214ee22dd:"AM","3fbe3edfc5":"or","1dfaab6548":"PM","3d88094723":".",fb2a23dc16:"Time zone","46930b1ccf":"for example",fa747dfcf3:"Counter type","7a4dc8253f":"Number","8bdf1760f0":"Letter","83a8f475e3":"Prefix","90a2f53d3a":"Suffix","8b0db67871":"Current value","29e1d3d9f0":"Increment","39a52f2df5":"Digits","57f15bb774":"Pad with zeros",a3ccf702c5:"Data source","700c93d882":"Formats supported by external input",c8d09cf955:"Default",f4dbbc63a5:"Database","7bb7346e15":"External input",ef258428cd:"Counter",a74a77bc7f:"Text, counter, and date combination","2d0366384f":"QR code",b1085310cb:"Barcode",b418ca60d4:"Variable","382f4b5559":"Please select","6a954390e3":"Table",ad3ee64830:"Column","6bd6e44cbc":"Select an element ID","850e2546c3":"Linked barcode ID",a424315147:"Content cannot be edited after linking","20bc33c7ba":"Linked barcode: ","4b822f835d":"Linked QR code ID",e5346f5159:"Linked QR code: ","9f6e8dba88":"Select a key","8cef5cc20b":"Import variables","1cebaf21fb":"Import JSON file",a25ed32d21:"Clear data",b56d9ac6c5:"Confirm","4d0b4688c7":"Cancel","184a9c08ac":"Clear all variables?",cce10d7b40:"File import failed","609d669223":"Duplicate keys exist. Edit them before confirming.",b088a3713a:"Select font",f670b2adc0:"Bold",af5a2c8bff:"Italic",c85de9e58a:"Strikethrough","9bc18ae51e":"Underline",f4d3dab8e0:"Text","07f568dada":"Text color",c9c7630d2c:"Text font","34098a184f":"Text size","0fa1d514a5":"Barcode type","0c5279c8ae":"Barcode text settings","576ccdb1f1":"Font size",f7af330e8f:"QR code type",cc288c9c8e:"QR code error correction level",d480c424f8:"QR code value text settings","4e3a37477c":"Show QR code value","89c41faeea":"Module pixels",fb54f6f959:"Aspect ratio","020af9c5f4":"LongBei code error correction level","204ca8e993":"QR code error correction level","3276f518f5":"Import using the image aspect ratio",a41a0c9fd2:"Select clip art","446d1e1236":"Please select an image","18104edf89":"Select image",be8da62ea1:"Image",e423d0e04e:"Failed to select image","17ad570546":"Print counter",d84a63fd99:"Print date",bc90a3957d:"Keyboard input","5585698377":"PM display","9978b8a700":"Corner radius","579f280b5d":"Rows","150074c2e8":"Table","2a2b777ae4":"Row","1082f4e944":"Solid","12c09d0341":"Dashed","72077749f7":"None","83100cd7eb":"Insert row above","5d80537a38":"Insert row below",bdc0e99b04:"Delete current row",eee6dec245:"Delete current column","199013c934":"Insert column left","45989304d7":"Insert column right",cee8bcba20:"Font size",b534c8636c:"Line height",c86f1b361f:"Character spacing","6d93ab3fba":"Character spacing","5937a2c95a":"Text position","413f8db65f":"Align left","5be891c540":"Align center","70fe40dec2":"Align right",a9d35ab0a6:"Top","435b2d8982":"Bottom","443bde0f4c":"Text alignment","989d1affa0":"Version","0965832369":"Date offset","6f14c2641c":"Year",d9b59879f3:"Month","15917f3b32":"Day","86ec1ca75c":"Width",eea51aa44b:"Height",cb165f5ca1:"Rotation angle","5268436bdf":"Align horizontal center","8a9aed3516":"Distribute horizontally",ceb66a60f6:"Align top","2cd89127c4":"Align vertical center","5d2078e01c":"Align bottom",f8735a4579:"Distribute vertically","3ffbbe25d5":"Center horizontally on canvas","7cd8c94d34":"Center vertically on canvas","9474979eb3":"Center horizontally in area","73678a1e04":"Center vertically in area","41654e0268":"Basic information","067f80c392":"Columns","68d87ec64c":"Column width",db63adaf4c:"Double-click a cell to edit","046ca7db56":"Top",b3ceb938fb:"Right","343b383f1d":"Bottom","8566923239":"Left","68238a67bc":"Font color","97c8abc1b8":"Arc radius (positive bends up, negative bends down)","83cc65b13f":"Single line","918a0c837b":"Paragraph","7d9b9e079f":"Arc layout","0a84571f3e":"Size mode","1b95368e24":"Scale","2c06479d15":"Free","3d17580e06":"Barcode height (mm)","4e28691ff7":"Barcode height","5f397a20e8":"Barcode-text gap (mm)","60a48b31d9":"Barcode-text gap"},enEditor={remaining:remaining$1,label:label$1,newLabel:newLabel$1,cloudLabel:cloudLabel$1,labelFileFilter:labelFileFilter$1,labelSettings:labelSettings$2,labelEditSettings:labelEditSettings$1,labelSize:labelSize$1,labelWidth:labelWidth$1,labelHeight:labelHeight$1,labelShape:labelShape$1,labelsPerPage:labelsPerPage$1,oneLabelPerPage:oneLabelPerPage$1,multipleLabelsPerPage:multipleLabelsPerPage$1,pageHasMargins:pageHasMargins$1,pageHasNoMargins:pageHasNoMargins$1,labelSideMargin:labelSideMargin$1,varnishLayer:varnishLayer$1,varnishPanel:varnishPanel$1,specialist:specialist$1,templateName:templateName$3,instantEditPrint:instantEditPrint$1,instantScanPrint:instantScanPrint$1,linkedContentReadonly:linkedContentReadonly$1,qrCodeContent:qrCodeContent$1,defaults:defaults$1,objectNames:objectNames$1,contextMenu:contextMenu$1,image:image$1,wizard:wizard$1,tabs:tabs$2,shell:shell$1,feature:feature$1,copy:copy$3},title$5="Print",preview$1="Preview",file$2="Print file:",range$2="Print range",copies$1="Copies",content$1="Print content",toFile$1="Print to file",direction$1="Print direction",order$1="Print order",counter$3="Print counter",date$3="Print date",cancel$1="Cancel printing",connecting$3="Connecting to printer",connectingPrinter$1="Connecting to printer...",printing$1="Printing...",complete$1="Printing complete",pageComplete$1="Page {page} printed",maximumRows$1="Maximum printable rows in the page range: {rows}",rewind$1="Rewind",separateLayers$1="Print layers separately",multipleLabels$1="Print multiple labels",sendTemplate$1="Send template",selectDriver$1="Select driver",advancedOptions$1="Advanced options",paperSavingMode$1="Paper saving mode",enabled$1="On",disabled$1="Off",serialCount$1="Serial number count",startRecord$1="Start record",endRecord$1="End record",pageRange$1="Page range",rangeExample$1="Example: 1-3,8,10",copyCount$1="Copy count",template$1="Template",templateName$2="Template name",currentAssociations$1="Current associations:",sheetRows$1="{sheet} has {rows} rows; ",driver$1="Driver:",task$1="Task:",taskComplete$1="Task complete",success$1="Succeeded:",failed$1="Failed:",progress$1="Progress:",firstPage$1="First page",previousPage$1="Previous page",currentPage$1="Current page",nextPage$1="Next page",lastPage$1="Last page",firstImage$1="First image",previousImage$1="Previous image",currentImage$1="Current image",nextImage$1="Next image",lastImage$1="Last image",pageSummary$1="Page {current}/{totalPages}, {total} images total",previewGenerating$1="Generating print preview...",previewFailed$1="Failed to generate print preview",saveTemplateFile$1="Save template file",templateFileFilter$1="Template files",templateSaved$1="Template saved",templateSent$1="Template sent",errors$1={connectFailed:"Failed to connect to printer",tidReadFailed:"Failed to read TID",pageFailed:"Failed to print page {page}",templateSendFailed:"Failed to send template",missingDriver:"Select a driver",emptyCanvas:"An empty canvas cannot be printed or previewed",missingTemplateName:"Enter a template name",startAfterEnd:"The start page cannot be after the end page",rangeExceeded:"The maximum print page range was exceeded",invalidPage:"Invalid page number",invalidPageFormat:"Invalid page range format",invalidDriverResponse:"No JSON response received"},enPrint={title:title$5,preview:preview$1,file:file$2,range:range$2,copies:copies$1,content:content$1,toFile:toFile$1,direction:direction$1,order:order$1,counter:counter$3,date:date$3,continue:"Continue printing",cancel:cancel$1,connecting:connecting$3,connectingPrinter:connectingPrinter$1,printing:printing$1,complete:complete$1,pageComplete:pageComplete$1,maximumRows:maximumRows$1,rewind:rewind$1,separateLayers:separateLayers$1,multipleLabels:multipleLabels$1,sendTemplate:sendTemplate$1,selectDriver:selectDriver$1,default:"Default",advancedOptions:advancedOptions$1,paperSavingMode:paperSavingMode$1,enabled:enabled$1,disabled:disabled$1,serialCount:serialCount$1,startRecord:startRecord$1,endRecord:endRecord$1,pageRange:pageRange$1,rangeExample:rangeExample$1,copyCount:copyCount$1,template:template$1,templateName:templateName$2,currentAssociations:currentAssociations$1,sheetRows:sheetRows$1,driver:driver$1,task:task$1,taskComplete:taskComplete$1,success:success$1,failed:failed$1,progress:progress$1,firstPage:firstPage$1,previousPage:previousPage$1,currentPage:currentPage$1,nextPage:nextPage$1,lastPage:lastPage$1,firstImage:firstImage$1,previousImage:previousImage$1,currentImage:currentImage$1,nextImage:nextImage$1,lastImage:lastImage$1,pageSummary:pageSummary$1,previewGenerating:previewGenerating$1,previewFailed:previewFailed$1,saveTemplateFile:saveTemplateFile$1,templateFileFilter:templateFileFilter$1,templateSaved:templateSaved$1,templateSent:templateSent$1,errors:errors$1},title$4="Database",type$1="Database type",name$1="Database name",view$1="Database view",path$1="Database path:",serverAddress$1="Database server address",serverPort$1="Database server port",userName$1="Database user name",password$1="Database password",select$1="Select database",connect$1="Connect",serverUrl$1="Server URL",filePath$1="File path",serverAddressPlaceholder$1="Server address",serverPortPlaceholder$1="Server port",selectFile$1="Select file",sheet$1="Table:",column$1="Column:",hex$1="Hexadecimal",numericWrite$1="Write as number",characterWrite$1="Write as text",deleteCharacters$1="Delete characters",sheetInstructions$1="Select a worksheet, then specify how its data is arranged",previewRows$1="Preview (10 rows)",selectedSheets$1="You selected the following tables",addAnotherPrompt$1="Would you like to add another table?",addAnotherYes$1="Yes, select another table",addAnotherNo$1="No, selection is complete",selectFailed$1="Failed to select database",connecting$2="Connecting to database",connectionSuccess$1="Database connected",connectionFailed$3="Database connection failed",prompts$2={excelFile:"Select an Excel file",dbFile:"Select a db file",serverAddress:"Enter the database server address",serverPort:"Enter the database server port",name:"Enter the database name",userName:"Enter the database user name",password:"Enter the database password"},enDatabase={title:title$4,type:type$1,name:name$1,view:view$1,path:path$1,serverAddress:serverAddress$1,serverPort:serverPort$1,userName:userName$1,password:password$1,select:select$1,connect:connect$1,serverUrl:serverUrl$1,filePath:filePath$1,serverAddressPlaceholder:serverAddressPlaceholder$1,serverPortPlaceholder:serverPortPlaceholder$1,selectFile:selectFile$1,sheet:sheet$1,column:column$1,hex:hex$1,numericWrite:numericWrite$1,characterWrite:characterWrite$1,deleteCharacters:deleteCharacters$1,sheetInstructions:sheetInstructions$1,previewRows:previewRows$1,selectedSheets:selectedSheets$1,addAnotherPrompt:addAnotherPrompt$1,addAnotherYes:addAnotherYes$1,addAnotherNo:addAnotherNo$1,selectFailed:selectFailed$1,connecting:connecting$2,connectionSuccess:connectionSuccess$1,connectionFailed:connectionFailed$3,prompts:prompts$2},title$3="RFID label",safeArea$1="Safe area",counter$2="Counter",settings$1="RFID label settings",production$1="RFID label production",uhfPrint$1="UHF RFID printing",protocol$1="RFID label protocol standard",readOffset$1="RFID label read offset",writeContent$1="Label write content",tid$1="Tag identifier (TID)",longbeiContent$1="Longbei code content",longbeiErrorCorrection$1="Longbei code error-correction level",guojun$1="Guojun",databaseSource$1="Database",status$1="Status",power$1="Power",readPower$1="Read power",writePower$1="Write power",getCurrentValue$1="Get current device value",crcValidation$1="RFID data CRC validation",commandPassword$1="Command password",oldCommandPassword$1="Old command password",newCommandPassword$1="New command password",enterOldCommandPassword$1="Enter old command password",enterNewCommandPassword$1="Enter new command password",accessPassword$1="Access password",oldPassword$1="Old password",newPassword$1="New password",manualInput$1="Manual input",enterEightDigitPassword$1="Enter an 8-digit password",savePasswordToFile$1="Save password",regionPermissions$1="Region permissions",epcRegion$1="EPC region",userRegion$1="User region",reservedRegion$1="Reserved region",lock$1="Lock",permanentLock$1="Permanent lock",neverLock$1="Never lock",changeKillPassword$1="Change Kill password",killPassword$1="Kill password",paddingMethod$1="Padding method",defaultPadding$1="Default",padStart$2="Pad start",padEnd$1="Pad end",dataSource$1="Data source",hexadecimal$1="Hexadecimal",text$1="Text",date$2="Date",sequenceGenerator$1="Sequence generator",enterData$1="Enter data",minimumPaddingDigits$1="Minimum padding digits",readWrite$1="Readable and writable",readOnly$1="Read-only",configureMemoryProperties$1="Configure memory properties",configureSecurityMode$1="Configure security mode",noAuthentication$1="No authentication",authenticationWithoutSecureCommunication$1="Authentication without secure communication",authenticationWithSecureCommunication$1="Authentication with secure communication",unsavedSwitchConfirm$1="There are unsaved settings. Continue switching?",deviceDetectionFailed$1="Device detection failed. Error code: {code}; details: {detail}",noPrinterFound$1="No printer was found",connectionFailed$2="Connection failed. Error code: {code}; details: {detail}",connectedTo$1="Connected to: {device}",oldAndNewPasswordRequired$1="Old and new passwords cannot both be empty",savePasswordSuccess$1="Password saved successfully",savePasswordFailed$1="Failed to save password",passwordRequired$1="Password is required",oldPasswordEightDigits$1="Old password must be 8 digits",newPasswordEightDigits$1="New password must be 8 digits",killPasswordEightDigits$1="Kill password must be 8 digits",oldCommandPasswordEightDigits$1="Old command password must be 8 digits",newCommandPasswordEightDigits$1="New command password must be 8 digits",newCommandRequiredForAccessChange$1="A new command password is required to change the access password",oldCommandRequiredForAccessChange$1="The old command password is required to change the access password",changeKillPasswordConfirm$1="Change the Kill password?",paddingMultipleOfFour$1="Padding length must be a multiple of 4",setFailedWithDetail$1="Set failed: {detail}",getFailedWithDetail$1="Get failed: {detail}",enRfid={title:title$3,safeArea:safeArea$1,counter:counter$2,settings:settings$1,production:production$1,uhfPrint:uhfPrint$1,protocol:protocol$1,readOffset:readOffset$1,writeContent:writeContent$1,tid:tid$1,longbeiContent:longbeiContent$1,longbeiErrorCorrection:longbeiErrorCorrection$1,guojun:guojun$1,databaseSource:databaseSource$1,status:status$1,power:power$1,readPower:readPower$1,writePower:writePower$1,getCurrentValue:getCurrentValue$1,crcValidation:crcValidation$1,commandPassword:commandPassword$1,oldCommandPassword:oldCommandPassword$1,newCommandPassword:newCommandPassword$1,enterOldCommandPassword:enterOldCommandPassword$1,enterNewCommandPassword:enterNewCommandPassword$1,accessPassword:accessPassword$1,oldPassword:oldPassword$1,newPassword:newPassword$1,manualInput:manualInput$1,enterEightDigitPassword:enterEightDigitPassword$1,savePasswordToFile:savePasswordToFile$1,regionPermissions:regionPermissions$1,epcRegion:epcRegion$1,userRegion:userRegion$1,reservedRegion:reservedRegion$1,lock:lock$1,permanentLock:permanentLock$1,neverLock:neverLock$1,changeKillPassword:changeKillPassword$1,killPassword:killPassword$1,paddingMethod:paddingMethod$1,defaultPadding:defaultPadding$1,padStart:padStart$2,padEnd:padEnd$1,dataSource:dataSource$1,hexadecimal:hexadecimal$1,text:text$1,date:date$2,sequenceGenerator:sequenceGenerator$1,enterData:enterData$1,minimumPaddingDigits:minimumPaddingDigits$1,readWrite:readWrite$1,readOnly:readOnly$1,configureMemoryProperties:configureMemoryProperties$1,configureSecurityMode:configureSecurityMode$1,noAuthentication:noAuthentication$1,authenticationWithoutSecureCommunication:authenticationWithoutSecureCommunication$1,authenticationWithSecureCommunication:authenticationWithSecureCommunication$1,unsavedSwitchConfirm:unsavedSwitchConfirm$1,deviceDetectionFailed:deviceDetectionFailed$1,noPrinterFound:noPrinterFound$1,connectionFailed:connectionFailed$2,connectedTo:connectedTo$1,oldAndNewPasswordRequired:oldAndNewPasswordRequired$1,savePasswordSuccess:savePasswordSuccess$1,savePasswordFailed:savePasswordFailed$1,passwordRequired:passwordRequired$1,oldPasswordEightDigits:oldPasswordEightDigits$1,newPasswordEightDigits:newPasswordEightDigits$1,killPasswordEightDigits:killPasswordEightDigits$1,oldCommandPasswordEightDigits:oldCommandPasswordEightDigits$1,newCommandPasswordEightDigits:newCommandPasswordEightDigits$1,newCommandRequiredForAccessChange:newCommandRequiredForAccessChange$1,oldCommandRequiredForAccessChange:oldCommandRequiredForAccessChange$1,changeKillPasswordConfirm:changeKillPasswordConfirm$1,paddingMultipleOfFour:paddingMultipleOfFour$1,setFailedWithDetail:setFailedWithDetail$1,getFailedWithDetail:getFailedWithDetail$1},invalidPageSize$1="Invalid page size. Adjust the label size, margins, or spacing.",pageExceedsSettings$1="The page exceeds the configured area. Adjust the label size, margins, or spacing.",emptyCanvas$1="An empty canvas cannot be printed or previewed",printFailed$1="Failed to print page {page}",pageRangeExceeded$1="Maximum print page range exceeded",printerUnavailable$1="No printer was found",printerConnectionFailed$1="Unable to connect to printer",databaseSelectionFailed$1="Failed to select database",networkTimeout$1="The request timed out. Check the network and try again.",unknown$1="Something went wrong. Please try again.",unknownWithCode$1="Something went wrong (code: {code}). Please try again.",enErrors={invalidPageSize:invalidPageSize$1,pageExceedsSettings:pageExceedsSettings$1,emptyCanvas:emptyCanvas$1,printFailed:printFailed$1,pageRangeExceeded:pageRangeExceeded$1,printerUnavailable:printerUnavailable$1,printerConnectionFailed:printerConnectionFailed$1,databaseSelectionFailed:databaseSelectionFailed$1,networkTimeout:networkTimeout$1,unknown:unknown$1,unknownWithCode:unknownWithCode$1},actions={confirm:"確認",cancel:"キャンセル",close:"閉じる",save:"保存",delete:"削除",continue:"続行",refresh:"更新",select:"選択",create:"新規作成",custom:"カスタム",set:"設定"},dialog={prompt:"ヒント",defaultContent:"これはデフォルトのダイアログ内容です"},feedback={notice:"お知らせ",setSuccess:"設定に成功しました"},prompts$1={enter:"入力してください"},locale={zhCN:"简体中文",enUS:"English"},tabs$1={closingTitle:"タブを閉じています",closePrompt:"タブ[{name}]の内容を閉じますか?",savePrompt:"タブ[{name}]の内容を保存しますか?",closeAll:"すべてのタブを閉じる"},commonUi={clipArrow:"矢印",clipMark:"マーク",clipPunctuation:"句読点",clipSequence:"連番",color:"色",opacity:"透明度",canvasUnavailable:"Canvas コンテキストを取得できません",addElement:"要素を追加",selectRelatedId:"関連付ける要素IDを選択",relatedName:"関連要素名:",none:"なし",textSlice:"テキスト切り取り",moveUp:"上に移動",moveDown:"下に移動",start:"開始",end:"終了",cropImage:"画像を切り抜き",keepAspectRatio:"画像の縦横比を保持",crop:"切り抜き",renamePrompt:"名前を入力してください",invalidProperty:"属性値エラー",customPlaceholder:"カスタム設定",databaseView:"データベース表示",databasePath:"データベースパス",dataTable:"データテーブル",totalRows:"全 {count} 件",sequence:"連番",upgrade:"アップグレード",requestAuthorization:"認証を申請",generateAuthorization:"認証情報を生成",importAuthorizationFile:"認証ファイルをインポート",authorizationFilePath:"ライセンスファイルパス",companyName:"会社名",enterCompanyName:"会社名を入力",contact:"連絡先",enterContact:"連絡先を入力",phone:"電話番号",enterPhone:"電話番号を入力",email:"メール",enterEmail:"メールアドレスを入力",submit:"送信",sendQrCode:"QRコードのスクリーンショットを運用担当者に送信して認証ファイルを生成してください",regenerateAuthorization:"認証情報を再生成",companyNameRequired:"会社名を入力してください",contactRequired:"連絡先を入力してください",phoneRequired:"電話番号を入力してください",phoneInvalid:"正しい電話番号を入力してください",emailRequired:"メールアドレスを入力してください",emailInvalid:"正しいメールアドレスを入力してください",authorizationUpgradeSuccess:"ライセンス更新完了",preview:"プレビュー",clickPreview:"クリックしてプレビューを表示",fill:"塗りつぶし",backgroundFill:"背景塗りつぶし",stroke:"ストローク",strokeStyle:"ストロークスタイル",strokeWidth:"ストローク幅",dashLength:"線分の長さ",dash:"線分",gapLength:"間隔の長さ",gap:"間隔",sdkVersion:"SDK バージョン",newFile:"新規ファイル",doNotSave:"保存しない"},newStep={preview:"プレビュー:",labelSize:"ラベルサイズ",millimeters:"mm",invalidDimensions:"エラー:ページサイズが正しくありません。ラベルサイズ、余白、間隔などを調整してください",newFile:"新規ファイル",openFile:"ファイルを開く",openTemplate:"テンプレートを開く",oneLabelPerPage:"1ページに1ラベル",multipleLabelsPerPage:"1ページに複数ラベル",rows:"行:",columns:"列:",printOrder:"印刷順序:",startCorner:"開始位置:",preferredDirection:"優先方向:",leftTop:"左上",leftBottom:"左下",rightTop:"右上",rightBottom:"右下",horizontal:"水平",vertical:"垂直",hasMarginsQuestion:"ページにサイドマージンは含まれますか?",hasMargins:"はい、ラベルページにはサイドマージンが含まれます",noMargins:"無し、ラベル右マージンなし",marginSize:"サイドマージンサイズ",left:"左:",right:"右:",top:"上:",bottom:"下:",rectangle:"長方形",roundedRectangle:"角丸長方形",ellipse:"楕円",pageWidth:"ページ幅:",pageHeight:"ページ高さ:",printDirection:"印刷方向",portrait:"縦方向",landscape:"横",width:"幅:",height:"高さ:",manual:"手動設定",spacing:"間隔",horizontalSpacing:"水平間隔:",verticalSpacing:"垂直間隔:",margins:"余白:",fileNamePrompt:"ファイル名を入力してください:"},jaCommon={actions,dialog,feedback,prompts:prompts$1,locale,tabs:tabs$1,commonUi,newStep},file$1="ファイル",edit="編集",print="印刷(P)",database="データベース",databaseView="データベース表示",refreshDatabase="データベースを更新",labelSettings$1="ラベルプロパティ設定",fileWithKey="ファイル(F)",editWithKey="編集(E)",viewWithKey="表示(V)",toolsWithKey="ツール(T)",helpWithKey="ヘルプ(H)",open$1="開く(O)",save="保存(S)",saveAs$1="名前を付けて保存(A)",downloadTemplate="テンプレートをダウンロード",uploadCloud="クラウドテンプレートにアップロード",undo="元に戻す(Z)",redo="やり直す(R)",copy$2="コピー(C)",paste="貼り付け(V)",cut="切り取り(X)",exportImage="画像をエクスポート",objectProps="オブジェクトプロパティ",zoom="ズーム",zoomIn="拡大",zoomOut="縮小",zoomAuto="自動ズーム",ruler="定規",grid="グリッド",visible="表示",helpIndex="ヘルプインデックス",about="LabelEditorについて",closeAll="すべてのタブを閉じる",minimize="最小化",restore="元のサイズに戻す",maximize="最大化",close="閉じる",jaMenu={file:file$1,edit,print,database,databaseView,refreshDatabase,labelSettings:labelSettings$1,fileWithKey,editWithKey,viewWithKey,toolsWithKey,helpWithKey,new:"新規(N)",open:open$1,save,saveAs:saveAs$1,downloadTemplate,uploadCloud,undo,redo,copy:copy$2,paste,cut,delete:"削除(D)",exportImage,objectProps,zoom,zoomIn,zoomOut,zoomAuto,ruler,grid,visible,helpIndex,about,closeAll,minimize,restore,maximize,close},remaining={upperLayer:"上層",lowerLayer:"下層",doubleClickText:"ダブルクリックして入力",imageLoadFailed:"画像の読み込みに失敗しました",emptyCannotSave:"空のファイルは保存できません",emptyCannotExport:"空のファイルは画像をエクスポートできません",unnamed:"無題",savedToMyTemplates:"マイテンプレートに保存しました",missingCloudId:"クラウドテンプレートIDが見つからないため保存できません",saveSuccess:"保存に成功しました",saveFileFailed:"ファイルの保存に失敗しました",fileNotWritable:"ファイルに書き込みできません",saveFile:"ファイルを保存",labelFilter:"ラベル(*.LEX)",savedFile:"ファイルの保存に成功しました",thumbnailFailed:"サムネイルの生成に失敗しました",saveImage:"画像を保存",imageFilter:"画像(*.png)",saveFailed:"保存に失敗しました",alreadyOpen:"このファイルは既に開かれています",openFailed:"ファイルを開けませんでした",cloudTemplate:"クラウドテンプレート",closeAllTabs:"すべてのタブを閉じる",newFileNumber:"新規ファイル{number}",serverError:"サーバーエラー",serverConnectError:"连接服务器异常,请查看网络是否正常",methodUnavailable:"メソッド {method} は未実装または利用できません",barcodeVersion:"バージョン",barcodeGrid:"列数×行数",barcodeRows:"行数",barcodeColumns:"列数"},label="ラベル",newLabel="新規ラベル",cloudLabel="クラウドラベル",labelFileFilter="ラベル(*.LEX)",labelSettings="ラベルプロパティ設定",labelEditSettings="ラベル編集設定",labelSize="ラベルサイズ",labelWidth="ラベル幅",labelHeight="ラベル高さ",labelShape="ラベル形状",labelsPerPage="1ページあたりのラベル数",oneLabelPerPage="1ページに1ラベル",multipleLabelsPerPage="1ページに複数ラベル",pageHasMargins="はい、ラベルページにサイドマージンが含まれます",pageHasNoMargins="いいえ、ラベルにサイドマージンはありません",labelSideMargin="ラベルのサイドマージン",varnishLayer="ニス層",varnishPanel="ニス設定パネル",specialist={laser:{title:"レーザー設定",selectPreset:"プリセットパラメータを選択",deletedWarning:'レーザー設定 "{deletedNames}" は削除されました。使用しているオブジェクトはデフォルトパラメータに戻ります',limitWarning:"レーザー設定の上限({maxPresets})を超えました。一部の新プリセットはインポートされませんでした",fields:{repeatTimes:"マーキング回数",scanSpeed:"レーザー速度",jumpSpeed:"ジャンプ速度",power:"パワー",frequency:"周波数",pulseWidth:"パルス幅",openLightDelay:"発光遅延",closeLightDelay:"消灯遅延",endDelay:"終了遅延",cornerDelay:"コーナー遅延",jumpDelay:"ジャンプ遅延"}},varnish:{none:"なし",portraitOutline:"ポートレート輪郭",enabled:"あり",colorOverlay:"カラーオーバーレイ",fullOverlay:"全面オーバーレイ"}},templateName$1="ラベルテンプレート_{name}",instantEditPrint="編集してすぐ印刷",instantScanPrint="スキャンしてすぐ印刷",linkedContentReadonly="関連元があるためコンテンツを編集できません",qrCodeContent="QRコード内容",defaults={layer:"レイヤー {sequence}"},objectNames={text:"テキスト",textname:"名前",image:"画像",rect:"長方形",triangle:"三角形",table:"テーブル",circle:"円",line:"直線",barcode:"バーコード",barcode2d:"二次元コード",counter:"日付カウンター",group:"グループ"},contextMenu={delete:"削除",lock:"オブジェクトをロック",unlock:"オブジェクトのロックを解除",layers:"レイヤー管理",bringForward:"一つ上へ",sendBackwards:"一つ下へ",bringToFront:"最前面へ",sendToBack:"最背面へ",group:"グループ化",ungroup:"グループ解除"},image={settings:"画像設定",keepRatio:"画像の縦横比を保持",flipHorizontal:"水平反転",flipVertical:"垂直反転",grayscale:"グレースケール",sharpen:"白黒図の鮮明度最適化",anchorAlignment:"アンカー配置",anchorSettings:"アンカー設定",alignment:"配置:",crop:"画像切り抜き",replace:"画像を交換",selectFile:"ファイルを選択",selectClipArt:"クリップアートを選択",selectTitle:"画像を選択",fileType:"画像",selectFailed:"画像の選択に失敗しました",selectRequired:"画像を選択してください",unsupportedType:"サポートされていないファイル形式です",processingFailed:"ファイル処理に失敗しました: {detail}",canvasCreateFailed:"キャンバスの作成に失敗しました",temporaryCanvasCreateFailed:"一時キャンバスの作成に失敗しました",decodeFailed:"画像のデコードに失敗しました",readFailed:"ファイルの読み取りに失敗しました",align:{leftTop:"左上",topCenter:"上部中央",rightTop:"右上",leftCenter:"左中央",center:"中央",rightCenter:"右中央",leftBottom:"左下",bottomCenter:"下部中央",rightBottom:"右下"}},wizard={previous:"前へ",next:"次へ",finish:"完了",welcome:"Label Editorへようこそ",chooseTask:"実行するタスクを選択してください",labelsPerPageStep:"1ページあたりのラベル数 - 用紙属性を指定",sideMarginStep:"サイドマージン - ラベルのサイドマージンを指定",shapeStep:"ラベル形状 - ラベルの形状を指定",spacingStep:"テンプレートサイズと間隔 - テンプレートのサイズと間隔を指定"},tabs={page:"ページ",layoutOrder:"レイアウトと順序",shape:"形状",margin:"余白",spacing:"間隔"},shell={objectList:"オブジェクトリスト",rename:"名前変更",settings:"設定",fillStroke:"塗りつぶしとストローク",backgroundColor:"背景色",backgroundImage:"背景画像",replace:"交換",clear:"クリア",cover:"全面表示",borderPattern:"ストロークパターン",layers:"レイヤー",renameLayer:"レイヤー名を変更",layerNamePlaceholder:"レイヤー名を入力してください",noStroke:"ストロークなし",patternNumber:"パターン {number}",replaceImage:"画像を交換",viewBarcode:"バーコード内容を表示",enterBarcode:"バーコード内容を入力してください",viewQrCode:"QRコード内容を表示",enterQrCode:"QRコード内容を入力してください",maxLayers:"最大 {count} レイヤーまでサポート",deleteLayer:"レイヤーを削除",deleteLayerConfirm:"「{name}」を削除してもよろしいですか?",updateSuccess:"更新に成功しました",untitled:"無題",uploadCloudSuccess:"クラウドテンプレートへのアップロードに成功しました",uploadFailed:"アップロードに失敗しました",cloudIdMissing:"クラウドテンプレートIDが見つからないためダウンロードできません",downloadTemplate:"テンプレートをダウンロード",downloadSuccess:"ダウンロードに成功しました",downloadFailed:"ダウンロードに失敗しました",createCanvasFirst:"先にキャンバスを作成してください",undefinedAction:"未定義の操作: {action}",fileOpenFailed:"ファイルを開けませんでした",openFile:"ファイルを開く",textPrompt:"ダブルクリックしてテキストを入力",text:"テキスト",selectTool:"選択(V)",panTool:`キャンバス移動(H)
419
+ スペースキーを押すと一時的に移動`,print:"印刷",saveFile:"ファイルを保存",newFile:"新規ファイル",rect:"長方形",triangle:"三角形",circle:"円",line:"線",textTool:"テキスト",table:"テーブル",barcode:"バーコード",qrCode:"QRコード",picture:"画像",counter:"日付カウンター",variable:"変数",database:"データベース",databaseView:"データベース表示",refreshDatabase:"データベースを更新",firstRecord:"最初のレコード",previousRecord:"前のレコード",nextRecord:"次のレコード",lastRecord:"最後のレコード",name:"名前"},feature={dateFormat:"日付形式",addVariable:"変数を追加",importImage:"画像をインポート",imagePath:"画像パス: {path}",externalInputChineseFormatUnsupported:"外部入力は中国語形式に対応していません",copyId:"IDをコピー",cell:"セル",cellIndex:"セル {index}",cellPosition:"{row} 行 {column} 列"},copy$1={"532cd474d1":"開始値","911dd68193":"連番桁数","6078bac61a":"増分",de61aa8e1c:"プレビュー","8e35f2b9f3":"16進数","68c1392da2":"数値書き込み",fe992493bf:"文字書き込み","9d2601c843":"形式",b6fed9af83:"日付","4a570eab6a":"日(ゼロ埋めなしの数字)",ec27904da4:"日を数字表記、先頭ゼロ付き",d741bd3dfc:"日(短縮ローカライズ名称)","792c34e70d":"月曜",c3405710e0:"日曜","50e83fe09b":"日(非短縮ローカライズ名称)",dded7a4890:"月曜日",d9636d4a90:"日曜日","6c386a81be":"月(ゼロ埋めなしの数字)",bf35a6483e:"月(ゼロ埋めありの数字)",dc2d993af6:"月(短縮ローカライズ名称)","5b17a06153":"10月",dfef764f33:"11月","7d0ccf16f3":"月(非短縮ローカライズ名称)","76a16869e0":"年(2桁)","617517584f":"年(4桁)","3de91c80ce":"時(ゼロ埋めなし)","71b6771bc7":"表示","5ebd64c830":"時(ゼロ埋めあり)",e1f6bc2677:"分(ゼロ埋めなし)","472e0cbc27":"分(ゼロ埋めあり)",ff4b6ad7d6:"秒(ゼロ埋めなし)","28ba129d4e":"秒(ゼロ埋めあり)",bcba353efd:"ミリ秒(ゼロ埋めなし)","273d567f9c":"ミリ秒(ゼロ埋めあり)","7f5c242027":"午前",e4780194e0:"午後表示 a","312ba03084":"で",e214ee22dd:"午前","3fbe3edfc5":"または","1dfaab6548":"午後","3d88094723":"置き換えられます",fb2a23dc16:"タイムゾーン","46930b1ccf":"例",fa747dfcf3:"カウントタイプ","7a4dc8253f":"数字","8bdf1760f0":"英字","83a8f475e3":"埋め文字","90a2f53d3a":"末尾埋め文字","8b0db67871":"現在値","29e1d3d9f0":"増分値","39a52f2df5":"データビット","57f15bb774":"ゼロ埋め",a3ccf702c5:"データソース","700c93d882":"外部入力対応形式",c8d09cf955:"デフォルト",f4dbbc63a5:"データベース","7bb7346e15":"外部入力",ef258428cd:"カウンター",a74a77bc7f:"テキスト、タイマー、日付の組み合わせ","2d0366384f":"QRコード",b1085310cb:"バーコード",b418ca60d4:"変数","382f4b5559":"選択してください","6a954390e3":"テーブル",ad3ee64830:"列","6bd6e44cbc":"関連付ける要素IDを選択","850e2546c3":"関連バーコードID",a424315147:"関連付け後はコンテンツを編集できません","20bc33c7ba":"関連バーコード:","4b822f835d":"関連QRコードID",e5346f5159:"関連QRコード:","9f6e8dba88":"Keyを選択してください","8cef5cc20b":"変数をインポート","1cebaf21fb":"jsonファイルをインポート",a25ed32d21:"データをクリア",b56d9ac6c5:"確認","4d0b4688c7":"キャンセル","184a9c08ac":"すべての変数をクリアしますか?",cce10d7b40:"ファイルのインポートに失敗しました","609d669223":"重複するkeyがあります。修正してから確認してください",b088a3713a:"フォントを選択",f670b2adc0:"太字",af5a2c8bff:"斜体",c85de9e58a:"取り消し線","9bc18ae51e":"下線",f4d3dab8e0:"テキスト","07f568dada":"文字色",c9c7630d2c:"テキストフォント","34098a184f":"テキストサイズ","0fa1d514a5":"一次元コードタイプ","0c5279c8ae":"一次元コードテキスト設定","576ccdb1f1":"フォントサイズ",f7af330e8f:"二次元コードタイプ",cc288c9c8e:"QRコード誤り訂正レベル",d480c424f8:"QRコード値テキスト設定","4e3a37477c":"QRコード値を表示","89c41faeea":"モジュールピクセル",fb54f6f959:"縦横比","020af9c5f4":"ロンベイコード誤り訂正レベル","204ca8e993":"QRコード誤り訂正レベル","3276f518f5":"画像の縦横比でインポート",a41a0c9fd2:"クリップアートを選択","446d1e1236":"画像を選択してください","18104edf89":"画像を選択",be8da62ea1:"画像",e423d0e04e:"画像の選択に失敗しました","17ad570546":"印刷カウンター",d84a63fd99:"印刷日付",bc90a3957d:"キーボード入力","5585698377":"午後 表示","9978b8a700":"角丸","579f280b5d":"行数","150074c2e8":"テーブル","2a2b777ae4":"行","1082f4e944":"直線","12c09d0341":"点線","72077749f7":"なし","83100cd7eb":"上に行を挿入","5d80537a38":"下に行を挿入",bdc0e99b04:"現在の行を削除",eee6dec245:"現在の列を削除","199013c934":"左に列を挿入","45989304d7":"右に列を挿入",cee8bcba20:"フォントサイズ",b534c8636c:"行の高さ",c86f1b361f:"文字間隔","6d93ab3fba":"テキスト間隔","5937a2c95a":"テキスト位置","413f8db65f":"左揃え","5be891c540":"中央揃え","70fe40dec2":"右揃え",a9d35ab0a6:"上部","435b2d8982":"下部","443bde0f4c":"テキスト配置","989d1affa0":"バージョン","0965832369":"日付オフセット","6f14c2641c":"年",d9b59879f3:"月","15917f3b32":"日","86ec1ca75c":"幅",eea51aa44b:"高さ",cb165f5ca1:"回転角度","5268436bdf":"水平中央揃え","8a9aed3516":"水平等間隔配置",ceb66a60f6:"上揃え","2cd89127c4":"垂直中央揃え","5d2078e01c":"下揃え",f8735a4579:"垂直等間隔配置","3ffbbe25d5":"キャンバス水平中央","7cd8c94d34":"キャンバス垂直中央","9474979eb3":"エリア水平中央","73678a1e04":"エリア垂直中央","41654e0268":"基本情報","067f80c392":"列数","68d87ec64c":"列幅",db63adaf4c:"セルをダブルクリックして編集","046ca7db56":"上辺",b3ceb938fb:"右辺","343b383f1d":"下辺","8566923239":"左辺","68238a67bc":"文字色","97c8abc1b8":"円弧半径(正の値は上向き、負の値は下向きの曲線)","83cc65b13f":"単行","918a0c837b":"段落","7d9b9e079f":"円弧配置","0a84571f3e":"尺寸模式","1b95368e24":"倍数拉伸","2c06479d15":"自由拉伸","3d17580e06":"一维码高度(mm)","4e28691ff7":"一维码高","5f397a20e8":"条码与文本间距(mm)","60a48b31d9":"一维码与文字间距"},jaEditor={remaining,label,newLabel,cloudLabel,labelFileFilter,labelSettings,labelEditSettings,labelSize,labelWidth,labelHeight,labelShape,labelsPerPage,oneLabelPerPage,multipleLabelsPerPage,pageHasMargins,pageHasNoMargins,labelSideMargin,varnishLayer,varnishPanel,specialist,templateName:templateName$1,instantEditPrint,instantScanPrint,linkedContentReadonly,qrCodeContent,defaults,objectNames,contextMenu,image,wizard,tabs,shell,feature,copy:copy$1},title$2="印刷",preview="印刷プレビュー",file="印刷ファイル:",range$1="印刷範囲",copies="印刷部数",content="印刷内容",toFile="ファイルに出力",direction="印刷方向",order="印刷順序",counter$1="印刷カウンター",date$1="印刷日付",cancel="印刷をキャンセル",connecting$1="プリンターに接続中",connectingPrinter="プリンターに接続中....",printing="印刷中....",complete="印刷が完了しました",pageComplete="{page}ページ目の印刷が完了しました",maximumRows="ページ範囲の最大印刷行数:{rows}行",rewind="巻き戻し",separateLayers="レイヤー別印刷",multipleLabels="マルチラベル印刷",sendTemplate="テンプレートを送信",selectDriver="ドライバーを選択",advancedOptions="詳細設定",paperSavingMode="省紙モード",enabled="有効",disabled="無効",serialCount="シリアル番号数",startRecord="開始レコード",endRecord="終了レコード",pageRange="ページ範囲",rangeExample="例:1-3,8,10 形式",copyCount="部数",template="テンプレート",templateName="テンプレート名",currentAssociations="現在の関連:",sheetRows="{sheet} テーブルに {rows} 行のデータがあります;",driver="ドライバー:",task="タスク:",taskComplete="タスク完了",success="成功:",failed="失敗:",progress="進捗:",firstPage="最初のページ",previousPage="前のページ",currentPage="現在のページ",nextPage="次のページ",lastPage="最後のページ",firstImage="最初の画像",previousImage="前の画像",currentImage="現在の画像",nextImage="次の画像",lastImage="最後の画像",pageSummary="{current}/{totalPages} ページ、全 {total} 枚",previewGenerating="印刷プレビューを生成中...",previewFailed="印刷プレビューの生成に失敗しました",saveTemplateFile="テンプレートファイルを保存",templateFileFilter="テンプレートファイル",templateSaved="テンプレートの保存に成功しました",templateSent="テンプレートの送信に成功しました",errors={connectFailed:"プリンターへの接続に失敗しました",tidReadFailed:"TID の読み取りに失敗しました",pageFailed:"{page}ページ目の印刷に失敗しました",templateSendFailed:"テンプレートの送信に失敗しました",missingDriver:"ドライバーを選択してください",emptyCanvas:"空のキャンバスは印刷またはプレビューできません",missingTemplateName:"テンプレート名を入力してください",startAfterEnd:"開始ページは終了ページより大きくできません",rangeExceeded:"最大印刷ページ範囲を超えました",invalidPage:"無効なページ番号です",invalidPageFormat:"ページ番号の形式が正しくありません",invalidDriverResponse:"JSON レスポンスを取得できません"},jaPrint={title:title$2,preview,file,range:range$1,copies,content,toFile,direction,order,counter:counter$1,date:date$1,continue:"印刷を続行",cancel,connecting:connecting$1,connectingPrinter,printing,complete,pageComplete,maximumRows,rewind,separateLayers,multipleLabels,sendTemplate,selectDriver,default:"デフォルト",advancedOptions,paperSavingMode,enabled,disabled,serialCount,startRecord,endRecord,pageRange,rangeExample,copyCount,template,templateName,currentAssociations,sheetRows,driver,task,taskComplete,success,failed,progress,firstPage,previousPage,currentPage,nextPage,lastPage,firstImage,previousImage,currentImage,nextImage,lastImage,pageSummary,previewGenerating,previewFailed,saveTemplateFile,templateFileFilter,templateSaved,templateSent,errors},title$1="データベース",type="データベースタイプ",name="データベース名",view="データベース表示",path="データベースパス:",serverAddress="データベースサーバーアドレス",serverPort="データベースサーバーポート",userName="データベースユーザー名",password="データベースユーザーパスワード",select="データベースを選択",connect="接続",serverUrl="サーバーURL",filePath="ファイルパス",serverAddressPlaceholder="サーバーアドレス",serverPortPlaceholder="サーバーポート",selectFile="ファイルを選択",sheet="テーブル:",column="列:",hex="16進数",numericWrite="数値書き込み",characterWrite="文字書き込み",deleteCharacters="文字を削除",sheetInstructions="ワークシートを選択し、そのシート上のデータの配置方法を指定してください",previewRows="プレビュー(10行)",selectedSheets="以下のテーブルを選択しました",addAnotherPrompt="他のテーブルを追加しますか?",addAnotherYes="はい、別のテーブルを選択します",addAnotherNo="いいえ、選択を完了しました",selectFailed="データベースの選択に失敗しました",connecting="データベースに接続中",connectionSuccess="データベースの接続に成功しました",connectionFailed$1="データベースの接続に失敗しました",prompts={excelFile:"Excelファイルを選択してください",dbFile:"dbファイルを選択してください",serverAddress:"データベースサーバーアドレスを入力してください",serverPort:"データベースサーバーポートを入力してください",name:"データベース名を入力してください",userName:"データベースユーザー名を入力してください",password:"データベースユーザーパスワードを入力してください"},jaDatabase={title:title$1,type,name,view,path,serverAddress,serverPort,userName,password,select,connect,serverUrl,filePath,serverAddressPlaceholder,serverPortPlaceholder,selectFile,sheet,column,hex,numericWrite,characterWrite,deleteCharacters,sheetInstructions,previewRows,selectedSheets,addAnotherPrompt,addAnotherYes,addAnotherNo,selectFailed,connecting,connectionSuccess,connectionFailed:connectionFailed$1,prompts},title="RFIDタグ",safeArea="セーフエリア",counter="カウンター",settings="RFIDタグ設定",production="RFIDタグ作成",uhfPrint="UHF-RFID印刷",protocol="RFIDタグプロトコル標準",readOffset="RFIDタグ読み取りオフセット",writeContent="タグ書き込み内容",tid="タグ情報エリア(TID)",longbeiContent="ロンベイコード内容",longbeiErrorCorrection="ロンベイコード誤り訂正レベル",guojun="国軍",databaseSource="データベース",status="ステータス",power="パワー",readPower="読み取りパワー",writePower="書き込みパワー",getCurrentValue="デバイスの現在値を取得",crcValidation="RFIDデータCRCチェックあり",commandPassword="コマンドパスワード",oldCommandPassword="旧コマンドパスワード",newCommandPassword="新コマンドパスワード",enterOldCommandPassword="旧コマンドパスワードを入力",enterNewCommandPassword="新コマンドパスワードを入力",accessPassword="アクセスパスワード",oldPassword="旧パスワード",newPassword="新パスワード",manualInput="手動入力",enterEightDigitPassword="8桁のパスワードを入力してください",savePasswordToFile="パスワードをファイルに保存",regionPermissions="エリア権限設定",epcRegion="コードエリア(EPC)",userRegion="ユーザーエリア(User)",reservedRegion="予約エリア(Reserved)",lock="ロック",permanentLock="永久ロック",neverLock="ロックしない",changeKillPassword="Killパスワードを変更",killPassword="Killパスワード",paddingMethod="埋め方法",defaultPadding="デフォルト",padStart$1="前埋め",padEnd="後埋め",dataSource="データソース",hexadecimal="16進数",text="テキスト",date="日付",sequenceGenerator="連番ジェネレーター",enterData="データを入力してください",minimumPaddingDigits="最小埋め桁数",readWrite="読み取り/書き込み可能",readOnly="読み取り専用",configureMemoryProperties="ストレージエリアのプロパティを設定",configureSecurityMode="セキュリティモードを設定",noAuthentication="認証不要",authenticationWithoutSecureCommunication="認証が必要、セキュア通信は不要",authenticationWithSecureCommunication="認証が必要、セキュア通信が必要",unsavedSwitchConfirm="未保存の設定項目があります。切り替えを続行しますか?",deviceDetectionFailed="デバイス検出に失敗しました。エラーコード:{code}、エラー詳細:{detail}",noPrinterFound="プリンターが見つかりませんでした",connectionFailed="接続に失敗しました。エラーコード:{code}、エラー詳細:{detail}",connectedTo="接続先:{device}",oldAndNewPasswordRequired="新パスワードと旧パスワードは空にできません",savePasswordSuccess="パスワードの保存に成功しました",savePasswordFailed="パスワードの保存に失敗しました",passwordRequired="パスワードは空にできません",oldPasswordEightDigits="旧パスワードは8桁である必要があります",newPasswordEightDigits="新パスワードは8桁である必要があります",killPasswordEightDigits="Killパスワードは8桁である必要があります",oldCommandPasswordEightDigits="旧コマンドパスワードは8桁である必要があります",newCommandPasswordEightDigits="新コマンドパスワードは8桁である必要があります",newCommandRequiredForAccessChange="アクセス新パスワードを変更するには、新コマンドパスワードを入力する必要があります",oldCommandRequiredForAccessChange="アクセス新パスワードを変更するには、旧コマンドパスワードを入力する必要があります",changeKillPasswordConfirm="Killパスワードを変更してもよろしいですか?",paddingMultipleOfFour="埋めデータの桁数は4の倍数である必要があります",setFailedWithDetail="設定に失敗しました:{detail}",getFailedWithDetail="取得に失敗しました:{detail}",jaRfid={title,safeArea,counter,settings,production,uhfPrint,protocol,readOffset,writeContent,tid,longbeiContent,longbeiErrorCorrection,guojun,databaseSource,status,power,readPower,writePower,getCurrentValue,crcValidation,commandPassword,oldCommandPassword,newCommandPassword,enterOldCommandPassword,enterNewCommandPassword,accessPassword,oldPassword,newPassword,manualInput,enterEightDigitPassword,savePasswordToFile,regionPermissions,epcRegion,userRegion,reservedRegion,lock,permanentLock,neverLock,changeKillPassword,killPassword,paddingMethod,defaultPadding,padStart:padStart$1,padEnd,dataSource,hexadecimal,text,date,sequenceGenerator,enterData,minimumPaddingDigits,readWrite,readOnly,configureMemoryProperties,configureSecurityMode,noAuthentication,authenticationWithoutSecureCommunication,authenticationWithSecureCommunication,unsavedSwitchConfirm,deviceDetectionFailed,noPrinterFound,connectionFailed,connectedTo,oldAndNewPasswordRequired,savePasswordSuccess,savePasswordFailed,passwordRequired,oldPasswordEightDigits,newPasswordEightDigits,killPasswordEightDigits,oldCommandPasswordEightDigits,newCommandPasswordEightDigits,newCommandRequiredForAccessChange,oldCommandRequiredForAccessChange,changeKillPasswordConfirm,paddingMultipleOfFour,setFailedWithDetail,getFailedWithDetail},invalidPageSize="ページサイズが正しくありません。ラベルサイズ、余白、間隔などを調整してください",pageExceedsSettings="エラー:設定されたページを超えています。ラベルサイズ、余白、間隔などを調整してください",emptyCanvas="空のキャンバスは印刷またはプレビューできません",printFailed="{page}ページ目の印刷に失敗しました",pageRangeExceeded="最大印刷ページ範囲を超えました",printerUnavailable="プリンターが見つかりませんでした",printerConnectionFailed="プリンターに接続できません",databaseSelectionFailed="データベースの選択に失敗しました",networkTimeout="リクエストがタイムアウトしました。ネットワークを確認して再試行してください",unknown="操作に失敗しました。再試行してください",unknownWithCode="操作に失敗しました(エラーコード:{code})。再試行してください",jaErrors={invalidPageSize,pageExceedsSettings,emptyCanvas,printFailed,pageRangeExceeded,printerUnavailable,printerConnectionFailed,databaseSelectionFailed,networkTimeout,unknown,unknownWithCode},baseMessages={"zh-CN":{common:zhCommon,menu:zhMenu,editor:zhEditor,print:zhPrint,database:zhDatabase,rfid:zhRfid,errors:zhErrors},"en-US":{common:enCommon,menu:enMenu,editor:enEditor,print:enPrint,database:enDatabase,rfid:enRfid,errors:enErrors},"ja-JP":{common:jaCommon,menu:jaMenu,editor:jaEditor,print:jaPrint,database:jaDatabase,rfid:jaRfid,errors:jaErrors}};function createDascomI18n({locale:tg=DEFAULT_LOCALE,messages:eg={},missingWarn:gg=!0}={}){const ig={"zh-CN":mergeTrees(baseMessages["zh-CN"],eg["zh-CN"]),"en-US":mergeTrees(baseMessages["en-US"],eg["en-US"]),"ja-JP":mergeTrees(baseMessages["ja-JP"],eg["ja-JP"])};return createI18n({legacy:!1,locale:tg,fallbackLocale:DEFAULT_LOCALE,messages:ig,datetimeFormats:dateTimeFormats,numberFormats,missingWarn:gg})}function mergeDascomI18nMessages(tg,eg={}){for(const gg of["zh-CN","en-US","ja-JP"]){const ig=eg[gg];if(!ig)continue;const ng=tg.global.getLocaleMessage(gg);tg.global.setLocaleMessage(gg,mergeTrees(ng,ig))}}const isRecord=tg=>typeof tg=="object"&&tg!==null;function firstText(...tg){for(const eg of tg)if(typeof eg=="string"&&eg.trim())return eg.trim()}function firstCode(...tg){for(const eg of tg){if(typeof eg=="string"&&eg.trim())return eg.trim();if(typeof eg=="number"&&Number.isFinite(eg))return eg}}function getErrorParts(tg){if(typeof tg=="string")return{detail:tg.trim()||void 0};if(tg instanceof Error)return{code:firstCode(tg.code),detail:firstText(tg.message)};if(!isRecord(tg))return{};const eg=isRecord(tg.response)?tg.response:void 0,gg=isRecord(tg.data)?tg.data:isRecord(eg==null?void 0:eg.data)?eg.data:void 0,ig=isRecord(tg.payload)?tg.payload:void 0;return{code:firstCode(tg.code,tg.status,eg==null?void 0:eg.status,gg==null?void 0:gg.code,ig==null?void 0:ig.code),detail:firstText(tg.message,tg.error,typeof tg.payload=="string"?tg.payload:void 0,ig==null?void 0:ig.message,ig==null?void 0:ig.error,gg==null?void 0:gg.message,gg==null?void 0:gg.error,typeof(eg==null?void 0:eg.data)=="string"?eg.data:void 0)}}const orderedMatchers=[({code:tg,detail:eg})=>/^(?:ETIMEDOUT|ECONNABORTED)$/i.test(String(tg??""))||/(?:timeout|timed out|请求超时|网络超时)/i.test(eg??"")?"errors.networkTimeout":void 0,({detail:tg})=>/^(?:连接不上打印机|无法连接打印机|Unable to connect to printer)$/i.test(tg??"")?"errors.printerConnectionFailed":void 0,({detail:tg})=>/^(?:没有枚举到打印机|未找到打印机|No printer was found)$/i.test(tg??"")?"errors.printerUnavailable":void 0];function toSafeError(tg,eg){const gg=getErrorParts(tg);for(const ig of orderedMatchers){const ng=ig(gg);if(ng)return{key:ng,code:gg.code,logDetail:tg}}return{key:gg.code==null?"errors.unknown":"errors.unknownWithCode",code:gg.code,logDetail:tg}}const editorMessages={"zh-CN":{},"en-US":{}};let activeController=null;function translate(tg,eg){return(activeController==null?void 0:activeController.translate(tg,eg))??tg}function getActiveEditorLocale(){return(activeController==null?void 0:activeController.locale.value)??"zh-CN"}function activateEditorI18n(tg){return activeController=tg,()=>{activeController===tg&&(activeController=null)}}function normalizeEditorLocale(tg){return/^(zh|en|ja)([-_]|$)/i.test(String(tg??"").trim())||console.warn(`[LabelEditor] Unsupported locale "${tg}"; using zh-CN`),normalizeLocale(tg)}function createEditorI18n(tg,eg={}){const gg=ref(tg==null?detectBrowserLocale():normalizeEditorLocale(tg)),ig=createDascomI18n({locale:gg.value,messages:editorMessages});return mergeDascomI18nMessages(ig,eg),{i18n:ig,locale:gg,translate(og,ag){return String(ig.global.t(og,ag??{}))},setMessages(og){mergeDascomI18nMessages(ig,og)},setLocale(og){const ag=normalizeEditorLocale(og);return gg.value=ag,ig.global.locale.value=ag,ag}}}function getEditorAntLocale(tg){return getAntdLocale(normalizeLocale(tg.value))}function useEditorAntLocale(tg){return computed(()=>getEditorAntLocale(tg))}function bindLocaleToElement(tg,eg){const gg=eg.getAttribute("lang"),ig=watch(tg,ng=>eg.setAttribute("lang",ng),{immediate:!0,flush:"sync"});return()=>{ig(),gg==null?eg.removeAttribute("lang"):eg.setAttribute("lang",gg)}}function reuseEditorWithLocale(tg,eg){return eg!=null&&tg.setLocale(eg),tg}function mountEditorApplication(tg,eg,gg,ig){let ng=null;try{return ig(),ng=bindLocaleToElement(gg.locale,eg),tg.mount(eg),ng}catch(og){ng==null||ng();try{tg.unmount()}catch{}throw og}}const normalizeShowLaser=tg=>tg==null?0:typeof tg=="boolean"?tg?16:0:typeof tg=="number"&&tg>0?tg:0,config=reactive({width:85.6,height:54,dpi:203,showVarnish:!1,showLaser:0,layerMaxCount:1,separateLayerMode:!1,layerStyleIndependent:!1,separateLayerCount:2,separateLayerNames:[],enabledTools:null,disabledTools:[],visibleMenus:null,enabledMenuItems:null,disabledMenuItems:[]});function setEditorConfig(tg){if(tg.width!=null&&(config.width=tg.width),tg.height!=null&&(config.height=tg.height),tg.dpi!=null&&(config.dpi=tg.dpi),tg.showVarnish!=null&&(config.showVarnish=tg.showVarnish),tg.separateLayerMode!=null&&(config.separateLayerMode=!!tg.separateLayerMode),tg.layerStyleIndependent!=null&&(config.layerStyleIndependent=!!tg.layerStyleIndependent),tg.layerMaxCount!=null){const eg=Number(tg.layerMaxCount);config.layerMaxCount=Number.isFinite(eg)&&eg>=1?Math.floor(eg):1}if(tg.separateLayerCount!=null){const eg=Number(tg.separateLayerCount);config.separateLayerCount=Number.isFinite(eg)&&eg>=1?Math.floor(eg):2}else config.separateLayerMode&&tg.layerMaxCount!=null&&(config.separateLayerCount=config.layerMaxCount);tg.separateLayerNames!=null&&(config.separateLayerNames=Array.isArray(tg.separateLayerNames)?tg.separateLayerNames.map(eg=>String(eg||"").trim()).filter(Boolean):[]),config.separateLayerMode&&(config.layerMaxCount=config.separateLayerCount),tg.showLaser!=null&&(config.showLaser=normalizeShowLaser(tg.showLaser)),tg.enabledTools!=null&&(config.enabledTools=tg.enabledTools),tg.disabledTools!=null&&(config.disabledTools=tg.disabledTools),tg.visibleMenus!=null&&(config.visibleMenus=tg.visibleMenus),tg.enabledMenuItems!=null&&(config.enabledMenuItems=tg.enabledMenuItems),tg.disabledMenuItems!=null&&(config.disabledMenuItems=tg.disabledMenuItems)}function getEditorConfig(){return config}function isToolEnabled(tg){return config.enabledTools&&config.enabledTools.length>0?config.enabledTools.includes(tg):config.disabledTools.length>0?!config.disabledTools.includes(tg):!0}function isMenuVisible(tg){return config.visibleMenus?config.visibleMenus.includes(tg):!0}function isMenuItemVisible(tg){return config.enabledMenuItems&&config.enabledMenuItems.length>0?config.enabledMenuItems.includes(tg):config.disabledMenuItems.length>0?!config.disabledMenuItems.includes(tg):!0}const _externalLaserList=ref([]),_laserPresets=ref([]),_lastSyncResult=ref(null);function setLaserConfigList(tg){return _externalLaserList.value=tg,_laserPresets.value.length>0?syncExternalPresets():{deletedNames:[],allOutdatedNames:[],newPresets:[]}}function getExternalLaserList(){return _externalLaserList}function getLaserPresets(){return _laserPresets}function getLaserMaxPresets(){return config.showLaser>0?config.showLaser:0}function getLastSyncResult(){return _lastSyncResult}function syncExternalPresets(){const tg=new Set(_externalLaserList.value.map(og=>og.configId)),eg=new Set(_laserPresets.value.map(og=>og.configId)),gg=_externalLaserList.value.filter(og=>!eg.has(og.configId)),ig=_laserPresets.value.filter(og=>!tg.has(og.configId)),ng=ig.map(og=>og.configName);return gg.length>0&&(_laserPresets.value=[..._laserPresets.value,...gg]),ig.length>0&&(_laserPresets.value=_laserPresets.value.filter(og=>tg.has(og.configId))),_lastSyncResult.value={deletedNames:ng,allOutdatedNames:ng,newPresets:gg},{deletedNames:ng,allOutdatedNames:ng,newPresets:gg}}function setLaserPresets(tg){_laserPresets.value=tg}function resetLaserPresetsFromExternal(){_laserPresets.value=JSON.parse(JSON.stringify(_externalLaserList.value))}const state$3=reactive({config:{layerMaxCount:1}});function getLayerMaxCount(tg){const eg=tg??state$3.config.layerMaxCount??1,gg=Number(eg);return!Number.isFinite(gg)||gg<1?1:Math.floor(gg)}function getSysConfigState(){return state$3.config}function setSysConfigState(tg){state$3.config={...tg,DPI:getEditorConfig().dpi,layerMaxCount:getLayerMaxCount(tg==null?void 0:tg.layerMaxCount)}}function getSysState(){return state$3}function t(tg,eg,gg){return(eg=(function(ig){var ng=(function(og,ag){if(typeof og!="object"||!og)return og;var Ig=og[Symbol.toPrimitive];if(Ig!==void 0){var sg=Ig.call(og,ag);if(typeof sg!="object")return sg;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ag==="string"?String:Number)(og)})(ig,"string");return typeof ng=="symbol"?ng:ng+""})(eg))in tg?Object.defineProperty(tg,eg,{value:gg,enumerable:!0,configurable:!0,writable:!0}):tg[eg]=gg,tg}function e(tg,eg){var gg=Object.keys(tg);if(Object.getOwnPropertySymbols){var ig=Object.getOwnPropertySymbols(tg);eg&&(ig=ig.filter((function(ng){return Object.getOwnPropertyDescriptor(tg,ng).enumerable}))),gg.push.apply(gg,ig)}return gg}function s$1(tg){for(var eg=1;eg<arguments.length;eg++){var gg=arguments[eg]!=null?arguments[eg]:{};eg%2?e(Object(gg),!0).forEach((function(ig){t(tg,ig,gg[ig])})):Object.getOwnPropertyDescriptors?Object.defineProperties(tg,Object.getOwnPropertyDescriptors(gg)):e(Object(gg)).forEach((function(ig){Object.defineProperty(tg,ig,Object.getOwnPropertyDescriptor(gg,ig))}))}return tg}function i(tg,eg){if(tg==null)return{};var gg,ig,ng=(function(ag,Ig){if(ag==null)return{};var sg={};for(var Cg in ag)if({}.hasOwnProperty.call(ag,Cg)){if(Ig.indexOf(Cg)>=0)continue;sg[Cg]=ag[Cg]}return sg})(tg,eg);if(Object.getOwnPropertySymbols){var og=Object.getOwnPropertySymbols(tg);for(ig=0;ig<og.length;ig++)gg=og[ig],eg.indexOf(gg)>=0||{}.propertyIsEnumerable.call(tg,gg)&&(ng[gg]=tg[gg])}return ng}function r(tg,eg){return eg||(eg=tg.slice(0)),Object.freeze(Object.defineProperties(tg,{raw:{value:Object.freeze(eg)}}))}let n$1=class{constructor(){t(this,"browserShadowBlurConstant",1),t(this,"DPI",96),t(this,"devicePixelRatio",typeof window<"u"?window.devicePixelRatio:1),t(this,"perfLimitSizeTotal",2097152),t(this,"maxCacheSideLimit",4096),t(this,"minCacheSideLimit",256),t(this,"disableStyleCopyPaste",!1),t(this,"enableGLFiltering",!0),t(this,"textureSize",4096),t(this,"forceGLPutImageData",!1),t(this,"cachesBoundsOfCurve",!1),t(this,"fontPaths",{}),t(this,"NUM_FRACTION_DIGITS",4)}};const o=new class extends n$1{constructor(tg){super(),this.configure(tg)}configure(){let tg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object.assign(this,tg)}addFonts(){let tg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fontPaths=s$1(s$1({},this.fontPaths),tg)}removeFonts(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach((tg=>{delete this.fontPaths[tg]}))}clearFonts(){this.fontPaths={}}restoreDefaults(tg){const eg=new n$1,gg=(tg==null?void 0:tg.reduce(((ig,ng)=>(ig[ng]=eg[ng],ig)),{}))||eg;this.configure(gg)}},a=function(tg){for(var eg=arguments.length,gg=new Array(eg>1?eg-1:0),ig=1;ig<eg;ig++)gg[ig-1]=arguments[ig];return console[tg]("fabric",...gg)};class h extends Error{constructor(eg,gg){super("fabric: ".concat(eg),gg)}}class c extends h{constructor(eg){super("".concat(eg," 'options.signal' is in 'aborted' state"))}}let l$1=class{};class u extends l$1{testPrecision(eg,gg){const ig="precision ".concat(gg,` float;
420
420
  void main(){}`),ng=eg.createShader(eg.FRAGMENT_SHADER);return!!ng&&(eg.shaderSource(ng,ig),eg.compileShader(ng),!!eg.getShaderParameter(ng,eg.COMPILE_STATUS))}queryWebGL(eg){const gg=eg.getContext("webgl");gg&&(this.maxTextureSize=gg.getParameter(gg.MAX_TEXTURE_SIZE),this.GLPrecision=["highp","mediump","lowp"].find((ig=>this.testPrecision(gg,ig))),gg.getExtension("WEBGL_lose_context").loseContext(),a("log","WebGL: max texture size ".concat(this.maxTextureSize)))}isSupported(eg){return!!this.maxTextureSize&&this.maxTextureSize>=eg}}const d={};let g;const p=()=>g||(g={document,window,isTouchSupported:"ontouchstart"in window||"ontouchstart"in document||window&&window.navigator&&window.navigator.maxTouchPoints>0,WebGLProbe:new u,dispose(){},copyPasteData:d}),m=()=>p().document,v=()=>p().window,y=()=>{var tg;return Math.max((tg=o.devicePixelRatio)!==null&&tg!==void 0?tg:v().devicePixelRatio,1)},_$1=new class{constructor(){t(this,"charWidthsCache",{}),t(this,"boundsOfCurveCache",{})}getFontCache(tg){let{fontFamily:eg,fontStyle:gg,fontWeight:ig}=tg;eg=eg.toLowerCase(),this.charWidthsCache[eg]||(this.charWidthsCache[eg]={});const ng=this.charWidthsCache[eg],og="".concat(gg.toLowerCase(),"_").concat((ig+"").toLowerCase());return ng[og]||(ng[og]={}),ng[og]}clearFontCache(tg){(tg=(tg||"").toLowerCase())?this.charWidthsCache[tg]&&delete this.charWidthsCache[tg]:this.charWidthsCache={}}limitDimsByArea(tg){const{perfLimitSizeTotal:eg}=o,gg=Math.sqrt(eg*tg);return[Math.floor(gg),Math.floor(eg/gg)]}},x="6.7.1";function C(){}const b=Math.PI/2,S=2*Math.PI,w=Math.PI/180,T$1=Object.freeze([1,0,0,1,0,0]),O=16,k$1=.4477152502,D$1="center",M$1="left",P$1="top",E$1="bottom",A$1="right",j="none",F=/\r?\n/,L$1="moving",R$1="scaling",I="rotating",B$1="rotate",X="skewing",Y$1="resizing",W="modifyPoly",V="modifyPath",z$1="changed",G="scale",H="scaleX",N$1="scaleY",U$1="skewX",q="skewY",K="fill",J="stroke",Q="modified",Z="json",$$1="svg",tt=new class{constructor(){this[Z]=new Map,this[$$1]=new Map}has(tg){return this[Z].has(tg)}getClass(tg){const eg=this[Z].get(tg);if(!eg)throw new h("No class registered for ".concat(tg));return eg}setClass(tg,eg){eg?this[Z].set(eg,tg):(this[Z].set(tg.type,tg),this[Z].set(tg.type.toLowerCase(),tg))}getSVGClass(tg){return this[$$1].get(tg)}setSVGClass(tg,eg){this[$$1].set(eg??tg.type.toLowerCase(),tg)}},et=new class extends Array{remove(tg){const eg=this.indexOf(tg);eg>-1&&this.splice(eg,1)}cancelAll(){const tg=this.splice(0);return tg.forEach((eg=>eg.abort())),tg}cancelByCanvas(tg){if(!tg)return[];const eg=this.filter((gg=>{var ig;return gg.target===tg||typeof gg.target=="object"&&((ig=gg.target)===null||ig===void 0?void 0:ig.canvas)===tg}));return eg.forEach((gg=>gg.abort())),eg}cancelByTarget(tg){if(!tg)return[];const eg=this.filter((gg=>gg.target===tg));return eg.forEach((gg=>gg.abort())),eg}};class st{constructor(){t(this,"__eventListeners",{})}on(eg,gg){if(this.__eventListeners||(this.__eventListeners={}),typeof eg=="object")return Object.entries(eg).forEach((ig=>{let[ng,og]=ig;this.on(ng,og)})),()=>this.off(eg);if(gg){const ig=eg;return this.__eventListeners[ig]||(this.__eventListeners[ig]=[]),this.__eventListeners[ig].push(gg),()=>this.off(ig,gg)}return()=>!1}once(eg,gg){if(typeof eg=="object"){const ig=[];return Object.entries(eg).forEach((ng=>{let[og,ag]=ng;ig.push(this.once(og,ag))})),()=>ig.forEach((ng=>ng()))}if(gg){const ig=this.on(eg,(function(){for(var ng=arguments.length,og=new Array(ng),ag=0;ag<ng;ag++)og[ag]=arguments[ag];gg.call(this,...og),ig()}));return ig}return()=>!1}_removeEventListener(eg,gg){if(this.__eventListeners[eg])if(gg){const ig=this.__eventListeners[eg],ng=ig.indexOf(gg);ng>-1&&ig.splice(ng,1)}else this.__eventListeners[eg]=[]}off(eg,gg){if(this.__eventListeners)if(eg===void 0)for(const ig in this.__eventListeners)this._removeEventListener(ig);else typeof eg=="object"?Object.entries(eg).forEach((ig=>{let[ng,og]=ig;this._removeEventListener(ng,og)})):this._removeEventListener(eg,gg)}fire(eg,gg){var ig;if(!this.__eventListeners)return;const ng=(ig=this.__eventListeners[eg])===null||ig===void 0?void 0:ig.concat();if(ng)for(let og=0;og<ng.length;og++)ng[og].call(this,gg||{})}}const it=(tg,eg)=>{const gg=tg.indexOf(eg);return gg!==-1&&tg.splice(gg,1),tg},rt=tg=>{if(tg===0)return 1;switch(Math.abs(tg)/b){case 1:case 3:return 0;case 2:return-1}return Math.cos(tg)},nt=tg=>{if(tg===0)return 0;const eg=tg/b,gg=Math.sign(tg);switch(eg){case 1:return gg;case 2:return 0;case 3:return-gg}return Math.sin(tg)};class ot{constructor(){let eg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,gg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;typeof eg=="object"?(this.x=eg.x,this.y=eg.y):(this.x=eg,this.y=gg)}add(eg){return new ot(this.x+eg.x,this.y+eg.y)}addEquals(eg){return this.x+=eg.x,this.y+=eg.y,this}scalarAdd(eg){return new ot(this.x+eg,this.y+eg)}scalarAddEquals(eg){return this.x+=eg,this.y+=eg,this}subtract(eg){return new ot(this.x-eg.x,this.y-eg.y)}subtractEquals(eg){return this.x-=eg.x,this.y-=eg.y,this}scalarSubtract(eg){return new ot(this.x-eg,this.y-eg)}scalarSubtractEquals(eg){return this.x-=eg,this.y-=eg,this}multiply(eg){return new ot(this.x*eg.x,this.y*eg.y)}scalarMultiply(eg){return new ot(this.x*eg,this.y*eg)}scalarMultiplyEquals(eg){return this.x*=eg,this.y*=eg,this}divide(eg){return new ot(this.x/eg.x,this.y/eg.y)}scalarDivide(eg){return new ot(this.x/eg,this.y/eg)}scalarDivideEquals(eg){return this.x/=eg,this.y/=eg,this}eq(eg){return this.x===eg.x&&this.y===eg.y}lt(eg){return this.x<eg.x&&this.y<eg.y}lte(eg){return this.x<=eg.x&&this.y<=eg.y}gt(eg){return this.x>eg.x&&this.y>eg.y}gte(eg){return this.x>=eg.x&&this.y>=eg.y}lerp(eg){let gg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5;return gg=Math.max(Math.min(1,gg),0),new ot(this.x+(eg.x-this.x)*gg,this.y+(eg.y-this.y)*gg)}distanceFrom(eg){const gg=this.x-eg.x,ig=this.y-eg.y;return Math.sqrt(gg*gg+ig*ig)}midPointFrom(eg){return this.lerp(eg)}min(eg){return new ot(Math.min(this.x,eg.x),Math.min(this.y,eg.y))}max(eg){return new ot(Math.max(this.x,eg.x),Math.max(this.y,eg.y))}toString(){return"".concat(this.x,",").concat(this.y)}setXY(eg,gg){return this.x=eg,this.y=gg,this}setX(eg){return this.x=eg,this}setY(eg){return this.y=eg,this}setFromPoint(eg){return this.x=eg.x,this.y=eg.y,this}swap(eg){const gg=this.x,ig=this.y;this.x=eg.x,this.y=eg.y,eg.x=gg,eg.y=ig}clone(){return new ot(this.x,this.y)}rotate(eg){let gg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:at;const ig=nt(eg),ng=rt(eg),og=this.subtract(gg);return new ot(og.x*ng-og.y*ig,og.x*ig+og.y*ng).add(gg)}transform(eg){let gg=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return new ot(eg[0]*this.x+eg[2]*this.y+(gg?0:eg[4]),eg[1]*this.x+eg[3]*this.y+(gg?0:eg[5]))}}const at=new ot(0,0),ht=tg=>!!tg&&Array.isArray(tg._objects);function ct(tg){class eg extends tg{constructor(){super(...arguments),t(this,"_objects",[])}_onObjectAdded(ig){}_onObjectRemoved(ig){}_onStackOrderChanged(ig){}add(){for(var ig=arguments.length,ng=new Array(ig),og=0;og<ig;og++)ng[og]=arguments[og];const ag=this._objects.push(...ng);return ng.forEach((Ig=>this._onObjectAdded(Ig))),ag}insertAt(ig){for(var ng=arguments.length,og=new Array(ng>1?ng-1:0),ag=1;ag<ng;ag++)og[ag-1]=arguments[ag];return this._objects.splice(ig,0,...og),og.forEach((Ig=>this._onObjectAdded(Ig))),this._objects.length}remove(){const ig=this._objects,ng=[];for(var og=arguments.length,ag=new Array(og),Ig=0;Ig<og;Ig++)ag[Ig]=arguments[Ig];return ag.forEach((sg=>{const Cg=ig.indexOf(sg);Cg!==-1&&(ig.splice(Cg,1),ng.push(sg),this._onObjectRemoved(sg))})),ng}forEachObject(ig){this.getObjects().forEach(((ng,og,ag)=>ig(ng,og,ag)))}getObjects(){for(var ig=arguments.length,ng=new Array(ig),og=0;og<ig;og++)ng[og]=arguments[og];return ng.length===0?[...this._objects]:this._objects.filter((ag=>ag.isType(...ng)))}item(ig){return this._objects[ig]}isEmpty(){return this._objects.length===0}size(){return this._objects.length}contains(ig,ng){return!!this._objects.includes(ig)||!!ng&&this._objects.some((og=>og instanceof eg&&og.contains(ig,!0)))}complexity(){return this._objects.reduce(((ig,ng)=>ig+=ng.complexity?ng.complexity():0),0)}sendObjectToBack(ig){return!(!ig||ig===this._objects[0])&&(it(this._objects,ig),this._objects.unshift(ig),this._onStackOrderChanged(ig),!0)}bringObjectToFront(ig){return!(!ig||ig===this._objects[this._objects.length-1])&&(it(this._objects,ig),this._objects.push(ig),this._onStackOrderChanged(ig),!0)}sendObjectBackwards(ig,ng){if(!ig)return!1;const og=this._objects.indexOf(ig);if(og!==0){const ag=this.findNewLowerIndex(ig,og,ng);return it(this._objects,ig),this._objects.splice(ag,0,ig),this._onStackOrderChanged(ig),!0}return!1}bringObjectForward(ig,ng){if(!ig)return!1;const og=this._objects.indexOf(ig);if(og!==this._objects.length-1){const ag=this.findNewUpperIndex(ig,og,ng);return it(this._objects,ig),this._objects.splice(ag,0,ig),this._onStackOrderChanged(ig),!0}return!1}moveObjectTo(ig,ng){return ig!==this._objects[ng]&&(it(this._objects,ig),this._objects.splice(ng,0,ig),this._onStackOrderChanged(ig),!0)}findNewLowerIndex(ig,ng,og){let ag;if(og){ag=ng;for(let Ig=ng-1;Ig>=0;--Ig)if(ig.isOverlapping(this._objects[Ig])){ag=Ig;break}}else ag=ng-1;return ag}findNewUpperIndex(ig,ng,og){let ag;if(og){ag=ng;for(let Ig=ng+1;Ig<this._objects.length;++Ig)if(ig.isOverlapping(this._objects[Ig])){ag=Ig;break}}else ag=ng+1;return ag}collectObjects(ig){let{left:ng,top:og,width:ag,height:Ig}=ig,{includeIntersecting:sg=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Cg=[],lg=new ot(ng,og),Ag=lg.add(new ot(ag,Ig));for(let cg=this._objects.length-1;cg>=0;cg--){const rg=this._objects[cg];rg.selectable&&rg.visible&&(sg&&rg.intersectsWithRect(lg,Ag)||rg.isContainedWithinRect(lg,Ag)||sg&&rg.containsPoint(lg)||sg&&rg.containsPoint(Ag))&&Cg.push(rg)}return Cg}}return eg}class lt extends st{_setOptions(){let eg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(const gg in eg)this.set(gg,eg[gg])}_setObject(eg){for(const gg in eg)this._set(gg,eg[gg])}set(eg,gg){return typeof eg=="object"?this._setObject(eg):this._set(eg,gg),this}_set(eg,gg){this[eg]=gg}toggle(eg){const gg=this.get(eg);return typeof gg=="boolean"&&this.set(eg,!gg),this}get(eg){return this[eg]}}function ut(tg){return v().requestAnimationFrame(tg)}function dt(tg){return v().cancelAnimationFrame(tg)}let gt=0;const ft=()=>gt++,pt=()=>{const tg=m().createElement("canvas");if(!tg||tg.getContext===void 0)throw new h("Failed to create `canvas` element");return tg},mt=()=>m().createElement("img"),vt=tg=>{const eg=pt();return eg.width=tg.width,eg.height=tg.height,eg},yt=(tg,eg,gg)=>tg.toDataURL("image/".concat(eg),gg),_t=(tg,eg,gg)=>new Promise(((ig,ng)=>{tg.toBlob(ig,"image/".concat(eg),gg)})),xt=tg=>tg*w,Ct=tg=>tg/w,bt=tg=>tg.every(((eg,gg)=>eg===T$1[gg])),St=(tg,eg,gg)=>new ot(tg).transform(eg,gg),wt=tg=>{const eg=1/(tg[0]*tg[3]-tg[1]*tg[2]),gg=[eg*tg[3],-eg*tg[1],-eg*tg[2],eg*tg[0],0,0],{x:ig,y:ng}=new ot(tg[4],tg[5]).transform(gg,!0);return gg[4]=-ig,gg[5]=-ng,gg},Tt=(tg,eg,gg)=>[tg[0]*eg[0]+tg[2]*eg[1],tg[1]*eg[0]+tg[3]*eg[1],tg[0]*eg[2]+tg[2]*eg[3],tg[1]*eg[2]+tg[3]*eg[3],gg?0:tg[0]*eg[4]+tg[2]*eg[5]+tg[4],gg?0:tg[1]*eg[4]+tg[3]*eg[5]+tg[5]],Ot=(tg,eg)=>tg.reduceRight(((gg,ig)=>ig&&gg?Tt(ig,gg,eg):ig||gg),void 0)||T$1.concat(),kt=tg=>{let[eg,gg]=tg;return Math.atan2(gg,eg)},Dt=tg=>{const eg=kt(tg),gg=Math.pow(tg[0],2)+Math.pow(tg[1],2),ig=Math.sqrt(gg),ng=(tg[0]*tg[3]-tg[2]*tg[1])/ig,og=Math.atan2(tg[0]*tg[2]+tg[1]*tg[3],gg);return{angle:Ct(eg),scaleX:ig,scaleY:ng,skewX:Ct(og),skewY:0,translateX:tg[4]||0,translateY:tg[5]||0}},Mt=function(tg){return[1,0,0,1,tg,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0]};function Pt(){let{angle:tg=0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{x:eg=0,y:gg=0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const ig=xt(tg),ng=rt(ig),og=nt(ig);return[ng,og,-og,ng,eg?eg-(ng*eg-og*gg):0,gg?gg-(og*eg+ng*gg):0]}const Et=function(tg){return[tg,0,0,arguments.length>1&&arguments[1]!==void 0?arguments[1]:tg,0,0]},At=tg=>Math.tan(xt(tg)),jt=tg=>[1,0,At(tg),1,0,0],Ft=tg=>[1,At(tg),0,1,0,0],Lt=tg=>{let{scaleX:eg=1,scaleY:gg=1,flipX:ig=!1,flipY:ng=!1,skewX:og=0,skewY:ag=0}=tg,Ig=Et(ig?-eg:eg,ng?-gg:gg);return og&&(Ig=Tt(Ig,jt(og),!0)),ag&&(Ig=Tt(Ig,Ft(ag),!0)),Ig},Rt=tg=>{const{translateX:eg=0,translateY:gg=0,angle:ig=0}=tg;let ng=Mt(eg,gg);ig&&(ng=Tt(ng,Pt({angle:ig})));const og=Lt(tg);return bt(og)||(ng=Tt(ng,og)),ng},It=function(tg){let{signal:eg,crossOrigin:gg=null}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise((function(ig,ng){if(eg&&eg.aborted)return ng(new c("loadImage"));const og=mt();let ag;eg&&(ag=function(sg){og.src="",ng(sg)},eg.addEventListener("abort",ag,{once:!0}));const Ig=function(){og.onload=og.onerror=null,ag&&(eg==null||eg.removeEventListener("abort",ag)),ig(og)};tg?(og.onload=Ig,og.onerror=function(){ag&&(eg==null||eg.removeEventListener("abort",ag)),ng(new h("Error loading ".concat(og.src)))},gg&&(og.crossOrigin=gg),og.src=tg):Ig()}))},Bt=function(tg){let{signal:eg,reviver:gg=C}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(((ig,ng)=>{const og=[];eg&&eg.addEventListener("abort",ng,{once:!0}),Promise.all(tg.map((ag=>tt.getClass(ag.type).fromObject(ag,{signal:eg}).then((Ig=>(gg(ag,Ig),og.push(Ig),Ig)))))).then(ig).catch((ag=>{og.forEach((Ig=>{Ig.dispose&&Ig.dispose()})),ng(ag)})).finally((()=>{eg&&eg.removeEventListener("abort",ng)}))}))},Xt=function(tg){let{signal:eg}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(((gg,ig)=>{const ng=[];eg&&eg.addEventListener("abort",ig,{once:!0});const og=Object.values(tg).map((Ig=>Ig&&Ig.type&&tt.has(Ig.type)?Bt([Ig],{signal:eg}).then((sg=>{let[Cg]=sg;return ng.push(Cg),Cg})):Ig)),ag=Object.keys(tg);Promise.all(og).then((Ig=>Ig.reduce(((sg,Cg,lg)=>(sg[ag[lg]]=Cg,sg)),{}))).then(gg).catch((Ig=>{ng.forEach((sg=>{sg.dispose&&sg.dispose()})),ig(Ig)})).finally((()=>{eg&&eg.removeEventListener("abort",ig)}))}))},Yt=function(tg){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).reduce(((eg,gg)=>(gg in tg&&(eg[gg]=tg[gg]),eg)),{})},Wt=(tg,eg)=>Object.keys(tg).reduce(((gg,ig)=>(eg(tg[ig],ig,tg)&&(gg[ig]=tg[ig]),gg)),{}),Vt=(tg,eg)=>parseFloat(Number(tg).toFixed(eg)),zt=tg=>"matrix("+tg.map((eg=>Vt(eg,o.NUM_FRACTION_DIGITS))).join(" ")+")",Gt=tg=>!!tg&&tg.toLive!==void 0,Ht=tg=>!!tg&&typeof tg.toObject=="function",Nt=tg=>!!tg&&tg.offsetX!==void 0&&"source"in tg,Ut=tg=>!!tg&&"multiSelectionStacking"in tg;function qt(tg){const eg=tg&&Kt(tg);let gg=0,ig=0;if(!tg||!eg)return{left:gg,top:ig};let ng=tg;const og=eg.documentElement,ag=eg.body||{scrollLeft:0,scrollTop:0};for(;ng&&(ng.parentNode||ng.host)&&(ng=ng.parentNode||ng.host,ng===eg?(gg=ag.scrollLeft||og.scrollLeft||0,ig=ag.scrollTop||og.scrollTop||0):(gg+=ng.scrollLeft||0,ig+=ng.scrollTop||0),ng.nodeType!==1||ng.style.position!=="fixed"););return{left:gg,top:ig}}const Kt=tg=>tg.ownerDocument||null,Jt=tg=>{var eg;return((eg=tg.ownerDocument)===null||eg===void 0?void 0:eg.defaultView)||null},Qt=function(tg,eg,gg){let{width:ig,height:ng}=gg,og=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;tg.width=ig,tg.height=ng,og>1&&(tg.setAttribute("width",(ig*og).toString()),tg.setAttribute("height",(ng*og).toString()),eg.scale(og,og))},Zt=(tg,eg)=>{let{width:gg,height:ig}=eg;gg&&(tg.style.width=typeof gg=="number"?"".concat(gg,"px"):gg),ig&&(tg.style.height=typeof ig=="number"?"".concat(ig,"px"):ig)};function $t(tg){return tg.onselectstart!==void 0&&(tg.onselectstart=()=>!1),tg.style.userSelect=j,tg}class te{constructor(eg){t(this,"_originalCanvasStyle",void 0),t(this,"lower",void 0);const gg=this.createLowerCanvas(eg);this.lower={el:gg,ctx:gg.getContext("2d")}}createLowerCanvas(eg){const gg=(ig=eg)&&ig.getContext!==void 0?eg:eg&&m().getElementById(eg)||pt();var ig;if(gg.hasAttribute("data-fabric"))throw new h("Trying to initialize a canvas that has already been initialized. Did you forget to dispose the canvas?");return this._originalCanvasStyle=gg.style.cssText,gg.setAttribute("data-fabric","main"),gg.classList.add("lower-canvas"),gg}cleanupDOM(eg){let{width:gg,height:ig}=eg;const{el:ng}=this.lower;ng.classList.remove("lower-canvas"),ng.removeAttribute("data-fabric"),ng.setAttribute("width","".concat(gg)),ng.setAttribute("height","".concat(ig)),ng.style.cssText=this._originalCanvasStyle||"",this._originalCanvasStyle=void 0}setDimensions(eg,gg){const{el:ig,ctx:ng}=this.lower;Qt(ig,ng,eg,gg)}setCSSDimensions(eg){Zt(this.lower.el,eg)}calcOffset(){return(function(eg){var gg;const ig=eg&&Kt(eg),ng={left:0,top:0};if(!ig)return ng;const og=((gg=Jt(eg))===null||gg===void 0?void 0:gg.getComputedStyle(eg,null))||{};ng.left+=parseInt(og.borderLeftWidth,10)||0,ng.top+=parseInt(og.borderTopWidth,10)||0,ng.left+=parseInt(og.paddingLeft,10)||0,ng.top+=parseInt(og.paddingTop,10)||0;let ag={left:0,top:0};const Ig=ig.documentElement;eg.getBoundingClientRect!==void 0&&(ag=eg.getBoundingClientRect());const sg=qt(eg);return{left:ag.left+sg.left-(Ig.clientLeft||0)+ng.left,top:ag.top+sg.top-(Ig.clientTop||0)+ng.top}})(this.lower.el)}dispose(){p().dispose(this.lower.el),delete this.lower}}const ee={backgroundVpt:!0,backgroundColor:"",overlayVpt:!0,overlayColor:"",includeDefaultValues:!0,svgViewportTransformation:!0,renderOnAddRemove:!0,skipOffscreen:!0,enableRetinaScaling:!0,imageSmoothingEnabled:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,viewportTransform:[...T$1]};class se extends ct(lt){get lowerCanvasEl(){var eg;return(eg=this.elements.lower)===null||eg===void 0?void 0:eg.el}get contextContainer(){var eg;return(eg=this.elements.lower)===null||eg===void 0?void 0:eg.ctx}static getDefaults(){return se.ownDefaults}constructor(eg){let gg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Object.assign(this,this.constructor.getDefaults()),this.set(gg),this.initElements(eg),this._setDimensionsImpl({width:this.width||this.elements.lower.el.width||0,height:this.height||this.elements.lower.el.height||0}),this.skipControlsDrawing=!1,this.viewportTransform=[...this.viewportTransform],this.calcViewportBoundaries()}initElements(eg){this.elements=new te(eg)}add(){const eg=super.add(...arguments);return arguments.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),eg}insertAt(eg){for(var gg=arguments.length,ig=new Array(gg>1?gg-1:0),ng=1;ng<gg;ng++)ig[ng-1]=arguments[ng];const og=super.insertAt(eg,...ig);return ig.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),og}remove(){const eg=super.remove(...arguments);return eg.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),eg}_onObjectAdded(eg){eg.canvas&&eg.canvas!==this&&(a("warn",`Canvas is trying to add an object that belongs to a different canvas.
421
421
  Resulting to default behavior: removing object from previous canvas and adding to new canvas`),eg.canvas.remove(eg)),eg._set("canvas",this),eg.setCoords(),this.fire("object:added",{target:eg}),eg.fire("added",{target:this})}_onObjectRemoved(eg){eg._set("canvas",void 0),this.fire("object:removed",{target:eg}),eg.fire("removed",{target:this})}_onStackOrderChanged(){this.renderOnAddRemove&&this.requestRenderAll()}getRetinaScaling(){return this.enableRetinaScaling?y():1}calcOffset(){return this._offset=this.elements.calcOffset()}getWidth(){return this.width}getHeight(){return this.height}setWidth(eg,gg){return this.setDimensions({width:eg},gg)}setHeight(eg,gg){return this.setDimensions({height:eg},gg)}_setDimensionsImpl(eg){let{cssOnly:gg=!1,backstoreOnly:ig=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!gg){const ng=s$1({width:this.width,height:this.height},eg);this.elements.setDimensions(ng,this.getRetinaScaling()),this.hasLostContext=!0,this.width=ng.width,this.height=ng.height}ig||this.elements.setCSSDimensions(eg),this.calcOffset()}setDimensions(eg,gg){this._setDimensionsImpl(eg,gg),gg&&gg.cssOnly||this.requestRenderAll()}getZoom(){return this.viewportTransform[0]}setViewportTransform(eg){this.viewportTransform=eg,this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll()}zoomToPoint(eg,gg){const ig=eg,ng=[...this.viewportTransform],og=St(eg,wt(ng));ng[0]=gg,ng[3]=gg;const ag=St(og,ng);ng[4]+=ig.x-ag.x,ng[5]+=ig.y-ag.y,this.setViewportTransform(ng)}setZoom(eg){this.zoomToPoint(new ot(0,0),eg)}absolutePan(eg){const gg=[...this.viewportTransform];return gg[4]=-eg.x,gg[5]=-eg.y,this.setViewportTransform(gg)}relativePan(eg){return this.absolutePan(new ot(-eg.x-this.viewportTransform[4],-eg.y-this.viewportTransform[5]))}getElement(){return this.elements.lower.el}clearContext(eg){eg.clearRect(0,0,this.width,this.height)}getContext(){return this.elements.lower.ctx}clear(){this.remove(...this.getObjects()),this.backgroundImage=void 0,this.overlayImage=void 0,this.backgroundColor="",this.overlayColor="",this.clearContext(this.getContext()),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll()}renderAll(){this.cancelRequestedRender(),this.destroyed||this.renderCanvas(this.getContext(),this._objects)}renderAndReset(){this.nextRenderHandle=0,this.renderAll()}requestRenderAll(){this.nextRenderHandle||this.disposed||this.destroyed||(this.nextRenderHandle=ut((()=>this.renderAndReset())))}calcViewportBoundaries(){const eg=this.width,gg=this.height,ig=wt(this.viewportTransform),ng=St({x:0,y:0},ig),og=St({x:eg,y:gg},ig),ag=ng.min(og),Ig=ng.max(og);return this.vptCoords={tl:ag,tr:new ot(Ig.x,ag.y),bl:new ot(ag.x,Ig.y),br:Ig}}cancelRequestedRender(){this.nextRenderHandle&&(dt(this.nextRenderHandle),this.nextRenderHandle=0)}drawControls(eg){}renderCanvas(eg,gg){if(this.destroyed)return;const ig=this.viewportTransform,ng=this.clipPath;this.calcViewportBoundaries(),this.clearContext(eg),eg.imageSmoothingEnabled=this.imageSmoothingEnabled,eg.patternQuality="best",this.fire("before:render",{ctx:eg}),this._renderBackground(eg),eg.save(),eg.transform(ig[0],ig[1],ig[2],ig[3],ig[4],ig[5]),this._renderObjects(eg,gg),eg.restore(),this.controlsAboveOverlay||this.skipControlsDrawing||this.drawControls(eg),ng&&(ng._set("canvas",this),ng.shouldCache(),ng._transformDone=!0,ng.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(eg,ng)),this._renderOverlay(eg),this.controlsAboveOverlay&&!this.skipControlsDrawing&&this.drawControls(eg),this.fire("after:render",{ctx:eg}),this.__cleanupTask&&(this.__cleanupTask(),this.__cleanupTask=void 0)}drawClipPathOnCanvas(eg,gg){const ig=this.viewportTransform;eg.save(),eg.transform(...ig),eg.globalCompositeOperation="destination-in",gg.transform(eg),eg.scale(1/gg.zoomX,1/gg.zoomY),eg.drawImage(gg._cacheCanvas,-gg.cacheTranslationX,-gg.cacheTranslationY),eg.restore()}_renderObjects(eg,gg){for(let ig=0,ng=gg.length;ig<ng;++ig)gg[ig]&&gg[ig].render(eg)}_renderBackgroundOrOverlay(eg,gg){const ig=this["".concat(gg,"Color")],ng=this["".concat(gg,"Image")],og=this.viewportTransform,ag=this["".concat(gg,"Vpt")];if(!ig&&!ng)return;const Ig=Gt(ig);if(ig){if(eg.save(),eg.beginPath(),eg.moveTo(0,0),eg.lineTo(this.width,0),eg.lineTo(this.width,this.height),eg.lineTo(0,this.height),eg.closePath(),eg.fillStyle=Ig?ig.toLive(eg):ig,ag&&eg.transform(...og),Ig){eg.transform(1,0,0,1,ig.offsetX||0,ig.offsetY||0);const sg=ig.gradientTransform||ig.patternTransform;sg&&eg.transform(...sg)}eg.fill(),eg.restore()}if(ng){eg.save();const{skipOffscreen:sg}=this;this.skipOffscreen=ag,ag&&eg.transform(...og),ng.render(eg),this.skipOffscreen=sg,eg.restore()}}_renderBackground(eg){this._renderBackgroundOrOverlay(eg,"background")}_renderOverlay(eg){this._renderBackgroundOrOverlay(eg,"overlay")}getCenter(){return{top:this.height/2,left:this.width/2}}getCenterPoint(){return new ot(this.width/2,this.height/2)}centerObjectH(eg){return this._centerObject(eg,new ot(this.getCenterPoint().x,eg.getCenterPoint().y))}centerObjectV(eg){return this._centerObject(eg,new ot(eg.getCenterPoint().x,this.getCenterPoint().y))}centerObject(eg){return this._centerObject(eg,this.getCenterPoint())}viewportCenterObject(eg){return this._centerObject(eg,this.getVpCenter())}viewportCenterObjectH(eg){return this._centerObject(eg,new ot(this.getVpCenter().x,eg.getCenterPoint().y))}viewportCenterObjectV(eg){return this._centerObject(eg,new ot(eg.getCenterPoint().x,this.getVpCenter().y))}getVpCenter(){return St(this.getCenterPoint(),wt(this.viewportTransform))}_centerObject(eg,gg){eg.setXY(gg,D$1,D$1),eg.setCoords(),this.renderOnAddRemove&&this.requestRenderAll()}toDatalessJSON(eg){return this.toDatalessObject(eg)}toObject(eg){return this._toObjectMethod("toObject",eg)}toJSON(){return this.toObject()}toDatalessObject(eg){return this._toObjectMethod("toDatalessObject",eg)}_toObjectMethod(eg,gg){const ig=this.clipPath,ng=ig&&!ig.excludeFromExport?this._toObject(ig,eg,gg):null;return s$1(s$1(s$1({version:x},Yt(this,gg)),{},{objects:this._objects.filter((og=>!og.excludeFromExport)).map((og=>this._toObject(og,eg,gg)))},this.__serializeBgOverlay(eg,gg)),ng?{clipPath:ng}:null)}_toObject(eg,gg,ig){let ng;this.includeDefaultValues||(ng=eg.includeDefaultValues,eg.includeDefaultValues=!1);const og=eg[gg](ig);return this.includeDefaultValues||(eg.includeDefaultValues=!!ng),og}__serializeBgOverlay(eg,gg){const ig={},ng=this.backgroundImage,og=this.overlayImage,ag=this.backgroundColor,Ig=this.overlayColor;return Gt(ag)?ag.excludeFromExport||(ig.background=ag.toObject(gg)):ag&&(ig.background=ag),Gt(Ig)?Ig.excludeFromExport||(ig.overlay=Ig.toObject(gg)):Ig&&(ig.overlay=Ig),ng&&!ng.excludeFromExport&&(ig.backgroundImage=this._toObject(ng,eg,gg)),og&&!og.excludeFromExport&&(ig.overlayImage=this._toObject(og,eg,gg)),ig}toSVG(){let eg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},gg=arguments.length>1?arguments[1]:void 0;eg.reviver=gg;const ig=[];return this._setSVGPreamble(ig,eg),this._setSVGHeader(ig,eg),this.clipPath&&ig.push('<g clip-path="url(#'.concat(this.clipPath.clipPathId,`)" >
422
422
  `)),this._setSVGBgOverlayColor(ig,"background"),this._setSVGBgOverlayImage(ig,"backgroundImage",gg),this._setSVGObjects(ig,gg),this.clipPath&&ig.push(`</g>
@@ -927,7 +927,7 @@ void main() {
927
927
  `+(cg.length?"<defs>"+cg.join("")+"</defs>":"")+(/^[0-9A-Fa-f]{6}$/.test(""+yg)?'<rect width="100%" height="100%" fill="#'+yg+`" />
928
928
  `:"")+Gg+Cg+`</svg>
929
929
  `}};function wg(Gg,Zg){Gg+=pg,Zg+=fg;var yg=tg*Gg+eg*Zg+gg*(mg-1)+ig*(hg-1),Bg=ng*Gg+og*Zg+ag*(mg-1)+Ig*(hg-1);return""+((yg|0)==yg?yg:yg.toFixed(2))+" "+((Bg|0)==Bg?Bg:Bg.toFixed(2))}}var FontLib=(function(){var tg=[],eg={},gg={},ig={},ng=0;return ig.next=ig,ig.prev=ig,{lookup:ag,monochrome:Ig,getglyph:sg,getpaths:Cg,loadFont:og};function og(lg){var Ag=100,cg=100,rg=null;if(arguments.length==2)rg=arguments[1];else if(arguments.length==3)Ag=cg=+arguments[1]||100,rg=arguments[2];else if(arguments.length==4)cg=+arguments[1]||100,Ag=+arguments[2]||100,rg=arguments[3];else throw new Error("bwipjs: loadFont: invalid number of arguments");var ug=STBTT.InitFont(toUint8Array(rg));ug.bwipjs_name=lg,ug.bwipjs_multx=Ag,ug.bwipjs_multy=cg;var dg=tg.push(ug)-1;return eg[lg.toUpperCase()]=dg,dg}function ag(lg){var Ag=eg[lg.toUpperCase()];return Ag===void 0?1:Ag}function Ig(lg){if(lg)throw new Error("bwipjs: monochrome fonts not implemented")}function sg(lg,Ag,cg,rg){lg=lg|0,Ag=Ag|0,cg=+cg,rg=+rg,(!cg||cg<8)&&(cg=8),(!rg||rg<8)&&(rg=cg),(lg<0||lg>=tg.length)&&(lg=1),(!Ag||Ag<32)&&(Ag=32);var ug=""+lg+"c"+Ag+"w"+cg+"h"+rg,bg=gg[ug];if(bg){bg.prev.next=bg.next,bg.next.prev=bg.prev;var hg=ig;return hg.next.prev=bg,bg.next=hg.next,bg.prev=hg,hg.next=bg,bg}var dg=tg[lg],bg=STBTT.GetGlyph(dg,Ag,cg*dg.bwipjs_multx/100,rg*dg.bwipjs_multy/100)||STBTT.GetGlyph(dg,0,cg*dg.bwipjs_multx/100,rg*dg.bwipjs_multy/100);if(bg.bytes=bg.pixels,bg.cachekey=ug,bg.offset=0,ng>250){var hg=ig,mg=hg.prev;mg.prev.next=hg,hg.prev=mg.prev,mg.next=mg.prev=null,delete gg[mg.cachekey]}else ng++;gg[ug]=bg;var hg=ig;return hg.next.prev=bg,bg.next=hg.next,bg.prev=hg,hg.next=bg,bg}function Cg(lg,Ag,cg,rg){lg=lg|0,Ag=Ag|0,cg=+cg,rg=+rg,(!cg||cg<8)&&(cg=8),(!rg||rg<8)&&(rg=cg),(lg<0||lg>=tg.length)&&(lg=1),(!Ag||Ag<32)&&(Ag=32);var ug=tg[lg];return STBTT.GetPaths(ug,Ag,cg*ug.bwipjs_multx/100,rg*ug.bwipjs_multy/100)}})();function LoadFont(){return FontLib.loadFont.apply(FontLib,Array.prototype.slice.call(arguments))}var STBTT=(function(){var tg=1,eg=2,gg=3,ig=4,ng=0,og=3,ag=1,Ig=10,sg=Math.floor,Cg=Math.ceil,lg=Math.sqrt,Ag=Math.abs;function cg(zg){for(var Hg=[],ca=0;ca<zg;ca++)Hg.push({});return Hg}function rg(zg){return zg[zg.cursor++]||0}function ug(zg){return zg[zg.cursor]}function dg(zg,Hg){zg.cursor=Hg>zg.length||Hg<0?zg.length:Hg}function bg(zg,Hg){dg(zg,zg.cursor+Hg)}function mg(zg,Hg){for(var ca=0,tI=0;tI<Hg;tI++)ca=ca<<8|rg(zg);return ca}function hg(){return{length:0}}function pg(zg,Hg,ca){if(Hg<0||ca<0||Hg>zg.length||ca>zg.length-Hg)return hg();var tI=zg.subarray(Hg,Hg+ca);return tI.cursor=0,tI}function fg(zg){var Hg=zg.cursor,ca=mg(zg,2);if(ca){var tI=rg(zg);bg(zg,tI*ca),bg(zg,mg(zg,tI)-1)}return pg(zg,Hg,zg.cursor-Hg)}function wg(zg){var Hg=rg(zg);return Hg>=32&&Hg<=246?Hg-139:Hg>=247&&Hg<=250?(Hg-247)*256+rg(zg)+108:Hg>=251&&Hg<=254?-(Hg-251)*256-rg(zg)-108:Hg==28?mg(zg,2):Hg==29?mg(zg,4):0}function Gg(zg){var Hg=ug(zg);if(Hg==30)for(bg(zg,1);zg.cursor<zg.length;){var ca=rg(zg);if((ca&15)==15||ca>>4==15)break}else wg(zg)}function Zg(zg,Hg){for(dg(zg,0);zg.cursor<zg.length;){for(var ca=zg.cursor,tI,jg;ug(zg)>=28;)Gg(zg);if(tI=zg.cursor,jg=rg(zg),jg==12&&(jg=rg(zg)|256),jg==Hg)return pg(zg,ca,tI-ca)}return pg(zg,0,0)}function yg(zg,Hg,ca,tI){for(var jg=Zg(zg,Hg),lo=0;lo<ca&&jg.cursor<jg.length;lo++)tI[lo]=wg(jg)}function Bg(zg,Hg,ca){var tI=Zg(zg,Hg);return tI.cursor<tI.length&&(ca=wg(tI)),ca}function Wg(zg){return dg(zg,0),mg(zg,2)}function $g(zg,Hg){var ca,tI,jg,lo;return dg(zg,0),ca=mg(zg,2),tI=rg(zg),bg(zg,Hg*tI),jg=mg(zg,tI),lo=mg(zg,tI),pg(zg,2+(ca+1)*tI+jg,lo-jg)}function Ng(zg){return zg&32768?(4294901760|zg)>>0:zg}function vg(zg,Hg){return zg[Hg]*256+zg[Hg+1]}function Xg(zg,Hg){var ca=zg[Hg]*256+zg[Hg+1];return ca&32768?(4294901760|ca)>>0:ca}function Vg(zg,Hg){return(zg[Hg]<<24)+(zg[Hg+1]<<16)+(zg[Hg+2]<<8)+zg[Hg+3]}function Mg(zg,Hg,ca){for(var tI=vg(zg,Hg+4),jg=Hg+12,lo=0;lo<tI;++lo){var sa=jg+16*lo;if(zg[sa]==ca[0]&&zg[sa+1]==ca[1]&&zg[sa+2]==ca[2]&&zg[sa+3]==ca[3])return Vg(zg,sa+8)}return 0}function Rg(zg,Hg){var ca=[0,0];if(yg(Hg,18,2,ca),!ca[1]||!ca[0])return hg();var tI=pg(zg,ca[1],ca[0]),jg=Bg(tI,19,0);return jg?(dg(zg,ca[1]+jg),fg(zg)):hg()}function Sg(zg,Hg,ca){var tI,jg,lo,sa;if(zg.data=Hg,zg.fontstart=ca,zg.cff=hg(),tI=Mg(Hg,ca,[99,109,97,112]),zg.loca=Mg(Hg,ca,[108,111,99,97]),zg.head=Mg(Hg,ca,[104,101,97,100]),zg.glyf=Mg(Hg,ca,[103,108,121,102]),zg.hhea=Mg(Hg,ca,[104,104,101,97]),zg.hmtx=Mg(Hg,ca,[104,109,116,120]),zg.kern=Mg(Hg,ca,[107,101,114,110]),!tI||!zg.head||!zg.hhea||!zg.hmtx)return 0;if(zg.glyf){if(!zg.loca)return 0}else{var qg,ga,va,sI,aa=2,_g=0,xa=0,lI=0;if(sI=Mg(Hg,ca,[67,70,70,32]),!sI||(zg.fontdicts=hg(),zg.fdselect=hg(),zg.cff=Hg.subarray(sI),zg.cff.cursor=0,qg=zg.cff,bg(qg,2),dg(qg,rg(qg)),fg(qg),va=fg(qg),ga=$g(va,0),fg(qg),zg.gsubrs=fg(qg),_g=Bg(ga,17,_g),aa=Bg(ga,262,aa),xa=Bg(ga,292,xa),lI=Bg(ga,293,lI),zg.subrs=Rg(qg,ga),aa!=2)||_g==0)return 0;if(xa){if(!lI)return 0;dg(qg,xa),zg.fontdicts=fg(qg),zg.fdselect=pg(qg,lI,qg.length-lI)}dg(qg,_g),zg.charstrings=fg(qg)}for(jg=Mg(Hg,ca,[109,97,120,112]),jg?zg.numGlyphs=vg(Hg,jg+4):zg.numGlyphs=65535,sa=vg(Hg,tI+2),zg.index_map=0,lo=0;lo<sa;++lo){var gI=tI+4+8*lo;switch(vg(Hg,gI)){case og:switch(vg(Hg,gI+2)){case ag:case Ig:zg.index_map=tI+Vg(Hg,gI+4);break}break;case ng:zg.index_map=tI+Vg(Hg,gI+4);break}}return zg.index_map==0?0:(zg.indexToLocFormat=vg(Hg,zg.head+50),1)}function Yg(zg,Hg){var ca=zg.data,tI=zg.index_map,jg=vg(ca,tI+0);if(jg==0){var lo=vg(ca,tI+2);return Hg<lo-6?ca[tI+6+Hg]:0}else if(jg==6){var sa=vg(ca,tI+6),qg=vg(ca,tI+8);return Hg>=sa&&Hg<sa+qg?vg(ca,tI+10+(Hg-sa)*2):0}else{if(jg==2)return 0;if(jg==4){var ga=vg(ca,tI+6)>>1,va=vg(ca,tI+8)>>1,sI=vg(ca,tI+10),aa=vg(ca,tI+12)>>1,_g=tI+14,xa=_g;if(Hg>65535)return 0;for(Hg>=vg(ca,xa+aa*2)&&(xa+=aa*2),xa-=2;sI;){va>>=1;var lI=vg(ca,xa+va*2);Hg>lI&&(xa+=va*2),--sI}xa+=2;var gI,II,AI=xa-_g>>>1;return II=vg(ca,tI+14+ga*2+2+2*AI),Hg<II?0:(gI=vg(ca,tI+14+ga*6+2+2*AI),gI==0?Hg+Xg(ca,tI+14+ga*4+2+2*AI):vg(ca,gI+(Hg-II)*2+tI+14+ga*6+2+2*AI))}else if(jg==12||jg==13){for(var rI=Vg(ca,tI+12),bI=0,hI=rI;bI<hI;){var WI=bI+(hI-bI>>1),wI=Vg(ca,tI+16+WI*12),fI=Vg(ca,tI+16+WI*12+4);if(Hg<wI)hI=WI;else if(Hg>fI)bI=WI+1;else{var GI=Vg(ca,tI+16+WI*12+8);return jg==12?GI+Hg-wI:GI}}return 0}}return 0}function xg(zg,Hg,ca,tI,jg,lo){zg.type=Hg,zg.x=ca,zg.y=tI,zg.cx=jg,zg.cy=lo}function Og(zg,Hg){var ca,tI;return Hg>=zg.numGlyphs||zg.indexToLocFormat>=2?-1:(zg.indexToLocFormat==0?(ca=zg.glyf+vg(zg.data,zg.loca+Hg*2)*2,tI=zg.glyf+vg(zg.data,zg.loca+Hg*2+2)*2):(ca=zg.glyf+Vg(zg.data,zg.loca+Hg*4),tI=zg.glyf+Vg(zg.data,zg.loca+Hg*4+4)),ca==tI?-1:ca)}function Kg(zg,Hg,ca){if(zg.cff.length)eo(zg,Hg,ca);else{var tI=Og(zg,Hg);if(tI<0)return 0;ca.x0=Xg(zg.data,tI+2),ca.y0=Xg(zg.data,tI+4),ca.x1=Xg(zg.data,tI+6),ca.y1=Xg(zg.data,tI+8)}return 1}function Dg(zg,Hg,ca,tI,jg,lo,sa,qg,ga,va){return tI?(ca&&xg(zg[Hg++],gg,ga+sa>>1,va+qg>>1,ga,va),xg(zg[Hg++],gg,jg,lo,sa,qg)):ca?xg(zg[Hg++],gg,jg,lo,ga,va):xg(zg[Hg++],eg,jg,lo,0,0),Hg}function Fg(zg,Hg){var ca=zg.data,tI=Og(zg,Hg);if(tI<0)return null;var jg=[],lo=Xg(ca,tI);if(lo>0){var sa=0,qg,ga,va=0,sI,aa,_g,xa=0,lI,gI=0,II,AI,rI,bI,hI,WI,wI,fI,GI=tI+10,VI=vg(ca,tI+10+lo*2),YI=ca.subarray(tI+10+lo*2+2+VI),kI=0;for(aa=1+vg(ca,GI+lo*2-2),sI=aa+2*lo,jg=cg(sI),_g=0,qg=0,lI=sI-aa,ga=0;ga<aa;++ga)qg==0?(sa=YI[kI++],sa&8&&(qg=YI[kI++])):--qg,jg[lI+ga].type=sa;for(II=0,ga=0;ga<aa;++ga){if(sa=jg[lI+ga].type,sa&2){var jI=YI[kI++];II+=sa&16?jI:-jI}else sa&16||(II=II+Ng(YI[kI]*256+YI[kI+1]),kI+=2);jg[lI+ga].x=II}for(AI=0,ga=0;ga<aa;++ga){if(sa=jg[lI+ga].type,sa&4){var FI=YI[kI++];AI+=sa&32?FI:-FI}else sa&32||(AI=AI+Ng(YI[kI]*256+YI[kI+1]),kI+=2);jg[lI+ga].y=AI}var xI=0;for(hI=WI=rI=bI=wI=fI=0,ga=0;ga<aa;++ga)sa=jg[lI+ga].type,II=jg[lI+ga].x,AI=jg[lI+ga].y,_g==ga?(ga!=0&&(xI=Dg(jg,xI,xa,gI,hI,WI,wI,fI,rI,bI)),gI=!(sa&1),gI?(wI=II,fI=AI,jg[lI+ga+1].type&1?(hI=jg[lI+ga+1].x,WI=jg[lI+ga+1].y,++ga):(hI=II+jg[lI+ga+1].x>>1,WI=AI+jg[lI+ga+1].y>>1)):(hI=II,WI=AI),xg(jg[xI++],tg,hI,WI,0,0),xa=0,_g=1+vg(ca,GI+va*2),++va):sa&1?(xa?xg(jg[xI++],gg,II,AI,rI,bI):xg(jg[xI++],eg,II,AI,0,0),xa=0):(xa&&xg(jg[xI++],gg,rI+II>>1,bI+AI>>1,rI,bI),rI=II,bI=AI,xa=1);jg.length=Dg(jg,xI,xa,gI,hI,WI,wI,fI,rI,bI)}else if(lo==-1)for(var UI=1,XI=tI+10;UI;){var sa,PI,HI=[1,0,0,1,0,0];sa=Xg(ca,XI),XI+=2,PI=Xg(ca,XI),XI+=2,sa&2&&(sa&1?(HI[4]=Xg(ca,XI),XI+=2,HI[5]=Xg(ca,XI),XI+=2):(HI[4]=rg(ca),XI+=1,HI[5]=rg(ca),XI+=1)),sa&8?(HI[0]=HI[3]=Xg(ca,XI)/16384,XI+=2,HI[1]=HI[2]=0):sa&64?(HI[0]=Xg(ca,XI)/16384,XI+=2,HI[1]=HI[2]=0,HI[3]=Xg(ca,XI)/16384,XI+=2):sa&128&&(HI[0]=Xg(ca,XI)/16384,XI+=2,HI[1]=Xg(ca,XI)/16384,XI+=2,HI[2]=Xg(ca,XI)/16384,XI+=2,HI[3]=Xg(ca,XI)/16384,XI+=2);var sI=lg(HI[0]*HI[0]+HI[1]*HI[1]),aa=lg(HI[2]*HI[2]+HI[3]*HI[3]),gl=no(zg,PI);if(gl.length>0){for(var ga=0,cs=gl.length;ga<cs;++ga){var il=gl[ga],II,AI;II=il.x,AI=il.y,il.x=sg(sI*(HI[0]*II+HI[2]*AI+HI[4])),il.y=sg(aa*(HI[1]*II+HI[3]*AI+HI[5])),II=il.cx,AI=il.cy,il.cx=sg(sI*(HI[0]*II+HI[2]*AI+HI[4])),il.cy=sg(aa*(HI[1]*II+HI[3]*AI+HI[5]))}jg=jg.concat(gl)}UI=sa&32}return jg}function Tg(zg,Hg,ca){(Hg>zg.max_x||!zg.started)&&(zg.max_x=Hg),(ca>zg.max_y||!zg.started)&&(zg.max_y=ca),(Hg<zg.min_x||!zg.started)&&(zg.min_x=Hg),(ca<zg.min_y||!zg.started)&&(zg.min_y=ca),zg.started=1}function Jg(zg,Hg,ca,tI,jg,lo,sa,qg){Tg(zg,ca,tI),Hg==ig&&(Tg(zg,jg,lo),Tg(zg,sa,qg));var ga={};xg(ga,Hg,ca,tI,jg,lo),ga.cx1=sa,ga.cy1=qg,zg.vertices.push(ga)}function Eg(zg){(zg.first_x!=zg.x||zg.first_y!=zg.y)&&Jg(zg,eg,zg.first_x,zg.first_y,0,0,0,0)}function co(zg,Hg,ca){Eg(zg),zg.first_x=zg.x=zg.x+Hg,zg.first_y=zg.y=zg.y+ca,Jg(zg,tg,zg.x,zg.y,0,0,0,0)}function da(zg,Hg,ca){zg.x+=Hg,zg.y+=ca,Jg(zg,eg,zg.x,zg.y,0,0,0,0)}function ma(zg,Hg,ca,tI,jg,lo,sa){var qg=zg.x+Hg,ga=zg.y+ca,va=qg+tI,sI=ga+jg;zg.x=va+lo,zg.y=sI+sa,Jg(zg,ig,zg.x,zg.y,qg,ga,va,sI)}function pa(zg,Hg){var ca=Wg(zg),tI=107;return ca>=33900?tI=32768:ca>=1240&&(tI=1131),Hg+=tI,Hg<0||Hg>=ca?hg():$g(zg,Hg)}function eI(zg,Hg){var ca=zg.fdselect,tI,jg,lo,sa,qg,ga=-1,va;if(dg(ca,0),qg=rg(ca),qg==0)bg(ca,Hg),ga=rg(ca);else if(qg==3)for(tI=mg(ca,2),jg=mg(ca,2),va=0;va<tI;va++){if(sa=rg(ca),lo=mg(ca,2),Hg>=jg&&Hg<lo){ga=sa;break}jg=lo}return Rg(zg.cff,$g(zg.fontdicts,ga))}function Qg(zg,Hg,ca){var tI=1,jg=0,lo=0,sa=0,qg,ga,va,sI=0,aa,_g=[],xa=[],lI=zg.subrs,gI,II;for(gI=$g(zg.charstrings,Hg);gI.cursor<gI.length;){switch(ga=0,aa=1,va=rg(gI),va){case 19:case 20:tI&&(jg+=sa/2|0),tI=0,bg(gI,(jg+7)/8|0);break;case 1:case 3:case 18:case 23:jg+=sa/2|0;break;case 21:if(tI=0,sa<2)return 0;co(ca,_g[sa-2],_g[sa-1]);break;case 4:if(tI=0,sa<1)return 0;co(ca,0,_g[sa-1]);break;case 22:if(tI=0,sa<1)return 0;co(ca,_g[sa-1],0);break;case 5:if(sa<2)return 0;for(;ga+1<sa;ga+=2)da(ca,_g[ga],_g[ga+1]);break;case 7:if(sa<1)return 0;for(;!(ga>=sa||(da(ca,0,_g[ga]),ga++,ga>=sa));)da(ca,_g[ga],0),ga++;break;case 6:if(sa<1)return 0;for(;!(ga>=sa||(da(ca,_g[ga],0),ga++,ga>=sa));)da(ca,0,_g[ga]),ga++;break;case 31:if(sa<4)return 0;for(;!(ga+3>=sa||(ma(ca,_g[ga],0,_g[ga+1],_g[ga+2],sa-ga==5?_g[ga+4]:0,_g[ga+3]),ga+=4,ga+3>=sa));)ma(ca,0,_g[ga],_g[ga+1],_g[ga+2],_g[ga+3],sa-ga==5?_g[ga+4]:0),ga+=4;break;case 30:if(sa<4)return 0;for(;!(ga+3>=sa||(ma(ca,0,_g[ga],_g[ga+1],_g[ga+2],_g[ga+3],sa-ga==5?_g[ga+4]:0),ga+=4,ga+3>=sa));)ma(ca,_g[ga],0,_g[ga+1],_g[ga+2],sa-ga==5?_g[ga+4]:0,_g[ga+3]),ga+=4;break;case 8:if(sa<6)return 0;for(;ga+5<sa;ga+=6)ma(ca,_g[ga],_g[ga+1],_g[ga+2],_g[ga+3],_g[ga+4],_g[ga+5]);break;case 24:if(sa<8)return 0;for(;ga+5<sa-2;ga+=6)ma(ca,_g[ga],_g[ga+1],_g[ga+2],_g[ga+3],_g[ga+4],_g[ga+5]);if(ga+1>=sa)return 0;da(ca,_g[ga],_g[ga+1]);break;case 25:if(sa<8)return 0;for(;ga+1<sa-6;ga+=2)da(ca,_g[ga],_g[ga+1]);if(ga+5>=sa)return 0;ma(ca,_g[ga],_g[ga+1],_g[ga+2],_g[ga+3],_g[ga+4],_g[ga+5]);break;case 26:case 27:if(sa<4)return 0;for(II=0,sa&1&&(II=_g[ga],ga++);ga+3<sa;ga+=4)va==27?ma(ca,_g[ga],II,_g[ga+1],_g[ga+2],_g[ga+3],0):ma(ca,II,_g[ga],_g[ga+1],_g[ga+2],0,_g[ga+3]),II=0;break;case 10:sI||(zg.fdselect.length&&(lI=eI(zg,Hg)),sI=1);case 29:if(sa<1||(qg=_g[--sa]|0,lo>=10)||(xa[lo++]=gI,gI=pa(va==10?lI:zg.gsubrs,qg),gI.length==0))return 0;gI.cursor=0,aa=0;break;case 11:if(lo<=0)return 0;gI=xa[--lo],aa=0;break;case 14:return Eg(ca),1;case 12:var AI,rI,bI,hI,WI,wI,fI,GI,VI,YI,kI,jI,FI,xI,UI=rg(gI);switch(UI){case 34:if(sa<7)return 0;AI=_g[0],rI=_g[1],GI=_g[2],bI=_g[3],hI=_g[4],WI=_g[5],wI=_g[6],ma(ca,AI,0,rI,GI,bI,0),ma(ca,hI,0,WI,-GI,wI,0);break;case 35:if(sa<13)return 0;AI=_g[0],fI=_g[1],rI=_g[2],GI=_g[3],bI=_g[4],VI=_g[5],hI=_g[6],YI=_g[7],WI=_g[8],kI=_g[9],wI=_g[10],jI=_g[11],ma(ca,AI,fI,rI,GI,bI,VI),ma(ca,hI,YI,WI,kI,wI,jI);break;case 36:if(sa<9)return 0;AI=_g[0],fI=_g[1],rI=_g[2],GI=_g[3],bI=_g[4],hI=_g[5],WI=_g[6],kI=_g[7],wI=_g[8],ma(ca,AI,fI,rI,GI,bI,0),ma(ca,hI,0,WI,kI,wI,-(fI+GI+kI));break;case 37:if(sa<11)return 0;AI=_g[0],fI=_g[1],rI=_g[2],GI=_g[3],bI=_g[4],VI=_g[5],hI=_g[6],YI=_g[7],WI=_g[8],kI=_g[9],wI=jI=_g[10],FI=AI+rI+bI+hI+WI,xI=fI+GI+VI+YI+kI,Ag(FI)>Ag(xI)?jI=-xI:wI=-FI,ma(ca,AI,fI,rI,GI,bI,VI),ma(ca,hI,YI,WI,kI,wI,jI);break;default:return 0}break;default:if(va!=255&&va!=28&&(va<32||va>254)||(va==255?II=(mg(gI,4)|0)/65536:(bg(gI,-1),II=(wg(gI)<<16|0)>>16),sa>=48))return 0;_g[sa++]=II,aa=0;break}aa&&(sa=0)}return 0}function Ca(){return{started:0,first_x:0,first_y:0,x:0,y:0,min_x:0,max_x:0,min_y:0,max_y:0,vertices:[]}}function uo(zg,Hg){var ca=Ca();return Qg(zg,Hg,ca)?ca.vertices:null}function eo(zg,Hg,ca){var tI=Ca(),jg=Qg(zg,Hg,tI);return ca.x0=jg?tI.min_x:0,ca.y0=jg?tI.min_y:0,ca.x1=jg?tI.max_x:0,ca.y1=jg?tI.max_y:0,jg&&tI.vertices?tI.vertices.length:0}function no(zg,Hg){return zg.cff.length?uo(zg,Hg):Fg(zg,Hg)}function kg(zg,Hg){var ca=vg(zg.data,zg.hhea+34);return Hg<ca?{advanceWidth:Xg(zg.data,zg.hmtx+4*Hg),leftSideBearing:Xg(zg.data,zg.hmtx+4*Hg+2)}:{advanceWidth:Xg(zg.data,zg.hmtx+4*(ca-1)),leftSideBearing:Xg(zg.data,zg.hmtx+4*ca+2*(Hg-ca))}}function Lg(zg){return{ascent:Xg(zg.data,zg.hhea+4),descent:Xg(zg.data,zg.hhea+6),linegap:Xg(zg.data,zg.hhea+8)}}function Pg(zg,Hg,ca,tI,jg,lo){var sa={};return Kg(zg,Hg,sa)?{x0:sg(sa.x0*ca+jg),y0:sg(-sa.y1*tI+lo),x1:Cg(sa.x1*ca+jg),y1:Cg(-sa.y0*tI+lo)}:{x0:0,y0:0,x1:0,y1:0}}function ua(zg,Hg,ca){var tI=(zg.x1-zg.x0)/(zg.y1-zg.y0);return{fdx:tI,fdy:tI!=0?1/tI:0,fx:zg.x0+tI*(ca-zg.y0)-(Hg|0),direction:zg.invert?1:-1,sy:zg.y0,ey:zg.y1,next:0}}function ya(zg,Hg,ca,tI,jg,lo,sa){Hg=Hg|0,jg!=sa&&(jg>ca.ey||sa<ca.sy||(jg<ca.sy&&(tI+=(lo-tI)*(ca.sy-jg)/(sa-jg),jg=ca.sy),sa>ca.ey&&(lo+=(lo-tI)*(ca.ey-sa)/(sa-jg),sa=ca.ey),tI<=Hg&&lo<=Hg?zg[Hg]+=ca.direction*(sa-jg):tI>=Hg+1&&lo>=Hg+1||(zg[Hg]+=ca.direction*(sa-jg)*(1-(tI-Hg+(lo-Hg))/2))))}function oI(zg,Hg,ca,tI,jg){for(var lo=jg+1;tI;){if(tI.fdx==0){var sa=tI.fx;sa<ca&&(sa>=0?(ya(zg,sa,tI,sa,jg,sa,lo),ya(Hg,sa+1,tI,sa,jg,sa,lo)):ya(Hg,0,tI,sa,jg,sa,lo))}else{var sa=tI.fx,qg=tI.fdx,ga=sa+qg,va,sI,aa,_g,xa=tI.fdy;if(tI.sy>jg?(va=sa+qg*(tI.sy-jg),aa=tI.sy):(va=sa,aa=jg),tI.ey<lo?(sI=sa+qg*(tI.ey-jg),_g=tI.ey):(sI=ga,_g=lo),va>=0&&sI>=0&&va<ca&&sI<ca)if((va|0)==(sI|0)){var lI=_g-aa,gI=va|0;zg[gI]+=tI.direction*(1-(va-gI+(sI-gI))/2)*lI,Hg[gI+1]+=tI.direction*lI}else{var II,gI,AI,rI,bI,hI,WI,wI;for(va>sI&&(aa=lo-(aa-jg),_g=lo-(_g-jg),II=aa,aa=_g,_g=II,II=sI,sI=va,va=II,qg=-qg,xa=-xa,II=sa,sa=ga,ga=II),AI=va|0,rI=sI|0,bI=(AI+1-sa)*xa+jg,WI=tI.direction,wI=WI*(bI-aa),zg[AI]+=wI*(1-(va-AI+(AI+1-AI))/2),hI=WI*xa,gI=AI+1;gI<rI;++gI)zg[gI]+=wI+hI/2,wI+=hI;bI+=xa*(rI-(AI+1)),zg[rI]+=wI+WI*(1-(rI-rI+(sI-rI))/2)*(_g-bI),Hg[rI+1]+=WI*(_g-aa)}else for(var gI=0;gI<ca;++gI){var fI=jg,AI=gI,rI=gI+1,GI=ga,VI=lo,YI=(gI-sa)/qg+jg,kI=(gI+1-sa)/qg+jg;sa<AI&&GI>rI?(ya(zg,gI,tI,sa,fI,AI,YI),ya(zg,gI,tI,AI,YI,rI,kI),ya(zg,gI,tI,rI,kI,GI,VI)):GI<AI&&sa>rI?(ya(zg,gI,tI,sa,fI,rI,kI),ya(zg,gI,tI,rI,kI,AI,YI),ya(zg,gI,tI,AI,YI,GI,VI)):sa<AI&&GI>AI||GI<AI&&sa>AI?(ya(zg,gI,tI,sa,fI,AI,YI),ya(zg,gI,tI,AI,YI,GI,VI)):sa<rI&&GI>rI||GI<rI&&sa>rI?(ya(zg,gI,tI,sa,fI,rI,kI),ya(zg,gI,tI,rI,kI,GI,VI)):ya(zg,gI,tI,sa,fI,GI,VI)}}tI=tI.next}}function iI(zg,Hg,ca,tI,jg,lo){jg|=0,lo|=0;var sa=null,qg,ga=lo,va=0,sI,aa=new Float32Array(zg.w*2+1),_g=aa.subarray(zg.w),xa=0;for(Hg[ca].y0=lo+zg.h+1;va<zg.h;){var lI=ga+0,gI=ga+1,II=sa;if(aa.fill)aa.fill(0);else for(var AI=0,rI=aa.length;AI<rI;AI++)aa[AI]=0;for(;II;)qg=II,II=qg.next,qg.ey<=lI&&(qg.direction=0);for(;Hg[xa].y0<=gI;)Hg[xa].y0!=Hg[xa].y1&&(qg=ua(Hg[xa],jg,lI),qg.next=sa,sa=qg),++xa;sa&&oI(aa,_g,zg.w,sa,lI);for(var sI=0,bI=0;sI<zg.w;++sI){var hI,WI;bI+=_g[sI],hI=aa[sI]+bI,hI=Ag(hI)*255+.5,WI=hI>>>0,WI>255&&(WI=255),zg.pixels[va*zg.stride+sI]=WI}for(II=sa;II;)qg=II,qg.fx+=qg.fdx,II=qg.next;++ga,++va}}function oa(zg,Hg){for(var ca=1;ca<Hg;++ca){for(var tI=zg[ca],jg=ca;jg>0&&tI.y0<zg[jg-1].y0;)zg[jg]=zg[jg-1],--jg;ca!=jg&&(zg[jg]=tI)}}function ha(zg,Hg,ca){for(;ca>12;){var tI,jg,lo,sa,qg,ga=ca>>1,va=zg[Hg].y0<zg[Hg+ga].y0,sI=zg[Hg+ga].y0<zg[Hg+ca-1].y0;for(va!=sI&&(jg=zg[Hg].y0<zg[Hg+ca-11].y0,qg=jg==sI?0:ca-1,tI=zg[Hg+qg],zg[Hg+qg]=zg[Hg+ga],zg[Hg+ga]=tI),tI=zg[Hg],zg[Hg]=zg[Hg+ga],zg[Hg+ga]=tI,lo=1,sa=ca-1;;){for(;zg[Hg+lo].y0<zg[Hg].y0;++lo);for(;zg[Hg].y0<zg[Hg+sa].y0;--sa);if(lo>=sa)break;tI=zg[Hg+lo],zg[Hg+lo]=zg[Hg+sa],zg[Hg+sa]=tI,++lo,--sa}sa<ca-lo?(ha(zg,Hg,sa),Hg+=lo,ca-=lo):(ha(zg,Hg+lo,ca-lo),ca=sa)}}function nI(zg,Hg){ha(zg,0,Hg),oa(zg,Hg)}function cI(zg,Hg,ca,tI,jg,lo,sa,qg,ga,va){var sI=-jg,aa,_g,xa,lI,gI,II,AI=1;for(_g=0,xa=0;xa<ca.length;++xa)_g+=ca[xa];for(aa=cg(_g+1),_g=0,II=0,xa=0;xa<ca.length;++xa){var rI=II;for(II+=ca[xa],lI=ca[xa]-1,gI=0;gI<ca[xa];lI=gI++){var bI=gI,hI=lI;Hg[rI+lI].y!=Hg[rI+gI].y&&(aa[_g].invert=0,Hg[rI+lI].y>Hg[rI+gI].y&&(aa[_g].invert=1,bI=lI,hI=gI),aa[_g].x0=Hg[rI+bI].x*tI+lo,aa[_g].y0=(Hg[rI+bI].y*sI+sa)*AI,aa[_g].x1=Hg[rI+hI].x*tI+lo,aa[_g].y1=(Hg[rI+hI].y*sI+sa)*AI,++_g)}}nI(aa,_g),iI(zg,aa,_g,AI,qg,ga)}function dI(zg,Hg,ca,tI,jg,lo,sa,qg,ga){var va=(Hg+2*tI+lo)/4,sI=(ca+2*jg+sa)/4,aa=(Hg+lo)/2-va,_g=(ca+sa)/2-sI;return ga>16||(aa*aa+_g*_g>qg?(dI(zg,Hg,ca,(Hg+tI)/2,(ca+jg)/2,va,sI,qg,ga+1),dI(zg,va,sI,(tI+lo)/2,(jg+sa)/2,lo,sa,qg,ga+1)):zg.push({x:lo,y:sa})),1}function pI(zg,Hg,ca,tI,jg,lo,sa,qg,ga,va,sI){var aa=tI-Hg,_g=jg-ca,xa=lo-tI,lI=sa-jg,gI=qg-lo,II=ga-sa,AI=qg-Hg,rI=ga-ca,bI=lg(aa*aa+_g*_g)+lg(xa*xa+lI*lI)+lg(gI*gI+II*II),hI=lg(AI*AI+rI*rI),WI=bI*bI-hI*hI;if(!(sI>16))if(WI>va){var wI=(Hg+tI)/2,fI=(ca+jg)/2,GI=(tI+lo)/2,VI=(jg+sa)/2,YI=(lo+qg)/2,kI=(sa+ga)/2,jI=(wI+GI)/2,FI=(fI+VI)/2,xI=(GI+YI)/2,UI=(VI+kI)/2,XI=(jI+xI)/2,PI=(FI+UI)/2;pI(zg,Hg,ca,wI,fI,jI,FI,XI,PI,va,sI+1),pI(zg,XI,PI,xI,UI,YI,kI,qg,ga,va,sI+1)}else zg.push({x:qg,y:ga})}function Ug(zg,Hg,ca){for(var tI=[],jg=Hg*Hg,lo=-1,sa=0,qg=0,ga=0,va=0,sI=zg.length;va<sI;++va)switch(zg[va].type){case tg:lo>=0&&(ca[lo]=tI.length-sa),++lo,sa=tI.length,qg=zg[va].x,ga=zg[va].y,tI.push({x:qg,y:ga});break;case eg:qg=zg[va].x,ga=zg[va].y,tI.push({x:qg,y:ga});break;case gg:dI(tI,qg,ga,zg[va].cx,zg[va].cy,zg[va].x,zg[va].y,jg,0),qg=zg[va].x,ga=zg[va].y;break;case ig:pI(tI,qg,ga,zg[va].cx,zg[va].cy,zg[va].cx1,zg[va].cy1,zg[va].x,zg[va].y,jg,0),qg=zg[va].x,ga=zg[va].y;break}return ca[lo]=tI.length-sa,tI}function La(zg,Hg,ca,tI,jg,lo,sa,qg,ga,va){qg|=0,ga|=0;var sI=tI>jg?jg:tI,aa=[],_g=Ug(ca,Hg/sI,aa);_g&&cI(zg,_g,aa,tI,jg,lo,sa,qg,ga)}function aI(zg){var Hg={};if(!Sg(Hg,zg,0))return null;var ca=Lg(Hg);return Hg.ascent=ca.ascent,Hg.descent=ca.descent,Hg.linegap=ca.linegap,Hg}function CI(zg,Hg,ca,tI){tI=tI||ca;var jg=ca/zg.ascent,lo=tI/zg.ascent,sa=Yg(zg,Hg);if(!sa&&Hg)return null;var qg=no(zg,sa),ga=Pg(zg,sa,jg,lo,0,0),va=ga.x1-ga.x0,sI=ga.y1-ga.y0,aa=null;if(va&&sI){var _g={pixels:aa=new Uint8Array(va*sI),w:va,h:sI,stride:va};La(_g,.35,qg,jg,lo,0,0,ga.x0,ga.y0)}var xa=kg(zg,sa);return{glyph:sa,pixels:aa,width:va,height:sI,top:-ga.y0,left:ga.x0,advance:sg(xa.advanceWidth*jg)}}function fa(zg,Hg,ca,tI){tI=tI||ca;var jg=ca/zg.ascent,lo=tI/zg.ascent,sa=Yg(zg,Hg);if(!sa&&Hg)return null;var qg=no(zg,sa),ga=kg(zg,sa),va=0,sI=0,aa=[];if(qg)for(var _g=0,xa=qg.length;_g<xa;_g++){var lI=qg[_g],gI;if(lI.type==tg)gI={type:"M",x:lI.x*jg,y:lI.y*lo};else if(lI.type==eg)gI={type:"L",x:lI.x*jg,y:lI.y*lo};else if(lI.type==gg)gI={type:"Q",x:lI.x*jg,y:lI.y*lo,cx:lI.cx*jg,cy:lI.cy*lo};else if(lI.type==ig)gI={type:"C",x:lI.x*jg,y:lI.y*lo,cx1:lI.cx*jg,cy1:lI.cy*lo,cx2:lI.cx1*jg,cy2:lI.cy1*lo};else continue;gI.y>va&&(va=gI.y),gI.y<sI&&(sI=gI.y),aa.push(gI)}return aa.advance=ga.advanceWidth*jg,aa.ascent=va,aa.descent=sI,aa}return{InitFont:aI,GetGlyph:CI,GetPaths:fa}})();function toUint8Array(tg){if(typeof tg=="string"){for(var eg=/[^A-Za-z0-9+\/=\s]/.test(tg),gg=eg?tg:atob(tg),ig=gg.length,ng=new Uint8Array(ig),og=0;og<ig;og++)ng[og]=gg.charCodeAt(og);return ng}else{if(tg instanceof Uint8Array)return tg;if(tg instanceof ArrayBuffer)return new Uint8Array(tg)}throw new ReferenceError("data must be a binary or base64 encoded string or Uint8Array")}FontLib.loadFont("OCR-A",100,100,"AAEAAAAPAIAAAwBwRkZUTXxHoksAADPIAAAAHEdERUYAmQAGAAAyIAAAACBHUE9TuP+4/gAAM5gAAAAwR1NVQuq3l/0AADJAAAABWE9TLzKDm4kvAAABeAAAAGBjbWFwO6GiGgAAArgAAAFaZ2FzcP//AAMAADIYAAAACGdseWYfHUemAAAE8AAAKUBoZWFkFeCL3QAAAPwAAAA2aGhlYQcqAgQAAAE0AAAAJGhtdHgagBVHAAAB2AAAAOBsb2NhH+IWRAAABBQAAADabWF4cACxAF0AAAFYAAAAIG5hbWUIp3NfAAAuMAAAAoJwb3N0oJoboAAAMLQAAAFkAAEAAAACAAAhYPsHXw889QALA+gAAAAA2gMjvQAAAADaAyO9AD7/LAJ8BFIAAAAIAAIAAAAAAAAAAQAABFL/LABaAtMAAAAAAnwAAQAAAAAAAAAAAAAAAAAAAAQAAQAAAGwAWgADAAAAAAACAAAAAQABAAAAQAAAAAAAAAACAtMBkAAFAAACigK8AAAAjAKKArwAAAHgADEBAgAAAgAFCQAAAAAAAAAAACMAACoAAAAAAAAAAABQZkVkAEAAICWgAyD/OABaBFIA1AAAAAEAAAAAAjgDDAAAACAAAQLTAAAAAAAAAtMAAALTAAAA9gBJAEkASQBJAEkA3QDdAKwASQBJAKwASQDdAEkASQBJAEkASQBhAEkASQBJAEkASQDdAKwASQBJAEkASQBJAEYASQBJAEkASQBJAEkASQBJAHoASQBJAEkASQBJAEkASQBJAEkASQBJAEkASQBJAEkASABJAEkASQBIAEkAegBJAEkASQBJAEkAYQBJAEkAegB6AEkAegBBAEkASQBJAEkASQBJAEkASQBJAD4ASQBJAEkASQEPAEkASQBxAHEAcQE3AFcA7QBxAQMA1ABxAAAAAwAAAAMAAAAcAAEAAAAAAFQAAwABAAAAHAAEADgAAAAKAAgAAgACAH4kQiUCJaD//wAAACAkQCUCJaD////j3CLbY9rGAAEAAAAAAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAADBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAFIApgDoAS4BigGqAdYCAgJKAnQCkAKsAsYC5AMIAzIDYAOcA8gD+gQmBFIEggSuBNwFDAU0BVwFhAXEBhIGPgZwBqgG5AcKBy4HageWB8QH7gggCDoIZgiICMoI8glMCYIJwAnmChAKNAp0Cq4K1gr6CyYLRAtwC5QLrgvODBYMdAysDRANag2eDhYOSA6EDsYO+A8iD2YPmA/yEFgQvBDqETQRbhGgEcwSDhJEEnoSqBLiEwITPBNyE5ITthPeE+wT+hQUFEYUaBSIFKAAAAACAPYAAAGNAwwADwAfAAA3NTQ2OwEyFh0BFAYrASImETQ2OwEyFh0BAxQGIyImJ/YeFTEVHh4VMRUeHhUxFB8ZHhQVHAIzKhUdHRUqFR4eArwUHhwTA/6BFR0dFQAAAAABAEkBqAI7AwwAEwAAEychFQYHBiMiJjUnIwcOASMiJidKAQHyJgsMKBQgKHIqAxwSExwDAsJKSrkvMhoS09YRGBgRAAIASQB/AjsDDAA9AEEAABM0NjsBNSMiJjQ2OwE1NDYyFh0BMzU0NjIWHQEzMhYUBisBFTMyFhUUBisBFRQGIiY9ASMVFAYiJj0BIyImNzM1I0kdFTExFR0dFTEdKh5hHiodMRUeHhUxMRUeHhUxHSoeYR4qHTEVHchhYQFcFB5vHiodeBQeHhR4eBQeHhR4HSoebx4UFR53FR4eFXd3FR4eFXceR28AAAEASQAAAjsDDAAxAAA2NDYzITUhIiY9ATQ2OwE1NDYzMhYdATMyFhQGIyEVITIWHQEUBisBFRQGIyImPQEjIkkdFQFb/qUVHR0VlB4VFB6UFR4eFf6lAVsVHh4VlB4UFR6UFccqHkQeFaoVHXgUHh4UeB0qHkQeFaoVHXcVHh4VdwAAAAMASQAAAjsDDAAPAB8ALwAANzQ3ATYzMhYVFAcBBiMiJhE1NDY7ATIWHQEUBisBIiYBNTQ2OwEyFh0BFAYrASImSQoBjQ4aFR4L/nMOGhUdHRVjFR4eFWMVHQEpHhVjFR4eFWMVHocUCwH+Ex0VEg3+AhMdAhNVFB4eFFUVHh79w1QVHh4VVBUeHgAAAwBJAAACOwK3AC4ANgBBAAA3NTQ/AScmPQE0NjsBMhYdARQPARc3NjMyFhUUDgIHFxYVFAYjIi8BBwYrASImNxQWOwE3JwcRFzc1NCYrASIGFUkRXGANWT5gPlkRfWszDxIVHhAPIQI0Dh4VFw43Sg8RYj5ZZR4UTzhrTlVvHhRgFB6XRRgPT2YPFEU+WVk+RRkOa3IsDB4VDRoOGAI4EBIVHhA7PwxZPhUdMHJCASpbXi4UHh0VAAEA3QFUAaYDDAARAAATETQ2OwEyFhcUBg8BDgEjIibdHhVjFRwCMhoZBRoSFR4BhgFUFB4dFQawVVURFR0AAAABAN0AAAHZAwwAGwAAEzU0PwE2MzIWFRQPAQYdARQfARYVFAYjIi8BJt0rdRAYFR8MdRYWdQodFRgQdSsBJsBFOJYTHhQOEpUdIsAiHZUPEBUeE5Y4AAAAAQCsAAABpgMMABsAADc0PwE2PQE0LwEmNTQ2MzIfARYdARQPAQYjIiasCnUWFnUKHRUYEHUrK3UQGBUdMxAPlR0iwCIdlQ8RFB4TljhFwEU4lhMeAAAAAAEASQBVAjsCtwAzAAA3ND8BJyY1NDYzMh8BNTQ2MzIWHQE3NjMyFhUUDwEXFhUUBiMiLwEVFAYjIiY9AQcGIyImSRGZmREdFRMOcx4VFB5zDRQVHhKZmRIeFRQNcx4UFR5zDhMVHdwYD4ODDxgVHQxikRUdHRWRYgwdFRcQg4MQFxUdDGKRFR0dFZFiDB0AAAEASQCNAjsCfwAdAAASNDY7ATU0NjMyFh0BMzIWFAYrARUUBiMiJj0BIyJJHRWUHhUUHpQVHh4VlB4UFR6UFQFxKh6UFB4eFJQeKh2UFR4eFZQAAAEArAAAAdcBZAAQAAASNDY7ATIWHQEUBiImPQEjIqwdFccVHR0qHpQVARwqHh4V/hUeHhXMAAAAAQBJASkCOwG5AA8AABM1NDYzITIWHQEUBiMhIiZJHRUBjRUeHhX+cxUdAVwqFR4eFSoVHh4AAAABAN0AfwGmATkADwAANzU0NjsBMhYdARQGKwEiJt0eFWMVHh4VYxUeslUVHR0VVRUeHgAAAQBJAAACOwMMAA8AADc0NwE2MzIWFRQHAQYjIiZJBgGNDx0VHgf+cw8dFR0zDQwCpxkeFAwO/VkZHgAAAgBJAAACOwMMAA8AEwAANxE0NjMhMhYVERQGIyEiJjchESFJPCkBKCg9PSj+2Ck8ZQEo/thlAkIpPDwp/b4pPDwpAkIAAAAAAQBJAAACOwMMABwAADc0NjsBESMiJjU0NjsBETM1NDYyFh0BFAYjISImSR0VlJQVHR0V+WIdKh4eFf5zFR0zFB4CQh4VFB79WcwVHh4V/hUeHgAAAQBJAAACOwMMAB4AADMRNDYzITUhIiY1NDYzITIWHQEUBiMhFSEyFhUUBiNJPCkBKP6lFR0dFQFbKD08Kf7YAVoVHh4VAVQpO+8eFRQePCnvKDzvHhQVHgAAAAABAEkAAAI7AwwAKgAANzQ2MyE1NCYrASImNDY7ATI2PQEhIiY1NDYzITIWHQEUBxYdARQGIyEiJkkdFQFbHxTFFR0dFcUVHv6lFR0dFQFbKD0oKD0o/qUVHTMUHrwUHx0qHh4UvB4VFB48Kbw6Kys6vCk8HgAAAAABAGEAAAIiAwwAHQAAExE0NjIWFREzETQ2MzIWFREyFhQGIxUUBiMiJj0BYR4qHcUeFRQeFR0dFR4UFR4A/wHbFB4eFP6KASEVHR0V/t8eKh3MFR4eFcwAAQBJAAACOwMMACIAADc0NjMyHwEzNSERITIWFRQGKwEVMzIWHQEUBisBIi4CJyZJHRUMCFrt/tYBXBUeHhX3xSg9PSjjFCkaLAkeXRUdBCbvAbgeFBUe7j0o7yk8CgsVBA0AAAIASQAAAjsDDAAXABsAADcRNDY7ATIWFRQGIxEhMhYdARQGIyEiJjchNSFJHRUyFR0dFQFbFR4eFf5zFR1kASn+1zMCpxQeHhQVHv69HhX+FR4eR5oAAAABAEkAAAI7AwwAGwAAEzU0NjMhERQPARUUBiMiJj0BND8BNSEOASMiJkkdFQHAErUeFBUeErX+1wMcExUdAq8rFB7+zxcQmucVHh4V/hcQmrUSGB0AAAAAAwBJAAACOwMMABcAGwAfAAA3NTQ2MxE0NjsBMhYVETIWHQEUBiMhIiY3ITUhNzM1I0k7KRwVxxUcKD09KP7XKTtkASn+12RhYWXvKTwBIRUdHRX+3z0o7yk8PCnvZe4AAgBJAAACOwMMABcAGwAAExE0NjMhMhYVERQGKwEiJjU0NjMRISImNyE1IUkdFQGNFR4eFTIVHR0V/qUVHWQBKf7XAdsA/xQeHhT9WRUeHhUUHgFDHkeaAAIA3QB/AaYCjQAPAB8AADc1NDY7ATIWHQEUBisBIiYRNTQ2OwEyFh0BFAYrASIm3R4VYxUeHhVjFR4eFWMVHh4VYxUeslUVHR0VVRUeHgFoVRUeHhVVFR0dAAAAAgCsAAAB1wK3ABAAIAAAEjQ2OwEyFh0BFAYiJj0BIyIDNTQ2OwEyFh0BFAYrASImrB0VxxUdHSoelBUdHRVkFB4eFGQVHQEcKh4eFf4VHh4VzAExVRUdHRVVFR4eAAAAAQBJAFUCOwK3ABYAABM1NDclNjMyFhUUBw0BFhUUBiMiJyUmSRgBjQsPFR4Z/pkBZxkeFQ8L/nMYAXArHQ/pBx0VHBDT0xAcFR0H6Q8AAAACAEkA/wI7AjgACwAXAAASNDYzITIWFAYjISImNDYzITIWFAYjISJJHRUBjRUeHhX+cxUdHRUBjRUeHhX+cxUBHCoeHiod8SoeHiodAAAAAAEASQBVAjsCtwAWAAA3NDctASY1NDYzMhcFFh0BFAcFBiMiJkkYAWj+mBgdFQ8LAY0ZFP5uCw8VHYcdD9PTDx0VHQfpEBwqHQzsBx0AAAAAAgBJAAACOwMMAB4AKAAAEzQ3ATYyHwEWHQEUBwUVFAYiJj0BNDclNScFBiMiJhM0NjIWFRQGIiZJEQEqDyQPYxIS/ugeKh0RARkx/vcPEhUdYx0qHh4qHQHbGA4A/wwMVQ8XVRcQ7z4VHR0VVRkO7yYq4wwe/m0UHh4UFR4eAAACAEkAAAI7AwwALQA4AAA3NTQ2OwEyFhURFBYyNjURNCYrASIGBwYjIiY1NDc2OwEyFhURFAYjIicGIyImNxQWMjY9ASMiBhVJWD1kFB4dKB0uH48ZLQwOHxUdNjdEj0lpWT05Kiw4PVhlHCgdMRQclrc+WB4V/uYUHR0UAcQgLSMXGx4VJDEyakj+PD1ZJydYPhQdHRToHRQAAAACAEYAAAI8AwwAFQAYAAA3Ez4BMhYXExQGIyImLwEjBw4BIyImNzMDRssFGiIcBMofFREaBSffJwUbERUfqqNSMwK1EBQUEP1LFR4UEIaGEBQe8QEWAAAAAwBJAAACOwMMAA4AGAAiAAAzESEyFh0BFAcWHQEUBiMnMzI2PQE0JisBNTMyNj0BNCYrAUkBKFJ4RkZ4UsPDKTw8KcPDKTw8KcMDDHhSJVk+PlklUnhlPSglKTxlPCglKD0AAAEASQAAAjsDDAAlAAATND8BPgE7ATIWFRQGKwEiDwEGFB8BFjsBMhYVFAYrASImJyYnJkkYZRBLLboVHh4Vuh8NZw0NZw0fuhUeHhW6LEkSShwYAYY1MswkLx4UFR4cyxw8HMscHhQVHjAkjT4zAAACAEkAAAI7AwwAGwAoAAA3NDY7AREjIiY1NDY7ATIWHwEWFA8BDgErASImNzMyPwE2NTQvASYrAUkdFTExFR0dFbosSRJmGRllEEstuhUdyCQfDWcODmcNHyQzFB4CQh4VFB4wJMs0ZjTMJC8eRxzLIhgeHMscAAABAEkAAAI7AwwAGQAAMxEhMhYVFAYjIRUzMhYUBisBFSEyFhUUBiNJAb8VHh4V/qaUFB4eFJQBWhUeHhUDDB4UFR7uHiod7x4UFR4AAQBJAAACOwMMABYAADcRITIWFRQGIyEVMzIWFAYrAREUBiImSQG/FR4eFf6m9xUdHRX3HiodMwLZHhQVHpodKh7+ixUeHgAAAQBJAAACOwMMACoAADcRND8BNjsBMhYVFAYrASIPAQYVERQWOwEyNj0BIyImNDY7ARUUBisBIiZJKogtS5UVHh4VlRkPiBUeFMMUH2MVHR0VyFo+wz9YmAEPRTawOh4UFR4Urhwi/vEVHh4VZx0qHsw+WlkAAAAAAQBJAAACOwMMABsAADcRNDYyFhURIRE0NjIWFREUBiImNREhERQGIiZJHSoeASgdKh4eKh3+2B4qHTMCpxQeHhT+3wEhFB4eFP1ZFR4eFQEh/t8VHh4AAAEASQAAAjsDDAAfAAA3NDY7AREjIiY1NDYzITIWFRQGKwERMzIWFRQGIyEiJkkdFZSUFR0dFQGNFR4eFZSUFR4eFf5zFR0zFB4CQh4VFB4eFBUe/b4eFBUeHgAAAQB6AAACCQMMABsAADc1NDYyFh0BFBY7ATI2NRE0NjIWFREUBisBIiZ6HiodHhVfFR4dKh5aPl8+WpeaFR4eFZoVHR4UAkMUHh4U/b0+WVkAAAAAAQBJAAACOwMMAB4AADcRNDYyFh0BATYzMhYVFAcJARYVFAYjIicBFRQGIiZJHSoeATkPEhUeEv6gAWASHhUSD/7HHiodMwKnFB4eFOYBDAweFBgP/tP+0w8XFR4MAQzlFR4eAAEASQAAAjsDDAAOAAAzETQ2MhYVESEyFhUUBiNJHSoeAVoVHh4VAtoUHh4U/YseFBUeAAABAEkAAAI7AwwAGwAANxEzFzczERQGIiY1EQcVFAYjIiY9AScRFAYiJkl+e3p/HiodYh4UFR5hHiodMwLZr6/9JxUeHhUCTowaFR4eFRqK/bQVHh4AAAAAAQBJAAACOwMMABEAADcRMwERNDYyFhURIwERFAYiJkmFAQgdKh6G/vkeKh0zAtn9pgIoFB4eFP0mAlj92xUeHgAAAAACAEkAAAI7AwwAFgApAAATND8BPgEzMhYfARYUDwEOASMiJi8BJjcGFB8BFjMyPwE2NTQvASYjIgdJGGsQPyYnPxBrGRlrED8nJj8QaxhyDQ1sCBIUCGsODmwIExEJAYY1MtcfKSkf1zRmNNcfKSkf1y5zHDwc1hEQ1yIYHhzVEhIAAAACAEkAAAI7AwwADwAZAAA3ESEyFh0BFAYrARUUBiImEzMyNj0BNCYrAUkBWj5aWj71HiodZfUUHx8U9TMC2Vk+tD5a9hUeHgFwHhW0FB4AAAIASQAAAjsDDAAhAEAAADcRND8BNjMyFhURFA4FBxczMhYVFAYrAScHBiMiJjcUOwE3JyY1NDYzMh4DFz4ENRE0JisBBwYVSUbhIC8ySggUDiMOLAUYQRUeHhWGJUsiLTJIZRUIbCUDHhUNFA8IDAIEHw4UCQ0KB+giewEaXj2+Hkky/uYXKSUZIg0kBD0eFBUeXkAeSTIWXF4HCxUeCxoRJAQEGQ0aHBEBGgkMwx4wAAAAAAIASQAAAjsDDAAZACMAADcRITIWHQEUBisBExYVFAYjIicDIxEUBiImEzMyNj0BNCYrAUkBWj5aWz06ywceFR0P6UUeKh1l9RQfHxT1MwLZWj40Plr+pA4LFR4ZAY/+ixUeHgHvHxQ0FR4AAAEASQAAAjsDDAAsAAA3NDYyFhUUFjsBMjUBJj0BNDY7ATIWFRQGIiY1NCYrASIdAgEWFQ4BKwEiJkkdKh4UDvkN/ooXQy75N1EeKh0VDvkMAXQZAkEv+TdQhxUeHhUOFA0B4iAmAy1CUDcVHh4VDRUKAwT+Ih4oL0NQAAABAEkAAAI7AwwAGAAAEzUhFRQGIiY9ASMRFAYjIiY1ESMVFAYiJkkB8h4qHWIeFBUeYR4qHQKFh4cVHh4VIv2MFR4eFQJ0IhUeHgAAAQBJAAACOwMMABsAADcRNDYyFhURFBY7ATI2NRE0NjIWFREUBisBIiZJHSoeHhTDFB8dKh5aPsM+WZcCQxQeHhT9vRUdHhQCQxQeHhT9vT5ZWQAAAQBJAAACOwMMABUAABM1NDYyFh0BGwE1NDYyFh0BAwYjIidJHSoelJQdKh7KDSIjDQIltRQeHhSh/oYBeqEUHh4UtP36ICAAAQBJAAACOwMMACsAADcRNDYyFhURFzM+ATcRNDYzMhYVER4BFzM3ETQ2MhYVEQcGKwEiJwYrASInSR0qHhwpAhQGHhUUHgYUAikdHSoeOQ8dYiASFR5hHg96AmAUHh4U/bswAyYKAUMVHR0V/r0KJgMwAkUUHh4U/aBhGSMjGQABAEkAAAI7AwwAIwAANzQ3EwMmNTQ2MzIXGwE2MzIWFRQHAxMWFRQGIyInCwEGIyImSQa4uAYdFR0Pm5oPHRUeB7i4Bx4VHQ+amw8dFR0zDQwBOgE6DA4UHhn++AEIGR4UDA7+xv7GDgsVHhkBCP74GR4AAAEASQAAAjsDDAAZAAATNTQ2MhYdARc3NTQ2MhYdAQcRFAYjIiY1EUkdKh6Ukx4qHsceFBUeAnNnFB4eFES+vkQUHh4UZ/7+vhUeHhUBQgAAAQBIAAACOwMMABMAADcBISImNTQ2MyEVASEyFhUUBiMhSAFo/ssVHR0VAcD+mAE1FR4eFf5BQAJnHhUUHkD9mR4UFR4AAAAAAgBJAAACOwMMABcAGwAANxE0NjMhMhYVFAYrAREzMhYVFAYjISImNzMRI0kdFQGNFR4eFcbGFR4eFf5zFR1kMDAzAqcUHh4UFR79vh4UFR4eRwJCAAAAAAEASQAAAjsDDAAPAAATNDYzMhcBFhUUBiMiJwEmSR0VHQ8BjQceFR0P/nMGAtoUHhn9WQ4LFR4ZAqcMAAIASQAAAjsDDAAXABsAADc0NjsBESMiJjU0NjMhMhYVERQGIyEiJiUzESNJHRXGxhUdHRUBjRUeHhX+cxUdAV0wMDMUHgJCHhUUHh4U/VkVHh5HAkIAAAABAEgAfwI7AmIAFAAANxM2MzIXExYVFAYjIi8BBwYjIiY1SM0NIB4OyAUeFRsOnZ4OGxUdvgGJGxv+gAwJFR4V7OwVHhUAAAABAEn/mwI7AAAADQAAFzQ2MyEyFhUUBiMhIiZJHRUBjRUeHhX+cxUdMhQeHhQVHh4AAAAAAQB6AagCCQMMABAAABM0NjsBMhcTFhUUBiMiJwEmeh4VYxoOywYeFRAQ/tYSAtoUHhP++gsNFR4MAP8PAAAAAAIASQAAAjsCOAAmADQAADc1NDY7ATIXNC4FKwEiJjQ2OwEyFhcTFAYjIiY1BwYrASImNxQWOwE3NTQmKwEiBhVJWD3BGBQBAQMGCxEMuhUdHRW6PVcCDR8VFB1KCg+VPVhlHBSHax8SwRMdljg+WAcHIQ8cDRAGHSoeVTz+ixUdHhQrB1g+FB0/LBIdHRQAAAIASQAAAjsDDAApAEMAADcRNDYyFh0BNjsBMh4FFxYdARQOBA8BBisBIi4BJxUUBiImNxQfARY7ATI+ATc2PQE0LgEnJisBIg8BBhVJHSoeRENLDRgYDhgHGwE1BA4HGgURESk4Sx02HRceKh1lEVYMFEsOFh4CEg0fARUUSxQMVhEzAqcUHh4U4kADCwUTBRcBLkTOEBsaDxoGDw4kFhcVDxUeHsIXDkoMDB4BDhfODhQaARMMSgsaAAAAAQBJAAACOwI4ACYAADc1NDc+AzsBMhYUBisBIg8BBh0BFB8BFjsBMhYVFAYrASIvASZJNAszITof0xUeHhXTFAxWERFWDBTTFR4eFdM5KVY04HhFLQkxGxkeKh0MSgsaeBcPSQweFBUeJEotAAAAAAIASQAAAjsDDAAtAEgAADc1NDY3Njc2OwEyHgQXNTQ2MhYVERQGIiY9AQ4CKwEiLgcnJjcUHgIXFjsBMj8BNj0BNC8BJisBIg4BBwYVSSonBQMpOEsQHhMeCB8CHSoeHiodFx02HksLExMOEQoRBhMCNGUMDRgEDxFLEg5WEhJWDBRLDhcaBBK1zjA7IAQCJAcHFAYcAecUHh4U/VkVHh4VEBYXFgIGBQoGDgURAitHDBYMEwMMDEoNGHgVEEoMDRoDEBYAAAAAAgBJAAACOwI4ADQAQQAANzU0PgE3NjsBMh4GHwEWHQEUBiMhFRQeAhcWMyEyFhUUBiMhIi4HJyY3ITU0JisBIg4BBwYVSSAaHyk4fQoTFAwUBxQECws1HhX+pgwNGAQPEQEFFR4eFf77CxMTDhEKEQYTAjRlASg8Gn0OFh4CEbXOIzwYGiQCBgQMBBECCgouRHwVHh8MFgwTAwweFBUeAgYFCgYOBRECK8tKGjYMHgEOFwAAAQBhAAACIQMMACQAABI0NjsBNTQ2OwEyFhUUBisBIgYdATMyFhQGKwERFAYiJjURIyJhHRUxaEp5FR0dFXkgLWMUHh4UYx0qHjEVAfAqHiJKaB4UFR4tICIeKh3+YBUeHhUBoAAAAAACAEn/LAI7AjgAQgBZAAA3NTQ+CDc2OwEyHgQXNTQ2MhYVERQOBA8BBisBIiY0NjsBMj4BNzY9AQ4CKwEiLgMvASY3FBY7ATI/ATY9ATQvASYrASIOAQcGFUkDAwsEEAQVAxcBKThLEB4THggfAh0qHgQOBxoFEREpONMVHh4V0w4XHAMSFx42HUsPHxIeBxARNGQ7G0sUDFYSElYMFEsPFxgGEuCjCxYQFAoTBhIDEwEkBwcUBhwBEhUeHhX93BAbGg8aBg8OJB0qHg4aAw4XjRUYFwcGFQUPDi1FGzYMSg4XThUQSgwOGAQSFAAAAAABAEkAAAI6AwwAIAAANxE0NjIWHQE3NjsBMhYXExQGIyImNQMuASsBBxEUBiImSR0qHmAmKzk9VwIMHRUUHg0CGxRHox4qHTMCpxQeHhT3PRhVPP6MFR4dFAFzExxp/skVHh4AAgB6AAACCQM2ABoAKgAANzQ2OwERIyImNDY7ATIWFREzMhYVFAYjISImEzU0NjsBMhYdARQGKwEiJnoeFWNjFR4eFZUUHmIVHh4V/tcVHmMeFTIUHh4UMhUeMxQeAW4dKh4eFf5gHhQVHh4CvCoVHR0VKhUeHgAAAgB6/ywCCQM2AB8ALwAAFzQ2MzIeAjsBMjY1ESMiJjQ2OwEyFhURFAYrASImJxM1NDY7ATIWHQEUBisBIiZ6HhUUGAkZFWIUH5UVHh4VxhUeWT5iOFYI+B4VMRUeHhUxFR5NFR4bHxsdFAIRHSoeHhX9vT5YSjUDLyoVHR0VKhUeHgAAAQBJAAACOwMMAB8AADcRNDYyFhURJTYzMhYVFA8BFxYVFAYjIiclBxUUBiImSR0qHgEIDhIVHhLL/RIdFRMP/vcwHiodMwKnFB4eFP5x4QweFRcPrtgPFxUeDOMqkhUeHgAAAAEAegAAAgkDDAAbAAA3NDY7AREjIiY1NDY7ATIWFREzMhYVFAYjISImeh4VYmIVHh4VlRQeYhUeHhX+1xUeMxQeAkIeFRQeHhT9ix4UFR4eAAAAAAEAQQAAAkICOAAuAAA3ETQ2MzIWFzYzMhc3NjMyFhcTFAYjIiYnAyYrAQcRFAYjIiY1ETQrAQcRFAYiJkEdFRAbBSktPSQWISovSAEPHRUUHgEOAg8GRB4UFR4WCEseKh0zAdIVHhQPIzASG0Iv/m8VHh0UAY8TOv6aFR4eFQGKFkH+oRUeHgABAEkAAAI6AjgAIAAANxE0NjIWHQE3NjsBMhYXExQGIyImNQMuASsBBxEUBiImSR0qHmAmKzk9VwIMHRUUHg0CGxRHox4qHTMB0hUeHhUiPRhVPP6MFR4dFAFzExxp/skVHh4AAgBJAAACOwI4ACYAQAAANzU0PgE3NjsBMh4FFxYdARQOBA8BBisBIi4EJyY3FB4CFxY7ATI+ATc2PQE0JisBIg4BBwYVSSAaHyk4fQ0YGA4YBxsBNQQOBxoFEREpOH0QHRQbCxsENGUMDRgEDxF9DhYeAhI8Gn0OFh4CEbXOIzwYGiQDCwUTBRcBLkTOEBsaDxoGDw4kBwcSCBgDK0cMFgwTAwwMHgEOF84aNgweAQ4XAAAAAgBJ/ywCOwJNACwASgAAFxE0NjIWHQE+CDsBMh4BFx4EHQEUDwEGKwEiLgEnFRQGIiYTFB4CFx4CFxY7ATI/ATY9ATQvASYrASIPAQYVSR0qHgITBhIKEg8TFQsVHTcbGQIwDB0KNVYpORUfNyAVHiodZQoKFQMHGBQJDhUVFAxXERFXDBQVFQ5aDqICvRQeHhQbAhQFEQYNBQcCGBUXAikPJiYXoUQuSiQYHBfYFR0dAZIMFQsSAwcZFAgODEoNGKEYDUsMDlsLFwAAAgBJ/ywCOwI4AC0ASAAANzU0Njc2NzY7ATIeBBc1NDYyFhURFAYiJj0BDgIrASIuBycmNxQeAhcWOwEyPwE2PQE0LwEmKwEiDgEHBhVJKicFAyk4SxAeEx4IHwIdKh4eKh0XHTYeSwsTEw4RChEGEwI0ZQwNGAQPEUsSDlYSElYMFEsOFxoEErXOMDsgBAIkBwcUBhwBEhUeHhX9WRUdHRXlFhcWAgYFCgYOBRECK0cMFgwTAwwMSg0YeBUQSgwNGgMQFgAAAAABAEkAAAI7AjgAHwAANxE0NjIWHQE3NjsBMhYdARQGIiY9ATQmKwEHERQGIiZJHSoedwsSYz1ZHiodHRRRph4qHTMB0hUeHhU7ZghZPRwVHR0VHBQdj/7vFR4eAAEASQAAAjoCOAA0AAA3NDYzMhYXHgE7ATI2NTQnJS4BNTQ3NjsBMhcWFRQGIyImKwEiBhUUFwUeAR0BDgErASInJkkcFRImCQIUBMsYGx3+6yIqJSY11kswCh4VEi0T1g0PEAEWJjUBWj+9ST4TXRUdHQMBCSAWIg14D0MnMyQmPw0RFR4rEgsSBngRTS4CP1k1EAABAEkAAAI7AuIAKgAAEjQ2OwE1NDYyFh0BMzIWFAYrAREUFjsBMj4CMzIWHQEOASsBIiY1ESMiSR0VMR0qHsUVHR0VxRwUZBQZCRkUFR4KVTdkPVgxFQHwKh53FR4eFXceKh3+wxQdGx8bHhUINEtZPQE9AAEASQAAAjsCOAAgAAATNDYzMhYVEx4BOwE3ETQ2MhYVERQGIiY9AQcGKwEiJidJHRUUHg0CGxRHpB0qHh4qHWEmKzk8WAICBRUeHRT+jRQbaAE4FR4eFf4uFR4eFSM+GFU7AAABAEkAAAI7AjgAGgAAEzU0NjIWHQEbATU0NjIWHQEUBwMGKwEiJwMmSR0qHpOVHSoeBacNIT8hDacEAbBVFR4eFUr+rQFTShUeHhVVCgr+gh4eAX4IAAAAAQA+AAACRQI4ACsAABM0NjMyFhcTFzc1NDYzMhYdARc3Ez4BMhYdAQMHDgErASIvAQcGKwEiJi8BPh4VFB0BCiBCHhUUHkIgCgEdKB8LMwUbETEdDzc4Dx0xERsFNAIEFR8dFP7dbHJyFB4eFHJybAEjFB0eFAL+yqoQFBlfXxkUELYAAQBJAAACOwI4ACMAADc0PwEnJjU0NjMyHwE3NjMyFhUUDwEXFhUUBiMiLwEHBiMiJkkKraEMHhUXEJWUEBcVHgyhrQseFRgPn6APGBUdMxMN0MIPERUeE7OzEx4VEQ/C0A4SFR4SwcESHgAAAQBJ/ywCOwI4ACMAABY0NjsBNyMiJwMmPQE0NjIWHQETMxM1NDYyFh0BFAcBBisBIkkdFWdDFSIMlQQdKh6DIIQeKh4F/vwNIogVtyoemR8BUwgMVRUeHhVK/tQBLEoVHh4VVQoK/a4eAAAAAQBJAAACOwI4ABwAADc1NDcBISImNDYzITIWHQEUBwEhMhYVFAYjISImSQ8BYP7bFR0dFQF1FR4Q/qEBPBUeHhX+cxUdMyoXDQFSHSoeHhUqFRD+rx4UFR4eAAABAEkAAAI7AwwAKgAAEjQ2OwEyNj0BNDY7ATIWFRQGKwEVFAcWHQEzMhYVFAYrASImPQE0JisBIkkdFWEWHT0olBUeHhWUJyeUFR4eFZQoPR4VYRUBcSoeHRW8KTweFBUevDksLDm8HhQVHjwpvBQfAAAAAAIBDwAAAXQDDAAIABEAACURMxEUBiMiJhkBNDYzMhYVEQEPZR4UFR4eFRQeMwEh/t8VHh4BmwEhFB4eFP7fAAABAEkAAAI7AwwAKgAANzQ2OwE1NDcmPQEjIiY1NDY7ATIWHQEUFjsBMhYUBisBIgYdARQGKwEiJkkdFZQnJ5QVHR0VlCk8HRViFR4eFWIVHTwplBUdMxQevDksLDm8HhUUHjwpvBQeHiodHxS8KTweAAAAAAEASQGqAjsDCwAmAAATNTQ2MzIWHQEUFjI2PQE0NjIWHQEUBiMiJyY9ATQmIgYdARQGIiZJXTw6WB0oHR0qHlw9PCssHSgcHiodAgVvQVZYPzQUHx8UbxUeHhVvQVUrLj00FB4eFG8VHR0AAAEAcQAAAmMDDAATAAAzETQ2MhYdATMRIREUBiImPQEjEXEdKh5hASweKh1iATEVHh4VzAKn/s8VHh4VzP1ZAAABAHEAAAJjAwwAFQAANxEhETQ2MhYVERQGIiY1ESERFAYiJnEBjR0qHh4qHf7YHiodMwGGASEUHh4U/VkVHh4VASH+3xUeHgABAHEAAAJjAwwAGAAAExE0NjIWFREhETQ2MhYVESMRFAYjIiY1EXEdKh4BKB0qHsceFBUeAVQBhhQeHhT+3wEhFB4eFP56/t8VHh4VASEAAAEBN/+bAZwEUgADAAAFETMRATdlZQS3+0kAAAABAFf/5wJ8AyUAAwAAFxEhEVcCJRkDPvzCAAAAAQDtAAAB5gD6AA8AADc1NDY7ATIWHQEUBisBIibtHRWVFR0dFZUVHTOUFR4eFZQVHh4AAAEAcQAAAmMDDAAeAAATNDcBNjIfARYdARQHBRUUBiImPQE0NyU1JwUGIyImcREBKg8kD2MSEv7oHiodEQEZMf73DxIVHQHbGA4A/wwMVQ8XVRcQ7+cVHh4V/hkO7yYq4wweAAABAQMBqAHRAwwAEwAAATQ2OwEyFhUUBhUDFAYiJjU0NjUBAyAVYxQiATMfKCEBAtoUHhoSAQQB/wAUHhoSAQQBAAAAAAEA1AAAAf8BZAAUAAATNTQ2OwEyFh0BFAYrASImPQEjIibUHRXHFR0dFTIVHWMVHQEHKhUeHhX+FR4eFaEeAAABAHEBVAJjAbkACwAAEjQ2MyEyFhQGIyEicR0VAY0VHh4V/nMVAXEqHh4qHQAAAAAAAA4ArgABAAAAAAAAAFYArgABAAAAAAABAAQBDwABAAAAAAACAAcBJAABAAAAAAADACEBcAABAAAAAAAEAAUBngABAAAAAAAFAAoBugABAAAAAAAGAAQBzwADAAEECQAAAKwAAAADAAEECQABAAgBBQADAAEECQACAA4BFAADAAEECQADAEIBLAADAAEECQAEAAoBkgADAAEECQAFABQBpAADAAEECQAGAAgBxQBNAGEAdAB0AGgAZQB3ACAAUwBrAGEAbABhACAAKAAyADAAMQAxAC0AMQAyACkAOwAgAGIAYQBzAGUAZAAgAG8AbgAgAGMAbwBkAGUAIABiAHkAIABSAGkAYwBoAGEAcgBkACAAQgAuACAAVwBhAGwAZQBzACAAKAAxADkAOAA4AC0AOAA5ACkAIABhAG4AZAAgAFQAbwByACAATABpAGwAbABxAHYAaQBzAHQAAE1hdHRoZXcgU2thbGEgKDIwMTEtMTIpOyBiYXNlZCBvbiBjb2RlIGJ5IFJpY2hhcmQgQi4gV2FsZXMgKDE5ODgtODkpIGFuZCBUb3IgTGlsbHF2aXN0AABPAEMAUgBBAABPQ1JBAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAE8AQwBSACAAQQAgADoAIAAyADcALQA5AC0AMgAwADEAMgAARm9udEZvcmdlIDIuMCA6IE9DUiBBIDogMjctOS0yMDEyAABPAEMAUgAgAEEAAE9DUiBBAABWAGUAcgBzAGkAbwBuACAAMgAgAABWZXJzaW9uIDIgAABPAEMAUgBBAABPQ1JBAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAbAAAAAEAAgADAAQABQAGAAcACAAJALcACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCALYARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEBAgEDAQQBBQEGAQcBCAEJAQoBCwd1bmkyNDQwB3VuaTI0NDEHdW5pMjQ0MghTRjExMDAwMAtibGFja3NxdWFyZQpwZXJpb2QuYWx0DHF1ZXN0aW9uLmFsdA9xdW90ZXNpbmdsZS5hbHQJY29tbWEuYWx0Cmh5cGhlbi5hbHQAAAAB//8AAgABAAAADgAAABgAAAAAAAIAAQADAGsAAQAEAAAAAgAAAAEAAAAKAEQAogACREZMVAAObGF0bgAkAAQAAAAA//8ABgAAAAEAAgADAAQABQAEAAAAAP//AAYAAAABAAIAAwAEAAUABmFhbHQAJnNzMDEALHNzMDIAMnNzMDMAOHNzMDQAPnNzMDUARAAAAAEAAAAeAAEAAQAcAAEAAgAaAAEAAwAYAAEABAAWAAEABQAAAQAAAAEBAAABAgAAAQMAAAEEAAYADgAWAB4AJgAuADYAAwAAAAEAMAABAAAAAQBkAAEAAAABAGgAAQAAAAEAbAABAAAAAQBwAAEAAAABAHQAAQAuAAUAEAAWABwAIgAoAAIACgBpAAIADwBqAAIAEABrAAIAEQBnAAIAIgBoAAEABQAKAA8AEAARACIAAQAGAFYAAQABABEAAQAGAEYAAQABACIAAQAGAF8AAQABAAoAAQAGAFsAAQABAA8AAQAGAFsAAQABABAAAQAAAAoALAAuAAJERkxUAA5sYXRuABgABAAAAAD//wAAAAQAAAAA//8AAAAAAAAAAAABAAAAAMw9os8AAAAA1gbbzAAAAADaAyOv"),FontLib.loadFont("OCR-B",96,100,"AAEAAAAPAIAAAwBwRkZUTXxHn14AADmUAAAAHEdERUYAkwAEAAA4IAAAACBHUE9TuP+4/gAAOWQAAAAwR1NVQnZYZVQAADhAAAABJE9TLzJa+GPlAAABeAAAAGBjbWFwzJGg2QAAA2QAAAFCZ2FzcP//AAMAADgYAAAACGdseWbm+CwyAAAFeAAALwRoZWFkFgqHXQAAAPwAAAA2aGhlYQeFAeAAAAE0AAAAJGhtdHgIFCYVAAAB2AAAAYpsb2NhZAZYlAAABKgAAADObWF4cACtAGkAAAFYAAAAIG5hbWWukZg3AAA0fAAAAnlwb3N0tfQXywAANvgAAAEdAAEAAAACAADO4NltXw889QALA+gAAAAA2gMiKgAAAADaAyIqAA7/GQLWAwsAAAAIAAIAAAAAAAAAAQAABFL+sABaAtMAAP/9AtYAAQAAAAAAAAAAAAAAAAAAAF8AAQAAAGYAZgAFAAAAAAACAAAAAQABAAAAQAAAAAAAAAACAsMBkAAFAAACigK8AAAAjAKKArwAAAHgADEBAgAAAgAFCQAAAAAAAAAAAK8AAABoAAAAAAAAAABQZkVkAEAAIAB+AyD/OABaBFIBUAAAAAEAAAAAAiAC+QAAACAAAQLTAAAAAAAAAtMAAALTAAAC0wD1AtMAdALTAEQCvwA/Ar8APwLTAEQC0wDnAtMA0wLTAIgC0wBEAtMARALTAHIC0wBEAtMAxALTAIACvwA/AskAXgK/AFACvwA/Ar8APwK/AFkCvwA/Ar8APwK/AD8CvwA/AtMA1gLTAG8C0wBBAtMARALTAEEC0wBgAtMARAK/AEUCvwA/Ar8AbwK/AHICvwBtAr8AoAK/AEcCvwBbAr8AeAK/AFACvwBNAr8AWwK/AD8CvwBNAr8AQgK/AFsCvwBBAr8AZwK/AGECvwA/Ar8ATQK/AD4CvwA/Ar8AUwK/AFYCvwBbAtMApQLTAIAC0wBVAtMARALTAEQC0wC2Ar8ATQK/AEoCvwB1Ar8APwK/AE0CvwBhAr8AQgK/AGoCyQCDAskAZwK/AHsCyQDLAr8APwK/AE0CvwA/Ar8ASgK/AD8CvwCaAr8AZwK/AE0CvwBNAr8AQgK/AEECvwBhAr8APwK/AGEC0wBEAQwARABSAnICBgG2AA4AAAAAAAMAAAADAAAAHAABAAAAAAA8AAMAAQAAABwABAAgAAAABAAEAAEAAAB+//8AAAAg////4wABAAAAAAAAAQYAAAEAAAAAAAAAAQIAAAACAAAAAAAAAAAAAAAAAAAAAQAAAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALABiAMYBUAG6AkICYgKMArQC8gMaAzoDVgNwA5QEEgQ2BIgE2AUSBVYFngXSBjQGegaoBtwHDAcyB1oHxAhUCIQI2glACXgJrAnaCjQKYgqYCswLAgskC2QLlgvuDB4MgAzODUQNbA2eDcgOEg5ODoAOsg7WDvoPHA9ED2APgg/eECoQaBCyEPgRLBGUEdISAhJOEoASqBLyEygTVhOiE+gUIhSYFN4VGBVGFYYVvBXyFiAWbBaEFs4XDhcmF0QXaheCAAAAAgD1/7wBfQL9AA8AGwAAFzU0NjsBMhYdARQGKwEiJhMRNDYyFhURFAYiJvUbEi4SGxsSLhIbFxskGxomGhcuEhsbEi4SGxsBcgGHExobEv55EhsaAAAAAAIAdAHHAgkC/QASACMAABM1NDY7ATIXFhUwFQ8BDgEjIiYlNTQ2OwEyFxYdAQcOASMiJnQbEh0SDg4BHQIZEhEcASQbEhcRDg4ZBBYREhsB9NwSGw0MDwEC5BAXGxLcExoNDBAE5RAUGwAAAAIARP/4Ai4DAABEAEgAADc0NjsBNyMiJjQ2OwE3PgEzMhcWFQczNzYzMhYdAQcXHgEVFAYrAQczMhYUBisBBw4BIyImPQE3IwcOASMiJyY1NycuATczNyNEGhMVJicSGxoTOygDGRASDQ4liCgNHxIbIwUQFxsSFCUlExobEjopAxoPEhskhykDGRASDQ4mBRIXnoglh/4TGqcaJhqxDhUODhCosSMaEwqcAQMZERIbpxskG7YOFRsSCqK2DxQODRGsAQIaPqcAAwA///sCHwL9AEcAWABfAAA3JjU0NjMyFxYXFhczNScuAScuAjU0NzY/ATU0NjIWHQEXFhcxFhUUBiMiJyYvARUXFhcWFx4BFRQHBg8BFRQGIiY9ASMmJxMGFRQXFhcWFxYXHgIfATUTNzY1NC8BQQIbEhYVFwwYLQUEIS4cGyIWNjZSBBoiGgRpOAkbEhcOITUGBCwcHR8fHjc3UwQaIhoFlSi8YwMECAgFBgwMChwCB1YGZWQHoAUMExodIQYNBNwBChEPDyQ2IkwqKwoBCRMaGxIJAQ5SDA4SGhMsCwHFAQ4MDBYVPytNMDENAQYSGxoTBw1kAcoORQsKCggHBQUGBgUKAQKq/iABFEo8JAIAAAAABQA///gCHwMAAA0AHAAoADcARwAAJSIVFBcWHwEzMjc2NTQHJjU0NzYzMhcWFAcGIyIDIhUUFzsBMjc2NTQHJjU0NzYzMhcWFAcGIyICJjU0NwE2MzIWFRQHAQYjAaIhBQUOAQgRCQl6HyAfNzogICAgOjiuIxgBChEJB3wgISA6Nx8fHx83OycbBgGMDRQSGwb+exAYtTIPDxABAhAPEjKVKDg5KyspKXIqKQKuMikIEA8SMpUoODkrKykqcikp/hQbEw0JAq0MGxIMCv1dFwAAAAADAET/9wIuAwAAQgBOAFwAADc0PwEnJjU0NzYzMhcWFRQHDgEHDgIPARc3NjU0NjIWFRQPARcWFx4BFxYVFAYjIicmJyYnJicmJyYvAQcGKwEuATcUFzMyPwEnBwYHBhMUHwE3Njc2NTQnJiMiRF8EA0Q1NVhKNTQJChQYFxY+BASXBBUcJBs3AgICBwcHAwMbEgYFBgQDBAUCAQUGAQMEPlEGYnVafwYwKAShBRwPEBwwAwRMHiAcGyJozXJUAwRdVVQwMCgmRBsaGyMXGBMuAwPSCDRFExscEnxTAwIFCAgKCQgIEhsCAgEBBQUCAQcIAgICJwFyYnkCFwLhBB0bGwFXOEQEAzYlJx0eDgwAAAEA5wGIAY0C/QASAAATNDY7AR4BFTAVBwMGKwEiJyYn5xsSURAXARUIJCISDQ0BAtATGgIZDwEB/twlCwoRAAABANP/+AHpAwAAGQAAEzU2NzYzMhYVFAcGBwYHFRQXFhUUBiMiJybTA80LDhIbFE4sLQGoFBsSDgvQAXMG8I8IGhMXDjNKS20FvmsOGBMaB4wAAAABAIj/+AGfAwAAGAAANzQ3NjU0LwEmJyY1NDYzMhcWFRQHBiMiJogUqakBBwYGGxIOC9HRCw4SGyUYDm7AwnMBAgwMChIbCJDv7I4HGwAAAAEARACeAi4ChQAqAAATNDc2Mxc1NDYyFh0BNzE2MzIWFRQPARcWFRQGIyIvAQcGIyImNTQ/AScmRA4OEZsbJBuNBggSGyB6UAUaExQMV3AMFBMaCV6MHwG+Eg8OM54TGhsSni4DGxIgCymICwwTGguWlgsbEg0Ofy4MAAABAEQAagIuAo0AGwAAEjQ2OwE1NDYyFh0BMzIWFAYrARUUBiImPQEjIkQbEpsaJhqbEhsbEpsbJBubEgFpJhq3ExobErcbJBu4EhsaE7gAAAEAcv9NAeYAygASAAAXNDcTNjsBMhYdARQHAwYrASImcgWyDBVvEhsN/gwUHBMahgwKAS4MGhMfEwz++w0aAAABAEQBQQIuAbcADwAAEzU0NjMhMhYdARQGIyEiJkQaEwGQExoaE/5wExoBbhwTGhsSHBIbGgAAAAEAxP/7Aa0AtgAPAAA3NTQ2OwEyFh0BFAYrASImxBsSjxIbGxKPEhsoYRIbGhNhExobAAABAID/+AHyAwAAEwAANzQ3MwE+ATMyFhUUByMBDgEjIiaAAwEBGAQYDRIbAwH+6AQYDRIbJQoHAq4MEBsSCgf9UgwQGgAAAAACAD//+AIfAv8AJQBUAAAFIyYnLgEnJicmNTQ2Nz4BNz4CMzIeARceARceARUUDgUDFRQWFxYXHgE7ATI2Nz4BNz4BPQE0JicmJyYnJicmJyYnLgEjIg4CBw4BBw4BATMEOywsNA8QBQUDBgYVEhIySC4tSDITEhUGBgMEDRQmMEbFBQkIEBA4KBUcLA0OEgQFAwEBAQMDBQUICAsMDg8nGBknHhcICAoCAgMIARMSOy8vMC9AOVEvMEEhICYYGCYgIUIvL1I4KEFMOTYkFgGwUi1AJSUXGB8XFhUxHyA0Hy4fJRwdEBEXFw4ODw8ICQoLFB0SESkXFi8AAAABAF7/+wGMAv0AFQAAEiY1ND8BNjsBMhYVERQGIiY1EQcGI3gaDbcNECASGxskG4kNEQIJGxIVCp0LGxL9WBIbGhMCYXULAAABAFAABgILAwAANwAAEiY1NDc2MzIXFhUUBw4BBw4BBw4BBwYHBgcVITIWFAYjISImPQE0NzY3Njc2NzY1NCcmIyIHBiNrGxNbcVs9Pg0NISAgISMmIhgYCwsCASgTGhsS/qoSGwoRLy9EXhkcJSM0Wj4LDwJyGxEZDTw6OV0lIiMsGxsYFxkaGhkgHysFGyQbGxIVTiI8LzAuPyQkKDUhICwIAAEAP//4AhYC/AA3AAA3JjU0NjMyFxYzMjc2NzU0JyYnJiMiJjU0PwEhIiY0NjMhMhYdARQPARcWFxYdAQYHBiMiJyYnJlQVGxIGC0BGTDQ1BCAeLCs1ERoJuP7nEhsaEwFhEhsOoQhVNjUFUE5wHBwcIyMeEBgTGwQdJidKCjMkIw8OGxMSCswbJhobEiQQDrECFjs7WRBtQEADAwcIAAABAD//+wIfAv0AKAAANiY9ATQ3Ez4BMzIWFRQHAzM1NDYyFxYdATMyFhQGKwEVFAcGIiY9ASNaGwXVBBYMEhoFyMMaIg0OOhMaGxI6Dg0iGvWpGhMrCAsBzwsPGxIKCf5GeRIbDg0SeRskG4ESDQ4bEoEAAAIAWf/4AfcC/AAqAC0AABYmNDYzMjc2NTQnJiMiByMiJj0BEz4BMyEyFhQGKwEHMzIXFhUUBwYHBiMSIjN0GxsSyjsSIi1xHyAEEhsOAhkSARwTGhsS8ggTf01OFxgkYL4YAQEIGicacSIfSSU1AxkSAwD/EhgbJBydQUB+NS4vIVoBrQAAAAACAD//+AIfAv0AHwAvAAA3Jic1NDc2Nz4BNzYzMhYVFAcGDwE3NjMyFxYVFAcGIgMGFRQXFjMyNzY1NCcmIyKFQwNFHCgnNjILFBEaC3E1BwsdHm1BQkRE0AYoKilDQikrJyZJRzlBawx9ci80NT85DRsSEQ6ATQoCBkRFdGlCQgFkK0xEKCcoKENOKisAAAABAD//+wIfAvwAHwAAEiY0NjMhMhYVFAcGBwYHBhUUBiImNTQ3Njc2NzY/ASFaGxoTAYYTGjsSNDQWQRoiGkwXNDURGAkC/q8CoRsmGhsSTFkcQUIpeMETGxoU2o0pRUYaKBQHAAAAAAMAP//3Ah8DAAAVACQAQgAAEwYVFBYXHgEXOwE2NzY3PgE1NCcmIhMGFRQXFjsBMjc2NTQvAQMmNTQ/AScmNTQ3NjMyFxYVFAcGDwEXFhUUBgcjIuEmEhUUGxwCAhwODhQUEiYlUimXLSpAFDUmJ5ICrUWOBgZsQD9PTkBAHB0zBgaOdFIqZwKSFCYZJhAPEA4NCAgPECcZJhQU/s9PXjgfHyMjMF9OAv67Olx5YgQEQmtJLzAwMEg7KSghBARieU96BwACAD//+wIfAwAADwAtAAATBhUUFxYzMjc2NTQnJiMiAyY1NDc2MzIXFhUUBwYHBgcGIyImNDc2PwEHBiMixSwqKER3FQoqKUM/bURIRmJlRUYVFSZTeA0PERoOX0QFChogagJ1MENBKShJIShLLC3+tENlaEtLRkZyRzk5QpFvDBomDltuCgIEAAAAAAIA1v/7AZwCEAAPAB8AADc1NDY7ATIWHQEUBisBIiYRNTQ2OwEyFh0BFAYrASIm1hsSbBIbGxJsEhsbEmwSGxoTbBMaKFATGhsSUBIbGgF+UBMaGxJQEhsaAAAAAgBv/1IBswIQABIAIgAAFzQ/ATM2OwEyFhUUBwMGKwEiJhM1NDY7ATIWHQEUBisBIiZvA3wBCR9vEhsBzA4RKxIbexsSbBIbGhNsExqBDAf9GRsSDgP+9Q0aAidQExobElASGxoAAAABAEEARQIuArMAHQAAEy4BJyYnLgE1NDcBMDE2MzIWFRQHDQEWFRQGIyInTwEGAQECAQIOAZkLDhIbDf6hAV8NGxIOCwFcAQUBAgMECAcREAEPCBsSFwnq6g4SEhsIAAACAEQA3QIuAhsACwAXAAA2NDYzITIWFAYjISImNDYzITIWFAYjISJEGxIBkBIbGhP+cBMaGhMBkBMaGxL+cBL3JhobJBv+JhobJBsAAQBBAEUCLgKzABcAAAkBBiMiJjU0Ny0BJjU0NjMyFzAxARYVFAIg/mcLDhIbDQFf/qENGxIOCwGZDgFc/vEIGxISDurqCRcSGwj+8RAREgACAGD/vAH1AwEAOQBLAAATNTQ2NzYzMhcWHQEOAQcGBwYHBhUUBwYiJjU0NzY3Njc2NzY3NjU0JyMiJyYrAgYdARQHBiMiJyYTNTQ2OwEyFh0BFAcGKwEiJyZgPi8vNlA6OQEsHwcUFgkJDg0kGwoKCwwUFQgSEBFTAQUICgQDAW4NDRMSDQ2UGxIuEhsODRIuEg0OAjQMPFsVFTAwWAIxZCMIExQOCwsUDw8dFRoYFw4OFBUKEyIiG0IVAQIOUgkUDw4ODv3MMRUdHRUxFA8PDw8AAAIARP/yAi4DBABKAGUAADc1NDcyHwE3NjMyFxYVERY7ATY3Njc+AT0BNCYnLgEnJicmKwEGBw4BIyInJj0BNjc2NzMyFhcWFx4BHQEUBwYHBiMiLwEHBisBJjcUFxYXHgEXMzI3Njc9AiYnJiMiBwYHDgEVRIgvJwUCDhkSDQ4CHAETDQwEBQMDBQUXEBEbGyMJggsCGRETDQ0MPT9eCTpZGxsREQ0KCiMmNzYdAwQrPQiMWgEBBQQYEwYcEQ8NDRcXHBALCgMEAtIB7wIdAwUYDw8T/vk2AQwNFhUmHZgqPyYlNBcYDAwGVxIYDg8VB1ItLgMqIyM1NXBGfFsxMCInJgQDKAXWGw8QFBUVAREQHQGMARoTFAwMFhQiGAAAAAIARf/1AhoC9gAZABwAABYmPQETPgE7ATIWFxMUBwYjIiYvASMHDgEjEwMzYBufBBgOQg0XA6MODhIPGQMtyywDGQ+9T54LHRUOAp4OFREM/U0TDw8VD8PDDxUCov6qAAMAPwAGAh8C/QAhACsAOQAANiY1ETQ3NjsBMhcWFxYXHgEVFA8BFx4BHQEUBgcGBwYrARMVNzI9ASYnJiMDFRcyPQEmJyYnJicmI1obDQ0TpyQVFR4dFiwyOgQEIicnJCUvLz6nLXqyASspQZaWiAMODRgYGRkkBh0VApIWDw4BAgcIDRxiOVo4BAQeWDACMlkfHwsLAVr1AXwBPh0cATrVAWMLIRUWCwoDBAABAG//8gHwAwsARQAAEyYnNTQ2NzY3Njc2NzMyFxYXFRQHBiMiJyYnJicwMSYrAQYRFR4BFxYXFhceATMyNzY3PgEzMhcWHQEGBwYjIicmJyYnJnYGAQ0QERkYJyQvBTsuLQ0NDRITCQsICQsVHQWBAQQFBAoJDg4tHBwTFgQDGRASDQ0KLS09MiUoGBkREQD/NT8OQGw0MyUkFhYCJiY9ChQPDw0NFRYKEgf+6RIlOiMkGhoXFxoPDxoSFw8PFAo8JiYVFSQkMzMAAAACAHIABgIFAv4AFAAhAAA3JjURNDc2MzIXFhcWFRQHBgcGIyITJxE3Njc2NTQnJicmgA4NDRNmQ0M1RUhGayJLEkUGBmU5OyEgMysVDxUCkxQPDyssTmiFi19eFwcCkQH91AELQUB1UkFAKyQAAAAAAQBtAAYCEwL7ACIAADYmNRE0NzYzITIXFhQGIyEVMzIXFhQHBisBFSEyFxYUBiMhiBsNDRMBTBMNDRsS/uHvEg0ODQ0T7wEfEw0NGxL+tAYdFQKRFQ8ODg8qHdQPDykPDvUODyodAAABAKD/9QICAvoAHgAANyY1ETQ3NjMhMhcWFAYrARUzMhcWFAcGKwERFAcGIq4ODQ0TAQgTDQ0bEtuuEg0ODg0Srg4NJAQPFQKgFA8PDg8qHdQPDygPD/7KFQ8PAAEAR//xAg4DCAA+AAA3Jj0BNDc2NzYzMhcWFxYVFAYjIicmIyIHBgcGFRQXHgEzMj8BNSMiJyY0NjsBMhYVERQHDgEHDgEHBiMiJyZeFxcXLEZeExNYNwsbEhQOK0M+Kh8PEBwSTDUuMgNyEgwNGhGfEhsHCBIREhEQLC5sQivEV2MDYVNUME8DEEgOExQdETYxJD4+SWlYODoUAckODykdHRX+6Q4LDA4ICAYFDk0wAAAAAAEAW//1AgIDBAAdAAAWJjURNDc2MhYVETMRNDc2MhYVERQGIiY1ESMRFAZ2Gw4NJBvzDg0kGxskG/MbCx0VAqoVDw8dFv7lARsVDw8dFv1WFR0dFQEt/tMVHQAAAQB4AAYB5gL6ACMAADcmNDc2OwERIyInJjQ3NjsBMhcWFAcGKwERMzIXFhQHBiMhIoYODQ0TYEwSDQ4NDRPsEw0NDg0STGATDQ0ODRL+7BIVDykPDgIsDw8oDw8PDygPD/3UDg8pDw8AAAAAAQBQ//ABpQMHACMAADYmNTQzMhcWHQEGFRQXFjMyNzY1ETQ2MhYVERQXFBUUBiMiJ4Y2MBMMDQIcGiAeFRcbJBsBZ0EpJyBXN04ODxUKDAQpGhoYGS0CJBUdHRX95wMFBAJMchcAAAABAE3/9QIfAwcAHwAANyY1ETQ2MhYVEQE2MhYUBwMBFhUUBwYjIicBERQHBiJbDhskGwEUDiQbDvwBEw4ODRITDf7VDg0kBA8VAq0VHR0U/ucBOw8dKRD+3P6+ERIVDw8OAVv+yRQPDwAAAAABAFsACwIfAwcAEwAANyY1ETQ2MhYVESEyFxYUBwYjISJpDhskGwE9Ew0NDg0S/pYSGg8UApkUHR0U/ZkPDygPDwAAAAEAP//1Ah8DBAAoAAAWJjURNDY7ATIXFhcbAT4BOwEyFxYVERQGIiY1EQMGBwYjIiYnAxEUBlobGxJNDgwLBE1NAxgOTRINDhskG2wGCwoPDhcEbRsLHRUCqhYdCgsO/uUBGw4VDw8V/VYVHR0UAmv+cxAKChQPAY79lRQdAAAAAQBN//UCEQMIAB8AADcmNRE0NjsBMhYXExE0NjIWFREUBwYrASInAxEUBwYiWw4bEiUMFwXwGyQbDg0SJhwM7w4NJAQPFQKtFR0PDf3JAiMUHR0V/VMVDw8bAjf93xQPDwAAAAIAQv/yAhwDBwAeADkAADYmPQE0PgE3Njc2MzIXFhceAR0BFAYHBgcGIyInJicSBh0BFBYXFhcWMjc2Nz4BNTQmJyYnJiIHBgdkIhEmHRsoJy81LS4eHiEhHR4uLTY1LS4eLBESEREdHkgeHREREhERER0eSh8dEKuLRwM2bWcnJxcYIiE4OItJA0eLOjkjIyMjOQGdYSwELmItLx4fHx4vLWMtMWQtLR0dHh4vAAAAAgBb//UCHwL8ABUAHwAANyY1ETQ3NjsBMhcWFRQHBisBERQGIhMVMzI3NTQnJiNpDg0NE6hoQ0QmPYx7GyQ/e5AFKSdFBA8VAqEVDw85OWxRNVj+6BYdAqP1dAdEGxsAAgBB//UCHwMIACMAQwAANyY9ATQ3Njc2OwEyFxYXHgEVFA8BFxYVFAYjIi8BBwYjIicmEgYdARAzMj8BJyY1NDc2MzIfATc2NTQnJicmIyIHBgdfHh4ZMzFBCDYrKxsbHTACQwocEhYKOAQ1Oz03OTIMhSAeBGAKDQwRFwpRAxQPDyEiLiUbGw3DUYMDgk1BLy8fHzU1gUeMZAJfDxEUHg5SBC4uLwGzTS0D/tgZA4sPEBQPDw52CkFLRjs8KSkWFSUAAAIAZ//1AggC+AAkADEAABYmNRE0NzY7ARYXFhcWFxYHBgcGDwETFhUUBwYjIicDIxEUBwYTFTcyNzY3NjU0JyYjghsNDROfKiMkHx4REQEBICFCBYoFDg0SFgueWw4NG242GhoKCiUiOAsdFQKeFg8OAQoLFRUnJjRfOjobAv77ChEUDw8NAT7+6BUPDwKk9QIaGRwcLDAWFgAAAAEAYf/wAf0DBwBRAAA3Jic1NDYzMhYXFhcWMzI3NjU0JyYnLgEnLgInJicmJyYnJjU0NzY3MzIXFhcWFRQHBiInJicmJyYjIgcGFRQXFhcWFx4BFx4CFRQGBwYjIqU6ChsSERoCBiEfKTAlJAcHDg0WEw45IhoaDxAQDwgHPDxPBkcyNBECDQ0mCwwJCgobMC0jJBUTJBAjIyceHSEXZksSEkkiMk0IFB0YEi0YGCAcOxgUEw4OEQoIHxUQERARFxcdHCNSNTYCJydDCAQUDw4NDhUYChoZGSotGBgUCxITFxcWLUQpVXQOAwAAAQA///UCHwL4ABgAABMmNDc2MyEyFxYUBwYrAREUBwYiJjURIyJNDg0NEwGGEw0NDg0SmA0NIhqYEgKiDyoPDg8PKQ8P/ZQUDw8dFQJsAAABAE3/8gIRAwgAIAAANyY1ETQ2MhYVERQXFjMyNzY1ETQ2MhYVERQHBgcGIicmZRgbJBsyHzc+JCYbJBsYGCw1ojUscDY9AfMVHR0V/g1RJhcmJkEB8xUdHRX+Dj02NiAoKCAAAQA+//UCIAMGABgAADcDNDc2MzIWFxsBPgEzMhcWFQMOASsBIibjpQ4OEg8ZA5iXBhcPEg4OpwMYDkIOGhkCvBQODxUO/YACgA8UDw8T/UQPFRYAAQA///QCHwMFAC8AADcmAzU0NjIXFhcSHwE3NjsBMhcWHwE3NhM0NjMyFh0BAgMOAQcjIi8BBwYrASInJn4xDhskDQ0BCxgDPwsdEQ4LDAQ+AxkKHBIRHA4yAxkQBTQNPj8KIBsRDAwb9AHFAhQbDg8U/r+4GfUhCgsO6xjBATEUHR0TAv5G/wAOFgEw6/giCwsAAAEAU//1AgsDBgAlAAAWJj0BNDcTAyY1NDYzMhcbATYzMhcWFRQHAxMWFRQGIyInCwEGI24bBaCaBRsSFAyJgRMVEg0OBZqgBRsSFQ2NhxIWCx0VAQ8KAUYBMgwOFh0N/u0BBRsPDxUODP7O/roKDxUdDQEj/ukaAAEAVv/0AggC+QAeAAATJjU0NjMyFxsBMz4BMzIXFhUUBxUDERQGIiY1EQMwWwUbEhkPhIQBAxgMEg0OBakaIhqpArAIDxUdG/7rARULEA8PFA8IAf6l/tEUHR0UAS8BWwAAAAABAFsABgICAv4AHgAANyY1NDcBIyInJjQ3NjMhMhcWFRQHASEyFxYUBiMhImkOBQEL4BINDg0NEwEoEg0OBf73AQMTDQ0bEv6zEhUPFA4KAkkPDykPDw8QFA0K/bcPDyodAAAAAQCl//gCHQMAABUAADcRNDYzITIWFAYrAREzMhYUBiMhIialGxIBHhIbGhPx8RIbGxL+4hIbJQKuEhsbJBv9rBskGxsAAAAAAQCA//gB8gMAABQAABM0NjMyFhcBMDMWFRQGIyInATAjJoAbEgwZBAEYAQMbEh4L/ugBAwLTExoQDP1SBwoSGxwCrgcAAAAAAQBV//gBzQMAABUAADY0NjsBESMiJjQ2MyEyFhURFAYjISJVGxLx8RMaGxIBHhIbGxL+4hITJBsCVBskGxsS/VISGwABAEQBdAIuAvsAGAAAEzU0NxM2NzIXEzAxFhUUBiMiLwEHBiMiJkQHzg8QGAnNCBsSEw2pqAwTEhsBoQoOCwErCgEM/swLDhIbDbKyDRoAAAEARP8ZAi7/kAAPAAAXNDYzITIWHQEUBiMhIiY1RBsSAZASGxsS/nASG50TGhsSHRIbGhMAAAAAAQC2AgcBuQMAABIAAAEnJjU0PwE2MzIfAhYUBwYjIgFvqRALDw0XDgoDnwsLDRURAhGODRUQDRIQCQKmDh4NDwAAAAACAE3/7wH6AiAADQA/AAAlIhUUFxYXMzI/ATUjJgcmNTQ3Njc2NzY3PgE7AScmJyYjIgcGIyImNTQ3NjMyFxYVERQGIiY9AQcGIyIjJiMmAVixHRodCFZGAQUr7zQNDBkaHR0pKUQyBgEGGRo5PC4MEBMaEU9TWzU8GyQbCERPAgYFBD/3YCEVFQJ6ATAC1C9FKh8fExMMDQYGBAY/GRonCRoTFg06MjpY/sUSHBoTEwc9AQUAAAAAAgBK//ACHwMFAB4AMgAAFiY1ETQ2MhYdATc2MzIXHgEXFRQHBiMiJyYvARUUBjcVFhcWMzI3Nj0BJicmIyIHBg8BZRsbJBsIQkoYIE9fATo5aBEIRDsIGxsUKysxJSFAAiUlNxsdQCUBDRsTArcSGxoT+QY2CBV/XweBVVMBBzAGDhMa0gExJSUXLYgJQDIzDh9NAQAAAAABAHX/7gHwAhoAKgAANyY1NDc2MzIXFhcWFxUUBiMiJyYjIgcGFRQzMjc2Nz4BMzIWHQEGBwYjIuVwNTVjExQwIyMLGRMfDAw+JRg9bBIPMQsDGRASGg4yNDwwBz7NeElHAwYbGyoLExokIw0fgsoEDCsOFRsSCzckJQAAAgA///ECEwMFAB4AMQAANyY1NDc2NzYzMh8BNTQ2MhYVERQGIiYvAQcGIyInJhMGFRQXFjMyNzY3PQImJyYjImwtLy5RHBhKRggbJBsbJBoBAQc/TxocVUA/IiI9HB5MGRUpKTAoVEpvZkVEFwg1BvgSGxoT/UkUGhoRCgYxBhQBnCxuTzs8DiBQAYUBLyMjAAAAAAIATf/xAhECIAAkAC0AADcmNTQ3NjczMhcWFRQGIyEXFhcWMzI3Njc2MzIWFRQHBiMiJyYTByEnJicmIyJ2KT49ZgZoOjsbEv7EAQclJEMREh4UDBITGy0tPzMmTA8CAQQBCxwcPGNgSmhzTUwCR0dzEhwGSyssAwQVDRoTKxQVDRoBOgcGPBwdAAAAAQBh//MB/QMCACMAABImNDY7ATU0MzIWFAYjIgcGBwYdATMyFhQGKwETFAYiJjUDI3saGxJxzhIbGxIsICAJBHwSGxsSfAYaIhoFcQG7GyQbDt8bJBsPECINNw4bJBv+ZhIcGxMBmgACAEL/QgIGAhsANABJAAA3JjU0NzYzMhcWHwE3PgEzMhYVERUWHQEUBwYjIicmJyMmNTQ2MzIXFhcWMzI3Nj0BBwYjIhMGFRQXFjMyNjc2NzY/AT0BJicjIns5OjlmDwg/MgcBARsREhsBOzxhTjAwFQEDGxIUEBEKFkVbGAoIPlJfCCAfHjocMRISDAsPAStVDUJbR2t4S0sBBikGChEYGxP+UQEJDBdeNzcTEzEHCxMaFRgFCjgXLDsHNwF8L09CLC0UFBMQEBkCVgF3BgAAAQBq//MB9AMFACkAABYmNRE0NjIWHQE3NjMyFxYXFh0BFAYiJjURNCc0Jy4CIyIHBg8BERQGhRsbJBsIOUo4KioPChskGwEEBBAdFTEgHxoBGw0aFAK3ExobEvUHMSMjNyVb/RIcHBIBCxsRERUXGRMhHzMB/tQSHAAAAAIAg//zAZQDBQAQACAAABImNDY7ATIWFREUBiImNREjNiY9ATQ2OwEyFh0BFAYrAZ4bGhO0ExobJBuHeBsbEi0SGxsSLQGoGyQbGhP+SxMaGxIBiNUaEy4TGhoTLhMaAAIAZ/9JAZQDBAAPADQAAAAmPQE0NjsBMhYdARQGKwEDIj0BNDc2MzIXFjMyNzY3NjURIyImNDY7ATIWFREUBwYHBgcGASgbGxItEhsbEi10Xw4PFQQQEAoICD0UCmUSGxoTkhMaERMdHSciAnwaEy4TGhoTLhMa/M0uCREKCwECAQQtFkkBdBskGxsS/lJVJCUbGgYFAAAAAQB7//MCBQMFACEAABYmNRE0NjIWFREzNzM2MzIWFRQPARcWFRQGIyIvASMVFAaWGxskGwq7AQ0REhsOqssMGxIVC9kKGw0aFAK3ExobEv6Asg4cEhQNpOUOERIcDfTUEhsAAAEAy//5AfADBQAYAAA3JjUTNDYzMhYVAxQXFhcWMzIWFAYjIicm9CkGGhMSGwcQES8PQBIbGxJTMC48N28B9RMbGxP+Cj8iJAcCGyQbDQ4AAQA///MCHwIbADIAABYmNRE0NjMyHwE3NjMyHwE3NjMyFhURFAYiJjURJiMiBwYVERQGIiY1ESYjIgcGFREUBlobGxIXDgMEIig4JAMEKTQ2RxskGwIhHxUUGiIaAiAgFRQbDRsTAckTGxUEAxktBQUtTzX+ihIcGxMBbzEvLif+5BIcGxMBbzEwLib+5BIcAAAAAAEATf/zAhECGwAjAAAWJjURNDYyFh0BNzYzMhcWHQEUBiImNRE0JyYjIgcGBxURFAZoGxskGwhDWGUxMRskGxcXPzsoKBgbDRwSAckSGxoSFAc9Q0N3/RIcGxMA/08oKiopOwH+7xIcAAAAAAIAP//wAh8CIAAPABsAADcmNTQ3NjMyFxYVFAcGIyIDBhQXFjI3NjQnJiKAQUFAb2xCQkJBbW4BJycmkiYnJyeQPk96e09PT1B6eU9PAaA2pjU1NTWmNjYAAAAAAgBK/0gCHwIbABUAMwAANxcWMzI3NjU0JyYjIgciIzEGBwYHFQImNRE0NjIWHQE3NjMyFxYXFhUUBwYrASYvARUUBqQBPlQPFWohIUQDBAMDLyUlFUAaGyQbCD5LGSFWLS09PGkRRjoIGssBgAUdlVQ2NwEDJCMvAf4BGxICdRMbGhMLBzQIFkZHb3dNTQQxB7cTGgAAAAACAD//SAITAhsAHAAvAAA3JjU0NzYzMh8BNTQ2MhYVERQGIiY9AQcGIyInJhMGFRQXFjMyNzY3PQImJyYjIm0uryEZSz4IGyQbGiYaCD5OHBtTPT8jIzwZIEIjFygpMSNQRmvmLAg0BwsSGxsT/YsTGhsStgc0BxMBoCiBSzY4DR1VAX0BMiQlAAAAAAEAmv/zAg4CGwAnAAAWJjURNDYzMhYdATc2MzIWFxQGIiYnNCcjIicmIgcGKwEGBwYdARQGtRsbEhMaCDdPPE8BGyQaASMBAgQFBwcGAwE3ICIbDRwSAckSGxkTCwc0TTgTGxoSIggBAgIBCTg3QOUTGwAAAQBn//AB/QIgAFEAADcmNTQ2MzIXFhcWMzI3NjU0JyYnJicuAicuAScmJyYnJjU0NzY7ARYXFhcWFRQGIyImJyYnIyIHBgcGFRQXFhceARcWFxYXFhcWFRQHBgcjImwFGxITEhUJITIwIyYPDgwKFgs5GhkaGRISCQgHBzg4Uh02LC0MAhsSEBkDCEAZGxMUEhQ+Dx8gIhwdDxAREQcHOjxYCYVFCA8TGhUYBBESEyYTDg0EBQYDDwgJCQ8ODg8OFhUZTiUmAxsbLwkDEhsTDiIEAwIODxswEgQHCAsKCQwLEREWFx1SJygCAAABAE3/8wHjAqYAMQAAEiY0NjsBNzQ2MhYVBzMyFhQGKwEHFBUWFx4COwEyNzYzMhYVFAcGIyInJicmPQE3I2gbGxJSARkkGAKWEhsbEpcDAQMEDRsUAhAcGw0SGyMlNCofLxQUA1ABshslG2wUGRsSbBwkHO0aDQwTExENCgobEiAQEQwTLi9MDOsAAAEATf/wAhECGAAoAAA3Jj0BNDYzMhYdARQXFhczMjc2NzERNDYyFhURFAYiJj0BBwYrASYnJlcKGxESHBUVQwU7KCYVGyQbGyQbCEFYBEgwMYEmS/gSHBwS6lwrLQIsKz8BChMbHBL+NxIcGhMSBzsBJyYAAQBC//MCHAIYAB0AABMmNTQ2MzIXEzMTMDU+ATMyFhUUBzEDDgErASImJ0UDGxIfC5EKkQMZDhIbA54DGQ1GDhcEAdsGCRMbH/5eAaIBDBIcEgkG/jYMEhENAAABAEH/8wIeAhgAKAAANwM0NzYzMhYXEzc+ATsBMh8BEz4BMzIXFh0BAw4BKwEiLwEHBisBIiZ4Nw4OEhEZAiorAxcPLCAKKikDGRESDg44AhkRMCAJMTELHTERGhsBzxMNDhcR/qSWDRMglgFcEBgNDRAE/jEQGB+wryAYAAAAAAEAYf/zAf0CGAAjAAAWJjU0PwEnJjU0NjMyHwE3NjMyFhUUDwEXFhUUBiMiLwEHBiN8GwiMgQcbEhcJdXUNExIbB4KMCRsSGAmAgQwUDRwSDg3OxgwOExsMtbUMHBIODMbODg0SHAy/vwwAAAEAP/9JAh8CGAAjAAAWJjU0NjsBMj8BAyY1NDYzMhcbATYzMhYVFAcBMDEGBwYjIidTFBsSEBYHa78GGxITDaicDhQSGwX+zQ0dHSMNDrEZEBMaEMsBVAkNExsM/tcBKQwbEw0K/bccEhMDAAEAYQAEAgUCBwAcAAA2Jj0BNDcBIyImNDYzITIWHQEUBxUBITIWFAYjIXsaDAEU6hIbGhMBKhMaDf7zAQQSGxoT/rYEGxIjDw4BPBomGhoTKBEMAf7KGyQbAAAAAQBE//gCLgMAADQAABI0NjMyNzY9ATQ3Njc2MzIWFAYrASIHBgcGFRQPARcWFRQXFhcWMzIWFAYjIicmNTQnJiMiRBsSVhcRJiE0NmESGxoTIjUdHxEUMQUEMgcIGhd4EhsbEpAtVRYYUBMBaCYbGxQ9CmM1Lg0OGyQbBgYYGkl7JQMFMWE3Hh8RDhskGxsznzsXGAAAAAABAQz/ZAFmAwAACwAABRE0NjIWFREUBiImAQwbJBsaJhpvA0ITGhsS/L4SGxoAAAABAET/+AIuAwAAMwAANjQ2OwEyNzY3NjU0PwEnJjU0JyYnJiMiJjQ2MzIXFhcWFRQXFjsBMhYUBiMiBhUUBwYjIkQbEiE9HyIOCjIEBTENDScVYRMaGxJhNjQhJRIXUgQSGxsSUC9UK5ISEiYaCQkgGUhhMQUDJXs1HyELBxomGg4NLjNlRhUbHCQaLzufMxsAAAAAAQBSAhwCIALNACsAABM1Njc2MzIzFjMWFxYzMjc+ATMyFhUUBxUOASMiIyYjJicmIyIHMQ4BIyImUgonJzACBQQDLj4rICAIAxoPEhsCCkwwAgUEAy4+KiAgCQMZEBIbAlUKMB8fAQUvIicPFRsSAwUBMD8BBDAhJg8VGwAAAAABAnIB9QLWAq8ACwAAATU0NjIWHQEUBiImAnIeKB4eKB4CJ1YVHR4UVhQeHQAAAAABAgYB9QKgAq8ADwAAATQ2MzIfARYVFAYjIi8BJgIGHhQbCTwIHhQTET0HAn0VHQ5fDQ4UHg9eCwAAAAACAbYCVALWAwIACwAXAAABNTQ2MhYdARQGIiY3NTQ2MhYdARQGIiYBth4oHh0qHbweKB4dKh0ChkoVHR4UShQeHRVKFB4eFEoUHh4AAQAO/4cAcgK1AAsAABcRNDYyFhURFAYiJg4eKB4dKh1HAsoUHh4U/TYUHh4AAAAAAAAOAK4AAQAAAAAAAABDAIgAAQAAAAAAAQAEANYAAQAAAAAAAgAHAOsAAQAAAAAAAwApAUcAAQAAAAAABAANAY0AAQAAAAAABQAKAbEAAQAAAAAABgAEAcYAAwABBAkAAACGAAAAAwABBAkAAQAIAMwAAwABBAkAAgAOANsAAwABBAkAAwBSAPMAAwABBAkABAAaAXEAAwABBAkABQAUAZsAAwABBAkABgAIAbwATQBhAHQAdABoAGUAdwAgAFMAawBhAGwAYQAgACgAMgAwADEAMQApADsAIABiAGEAcwBlAGQAIABvAG4AIABjAG8AZABlACAAYgB5ACAATgBvAHIAYgBlAHIAdAAgAFMAYwBoAHcAYQByAHoAIAAoADEAOQA4ADYALAAgADIAMAAxADEAKQAATWF0dGhldyBTa2FsYSAoMjAxMSk7IGJhc2VkIG9uIGNvZGUgYnkgTm9yYmVydCBTY2h3YXJ6ICgxOTg2LCAyMDExKQAATwBDAFIAQgAAT0NSQgAAUgBlAGcAdQBsAGEAcgAAUmVndWxhcgAARgBvAG4AdABGAG8AcgBnAGUAIAAyAC4AMAAgADoAIABPAEMAUgAgAEIAIABSAGUAZwB1AGwAYQByACAAOgAgADIANwAtADkALQAyADAAMQAyAABGb250Rm9yZ2UgMi4wIDogT0NSIEIgUmVndWxhciA6IDI3LTktMjAxMgAATwBDAFIAIABCACAAUgBlAGcAdQBsAGEAcgAAT0NSIEIgUmVndWxhcgAAVgBlAHIAcwBpAG8AbgAgADIAIAAAVmVyc2lvbiAyIAAATwBDAFIAQgAAT0NSQgAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAAAAQACAAMABAAFAAYABwAIAAkAtwALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAtgBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQECAQMBBAEFD3F1b3Rlc2luZ2xlLmFsdAlncmF2ZS5hbHQMcXVvdGVkYmwuYWx0B2Jhci5hbHQAAAAAAAAB//8AAgABAAAADgAAABgAAAAAAAIAAQABAGUAAQAEAAAAAgAAAAEAAAAKAEAAjgACREZMVAAObGF0bgAiAAQAAAAA//8ABQAAAAEAAgADAAQABAAAAAD//wAFAAAAAQACAAMABAAFYWFsdAAgc3MwMQAmc3MwMgAsc3MwMwAyc3MwNAA4AAAAAQAAABgAAQABABYAAQACABQAAQADABIAAQAEAAABAAAAAQEAAAECAAABAwAFAAwAFAAcACQALAADAAAAAQAoAAEAAAABAFIAAQAAAAEAVgABAAAAAQBaAAEAAAABAF4AAQAmAAQADgAUABoAIAACAAUAZAACAAoAYgACAEMAYwACAF8AZQABAAQABQAKAEMAXwABAAYAIAABAAEAQwABAAYAXwABAAEABQABAAYAWAABAAEACgABAAYABgABAAEAXwABAAAACgAsAC4AAkRGTFQADmxhdG4AGAAEAAAAAP//AAAABAAAAAD//wAAAAAAAAAAAAEAAAAAzD2izwAAAADWBtqRAAAAANoDIf0=");const BwipJs={toCanvas:ToCanvas,toSVG:ToSVG,render:Render,raw:ToRaw,drawingCanvas:DrawingCanvas,drawingSVG:DrawingSVG,fixupOptions:FixupOptions,loadFont:LoadFont,FontLib,BWIPJS_VERSION,BWIPP_VERSION};let customBcid=["ean13","upca","upce","ean8"];function generateCanvas(tg){var ng;if(tg.barcolor&&(tg.barcolor.charAt(0)==="#"?tg.barcolor.length>7&&(tg.barcolor=tg.barcolor.substring(0,7)):tg.barcolor.length>6&&(tg.barcolor=tg.barcolor.substring(0,6))),tg.extra&&(tg.bcid.startsWith("aztec")&&(ng=tg.extra)!=null&&ng.version&&(tg.extra.layers=tg.extra.version),tg.extra.version&&tg.bcid==="micropdf417")){const og=tg.extra.version.split("x");og.length==2&&(tg.extra.version=og[1]+"x"+og[0])}const eg=document.createElement("canvas");tg.width&&tg.height&&(eg.width=tg.width,eg.height=tg.height);let gg=tg.extra||{};const ig={...tg,...gg,textcolor:""};return customBcid.includes(ig.bcid)&&(ig.textsize=1),BwipJs.toCanvas(eg,ig),eg}const mixMultCode={LPMixQrCode:[{label:"龙贝码",value:""},{label:"QR Code",value:""}]},OBJECT_NAME_MAP={text:"文本",textname:"名字",image:"图片",rect:"矩形",triangle:"三角形",table:"表格",circle:"圆形",line:"直线",barcode:"条码",barcode2d:"二维码",counter:"日期计数器",group:"组合"},canvasNameMap=new WeakMap,canvasNameResolvers=new WeakMap;function setObjectNameResolver(tg,eg){canvasNameResolvers.set(tg,eg)}function initCountObjsName(tg,eg){let gg=tg.filter(ig=>ig.id!=="workspace");deepTraverse(gg,ig=>{addObjName(eg,ig,"init")})}function deepTraverse(tg,eg){const gg=[...tg];let ig=gg.length;for(;gg.length>0;){const ng=gg.shift();let og=!1;ig>0&&(ig--,og=!0),ng.type==="group"?(eg&&eg(ng,og),gg.push(...ng.getObjects())):eg&&eg(ng,og)}}function addObjName(tg,eg,gg="add"){var ag;const ig=eg.type??"";let ng=canvasNameMap.get(tg);ng||(ng={},canvasNameMap.set(tg,ng));const og=(ng[ig]??0)+1;if(ng[ig]=og,gg==="add"){const Ig=OBJECT_NAME_MAP[ig],sg=((ag=canvasNameResolvers.get(tg))==null?void 0:ag(ig))??Ig;if(sg){const Cg=/[\u3400-\u9fff]/.test(sg)?"":" ";eg.name=`${sg}${Cg}${og}`}}}function refreshObjectCenterProperties(tg){tg.forEach(eg=>{const gg=eg;if(gg.id==="workspace")return;const ig=gg.getCenterPoint();if(gg.set({centerX:ig.x,centerY:ig.y}),gg.type==="group"){const ng=gg.getObjects();refreshObjectCenterProperties(ng)}})}const cloneCommonField=["id","name","locked","databaseSheet","databaseColumn","outsideInput","hasControls","hasBorders","fromJson","jsonFieldKey","databaseTid","increaseCount","fromBarCode","fromBarCode2d","fromBarCode2dID","increaseDate","barcodeDateFormatType","addCombObject","databaseMixConcat","rows","columns","tableTexts","tableCellStyles","tableCellBorders","tableCellSpans","columnWidths","rowHeights","fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType","centerX","centerY"];let targetDPI=203;const setTargetDpi=tg=>{targetDPI=tg||203},getTargetDpi=()=>targetDPI||203;function anyRgbToHex(tg){const eg=tg.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!eg)return tg;const gg=ig=>Math.min(255,Math.max(0,parseInt(ig))).toString(16).padStart(2,"0").toUpperCase();return`#${gg(eg[1])}${gg(eg[2])}${gg(eg[3])}`}function expandHexColor(tg){const eg=tg.startsWith("#")?tg.slice(1):tg;if(eg.length!==3)throw new Error("请输入一个有效的3位16进制颜色代码");return"#"+eg.split("").map(ig=>ig+ig).join("")}function addAlphaToHex(tg,eg){let gg=tg.replace("#","").toUpperCase();return typeof eg=="number"&&(gg=gg+Math.round(eg/100*255).toString(16).padStart(2,"0")),"#"+gg}function hexToHex6_blend(tg,eg="#FFFFFF"){if(!tg)return tg;let gg=tg.replace("#","").toUpperCase();if(gg.length===3&&(gg=gg.split("").map(cg=>cg+cg).join("")),gg.length===4&&(gg=gg.split("").map(cg=>cg+cg).join("")),gg.length===6)return`#${gg}`;if(gg.length!==8)return tg;const ig=parseInt(gg.slice(0,2),16),ng=parseInt(gg.slice(2,4),16),og=parseInt(gg.slice(4,6),16),ag=parseInt(gg.slice(6,8),16)/255,Ig=eg.replace("#",""),sg=parseInt(Ig.slice(0,2),16),Cg=parseInt(Ig.slice(2,4),16),lg=parseInt(Ig.slice(4,6),16),Ag=(cg,rg)=>Math.round(cg*ag+rg*(1-ag));return"#"+[Ag(ig,sg),Ag(ng,Cg),Ag(og,lg)].map(cg=>cg.toString(16).padStart(2,"0")).join("")}function rgbaStringToHex8(tg){const eg=tg.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!eg)return tg;const[,gg,ig,ng,og=1]=eg,ag=sg=>Number(sg).toString(16).padStart(2,"0"),Ig=Math.round(og*255);return`#${ag(gg)}${ag(ig)}${ag(ng)}${ag(Ig)}`}function splitLongWord(tg,eg,gg){const ig=[];let ng="";for(const og of eg){const ag=ng+og;tg.measureText(ag).width>gg?(ig.push(ng),ng=og):ng=ag}return ng&&ig.push(ng),ig}function wrapText(tg,eg,gg,ig){return ig&&(tg.font=ig),eg.split(`
930
- `).flatMap(ng=>{let og="";const ag=ng.split(/\s+/).filter(Ig=>Ig);return ag.reduce((Ig,sg,Cg)=>{const lg=og?`${og} ${sg}`:sg;return tg.measureText(lg).width<=gg?og=lg:(og&&Ig.push(og),og=sg,(Cg===ag.length-1||tg.measureText(sg).width>gg)&&(Ig.push(...splitLongWord(tg,sg,gg)),og="")),Cg===ag.length-1&&og&&Ig.push(og),Ig},[])})}function getLineHeight(tg){const eg=tg.font.match(/\d+/),gg=10;return eg?parseInt(eg[0],gg):gg}function generateThumbnail(tg,eg,gg){let{width:ig,height:ng}=tg;const og=Math.min(eg/ig,gg/ng);ig*=og,ng*=og;const ag=document.createElement("canvas"),Ig=ag.getContext("2d");if(!Ig)throw new Error("Canvas context not available");return ag.width=ig,ag.height=ng,Ig.drawImage(tg,0,0,ig,ng),ag.toDataURL("image/png",.85)}class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(eg){super(`Invalid DateTime: ${eg.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(eg){super(`Invalid Interval: ${eg.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(eg){super(`Invalid Duration: ${eg.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(eg){super(`Invalid unit ${eg}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const n="numeric",s="short",l="long",DATE_SHORT={year:n,month:n,day:n},DATE_MED={year:n,month:s,day:n},DATE_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s},DATE_FULL={year:n,month:l,day:n},DATE_HUGE={year:n,month:l,day:n,weekday:l},TIME_SIMPLE={hour:n,minute:n},TIME_WITH_SECONDS={hour:n,minute:n,second:n},TIME_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,timeZoneName:s},TIME_WITH_LONG_OFFSET={hour:n,minute:n,second:n,timeZoneName:l},TIME_24_SIMPLE={hour:n,minute:n,hourCycle:"h23"},TIME_24_WITH_SECONDS={hour:n,minute:n,second:n,hourCycle:"h23"},TIME_24_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:s},TIME_24_WITH_LONG_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:l},DATETIME_SHORT={year:n,month:n,day:n,hour:n,minute:n},DATETIME_SHORT_WITH_SECONDS={year:n,month:n,day:n,hour:n,minute:n,second:n},DATETIME_MED={year:n,month:s,day:n,hour:n,minute:n},DATETIME_MED_WITH_SECONDS={year:n,month:s,day:n,hour:n,minute:n,second:n},DATETIME_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s,hour:n,minute:n},DATETIME_FULL={year:n,month:l,day:n,hour:n,minute:n,timeZoneName:s},DATETIME_FULL_WITH_SECONDS={year:n,month:l,day:n,hour:n,minute:n,second:n,timeZoneName:s},DATETIME_HUGE={year:n,month:l,day:n,weekday:l,hour:n,minute:n,timeZoneName:l},DATETIME_HUGE_WITH_SECONDS={year:n,month:l,day:n,weekday:l,hour:n,minute:n,second:n,timeZoneName:l};class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(eg,gg){throw new ZoneIsAbstractError}formatOffset(eg,gg){throw new ZoneIsAbstractError}offset(eg){throw new ZoneIsAbstractError}equals(eg){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let singleton$1=null;class SystemZone extends Zone{static get instance(){return singleton$1===null&&(singleton$1=new SystemZone),singleton$1}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(eg,{format:gg,locale:ig}){return parseZoneInfo(eg,gg,ig)}formatOffset(eg,gg){return formatOffset(this.offset(eg),gg)}offset(eg){return-new Date(eg).getTimezoneOffset()}equals(eg){return eg.type==="system"}get isValid(){return!0}}const dtfCache=new Map;function makeDTF(tg){let eg=dtfCache.get(tg);return eg===void 0&&(eg=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:tg,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),dtfCache.set(tg,eg)),eg}const typeToPos={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(tg,eg){const gg=tg.format(eg).replace(/\u200E/g,""),ig=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(gg),[,ng,og,ag,Ig,sg,Cg,lg]=ig;return[ag,ng,og,Ig,sg,Cg,lg]}function partsOffset(tg,eg){const gg=tg.formatToParts(eg),ig=[];for(let ng=0;ng<gg.length;ng++){const{type:og,value:ag}=gg[ng],Ig=typeToPos[og];og==="era"?ig[Ig]=ag:isUndefined$1(Ig)||(ig[Ig]=parseInt(ag,10))}return ig}const ianaZoneCache=new Map;class IANAZone extends Zone{static create(eg){let gg=ianaZoneCache.get(eg);return gg===void 0&&ianaZoneCache.set(eg,gg=new IANAZone(eg)),gg}static resetCache(){ianaZoneCache.clear(),dtfCache.clear()}static isValidSpecifier(eg){return this.isValidZone(eg)}static isValidZone(eg){if(!eg)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:eg}).format(),!0}catch{return!1}}constructor(eg){super(),this.zoneName=eg,this.valid=IANAZone.isValidZone(eg)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(eg,{format:gg,locale:ig}){return parseZoneInfo(eg,gg,ig,this.name)}formatOffset(eg,gg){return formatOffset(this.offset(eg),gg)}offset(eg){if(!this.valid)return NaN;const gg=new Date(eg);if(isNaN(gg))return NaN;const ig=makeDTF(this.name);let[ng,og,ag,Ig,sg,Cg,lg]=ig.formatToParts?partsOffset(ig,gg):hackyOffset(ig,gg);Ig==="BC"&&(ng=-Math.abs(ng)+1);const cg=objToLocalTS({year:ng,month:og,day:ag,hour:sg===24?0:sg,minute:Cg,second:lg,millisecond:0});let rg=+gg;const ug=rg%1e3;return rg-=ug>=0?ug:1e3+ug,(cg-rg)/(60*1e3)}equals(eg){return eg.type==="iana"&&eg.name===this.name}get isValid(){return this.valid}}let intlLFCache={};function getCachedLF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlLFCache[gg];return ig||(ig=new Intl.ListFormat(tg,eg),intlLFCache[gg]=ig),ig}const intlDTCache=new Map;function getCachedDTF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlDTCache.get(gg);return ig===void 0&&(ig=new Intl.DateTimeFormat(tg,eg),intlDTCache.set(gg,ig)),ig}const intlNumCache=new Map;function getCachedINF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlNumCache.get(gg);return ig===void 0&&(ig=new Intl.NumberFormat(tg,eg),intlNumCache.set(gg,ig)),ig}const intlRelCache=new Map;function getCachedRTF(tg,eg={}){const{base:gg,...ig}=eg,ng=JSON.stringify([tg,ig]);let og=intlRelCache.get(ng);return og===void 0&&(og=new Intl.RelativeTimeFormat(tg,eg),intlRelCache.set(ng,og)),og}let sysLocaleCache=null;function systemLocale(){return sysLocaleCache||(sysLocaleCache=new Intl.DateTimeFormat().resolvedOptions().locale,sysLocaleCache)}const intlResolvedOptionsCache=new Map;function getCachedIntResolvedOptions(tg){let eg=intlResolvedOptionsCache.get(tg);return eg===void 0&&(eg=new Intl.DateTimeFormat(tg).resolvedOptions(),intlResolvedOptionsCache.set(tg,eg)),eg}const weekInfoCache=new Map;function getCachedWeekInfo(tg){let eg=weekInfoCache.get(tg);if(!eg){const gg=new Intl.Locale(tg);eg="getWeekInfo"in gg?gg.getWeekInfo():gg.weekInfo,"minimalDays"in eg||(eg={...fallbackWeekSettings,...eg}),weekInfoCache.set(tg,eg)}return eg}function parseLocaleString(tg){const eg=tg.indexOf("-x-");eg!==-1&&(tg=tg.substring(0,eg));const gg=tg.indexOf("-u-");if(gg===-1)return[tg];{let ig,ng;try{ig=getCachedDTF(tg).resolvedOptions(),ng=tg}catch{const sg=tg.substring(0,gg);ig=getCachedDTF(sg).resolvedOptions(),ng=sg}const{numberingSystem:og,calendar:ag}=ig;return[ng,og,ag]}}function intlConfigString(tg,eg,gg){return(gg||eg)&&(tg.includes("-u-")||(tg+="-u"),gg&&(tg+=`-ca-${gg}`),eg&&(tg+=`-nu-${eg}`)),tg}function mapMonths(tg){const eg=[];for(let gg=1;gg<=12;gg++){const ig=DateTime.utc(2009,gg,1);eg.push(tg(ig))}return eg}function mapWeekdays(tg){const eg=[];for(let gg=1;gg<=7;gg++){const ig=DateTime.utc(2016,11,13+gg);eg.push(tg(ig))}return eg}function listStuff(tg,eg,gg,ig){const ng=tg.listingMode();return ng==="error"?null:ng==="en"?gg(eg):ig(eg)}function supportsFastNumbers(tg){return tg.numberingSystem&&tg.numberingSystem!=="latn"?!1:tg.numberingSystem==="latn"||!tg.locale||tg.locale.startsWith("en")||getCachedIntResolvedOptions(tg.locale).numberingSystem==="latn"}class PolyNumberFormatter{constructor(eg,gg,ig){this.padTo=ig.padTo||0,this.floor=ig.floor||!1;const{padTo:ng,floor:og,...ag}=ig;if(!gg||Object.keys(ag).length>0){const Ig={useGrouping:!1,...ig};ig.padTo>0&&(Ig.minimumIntegerDigits=ig.padTo),this.inf=getCachedINF(eg,Ig)}}format(eg){if(this.inf){const gg=this.floor?Math.floor(eg):eg;return this.inf.format(gg)}else{const gg=this.floor?Math.floor(eg):roundTo(eg,3);return padStart(gg,this.padTo)}}}class PolyDateFormatter{constructor(eg,gg,ig){this.opts=ig,this.originalZone=void 0;let ng;if(this.opts.timeZone)this.dt=eg;else if(eg.zone.type==="fixed"){const ag=-1*(eg.offset/60),Ig=ag>=0?`Etc/GMT+${ag}`:`Etc/GMT${ag}`;eg.offset!==0&&IANAZone.create(Ig).valid?(ng=Ig,this.dt=eg):(ng="UTC",this.dt=eg.offset===0?eg:eg.setZone("UTC").plus({minutes:eg.offset}),this.originalZone=eg.zone)}else eg.zone.type==="system"?this.dt=eg:eg.zone.type==="iana"?(this.dt=eg,ng=eg.zone.name):(ng="UTC",this.dt=eg.setZone("UTC").plus({minutes:eg.offset}),this.originalZone=eg.zone);const og={...this.opts};og.timeZone=og.timeZone||ng,this.dtf=getCachedDTF(gg,og)}format(){return this.originalZone?this.formatToParts().map(({value:eg})=>eg).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const eg=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?eg.map(gg=>{if(gg.type==="timeZoneName"){const ig=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...gg,value:ig}}else return gg}):eg}resolvedOptions(){return this.dtf.resolvedOptions()}}class PolyRelFormatter{constructor(eg,gg,ig){this.opts={style:"long",...ig},!gg&&hasRelative()&&(this.rtf=getCachedRTF(eg,ig))}format(eg,gg){return this.rtf?this.rtf.format(eg,gg):formatRelativeTime(gg,eg,this.opts.numeric,this.opts.style!=="long")}formatToParts(eg,gg){return this.rtf?this.rtf.formatToParts(eg,gg):[]}}const fallbackWeekSettings={firstDay:1,minimalDays:4,weekend:[6,7]};class Locale{static fromOpts(eg){return Locale.create(eg.locale,eg.numberingSystem,eg.outputCalendar,eg.weekSettings,eg.defaultToEN)}static create(eg,gg,ig,ng,og=!1){const ag=eg||Settings.defaultLocale,Ig=ag||(og?"en-US":systemLocale()),sg=gg||Settings.defaultNumberingSystem,Cg=ig||Settings.defaultOutputCalendar,lg=validateWeekSettings(ng)||Settings.defaultWeekSettings;return new Locale(Ig,sg,Cg,lg,ag)}static resetCache(){sysLocaleCache=null,intlDTCache.clear(),intlNumCache.clear(),intlRelCache.clear(),intlResolvedOptionsCache.clear(),weekInfoCache.clear()}static fromObject({locale:eg,numberingSystem:gg,outputCalendar:ig,weekSettings:ng}={}){return Locale.create(eg,gg,ig,ng)}constructor(eg,gg,ig,ng,og){const[ag,Ig,sg]=parseLocaleString(eg);this.locale=ag,this.numberingSystem=gg||Ig||null,this.outputCalendar=ig||sg||null,this.weekSettings=ng,this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=og,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=supportsFastNumbers(this)),this.fastNumbersCached}listingMode(){const eg=this.isEnglish(),gg=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return eg&&gg?"en":"intl"}clone(eg){return!eg||Object.getOwnPropertyNames(eg).length===0?this:Locale.create(eg.locale||this.specifiedLocale,eg.numberingSystem||this.numberingSystem,eg.outputCalendar||this.outputCalendar,validateWeekSettings(eg.weekSettings)||this.weekSettings,eg.defaultToEN||!1)}redefaultToEN(eg={}){return this.clone({...eg,defaultToEN:!0})}redefaultToSystem(eg={}){return this.clone({...eg,defaultToEN:!1})}months(eg,gg=!1){return listStuff(this,eg,months,()=>{const ig=this.intl==="ja"||this.intl.startsWith("ja-");gg&=!ig;const ng=gg?{month:eg,day:"numeric"}:{month:eg},og=gg?"format":"standalone";if(!this.monthsCache[og][eg]){const ag=ig?Ig=>this.dtFormatter(Ig,ng).format():Ig=>this.extract(Ig,ng,"month");this.monthsCache[og][eg]=mapMonths(ag)}return this.monthsCache[og][eg]})}weekdays(eg,gg=!1){return listStuff(this,eg,weekdays,()=>{const ig=gg?{weekday:eg,year:"numeric",month:"long",day:"numeric"}:{weekday:eg},ng=gg?"format":"standalone";return this.weekdaysCache[ng][eg]||(this.weekdaysCache[ng][eg]=mapWeekdays(og=>this.extract(og,ig,"weekday"))),this.weekdaysCache[ng][eg]})}meridiems(){return listStuff(this,void 0,()=>meridiems,()=>{if(!this.meridiemCache){const eg={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(gg=>this.extract(gg,eg,"dayperiod"))}return this.meridiemCache})}eras(eg){return listStuff(this,eg,eras,()=>{const gg={era:eg};return this.eraCache[eg]||(this.eraCache[eg]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(ig=>this.extract(ig,gg,"era"))),this.eraCache[eg]})}extract(eg,gg,ig){const ng=this.dtFormatter(eg,gg),og=ng.formatToParts(),ag=og.find(Ig=>Ig.type.toLowerCase()===ig);return ag?ag.value:null}numberFormatter(eg={}){return new PolyNumberFormatter(this.intl,eg.forceSimple||this.fastNumbers,eg)}dtFormatter(eg,gg={}){return new PolyDateFormatter(eg,this.intl,gg)}relFormatter(eg={}){return new PolyRelFormatter(this.intl,this.isEnglish(),eg)}listFormatter(eg={}){return getCachedLF(this.intl,eg)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hasLocaleWeekInfo()?getCachedWeekInfo(this.locale):fallbackWeekSettings}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(eg){return this.locale===eg.locale&&this.numberingSystem===eg.numberingSystem&&this.outputCalendar===eg.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let singleton=null;class FixedOffsetZone extends Zone{static get utcInstance(){return singleton===null&&(singleton=new FixedOffsetZone(0)),singleton}static instance(eg){return eg===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(eg)}static parseSpecifier(eg){if(eg){const gg=eg.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(gg)return new FixedOffsetZone(signedOffset(gg[1],gg[2]))}return null}constructor(eg){super(),this.fixed=eg}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(eg,gg){return formatOffset(this.fixed,gg)}get isUniversal(){return!0}offset(){return this.fixed}equals(eg){return eg.type==="fixed"&&eg.fixed===this.fixed}get isValid(){return!0}}class InvalidZone extends Zone{constructor(eg){super(),this.zoneName=eg}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function normalizeZone(tg,eg){if(isUndefined$1(tg)||tg===null)return eg;if(tg instanceof Zone)return tg;if(isString$1(tg)){const gg=tg.toLowerCase();return gg==="default"?eg:gg==="local"||gg==="system"?SystemZone.instance:gg==="utc"||gg==="gmt"?FixedOffsetZone.utcInstance:FixedOffsetZone.parseSpecifier(gg)||IANAZone.create(tg)}else return isNumber$1(tg)?FixedOffsetZone.instance(tg):typeof tg=="object"&&"offset"in tg&&typeof tg.offset=="function"?tg:new InvalidZone(tg)}const numberingSystems={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(tg){let eg=parseInt(tg,10);if(isNaN(eg)){eg="";for(let gg=0;gg<tg.length;gg++){const ig=tg.charCodeAt(gg);if(tg[gg].search(numberingSystems.hanidec)!==-1)eg+=hanidecChars.indexOf(tg[gg]);else for(const ng in numberingSystemsUTF16){const[og,ag]=numberingSystemsUTF16[ng];ig>=og&&ig<=ag&&(eg+=ig-og)}}return parseInt(eg,10)}else return eg}const digitRegexCache=new Map;function resetDigitRegexCache(){digitRegexCache.clear()}function digitRegex({numberingSystem:tg},eg=""){const gg=tg||"latn";let ig=digitRegexCache.get(gg);ig===void 0&&(ig=new Map,digitRegexCache.set(gg,ig));let ng=ig.get(eg);return ng===void 0&&(ng=new RegExp(`${numberingSystems[gg]}${eg}`),ig.set(eg,ng)),ng}let now=()=>Date.now(),defaultZone="system",defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,twoDigitCutoffYear=60,throwOnInvalid,defaultWeekSettings=null;class Settings{static get now(){return now}static set now(eg){now=eg}static set defaultZone(eg){defaultZone=eg}static get defaultZone(){return normalizeZone(defaultZone,SystemZone.instance)}static get defaultLocale(){return defaultLocale}static set defaultLocale(eg){defaultLocale=eg}static get defaultNumberingSystem(){return defaultNumberingSystem}static set defaultNumberingSystem(eg){defaultNumberingSystem=eg}static get defaultOutputCalendar(){return defaultOutputCalendar}static set defaultOutputCalendar(eg){defaultOutputCalendar=eg}static get defaultWeekSettings(){return defaultWeekSettings}static set defaultWeekSettings(eg){defaultWeekSettings=validateWeekSettings(eg)}static get twoDigitCutoffYear(){return twoDigitCutoffYear}static set twoDigitCutoffYear(eg){twoDigitCutoffYear=eg%100}static get throwOnInvalid(){return throwOnInvalid}static set throwOnInvalid(eg){throwOnInvalid=eg}static resetCaches(){Locale.resetCache(),IANAZone.resetCache(),DateTime.resetCache(),resetDigitRegexCache()}}class Invalid{constructor(eg,gg){this.reason=eg,this.explanation=gg}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(tg,eg){return new Invalid("unit out of range",`you specified ${eg} (of type ${typeof eg}) as a ${tg}, which is invalid`)}function dayOfWeek(tg,eg,gg){const ig=new Date(Date.UTC(tg,eg-1,gg));tg<100&&tg>=0&&ig.setUTCFullYear(ig.getUTCFullYear()-1900);const ng=ig.getUTCDay();return ng===0?7:ng}function computeOrdinal(tg,eg,gg){return gg+(isLeapYear(tg)?leapLadder:nonLeapLadder)[eg-1]}function uncomputeOrdinal(tg,eg){const gg=isLeapYear(tg)?leapLadder:nonLeapLadder,ig=gg.findIndex(og=>og<eg),ng=eg-gg[ig];return{month:ig+1,day:ng}}function isoWeekdayToLocal(tg,eg){return(tg-eg+7)%7+1}function gregorianToWeek(tg,eg=4,gg=1){const{year:ig,month:ng,day:og}=tg,ag=computeOrdinal(ig,ng,og),Ig=isoWeekdayToLocal(dayOfWeek(ig,ng,og),gg);let sg=Math.floor((ag-Ig+14-eg)/7),Cg;return sg<1?(Cg=ig-1,sg=weeksInWeekYear(Cg,eg,gg)):sg>weeksInWeekYear(ig,eg,gg)?(Cg=ig+1,sg=1):Cg=ig,{weekYear:Cg,weekNumber:sg,weekday:Ig,...timeObject(tg)}}function weekToGregorian(tg,eg=4,gg=1){const{weekYear:ig,weekNumber:ng,weekday:og}=tg,ag=isoWeekdayToLocal(dayOfWeek(ig,1,eg),gg),Ig=daysInYear(ig);let sg=ng*7+og-ag-7+eg,Cg;sg<1?(Cg=ig-1,sg+=daysInYear(Cg)):sg>Ig?(Cg=ig+1,sg-=daysInYear(ig)):Cg=ig;const{month:lg,day:Ag}=uncomputeOrdinal(Cg,sg);return{year:Cg,month:lg,day:Ag,...timeObject(tg)}}function gregorianToOrdinal(tg){const{year:eg,month:gg,day:ig}=tg,ng=computeOrdinal(eg,gg,ig);return{year:eg,ordinal:ng,...timeObject(tg)}}function ordinalToGregorian(tg){const{year:eg,ordinal:gg}=tg,{month:ig,day:ng}=uncomputeOrdinal(eg,gg);return{year:eg,month:ig,day:ng,...timeObject(tg)}}function usesLocalWeekValues(tg,eg){if(!isUndefined$1(tg.localWeekday)||!isUndefined$1(tg.localWeekNumber)||!isUndefined$1(tg.localWeekYear)){if(!isUndefined$1(tg.weekday)||!isUndefined$1(tg.weekNumber)||!isUndefined$1(tg.weekYear))throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");return isUndefined$1(tg.localWeekday)||(tg.weekday=tg.localWeekday),isUndefined$1(tg.localWeekNumber)||(tg.weekNumber=tg.localWeekNumber),isUndefined$1(tg.localWeekYear)||(tg.weekYear=tg.localWeekYear),delete tg.localWeekday,delete tg.localWeekNumber,delete tg.localWeekYear,{minDaysInFirstWeek:eg.getMinDaysInFirstWeek(),startOfWeek:eg.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hasInvalidWeekData(tg,eg=4,gg=1){const ig=isInteger(tg.weekYear),ng=integerBetween(tg.weekNumber,1,weeksInWeekYear(tg.weekYear,eg,gg)),og=integerBetween(tg.weekday,1,7);return ig?ng?og?!1:unitOutOfRange("weekday",tg.weekday):unitOutOfRange("week",tg.weekNumber):unitOutOfRange("weekYear",tg.weekYear)}function hasInvalidOrdinalData(tg){const eg=isInteger(tg.year),gg=integerBetween(tg.ordinal,1,daysInYear(tg.year));return eg?gg?!1:unitOutOfRange("ordinal",tg.ordinal):unitOutOfRange("year",tg.year)}function hasInvalidGregorianData(tg){const eg=isInteger(tg.year),gg=integerBetween(tg.month,1,12),ig=integerBetween(tg.day,1,daysInMonth(tg.year,tg.month));return eg?gg?ig?!1:unitOutOfRange("day",tg.day):unitOutOfRange("month",tg.month):unitOutOfRange("year",tg.year)}function hasInvalidTimeData(tg){const{hour:eg,minute:gg,second:ig,millisecond:ng}=tg,og=integerBetween(eg,0,23)||eg===24&&gg===0&&ig===0&&ng===0,ag=integerBetween(gg,0,59),Ig=integerBetween(ig,0,59),sg=integerBetween(ng,0,999);return og?ag?Ig?sg?!1:unitOutOfRange("millisecond",ng):unitOutOfRange("second",ig):unitOutOfRange("minute",gg):unitOutOfRange("hour",eg)}function isUndefined$1(tg){return typeof tg>"u"}function isNumber$1(tg){return typeof tg=="number"}function isInteger(tg){return typeof tg=="number"&&tg%1===0}function isString$1(tg){return typeof tg=="string"}function isDate$1(tg){return Object.prototype.toString.call(tg)==="[object Date]"}function hasRelative(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hasLocaleWeekInfo(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function maybeArray(tg){return Array.isArray(tg)?tg:[tg]}function bestBy(tg,eg,gg){if(tg.length!==0)return tg.reduce((ig,ng)=>{const og=[eg(ng),ng];return ig&&gg(ig[0],og[0])===ig[0]?ig:og},null)[1]}function pick(tg,eg){return eg.reduce((gg,ig)=>(gg[ig]=tg[ig],gg),{})}function hasOwnProperty(tg,eg){return Object.prototype.hasOwnProperty.call(tg,eg)}function validateWeekSettings(tg){if(tg==null)return null;if(typeof tg!="object")throw new InvalidArgumentError("Week settings must be an object");if(!integerBetween(tg.firstDay,1,7)||!integerBetween(tg.minimalDays,1,7)||!Array.isArray(tg.weekend)||tg.weekend.some(eg=>!integerBetween(eg,1,7)))throw new InvalidArgumentError("Invalid week settings");return{firstDay:tg.firstDay,minimalDays:tg.minimalDays,weekend:Array.from(tg.weekend)}}function integerBetween(tg,eg,gg){return isInteger(tg)&&tg>=eg&&tg<=gg}function floorMod(tg,eg){return tg-eg*Math.floor(tg/eg)}function padStart(tg,eg=2){const gg=tg<0;let ig;return gg?ig="-"+(""+-tg).padStart(eg,"0"):ig=(""+tg).padStart(eg,"0"),ig}function parseInteger(tg){if(!(isUndefined$1(tg)||tg===null||tg===""))return parseInt(tg,10)}function parseFloating(tg){if(!(isUndefined$1(tg)||tg===null||tg===""))return parseFloat(tg)}function parseMillis(tg){if(!(isUndefined$1(tg)||tg===null||tg==="")){const eg=parseFloat("0."+tg)*1e3;return Math.floor(eg)}}function roundTo(tg,eg,gg="round"){const ig=10**eg;switch(gg){case"expand":return tg>0?Math.ceil(tg*ig)/ig:Math.floor(tg*ig)/ig;case"trunc":return Math.trunc(tg*ig)/ig;case"round":return Math.round(tg*ig)/ig;case"floor":return Math.floor(tg*ig)/ig;case"ceil":return Math.ceil(tg*ig)/ig;default:throw new RangeError(`Value rounding ${gg} is out of range`)}}function isLeapYear(tg){return tg%4===0&&(tg%100!==0||tg%400===0)}function daysInYear(tg){return isLeapYear(tg)?366:365}function daysInMonth(tg,eg){const gg=floorMod(eg-1,12)+1,ig=tg+(eg-gg)/12;return gg===2?isLeapYear(ig)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][gg-1]}function objToLocalTS(tg){let eg=Date.UTC(tg.year,tg.month-1,tg.day,tg.hour,tg.minute,tg.second,tg.millisecond);return tg.year<100&&tg.year>=0&&(eg=new Date(eg),eg.setUTCFullYear(tg.year,tg.month-1,tg.day)),+eg}function firstWeekOffset(tg,eg,gg){return-isoWeekdayToLocal(dayOfWeek(tg,1,eg),gg)+eg-1}function weeksInWeekYear(tg,eg=4,gg=1){const ig=firstWeekOffset(tg,eg,gg),ng=firstWeekOffset(tg+1,eg,gg);return(daysInYear(tg)-ig+ng)/7}function untruncateYear(tg){return tg>99?tg:tg>Settings.twoDigitCutoffYear?1900+tg:2e3+tg}function parseZoneInfo(tg,eg,gg,ig=null){const ng=new Date(tg),og={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};ig&&(og.timeZone=ig);const ag={timeZoneName:eg,...og},Ig=new Intl.DateTimeFormat(gg,ag).formatToParts(ng).find(sg=>sg.type.toLowerCase()==="timezonename");return Ig?Ig.value:null}function signedOffset(tg,eg){let gg=parseInt(tg,10);Number.isNaN(gg)&&(gg=0);const ig=parseInt(eg,10)||0,ng=gg<0||Object.is(gg,-0)?-ig:ig;return gg*60+ng}function asNumber(tg){const eg=Number(tg);if(typeof tg=="boolean"||tg===""||!Number.isFinite(eg))throw new InvalidArgumentError(`Invalid unit value ${tg}`);return eg}function normalizeObject(tg,eg){const gg={};for(const ig in tg)if(hasOwnProperty(tg,ig)){const ng=tg[ig];if(ng==null)continue;gg[eg(ig)]=asNumber(ng)}return gg}function formatOffset(tg,eg){const gg=Math.trunc(Math.abs(tg/60)),ig=Math.trunc(Math.abs(tg%60)),ng=tg>=0?"+":"-";switch(eg){case"short":return`${ng}${padStart(gg,2)}:${padStart(ig,2)}`;case"narrow":return`${ng}${gg}${ig>0?`:${ig}`:""}`;case"techie":return`${ng}${padStart(gg,2)}${padStart(ig,2)}`;default:throw new RangeError(`Value format ${eg} is out of range for property format`)}}function timeObject(tg){return pick(tg,["hour","minute","second","millisecond"])}const monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(tg){switch(tg){case"narrow":return[...monthsNarrow];case"short":return[...monthsShort];case"long":return[...monthsLong];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(tg){switch(tg){case"narrow":return[...weekdaysNarrow];case"short":return[...weekdaysShort];case"long":return[...weekdaysLong];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const meridiems=["AM","PM"],erasLong=["Before Christ","Anno Domini"],erasShort=["BC","AD"],erasNarrow=["B","A"];function eras(tg){switch(tg){case"narrow":return[...erasNarrow];case"short":return[...erasShort];case"long":return[...erasLong];default:return null}}function meridiemForDateTime(tg){return meridiems[tg.hour<12?0:1]}function weekdayForDateTime(tg,eg){return weekdays(eg)[tg.weekday-1]}function monthForDateTime(tg,eg){return months(eg)[tg.month-1]}function eraForDateTime(tg,eg){return eras(eg)[tg.year<0?0:1]}function formatRelativeTime(tg,eg,gg="always",ig=!1){const ng={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},og=["hours","minutes","seconds"].indexOf(tg)===-1;if(gg==="auto"&&og){const Ag=tg==="days";switch(eg){case 1:return Ag?"tomorrow":`next ${ng[tg][0]}`;case-1:return Ag?"yesterday":`last ${ng[tg][0]}`;case 0:return Ag?"today":`this ${ng[tg][0]}`}}const ag=Object.is(eg,-0)||eg<0,Ig=Math.abs(eg),sg=Ig===1,Cg=ng[tg],lg=ig?sg?Cg[1]:Cg[2]||Cg[1]:sg?ng[tg][0]:tg;return ag?`${Ig} ${lg} ago`:`in ${Ig} ${lg}`}function stringifyTokens(tg,eg){let gg="";for(const ig of tg)ig.literal?gg+=ig.val:gg+=eg(ig.val);return gg}const macroTokenToFormatOpts={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS};class Formatter{static create(eg,gg={}){return new Formatter(eg,gg)}static parseFormat(eg){let gg=null,ig="",ng=!1;const og=[];for(let ag=0;ag<eg.length;ag++){const Ig=eg.charAt(ag);Ig==="'"?((ig.length>0||ng)&&og.push({literal:ng||/^\s+$/.test(ig),val:ig===""?"'":ig}),gg=null,ig="",ng=!ng):ng||Ig===gg?ig+=Ig:(ig.length>0&&og.push({literal:/^\s+$/.test(ig),val:ig}),ig=Ig,gg=Ig)}return ig.length>0&&og.push({literal:ng||/^\s+$/.test(ig),val:ig}),og}static macroTokenToFormatOpts(eg){return macroTokenToFormatOpts[eg]}constructor(eg,gg){this.opts=gg,this.loc=eg,this.systemLoc=null}formatWithSystemDefault(eg,gg){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(eg,{...this.opts,...gg}).format()}dtFormatter(eg,gg={}){return this.loc.dtFormatter(eg,{...this.opts,...gg})}formatDateTime(eg,gg){return this.dtFormatter(eg,gg).format()}formatDateTimeParts(eg,gg){return this.dtFormatter(eg,gg).formatToParts()}formatInterval(eg,gg){return this.dtFormatter(eg.start,gg).dtf.formatRange(eg.start.toJSDate(),eg.end.toJSDate())}resolvedOptions(eg,gg){return this.dtFormatter(eg,gg).resolvedOptions()}num(eg,gg=0,ig=void 0){if(this.opts.forceSimple)return padStart(eg,gg);const ng={...this.opts};return gg>0&&(ng.padTo=gg),ig&&(ng.signDisplay=ig),this.loc.numberFormatter(ng).format(eg)}formatDateTimeFromString(eg,gg){const ig=this.loc.listingMode()==="en",ng=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",og=(rg,ug)=>this.loc.extract(eg,rg,ug),ag=rg=>eg.isOffsetFixed&&eg.offset===0&&rg.allowZ?"Z":eg.isValid?eg.zone.formatOffset(eg.ts,rg.format):"",Ig=()=>ig?meridiemForDateTime(eg):og({hour:"numeric",hourCycle:"h12"},"dayperiod"),sg=(rg,ug)=>ig?monthForDateTime(eg,rg):og(ug?{month:rg}:{month:rg,day:"numeric"},"month"),Cg=(rg,ug)=>ig?weekdayForDateTime(eg,rg):og(ug?{weekday:rg}:{weekday:rg,month:"long",day:"numeric"},"weekday"),lg=rg=>{const ug=Formatter.macroTokenToFormatOpts(rg);return ug?this.formatWithSystemDefault(eg,ug):rg},Ag=rg=>ig?eraForDateTime(eg,rg):og({era:rg},"era"),cg=rg=>{switch(rg){case"S":return this.num(eg.millisecond);case"u":case"SSS":return this.num(eg.millisecond,3);case"s":return this.num(eg.second);case"ss":return this.num(eg.second,2);case"uu":return this.num(Math.floor(eg.millisecond/10),2);case"uuu":return this.num(Math.floor(eg.millisecond/100));case"m":return this.num(eg.minute);case"mm":return this.num(eg.minute,2);case"h":return this.num(eg.hour%12===0?12:eg.hour%12);case"hh":return this.num(eg.hour%12===0?12:eg.hour%12,2);case"H":return this.num(eg.hour);case"HH":return this.num(eg.hour,2);case"Z":return ag({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ag({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ag({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return eg.zone.offsetName(eg.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return eg.zone.offsetName(eg.ts,{format:"long",locale:this.loc.locale});case"z":return eg.zoneName;case"a":return Ig();case"d":return ng?og({day:"numeric"},"day"):this.num(eg.day);case"dd":return ng?og({day:"2-digit"},"day"):this.num(eg.day,2);case"c":return this.num(eg.weekday);case"ccc":return Cg("short",!0);case"cccc":return Cg("long",!0);case"ccccc":return Cg("narrow",!0);case"E":return this.num(eg.weekday);case"EEE":return Cg("short",!1);case"EEEE":return Cg("long",!1);case"EEEEE":return Cg("narrow",!1);case"L":return ng?og({month:"numeric",day:"numeric"},"month"):this.num(eg.month);case"LL":return ng?og({month:"2-digit",day:"numeric"},"month"):this.num(eg.month,2);case"LLL":return sg("short",!0);case"LLLL":return sg("long",!0);case"LLLLL":return sg("narrow",!0);case"M":return ng?og({month:"numeric"},"month"):this.num(eg.month);case"MM":return ng?og({month:"2-digit"},"month"):this.num(eg.month,2);case"MMM":return sg("short",!1);case"MMMM":return sg("long",!1);case"MMMMM":return sg("narrow",!1);case"y":return ng?og({year:"numeric"},"year"):this.num(eg.year);case"yy":return ng?og({year:"2-digit"},"year"):this.num(eg.year.toString().slice(-2),2);case"yyyy":return ng?og({year:"numeric"},"year"):this.num(eg.year,4);case"yyyyyy":return ng?og({year:"numeric"},"year"):this.num(eg.year,6);case"G":return Ag("short");case"GG":return Ag("long");case"GGGGG":return Ag("narrow");case"kk":return this.num(eg.weekYear.toString().slice(-2),2);case"kkkk":return this.num(eg.weekYear,4);case"W":return this.num(eg.weekNumber);case"WW":return this.num(eg.weekNumber,2);case"n":return this.num(eg.localWeekNumber);case"nn":return this.num(eg.localWeekNumber,2);case"ii":return this.num(eg.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(eg.localWeekYear,4);case"o":return this.num(eg.ordinal);case"ooo":return this.num(eg.ordinal,3);case"q":return this.num(eg.quarter);case"qq":return this.num(eg.quarter,2);case"X":return this.num(Math.floor(eg.ts/1e3));case"x":return this.num(eg.ts);default:return lg(rg)}};return stringifyTokens(Formatter.parseFormat(gg),cg)}formatDurationFromString(eg,gg){const ig=this.opts.signMode==="negativeLargestOnly"?-1:1,ng=lg=>{switch(lg[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},og=(lg,Ag)=>cg=>{const rg=ng(cg);if(rg){const ug=Ag.isNegativeDuration&&rg!==Ag.largestUnit?ig:1;let dg;return this.opts.signMode==="negativeLargestOnly"&&rg!==Ag.largestUnit?dg="never":this.opts.signMode==="all"?dg="always":dg="auto",this.num(lg.get(rg)*ug,cg.length,dg)}else return cg},ag=Formatter.parseFormat(gg),Ig=ag.reduce((lg,{literal:Ag,val:cg})=>Ag?lg:lg.concat(cg),[]),sg=eg.shiftTo(...Ig.map(ng).filter(lg=>lg)),Cg={isNegativeDuration:sg<0,largestUnit:Object.keys(sg.values)[0]};return stringifyTokens(ag,og(sg,Cg))}}const ianaRegex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...tg){const eg=tg.reduce((gg,ig)=>gg+ig.source,"");return RegExp(`^${eg}$`)}function combineExtractors(...tg){return eg=>tg.reduce(([gg,ig,ng],og)=>{const[ag,Ig,sg]=og(eg,ng);return[{...gg,...ag},Ig||ig,sg]},[{},null,1]).slice(0,2)}function parse(tg,...eg){if(tg==null)return[null,null];for(const[gg,ig]of eg){const ng=gg.exec(tg);if(ng)return ig(ng)}return[null,null]}function simpleParse(...tg){return(eg,gg)=>{const ig={};let ng;for(ng=0;ng<tg.length;ng++)ig[tg[ng]]=parseInteger(eg[gg+ng]);return[ig,null,gg+ng]}}const offsetRegex=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,isoExtendedZone=`(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`,isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,isoTimeRegex=RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`),isoTimeExtensionRegex=RegExp(`(?:[Tt]${isoTimeRegex.source})?`),isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/,isoOrdinalRegex=/(\d{4})-?(\d{3})/,extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay"),extractISOOrdinalData=simpleParse("year","ordinal"),sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/,sqlTimeRegex=RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`),sqlTimeExtensionRegex=RegExp(`(?: ${sqlTimeRegex.source})?`);function int(tg,eg,gg){const ig=tg[eg];return isUndefined$1(ig)?gg:parseInteger(ig)}function extractISOYmd(tg,eg){return[{year:int(tg,eg),month:int(tg,eg+1,1),day:int(tg,eg+2,1)},null,eg+3]}function extractISOTime(tg,eg){return[{hours:int(tg,eg,0),minutes:int(tg,eg+1,0),seconds:int(tg,eg+2,0),milliseconds:parseMillis(tg[eg+3])},null,eg+4]}function extractISOOffset(tg,eg){const gg=!tg[eg]&&!tg[eg+1],ig=signedOffset(tg[eg+1],tg[eg+2]),ng=gg?null:FixedOffsetZone.instance(ig);return[{},ng,eg+3]}function extractIANAZone(tg,eg){const gg=tg[eg]?IANAZone.create(tg[eg]):null;return[{},gg,eg+1]}const isoTimeOnly=RegExp(`^T?${isoTimeBaseRegex.source}$`),isoDuration=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(tg){const[eg,gg,ig,ng,og,ag,Ig,sg,Cg]=tg,lg=eg[0]==="-",Ag=sg&&sg[0]==="-",cg=(rg,ug=!1)=>rg!==void 0&&(ug||rg&&lg)?-rg:rg;return[{years:cg(parseFloating(gg)),months:cg(parseFloating(ig)),weeks:cg(parseFloating(ng)),days:cg(parseFloating(og)),hours:cg(parseFloating(ag)),minutes:cg(parseFloating(Ig)),seconds:cg(parseFloating(sg),sg==="-0"),milliseconds:cg(parseMillis(Cg),Ag)}]}const obsOffsets={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(tg,eg,gg,ig,ng,og,ag){const Ig={year:eg.length===2?untruncateYear(parseInteger(eg)):parseInteger(eg),month:monthsShort.indexOf(gg)+1,day:parseInteger(ig),hour:parseInteger(ng),minute:parseInteger(og)};return ag&&(Ig.second=parseInteger(ag)),tg&&(Ig.weekday=tg.length>3?weekdaysLong.indexOf(tg)+1:weekdaysShort.indexOf(tg)+1),Ig}const rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(tg){const[,eg,gg,ig,ng,og,ag,Ig,sg,Cg,lg,Ag]=tg,cg=fromStrings(eg,ng,ig,gg,og,ag,Ig);let rg;return sg?rg=obsOffsets[sg]:Cg?rg=0:rg=signedOffset(lg,Ag),[cg,new FixedOffsetZone(rg)]}function preprocessRFC2822(tg){return tg.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(tg){const[,eg,gg,ig,ng,og,ag,Ig]=tg;return[fromStrings(eg,ng,ig,gg,og,ag,Ig),FixedOffsetZone.utcInstance]}function extractASCII(tg){const[,eg,gg,ig,ng,og,ag,Ig]=tg;return[fromStrings(eg,Ig,gg,ig,ng,og,ag),FixedOffsetZone.utcInstance]}const isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex),isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex),isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex),isoTimeCombinedRegex=combineRegexes(isoTimeRegex),extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset,extractIANAZone),extractISOOrdinalDateAndTime=combineExtractors(extractISOOrdinalData,extractISOTime,extractISOOffset,extractIANAZone),extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(tg){return parse(tg,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDateAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset])}function parseRFC2822Date(tg){return parse(preprocessRFC2822(tg),[rfc2822,extractRFC2822])}function parseHTTPDate(tg){return parse(tg,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII])}function parseISODuration(tg){return parse(tg,[isoDuration,extractISODuration])}const extractISOTimeOnly=combineExtractors(extractISOTime);function parseISOTimeOnly(tg){return parse(tg,[isoTimeOnly,extractISOTimeOnly])}const sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex),sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex),extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(tg){return parse(tg,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone])}const INVALID$2="Invalid Duration",lowOrderMatrix={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},casualMatrix={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...lowOrderMatrix},daysInYearAccurate=146097/400,daysInMonthAccurate=146097/4800,accurateMatrix={years:{quarters:4,months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:daysInYearAccurate*24,minutes:daysInYearAccurate*24*60,seconds:daysInYearAccurate*24*60*60,milliseconds:daysInYearAccurate*24*60*60*1e3},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:daysInYearAccurate*24/4,minutes:daysInYearAccurate*24*60/4,seconds:daysInYearAccurate*24*60*60/4,milliseconds:daysInYearAccurate*24*60*60*1e3/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:daysInMonthAccurate*24,minutes:daysInMonthAccurate*24*60,seconds:daysInMonthAccurate*24*60*60,milliseconds:daysInMonthAccurate*24*60*60*1e3},...lowOrderMatrix},orderedUnits$1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],reverseUnits=orderedUnits$1.slice(0).reverse();function clone$1(tg,eg,gg=!1){const ig={values:gg?eg.values:{...tg.values,...eg.values||{}},loc:tg.loc.clone(eg.loc),conversionAccuracy:eg.conversionAccuracy||tg.conversionAccuracy,matrix:eg.matrix||tg.matrix};return new Duration(ig)}function durationToMillis(tg,eg){let gg=eg.milliseconds??0;for(const ig of reverseUnits.slice(1))eg[ig]&&(gg+=eg[ig]*tg[ig].milliseconds);return gg}function normalizeValues(tg,eg){const gg=durationToMillis(tg,eg)<0?-1:1;orderedUnits$1.reduceRight((ig,ng)=>{if(isUndefined$1(eg[ng]))return ig;if(ig){const og=eg[ig]*gg,ag=tg[ng][ig],Ig=Math.floor(og/ag);eg[ng]+=Ig*gg,eg[ig]-=Ig*ag*gg}return ng},null),orderedUnits$1.reduce((ig,ng)=>{if(isUndefined$1(eg[ng]))return ig;if(ig){const og=eg[ig]%1;eg[ig]-=og,eg[ng]+=og*tg[ig][ng]}return ng},null)}function removeZeroes(tg){const eg={};for(const[gg,ig]of Object.entries(tg))ig!==0&&(eg[gg]=ig);return eg}class Duration{constructor(eg){const gg=eg.conversionAccuracy==="longterm"||!1;let ig=gg?accurateMatrix:casualMatrix;eg.matrix&&(ig=eg.matrix),this.values=eg.values,this.loc=eg.loc||Locale.create(),this.conversionAccuracy=gg?"longterm":"casual",this.invalid=eg.invalid||null,this.matrix=ig,this.isLuxonDuration=!0}static fromMillis(eg,gg){return Duration.fromObject({milliseconds:eg},gg)}static fromObject(eg,gg={}){if(eg==null||typeof eg!="object")throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${eg===null?"null":typeof eg}`);return new Duration({values:normalizeObject(eg,Duration.normalizeUnit),loc:Locale.fromObject(gg),conversionAccuracy:gg.conversionAccuracy,matrix:gg.matrix})}static fromDurationLike(eg){if(isNumber$1(eg))return Duration.fromMillis(eg);if(Duration.isDuration(eg))return eg;if(typeof eg=="object")return Duration.fromObject(eg);throw new InvalidArgumentError(`Unknown duration argument ${eg} of type ${typeof eg}`)}static fromISO(eg,gg){const[ig]=parseISODuration(eg);return ig?Duration.fromObject(ig,gg):Duration.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static fromISOTime(eg,gg){const[ig]=parseISOTimeOnly(eg);return ig?Duration.fromObject(ig,gg):Duration.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidDurationError(ig);return new Duration({invalid:ig})}static normalizeUnit(eg){const gg={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[eg&&eg.toLowerCase()];if(!gg)throw new InvalidUnitError(eg);return gg}static isDuration(eg){return eg&&eg.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(eg,gg={}){const ig={...gg,floor:gg.round!==!1&&gg.floor!==!1};return this.isValid?Formatter.create(this.loc,ig).formatDurationFromString(this,eg):INVALID$2}toHuman(eg={}){if(!this.isValid)return INVALID$2;const gg=eg.showZeros!==!1,ig=orderedUnits$1.map(ng=>{const og=this.values[ng];return isUndefined$1(og)||og===0&&!gg?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...eg,unit:ng.slice(0,-1)}).format(og)}).filter(ng=>ng);return this.loc.listFormatter({type:"conjunction",style:eg.listStyle||"narrow",...eg}).format(ig)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let eg="P";return this.years!==0&&(eg+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(eg+=this.months+this.quarters*3+"M"),this.weeks!==0&&(eg+=this.weeks+"W"),this.days!==0&&(eg+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(eg+="T"),this.hours!==0&&(eg+=this.hours+"H"),this.minutes!==0&&(eg+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(eg+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),eg==="P"&&(eg+="T0S"),eg}toISOTime(eg={}){if(!this.isValid)return null;const gg=this.toMillis();return gg<0||gg>=864e5?null:(eg={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...eg,includeOffset:!1},DateTime.fromMillis(gg,{zone:"UTC"}).toISOTime(eg))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?durationToMillis(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg),ig={};for(const ng of orderedUnits$1)(hasOwnProperty(gg.values,ng)||hasOwnProperty(this.values,ng))&&(ig[ng]=gg.get(ng)+this.get(ng));return clone$1(this,{values:ig},!0)}minus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg);return this.plus(gg.negate())}mapUnits(eg){if(!this.isValid)return this;const gg={};for(const ig of Object.keys(this.values))gg[ig]=asNumber(eg(this.values[ig],ig));return clone$1(this,{values:gg},!0)}get(eg){return this[Duration.normalizeUnit(eg)]}set(eg){if(!this.isValid)return this;const gg={...this.values,...normalizeObject(eg,Duration.normalizeUnit)};return clone$1(this,{values:gg})}reconfigure({locale:eg,numberingSystem:gg,conversionAccuracy:ig,matrix:ng}={}){const ag={loc:this.loc.clone({locale:eg,numberingSystem:gg}),matrix:ng,conversionAccuracy:ig};return clone$1(this,ag)}as(eg){return this.isValid?this.shiftTo(eg).get(eg):NaN}normalize(){if(!this.isValid)return this;const eg=this.toObject();return normalizeValues(this.matrix,eg),clone$1(this,{values:eg},!0)}rescale(){if(!this.isValid)return this;const eg=removeZeroes(this.normalize().shiftToAll().toObject());return clone$1(this,{values:eg},!0)}shiftTo(...eg){if(!this.isValid)return this;if(eg.length===0)return this;eg=eg.map(ag=>Duration.normalizeUnit(ag));const gg={},ig={},ng=this.toObject();let og;for(const ag of orderedUnits$1)if(eg.indexOf(ag)>=0){og=ag;let Ig=0;for(const Cg in ig)Ig+=this.matrix[Cg][ag]*ig[Cg],ig[Cg]=0;isNumber$1(ng[ag])&&(Ig+=ng[ag]);const sg=Math.trunc(Ig);gg[ag]=sg,ig[ag]=(Ig*1e3-sg*1e3)/1e3}else isNumber$1(ng[ag])&&(ig[ag]=ng[ag]);for(const ag in ig)ig[ag]!==0&&(gg[og]+=ag===og?ig[ag]:ig[ag]/this.matrix[og][ag]);return normalizeValues(this.matrix,gg),clone$1(this,{values:gg},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const eg={};for(const gg of Object.keys(this.values))eg[gg]=this.values[gg]===0?0:-this.values[gg];return clone$1(this,{values:eg},!0)}removeZeros(){if(!this.isValid)return this;const eg=removeZeroes(this.values);return clone$1(this,{values:eg},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(eg){if(!this.isValid||!eg.isValid||!this.loc.equals(eg.loc))return!1;function gg(ig,ng){return ig===void 0||ig===0?ng===void 0||ng===0:ig===ng}for(const ig of orderedUnits$1)if(!gg(this.values[ig],eg.values[ig]))return!1;return!0}}const INVALID$1="Invalid Interval";function validateStartEnd(tg,eg){return!tg||!tg.isValid?Interval.invalid("missing or invalid start"):!eg||!eg.isValid?Interval.invalid("missing or invalid end"):eg<tg?Interval.invalid("end before start",`The end of an interval must be after its start, but you had start=${tg.toISO()} and end=${eg.toISO()}`):null}class Interval{constructor(eg){this.s=eg.start,this.e=eg.end,this.invalid=eg.invalid||null,this.isLuxonInterval=!0}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidIntervalError(ig);return new Interval({invalid:ig})}static fromDateTimes(eg,gg){const ig=friendlyDateTime(eg),ng=friendlyDateTime(gg),og=validateStartEnd(ig,ng);return og??new Interval({start:ig,end:ng})}static after(eg,gg){const ig=Duration.fromDurationLike(gg),ng=friendlyDateTime(eg);return Interval.fromDateTimes(ng,ng.plus(ig))}static before(eg,gg){const ig=Duration.fromDurationLike(gg),ng=friendlyDateTime(eg);return Interval.fromDateTimes(ng.minus(ig),ng)}static fromISO(eg,gg){const[ig,ng]=(eg||"").split("/",2);if(ig&&ng){let og,ag;try{og=DateTime.fromISO(ig,gg),ag=og.isValid}catch{ag=!1}let Ig,sg;try{Ig=DateTime.fromISO(ng,gg),sg=Ig.isValid}catch{sg=!1}if(ag&&sg)return Interval.fromDateTimes(og,Ig);if(ag){const Cg=Duration.fromISO(ng,gg);if(Cg.isValid)return Interval.after(og,Cg)}else if(sg){const Cg=Duration.fromISO(ig,gg);if(Cg.isValid)return Interval.before(Ig,Cg)}}return Interval.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static isInterval(eg){return eg&&eg.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(eg="milliseconds"){return this.isValid?this.toDuration(eg).get(eg):NaN}count(eg="milliseconds",gg){if(!this.isValid)return NaN;const ig=this.start.startOf(eg,gg);let ng;return gg!=null&&gg.useLocaleWeeks?ng=this.end.reconfigure({locale:ig.locale}):ng=this.end,ng=ng.startOf(eg,gg),Math.floor(ng.diff(ig,eg).get(eg))+(ng.valueOf()!==this.end.valueOf())}hasSame(eg){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,eg):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(eg){return this.isValid?this.s>eg:!1}isBefore(eg){return this.isValid?this.e<=eg:!1}contains(eg){return this.isValid?this.s<=eg&&this.e>eg:!1}set({start:eg,end:gg}={}){return this.isValid?Interval.fromDateTimes(eg||this.s,gg||this.e):this}splitAt(...eg){if(!this.isValid)return[];const gg=eg.map(friendlyDateTime).filter(ag=>this.contains(ag)).sort((ag,Ig)=>ag.toMillis()-Ig.toMillis()),ig=[];let{s:ng}=this,og=0;for(;ng<this.e;){const ag=gg[og]||this.e,Ig=+ag>+this.e?this.e:ag;ig.push(Interval.fromDateTimes(ng,Ig)),ng=Ig,og+=1}return ig}splitBy(eg){const gg=Duration.fromDurationLike(eg);if(!this.isValid||!gg.isValid||gg.as("milliseconds")===0)return[];let{s:ig}=this,ng=1,og;const ag=[];for(;ig<this.e;){const Ig=this.start.plus(gg.mapUnits(sg=>sg*ng));og=+Ig>+this.e?this.e:Ig,ag.push(Interval.fromDateTimes(ig,og)),ig=og,ng+=1}return ag}divideEqually(eg){return this.isValid?this.splitBy(this.length()/eg).slice(0,eg):[]}overlaps(eg){return this.e>eg.s&&this.s<eg.e}abutsStart(eg){return this.isValid?+this.e==+eg.s:!1}abutsEnd(eg){return this.isValid?+eg.e==+this.s:!1}engulfs(eg){return this.isValid?this.s<=eg.s&&this.e>=eg.e:!1}equals(eg){return!this.isValid||!eg.isValid?!1:this.s.equals(eg.s)&&this.e.equals(eg.e)}intersection(eg){if(!this.isValid)return this;const gg=this.s>eg.s?this.s:eg.s,ig=this.e<eg.e?this.e:eg.e;return gg>=ig?null:Interval.fromDateTimes(gg,ig)}union(eg){if(!this.isValid)return this;const gg=this.s<eg.s?this.s:eg.s,ig=this.e>eg.e?this.e:eg.e;return Interval.fromDateTimes(gg,ig)}static merge(eg){const[gg,ig]=eg.sort((ng,og)=>ng.s-og.s).reduce(([ng,og],ag)=>og?og.overlaps(ag)||og.abutsStart(ag)?[ng,og.union(ag)]:[ng.concat([og]),ag]:[ng,ag],[[],null]);return ig&&gg.push(ig),gg}static xor(eg){let gg=null,ig=0;const ng=[],og=eg.map(sg=>[{time:sg.s,type:"s"},{time:sg.e,type:"e"}]),ag=Array.prototype.concat(...og),Ig=ag.sort((sg,Cg)=>sg.time-Cg.time);for(const sg of Ig)ig+=sg.type==="s"?1:-1,ig===1?gg=sg.time:(gg&&+gg!=+sg.time&&ng.push(Interval.fromDateTimes(gg,sg.time)),gg=null);return Interval.merge(ng)}difference(...eg){return Interval.xor([this].concat(eg)).map(gg=>this.intersection(gg)).filter(gg=>gg&&!gg.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:INVALID$1}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(eg=DATE_SHORT,gg={}){return this.isValid?Formatter.create(this.s.loc.clone(gg),eg).formatInterval(this):INVALID$1}toISO(eg){return this.isValid?`${this.s.toISO(eg)}/${this.e.toISO(eg)}`:INVALID$1}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:INVALID$1}toISOTime(eg){return this.isValid?`${this.s.toISOTime(eg)}/${this.e.toISOTime(eg)}`:INVALID$1}toFormat(eg,{separator:gg=" – "}={}){return this.isValid?`${this.s.toFormat(eg)}${gg}${this.e.toFormat(eg)}`:INVALID$1}toDuration(eg,gg){return this.isValid?this.e.diff(this.s,eg,gg):Duration.invalid(this.invalidReason)}mapEndpoints(eg){return Interval.fromDateTimes(eg(this.s),eg(this.e))}}class Info{static hasDST(eg=Settings.defaultZone){const gg=DateTime.now().setZone(eg).set({month:12});return!eg.isUniversal&&gg.offset!==gg.set({month:6}).offset}static isValidIANAZone(eg){return IANAZone.isValidZone(eg)}static normalizeZone(eg){return normalizeZone(eg,Settings.defaultZone)}static getStartOfWeek({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getWeekendDays().slice()}static months(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null,outputCalendar:og="gregory"}={}){return(ng||Locale.create(gg,ig,og)).months(eg)}static monthsFormat(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null,outputCalendar:og="gregory"}={}){return(ng||Locale.create(gg,ig,og)).months(eg,!0)}static weekdays(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null}={}){return(ng||Locale.create(gg,ig,null)).weekdays(eg)}static weekdaysFormat(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null}={}){return(ng||Locale.create(gg,ig,null)).weekdays(eg,!0)}static meridiems({locale:eg=null}={}){return Locale.create(eg).meridiems()}static eras(eg="short",{locale:gg=null}={}){return Locale.create(gg,null,"gregory").eras(eg)}static features(){return{relative:hasRelative(),localeWeek:hasLocaleWeekInfo()}}}function dayDiff(tg,eg){const gg=ng=>ng.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),ig=gg(eg)-gg(tg);return Math.floor(Duration.fromMillis(ig).as("days"))}function highOrderDiffs(tg,eg,gg){const ig=[["years",(sg,Cg)=>Cg.year-sg.year],["quarters",(sg,Cg)=>Cg.quarter-sg.quarter+(Cg.year-sg.year)*4],["months",(sg,Cg)=>Cg.month-sg.month+(Cg.year-sg.year)*12],["weeks",(sg,Cg)=>{const lg=dayDiff(sg,Cg);return(lg-lg%7)/7}],["days",dayDiff]],ng={},og=tg;let ag,Ig;for(const[sg,Cg]of ig)gg.indexOf(sg)>=0&&(ag=sg,ng[sg]=Cg(tg,eg),Ig=og.plus(ng),Ig>eg?(ng[sg]--,tg=og.plus(ng),tg>eg&&(Ig=tg,ng[sg]--,tg=og.plus(ng))):tg=Ig);return[tg,ng,Ig,ag]}function diff(tg,eg,gg,ig){let[ng,og,ag,Ig]=highOrderDiffs(tg,eg,gg);const sg=eg-ng,Cg=gg.filter(Ag=>["hours","minutes","seconds","milliseconds"].indexOf(Ag)>=0);Cg.length===0&&(ag<eg&&(ag=ng.plus({[Ig]:1})),ag!==ng&&(og[Ig]=(og[Ig]||0)+sg/(ag-ng)));const lg=Duration.fromObject(og,ig);return Cg.length>0?Duration.fromMillis(sg,ig).shiftTo(...Cg).plus(lg):lg}const MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(tg,eg=gg=>gg){return{regex:tg,deser:([gg])=>eg(parseDigits(gg))}}const NBSP=" ",spaceOrNBSP=`[ ${NBSP}]`,spaceOrNBSPRegExp=new RegExp(spaceOrNBSP,"g");function fixListRegex(tg){return tg.replace(/\./g,"\\.?").replace(spaceOrNBSPRegExp,spaceOrNBSP)}function stripInsensitivities(tg){return tg.replace(/\./g,"").replace(spaceOrNBSPRegExp," ").toLowerCase()}function oneOf(tg,eg){return tg===null?null:{regex:RegExp(tg.map(fixListRegex).join("|")),deser:([gg])=>tg.findIndex(ig=>stripInsensitivities(gg)===stripInsensitivities(ig))+eg}}function offset(tg,eg){return{regex:tg,deser:([,gg,ig])=>signedOffset(gg,ig),groups:eg}}function simple(tg){return{regex:tg,deser:([eg])=>eg}}function escapeToken(tg){return tg.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function unitForToken(tg,eg){const gg=digitRegex(eg),ig=digitRegex(eg,"{2}"),ng=digitRegex(eg,"{3}"),og=digitRegex(eg,"{4}"),ag=digitRegex(eg,"{6}"),Ig=digitRegex(eg,"{1,2}"),sg=digitRegex(eg,"{1,3}"),Cg=digitRegex(eg,"{1,6}"),lg=digitRegex(eg,"{1,9}"),Ag=digitRegex(eg,"{2,4}"),cg=digitRegex(eg,"{4,6}"),rg=bg=>({regex:RegExp(escapeToken(bg.val)),deser:([mg])=>mg,literal:!0}),dg=(bg=>{if(tg.literal)return rg(bg);switch(bg.val){case"G":return oneOf(eg.eras("short"),0);case"GG":return oneOf(eg.eras("long"),0);case"y":return intUnit(Cg);case"yy":return intUnit(Ag,untruncateYear);case"yyyy":return intUnit(og);case"yyyyy":return intUnit(cg);case"yyyyyy":return intUnit(ag);case"M":return intUnit(Ig);case"MM":return intUnit(ig);case"MMM":return oneOf(eg.months("short",!0),1);case"MMMM":return oneOf(eg.months("long",!0),1);case"L":return intUnit(Ig);case"LL":return intUnit(ig);case"LLL":return oneOf(eg.months("short",!1),1);case"LLLL":return oneOf(eg.months("long",!1),1);case"d":return intUnit(Ig);case"dd":return intUnit(ig);case"o":return intUnit(sg);case"ooo":return intUnit(ng);case"HH":return intUnit(ig);case"H":return intUnit(Ig);case"hh":return intUnit(ig);case"h":return intUnit(Ig);case"mm":return intUnit(ig);case"m":return intUnit(Ig);case"q":return intUnit(Ig);case"qq":return intUnit(ig);case"s":return intUnit(Ig);case"ss":return intUnit(ig);case"S":return intUnit(sg);case"SSS":return intUnit(ng);case"u":return simple(lg);case"uu":return simple(Ig);case"uuu":return intUnit(gg);case"a":return oneOf(eg.meridiems(),0);case"kkkk":return intUnit(og);case"kk":return intUnit(Ag,untruncateYear);case"W":return intUnit(Ig);case"WW":return intUnit(ig);case"E":case"c":return intUnit(gg);case"EEE":return oneOf(eg.weekdays("short",!1),1);case"EEEE":return oneOf(eg.weekdays("long",!1),1);case"ccc":return oneOf(eg.weekdays("short",!0),1);case"cccc":return oneOf(eg.weekdays("long",!0),1);case"Z":case"ZZ":return offset(new RegExp(`([+-]${Ig.source})(?::(${ig.source}))?`),2);case"ZZZ":return offset(new RegExp(`([+-]${Ig.source})(${ig.source})?`),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);case" ":return simple(/[^\S\n\r]/);default:return rg(bg)}})(tg)||{invalidReason:MISSING_FTP};return dg.token=tg,dg}const partTypeStyleToTokenVal={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function tokenForPart(tg,eg,gg){const{type:ig,value:ng}=tg;if(ig==="literal"){const sg=/^\s+$/.test(ng);return{literal:!sg,val:sg?" ":ng}}const og=eg[ig];let ag=ig;ig==="hour"&&(eg.hour12!=null?ag=eg.hour12?"hour12":"hour24":eg.hourCycle!=null?eg.hourCycle==="h11"||eg.hourCycle==="h12"?ag="hour12":ag="hour24":ag=gg.hour12?"hour12":"hour24");let Ig=partTypeStyleToTokenVal[ag];if(typeof Ig=="object"&&(Ig=Ig[og]),Ig)return{literal:!1,val:Ig}}function buildRegex(tg){return[`^${tg.map(gg=>gg.regex).reduce((gg,ig)=>`${gg}(${ig.source})`,"")}$`,tg]}function match(tg,eg,gg){const ig=tg.match(eg);if(ig){const ng={};let og=1;for(const ag in gg)if(hasOwnProperty(gg,ag)){const Ig=gg[ag],sg=Ig.groups?Ig.groups+1:1;!Ig.literal&&Ig.token&&(ng[Ig.token.val[0]]=Ig.deser(ig.slice(og,og+sg))),og+=sg}return[ig,ng]}else return[ig,{}]}function dateTimeFromMatches(tg){const eg=og=>{switch(og){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let gg=null,ig;return isUndefined$1(tg.z)||(gg=IANAZone.create(tg.z)),isUndefined$1(tg.Z)||(gg||(gg=new FixedOffsetZone(tg.Z)),ig=tg.Z),isUndefined$1(tg.q)||(tg.M=(tg.q-1)*3+1),isUndefined$1(tg.h)||(tg.h<12&&tg.a===1?tg.h+=12:tg.h===12&&tg.a===0&&(tg.h=0)),tg.G===0&&tg.y&&(tg.y=-tg.y),isUndefined$1(tg.u)||(tg.S=parseMillis(tg.u)),[Object.keys(tg).reduce((og,ag)=>{const Ig=eg(ag);return Ig&&(og[Ig]=tg[ag]),og},{}),gg,ig]}let dummyDateTimeCache=null;function getDummyDateTime(){return dummyDateTimeCache||(dummyDateTimeCache=DateTime.fromMillis(1555555555555)),dummyDateTimeCache}function maybeExpandMacroToken(tg,eg){if(tg.literal)return tg;const gg=Formatter.macroTokenToFormatOpts(tg.val),ig=formatOptsToTokens(gg,eg);return ig==null||ig.includes(void 0)?tg:ig}function expandMacroTokens(tg,eg){return Array.prototype.concat(...tg.map(gg=>maybeExpandMacroToken(gg,eg)))}class TokenParser{constructor(eg,gg){if(this.locale=eg,this.format=gg,this.tokens=expandMacroTokens(Formatter.parseFormat(gg),eg),this.units=this.tokens.map(ig=>unitForToken(ig,eg)),this.disqualifyingUnit=this.units.find(ig=>ig.invalidReason),!this.disqualifyingUnit){const[ig,ng]=buildRegex(this.units);this.regex=RegExp(ig,"i"),this.handlers=ng}}explainFromTokens(eg){if(this.isValid){const[gg,ig]=match(eg,this.regex,this.handlers),[ng,og,ag]=ig?dateTimeFromMatches(ig):[null,null,void 0];if(hasOwnProperty(ig,"a")&&hasOwnProperty(ig,"H"))throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");return{input:eg,tokens:this.tokens,regex:this.regex,rawMatches:gg,matches:ig,result:ng,zone:og,specificOffset:ag}}else return{input:eg,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function explainFromTokens(tg,eg,gg){return new TokenParser(tg,gg).explainFromTokens(eg)}function parseFromTokens(tg,eg,gg){const{result:ig,zone:ng,specificOffset:og,invalidReason:ag}=explainFromTokens(tg,eg,gg);return[ig,ng,og,ag]}function formatOptsToTokens(tg,eg){if(!tg)return null;const ig=Formatter.create(eg,tg).dtFormatter(getDummyDateTime()),ng=ig.formatToParts(),og=ig.resolvedOptions();return ng.map(ag=>tokenForPart(ag,tg,og))}const INVALID="Invalid DateTime",MAX_DATE=864e13;function unsupportedZone(tg){return new Invalid("unsupported zone",`the zone "${tg.name}" is not supported`)}function possiblyCachedWeekData(tg){return tg.weekData===null&&(tg.weekData=gregorianToWeek(tg.c)),tg.weekData}function possiblyCachedLocalWeekData(tg){return tg.localWeekData===null&&(tg.localWeekData=gregorianToWeek(tg.c,tg.loc.getMinDaysInFirstWeek(),tg.loc.getStartOfWeek())),tg.localWeekData}function clone(tg,eg){const gg={ts:tg.ts,zone:tg.zone,c:tg.c,o:tg.o,loc:tg.loc,invalid:tg.invalid};return new DateTime({...gg,...eg,old:gg})}function fixOffset(tg,eg,gg){let ig=tg-eg*60*1e3;const ng=gg.offset(ig);if(eg===ng)return[ig,eg];ig-=(ng-eg)*60*1e3;const og=gg.offset(ig);return ng===og?[ig,ng]:[tg-Math.min(ng,og)*60*1e3,Math.max(ng,og)]}function tsToObj(tg,eg){tg+=eg*60*1e3;const gg=new Date(tg);return{year:gg.getUTCFullYear(),month:gg.getUTCMonth()+1,day:gg.getUTCDate(),hour:gg.getUTCHours(),minute:gg.getUTCMinutes(),second:gg.getUTCSeconds(),millisecond:gg.getUTCMilliseconds()}}function objToTS(tg,eg,gg){return fixOffset(objToLocalTS(tg),eg,gg)}function adjustTime(tg,eg){const gg=tg.o,ig=tg.c.year+Math.trunc(eg.years),ng=tg.c.month+Math.trunc(eg.months)+Math.trunc(eg.quarters)*3,og={...tg.c,year:ig,month:ng,day:Math.min(tg.c.day,daysInMonth(ig,ng))+Math.trunc(eg.days)+Math.trunc(eg.weeks)*7},ag=Duration.fromObject({years:eg.years-Math.trunc(eg.years),quarters:eg.quarters-Math.trunc(eg.quarters),months:eg.months-Math.trunc(eg.months),weeks:eg.weeks-Math.trunc(eg.weeks),days:eg.days-Math.trunc(eg.days),hours:eg.hours,minutes:eg.minutes,seconds:eg.seconds,milliseconds:eg.milliseconds}).as("milliseconds"),Ig=objToLocalTS(og);let[sg,Cg]=fixOffset(Ig,gg,tg.zone);return ag!==0&&(sg+=ag,Cg=tg.zone.offset(sg)),{ts:sg,o:Cg}}function parseDataToDateTime(tg,eg,gg,ig,ng,og){const{setZone:ag,zone:Ig}=gg;if(tg&&Object.keys(tg).length!==0||eg){const sg=eg||Ig,Cg=DateTime.fromObject(tg,{...gg,zone:sg,specificOffset:og});return ag?Cg:Cg.setZone(Ig)}else return DateTime.invalid(new Invalid("unparsable",`the input "${ng}" can't be parsed as ${ig}`))}function toTechFormat(tg,eg,gg=!0){return tg.isValid?Formatter.create(Locale.create("en-US"),{allowZ:gg,forceSimple:!0}).formatDateTimeFromString(tg,eg):null}function toISODate(tg,eg,gg){const ig=tg.c.year>9999||tg.c.year<0;let ng="";if(ig&&tg.c.year>=0&&(ng+="+"),ng+=padStart(tg.c.year,ig?6:4),gg==="year")return ng;if(eg){if(ng+="-",ng+=padStart(tg.c.month),gg==="month")return ng;ng+="-"}else if(ng+=padStart(tg.c.month),gg==="month")return ng;return ng+=padStart(tg.c.day),ng}function toISOTime(tg,eg,gg,ig,ng,og,ag){let Ig=!gg||tg.c.millisecond!==0||tg.c.second!==0,sg="";switch(ag){case"day":case"month":case"year":break;default:if(sg+=padStart(tg.c.hour),ag==="hour")break;if(eg){if(sg+=":",sg+=padStart(tg.c.minute),ag==="minute")break;Ig&&(sg+=":",sg+=padStart(tg.c.second))}else{if(sg+=padStart(tg.c.minute),ag==="minute")break;Ig&&(sg+=padStart(tg.c.second))}if(ag==="second")break;Ig&&(!ig||tg.c.millisecond!==0)&&(sg+=".",sg+=padStart(tg.c.millisecond,3))}return ng&&(tg.isOffsetFixed&&tg.offset===0&&!og?sg+="Z":tg.o<0?(sg+="-",sg+=padStart(Math.trunc(-tg.o/60)),sg+=":",sg+=padStart(Math.trunc(-tg.o%60))):(sg+="+",sg+=padStart(Math.trunc(tg.o/60)),sg+=":",sg+=padStart(Math.trunc(tg.o%60)))),og&&(sg+="["+tg.zone.ianaName+"]"),sg}const defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0},orderedUnits=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(tg){const eg={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[tg.toLowerCase()];if(!eg)throw new InvalidUnitError(tg);return eg}function normalizeUnitWithLocalWeeks(tg){switch(tg.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return normalizeUnit(tg)}}function guessOffsetForZone(tg){if(zoneOffsetTs===void 0&&(zoneOffsetTs=Settings.now()),tg.type!=="iana")return tg.offset(zoneOffsetTs);const eg=tg.name;let gg=zoneOffsetGuessCache.get(eg);return gg===void 0&&(gg=tg.offset(zoneOffsetTs),zoneOffsetGuessCache.set(eg,gg)),gg}function quickDT(tg,eg){const gg=normalizeZone(eg.zone,Settings.defaultZone);if(!gg.isValid)return DateTime.invalid(unsupportedZone(gg));const ig=Locale.fromObject(eg);let ng,og;if(isUndefined$1(tg.year))ng=Settings.now();else{for(const sg of orderedUnits)isUndefined$1(tg[sg])&&(tg[sg]=defaultUnitValues[sg]);const ag=hasInvalidGregorianData(tg)||hasInvalidTimeData(tg);if(ag)return DateTime.invalid(ag);const Ig=guessOffsetForZone(gg);[ng,og]=objToTS(tg,Ig,gg)}return new DateTime({ts:ng,zone:gg,loc:ig,o:og})}function diffRelative(tg,eg,gg){const ig=isUndefined$1(gg.round)?!0:gg.round,ng=isUndefined$1(gg.rounding)?"trunc":gg.rounding,og=(Ig,sg)=>(Ig=roundTo(Ig,ig||gg.calendary?0:2,gg.calendary?"round":ng),eg.loc.clone(gg).relFormatter(gg).format(Ig,sg)),ag=Ig=>gg.calendary?eg.hasSame(tg,Ig)?0:eg.startOf(Ig).diff(tg.startOf(Ig),Ig).get(Ig):eg.diff(tg,Ig).get(Ig);if(gg.unit)return og(ag(gg.unit),gg.unit);for(const Ig of gg.units){const sg=ag(Ig);if(Math.abs(sg)>=1)return og(sg,Ig)}return og(tg>eg?-0:0,gg.units[gg.units.length-1])}function lastOpts(tg){let eg={},gg;return tg.length>0&&typeof tg[tg.length-1]=="object"?(eg=tg[tg.length-1],gg=Array.from(tg).slice(0,tg.length-1)):gg=Array.from(tg),[eg,gg]}let zoneOffsetTs;const zoneOffsetGuessCache=new Map;class DateTime{constructor(eg){const gg=eg.zone||Settings.defaultZone;let ig=eg.invalid||(Number.isNaN(eg.ts)?new Invalid("invalid input"):null)||(gg.isValid?null:unsupportedZone(gg));this.ts=isUndefined$1(eg.ts)?Settings.now():eg.ts;let ng=null,og=null;if(!ig)if(eg.old&&eg.old.ts===this.ts&&eg.old.zone.equals(gg))[ng,og]=[eg.old.c,eg.old.o];else{const Ig=isNumber$1(eg.o)&&!eg.old?eg.o:gg.offset(this.ts);ng=tsToObj(this.ts,Ig),ig=Number.isNaN(ng.year)?new Invalid("invalid input"):null,ng=ig?null:ng,og=ig?null:Ig}this._zone=gg,this.loc=eg.loc||Locale.create(),this.invalid=ig,this.weekData=null,this.localWeekData=null,this.c=ng,this.o=og,this.isLuxonDateTime=!0}static now(){return new DateTime({})}static local(){const[eg,gg]=lastOpts(arguments),[ig,ng,og,ag,Ig,sg,Cg]=gg;return quickDT({year:ig,month:ng,day:og,hour:ag,minute:Ig,second:sg,millisecond:Cg},eg)}static utc(){const[eg,gg]=lastOpts(arguments),[ig,ng,og,ag,Ig,sg,Cg]=gg;return eg.zone=FixedOffsetZone.utcInstance,quickDT({year:ig,month:ng,day:og,hour:ag,minute:Ig,second:sg,millisecond:Cg},eg)}static fromJSDate(eg,gg={}){const ig=isDate$1(eg)?eg.valueOf():NaN;if(Number.isNaN(ig))return DateTime.invalid("invalid input");const ng=normalizeZone(gg.zone,Settings.defaultZone);return ng.isValid?new DateTime({ts:ig,zone:ng,loc:Locale.fromObject(gg)}):DateTime.invalid(unsupportedZone(ng))}static fromMillis(eg,gg={}){if(isNumber$1(eg))return eg<-MAX_DATE||eg>MAX_DATE?DateTime.invalid("Timestamp out of range"):new DateTime({ts:eg,zone:normalizeZone(gg.zone,Settings.defaultZone),loc:Locale.fromObject(gg)});throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof eg} with value ${eg}`)}static fromSeconds(eg,gg={}){if(isNumber$1(eg))return new DateTime({ts:eg*1e3,zone:normalizeZone(gg.zone,Settings.defaultZone),loc:Locale.fromObject(gg)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}static fromObject(eg,gg={}){eg=eg||{};const ig=normalizeZone(gg.zone,Settings.defaultZone);if(!ig.isValid)return DateTime.invalid(unsupportedZone(ig));const ng=Locale.fromObject(gg),og=normalizeObject(eg,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:ag,startOfWeek:Ig}=usesLocalWeekValues(og,ng),sg=Settings.now(),Cg=isUndefined$1(gg.specificOffset)?ig.offset(sg):gg.specificOffset,lg=!isUndefined$1(og.ordinal),Ag=!isUndefined$1(og.year),cg=!isUndefined$1(og.month)||!isUndefined$1(og.day),rg=Ag||cg,ug=og.weekYear||og.weekNumber;if((rg||lg)&&ug)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(cg&&lg)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");const dg=ug||og.weekday&&!rg;let bg,mg,hg=tsToObj(sg,Cg);dg?(bg=orderedWeekUnits,mg=defaultWeekUnitValues,hg=gregorianToWeek(hg,ag,Ig)):lg?(bg=orderedOrdinalUnits,mg=defaultOrdinalUnitValues,hg=gregorianToOrdinal(hg)):(bg=orderedUnits,mg=defaultUnitValues);let pg=!1;for(const Wg of bg){const $g=og[Wg];isUndefined$1($g)?pg?og[Wg]=mg[Wg]:og[Wg]=hg[Wg]:pg=!0}const fg=dg?hasInvalidWeekData(og,ag,Ig):lg?hasInvalidOrdinalData(og):hasInvalidGregorianData(og),wg=fg||hasInvalidTimeData(og);if(wg)return DateTime.invalid(wg);const Gg=dg?weekToGregorian(og,ag,Ig):lg?ordinalToGregorian(og):og,[Zg,yg]=objToTS(Gg,Cg,ig),Bg=new DateTime({ts:Zg,zone:ig,o:yg,loc:ng});return og.weekday&&rg&&eg.weekday!==Bg.weekday?DateTime.invalid("mismatched weekday",`you can't specify both a weekday of ${og.weekday} and a date of ${Bg.toISO()}`):Bg.isValid?Bg:DateTime.invalid(Bg.invalid)}static fromISO(eg,gg={}){const[ig,ng]=parseISODate(eg);return parseDataToDateTime(ig,ng,gg,"ISO 8601",eg)}static fromRFC2822(eg,gg={}){const[ig,ng]=parseRFC2822Date(eg);return parseDataToDateTime(ig,ng,gg,"RFC 2822",eg)}static fromHTTP(eg,gg={}){const[ig,ng]=parseHTTPDate(eg);return parseDataToDateTime(ig,ng,gg,"HTTP",gg)}static fromFormat(eg,gg,ig={}){if(isUndefined$1(eg)||isUndefined$1(gg))throw new InvalidArgumentError("fromFormat requires an input string and a format");const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0}),[Ig,sg,Cg,lg]=parseFromTokens(ag,eg,gg);return lg?DateTime.invalid(lg):parseDataToDateTime(Ig,sg,ig,`format ${gg}`,eg,Cg)}static fromString(eg,gg,ig={}){return DateTime.fromFormat(eg,gg,ig)}static fromSQL(eg,gg={}){const[ig,ng]=parseSQL(eg);return parseDataToDateTime(ig,ng,gg,"SQL",eg)}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(ig);return new DateTime({invalid:ig})}static isDateTime(eg){return eg&&eg.isLuxonDateTime||!1}static parseFormatForOpts(eg,gg={}){const ig=formatOptsToTokens(eg,Locale.fromObject(gg));return ig?ig.map(ng=>ng?ng.val:null).join(""):null}static expandFormat(eg,gg={}){return expandMacroTokens(Formatter.parseFormat(eg),Locale.fromObject(gg)).map(ng=>ng.val).join("")}static resetCache(){zoneOffsetTs=void 0,zoneOffsetGuessCache.clear()}get(eg){return this[eg]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}get weekNumber(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}get weekday(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?possiblyCachedLocalWeekData(this).weekday:NaN}get localWeekNumber(){return this.isValid?possiblyCachedLocalWeekData(this).weekNumber:NaN}get localWeekYear(){return this.isValid?possiblyCachedLocalWeekData(this).weekYear:NaN}get ordinal(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}get monthShort(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const eg=864e5,gg=6e4,ig=objToLocalTS(this.c),ng=this.zone.offset(ig-eg),og=this.zone.offset(ig+eg),ag=this.zone.offset(ig-ng*gg),Ig=this.zone.offset(ig-og*gg);if(ag===Ig)return[this];const sg=ig-ag*gg,Cg=ig-Ig*gg,lg=tsToObj(sg,ag),Ag=tsToObj(Cg,Ig);return lg.hour===Ag.hour&&lg.minute===Ag.minute&&lg.second===Ag.second&&lg.millisecond===Ag.millisecond?[clone(this,{ts:sg}),clone(this,{ts:Cg})]:[this]}get isInLeapYear(){return isLeapYear(this.year)}get daysInMonth(){return daysInMonth(this.year,this.month)}get daysInYear(){return this.isValid?daysInYear(this.year):NaN}get weeksInWeekYear(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?weeksInWeekYear(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(eg={}){const{locale:gg,numberingSystem:ig,calendar:ng}=Formatter.create(this.loc.clone(eg),eg).resolvedOptions(this);return{locale:gg,numberingSystem:ig,outputCalendar:ng}}toUTC(eg=0,gg={}){return this.setZone(FixedOffsetZone.instance(eg),gg)}toLocal(){return this.setZone(Settings.defaultZone)}setZone(eg,{keepLocalTime:gg=!1,keepCalendarTime:ig=!1}={}){if(eg=normalizeZone(eg,Settings.defaultZone),eg.equals(this.zone))return this;if(eg.isValid){let ng=this.ts;if(gg||ig){const og=eg.offset(this.ts),ag=this.toObject();[ng]=objToTS(ag,og,eg)}return clone(this,{ts:ng,zone:eg})}else return DateTime.invalid(unsupportedZone(eg))}reconfigure({locale:eg,numberingSystem:gg,outputCalendar:ig}={}){const ng=this.loc.clone({locale:eg,numberingSystem:gg,outputCalendar:ig});return clone(this,{loc:ng})}setLocale(eg){return this.reconfigure({locale:eg})}set(eg){if(!this.isValid)return this;const gg=normalizeObject(eg,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:ig,startOfWeek:ng}=usesLocalWeekValues(gg,this.loc),og=!isUndefined$1(gg.weekYear)||!isUndefined$1(gg.weekNumber)||!isUndefined$1(gg.weekday),ag=!isUndefined$1(gg.ordinal),Ig=!isUndefined$1(gg.year),sg=!isUndefined$1(gg.month)||!isUndefined$1(gg.day),Cg=Ig||sg,lg=gg.weekYear||gg.weekNumber;if((Cg||ag)&&lg)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(sg&&ag)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let Ag;og?Ag=weekToGregorian({...gregorianToWeek(this.c,ig,ng),...gg},ig,ng):isUndefined$1(gg.ordinal)?(Ag={...this.toObject(),...gg},isUndefined$1(gg.day)&&(Ag.day=Math.min(daysInMonth(Ag.year,Ag.month),Ag.day))):Ag=ordinalToGregorian({...gregorianToOrdinal(this.c),...gg});const[cg,rg]=objToTS(Ag,this.o,this.zone);return clone(this,{ts:cg,o:rg})}plus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg);return clone(this,adjustTime(this,gg))}minus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg).negate();return clone(this,adjustTime(this,gg))}startOf(eg,{useLocaleWeeks:gg=!1}={}){if(!this.isValid)return this;const ig={},ng=Duration.normalizeUnit(eg);switch(ng){case"years":ig.month=1;case"quarters":case"months":ig.day=1;case"weeks":case"days":ig.hour=0;case"hours":ig.minute=0;case"minutes":ig.second=0;case"seconds":ig.millisecond=0;break}if(ng==="weeks")if(gg){const og=this.loc.getStartOfWeek(),{weekday:ag}=this;ag<og&&(ig.weekNumber=this.weekNumber-1),ig.weekday=og}else ig.weekday=1;if(ng==="quarters"){const og=Math.ceil(this.month/3);ig.month=(og-1)*3+1}return this.set(ig)}endOf(eg,gg){return this.isValid?this.plus({[eg]:1}).startOf(eg,gg).minus(1):this}toFormat(eg,gg={}){return this.isValid?Formatter.create(this.loc.redefaultToEN(gg)).formatDateTimeFromString(this,eg):INVALID}toLocaleString(eg=DATE_SHORT,gg={}){return this.isValid?Formatter.create(this.loc.clone(gg),eg).formatDateTime(this):INVALID}toLocaleParts(eg={}){return this.isValid?Formatter.create(this.loc.clone(eg),eg).formatDateTimeParts(this):[]}toISO({format:eg="extended",suppressSeconds:gg=!1,suppressMilliseconds:ig=!1,includeOffset:ng=!0,extendedZone:og=!1,precision:ag="milliseconds"}={}){if(!this.isValid)return null;ag=normalizeUnit(ag);const Ig=eg==="extended";let sg=toISODate(this,Ig,ag);return orderedUnits.indexOf(ag)>=3&&(sg+="T"),sg+=toISOTime(this,Ig,gg,ig,ng,og,ag),sg}toISODate({format:eg="extended",precision:gg="day"}={}){return this.isValid?toISODate(this,eg==="extended",normalizeUnit(gg)):null}toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:eg=!1,suppressSeconds:gg=!1,includeOffset:ig=!0,includePrefix:ng=!1,extendedZone:og=!1,format:ag="extended",precision:Ig="milliseconds"}={}){return this.isValid?(Ig=normalizeUnit(Ig),(ng&&orderedUnits.indexOf(Ig)>=3?"T":"")+toISOTime(this,ag==="extended",gg,eg,ig,og,Ig)):null}toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?toISODate(this,!0):null}toSQLTime({includeOffset:eg=!0,includeZone:gg=!1,includeOffsetSpace:ig=!0}={}){let ng="HH:mm:ss.SSS";return(gg||eg)&&(ig&&(ng+=" "),gg?ng+="z":eg&&(ng+="ZZ")),toTechFormat(this,ng,!0)}toSQL(eg={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(eg)}`:null}toString(){return this.isValid?this.toISO():INVALID}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(eg={}){if(!this.isValid)return{};const gg={...this.c};return eg.includeConfig&&(gg.outputCalendar=this.outputCalendar,gg.numberingSystem=this.loc.numberingSystem,gg.locale=this.loc.locale),gg}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(eg,gg="milliseconds",ig={}){if(!this.isValid||!eg.isValid)return Duration.invalid("created by diffing an invalid DateTime");const ng={locale:this.locale,numberingSystem:this.numberingSystem,...ig},og=maybeArray(gg).map(Duration.normalizeUnit),ag=eg.valueOf()>this.valueOf(),Ig=ag?this:eg,sg=ag?eg:this,Cg=diff(Ig,sg,og,ng);return ag?Cg.negate():Cg}diffNow(eg="milliseconds",gg={}){return this.diff(DateTime.now(),eg,gg)}until(eg){return this.isValid?Interval.fromDateTimes(this,eg):this}hasSame(eg,gg,ig){if(!this.isValid)return!1;const ng=eg.valueOf(),og=this.setZone(eg.zone,{keepLocalTime:!0});return og.startOf(gg,ig)<=ng&&ng<=og.endOf(gg,ig)}equals(eg){return this.isValid&&eg.isValid&&this.valueOf()===eg.valueOf()&&this.zone.equals(eg.zone)&&this.loc.equals(eg.loc)}toRelative(eg={}){if(!this.isValid)return null;const gg=eg.base||DateTime.fromObject({},{zone:this.zone}),ig=eg.padding?this<gg?-eg.padding:eg.padding:0;let ng=["years","months","days","hours","minutes","seconds"],og=eg.unit;return Array.isArray(eg.unit)&&(ng=eg.unit,og=void 0),diffRelative(gg,this.plus(ig),{...eg,numeric:"always",units:ng,unit:og})}toRelativeCalendar(eg={}){return this.isValid?diffRelative(eg.base||DateTime.fromObject({},{zone:this.zone}),this,{...eg,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...eg){if(!eg.every(DateTime.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(eg,gg=>gg.valueOf(),Math.min)}static max(...eg){if(!eg.every(DateTime.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(eg,gg=>gg.valueOf(),Math.max)}static fromFormatExplain(eg,gg,ig={}){const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0});return explainFromTokens(ag,eg,gg)}static fromStringExplain(eg,gg,ig={}){return DateTime.fromFormatExplain(eg,gg,ig)}static buildFormatParser(eg,gg={}){const{locale:ig=null,numberingSystem:ng=null}=gg,og=Locale.fromOpts({locale:ig,numberingSystem:ng,defaultToEN:!0});return new TokenParser(og,eg)}static fromFormatParser(eg,gg,ig={}){if(isUndefined$1(eg)||isUndefined$1(gg))throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser");const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0});if(!ag.equals(gg.locale))throw new InvalidArgumentError(`fromFormatParser called with a locale of ${ag}, but the format parser was created for ${gg.locale}`);const{result:Ig,zone:sg,specificOffset:Cg,invalidReason:lg}=gg.explainFromTokens(eg);return lg?DateTime.invalid(lg):parseDataToDateTime(Ig,sg,ig,`format ${gg.format}`,eg,Cg)}static get DATE_SHORT(){return DATE_SHORT}static get DATE_MED(){return DATE_MED}static get DATE_MED_WITH_WEEKDAY(){return DATE_MED_WITH_WEEKDAY}static get DATE_FULL(){return DATE_FULL}static get DATE_HUGE(){return DATE_HUGE}static get TIME_SIMPLE(){return TIME_SIMPLE}static get TIME_WITH_SECONDS(){return TIME_WITH_SECONDS}static get TIME_WITH_SHORT_OFFSET(){return TIME_WITH_SHORT_OFFSET}static get TIME_WITH_LONG_OFFSET(){return TIME_WITH_LONG_OFFSET}static get TIME_24_SIMPLE(){return TIME_24_SIMPLE}static get TIME_24_WITH_SECONDS(){return TIME_24_WITH_SECONDS}static get TIME_24_WITH_SHORT_OFFSET(){return TIME_24_WITH_SHORT_OFFSET}static get TIME_24_WITH_LONG_OFFSET(){return TIME_24_WITH_LONG_OFFSET}static get DATETIME_SHORT(){return DATETIME_SHORT}static get DATETIME_SHORT_WITH_SECONDS(){return DATETIME_SHORT_WITH_SECONDS}static get DATETIME_MED(){return DATETIME_MED}static get DATETIME_MED_WITH_SECONDS(){return DATETIME_MED_WITH_SECONDS}static get DATETIME_MED_WITH_WEEKDAY(){return DATETIME_MED_WITH_WEEKDAY}static get DATETIME_FULL(){return DATETIME_FULL}static get DATETIME_FULL_WITH_SECONDS(){return DATETIME_FULL_WITH_SECONDS}static get DATETIME_HUGE(){return DATETIME_HUGE}static get DATETIME_HUGE_WITH_SECONDS(){return DATETIME_HUGE_WITH_SECONDS}}function friendlyDateTime(tg){if(DateTime.isDateTime(tg))return tg;if(tg&&tg.valueOf&&isNumber$1(tg.valueOf()))return DateTime.fromJSDate(tg);if(tg&&typeof tg=="object")return DateTime.fromObject(tg);throw new InvalidArgumentError(`Unknown datetime argument: ${tg}, of type ${typeof tg}`)}const WEEK_ZH=["一","二","三","四","五","六","日"],MONTH_ZH_NUM=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],MONTH_ZH_CN=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];function formatDate(tg,{years:eg=0,months:gg=0,days:ig=0}={}){const ng=DateTime.now().plus({years:eg,months:gg,days:ig}).setLocale("zh-CN");let og=formatWithZhMonth(ng,tg),ag=ng.toFormat(og);return ag=formatWithZhWeekday(ng,ag),ag}function formatWithZhWeekday(tg,eg){const gg=WEEK_ZH[tg.weekday-1];return eg.replace(/dddd/g,`星期${gg}`).replace(/ddd/g,`周${gg}`)}function formatWithZhMonth(tg,eg){const gg=tg.month-1;return eg.replace(/MMMM/g,MONTH_ZH_CN[gg]).replace(/MMM/g,MONTH_ZH_NUM[gg])}function throttle$1(tg,eg=300){let gg=0;return function(...ig){const ng=Date.now();ng-gg>=eg&&(tg.apply(this,ig),gg=ng)}}function ptToPx$1(tg,eg=o.DPI){return tg*eg/72}function mitt(tg){return{all:tg=tg||new Map,on:function(eg,gg){var ig=tg.get(eg);ig?ig.push(gg):tg.set(eg,[gg])},off:function(eg,gg){var ig=tg.get(eg);ig&&(gg?ig.splice(ig.indexOf(gg)>>>0,1):tg.set(eg,[]))},emit:function(eg,gg){var ig=tg.get(eg);ig&&ig.slice().map(function(ng){ng(gg)}),(ig=tg.get("*"))&&ig.slice().map(function(ng){ng(eg,gg)})}}}const canvasEventBus=mitt();let allObjMap=new Proxy({},{get(tg,eg){return eg in tg?tg[eg]:[]},set(tg,eg,gg){return tg[eg]=gg,!0}});function clearObjectMap(){allObjMap=new Proxy({},{get(tg,eg){return eg in tg?tg[eg]:[]},set(tg,eg,gg){return tg[eg]=gg,!0}})}function updateObjectMap(tg){tg.type!=="group"&&tg.id!=="workspace"?!allObjMap[tg.type]||allObjMap[tg.type]&&allObjMap[tg.type].length===0?allObjMap[tg.type]=[tg]:allObjMap[tg.type].push(tg):tg._objects.forEach(eg=>updateObjectMap(eg))}function getAllObjectMap(tg=null,eg="get"){if(eg==="get"&&Object.keys(allObjMap).length)return allObjMap;{if(!tg)return allObjMap;clearObjectMap();const gg=ig=>{ig.type==="group"&&ig._objects?ig._objects.forEach(ng=>gg(ng)):ig.id!=="workspace"&&(!allObjMap[ig.type]||allObjMap[ig.type]&&allObjMap[ig.type].length===0?allObjMap[ig.type]=[ig]:allObjMap[ig.type].push(ig))};tg==null||tg.getObjects().forEach(ig=>gg(ig))}return allObjMap}function getObjectList(tg,eg){tg.type!=="group"&&tg.type!=="activeselection"?eg&&eg(tg):tg._objects.forEach(gg=>getObjectList(gg,eg))}function getCounterIncrement(tg){const eg=Number(tg.incremental);return Number.isFinite(eg)?Math.trunc(eg):0}function getCounterValueType(tg){return tg.valueType==="letter"?"letter":"number"}function normalizeLetterValue(tg){return String(tg??"").toUpperCase().replace(/[^A-Z]/g,"")||"A"}function letterValueToNumber(tg){return normalizeLetterValue(tg).split("").reduce((eg,gg)=>eg*26+gg.charCodeAt(0)-64,0)}function numberToLetterValue(tg){let eg=Math.max(1,Math.trunc(tg)),gg="";for(;eg>0;)eg--,gg=String.fromCharCode(65+eg%26)+gg,eg=Math.floor(eg/26);return gg}function formatCounterValue(tg){if(getCounterValueType(tg)==="letter"){const ig=normalizeLetterValue(tg.value);return tg.zeroPadding?ig.padStart(Math.max(0,tg.length),"0"):ig}let eg=String(tg.value??"");if(!tg.zeroPadding)return eg;let gg=Number(eg);return gg<0?(gg=Math.abs(gg),`-${gg.toString().padStart(tg.length,"0")}`):eg.padStart(tg.length,"0")}function getNextCounterValue(tg){const eg=getCounterIncrement(tg);if(getCounterValueType(tg)==="letter"){const ng=letterValueToNumber(normalizeLetterValue(tg.value))+eg;if(ng<1)return null;const og=numberToLetterValue(ng);return og.length<=tg.length?og:null}const gg=Number(tg.value);if(!Number.isFinite(gg))return null;const ig=gg+eg;return Math.abs(ig).toString().length<=tg.length?ig:null}const GS1_AI_TABLE={"00":{length:18,desc:"SSCC"},"01":{length:14,desc:"GTIN"},"02":{length:14,desc:"GTIN inside"},11:{length:6,desc:"生产日期"},12:{length:6,desc:"付款截止日"},13:{length:6,desc:"包装日期"},15:{length:6,desc:"最佳保质期"},16:{length:6,desc:"销售截止日"},17:{length:6,desc:"有效期"},18:{length:6,desc:"接收日期"},20:{length:2,desc:"产品变体"},410:{length:13,desc:"收货方GLN"},411:{length:13,desc:"付款方GLN"},412:{length:13,desc:"购方GLN"},413:{length:13,desc:"发货方GLN"},414:{length:13,desc:"交货方GLN"},415:{length:13,desc:"开票方GLN"},416:{length:13,desc:"生产/服务方GLN"},417:{length:13,desc:"参与方GLN"},7001:{length:13,desc:"NHS编号"},10:{variable:!0,max:20,desc:"批号"},21:{variable:!0,max:20,desc:"序列号"},22:{variable:!0,max:20,desc:"次级数据"},30:{variable:!0,max:8,desc:"数量(件)"},37:{variable:!0,max:8,desc:"物流单元数量"},400:{variable:!0,max:30,desc:"客户订单号"},401:{variable:!0,max:30,desc:"货物标识号"},402:{variable:!0,max:20,desc:"GSIN"},403:{variable:!0,max:30,desc:"路线代码"},420:{variable:!0,max:20,desc:"收货方邮编"},421:{variable:!0,max:20,desc:"收货方邮编(含ISO)"},7002:{variable:!0,max:30,desc:"CE标识"},7010:{variable:!0,max:30,desc:"医院编号"},8001:{variable:!0,max:14,desc:"卷材信息"},8002:{variable:!0,max:20,desc:"手机电子序列号"},8003:{variable:!0,max:30,desc:"全球可回收资产标识"},8004:{variable:!0,max:30,desc:"全球单个资产标识"},8005:{variable:!0,max:6,desc:"价格"},8006:{variable:!0,max:18,desc:"组件标识"},8007:{variable:!0,max:34,desc:"IBAN"},8008:{variable:!0,max:12,desc:"生产日期时间"},8010:{variable:!0,max:30,desc:"CPID"},8011:{variable:!0,max:30,desc:"CPID序列号"},8012:{variable:!0,max:20,desc:"软件版本"},8013:{variable:!0,max:30,desc:"型号"},8017:{variable:!0,max:18,desc:"GSRN"},8018:{variable:!0,max:18,desc:"GSRN-Provider"},8020:{variable:!0,max:25,desc:"支付单号"},8110:{variable:!0,max:70,desc:"优惠券扩展"},8200:{variable:!0,max:25,desc:"包裹编号"},90:{variable:!0,max:30,desc:"双方约定"},91:{variable:!0,max:90,desc:"双方约定"},92:{variable:!0,max:90,desc:"双方约定"},93:{variable:!0,max:90,desc:"双方约定"},94:{variable:!0,max:90,desc:"双方约定"},95:{variable:!0,max:90,desc:"双方约定"},96:{variable:!0,max:90,desc:"双方约定"},97:{variable:!0,max:90,desc:"双方约定"},98:{variable:!0,max:90,desc:"双方约定"},99:{variable:!0,max:90,desc:"双方约定"}};for(let tg=310;tg<=369;tg++)GS1_AI_TABLE[String(tg)]={length:6,desc:"量度值"};class GS1Parser{static getAIInfo(eg){return GS1_AI_TABLE[eg]||null}static matchAIPrefix(eg,gg){for(const ig of[4,3,2]){if(gg+ig>eg.length)continue;const ng=eg.slice(gg,gg+ig);if(GS1_AI_TABLE[ng])return{ai:ng,info:GS1_AI_TABLE[ng]}}return null}static parse(eg){const gg=/\((\d{2,4})\)/g;let ig;const ng=[];for(;(ig=gg.exec(eg))!==null;){if(ng.length>0){const og=ng[ng.length-1];og.data=eg.slice(og.dataStart,ig.index)}ng.push({ai:ig[1],dataStart:ig.index+ig[0].length})}return ng.length>0&&(ng[ng.length-1].data=eg.slice(ng[ng.length-1].dataStart)),ng.map(og=>({ai:og.ai,data:og.data??""}))}static calcCheckDigit(eg){const gg=String(eg).split("").map(Number);let ig=0;for(let ng=0;ng<gg.length;ng++){const og=(gg.length-ng)%2===1?3:1;ig+=gg[ng]*og}return(10-ig%10)%10}static normalizeGTIN(eg){let gg=String(eg).replace(/\D/g,"");if(gg.length===14)return gg;gg=gg.padStart(13,"0");const ig=this.calcCheckDigit(gg);return gg+ig}static format(eg){return Array.isArray(eg)?eg.map(({ai:gg,data:ig})=>`(${gg})${ig}`).join(""):eg}static process(eg){const gg=this.parse(eg);return gg.length===0?`(01)${this.normalizeGTIN(eg)}`:gg.map(({ai:ig,data:ng})=>{if(this.getAIInfo(ig),ig==="01"||ig==="02")return{ai:ig,data:this.normalizeGTIN(ng)};if(ig==="00"){const og=String(ng).padStart(17,"0"),ag=this.calcCheckDigit(og);return{ai:ig,data:og+ag}}if(ig>="410"&&ig<="417"){const og=String(ng).padStart(12,"0"),ag=this.calcCheckDigit(og);return{ai:ig,data:og+ag}}return{ai:ig,data:ng}})}}function withObjectStrokeDash(tg,eg,gg){const ig=tg.getLineDash(),ng=tg.lineDashOffset,og=eg.strokeDashArray;tg.setLineDash(Array.isArray(og)&&og.length?og:[]),tg.lineDashOffset=eg.strokeDashOffset||0;try{gg()}finally{tg.setLineDash(ig),tg.lineDashOffset=ng}}function getBarcodeRenderWidth(tg,eg){if(eg>tg)return eg;const gg=Math.round(tg/eg)||1;return eg*gg}const Pl=class Pl extends ji{constructor(eg,gg){super(gg),this.hasFireChange=!1,this.minScaleLimit=.1,this.orginTextWidth=0,this.orginTextgaps=2,this.orginTextSize=0,this.orginTextHeight=0,this.lockScalingFlip=!0,this.objectCaching=!1,this._scaleAnchor=void 0,this.counterProps=null,this.reviewValueArgs=null,this.barcodeDateFormatType="",this.increaseDate=!1,this.concatTextIdListObj=null,this.connectObjIds=[],this.stretchMode="scale",this.barcodeTextHeight=0,this.barcodeTextGap=5,this._textLayoutInitialized=!1,this._lastTextAreaHeight=0,this._cache={canvas:void 0,error:void 0,update:!0},this.increaseDate=gg&&gg.increaseDate?gg.increaseDate:this.increaseDate,this.barcodeDateFormatType=gg&&gg.barcodeDateFormatType?gg.barcodeDateFormatType:this.barcodeDateFormatType,this.counterProps=gg&&gg.counterProps?gg.counterProps:this.counterProps,this.stretchMode=gg&&gg.stretchMode?gg.stretchMode:this.stretchMode,this.barcodeTextGap=gg&&gg.barcodeTextGap!=null?gg.barcodeTextGap:this.barcodeTextGap,this.barcodeOptions=cloneDeep(eg),this.barcodeOptions.textsize=eg.textsize||14,this.barcodeOptions.textposition=eg.includetext?eg.textposition||"bottom":void 0,this.barcodeOptions.textfontname=eg.textfontname||"Arial",this.set({width:this.width||1,height:this.height||80}),this.barcodeBaseWidth=this.width,this.on("scaling",ig=>{const ng=ig.transform;if(!ng)return;const og=ng.corner,ag=["ml","tl","bl"].includes(og),Ig=["mr","tr","br"].includes(og),sg=["mt","tl","tr"].includes(og),Cg=["mb","bl","br"].includes(og);if(!this._scaleAnchor){const dg=ag?"right":Ig?"left":"center",bg=sg?"bottom":Cg?"top":"center",mg=this.getPointByOrigin(dg,bg);this._scaleAnchor={p:mg,ox:dg,oy:bg}}const lg=Math.max(1,this.width*this.scaleX),Ag=Math.max(1,this.height*this.scaleY);this.width=lg,this.height=Ag,this.scaleX=1,this.scaleY=1,this.barcodeBaseWidth=this.width;const{p:cg,ox:rg,oy:ug}=this._scaleAnchor;if(this.group){const dg=kn.invertTransform(this.group.calcTransformMatrix()),bg=kn.transformPoint(cg,dg);this.setPositionByOrigin(bg,rg,ug)}else this.setPositionByOrigin(cg,rg,ug);this.setCoords()}),this.on("modified",()=>{this._scaleAnchor=void 0}),this.concatTextIdListObj=gg.concatTextIdListObj??this.concatTextIdListObj,this.connectObjIds=gg.connectObjIds??this.connectObjIds,canvasEventBus.off(`update:barcode:${this.id}`),canvasEventBus.on(`update:barcode:${this.id}`,async({list:ig,callback:ng=function(){}}={})=>{let og=await this.updateBarCode2d(ig);ng&&ng(og)})}measureText(eg,gg,ig){if(gg.textposition&&gg.textposition!=="none"&&gg.textsize){eg.font=`${gg.textsize}px ${gg.textfontname}`,gg.textgaps&&(eg.letterSpacing=gg.textgaps+"px");const ng=eg.measureText(gg.text);ig.textWidth=ng.actualBoundingBoxRight-ng.actualBoundingBoxLeft,ig.textHeight=ng.fontBoundingBoxAscent+ng.fontBoundingBoxDescent}}drawText(eg,gg,ig){if(gg.textposition&&gg.textposition!=="none"&&gg.textsize){gg.textcolor&&(eg.fillStyle=gg.textcolor);const ng=(sg,Cg)=>{let lg=(sg==null?void 0:sg.textWidth)||0;return Cg.textxalign==="left"?-this.width/2+this.strokeWidth/2:Cg.textxalign==="center"?-lg/2:Cg.textxalign==="right"&&this._cache.canvas?this.width/2-this.strokeWidth/2-lg:0},og=(sg,Cg)=>{let lg=(sg==null?void 0:sg.textHeight)||0;if(Cg.textposition==="top"){if(this._cache.canvas){const Ag=-this.height/2+lg+this.strokeWidth/2;return sg.y+=sg.textHeight,Ag}}else if(Cg.textposition==="bottom"&&this._cache.canvas)return this.height/2-this.strokeWidth/2;return 0},ag=ng(ig,gg),Ig=og(ig,gg);eg.save(),eg.fillText(gg.text,ag*this.scaleX,Ig*this.scaleY),eg.restore()}}countDate(){if(this.barcodeDateFormatType&&this.increaseDate){const eg=formatDate(this.barcodeDateFormatType);return console.log("formatted",eg),this.dirty=!0,this.setBarcodeOption({bcid:this.barcodeOptions.bcid,text:eg}),eg}}countCurrent(eg){let gg=this.counterProps||eg;if(gg){let ig=gg;if(!ig.value&&ig.value!==0)return"";const ng=formatCounterValue(ig);return(ig.prefix&&ig.prefix.length>0?ig.prefix:"")+ng+(ig.suffix&&ig.suffix.length>0?ig.suffix:"")}return""}countNext(eg="print"){if(this.counterProps){let gg=this.counterProps;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);let ng=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const og=getNextCounterValue(gg);return og!==null&&(gg.value=og,this.counterProps.value=og),this.dirty=!0,this._cache.update=!0,ng}else return""}reviewRecover(){if(this.reviewValueArgs){const eg=this.reviewValueArgs;this.counterProps=eg,this.reviewValueArgs=null;const gg=formatCounterValue(eg);let ig=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"");this.setBarcodeOption({bcid:this.barcodeOptions.bcid,text:ig})}}calculateCheckDigit(eg){if(!/^\d{13}$/.test(eg))return"";let gg=0;for(let ig=0;ig<13;ig++){const ng=parseInt(eg[ig]);gg+=ng*(ig%2===0?3:1)}return(10-gg%10)%10}_render(eg){var ug,dg,bg,mg;let gg=cloneDeep(this.barcodeOptions);console.log("_render======",gg);let ig=gg.bcid==="ean13",ng=gg.bcid==="upca",og=gg.bcid==="upce",ag=gg.bcid==="ean8";if(this.scaleX!==1&&(this.scaleX=1),this.scaleY!==1&&(this.scaleY=1),this.orginTextgaps>Number(gg.textgaps),this.orginTextSize>Number(gg.textsize),gg.bcid==="gs1-128"){const hg=GS1Parser.process(gg.text);gg.text=GS1Parser.format(hg)}gg.textgaps=gg.textgaps||1,this.orginTextgaps=gg.textgaps||1,this.orginTextSize=gg.textsize||0,eg.font=`${gg.textsize}px ${gg.textfontname}`,gg.textgaps&&(eg.letterSpacing=gg.textgaps+"px");const Ig=eg.measureText(gg.text);let sg=Ig.width/this.scaleX,Cg=(Ig.actualBoundingBoxAscent+Ig.actualBoundingBoxDescent)/this.scaleY;this.orginTextWidth=sg,this.orginTextHeight=Cg,this.height>0||(this.height=Cg+30);const lg=["ean13","upca","upce","ean8"],Ag=!lg.includes(gg.bcid)&&(gg.textposition==="top"||gg.textposition==="bottom"),cg=Ag?Cg+this.barcodeTextGap:0;this._textLayoutInitialized&&(this.height=Math.max(1,this.height+cg-this._lastTextAreaHeight)),this._textLayoutInitialized=!0,this._lastTextAreaHeight=cg,this.barcodeTextHeight=Ag?Cg:0,this._lastTextVisible=Ag;let rg={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2};if(rg.textWidth=sg,rg.textHeight=Cg,gg.includetext=!1,gg.scale=1,gg.paddingleft=0,gg.paddingright=0,lg.includes(gg.bcid)&&(gg={...gg,includetext:!0,textyoffset:-10},gg.bcid==="upca"&&(gg.textyoffset=-15),delete gg.paddingtop,delete gg.paddingbottom,delete gg.paddingleft,delete gg.paddingright,delete gg.textposition,delete gg.textxalign),typeof this.fill=="string"){let hg=rgbaStringToHex8(this.fill);gg.barcolor=hexToHex6_blend(hg)}if(this._cache.update)if(console.log("this._cache.update=====",this._cache.update),/[\u4e00-\u9fff]/.test(gg.text||""))this._cache.error="Not Support zh-CN character",this._cache.canvas=void 0,this._cache.update=!1;else try{if(this._cache.canvas=generateCanvas(gg),lg.includes(gg.bcid)){const pg=this._cache.canvas,fg=pg.getContext("2d");if(fg){const Gg=Math.trunc(pg.height*.125);fg.clearRect(0,pg.height-Gg,pg.width,Gg)}}let hg=this._cache.canvas.width;if(!lg.includes(gg.bcid)){let pg=getTargetDpi();this.canvas&&pg===300&&(hg=hg*1.32)}if(this.stretchMode==="free"){if((!this.width||this.width<1)&&(this.width=hg),this.width>hg){let pg=Math.min(32,Math.max(1,Math.ceil(this.width/hg)));pg>1&&(gg.scale=pg,this._cache.canvas=generateCanvas(gg),console.log("barcodeOption=====",gg),hg=this._cache.canvas.width)}}else{const pg=this.barcodeBaseWidth??this.width;this.width=getBarcodeRenderWidth(pg,hg)}rg.w=this.width,rg.x=-this.width/2,this._cache.error&&(this._cache.error=void 0),this.setCoords(),(ug=this.canvas)==null||ug.requestRenderAll(),this._cache.update=!1,(dg=this.canvas)!=null&&dg.getActiveObject&&((bg=this.canvas)==null?void 0:bg.getActiveObject())===this&&((mg=this.canvas)==null||mg.fire("custom:object:changed",{target:this,action:"barcode"}))}catch(hg){console.warn("draw barcode",hg),this.dirty=!0,hg instanceof Error&&(console.log("error",hg.message),this._cache.error="error:"+hg.message),this._cache.canvas=void 0}if(eg.imageSmoothingEnabled=!1,this.strokeWidth>0&&typeof this.stroke=="string"&&(eg.lineWidth=this.strokeWidth,eg.strokeStyle=this.stroke,withObjectStrokeDash(eg,this,()=>eg.strokeRect(rg.x,rg.y,rg.w,rg.h))),rg.barcodeCanvas=this._cache.canvas,!this._cache.error&&rg.barcodeCanvas){this.strokeWidth>0&&(rg.x+=this.strokeWidth/2,rg.y+=this.strokeWidth/2);let hg=rg.h-(rg.textHeight||0)-this.strokeWidth/2,pg=rg.y;gg.textposition==="top"?(hg=hg-this.barcodeTextGap,pg=pg+rg.textHeight/this.scaleY+this.barcodeTextGap):gg.textposition==="bottom"?hg=hg-this.barcodeTextGap/this.scaleY:hg=rg.h-this.strokeWidth/2;let wg=rg.w-this.strokeWidth/2,Gg=hg;lg.includes(gg.bcid)&&(Gg=rg.h-this.strokeWidth/2),eg.drawImage(rg.barcodeCanvas,0,0,rg.barcodeCanvas.width,rg.barcodeCanvas.height,rg.x,pg,wg,Gg);let Zg=this.barcodeOptions.text;const yg=this.width;if(ig){let Bg=this.calcEAN13CheckDigit(Zg);Zg=Zg+""+Bg,eg.save();const Wg=Math.trunc(yg/95),$g=-rg.y-Math.trunc(Gg/6);let Ng=rg.x+Math.trunc(wg/13);eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let vg=rg.barcodeCanvas.width;this.width/vg===1&&(eg.letterSpacing="-2px"),eg.fillText(Zg[0],-Wg*2+Ng,$g),eg.fillText(Zg.slice(1,7),Wg*(3+42/2)+rg.x+Math.trunc(wg/10),$g),eg.fillText(Zg.slice(7),Wg*(50+42/2)+rg.x+Math.trunc(wg/10),$g),eg.restore()}else if(ag){let Bg=this.calcEAN8CheckDigit(Zg);Zg=Zg+""+Bg,eg.save();const Wg=Math.trunc(yg/67),$g=-rg.y-Math.trunc(Gg/6);rg.x+Math.trunc(wg/13),eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let Ng=rg.barcodeCanvas.width;this.width/Ng===1&&(eg.letterSpacing="-1px");const Xg=Wg*12+rg.x+4,Vg=Wg*55+rg.x-4;eg.fillText(Zg.slice(0,4),Xg,$g),eg.fillText(Zg.slice(4),Vg,$g),eg.restore()}else if(ng){eg.save();const Bg=-rg.y-Math.trunc(Gg/6),Wg=rg.x;let $g=this.calcUPCACheckDigit(Zg);Zg=Zg+""+$g,eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let Ng=rg.barcodeCanvas.width;this.width/Ng===1&&(eg.letterSpacing="-1px"),this.drawUPCAText(eg,Zg,yg,Bg,Wg),eg.restore()}else if(og){eg.save();const Bg=-rg.y-Math.trunc(Gg/8),Wg=rg.x;let $g=this.calcUPCECheckDigit(Zg);Zg=Zg+""+$g,console.log("digits========",Zg),eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top",this.drawUPCEText(eg,Zg,yg,Bg,Wg),eg.restore()}else this.drawText(eg,gg,rg)}if(eg.save(),/[\u4e00-\u9fff]/.test(gg.text||"")&&(this._cache.error="Not Support zh-CN character"),this._cache.error){const hg=wrapText(eg,this._cache.error,rg.w),pg=getLineHeight(eg);let fg=rg.y+pg;const wg=eg.fillStyle;eg.fillStyle="red";for(const Gg of hg)if(eg.fillText(Gg,rg.x,fg),fg+=pg,fg>rg.y+this.height)break;eg.fillStyle=wg}eg.restore(),console.log("_render barcode")}calcEAN13CheckDigit(eg){if(!/^\d{12}$/.test(eg))return"";let gg=0,ig=0;for(let ag=0;ag<12;ag++){const Ig=Number(eg[11-ag]);(ag+1)%2===1?gg+=Ig:ig+=Ig}const og=(gg+ig*3)%10;return og===0?0:10-og}calcEAN8CheckDigit(eg){if(!/^\d{7}$/.test(eg))return"";let gg=0,ig=0;for(let ag=0;ag<7;ag++){const Ig=Number(eg[6-ag]);(ag+1)%2===1?ig+=Ig:gg+=Ig}const og=(gg*3+ig)%10;return og===0?0:10-og}calcUPCACheckDigit(eg){if(!/^\d{11}$/.test(eg))return"";let gg=0,ig=0;for(let Ig=0;Ig<11;Ig++){const sg=parseInt(eg[Ig],10);(Ig+1)%2===1?gg+=sg:ig+=sg}const og=(gg*3+ig)%10;return(og===0?0:10-og).toString()}calcUPCECheckDigit(eg){if(!/^\d{7}$/.test(eg))return"";const gg=eg.split("").map(Number),ig=gg[0],[ng,og,ag,Ig,sg,Cg]=gg.slice(1);let lg="";switch(Cg){case 0:case 1:case 2:lg=`${ig}${ng}${og}${Cg}0000${ag}${Ig}${sg}`;break;case 3:lg=`${ig}${ng}${og}${ag}00000${Ig}${sg}`;break;case 4:lg=`${ig}${ng}${og}${ag}${Ig}00000${sg}`;break;default:lg=`${ig}${ng}${og}${ag}${Ig}${sg}0000${Cg}`}const Ag=lg.split("").map(Number);let cg=0;for(let rg=0;rg<Ag.length;rg++)rg%2===0?cg+=Ag[rg]*3:cg+=Ag[rg];return(10-cg%10)%10}drawUPCAText(eg,gg,ig,ng,og){const ag=gg[0],Ig=gg.substring(1,6),sg=gg.substring(6,11),Cg=gg[11],lg=ng,Ag=ig/95;[{text:ag,x:og+Ag*3.5},{text:Ig,x:og+Ag*28+10},{text:sg,x:og+Ag*67},{text:Cg,x:og+Ag*91.5+10}].forEach(rg=>{rg.text&&eg.fillText(rg.text,rg.x,lg)})}drawUPCEText(eg,gg,ig,ng,og){[{i:0,x:og+4},{i:1,x:og+ig*.25},{i:2,x:og+ig*.33},{i:3,x:og+ig*.44},{i:4,x:og+ig*.56},{i:5,x:og+ig*.68},{i:6,x:og+ig*.78},{i:7,x:og+ig+4}].forEach(Ig=>{gg[Ig.i]&&eg.fillText(gg[Ig.i],Ig.x,ng)})}set(eg,gg){return this._cache&&(this._cache.update=!0),super.set(eg,gg)}setBarcodeOption(eg){eg.bcid!==this.barcodeOptions.bcid&&(this.barcodeBaseWidth=void 0),merge(this.barcodeOptions,eg),this.dirty=!0,this._cache.update=!0;let gg=this.group;for(;gg;)gg.dirty=!0,gg=gg.group;let ig=getAllObjectMap();this.updateBarCode2d([...ig.text,...ig.counter])}updateInGroup(){this.dirty=!0,this.setCoords();let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}getBarcodeOption(){return cloneDeep(this.barcodeOptions)}async updateBarCode2d(eg=[],gg=""){var ig;if(this.concatTextIdListObj||this.connectObjIds&&this.connectObjIds.length>0){let ng=!1,og="",ag=[],Ig=[];const sg=lg=>{if(this.connectObjIds){let Ag=0;for(let cg of this.connectObjIds){if(cg.index=Ag,cg.id&&cg.id===lg.id){ng=!0;let rg=lg.text+"";if(lg.type==="counter"&&(lg._props.mode==="1"?rg=lg.countCurrent():lg._props.mode==="2"&&(lg.updateText({isUpdateBarCodeDate:!1}),rg=lg.text+"")),cg.maxEnd=rg.length,cg.isSplit){cg.start=Math.min(cg.start,cg.maxEnd);let ug=rg.slice(cg.start,cg.end);ag[Ag]=ug}else ag[Ag]=rg}Ag++}}},Cg=lg=>{lg.type==="text"&&this.concatTextIdListObj&&this.concatTextIdListObj[lg.id]&&(ng||(lg==null||lg.set("text",this.barcodeOptions.text),lg.updateInGroup()),Ig.push(lg))};if(eg.length>0)eg.forEach(lg=>{sg(lg),Cg(lg)});else{const lg=Ag=>{Ag.type==="group"&&Ag._objects?Ag._objects.forEach(cg=>lg(cg)):(sg(Ag),Cg(Ag))};(ig=this.canvas)==null||ig.getObjects().forEach(Ag=>lg(Ag))}return ng?(og=ag.join(""),this.barcodeOptions.text=og,this.dirty=!0,this._cache.update=!0,gg&&this.updateInGroup(),Ig.forEach(lg=>{lg.updateInGroup(),lg==null||lg.set("text",og)}),setTimeout(()=>{var lg;(lg=this.canvas)==null||lg.requestRenderAll()},0),og):""}else return""}toObject(eg){let gg=["barcodeOptions","connectObjIds","concatTextIdListObj","counterProps","increaseDate","barcodeDateFormatType","stretchMode","barcodeTextHeight","barcodeTextGap"];return super.toObject(eg?[...eg,...gg]:gg)}};Pl.type="Barcode";let ABarcode=Pl;ABarcode.fromObject=(tg,eg)=>ABarcode._fromObject(tg,{...eg,extraParam:"barcodeOptions"}),tt.setClass(ABarcode),tt.setSVGClass(ABarcode);function getBase64Data({x:tg=0,y:eg=0,Content:gg="",ErrLevel:ig=1,Width:ng=0,Height:og=0,id:ag="",rWidth:Ig=0,rHeight:sg=0,CellSize:Cg="8"}={},lg=""){let Ag=ng/(og||1),cg=`${gg}-${ig}-${ng+og}-${Ag}-${Cg}`;if(lpCodeMap.has(cg)){let rg=lpCodeMap.get(cg);return lg!=="noSaveCache"&&setCacheLpCode({sKey:cg,img:rg,rWidth:Ig,rHeight:sg,x:tg,y:eg}),rg}return new Promise(async(rg,ug)=>{console.log("getLongbeiBase64Data=====");let dg=[JSON.stringify({Content:gg,ErrLevel:ig,Width:ng,Height:og,CellSize:Cg})],bg=await window.dsapi.driverAction.DSLE_Custom_LPCodeCreate(dg);if(bg=JSON.parse(bg),bg.code===0){let mg=bg.payload;if(mg){let hg=await loadBase64ToPic(mg);lpCodeMap.set(cg,hg),lg!=="noSaveCache"&&setCacheLpCode({sKey:cg,img:hg,rWidth:Ig,rHeight:sg,x:tg,y:eg}),rg(hg)}else ug("")}else ug(bg)})}function getMixBase64Data({x:tg=0,y:eg=0,Content:gg="",ErrLevel:ig="",Width:ng=0,Height:og=0,id:ag="",DPI:Ig=203,rWidth:sg=0,rHeight:Cg=0,CellSize:lg="8"}={},Ag=""){let cg=ng/(og||1),rg=`${gg}-${ig}-${ng+og}-${cg}-${lg}`;if(lpCodeMap.has(rg)){let ug=lpCodeMap.get(rg);return Ag!=="noSaveCache"&&setCacheMixLpCode({sKey:rg,img:ug,rWidth:sg,rHeight:Cg,x:tg,y:eg}),ug}return new Promise(async(ug,dg)=>{console.log("getMixLongbeiBase64Data=====");let bg=ig.split("-"),mg=bg[0]||"0",hg=bg[1]||"0",pg=gg.split("|&&&|"),fg=pg.shift(),wg=pg.join("")||fg,Gg=[JSON.stringify({LPContent:fg||"",LPErrLevel:mg,QRContent:wg,QRErrLevel:hg,Width:ng,Height:og,DPI:Ig+"",CellSize:lg})],Zg=await window.dsapi.driverAction.DSLE_Custom_LPMixCreate(Gg);if(Zg=JSON.parse(Zg),Zg.code===0){let yg=Zg.payload;if(yg){let Bg=await loadBase64ToPic(yg);lpCodeMap.set(rg,Bg),Ag!=="noSaveCache"&&setCacheMixLpCode({sKey:rg,img:Bg,rWidth:sg,rHeight:Cg,x:tg,y:eg}),ug(Bg)}else dg("")}else dg(Zg)})}function loadBase64ToPic(tg){return new Promise(async(eg,gg)=>{let ig=new Image;ig.onload=()=>{eg(ig)},ig.src=tg})}let maxCacheLength=2e3;function setCacheLpCode({x:tg=0,y:eg=0,id:gg="",sKey:ig="",img:ng=null,rWidth:og=0,rHeight:ag=0}={}){if(!ig||!ng||!gg)return;let Ig={sKey:ig,img:ng,rWidth:og,rHeight:ag,x:tg,y:eg};if(!cacheLpCodeMap.has(gg))cacheLpCodeMap.set(gg,[Ig]);else{let sg=cacheLpCodeMap.get(gg);sg.length>maxCacheLength&&sg.splice(0,500),sg.push(Ig),cacheLpCodeMap.set(gg,sg)}}function setCacheMixLpCode({x:tg=0,y:eg=0,id:gg="",sKey:ig="",img:ng=null,rWidth:og=0,rHeight:ag=0}={}){if(!ig||!ng||!gg)return;let Ig={sKey:ig,img:ng,rWidth:og,rHeight:ag,x:tg,y:eg};if(!cacheMixLpCodeMap.has(gg))cacheMixLpCodeMap.set(gg,[Ig]);else{let sg=cacheMixLpCodeMap.get(gg);sg.length>maxCacheLength&&sg.splice(0,500),sg.push(Ig),cacheMixLpCodeMap.set(gg,sg)}console.log("cacheMixLpCodeMap========",cacheMixLpCodeMap)}class cappedMap extends Map{constructor(eg=60){super(),this.limit=eg}set(eg,gg){if(!this.has(eg)&&this.size>=this.limit){const ig=this.keys().next().value;this.delete(ig)}return super.set(eg,gg)}}class fastMap extends Map{constructor(eg=60){super(),this.lastKey=null,this.limit=eg}set(eg,gg){if(!this.has(eg)&&this.size>=this.limit){const ig=this.keys().next().value;this.delete(ig)}return this.lastKey=eg,super.set(eg,gg)}getLast(){return super.get(this.lastKey)||null}}let cacheMixLpCodeMap=new fastMap(2e3),cacheLpCodeMap=new fastMap(2e3),errorLpCodeMap=new cappedMap(5555),lpCodeMap=new cappedMap(5555),lpBcid=["LPCode","LPMixQrCode"];function clearLpAndMixCacheById(tg){cacheMixLpCodeMap.has(tg)&&cacheMixLpCodeMap.delete(tg),cacheLpCodeMap.has(tg)&&cacheLpCodeMap.delete(tg)}function getLastCacheLpcode(tg){let eg=cacheLpCodeMap.get(tg);return eg?eg[eg.length-1]:null}function getLastMixCacheLpcode(tg){let eg=cacheMixLpCodeMap.get(tg);return eg?eg[eg.length-1]:null}const isff=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function addEvent(tg,eg,gg,ig){tg.addEventListener?tg.addEventListener(eg,gg,ig):tg.attachEvent&&tg.attachEvent("on".concat(eg),gg)}function removeEvent(tg,eg,gg,ig){tg.removeEventListener?tg.removeEventListener(eg,gg,ig):tg.detachEvent&&tg.detachEvent("on".concat(eg),gg)}function getMods(tg,eg){const gg=eg.slice(0,eg.length-1);for(let ig=0;ig<gg.length;ig++)gg[ig]=tg[gg[ig].toLowerCase()];return gg}function getKeys(tg){typeof tg!="string"&&(tg=""),tg=tg.replace(/\s/g,"");const eg=tg.split(",");let gg=eg.lastIndexOf("");for(;gg>=0;)eg[gg-1]+=",",eg.splice(gg,1),gg=eg.lastIndexOf("");return eg}function compareArray(tg,eg){const gg=tg.length>=eg.length?tg:eg,ig=tg.length>=eg.length?eg:tg;let ng=!0;for(let og=0;og<gg.length;og++)ig.indexOf(gg[og])===-1&&(ng=!1);return ng}const _keyMap={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":isff?173:189,"=":isff?61:187,";":isff?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},_modifier={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},modifierMap={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},_mods={16:!1,18:!1,17:!1,91:!1},_handlers={};for(let tg=1;tg<20;tg++)_keyMap["f".concat(tg)]=111+tg;let _downKeys=[],winListendFocus=null,_scope="all";const elementEventMap=new Map,code=tg=>_keyMap[tg.toLowerCase()]||_modifier[tg.toLowerCase()]||tg.toUpperCase().charCodeAt(0),getKey=tg=>Object.keys(_keyMap).find(eg=>_keyMap[eg]===tg),getModifier=tg=>Object.keys(_modifier).find(eg=>_modifier[eg]===tg);function setScope(tg){_scope=tg||"all"}function getScope(){return _scope||"all"}function getPressedKeyCodes(){return _downKeys.slice(0)}function getPressedKeyString(){return _downKeys.map(tg=>getKey(tg)||getModifier(tg)||String.fromCharCode(tg))}function getAllKeyCodes(){const tg=[];return Object.keys(_handlers).forEach(eg=>{_handlers[eg].forEach(gg=>{let{key:ig,scope:ng,mods:og,shortcut:ag}=gg;tg.push({scope:ng,shortcut:ag,mods:og,keys:ig.split("+").map(Ig=>code(Ig))})})}),tg}function filter(tg){const eg=tg.target||tg.srcElement,{tagName:gg}=eg;let ig=!0;const ng=gg==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(eg.type);return(eg.isContentEditable||(ng||gg==="TEXTAREA"||gg==="SELECT")&&!eg.readOnly)&&(ig=!1),ig}function isPressed(tg){return typeof tg=="string"&&(tg=code(tg)),_downKeys.indexOf(tg)!==-1}function deleteScope(tg,eg){let gg,ig;tg||(tg=getScope());for(const ng in _handlers)if(Object.prototype.hasOwnProperty.call(_handlers,ng))for(gg=_handlers[ng],ig=0;ig<gg.length;)gg[ig].scope===tg?gg.splice(ig,1).forEach(ag=>{let{element:Ig}=ag;return removeKeyEvent(Ig)}):ig++;getScope()===tg&&setScope(eg||"all")}function clearModifier(tg){let eg=tg.keyCode||tg.which||tg.charCode;tg.key&&tg.key.toLowerCase()==="capslock"&&(eg=code(tg.key));const gg=_downKeys.indexOf(eg);if(gg>=0&&_downKeys.splice(gg,1),tg.key&&tg.key.toLowerCase()==="meta"&&_downKeys.splice(0,_downKeys.length),(eg===93||eg===224)&&(eg=91),eg in _mods){_mods[eg]=!1;for(const ig in _modifier)_modifier[ig]===eg&&(hotkeys[ig]=!1)}}function unbind(tg){if(typeof tg>"u")Object.keys(_handlers).forEach(ng=>{Array.isArray(_handlers[ng])&&_handlers[ng].forEach(og=>eachUnbind(og)),delete _handlers[ng]}),removeKeyEvent(null);else if(Array.isArray(tg))tg.forEach(ng=>{ng.key&&eachUnbind(ng)});else if(typeof tg=="object")tg.key&&eachUnbind(tg);else if(typeof tg=="string"){for(var eg=arguments.length,gg=new Array(eg>1?eg-1:0),ig=1;ig<eg;ig++)gg[ig-1]=arguments[ig];let[ng,og]=gg;typeof ng=="function"&&(og=ng,ng=""),eachUnbind({key:tg,scope:ng,method:og,splitKey:"+"})}}const eachUnbind=tg=>{let{key:eg,scope:gg,method:ig,splitKey:ng="+"}=tg;getKeys(eg).forEach(ag=>{const Ig=ag.split(ng),sg=Ig.length,Cg=Ig[sg-1],lg=Cg==="*"?"*":code(Cg);if(!_handlers[lg])return;gg||(gg=getScope());const Ag=sg>1?getMods(_modifier,Ig):[],cg=[];_handlers[lg]=_handlers[lg].filter(rg=>{const dg=(ig?rg.method===ig:!0)&&rg.scope===gg&&compareArray(rg.mods,Ag);return dg&&cg.push(rg.element),!dg}),cg.forEach(rg=>removeKeyEvent(rg))})};function eventHandler(tg,eg,gg,ig){if(eg.element!==ig)return;let ng;if(eg.scope===gg||eg.scope==="all"){ng=eg.mods.length>0;for(const og in _mods)Object.prototype.hasOwnProperty.call(_mods,og)&&(!_mods[og]&&eg.mods.indexOf(+og)>-1||_mods[og]&&eg.mods.indexOf(+og)===-1)&&(ng=!1);(eg.mods.length===0&&!_mods[16]&&!_mods[18]&&!_mods[17]&&!_mods[91]||ng||eg.shortcut==="*")&&(eg.keys=[],eg.keys=eg.keys.concat(_downKeys),eg.method(tg,eg)===!1&&(tg.preventDefault?tg.preventDefault():tg.returnValue=!1,tg.stopPropagation&&tg.stopPropagation(),tg.cancelBubble&&(tg.cancelBubble=!0)))}}function dispatch(tg,eg){const gg=_handlers["*"];let ig=tg.keyCode||tg.which||tg.charCode;if(tg.key&&tg.key.toLowerCase()==="capslock"||!hotkeys.filter.call(this,tg))return;if((ig===93||ig===224)&&(ig=91),_downKeys.indexOf(ig)===-1&&ig!==229&&_downKeys.push(ig),["metaKey","ctrlKey","altKey","shiftKey"].forEach(Ig=>{const sg=modifierMap[Ig];tg[Ig]&&_downKeys.indexOf(sg)===-1?_downKeys.push(sg):!tg[Ig]&&_downKeys.indexOf(sg)>-1?_downKeys.splice(_downKeys.indexOf(sg),1):Ig==="metaKey"&&tg[Ig]&&(_downKeys=_downKeys.filter(Cg=>Cg in modifierMap||Cg===ig))}),ig in _mods){_mods[ig]=!0;for(const Ig in _modifier)if(Object.prototype.hasOwnProperty.call(_modifier,Ig)){const sg=modifierMap[_modifier[Ig]];hotkeys[Ig]=tg[sg]}if(!gg)return}for(const Ig in _mods)Object.prototype.hasOwnProperty.call(_mods,Ig)&&(_mods[Ig]=tg[modifierMap[Ig]]);tg.getModifierState&&!(tg.altKey&&!tg.ctrlKey)&&tg.getModifierState("AltGraph")&&(_downKeys.indexOf(17)===-1&&_downKeys.push(17),_downKeys.indexOf(18)===-1&&_downKeys.push(18),_mods[17]=!0,_mods[18]=!0);const ng=getScope();if(gg)for(let Ig=0;Ig<gg.length;Ig++)gg[Ig].scope===ng&&(tg.type==="keydown"&&gg[Ig].keydown||tg.type==="keyup"&&gg[Ig].keyup)&&eventHandler(tg,gg[Ig],ng,eg);if(!(ig in _handlers))return;const og=_handlers[ig],ag=og.length;for(let Ig=0;Ig<ag;Ig++)if((tg.type==="keydown"&&og[Ig].keydown||tg.type==="keyup"&&og[Ig].keyup)&&og[Ig].key){const sg=og[Ig],{splitKey:Cg}=sg,lg=sg.key.split(Cg),Ag=[];for(let cg=0;cg<lg.length;cg++)Ag.push(code(lg[cg]));Ag.sort().join("")===_downKeys.sort().join("")&&eventHandler(tg,sg,ng,eg)}}function hotkeys(tg,eg,gg){_downKeys=[];const ig=getKeys(tg);let ng=[],og="all",ag=document,Ig=0,sg=!1,Cg=!0,lg="+",Ag=!1,cg=!1;for(gg===void 0&&typeof eg=="function"&&(gg=eg),Object.prototype.toString.call(eg)==="[object Object]"&&(eg.scope&&(og=eg.scope),eg.element&&(ag=eg.element),eg.keyup&&(sg=eg.keyup),eg.keydown!==void 0&&(Cg=eg.keydown),eg.capture!==void 0&&(Ag=eg.capture),typeof eg.splitKey=="string"&&(lg=eg.splitKey),eg.single===!0&&(cg=!0)),typeof eg=="string"&&(og=eg),cg&&unbind(tg,og);Ig<ig.length;Ig++)tg=ig[Ig].split(lg),ng=[],tg.length>1&&(ng=getMods(_modifier,tg)),tg=tg[tg.length-1],tg=tg==="*"?"*":code(tg),tg in _handlers||(_handlers[tg]=[]),_handlers[tg].push({keyup:sg,keydown:Cg,scope:og,mods:ng,shortcut:ig[Ig],method:gg,key:ig[Ig],splitKey:lg,element:ag});if(typeof ag<"u"&&window){if(!elementEventMap.has(ag)){const rg=function(){let dg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return dispatch(dg,ag)},ug=function(){let dg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;dispatch(dg,ag),clearModifier(dg)};elementEventMap.set(ag,{keydownListener:rg,keyupListenr:ug,capture:Ag}),addEvent(ag,"keydown",rg,Ag),addEvent(ag,"keyup",ug,Ag)}if(!winListendFocus){const rg=()=>{_downKeys=[]};winListendFocus={listener:rg,capture:Ag},addEvent(window,"focus",rg,Ag)}}}function trigger(tg){let eg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(_handlers).forEach(gg=>{_handlers[gg].filter(ng=>ng.scope===eg&&ng.shortcut===tg).forEach(ng=>{ng&&ng.method&&ng.method()})})}function removeKeyEvent(tg){const eg=Object.values(_handlers).flat();if(eg.findIndex(ig=>{let{element:ng}=ig;return ng===tg})<0){const{keydownListener:ig,keyupListenr:ng,capture:og}=elementEventMap.get(tg)||{};ig&&ng&&(removeEvent(tg,"keyup",ng,og),removeEvent(tg,"keydown",ig,og),elementEventMap.delete(tg))}if((eg.length<=0||elementEventMap.size<=0)&&(Object.keys(elementEventMap).forEach(ng=>{const{keydownListener:og,keyupListenr:ag,capture:Ig}=elementEventMap.get(ng)||{};og&&ag&&(removeEvent(ng,"keyup",ag,Ig),removeEvent(ng,"keydown",og,Ig),elementEventMap.delete(ng))}),elementEventMap.clear(),Object.keys(_handlers).forEach(ng=>delete _handlers[ng]),winListendFocus)){const{listener:ng,capture:og}=winListendFocus;removeEvent(window,"focus",ng,og),winListendFocus=null}}const _api={getPressedKeyString,setScope,getScope,deleteScope,getPressedKeyCodes,getAllKeyCodes,isPressed,filter,trigger,unbind,keyMap:_keyMap,modifier:_modifier,modifierMap};for(const tg in _api)Object.prototype.hasOwnProperty.call(_api,tg)&&(hotkeys[tg]=_api[tg]);if(typeof window<"u"){const tg=window.hotkeys;hotkeys.noConflict=eg=>(eg&&window.hotkeys===hotkeys&&(window.hotkeys=tg),hotkeys),window.hotkeys=hotkeys}class EditorData{constructor(){this.enabled=!0,this.dirty=!1,this.originState="",this.hasSetActiveSelection=!1,this.handle={selectionHandles:new Set,modifyHandles:new Set,mouseDownHandles:new Set,mouseUpHandles:new Set,doubleClickHandles:new Set,objectUpdateHandles:new Set,mouseOverHandles:new Set,mouseOutHandles:new Set,checkDirtyHandles:new Set},this.selectHandle=eg=>{if(this.enabled)for(const gg of this.handle.selectionHandles)if(eg.selected){const ig=this.canvas.getActiveObject();gg(eg.e,ig?[ig]:[]),this.canvas&&this.canvas.elements.container.focus({preventScroll:!0})}else gg(eg.e,[])},this.modifyHandle=throttle$3(eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))){if(eg.target)for(const gg of this.handle.modifyHandles)gg(eg.e,eg.target);this.checkDirty(eg)}},200),this.doubleClickHandle=eg=>{var gg,ig;if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target){eg.target.type==="table"&&eg.scenePoint&&(this.canvas.getActiveObject()!==eg.target&&(this.canvas.setActiveObject(eg.target,eg.e),this.canvas.requestRenderAll()),(ig=(gg=eg.target).handleCellDoubleClick)==null||ig.call(gg,eg.scenePoint));for(const ng of this.handle.doubleClickHandles)ng(eg.e,eg.target)}},this.mouseDownHandle=eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target)for(const gg of this.handle.mouseDownHandles)gg(eg.e,eg.target)},this.mouseUpHandle=eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target)for(const gg of this.handle.mouseUpHandles)gg(eg.e,eg.target)},this.checkDirty=debounce$2(eg=>{if(!this.canvas)return!1;const gg=this.canvas.toJSON(),ig=JSON.stringify(gg);this.originState||(this.originState=ig),this.dirty=this.originState!==ig,eg.isToDirty&&(this.dirty=!0),console.log("this.dirty=========",this.dirty);for(const ng of this.handle.checkDirtyHandles)ng();return this.dirty},100),this.objectUpdateHandle=debounce$2(eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))){for(const gg of this.handle.objectUpdateHandles)gg(eg.target);this.checkDirty(eg)}},100),this.mouseOver=eg=>{for(const gg of this.handle.mouseOverHandles)gg()},this.mouseOut=eg=>{for(const gg of this.handle.mouseOutHandles)gg()}}init(eg){this.editor=eg,this.canvas=eg.getCanvas(),this.bind(),this.originState=JSON.stringify(this.canvas.toJSON())}getActiveObject(){return this.canvas.getActiveObject()}getActiveObjects(){return this.canvas.getActiveObjects()}getObjects(){return this.canvas.getObjects()||[]}getAllObjects(){if(!this.canvas)return[];const eg=[];function gg(ig){ig.type==="group"&&ig._objects?ig._objects.forEach(ng=>gg(ng)):ig.id!=="workspace"&&eg.push(ig)}return this.canvas.getObjects().forEach(ig=>gg(ig)),eg}clearActiveSelection(){this.canvas&&this.hasSetActiveSelection&&(this.canvas.discardActiveObject(),this.canvas.requestRenderAll(),this.hasSetActiveSelection=!1)}setObjectsActive(eg){if(!(!this.canvas||eg.length===0)){if(this.canvas.discardActiveObject(),eg.length===1)this.canvas.setActiveObject(eg[0]);else{this.hasSetActiveSelection=!0;const gg=new Jo(eg,{canvas:this.canvas});this.canvas.setActiveObject(gg)}this.canvas.requestRenderAll()}}getObjectsList(){if(!this.canvas)return[];const eg=this.canvas.getObjects(),gg=[];for(const ig of eg)if(ig.id!=="workspace"&&ig.drawObjectType!=="ignoreObject"){if(ig instanceof Jo)continue;ig.parent?ig.parent instanceof Jo?gg.push(ig):console.log("obj.parent isn't ActiveSelection",ig.parent,ig.parent.type):gg.push(ig)}return gg}setActiveObjectProps(eg,gg=!0){if(this.canvas){const ig=this.canvas.getActiveObject();if(ig){for(const ng in eg)console.error("objet set",ng,eg[ng]),ig.type==="text"?(ig.set(ng,eg[ng]),ig.splitByGrapheme&&ig.verticalTypeChange()):ig.set(ng,eg[ng]);return gg&&this.canvas.fire("custom:object:history",{target:ig,action:"history:update"}),!0}}return!1}setActiveObjectPos(eg){var gg;this.setActiveObjectProps(eg)&&((gg=this.canvas)==null||gg.getActiveObject().setCoords())}updateCanvas(){this.canvas.renderAll()}addModifyHandle(eg){this.handle.modifyHandles.add(eg)}addSelectionHandle(eg){this.handle.selectionHandles.add(eg)}addMouseDownHandle(eg){this.handle.mouseDownHandles.add(eg)}addMouseUpHandle(eg){this.handle.mouseUpHandles.add(eg)}addDoubleClickHandle(eg){this.handle.doubleClickHandles.add(eg)}addObjectUpdateHandle(eg){this.handle.objectUpdateHandles.add(eg)}addMouseOverHandle(eg){this.handle.mouseOverHandles.add(eg)}addMouseOutHandle(eg){this.handle.mouseOutHandles.add(eg)}removeMouseOverHandle(eg){this.handle.mouseOverHandles.delete(eg)}removeMouseOutHandle(eg){this.handle.mouseOutHandles.delete(eg)}removeModifyHandle(eg){this.handle.modifyHandles.delete(eg)}removeSelectionHandle(eg){this.handle.selectionHandles.delete(eg)}removeMouseDownHandle(eg){this.handle.mouseDownHandles.delete(eg)}removeMouseUpHandle(eg){this.handle.mouseUpHandles.delete(eg)}removeDoubleClickHandle(eg){this.handle.doubleClickHandles.delete(eg)}remvoeObjectUpdateHandle(eg){this.handle.objectUpdateHandles.delete(eg)}addCheckDirtyHandles(eg){this.handle.checkDirtyHandles.add(eg)}removeCheckDirtyHandles(eg){this.handle.checkDirtyHandles.delete(eg)}setOriginState(){if(!this.canvas)return!1;const eg=this.canvas.toJSON(),gg=JSON.stringify(eg);this.originState=gg}isWorkspace(eg){return eg&&eg.id==="workspace"}setEnabled(eg){this.enabled=eg}bind(){if(!this.canvas)return;const eg=this.canvas,gg=eg.findTarget.bind(eg);eg.findTarget=ig=>{if(ig&&ig.type==="dblclick"){const ng=[],og=[];for(const Ig of eg.getObjects())Ig.type==="table"&&Ig.perPixelTargetFind&&(ng.push(Ig),og.push(Ig.perPixelTargetFind),Ig.perPixelTargetFind=!1);const ag=gg(ig);return ng.forEach((Ig,sg)=>{Ig.perPixelTargetFind=og[sg]}),ag}return gg(ig)},eg.on("selection:created",this.selectHandle),eg.on("selection:updated",this.selectHandle),eg.on("selection:cleared",this.selectHandle),eg.on("object:modified",this.modifyHandle),eg.on("object:scaling",this.modifyHandle),eg.on("object:rotating",this.modifyHandle),eg.on("object:moving",this.modifyHandle),eg.on("object:skewing",this.modifyHandle),eg.on("custom:object:changed",this.modifyHandle),eg.on("custom:object:basechanged",this.modifyHandle),eg.on("mouse:dblclick",this.doubleClickHandle),eg.on("mouse:down",this.mouseDownHandle),eg.on("mouse:up",this.mouseUpHandle),eg.on("object:added",this.objectUpdateHandle),eg.on("object:removed",this.objectUpdateHandle),eg.on("custom:object:checkdirty",this.checkDirty),this.editor.on("group",this.objectUpdateHandle),this.editor.on("ungroup",this.objectUpdateHandle)}unbind(){if(!this.canvas)return;const eg=this.canvas;eg.off("selection:created",this.selectHandle),eg.off("selection:updated",this.selectHandle),eg.off("selection:cleared",this.selectHandle),eg.off("object:modified",this.modifyHandle),eg.off("object:scaling",this.modifyHandle),eg.off("object:rotating",this.modifyHandle),eg.off("object:moving",this.modifyHandle),eg.off("object:skewing",this.modifyHandle),eg.off("custom:object:changed",this.modifyHandle),eg.off("custom:object:basechanged",this.modifyHandle),eg.off("mouse:dblclick",this.doubleClickHandle),eg.off("mouse:down",this.mouseDownHandle),eg.off("mouse:up",this.mouseUpHandle),eg.off("object:added",this.objectUpdateHandle),eg.off("object:removed",this.objectUpdateHandle),eg.off("custom:object:checkdirty",this.checkDirty),this.editor.off("group",this.objectUpdateHandle),this.editor.off("ungroup",this.objectUpdateHandle)}}const byteToHex=[];for(let tg=0;tg<256;++tg)byteToHex.push((tg+256).toString(16).slice(1));function unsafeStringify(tg,eg=0){return(byteToHex[tg[eg+0]]+byteToHex[tg[eg+1]]+byteToHex[tg[eg+2]]+byteToHex[tg[eg+3]]+"-"+byteToHex[tg[eg+4]]+byteToHex[tg[eg+5]]+"-"+byteToHex[tg[eg+6]]+byteToHex[tg[eg+7]]+"-"+byteToHex[tg[eg+8]]+byteToHex[tg[eg+9]]+"-"+byteToHex[tg[eg+10]]+byteToHex[tg[eg+11]]+byteToHex[tg[eg+12]]+byteToHex[tg[eg+13]]+byteToHex[tg[eg+14]]+byteToHex[tg[eg+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(tg,eg,gg){var ng;if(native.randomUUID&&!tg)return native.randomUUID();tg=tg||{};const ig=tg.random??((ng=tg.rng)==null?void 0:ng.call(tg))??rng();if(ig.length<16)throw new Error("Random bytes length must be >= 16");return ig[6]=ig[6]&15|64,ig[8]=ig[8]&63|128,unsafeStringify(ig)}function handleConcatBarcode2d(tg,eg,gg=!0,ig=null){if(tg){let ng=[],og=getAllObjectMap(eg);ng=[...og.text,...og.counter];let ag=[...og.barcode2d],Ig=[...og.barcode],sg={};ag.forEach(lg=>{sg[lg.id]=lg});let Cg={};Ig.forEach(lg=>{Cg[lg.id]=lg});for(let lg of Object.keys(tg)){if(ag.length){let Ag=sg[lg];if(!Ag)return;let cg=!0;if(ig&&ig.type==="counter"&&ig.data==="2"&&(Ag.barcode2dOptions.bcid==="LPCode"?(cg=!Ag.hasLpemit,Ag.hasLpemit=!0):Ag.barcode2dOptions.bcid==="LPMixQrCode"&&(cg=!Ag.hasLpMixemit,Ag.hasLpMixemit=!0)),!cg)return;canvasEventBus.emit(`update:barcode2d:${lg}`,{list:ng,callback:rg=>{Ag.dirty=!0,Ag.barcode2dOptions.text=rg||Ag.barcode2dOptions.text,Ag.updateInGroup(),gg&&setTimeout(()=>{eg==null||eg.requestRenderAll()},30)}})}if(Ig.length){let Ag=Cg[lg];if(!Ag)return;canvasEventBus.emit(`update:barcode:${lg}`,{list:ng,callback:cg=>{Ag.dirty=!0,Ag.barcodeOptions.text=cg||Ag.barcodeOptions.text,Ag.updateInGroup(),gg&&setTimeout(()=>{eg==null||eg.requestRenderAll(),Ag.group&&setTimeout(()=>{Ag.updateInGroup(),eg==null||eg.requestRenderAll()},0)},30)}})}}}}function addHandle(tg,eg,gg){if(tg){let ig={},ng=getAllObjectMap(eg);[...ng.barcode2d,...ng.barcode].forEach(ag=>{ig[ag.id]=ag});for(let ag of Object.keys(tg)){let Ig=ig[ag];if(Ig){let sg=Ig.connectObjIds||[],Cg=cacheObj[gg];Cg&&(sg.some(lg=>lg.id===Cg.id)||(sg.splice(Cg.index,0,Cg),Ig.set("connectObjIds",sg)))}}}}let cacheObj={};function deleteHandle(tg,eg,gg){if(tg){let ig={},ng=getAllObjectMap(eg);[...ng.barcode2d,...ng.barcode].forEach(ag=>{ig[ag.id]=ag});for(let ag of Object.keys(tg)){let Ig=ig[ag];if(Ig){let sg=Ig.connectObjIds||[];sg=sg.filter(Cg=>(Cg.id===gg&&(cacheObj[gg]=Cg),Cg.id!==gg)),Ig.set("connectObjIds",sg)}}}}const eC=class eC extends No{constructor(eg,gg){if(super(eg,gg),this.hasSetSplit=!1,this.objectCaching=!0,this.hasSetItalic=!1,this.isClearCopyTextStyle=!1,this.propsMinHeight=0,this.strokeUniform=!0,this.isBgBlackColor=!1,this.customExportFields={varnish:"none"},this.backgroundColor="",this.connectBar2dMap=null,this.__canvasRef=null,this.fontFamily="微软雅黑",this.verticalType="top",this.arcEnable=!1,this.arcRadius=100,this.customExportFields=gg.customExportFields??this.customExportFields,this._originGetTopOffset=this._getTopOffset?this._getTopOffset.bind(this):()=>0,this.fontFamily=gg.fontFamily??this.fontFamily,gg.hasSetItalic&&gg.fontStyle!=="italic"&&(this.fontStyle="italic",gg.skewX===-15&&(this.skewX=0)),gg.propsMinHeight){this.propsMinHeight=gg.propsMinHeight;let ig=Math.max(this.height,this.propsMinHeight);this.height=ig}gg.verticalType&&(this.verticalType=gg.verticalType),gg.backgroundColor&&(this.backgroundColor=gg.backgroundColor),this.isBgBlackColor=gg.isBgBlackColor??this.isBgBlackColor,this.connectBar2dMap=gg.connectBar2dMap??this.connectBar2dMap,gg.arcEnable!==void 0&&(this.arcEnable=gg.arcEnable),gg.arcRadius!==void 0&&(this.arcRadius=gg.arcRadius),this.on("removed",ig=>{if(ig.target.type!=="activeselection"){if(this.inGroupRemove){this.inGroupRemove=!1;return}deleteHandle(this.connectBar2dMap,this.__canvasRef,this.id)}}),this.on("added",()=>{this.__canvasRef=this.canvas,addHandle(this.connectBar2dMap,this.__canvasRef,this.id)}),this.on("modified",ig=>{(ig==null?void 0:ig.action)!=="drag"&&this.type==="text"&&(this.verticalTypeChange(),this.tiggerHandleConcatBarcode2d())}),this.on("changed",()=>{this.type==="text"&&this.verticalTypeChange()}),this.verticalTypeChange()}tiggerHandleConcatBarcode2d(){this.connectBar2dMap&&handleConcatBarcode2d(this.connectBar2dMap,this.canvas)}updateInGroup(){this.dirty=!0,this.setCoords();let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}_calcTextHeight(){const eg=this._textLines&&this._textLines.length||0,gg=this.fontSize*this.lineHeight,ig=(this.padding||0)*2;return eg*gg+ig}verticalTypeChange(){var gg;if(!this.splitByGrapheme||!this.propsMinHeight)return;const eg=Math.max(this._calcTextHeight(),this.propsMinHeight);this.height!==eg&&(this.height=eg),this.verticalType==="top"?this._getTopOffset=this._originGetTopOffset:this.verticalType==="vcenter"?this._getTopOffset=()=>{let ig=this._calcTextHeight();return(this.fontSize*this.lineHeight-this.fontSize)/2-ig/2}:this.verticalType==="bottom"&&(this._getTopOffset=()=>{const ig=this._calcTextHeight(),og=Math.max(ig,this.propsMinHeight)-ig;return this._originGetTopOffset()+og}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}set(eg,gg){if(eg==="hasSetItalic")return this.hasSetItalic=!1,gg===!0?super.set("fontStyle","italic"):this;if(typeof eg=="object"&&eg){const ig={...eg};return"hasSetItalic"in ig&&(ig.hasSetItalic===!0&&(ig.fontStyle="italic"),delete ig.hasSetItalic),super.set(ig)}return(eg==="fill"||eg==="stroke"||eg==="underline"||eg==="overline"||eg==="linethrough"||eg==="fontWeight"||eg==="fontStyle")&&(this.styles={}),super.set(eg,gg)}set locked(eg){super.locked=eg,this.editable=!eg}get locked(){return super.locked}_measureLine(eg){let gg=this._textLines[eg];return Array.isArray(gg)&&(gg=gg.map(ig=>ig.replace(" "," "))),this._textLines[eg]=gg,super._measureLine(eg)}getStandardSpaceWidth(eg=" ",gg="Arial"){const ng=kn.createCanvasElement().getContext("2d");let og=0;return ng&&(ng.font=`${this.fontSize}px ${gg}`,og=ng.measureText(eg).width),og}getTextWidth(eg="",gg=0,ig="Arial"){const og=kn.createCanvasElement().getContext("2d");let ag=0;return og&&(og.font=`${gg}px ${ig}`,ag=og.measureText(eg).width),ag}getTextHeight(eg="测",gg=!0){const ng=kn.createCanvasElement().getContext("2d");let og=0;if(ng){ng.font=`${this.fontSize}px ${this.fontFamily}`;let ag=ng.measureText(eg);og=ag.fontBoundingBoxAscent+ag.fontBoundingBoxDescent+(gg?Math.trunc(this.fontSize/3):0)}return og*this._textLines.length}_measureChar(eg,gg,ig,ng){if(eg!==" "&&eg!==" ")return super._measureChar(eg,gg,ig,ng);{const og=this.getStandardSpaceWidth(" ",this.fontFamily);return{width:og,kernedWidth:og}}}parseColor(eg){if(!eg)return null;if(eg.startsWith("#")){let ig=eg.slice(1);ig.length===3&&(ig=ig.split("").map(og=>og+og).join(""));const ng=parseInt(ig,16);return{r:ng>>16&255,g:ng>>8&255,b:ng&255,a:1}}const gg=eg.match(/rgba?\(([^)]+)\)/);if(gg){const[ig,ng,og,ag=1]=gg[1].split(",").map(Ig=>Number(Ig.trim()));return{r:ig,g:ng,b:og,a:ag}}return null}luminance({r:eg,g:gg,b:ig}){return .2126*eg+.7152*gg+.0722*ig}isDark(eg,gg=40){const ig=this.parseColor(eg);return ig?this.luminance(ig)<=gg:!1}_renderArcText(eg){const gg=this.text.replace(/\u00A0/g," "),ig=this.fontSize,ng=Math.abs(this.arcRadius),og=this.arcRadius>=0;eg.save(),eg.font=`${this.fontStyle==="italic"?"italic ":""}${this.fontWeight==="bold"?"bold ":""}${ig}px ${this.fontFamily}`,eg.fillStyle=this.fill||"#000000",eg.textAlign="center",eg.textBaseline="middle";const ag=(this.charSpacing||0)/1e3*ig,Ig=[];let sg=0;for(const ug of gg){const dg=eg.measureText(ug).width+ag;Ig.push(dg),sg+=dg}const Cg=sg/ng,lg=ng-ng*Math.cos(Cg/2),Ag=og?ng-lg/2:-(ng-lg/2);let rg=(og?-Math.PI/2:Math.PI/2)-Cg/2;for(let ug=0;ug<gg.length;ug++){const dg=gg[ug],bg=Ig[ug]/2,mg=rg+bg/ng,hg=Math.cos(mg)*ng,pg=Math.sin(mg)*ng;eg.save(),eg.translate(hg,Ag+pg),og?eg.rotate(mg+Math.PI/2):eg.rotate(mg-Math.PI/2),eg.fillText(dg,0,0),eg.restore(),rg+=Ig[ug]/ng}eg.restore()}_getArcParams(){const eg=this.text.replace(/\u00A0/g," "),gg=this.fontSize,ig=Math.abs(this.arcRadius),ng=this.arcRadius>=0,ag=kn.createCanvasElement().getContext("2d");ag.font=`${this.fontStyle==="italic"?"italic ":""}${this.fontWeight==="bold"?"bold ":""}${gg}px ${this.fontFamily}`;const Ig=(this.charSpacing||0)/1e3*gg,sg=[];let Cg=0;for(const ug of eg){const dg=ag.measureText(ug).width+Ig;sg.push(dg),Cg+=dg}const lg=Cg/ig,Ag=ig-ig*Math.cos(lg/2),cg=ng?ig-Ag/2:-(ig-Ag/2),rg=ng?-Math.PI/2:Math.PI/2;return{text:eg,fontSize:gg,r:ig,bendUp:ng,charWidths:sg,totalWidth:Cg,totalAngle:lg,sagitta:Ag,circleCenterOffsetY:cg,baseAngle:rg}}_getArcCursorInfo(eg){const{text:gg,r:ig,bendUp:ng,charWidths:og,totalAngle:ag,circleCenterOffsetY:Ig,baseAngle:sg}=this._getArcParams();let Cg=0;for(let bg=0;bg<Math.min(eg,gg.length);bg++)Cg+=og[bg]/ig;const lg=sg-ag/2+Cg,Ag=Math.cos(lg)*ig,cg=Math.sin(lg)*ig,rg=Ag,ug=Ig+cg,dg=ng?lg+Math.PI/2:lg-Math.PI/2;return{x:rg,y:ug,angle:dg}}_calcArcBoundingBox(){const{text:eg,r:gg,bendUp:ig,charWidths:ng,totalAngle:og,circleCenterOffsetY:ag,baseAngle:Ig}=this._getArcParams(),sg=this.fontSize,Cg=sg/2+4;if(!eg.length)return{w:sg+Cg*2,h:sg*1.2+Cg*2};let lg=1/0,Ag=-1/0,cg=1/0,rg=-1/0,ug=Ig-og/2;for(let mg=0;mg<eg.length;mg++){const hg=ug,pg=ug+ng[mg]/gg,fg=(hg+pg)/2,wg=Math.cos(fg)*gg,Gg=Math.sin(fg)*gg,Zg=wg,yg=ag+Gg,Bg=ig?fg+Math.PI/2:fg-Math.PI/2,Wg=Math.cos(Bg),$g=Math.sin(Bg),Ng=ng[mg]/2+Cg,vg=sg/2+Cg,Xg=[{dx:-Ng,dy:-vg},{dx:Ng,dy:-vg},{dx:Ng,dy:vg},{dx:-Ng,dy:vg}];for(const{dx:Vg,dy:Mg}of Xg){const Rg=Zg+Vg*Wg-Mg*$g,Sg=yg+Vg*$g+Mg*Wg;Rg<lg&&(lg=Rg),Rg>Ag&&(Ag=Rg),Sg<cg&&(cg=Sg),Sg>rg&&(rg=Sg)}ug=pg}const dg=Ag-lg,bg=rg-cg;return{w:Math.max(dg,1),h:Math.max(bg,1)}}initDimensions(){if(this.arcEnable&&!this.splitByGrapheme){this._splitText(),this._clearCache(),this.dirty=!0;const eg=this._calcArcBoundingBox();this.width=eg.w,this.height=eg.h}else super.initDimensions()}_render(eg){this.arcEnable&&!this.splitByGrapheme?this._renderArcText(eg):super._render(eg)}__getCursorBoundariesOffsets(eg){if(this.arcEnable&&!this.splitByGrapheme){const{charIndex:gg}=this.get2DCursorLocation(eg),ig=this._getArcCursorInfo(gg);return{left:ig.x+this.width/2,top:ig.y+this.height/2}}return super.__getCursorBoundariesOffsets(eg)}_renderCursor(eg,gg,ig){if(this.arcEnable&&!this.splitByGrapheme){const{charIndex:ng}=this.get2DCursorLocation(ig),og=this._getArcCursorInfo(ng),ag=this.fontSize,Ig=this.getObjectScaling().x*this.canvas.getZoom(),sg=this.cursorWidth/Ig;eg.save(),eg.fillStyle=this.cursorColor||this.fill||"#000000",eg.globalAlpha=this._currentCursorOpacity,eg.translate(og.x,og.y),eg.rotate(og.angle),eg.fillRect(-sg/2,-ag/2,sg,ag),eg.restore()}else super._renderCursor(eg,gg,ig)}getSelectionStartFromPointer(eg){if(this.arcEnable&&!this.splitByGrapheme){const gg=this.canvas.getScenePoint(eg).transform(kn.invertTransform(this.calcTransformMatrix())),{text:ig,r:ng,bendUp:og,charWidths:ag,totalAngle:Ig,circleCenterOffsetY:sg,baseAngle:Cg}=this._getArcParams();let lg=1/0,Ag=0,cg=Cg-Ig/2;for(let rg=0;rg<=ig.length;rg++){const ug=cg,dg=Math.cos(ug)*ng,bg=Math.sin(ug)*ng,mg=dg,hg=sg+bg,pg=gg.x-mg,fg=gg.y-hg,wg=pg*pg+fg*fg;wg<lg&&(lg=wg,Ag=rg),rg<ig.length&&(cg+=ag[rg]/ng)}return Math.min(Ag,this._text.length)}return super.getSelectionStartFromPointer(eg)}_renderSelection(eg,gg,ig){if(this.arcEnable&&!this.splitByGrapheme){const{text:ng,r:og,bendUp:ag,charWidths:Ig,totalAngle:sg,circleCenterOffsetY:Cg,baseAngle:lg}=this._getArcParams(),Ag=this.fontSize,cg=Math.min(gg.selectionStart,gg.selectionEnd),rg=Math.max(gg.selectionStart,gg.selectionEnd);eg.save(),eg.fillStyle=this.selectionColor||"rgba(0,0,255,0.3)";let ug=lg-sg/2;for(let dg=0;dg<ng.length;dg++){const bg=ug,mg=ug+Ig[dg]/og,hg=(bg+mg)/2;if(dg>=cg&&dg<rg){const pg=Math.cos(hg)*og,fg=Math.sin(hg)*og,wg=pg,Gg=Cg+fg,Zg=ag?hg+Math.PI/2:hg-Math.PI/2;eg.save(),eg.translate(wg,Gg),eg.rotate(Zg),eg.fillRect(-Ig[dg]/2,-Ag/2,Ig[dg],Ag),eg.restore()}ug=mg}eg.restore()}else super._renderSelection(eg,gg,ig)}render(eg){if(eg.shadowBlur=0,eg.shadowColor="transparent",eg.imageSmoothingEnabled=!1,eg.textRendering="geometricPrecision",this.isClearCopyTextStyle&&(this.styles={},this.isClearCopyTextStyle=!1),this.splitByGrapheme){let gg=this.width*this.scaleX,ig=this.height*this.scaleY,ng=this.getTextHeight();ig<ng&&(ig=ng),this.hasSetSplit=!0,(gg!==this.width||ig!==this.height||this.scaleY!==1)&&(this.set({width:gg,height:ig,scaleX:1,scaleY:1}),this.height=ig,this.propsMinHeight=this.height,this.setCoords())}else if(this.arcEnable){this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this._calcArcBoundingBox();(this.width!==gg.w||this.height!==gg.h||this.scaleX!==1||this.scaleY!==1)&&(this.set({width:gg.w,height:gg.h,scaleX:1,scaleY:1}),this.setCoords()),this._forceClearCache=!0}else{this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this.text.replace(/ /g," ");gg!==this.text&&(this.text=gg);let ig=eg.measureText(this.text);ig.width!==this.width&&this.set({width:ig.width}),this._forceClearCache=!0}this.objectCaching=this.charSpacing<=1e5&&this.text.length<=800,this.dirty=!0,super.render(eg)}toObject(eg){let gg=["propsMinHeight","verticalType","backgroundColor","isBgBlackColor","fromBarCodeID","fromBarCode2dID","connectBar2dMap","arcEnable","arcRadius"];return super.toObject(eg?[...eg,...gg]:gg)}};eC.type="Text";let AText=eC;tt.setClass(AText);const aC=class aC extends AText{constructor(eg,gg){super("",gg),this.update=!0,this.reviewValueArgs=null,this.toStopDateUpdateBarcode=!1,this.fontSize=ptToPx$1(12),this.increaseYearVal=0,this.increaseMonthVal=0,this.increaseDayVal=0,this.charSpacing=1,this.fontFamily="微软雅黑",console.log("ACounter",eg),this.props=eg,this._props.mode==="3"&&this.updateText(),aC.isMode1Args(this._props.args)&&(this._props.args.nextValue=void 0),this.fontSize=gg.fontSize??this.fontSize,this.charSpacing=gg.charSpacing??this.charSpacing,this.fontFamily=gg.fontFamily??this.fontFamily,this.increaseYearVal=gg.increaseYearVal??this.increaseYearVal,this.increaseMonthVal=gg.increaseMonthVal??this.increaseMonthVal,this.increaseDayVal=gg.increaseDayVal??this.increaseDayVal}render(eg){console.log("_render======"),this.updateText(),super.render(eg)}reviewRecover(){if(this._props.mode==="1"&&aC.isMode1Args(this._props.args)&&this.reviewValueArgs){this._props.args=this.reviewValueArgs,this.reviewValueArgs=null;const eg=this._props.args,gg=formatCounterValue(eg);this.text=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:""),this.dirty=!1,this.update=!1,this._forceClearCache=!0}}countCurrent(){if(this._props.mode==="1"){const eg=this._props.args;if(!eg.value&&eg.value!==0)return"";const gg=formatCounterValue(eg);return(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"")}return""}countNext(eg="print"){if(this._props.mode==="1"&&aC.isMode1Args(this._props.args)){const gg=this._props.args;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);this.text=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const ng=getNextCounterValue(gg);ng!==null&&(gg.value=ng,console.log("update value f",gg.value)),this.update=!0,this.dirty=!0,this._forceClearCache=!0}}updateText({isUpdateBarCodeDate:eg=!0}={}){if(this.update&&this._props.mode==="1")if(aC.isMode1Args(this._props.args)){const gg=this._props.args;if(!gg.value&&gg.value!==0)return;const ig=formatCounterValue(gg);this.text=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:""),this.dirty=!0,this._forceClearCache=!0,console.log("updateText",this.text,gg)}else return;else if(this._props.mode==="2")if(aC.isMode2Args(this._props.args)){if(!this.toStopDateUpdateBarcode){const gg=formatDate(this._props.args.format,{years:this.increaseYearVal,months:this.increaseMonthVal,days:this.increaseDayVal});console.log("formatted",this._props.args.format,gg),this.text=gg,this.dirty=!0,this._forceClearCache=!0,eg&&handleConcatBarcode2d(this.connectBar2dMap,this.canvas,!1,{type:this.type,data:this._props.mode})}}else return;else this.update&&this._props.mode==="3"&&aC.isMode3Args(this._props.args)&&(this.text=this._props.args.text,this.dirty=!0,this._forceClearCache=!0);this.set("dirty",!0),this.update&&(this.initDimensions(),this.setCoords(),this.update=!1,this.canvas&&this._props.mode!=="2"&&(handleConcatBarcode2d(this.connectBar2dMap,this.canvas),this.canvas.fire("custom:object:changed",{target:this})))}set(eg,gg){return super.set(eg,gg)}set props(eg){this.editable=eg.mode==="3",this._props=eg,this.dirty=!0,this.update=!0}get props(){return this._props}static isMode1Args(eg){return"value"in eg}static isMode2Args(eg){return"format"in eg}static isMode3Args(eg){return"text"in eg}toObject(eg){aC.isMode3Args(this._props.args)&&(this._props.args.text=this.text);let gg=["connectBar2dMap","increaseYearVal","increaseMonthVal","increaseDayVal"];return super.toObject(eg?[...eg,"_props",...gg]:["_props",...gg])}};aC.type="Counter";let ACounter=aC;ACounter.fromObject=tg=>ACounter._fromObject(tg,{extraParam:"_props"}),tt.setClass(ACounter),tt.setSVGClass(ACounter);const Yc=class Yc extends na{constructor(eg,gg){super(eg,gg),this.imgScaleType="1",this.originRatio=0,this.setGrayFilter=!1,this.isScaleOtherSidedys=!1,this.isSetSharpen=!1,this.imageAlign="leftTop",this.customExportFields={varnish:"none"},this.prevCoordsPoints=null,this.gasolineLayer="none",this.noSetOtherPrevCoordsPoints=!1,this.customExportFields=gg.customExportFields??this.customExportFields,gg.imgScaleType&&(this.imgScaleType=gg.imgScaleType),gg.setGrayFilter&&(this.setGrayFilter=gg.setGrayFilter),this.isScaleOtherSidedys=gg.isScaleOtherSidedys??this.isScaleOtherSidedys,this.isSetSharpen=gg.isSetSharpen??this.isSetSharpen,this.imageAlign=gg.imageAlign??this.imageAlign,this.prevCoordsPoints=gg.prevCoordsPoints??this.prevCoordsPoints,this.gasolineLayer=gg.gasolineLayer??this.gasolineLayer}refreshAlignCoords(eg=203){var gg;if(this.prevCoordsPoints){this.setCoords();let ig=o.DPI/eg;const{bl:ng,br:og,tl:ag,tr:Ig}=this.aCoords,{bl:sg,br:Cg,tl:lg,tr:Ag}=this.prevCoordsPoints;sg.x=sg.x*ig,sg.y=sg.y*ig,Cg.x=Cg.x*ig,Cg.y=Cg.y*ig,lg.x=lg.x*ig,lg.y=lg.y*ig,Ag.x=Ag.x*ig,Ag.y=Ag.y*ig;const cg={x:0,y:0};switch(this.imageAlign){case"leftTop":break;case"leftBottom":cg.x=sg.x-ng.x,cg.y=sg.y-ng.y;break;case"leftCenter":let rg={x:ng.x,y:(ng.y-ag.y)/2},ug={x:sg.x,y:(sg.y-lg.y)/2};cg.x=ug.x-rg.x,cg.y=ug.y-rg.y;break;case"topCenter":let dg={x:(Ig.x-ag.x)/2,y:Ig.y},bg={x:(Ag.x-lg.x)/2,y:Ag.y};cg.x=bg.x-dg.x,cg.y=bg.y-dg.y;break;case"rightCenter":let mg={x:Ig.x,y:(og.y-Ig.y)/2},hg={x:Ag.x,y:(Cg.y-Ag.y)/2};cg.x=hg.x-mg.x,cg.y=hg.y-mg.y;break;case"bottomCenter":let pg={x:(og.x-ng.x)/2,y:og.y},fg={x:(Cg.x-sg.x)/2,y:Cg.y};cg.x=fg.x-pg.x,cg.y=fg.y-pg.y;break;case"center":let wg={x:(Ig.x-ag.x)/2,y:(ng.y-ag.y)/2},Gg={x:(Ag.x-lg.x)/2,y:(sg.y-lg.y)/2};cg.x=Gg.x-wg.x,cg.y=Gg.y-wg.y;break;case"rightTop":cg.x=Ag.x-Ig.x,cg.y=Ag.y-Ig.y;break;case"rightBottom":cg.x=Cg.x-og.x,cg.y=Cg.y-og.y;break}this.set({left:this.left+cg.x,top:this.top+cg.y}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}}_render(eg){const gg=this._element;if(!gg)return;let ig=this._filterScalingX,ng=this._filterScalingY,og=this.width,ag=this.height,Ig=Math.max(this.cropX,0),sg=Math.max(this.cropY,0),Cg=gg.naturalWidth||gg.width,lg=gg.naturalHeight||gg.height,Ag=Ig*ig,cg=sg*ng,rg=-og/2,ug=-ag/2;this.originRatio=Cg/lg;let dg=this.originRatio;this.imgScaleType==="2"?(og=this.height*dg,rg=-og/2,this.isScaleOtherSidedys&&this.width!==og&&(this.width=og,!this.noSetOtherPrevCoordsPoints&&this.setCoords())):this.imgScaleType==="3"&&(ag=this.width/dg,ug=-ag/2,this.isScaleOtherSidedys&&this.height!==ag&&(this.height=ag,!this.noSetOtherPrevCoordsPoints&&this.setCoords())),eg.save(),eg.beginPath(),eg.rect(-this.width/2,-this.height/2,this.width,this.height),eg.clip(),this.fill&&(eg.fillStyle=this.fill,eg.fillRect(-this.width/2,-this.height/2,this.width,this.height)),this.stroke&&this.strokeWidth&&(eg.strokeStyle=this.stroke,eg.lineWidth=this.strokeWidth,withObjectStrokeDash(eg,this,()=>eg.strokeRect(-this.width/2,-this.height/2,this.width,this.height))),eg.imageSmoothingEnabled=!0,eg.imageSmoothingQuality="high",eg.drawImage(gg,Ag,cg,Cg,lg,rg,ug,og,ag),eg.restore();const bg=this.filters.findIndex(mg=>mg.type==="Grayscale");if(this.setGrayFilter&&bg<0){const mg=new bh.Grayscale;this.filters.push(mg)}else!this.setGrayFilter&&bg>=0&&this.filters.splice(bg,1);this.applyFilters(),this.canvas.leRenderEnv!=="transform"&&!this.noSetOtherPrevCoordsPoints&&(this.prevCoordsPoints=this.aCoords)}set(eg,gg){return super.set(eg,gg)}toObject(eg){let gg=["imgScaleType","setGrayFilter","isScaleOtherSidedys","isSetSharpen","imageAlign","prevCoordsPoints","gasolineLayer"];return super.toObject(eg?[...eg,...gg]:gg)}fromObject(eg){return Yc._fromObject(eg)}};Yc.type="Image";let AImage=Yc;tt.setClass(AImage),tt.setSVGClass(AImage);const rd=class rd extends ho{constructor(){super(...arguments),this.perPixelTargetFind=!0}_render(eg){eg.beginPath();const{width:gg,height:ig}=this,ng=gg/2,og=ig/2;eg.ellipse(0,0,ng,og,0,0,Math.PI*2),this._renderPaintInOrder(eg)}set(eg,gg){return super.set(eg,gg)}};rd.type="Circle";let ACircle=rd;tt.setClass(ACircle);class ARect extends Er{constructor(eg){super(eg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ARect);class ATriangle extends vo{constructor(eg={}){super(eg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ATriangle),tt.setSVGClass(ATriangle);class ALine extends mo{constructor(eg,gg={}){super(eg,gg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ALine);const Iu=class Iu extends na{constructor(){super(...arguments),this.hasControls=!1,this.selectable=!1,this.evented=!0,this.hoverCursor="pointer"}_renderFill(eg){const gg=this._element;if(!gg)return;const ig=this._filterScalingX,ng=this._filterScalingY,og=this.width,ag=this.height,Ig=Math.max(this.cropX,0),sg=Math.max(this.cropY,0),Cg=gg.naturalWidth||gg.width,lg=gg.naturalHeight||gg.height,Ag=Ig*ig,cg=sg*ng,rg=-og/2,ug=-ag/2;gg&&eg.drawImage(gg,Ag,cg,Cg,lg,rg,ug,og,ag)}};Iu.type="Rfid";let RfidIcon=Iu;tt.setClass(RfidIcon),tt.setSVGClass(RfidIcon);const su=class su extends No{constructor(eg,gg){if(super(eg,gg),this.hasSetSplit=!1,this.objectCaching=!0,this.hasSetItalic=!1,this.isClearCopyTextStyle=!1,this.propsMinHeight=0,this.splitByGrapheme=!0,this.customExportFields={varnish:"none"},this.fontFamily="微软雅黑",this._renderTimer=null,this.verticalType="top",this.currentFontLevel=0,this.baseFontSize=118,this.splitByGrapheme=!0,this._originGetTopOffset=this._getTopOffset?this._getTopOffset.bind(this):()=>0,this.fontFamily=gg.fontFamily??this.fontFamily,gg.hasSetItalic&&gg.fontStyle!=="italic"&&(this.fontStyle="italic",gg.skewX===-15&&(this.skewX=0)),gg.propsMinHeight){this.propsMinHeight=gg.propsMinHeight;let ig=Math.max(this.height,this.propsMinHeight);this.height=ig}gg.verticalType&&(this.verticalType=gg.verticalType),this.customExportFields=gg.customExportFields??this.customExportFields,this.on("modified",()=>{this.verticalTypeChange()}),this.on("changed",()=>{this.verticalTypeChange()}),this.verticalTypeChange()}_calcTextHeight(){const eg=this._textLines&&this._textLines.length||0,gg=this.fontSize*this.lineHeight,ig=(this.padding||0)*2;return eg*gg+ig}_handleDotLineBreak(eg,gg){var ig;if(eg.includes("·")){const ng=eg.indexOf("·"),og=/[\u4e00-\u9fa5]/g,ag=((ig=eg.substring(ng+1).match(og))==null?void 0:ig.length)||0;if(this.charSpacing=1,ng==2&&(ag==2||ag==1))return[eg];let Ig=0;if(ag>=11||ng>=10?Ig=5:ag>=10||ng>=9?Ig=4:ag>=9||ng>=8?Ig=3:ag>=8||ng>=7?Ig=2:ag>=7||ng>=6?Ig=1:Ig=0,Ig!==this.currentFontLevel){switch(Ig){case 5:this.fontSize=64;break;case 4:this.fontSize=70;break;case 3:this.fontSize=78;break;case 2:this.fontSize=88;break;case 1:this.fontSize=100;break;case 0:this.fontSize=this.baseFontSize??118;break}this.currentFontLevel=Ig}const sg=eg.substring(0,ng+1),Cg=eg.substring(ng+1).trim();return Cg?[sg,Cg]:[eg]}else eg.length<=4?(this.fontSize=this.baseFontSize??118,this.currentFontLevel=0,eg.length===2?this.charSpacing=800:eg.length===3?this.charSpacing=300:eg.length===4&&(this.charSpacing=300)):(this.charSpacing=1,this.fontSize=this.baseFontSize,this.currentFontLevel=0);return[...gg]}_wrapText(eg,gg){if(this.isClearCopyTextStyle&&(this.styles={},this.verticalTypeChange()),this.splitByGrapheme){const ig=o.DPI??96,ag=3*.393701*ig,Ig=this.text;let sg=[...eg];return sg=this._handleDotLineBreak(Ig,eg),this.width!==ag&&(this.width=ag,this.setCoords(),this._renderTimer&&clearTimeout(this._renderTimer),this._renderTimer=setTimeout(()=>{var Cg;(Cg=this.canvas)==null||Cg.requestRenderAll()},0)),super._wrapText(sg,ag)}else return super._wrapText(eg,gg)}verticalTypeChange(){var gg;if(!this.splitByGrapheme||!this.propsMinHeight)return;const eg=Math.max(this._calcTextHeight(),this.propsMinHeight);this.height!==eg&&(this.height=eg),this.verticalType==="top"?this._getTopOffset=this._originGetTopOffset:this.verticalType==="vcenter"?this._getTopOffset=()=>{let ig=this._calcTextHeight();return(this.fontSize*this.lineHeight-this.fontSize)/2-ig/2}:this.verticalType==="bottom"&&(this._getTopOffset=()=>{const ig=this._calcTextHeight(),og=Math.max(ig,this.propsMinHeight)-ig;return this._originGetTopOffset()+og}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}set(eg,gg){if(eg==="hasSetItalic")return this.hasSetItalic=!1,gg===!0?super.set("fontStyle","italic"):this;if(typeof eg=="object"&&eg){const ig={...eg};return"hasSetItalic"in ig&&(ig.hasSetItalic===!0&&(ig.fontStyle="italic"),delete ig.hasSetItalic),super.set(ig)}return(eg==="fill"||eg==="stroke"||eg==="underline"||eg==="overline"||eg==="linethrough"||eg==="fontWeight"||eg==="fontStyle")&&(this.styles={}),super.set(eg,gg)}set locked(eg){super.locked=eg,this.editable=!eg}get locked(){return super.locked}_measureLine(eg){let gg=this._textLines[eg];return Array.isArray(gg)&&(gg=gg.map(ig=>ig.replace(" "," "))),this._textLines[eg]=gg,super._measureLine(eg)}getStandardSpaceWidth(eg=" ",gg="Arial"){const ng=kn.createCanvasElement().getContext("2d");let og=0;return ng&&(ng.font=`${this.fontSize}px ${gg}`,og=ng.measureText(eg).width),og}getTextWidth(eg="",gg=0,ig="Arial"){const og=kn.createCanvasElement().getContext("2d");let ag=0;return og&&(og.font=`${gg}px ${ig}`,ag=og.measureText(eg).width),ag}getTextHeight(eg="测",gg=!0){const ng=kn.createCanvasElement().getContext("2d");let og=0;if(ng){ng.font=`${this.fontSize}px ${this.fontFamily}`;let ag=ng.measureText(eg);og=ag.fontBoundingBoxAscent+ag.fontBoundingBoxDescent+(gg?Math.trunc(this.fontSize/3):0)}return og*this._textLines.length}_measureChar(eg,gg,ig,ng){if(eg!==" "&&eg!==" ")return super._measureChar(eg,gg,ig,ng);{const og=this.getStandardSpaceWidth(" ",this.fontFamily);return{width:og,kernedWidth:og}}}render(eg){if(eg.shadowBlur=0,eg.shadowColor="transparent",eg.imageSmoothingEnabled=!1,this.isClearCopyTextStyle&&(this.styles={}),this.splitByGrapheme){let gg=this.width*this.scaleX,ig=this.height*this.scaleY,ng=this.getTextHeight();ig<ng&&(ig=ng),this.hasSetSplit=!0,(gg!==this.width||ig!==this.height||this.scaleY!==1)&&(this.set({width:gg,height:ig,scaleX:1,scaleY:1}),this.height=ig,this.propsMinHeight=this.height,this.setCoords())}else{this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this.text.replace(/ /g," ");gg!==this.text&&(this.text=gg);let ig=eg.measureText(this.text);ig.width!==this.width&&this.set({width:ig.width}),this._forceClearCache=!0}this.charSpacing>1e5?this.objectCaching=!1:this.objectCaching=!0,this.dirty=!0,super.render(eg)}toObject(eg){let gg=["propsMinHeight","verticalType","customExportFields"];return super.toObject(eg?[...eg,...gg]:gg)}};su.type="TextName";let ATextName=su;tt.setClass(ATextName);const lu=class lu extends Er{constructor(eg={}){const{rows:gg,columns:ig,tableTexts:ng,tableCellStyles:og,tableCellBorders:ag,tableCellSpans:Ig,columnWidths:sg,rowHeights:Cg,fontSize:lg,fontFamily:Ag,fontWeight:cg,fontStyle:rg,underline:ug,linethrough:dg,charSpacing:bg,lineHeight:mg,textAlign:hg,verticalType:pg,...fg}=eg;super({fill:"#000000FF",backgroundColor:"#FFFFFF00",stroke:"#000000",strokeWidth:1,...fg}),this.perPixelTargetFind=!0,this.rows=2,this.columns=2,this.tableTexts=[],this.tableCellStyles=[],this.tableCellBorders=[],this.tableCellSpans=[],this.columnWidths=[],this.rowHeights=[],this.fontSize=24,this.fontFamily="微软雅黑",this.fontWeight="normal",this.fontStyle="normal",this.underline=!1,this.linethrough=!1,this.charSpacing=0,this.lineHeight=1.2,this.textAlign="center",this.verticalType="vcenter",this.strokeUniform=!0,this.selectedCellIndex=null,this.editingTextarea=null,this.keepEditingOnNextBlur=!1,this.editingPointerDownHandler=null,this.editingViewportChangeHandler=null,this.editingResizeObserver=null,this.editingUpdateFrame=0,this.rows=this.normalizeCount(gg,2),this.columns=this.normalizeCount(ig,2),this.tableTexts=[...ng||[]],this.tableCellStyles=[...og||[]],this.tableCellBorders=[...ag||[]],this.tableCellSpans=[...Ig||[]],this.columnWidths=[...sg||[]],this.rowHeights=[...Cg||[]],this.syncTextCount(),this.applyTextOptions({fontSize:lg,fontFamily:Ag,fontWeight:cg,fontStyle:rg,underline:ug,linethrough:dg,charSpacing:bg,lineHeight:mg,textAlign:hg,verticalType:pg}),this.on("scaling",wg=>this.resizeDuringScaling(wg)),this.on("modified",()=>{this.scaleAnchor=void 0}),this.on("removed",()=>{this.removeEditingTextarea(!1)})}get isEditing(){return this.editingTextarea!==null}set(eg,gg){var ng,og,ag,Ig,sg,Cg,lg;if(typeof eg=="object"&&eg)return Object.keys(eg).forEach(Ag=>this.set(Ag,eg[Ag])),this;if(eg==="rows"||eg==="columns"){this.removeEditingTextarea(!0);const Ag=this.normalizeCount(gg,eg==="rows"?this.rows:this.columns),cg=this.rows,rg=this.columns,ug=eg==="rows"?Ag:this.rows,dg=eg==="columns"?Ag:this.columns;return this.resizeByCountChange(eg,Ag),this.remapCellData(cg,rg,ug,dg),this[eg]=Ag,this.syncTextCount(),this.selectedCellIndex!==null&&this.selectedCellIndex>=this.rows*this.columns&&(this.selectedCellIndex=null),this.dirty=!0,this.setCoords(),(ng=this.canvas)==null||ng.requestRenderAll(),this}if(eg==="tableTexts")return this.tableTexts=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(og=this.canvas)==null||og.requestRenderAll(),this;if(eg==="tableCellStyles")return this.tableCellStyles=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll(),this;if(eg==="tableCellBorders")return this.tableCellBorders=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),this;if(eg==="tableCellSpans")return this.tableCellSpans=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(sg=this.canvas)==null||sg.requestRenderAll(),this;if(eg==="columnWidths"||eg==="rowHeights")return this[eg]=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(Cg=this.canvas)==null||Cg.requestRenderAll(),this;const ig=super.set(eg,gg);return this.isTextStyleKey(eg)&&(this.dirty=!0,(lg=this.canvas)==null||lg.requestRenderAll(),this.updateEditingTextarea()),ig}toObject(eg){const gg=["rows","columns","tableTexts","tableCellStyles","tableCellBorders","tableCellSpans","columnWidths","rowHeights","fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType","backgroundColor"];return super.toObject(eg?[...eg,...gg]:gg)}normalizeCount(eg,gg){const ig=Math.floor(Number(eg));return Number.isFinite(ig)?Math.min(Math.max(ig,1),50):gg}resizeDuringScaling(eg){const gg=eg==null?void 0:eg.transform;if(!gg)return;const ig=gg.corner,ng=["ml","tl","bl"].includes(ig),og=["mr","tr","br"].includes(ig),ag=["mt","tl","tr"].includes(ig),Ig=["mb","bl","br"].includes(ig);if(!this.scaleAnchor){const Ag=ng?"right":og?"left":"center",cg=ag?"bottom":Ig?"top":"center";this.scaleAnchor={point:this.getPointByOrigin(Ag,cg),originX:Ag,originY:cg}}this.width=Math.max(1,(this.width||1)*Math.abs(this.scaleX||1)),this.height=Math.max(1,(this.height||1)*Math.abs(this.scaleY||1)),this.scaleX=1,this.scaleY=1;const{point:sg,originX:Cg,originY:lg}=this.scaleAnchor;if(this.group){const Ag=kn.invertTransform(this.group.calcTransformMatrix()),cg=kn.transformPoint(sg,Ag);this.setPositionByOrigin(cg,Cg,lg)}else this.setPositionByOrigin(sg,Cg,lg);this.updateEditingTextarea(),this.dirty=!0,this.setCoords()}resizeByCountChange(eg,gg){if(eg==="columns"){const ig=this.width||0,ng=Array.from({length:this.columns},(Cg,lg)=>(this.columnWidths[lg]||1/this.columns)*ig),og=ng.reduce((Cg,lg)=>Cg+lg,0)/(ng.length||1)||ig/(this.columns||1)||1,ag=Array.from({length:gg},(Cg,lg)=>lg<ng.length?ng[lg]:og),Ig=ag.reduce((Cg,lg)=>Cg+lg,0);this.width=Ig;const sg=Ig||1;this.columnWidths=ag.map(Cg=>Cg/sg)}if(eg==="rows"){const ig=this.height||0,ng=Array.from({length:this.rows},(Cg,lg)=>(this.rowHeights[lg]||1/this.rows)*ig),og=ng.reduce((Cg,lg)=>Cg+lg,0)/(ng.length||1)||ig/(this.rows||1)||1,ag=Array.from({length:gg},(Cg,lg)=>lg<ng.length?ng[lg]:og),Ig=ag.reduce((Cg,lg)=>Cg+lg,0);this.height=Ig;const sg=Ig||1;this.rowHeights=ag.map(Cg=>Cg/sg)}}remapCellData(eg,gg,ig,ng){if(eg===ig&&gg===ng)return;const og=Array.isArray(this.tableTexts)?[...this.tableTexts]:[],ag=Array.isArray(this.tableCellStyles)?[...this.tableCellStyles]:[],Ig=Array.isArray(this.tableCellBorders)?[...this.tableCellBorders]:[],sg=Array.isArray(this.tableCellSpans)?[...this.tableCellSpans]:[],Cg=ig*ng;this.tableTexts=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?"":og[cg*gg+rg]||""}),this.tableCellStyles=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?{}:{...ag[cg*gg+rg]||{}}}),this.tableCellBorders=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?{}:{...Ig[cg*gg+rg]||{}}}),this.tableCellSpans=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;if(cg>=eg||rg>=gg)return this.createDefaultCellSpan();const ug=sg[cg*gg+rg]||{},dg=Number(ug.masterIndex),bg=Number.isFinite(dg)&&dg>=0?this.mapOldCellIndex(dg,gg,ig,ng):null;return{...this.createDefaultCellSpan(),...ug,masterIndex:bg}}),this.selectedCellIndex!==null&&(this.selectedCellIndex=this.mapOldCellIndex(this.selectedCellIndex,gg,ig,ng))}mapOldCellIndex(eg,gg,ig,ng){const og=Math.floor(eg/gg),ag=eg%gg;return og>=ig||ag>=ng?null:og*ng+ag}createDefaultCellSpan(){return{rowSpan:1,colSpan:1,hidden:!1,masterIndex:null}}getCellData(eg){return{text:this.tableTexts[eg]||"",style:{...this.tableCellStyles[eg]||{}},border:{...this.tableCellBorders[eg]||{}},span:{...this.createDefaultCellSpan(),...this.tableCellSpans[eg]||{}}}}applyStructureChange(eg,gg,ig,ng,og,ag,Ig,sg,Cg){var ug,dg;const lg=this.getPointByOrigin(sg,Cg),Ag=eg*gg,cg=new Map;for(let bg=0;bg<eg;bg++)for(let mg=0;mg<gg;mg++){const hg=ig(bg,mg);hg!==null&&cg.set(hg,bg*gg+mg)}const rg=Array.from({length:Ag},(bg,mg)=>{const hg=Math.floor(mg/gg),pg=mg%gg,fg=ig(hg,pg);if(fg===null)return null;const wg=this.getCellData(fg),Gg=Number(wg.span.masterIndex);return wg.span.masterIndex=Number.isFinite(Gg)&&Gg>=0?cg.get(Gg)??null:null,wg});if(this.rows=eg,this.columns=gg,this.width=ag.reduce((bg,mg)=>bg+mg,0),this.height=Ig.reduce((bg,mg)=>bg+mg,0),this.columnWidths=this.normalizeRatios(ag,gg),this.rowHeights=this.normalizeRatios(Ig,eg),this.tableTexts=rg.map(bg=>(bg==null?void 0:bg.text)||""),this.tableCellStyles=rg.map(bg=>(bg==null?void 0:bg.style)||{}),this.tableCellBorders=rg.map(bg=>(bg==null?void 0:bg.border)||{}),this.tableCellSpans=rg.map(bg=>(bg==null?void 0:bg.span)||this.createDefaultCellSpan()),this.selectedCellIndex=Math.min(ng,eg-1)*gg+Math.min(og,gg-1),this.group){const bg=kn.invertTransform(this.group.calcTransformMatrix());this.setPositionByOrigin(kn.transformPoint(lg,bg),sg,Cg)}else this.setPositionByOrigin(lg,sg,Cg);this.syncTextCount(),this.dirty=!0,this.setCoords(),(ug=this.canvas)==null||ug.requestRenderAll(),(dg=this.canvas)==null||dg.fire("object:modified",{target:this,action:"modifyprops"})}insertColumn(eg,gg="right"){if(this.columns>=50)return;const ig=!!this.editingTextarea,ng=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const og=Math.min(Math.max(eg,0),this.columns),ag=this.columns,Ig=this.columnWidths.map(Ag=>Ag*(this.width||0)),sg=Math.min(og,ag-1),Cg=Ig[sg]||(this.width||1)/Math.max(ag,1);Ig.splice(og,0,Cg);const lg=this.rowHeights.map(Ag=>Ag*(this.height||0));this.applyStructureChange(this.rows,ag+1,(Ag,cg)=>{if(cg===og)return null;const rg=cg>og?cg-1:cg;return Ag*ag+rg},Math.floor(ng/ag),ng%ag+(gg==="left"?1:0),Ig,lg,gg==="left"?"right":"left","top"),this.restoreEditingTextareaAfterStructureChange(ig)}insertRow(eg,gg="down"){if(this.rows>=50)return;const ig=!!this.editingTextarea,ng=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const og=Math.min(Math.max(eg,0),this.rows),ag=this.rows,Ig=this.columns,sg=this.rowHeights.map(cg=>cg*(this.height||0)),Cg=Math.min(og,ag-1),lg=sg[Cg]||(this.height||1)/Math.max(ag,1);sg.splice(og,0,lg);const Ag=this.columnWidths.map(cg=>cg*(this.width||0));this.applyStructureChange(ag+1,Ig,(cg,rg)=>cg===og?null:(cg>og?cg-1:cg)*Ig+rg,Math.floor(ng/Ig)+(gg==="up"?1:0),ng%Ig,Ag,sg,"left",gg==="up"?"bottom":"top"),this.restoreEditingTextareaAfterStructureChange(ig)}deleteColumn(eg){if(this.columns<=1)return;const gg=!!this.editingTextarea,ig=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const ng=Math.min(Math.max(eg,0),this.columns-1),og=this.columns,ag=this.columnWidths.map(sg=>sg*(this.width||0));ag.splice(ng,1);const Ig=this.rowHeights.map(sg=>sg*(this.height||0));this.applyStructureChange(this.rows,og-1,(sg,Cg)=>{const lg=Cg>=ng?Cg+1:Cg;return sg*og+lg},Math.floor(ig/og),Math.min(ng,og-2),ag,Ig,ng===0?"right":"left","top"),this.restoreEditingTextareaAfterStructureChange(gg)}deleteRow(eg){if(this.rows<=1)return;const gg=!!this.editingTextarea,ig=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const ng=Math.min(Math.max(eg,0),this.rows-1),og=this.rows,ag=this.columns,Ig=this.rowHeights.map(Cg=>Cg*(this.height||0));Ig.splice(ng,1);const sg=this.columnWidths.map(Cg=>Cg*(this.width||0));this.applyStructureChange(og-1,ag,(Cg,lg)=>(Cg>=ng?Cg+1:Cg)*ag+lg,Math.min(ng,og-2),ig%ag,sg,Ig,"left",ng===0?"bottom":"top"),this.restoreEditingTextareaAfterStructureChange(gg)}restoreEditingTextareaAfterStructureChange(eg){if(!eg||this.selectedCellIndex===null)return;const gg=this.selectedCellIndex;requestAnimationFrame(()=>{this.selectedCellIndex!==gg||this.editingTextarea||this.startCellEditing(gg)})}syncTextCount(){Array.isArray(this.tableTexts)||(this.tableTexts=[]);const eg=this.rows*this.columns;for(this.tableTexts.length>eg&&(this.tableTexts=this.tableTexts.slice(0,eg));this.tableTexts.length<eg;)this.tableTexts.push("");for(Array.isArray(this.tableCellStyles)||(this.tableCellStyles=[]),this.tableCellStyles.length>eg&&(this.tableCellStyles=this.tableCellStyles.slice(0,eg));this.tableCellStyles.length<eg;)this.tableCellStyles.push({});for(Array.isArray(this.tableCellBorders)||(this.tableCellBorders=[]),this.tableCellBorders.length>eg&&(this.tableCellBorders=this.tableCellBorders.slice(0,eg));this.tableCellBorders.length<eg;)this.tableCellBorders.push({});for(Array.isArray(this.tableCellSpans)||(this.tableCellSpans=[]),this.tableCellSpans.length>eg&&(this.tableCellSpans=this.tableCellSpans.slice(0,eg));this.tableCellSpans.length<eg;)this.tableCellSpans.push(this.createDefaultCellSpan());this.syncDimensionRatios(),this.selectedCellIndex!==null&&this.selectedCellIndex>=eg&&(this.selectedCellIndex=null)}syncDimensionRatios(){this.columnWidths=this.normalizeRatios(this.columnWidths,this.columns),this.rowHeights=this.normalizeRatios(this.rowHeights,this.rows)}normalizeRatios(eg,gg){const ig=Array.from({length:gg},(og,ag)=>{const Ig=Number(eg[ag]);return Number.isFinite(Ig)&&Ig>0?Ig:1}),ng=ig.reduce((og,ag)=>og+ag,0)||gg||1;return ig.map(og=>og/ng)}applyTextOptions(eg){["fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType"].forEach(ig=>{eg[ig]!==void 0&&(this[ig]=eg[ig])})}isTextStyleKey(eg){return["fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType","fill"].includes(eg)}getTextX(eg,gg,ig){return this.getTextXByAlign(eg,gg,ig,this.textAlign)}getTextXByAlign(eg,gg,ig,ng="center"){return ng==="left"?eg+ig:ng==="right"?eg+gg-ig:eg+gg/2}getTextStartYByVertical(eg,gg,ig,ng,og,ag="vcenter"){return ag==="top"?eg+ig+og/2:ag==="bottom"?eg+gg-ig-ng+og/2:eg+gg/2-ng/2+og/2}getTextareaVerticalPadding(eg,gg,ig){if(eg.verticalType==="top")return{top:0,bottom:0};const ng=Math.max(gg-ig,0);return eg.verticalType==="bottom"?{top:ng,bottom:0}:{top:ng/2,bottom:0}}getDefaultCellStyle(){return{fontSize:Number(this.fontSize)||12,fontFamily:this.fontFamily||"微软雅黑",fill:this.fill||"#000000",fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",underline:!!this.underline,linethrough:!!this.linethrough,charSpacing:Number(this.charSpacing)||0,lineHeight:Number(this.lineHeight)||1.2,textAlign:this.textAlign||"center",verticalType:this.verticalType||"vcenter"}}getCellStyle(eg){return this.syncTextCount(),{...this.getDefaultCellStyle(),...this.tableCellStyles[eg]||{}}}setCellStyle(eg,gg){var ig,ng;this.syncTextCount(),!(eg<0||eg>=this.rows*this.columns)&&(this.tableCellStyles[eg]={...this.tableCellStyles[eg]||{},...gg},this.updateEditingTextarea(eg),this.dirty=!0,(ig=this.canvas)==null||ig.requestRenderAll(),(ng=this.canvas)==null||ng.fire("object:modified",{target:this}))}getCellBorderStyle(eg){return this.syncTextCount(),{top:"solid",right:"solid",bottom:"solid",left:"solid",...this.tableCellBorders[eg]||{}}}setCellBorderStyle(eg,gg){var ig,ng;this.syncTextCount(),!(eg<0||eg>=this.rows*this.columns)&&(this.tableCellBorders[eg]={...this.tableCellBorders[eg]||{},...gg},this.dirty=!0,(ig=this.canvas)==null||ig.requestRenderAll(),(ng=this.canvas)==null||ng.fire("object:modified",{target:this}))}setAllCellBorderStyle(eg){var gg,ig;this.syncTextCount(),this.tableCellBorders=Array.from({length:this.rows*this.columns},()=>({top:eg,right:eg,bottom:eg,left:eg})),this.dirty=!0,(gg=this.canvas)==null||gg.requestRenderAll(),(ig=this.canvas)==null||ig.fire("object:modified",{target:this,action:"modifyprops"})}getCellLayout(eg){return{...this.getCellRect(eg),row:Math.floor(eg/this.columns),col:eg%this.columns}}setColumnWidth(eg,gg){var Ig,sg;const ig=this.width||0;if(eg<0||eg>=this.columns||!ig)return;const ng=Math.max(Number(gg)||0,8),og=Array.from({length:this.columns},(Cg,lg)=>(this.columnWidths[lg]||1/this.columns)*ig);og[eg]=ng;const ag=og.reduce((Cg,lg)=>Cg+lg,0)||ng;this.width=ag,this.columnWidths=og.map(Cg=>Cg/ag),this.setCoords(),this.updateEditingTextarea(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),(sg=this.canvas)==null||sg.fire("object:modified",{target:this})}setRowHeight(eg,gg){var Ig,sg;const ig=this.height||0;if(eg<0||eg>=this.rows||!ig)return;const ng=Math.max(Number(gg)||0,8),og=Array.from({length:this.rows},(Cg,lg)=>(this.rowHeights[lg]||1/this.rows)*ig);og[eg]=ng;const ag=og.reduce((Cg,lg)=>Cg+lg,0)||ng;this.height=ag,this.rowHeights=og.map(Cg=>Cg/ag),this.setCoords(),this.updateEditingTextarea(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),(sg=this.canvas)==null||sg.fire("object:modified",{target:this})}getColumnOffset(eg){const gg=this.width||0;return-gg/2+this.columnWidths.slice(0,eg).reduce((ig,ng)=>ig+ng*gg,0)}getRowOffset(eg){const gg=this.height||0;return-gg/2+this.rowHeights.slice(0,eg).reduce((ig,ng)=>ig+ng*gg,0)}getCellRect(eg){const gg=this.width||0,ig=this.height||0,ng=Math.floor(eg/this.columns),og=eg%this.columns,ag=(this.columnWidths[og]||0)*gg,Ig=(this.rowHeights[ng]||0)*ig;return{left:this.getColumnOffset(og),top:this.getRowOffset(ng),width:ag,height:Ig}}getCellIndexByPoint(eg){const gg=this.width||0,ig=this.height||0;if(!gg||!ig||!this.rows||!this.columns)return-1;const ng=kn.invertTransform(this.calcTransformMatrix()),og=kn.transformPoint(new ot(eg.x,eg.y),ng),ag=og.x+gg/2,Ig=og.y+ig/2;if(ag<0||Ig<0||ag>gg||Ig>ig)return-1;let sg=0,Cg=this.columns-1;for(let cg=0;cg<this.columns;cg++)if(sg+=this.columnWidths[cg]*gg,ag<=sg){Cg=cg;break}let lg=0,Ag=this.rows-1;for(let cg=0;cg<this.rows;cg++)if(lg+=this.rowHeights[cg]*ig,Ig<=lg){Ag=cg;break}return Ag*this.columns+Cg}getViewportCellTransform(eg){if(!this.canvas)return null;const gg=this.getCellRect(eg),ig=this.calcTransformMatrix(),ng=this.canvas.viewportTransform||[1,0,0,1,0,0],og=kn.multiplyTransformMatrices(ng,ig),ag=Math.hypot(og[0],og[1])||1,Ig=Math.hypot(og[2],og[3])||1;return{...gg,matrix:og,scaleX:ag,scaleY:Ig}}getCanvasElementRect(){var gg,ig;return this.canvas?(((ig=(gg=this.canvas.elements)==null?void 0:gg.upper)==null?void 0:ig.el)||this.canvas.upperCanvasEl||this.canvas.getElement()).getBoundingClientRect():null}removeEditingTextarea(eg=!0){var ng,og,ag;if(!this.editingTextarea)return;const gg=this.editingTextarea;this.editingTextarea=null;const ig=Number(gg.dataset.cellIndex);this.editingPointerDownHandler&&(document.removeEventListener("pointerdown",this.editingPointerDownHandler,!0),this.editingPointerDownHandler=null),this.unbindEditingViewportChange(),eg&&Number.isFinite(ig)&&(this.tableTexts[ig]=gg.value,this.dirty=!0,(ng=this.canvas)==null||ng.fire("object:modified",{target:this})),(og=gg.parentNode)==null||og.removeChild(gg),this.selectedCellIndex=null,this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll()}isEditingAssistantTarget(eg){return!!eg.closest([".right-side-bar",".ant-select-dropdown",".ant-select-item",".ant-select-selector",".ant-select-selection-search-input",".ant-input-number",".ant-input-number-dropdown",".ant-dropdown",".ant-tooltip",".ant-popover",".color-wrap",".color-preview-wrap",".hu-color-picker"].join(","))}bindEditingPointerDown(eg){this.editingPointerDownHandler&&document.removeEventListener("pointerdown",this.editingPointerDownHandler,!0),this.editingPointerDownHandler=gg=>{const ig=gg.target;if(!(!ig||ig===eg||eg.contains(ig))){if(this.isEditingAssistantTarget(ig)){this.keepEditingOnNextBlur=!0;return}this.removeEditingTextarea(!0)}},document.addEventListener("pointerdown",this.editingPointerDownHandler,!0)}scheduleEditingTextareaUpdate(eg){this.editingUpdateFrame&&cancelAnimationFrame(this.editingUpdateFrame),this.editingUpdateFrame=requestAnimationFrame(()=>{this.editingUpdateFrame=0,this.updateEditingTextarea(eg)})}bindEditingViewportChange(eg){var ng,og,ag,Ig,sg,Cg,lg;this.unbindEditingViewportChange(),this.editingViewportChangeHandler=()=>{this.scheduleEditingTextareaUpdate(eg)},window.addEventListener("resize",this.editingViewportChangeHandler),window.addEventListener("scroll",this.editingViewportChangeHandler,!0),(ng=window.visualViewport)==null||ng.addEventListener("resize",this.editingViewportChangeHandler),(og=window.visualViewport)==null||og.addEventListener("scroll",this.editingViewportChangeHandler);const gg=((sg=(Ig=(ag=this.canvas)==null?void 0:ag.elements)==null?void 0:Ig.upper)==null?void 0:sg.el)||((Cg=this.canvas)==null?void 0:Cg.upperCanvasEl)||((lg=this.canvas)==null?void 0:lg.getElement()),ig=(gg==null?void 0:gg.parentElement)||gg;ig&&typeof ResizeObserver<"u"&&(this.editingResizeObserver=new ResizeObserver(()=>{this.scheduleEditingTextareaUpdate(eg)}),this.editingResizeObserver.observe(ig))}unbindEditingViewportChange(){var eg,gg,ig;this.editingUpdateFrame&&(cancelAnimationFrame(this.editingUpdateFrame),this.editingUpdateFrame=0),this.editingViewportChangeHandler&&(window.removeEventListener("resize",this.editingViewportChangeHandler),window.removeEventListener("scroll",this.editingViewportChangeHandler,!0),(eg=window.visualViewport)==null||eg.removeEventListener("resize",this.editingViewportChangeHandler),(gg=window.visualViewport)==null||gg.removeEventListener("scroll",this.editingViewportChangeHandler),this.editingViewportChangeHandler=null),(ig=this.editingResizeObserver)==null||ig.disconnect(),this.editingResizeObserver=null}updateEditingTextarea(eg){if(!this.editingTextarea)return;const gg=this.editingTextarea,ig=Number(gg.dataset.cellIndex);if(!Number.isFinite(ig)||eg!==void 0&&eg!==ig)return;const ng=this.getViewportCellTransform(ig),og=this.getCanvasElementRect();if(!ng||!og)return;const ag=this.getCellStyle(ig),Ig=this.getCellEditFontSize(ig,ng.scaleY),sg=Math.max(Math.min(ng.scaleX,ng.scaleY),.01),Cg=Math.max(2/sg,Math.min(Ig*.18,8)),lg=Math.max(ng.width-Cg*2,12/ng.scaleX),Ag=Math.max(ng.height-Cg*2,12/ng.scaleY),cg=Ig*(Number(ag.lineHeight)||1.2),rg=this.getEditingLineCount(gg.value,ag,Ig,lg),ug=this.getTextareaVerticalPadding(ag,Ag,cg*rg),dg=kn.transformPoint(new ot(ng.left+Cg,ng.top+Cg),ng.matrix);gg.style.left=`${og.left+dg.x}px`,gg.style.top=`${og.top+dg.y}px`,gg.style.width=`${lg}px`,gg.style.height=`${Ag}px`,gg.style.transform=`matrix(${ng.matrix[0]}, ${ng.matrix[1]}, ${ng.matrix[2]}, ${ng.matrix[3]}, 0, 0)`,gg.style.color=ag.fill,gg.style.font=this.getFont(Ig,ag),gg.style.lineHeight=`${cg}px`,gg.style.textAlign=ag.textAlign,gg.style.letterSpacing=`${this.getSpacingPx(ag,Ig)}px`,gg.style.padding=`${ug.top}px 0 ${ug.bottom}px 0`}startCellEditing(eg){if(!this.canvas)return;this.removeEditingTextarea(!0),this.selectedCellIndex=eg;const gg=this.getViewportCellTransform(eg);if(!gg)return;const ig=this.getCanvasElementRect();if(!ig)return;const ng=this.getCellEditFontSize(eg,gg.scaleY),og=Math.max(Math.min(gg.scaleX,gg.scaleY),.01),ag=Math.max(2/og,Math.min(ng*.18,8)),Ig=kn.transformPoint(new ot(gg.left+ag,gg.top+ag),gg.matrix),sg=document.createElement("textarea");sg.value=this.tableTexts[eg]||"",sg.dataset.cellIndex=`${eg}`,sg.spellcheck=!1,sg.style.position="fixed",sg.style.left=`${ig.left+Ig.x}px`,sg.style.top=`${ig.top+Ig.y}px`,sg.style.width=`${Math.max(gg.width-ag*2,12/gg.scaleX)}px`,sg.style.height=`${Math.max(gg.height-ag*2,12/gg.scaleY)}px`,sg.style.zIndex="9999",sg.style.padding="0",sg.style.margin="0",sg.style.border="1px solid #2F54EB",sg.style.outline="none",sg.style.resize="none",sg.style.overflow="hidden",sg.style.background="rgba(255, 255, 255, 0.92)",sg.style.whiteSpace="pre-wrap",sg.style.overflowWrap="break-word";const Cg=this.getCellStyle(eg);sg.style.color=Cg.fill,sg.style.font=this.getFont(ng,Cg),sg.style.lineHeight=`${Cg.lineHeight}`,sg.style.textAlign=Cg.textAlign,sg.style.letterSpacing=`${this.getSpacingPx(Cg,ng)}px`,sg.style.boxSizing="border-box",sg.style.transformOrigin="left top",sg.style.transform=`matrix(${gg.matrix[0]}, ${gg.matrix[1]}, ${gg.matrix[2]}, ${gg.matrix[3]}, 0, 0)`;const lg=Ag=>Ag.stopPropagation();sg.addEventListener("mousedown",lg),sg.addEventListener("pointerdown",lg),sg.addEventListener("dblclick",lg),sg.addEventListener("keydown",Ag=>{Ag.stopPropagation(),Ag.key==="Escape"&&(Ag.preventDefault(),this.removeEditingTextarea(!1))}),sg.addEventListener("input",()=>this.updateEditingTextarea(eg)),sg.addEventListener("paste",Ag=>this.handleCellEditPaste(eg,Ag)),sg.addEventListener("copy",Ag=>this.handleCellEditCopy(eg,Ag)),sg.addEventListener("cut",Ag=>this.handleCellEditCut(eg,Ag)),sg.addEventListener("blur",()=>{if(this.keepEditingOnNextBlur){this.keepEditingOnNextBlur=!1;return}this.removeEditingTextarea(!0)}),document.body.appendChild(sg),this.editingTextarea=sg,this.bindEditingPointerDown(sg),this.bindEditingViewportChange(eg),this.updateEditingTextarea(eg),sg.focus(),sg.select()}handleCellEditPaste(eg,gg){const ig=gg.clipboardData;if(!ig)return;const ng=ig.getData("text/html");if(!ng)return;const og=this.extractCellStyleFromHtml(ng);og&&Object.keys(og).length>0&&this.setCellStyle(eg,og)}handleCellEditCopy(eg,gg){const ig=gg.clipboardData;if(!ig)return;const ng=this.editingTextarea;if(!ng)return;const og=ng.value.substring(ng.selectionStart,ng.selectionEnd);if(!og)return;const ag=this.getCellStyle(eg),Ig=this.buildClipboardHtml(og,ag);gg.preventDefault(),ig.setData("text/plain",og),ig.setData("text/html",Ig)}handleCellEditCut(eg,gg){var ag;this.handleCellEditCopy(eg,gg);const ig=this.editingTextarea;if(!ig)return;const ng=ig.selectionStart,og=ig.selectionEnd;ng!==og&&(ig.value=ig.value.slice(0,ng)+ig.value.slice(og),ig.selectionStart=ig.selectionEnd=ng,this.tableTexts[eg]=ig.value,this.updateEditingTextarea(eg),this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll())}buildClipboardHtml(eg,gg){const ig=[];gg.fill&&ig.push(`color:${gg.fill}`),gg.fontSize&&ig.push(`font-size:${gg.fontSize}px`),gg.fontFamily&&ig.push(`font-family:${gg.fontFamily}`),gg.fontWeight&&ig.push(`font-weight:${gg.fontWeight}`),gg.fontStyle&&ig.push(`font-style:${gg.fontStyle}`);const ng=[];gg.underline&&ng.push("underline"),gg.linethrough&&ng.push("line-through"),ng.length&&ig.push(`text-decoration:${ng.join(" ")}`),gg.textAlign&&ig.push(`text-align:${gg.textAlign}`),gg.lineHeight&&ig.push(`line-height:${gg.lineHeight}`);const og=eg.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>");return`<span style="${ig.join(";")}">${og}</span>`}extractCellStyleFromHtml(eg){try{const gg=document.createElement("div");gg.style.position="absolute",gg.style.left="-9999px",gg.style.top="-9999px",gg.style.visibility="hidden",gg.innerHTML=eg,document.body.appendChild(gg);let ig=null;const ng=document.createTreeWalker(gg,NodeFilter.SHOW_TEXT);let og;for(;og=ng.nextNode();)if(og.textContent&&og.textContent.trim()){ig=og.parentElement;break}ig||(ig=gg);const ag=window.getComputedStyle(ig),Ig={};ag.color&&(Ig.fill=ag.color);const sg=parseFloat(ag.fontSize);if(Number.isFinite(sg)&&sg>0&&(Ig.fontSize=sg),ag.fontFamily){const cg=(ag.fontFamily.split(",")[0]||"").trim();Ig.fontFamily=cg.replace(/^["']|["']$/g,"")}if(ag.fontWeight&&ag.fontWeight!=="normal"&&ag.fontWeight!=="400"){const cg=Number(ag.fontWeight);Ig.fontWeight=ag.fontWeight==="bold"||Number.isFinite(cg)&&cg>=600?"bold":ag.fontWeight}ag.fontStyle&&ag.fontStyle!=="normal"&&(Ig.fontStyle=ag.fontStyle);const Cg=ag.textDecorationLine||ag.textDecoration||"";/underline/i.test(Cg)&&(Ig.underline=!0),/line-through/i.test(Cg)&&(Ig.linethrough=!0);const lg=ag.textAlign;(lg==="left"||lg==="center"||lg==="right")&&(Ig.textAlign=lg);const Ag=parseFloat(ag.lineHeight);return Number.isFinite(Ag)&&Ag>=.5&&Ag<=5&&(Ig.lineHeight=Ag),document.body.removeChild(gg),Ig}catch{return null}}selectCell(eg){var gg;this.selectedCellIndex=eg,this.dirty=!0,(gg=this.canvas)==null||gg.requestRenderAll()}handleCellDoubleClick(eg){const gg=this.getCellIndexByPoint(eg);gg<0||(this.removeEditingTextarea(!0),this.selectCell(gg),this.startCellEditing(gg))}getFont(eg,gg){const ig=gg.fontStyle==="italic"?"italic ":"",ng=Number(gg.fontWeight),ag=gg.fontWeight==="bold"||Number.isFinite(ng)&&ng>=600?"bold ":"";return`${ig}${ag}${eg}px ${gg.fontFamily}`}getCellEditFontSize(eg,gg=1){const ig=this.getCellStyle(eg).fontSize||12;return Math.max(ig,8/Math.max(gg,.01))}getSpacingPx(eg,gg){return(Number(eg.charSpacing)||0)/1e3*gg}getEditingLineCount(eg,gg,ig,ng){const ag=document.createElement("canvas").getContext("2d");return ag?(ag.font=this.getFont(ig,gg),Math.max(this.wrapTextLines(ag,eg,gg,ig,ng).length,1)):Math.max(eg.split(/\r?\n/).length,1)}measureTextWidth(eg,gg,ig,ng){const og=this.getSpacingPx(ig,ng);return!gg||!og?eg.measureText(gg).width:Array.from(gg).reduce((ag,Ig)=>ag+eg.measureText(Ig).width,0)+Math.max(Array.from(gg).length-1,0)*og}wrapTextLine(eg,gg,ig,ng,og){if(!gg)return[""];if(this.measureTextWidth(eg,gg,ig,ng)<=og)return[gg];const ag=[];let Ig="";return Array.from(gg).forEach(sg=>{const Cg=`${Ig}${sg}`;if(Ig&&this.measureTextWidth(eg,Cg,ig,ng)>og){ag.push(Ig),Ig=sg;return}Ig=Cg}),ag.push(Ig),ag}wrapTextLines(eg,gg,ig,ng,og){return String(gg).split(/\r?\n/).flatMap(ag=>this.wrapTextLine(eg,ag,ig,ng,og))}drawTextLine(eg,gg,ig,ng,og,ag){const Ig=this.getSpacingPx(ig,ag);if(!Ig){eg.fillText(gg,ng,og);return}const sg=Array.from(gg);let Cg=ng;const lg=this.measureTextWidth(eg,gg,ig,ag);ig.textAlign==="center"&&(Cg=ng-lg/2),ig.textAlign==="right"&&(Cg=ng-lg),eg.textAlign="left",sg.forEach(Ag=>{eg.fillText(Ag,Cg,og),Cg+=eg.measureText(Ag).width+Ig})}drawTextDecoration(eg,gg,ig,ng,og,ag,Ig){if(!Ig.underline&&!Ig.linethrough)return;const sg=Math.min(this.measureTextWidth(eg,gg,Ig,ag),og);let Cg=ig-sg/2;if(Ig.textAlign==="left"&&(Cg=ig),Ig.textAlign==="right"&&(Cg=ig-sg),eg.strokeStyle=Ig.fill||"#000000",eg.lineWidth=Math.max(ag/16,1),Ig.underline){const lg=ng+ag*.38;eg.beginPath(),eg.moveTo(Cg,lg),eg.lineTo(Cg+sg,lg),eg.stroke()}Ig.linethrough&&(eg.beginPath(),eg.moveTo(Cg,ng),eg.lineTo(Cg+sg,ng),eg.stroke())}drawCellText(eg,gg,ig,ng,og,ag,Ig){if(!gg)return;const sg=Math.min(4,og/6,ag/6),Cg=Math.max(og-sg*2,1),lg=this.getCellStyle(Ig),Ag=this.getTextXByAlign(ig,og,sg,lg.textAlign),cg=this.scaleX||1,rg=this.scaleY||1,ug=Math.max(Number(lg.fontSize)||12,1),dg=ug*(Number(lg.lineHeight)||1.2);eg.font=this.getFont(ug,lg);const bg=this.wrapTextLines(eg,gg,lg,ug,Cg*cg),mg=bg.length*dg,hg=this.getTextStartYByVertical(ng,ag,sg,mg,dg,lg.verticalType);eg.save(),eg.beginPath(),eg.rect(ig+.5,ng+.5,Math.max(og-1,1),Math.max(ag-1,1)),eg.clip(),eg.translate(Ag,hg),eg.scale(1/cg,1/rg),eg.fillStyle=lg.fill||"#000000",eg.font=this.getFont(ug,lg),eg.textAlign=lg.textAlign,eg.textBaseline="middle",bg.forEach((pg,fg)=>{const wg=fg*dg*rg;this.drawTextLine(eg,pg,lg,0,wg,ug),this.drawTextDecoration(eg,pg,0,wg,Cg*cg,ug,lg)}),eg.restore()}drawSelectedCell(eg){if(this.selectedCellIndex===null)return;const gg=this.selectedCellIndex;if(gg<0||gg>=this.rows*this.columns)return;const ig=this.getCellRect(gg);eg.save(),eg.fillStyle="rgba(47, 84, 235, 0.14)",eg.strokeStyle="#2F54EB",eg.lineWidth=1,eg.fillRect(ig.left,ig.top,ig.width,ig.height),eg.strokeRect(ig.left+.5,ig.top+.5,Math.max(ig.width-1,1),Math.max(ig.height-1,1)),eg.restore()}resolveBorderStyle(eg,gg){return eg==="none"||gg==="none"?"none":eg==="dashed"||gg==="dashed"?"dashed":"solid"}getDefaultBorderStyle(){return Array.isArray(this.strokeDashArray)&&this.strokeDashArray.length?"dashed":"solid"}getBorderSideStyle(eg,gg){var ig;return((ig=this.tableCellBorders[eg])==null?void 0:ig[gg])||this.getDefaultBorderStyle()}drawBorderSegment(eg,gg,ig,ng,og,ag){gg!=="none"&&(eg.save(),eg.strokeStyle=this.stroke||"#000000",eg.lineWidth=this.strokeWidth||1,eg.setLineDash(gg==="dashed"&&Array.isArray(this.strokeDashArray)?this.strokeDashArray:gg==="dashed"?[6,4]:[]),eg.beginPath(),eg.moveTo(ig,ng),eg.lineTo(og,ag),eg.stroke(),eg.restore())}drawTableBorders(eg){for(let gg=0;gg<=this.rows;gg++){const ig=this.getRowOffset(gg);for(let ng=0;ng<this.columns;ng++){const og=this.getColumnOffset(ng),ag=this.getColumnOffset(ng+1),Ig=gg>0?(gg-1)*this.columns+ng:-1,sg=gg<this.rows?gg*this.columns+ng:-1,Cg=Ig>=0?this.getBorderSideStyle(Ig,"bottom"):void 0,lg=sg>=0?this.getBorderSideStyle(sg,"top"):void 0,Ag=this.resolveBorderStyle(Cg||lg||"solid",Cg&&lg?lg:void 0);this.drawBorderSegment(eg,Ag,og,ig,ag,ig)}}for(let gg=0;gg<=this.columns;gg++){const ig=this.getColumnOffset(gg);for(let ng=0;ng<this.rows;ng++){const og=this.getRowOffset(ng),ag=this.getRowOffset(ng+1),Ig=gg>0?ng*this.columns+gg-1:-1,sg=gg<this.columns?ng*this.columns+gg:-1,Cg=Ig>=0?this.getBorderSideStyle(Ig,"right"):void 0,lg=sg>=0?this.getBorderSideStyle(sg,"left"):void 0,Ag=this.resolveBorderStyle(Cg||lg||"solid",Cg&&lg?lg:void 0);this.drawBorderSegment(eg,Ag,ig,og,ig,ag)}}}_render(eg){const gg=this.width||0,ig=this.height||0;if(!gg||!ig||!this.rows||!this.columns)return;const ng=-gg/2,og=-ig/2;eg.save(),eg.fillStyle=this.backgroundColor||"#FFFFFF00",eg.fillRect(ng,og,gg,ig),eg.restore(),this.drawSelectedCell(eg),this.drawTableBorders(eg),this.syncTextCount();for(let ag=0;ag<this.rows;ag++)for(let Ig=0;Ig<this.columns;Ig++){const sg=ag*this.columns+Ig,Cg=this.getCellRect(sg);this.drawCellText(eg,this.tableTexts[sg]||"",Cg.left,Cg.top,Cg.width,Cg.height,sg)}}};lu.type="table";let ATable=lu;tt.setClass(ATable);const RIBBON_BORDER_PATTERN_OPTIONS=[{label:"无描边",value:"none",source:{x:57,y:29,width:169,height:169}},{label:"图案 1",value:"ribbon-01",source:{x:293,y:29,width:169,height:169}},{label:"图案 2",value:"ribbon-02",source:{x:546,y:29,width:169,height:169}},{label:"图案 3",value:"ribbon-03",source:{x:781,y:29,width:169,height:169}},{label:"图案 4",value:"ribbon-04",source:{x:1005,y:29,width:169,height:169}},{label:"图案 5",value:"ribbon-05",source:{x:1230,y:29,width:169,height:169}},{label:"图案 6",value:"ribbon-06",source:{x:1436,y:29,width:169,height:169}},{label:"图案 7",value:"ribbon-07",source:{x:1660,y:29,width:169,height:169}},{label:"图案 8",value:"ribbon-08",source:{x:57,y:255,width:169,height:169}},{label:"图案 9",value:"ribbon-09",source:{x:296,y:255,width:169,height:169}},{label:"图案 10",value:"ribbon-10",source:{x:550,y:254,width:168,height:169}},{label:"图案 11",value:"ribbon-11",source:{x:781,y:255,width:169,height:169}},{label:"图案 12",value:"ribbon-12",source:{x:1003,y:254,width:169,height:169}},{label:"图案 13",value:"ribbon-13",source:{x:1230,y:255,width:169,height:169}},{label:"图案 14",value:"ribbon-14",source:{x:1436,y:255,width:169,height:169}},{label:"图案 15",value:"ribbon-15",source:{x:1660,y:254,width:169,height:169}},{label:"图案 16",value:"ribbon-16",source:{x:57,y:629,width:169,height:169}},{label:"图案 17",value:"ribbon-17",source:{x:550,y:480,width:168,height:169}},{label:"图案 18",value:"ribbon-18",source:{x:781,y:483,width:169,height:169}},{label:"图案 19",value:"ribbon-19",source:{x:1003,y:483,width:169,height:169}},{label:"图案 20",value:"ribbon-20",source:{x:1230,y:471,width:169,height:169}},{label:"图案 21",value:"ribbon-21",source:{x:1436,y:473,width:169,height:169}},{label:"图案 22",value:"ribbon-22",source:{x:1660,y:473,width:169,height:169}},{label:"图案 23",value:"ribbon-23",source:{x:781,y:693,width:169,height:169}},{label:"图案 24",value:"ribbon-24",source:{x:1003,y:686,width:169,height:169}},{label:"图案 25",value:"ribbon-25",source:{x:1230,y:683,width:169,height:169}},{label:"图案 26",value:"ribbon-26",source:{x:1436,y:683,width:169,height:169}},{label:"图案 27",value:"ribbon-27",source:{x:1660,y:683,width:169,height:169}}];RIBBON_BORDER_PATTERN_OPTIONS.map(tg=>tg.value);function drawRibbonBorder(tg,eg,gg,ig){if(eg==="none"||!(ig!=null&&ig.left)||!(ig!=null&&ig.right))return;const{width:ng,height:og}=gg,ag=gg.left??0,Ig=gg.top??0,sg=getRibbonBorderBandWidth(ng);drawTextureSide(tg,ig.left,ag,Ig,sg,og,"left"),drawTextureSide(tg,ig.right,ag+ng-sg,Ig,sg,og,"right")}function getRibbonBorderBandWidth(tg){return Math.max(16,Math.min(56,Math.round(tg*.11)))}function drawTextureSide(tg,eg,gg,ig,ng,og,ag){const Ig=getImageSourceWidth(eg),sg=Number(eg.naturalHeight||eg.height);if(!Ig||!sg)return;const Cg=Math.max(1,Math.min(ng,Math.round(Ig))),lg=ag==="right"?gg+ng-Cg:gg,Ag=Math.max(1,Math.round(sg*(Cg/Ig)));let cg=ig;for(;cg<ig+og;){const rg=Math.min(Ag,ig+og-cg),ug=Math.max(1,Math.round(sg*(rg/Ag)));tg.drawImage(eg,0,0,Ig,ug,lg,cg,Cg,rg),cg+=Ag}}function getImageSourceWidth(tg){return tg?Number(tg.naturalWidth||tg.width||0):0}const objectMap={line:(tg,eg)=>new ALine([0,0,0,0],{...tg}),rect:(tg,eg)=>new ARect(tg),triangle:(tg,eg)=>new ATriangle(tg),table:(tg,eg)=>new ATable(tg),circle:(tg,eg)=>new ACircle(tg),barcode:(tg,eg)=>new ABarcode(eg,tg),barcode2d:(tg,eg)=>new ABarcode2D(eg,tg),text:(tg,eg)=>new AText(eg??"",tg),textname:(tg,eg)=>new ATextName(eg??"",tg),counter:(tg,eg)=>new ACounter(eg,tg),image:(tg,eg)=>new AImage(eg,tg),rfid:(tg,eg)=>new RfidIcon(eg,tg)};o.DPI=203;class BaseEditor{constructor(){this.bindData=new EditorData,this.ribbonBorderPattern="none",this.ribbonBorderTextures=null}get width(){var eg;return(eg=this.canvas)==null?void 0:eg.elements.lower.el.offsetWidth}get height(){var eg;return(eg=this.canvas)==null?void 0:eg.elements.lower.el.offsetHeight}init(eg,gg){this.canvas=new In(eg,{...gg,imageSmoothingEnabled:!1,fireMiddleClick:!0,fireRightClick:!0,stopContextMenu:!1,controlsAboveOverlay:!0,preserveObjectStacking:!0,selectionKey:"ctrlKey"}),this.bindData.init(this);const ig=ng=>{if(!this.canvas)return;const og=this.canvas.getActiveObject();if(!og||og.type!=="textname")return;const ag=og;ag.isEditing===!0&&(ng.key==="Enter"||ng.keyCode===13||ng.key===" "||ng.key==="Space"||ng.keyCode===32)&&(ng.preventDefault(),ng.stopImmediatePropagation(),ag.selectionStart!==void 0&&(ag.selectionStart=ag.selectionEnd=ag.selectionStart))};document.addEventListener("keydown",ig),this.canvas.on("dispose",()=>{document.removeEventListener("keydown",ig)})}removeObject(eg){var gg;eg&&((gg=this.canvas)==null||gg.remove(eg))}addObject(eg,gg,ig,ng){if(this.canvas)if(eg==="image")kn.loadImage(ig,{crossOrigin:"anonymous"}).then(og=>{let ag=og.width/og.height;gg.imgScaleType=ag>1?"3":ag<1?"2":"1";const Ig=new AImage(og,gg);Ig.id=v4(),Ig.canvas=this.canvas,Ig.padding=3,addObjName(this.canvas,Ig),this.canvas.add(Ig),this.canvas.setActiveObject(Ig)});else{const og=objectMap[eg](gg,ig);og.id=v4(),og.canvas=this.canvas,og.padding=3,addObjName(this.canvas,og),this.canvas.add(og),this.canvas.setActiveObject(og)}}getActiveObjects(){return this.canvas.getActiveObjects()}getActiveObject(){return this.canvas.getActiveObject()}getObjects(){return this.canvas.getObjects()}getAllObjects(){const eg=this.getCanvas(),gg=[];function ig(ng){ng.type==="group"&&ng._objects?ng._objects.forEach(og=>ig(og)):ng.id!=="workspace"&&gg.push(ng)}return eg.getObjects().forEach(ng=>ig(ng)),gg}getBind(){return this.bindData}setRibbonBorderTextures(eg){var gg;this.ribbonBorderTextures=eg,(gg=this.canvas)==null||gg.requestRenderAll()}_toDataUrl(eg,gg,{exclude:ig=[],targetDPI:ng=203,type:og="",ribbonBorderPattern:ag=this.ribbonBorderPattern}={},Ig=null){let sg=Ig;if(gg&&sg){const{left:Zg,top:yg,right:Bg,bottom:Wg}=gg;sg.width=sg.width+Zg+Bg,sg.height=sg.height+yg+Wg}const{left:Cg,top:lg,width:Ag,height:cg}=sg,rg=eg.viewportTransform,ug=new ot(Cg,lg).transform(rg),dg=new ot(Ag,cg).transform(rg),bg=dg.x-ug.x,mg=dg.y-ug.y;let hg=Ag/bg*(Math.trunc(ng/o.DPI*100)/100);const pg={format:"png",quality:1,width:bg,height:mg,left:ug.x,top:ug.y,multiplier:hg};eg.set("flagToDataURL",!0),(sg&&sg.type==="ellipse"||sg.type==="rect"&&sg.rx&&sg.ry)&&(eg.clipPath=sg);let fg="",wg="",Gg="";if(og==="print"){let Zg=["text","counter","rect","circle","barcode","group","table","triangle"],yg=["line","ellipse","image","barcode2d"];wg=eg.toCanvasElement(hg,{...pg,filter:Vg=>!ig.includes(Vg.id)&&(Zg.includes(Vg.type)||Vg.id==="workspace")}),Gg=eg.toCanvasElement(hg,{...pg,filter:Vg=>!ig.includes(Vg.id)&&Vg.id!=="workspace"&&yg.includes(Vg.type)});let Bg=wg.getContext("2d"),Wg=Bg.getImageData(0,0,wg.width,wg.height),$g=Wg.data;const Ng=$g.length,vg=Ng-Ng%16;let Xg=window.myThreshold||200;for(let Vg=0;Vg<vg;Vg+=16){let Mg=$g[Vg],Rg=$g[Vg+1],Sg=$g[Vg+2],Yg=.299*Mg+.587*Rg+.114*Sg;Yg=Yg>Xg?255:0,$g[Vg]=$g[Vg+1]=$g[Vg+2]=Yg,Mg=$g[Vg+4],Rg=$g[Vg+5],Sg=$g[Vg+6],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+4]=$g[Vg+5]=$g[Vg+6]=Yg,Mg=$g[Vg+8],Rg=$g[Vg+9],Sg=$g[Vg+10],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+8]=$g[Vg+9]=$g[Vg+10]=Yg,Mg=$g[Vg+12],Rg=$g[Vg+13],Sg=$g[Vg+14],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+12]=$g[Vg+13]=$g[Vg+14]=Yg}for(let Vg=vg;Vg<Ng;Vg+=4){const Mg=$g[Vg],Rg=$g[Vg+1],Sg=$g[Vg+2];let Yg=.299*Mg+.587*Rg+.114*Sg;Yg=Yg>Xg?255:0,$g[Vg]=$g[Vg+1]=$g[Vg+2]=Yg}if(Bg.save(),Bg.putImageData(Wg,0,0),Bg.globalCompositeOperation="multiply",Bg.fillStyle="rgba(255, 255, 255, 1)",Bg==null||Bg.fillRect(0,0,wg.width,wg.height),Bg.drawImage(Gg,0,0,Gg.width,Gg.height),Gg.width=0,Gg.height=0,Bg.restore(),fg=wg,fg instanceof HTMLCanvasElement){const{width:Vg,height:Mg}=fg,Rg=document.createElement("canvas");Rg.width=Vg,Rg.height=Mg,Rg.getContext("2d",{willReadFrequently:!0}).drawImage(fg,0,0),fg.width=0,fg.height=0,fg=Rg}}else og==="review"?fg=eg.toCanvasElement(hg,{...pg,filter:Zg=>!ig.includes(Zg.id)}):ag!=="none"?fg=eg.toCanvasElement(hg,{...pg,filter:Zg=>!ig.includes(Zg.id)}):fg=eg.toDataURL({...pg,filter:Zg=>!ig.includes(Zg.id)});if(ag!=="none"&&fg instanceof HTMLCanvasElement){const Zg=fg.getContext("2d");Zg&&drawRibbonBorder(Zg,ag,{width:fg.width,height:fg.height},this.ribbonBorderTextures),og!=="print"&&og!=="review"&&(fg=fg.toDataURL("image/png",1))}return eg.clipPath&&(eg.clipPath=void 0),eg.set("flagToDataURL",!1),fg}storeStatus(){var eg;this.activeObjects=(eg=this.canvas)==null?void 0:eg.getActiveObject()}restoreStatus(eg=!1){var gg,ig,ng;this.activeObjects?(console.log("restoreStatus"),(gg=this.canvas)==null||gg.setActiveObject(this.activeObjects),(ig=this.canvas)==null||ig.requestRenderAll(),this.activeObjects=void 0):eg&&((ng=this.canvas)==null||ng.requestRenderAll())}getCanvas(){if(!this.canvas)throw new Error("Editor uninit!!!");return this.canvas}static set DPI(eg){o.DPI=eg}static get DPI(){return o.DPI}dispose(){this.canvas&&this.canvas.dispose()}}Object.defineProperty(ji.prototype,"locked",{configurable:!0,enumerable:!0,get:function(){return this.lockMovementX&&this.lockMovementY&&this.lockRotation&&this.lockScalingX&&this.lockScalingY&&this.lockSkewingX&&this.lockSkewingY&&this.lockScalingFlip},set:function(tg){this.lockMovementX=this.lockMovementY=this.lockRotation=this.lockScalingX=this.lockScalingY=this.lockSkewingX=this.lockSkewingY=this.lockScalingFlip=tg,this.canvas&&this.canvas.fire("custom:object:locked",{target:this})}});class Editor extends BaseEditor{constructor(){super(...arguments),this.plugins=new Map,this.hooks=new Map,this.events=new Map,this.id=v4(),this._isShown=!1,this._isHasRfid=!1}get filePath(){return this._filePath}set filePath(eg){this._filePath=eg}get labelConfig(){return this._labelConfig}set labelConfig(eg){this._labelConfig=eg}get rfidConfig(){return this._rfidConfig}set rfidConfig(eg){this._rfidConfig=eg}get databaseConfig(){return this._databaseConfig}set databaseConfig(eg){this._databaseConfig=eg}init(eg,gg){super.init(eg,gg),this.canvas&&(this.canvas.on("custom:object:locked",ig=>{this.emit("custom:object:locked",ig)}),this.canvas.on("custom:object:refreshList",ig=>{this.emit("custom:object:refreshList",ig)}))}dispose(){this.canvas&&(this.canvas.off("custom:object:locked"),this.canvas.off("custom:object:refreshList")),this.plugins.forEach(eg=>eg.uninstall&&eg.uninstall()),super.dispose()}addHotKey(eg,gg){hotkeys(eg,{single:!0},(ig,ng)=>{ig.preventDefault(),gg({kbe:ig,hke:ng})})}removeHotKey(eg){hotkeys.unbind(eg)}editActivated(){for(let eg of this.plugins.values())eg.enabled&&eg.enabled()}editDeactivated(){for(let eg of this.plugins.values())eg.disabled&&eg.disabled()}use(eg,gg){const ig=typeof eg=="function"?new eg(gg):eg;return this.checkDependencies(ig),this.runLifecycleHooks(ig,gg),ig.name&&this.plugins.set(ig.name,ig),this}checkDependencies(eg){eg.dependencies&&eg.dependencies.forEach(gg=>{if(!this.plugins.has(gg))throw new Error(`Plugin ${eg.name} requires ${gg} to be installed first`)})}runLifecycleHooks(eg,gg){eg.install&&eg.install(this,gg)}addHook(eg,gg){this.hooks.set(eg,gg)}triggerHook(eg,...gg){const ig=this.hooks.get(eg);if(ig)return ig(...gg)}getPlugin(eg){return this.plugins.get(eg)}on(eg,gg){this.events.has(eg)||this.events.set(eg,[]),this.events.get(eg).push(gg)}emit(eg,...gg){this.events.has(eg)&&this.events.get(eg).forEach(ig=>ig(...gg))}off(eg,gg){this.events.has(eg)&&(gg?this.events.set(eg,this.events.get(eg).filter(ig=>ig!==gg)):this.events.delete(eg))}toDataUrl({padding:eg,type:gg="",exclude:ig=[],targetDPI:ng=203,isJudgeGrid:og=!1,ribbonBorderPattern:ag=this.ribbonBorderPattern}={}){if(!this.canvas)return;this.canvas.discardActiveObject();const Ig=this.getPlugin("RulerPlugin"),sg=this.getPlugin("HistoryPlugin"),Cg=this.getPlugin("WorkspacePlugin"),lg=Cg.workspace;let Ag=!1;og&&(Ag=(lg==null?void 0:lg.isHasGrid)||!1,Ag&&(Cg==null||Cg.hideGrid())),Ig&&Ig.disabled(),sg&&sg.disabled();const cg=this._toDataUrl(this.canvas,eg,{exclude:ig,targetDPI:ng,type:gg,ribbonBorderPattern:ag},lg);return this.canvas.renderAll(),Ig&&Ig.enabled(),sg&&sg.enabled(),og&&Ag&&(Cg==null||Cg.showGrid()),cg}async toDataUrlOffscreen({padding:eg,type:gg="",exclude:ig=[],targetDPI:ng=203,isJudgeGrid:og=!1,ribbonBorderPattern:ag=this.ribbonBorderPattern,json:Ig}={}){if(!this.canvas)return"";const sg=this.getPlugin("WorkspacePlugin"),Cg=sg==null?void 0:sg.workspace;if(!Cg)return"";const lg=Ig||this.canvas.toObject(cloneCommonField),Ag=this.canvas.getWidth(),cg=this.canvas.getHeight(),rg=document.createElement("canvas");rg.width=Ag,rg.height=cg;const ug=new In(rg,{enableRetinaScaling:!1,skipOffscreen:!1,selection:!1,preserveObjectStacking:!0});ug.setViewportTransform(this.canvas.viewportTransform?Array.from(this.canvas.viewportTransform):[1,0,0,1,0,0]);let dg=!1;const bg=Cg.width,mg=Cg.height;try{return await ug.loadFromJSON(lg),ug.renderAll(),typeof(sg==null?void 0:sg.createExportWorkspace)=="function"&&(sg.createExportWorkspace(ug),ug.renderAll()),og&&(dg=Cg.isHasGrid||!1),this._toDataUrl(ug,eg,{exclude:ig,targetDPI:ng,type:gg,ribbonBorderPattern:ag},Cg)}finally{Cg.width=bg,Cg.height=mg,ug.dispose(),rg.remove()}}toTemplateJson(){const eg={};eg.Version="1.0.0-alpha.1",refreshObjectCenterProperties(this.canvas.getObjects());let gg=this.canvas.toObject(cloneCommonField);if(eg.canvas=JSON.stringify(gg),this._labelConfig){const ig=this._labelConfig;ig.fileId.length===0&&(ig.fileId=v4()),eg.labelConfig=ig}return this._databaseConfig&&(eg.databaseConfig=this._databaseConfig),this._rfidConfig&&(eg.rfidConfig=this._rfidConfig),this._filePath&&(eg.filePath=this._filePath),JSON.stringify(eg)}toJSON(){return refreshObjectCenterProperties(this.canvas.getObjects()),JSON.stringify(this.canvas.toObject(cloneCommonField))}fromTemplateJson(eg,gg){this.canvas&&this.canvas.loadFromJSON(eg).then(ig=>{ig.renderAll(),gg(),this.bindData&&this.canvas&&(this.bindData.originState=JSON.stringify(this.canvas.toJSON()))})}}const state$2=reactive({barcode2dSizeRatio:""});function getAlignedTextLeft(tg,eg,gg,ig){return ig==="center"?tg+(eg-gg)/2:ig==="right"?tg+eg-gg:tg}function getTextWidth(tg,eg,gg=0){return tg.measureText(eg).width+Math.max(0,Array.from(eg).length-1)*gg}let sRatio=Math.trunc(4/3*100)/100,longbeiClearCode=["10000502","10002500","10000503"];const Cu=class Cu extends ji{constructor(eg,gg){var og,ag;super(gg),this.lastCtx=null,this.lastDrawOption=null,this.hasToDataUrl=!1,this.counterProps=null,this.reviewValueArgs=null,this.barcodeDateFormatType="",this.increaseDate=!1,this.concatTextIdListObj=null,this.connectObjIds=[],this.isFirstLoad=!1,this.canModified=!0,this.useLongbeiCache=!0,this.inWorkerRender=!1,this.workerOtherImgData="",this.barcodeBodyHeight=0,this.textAreaHeight=0,this.isSyncingTextHeight=!1,this.emitErrorMessage=throttle$1(Ig=>{canvasEventBus.emit("canvasShowError",Ig)},800),this._cache={canvas:void 0,error:void 0},this.counterProps=gg&&gg.counterProps?gg.counterProps:this.counterProps,this.increaseDate=gg&&gg.increaseDate?gg.increaseDate:this.increaseDate,this.barcodeDateFormatType=gg&&gg.barcodeDateFormatType?gg.barcodeDateFormatType:this.barcodeDateFormatType,((og=eg.extra)==null?void 0:og.version)==="0"&&(eg.extra=omit(eg.extra,["version"])),((ag=eg.extra)==null?void 0:ag.eclevel)==="0"&&(eg.extra=omit(eg.extra,["eclevel"])),eg.custom||(eg.custom={}),this.barcode2dOptions=cloneDeep(eg),this.concatTextIdListObj=gg&&gg.concatTextIdListObj?gg.concatTextIdListObj:this.concatTextIdListObj,this.connectObjIds=gg.connectObjIds??this.connectObjIds,this.barcode2dOptions.includetext=eg.includetext??!1,this.barcode2dOptions.textposition=this.barcode2dOptions.includetext?this.barcode2dOptions.textposition||"bottom":"none",this.barcode2dOptions.textsize=this.barcode2dOptions.textsize||14,this.barcode2dOptions.textfontname=this.barcode2dOptions.textfontname||"Arial",this.barcode2dOptions.textxalign=this.barcode2dOptions.textxalign||"center",this.barcode2dOptions.textgaps=this.barcode2dOptions.textgaps||0,this.textAreaHeight=this.measureTextAreaHeight(this.barcode2dOptions),this.barcodeBodyHeight=Math.max(1,(this.height||1)-this.textAreaHeight),this.set({width:this.width,height:this.height}),this.on("modified",Ig=>{console.log("eee=======",Ig),lpBcid.includes(this.barcode2dOptions.bcid)&&(Ig==null?void 0:Ig.action)!=="drag"&&(this.canModified=!0,setTimeout(()=>{let sg=this.barcode2dOptions.custom,Cg=this.width*this.scaleX,lg=this.height*this.scaleY,Ag=Math.max(Cg/lg,lg/Cg);Ag=Math.trunc(Ag*100)/100,[1,2,sRatio].includes(Ag)?(sg.sizeRatio=Ag===1?"1x1":Ag===2?"2x1":"4x3",state$2.barcode2dSizeRatio=sg.sizeRatio):(sg.sizeRatio="auto",state$2.barcode2dSizeRatio=sg.sizeRatio),console.log("state.barcode2dSizeRatio========",state$2.barcode2dSizeRatio)},30)),lpBcid.includes(this.barcode2dOptions.bcid)&&(Ig==null?void 0:Ig.action)==="drag"&&this.updateLpCodePosition()}),this.on("scaling",()=>{lpBcid.includes(this.barcode2dOptions.bcid)&&(this.canModified=!1,this.clearErrorLpCodeMap())}),canvasEventBus.off(`update:barcode2d:${this.id}`),canvasEventBus.on(`update:barcode2d:${this.id}`,async({list:Ig,callback:sg=function(){}}={})=>{let Cg=await this.updateBarCode2d(Ig);sg&&sg(Cg)})}updateLpCodePosition(){let eg=this.getLpCache();eg&&(eg.x=this.left,eg.y=this.top)}clearErrorLpCodeMap(){errorLpCodeMap.delete(this.id)}getLpCache(){let eg="",gg=this.id;return this.barcode2dOptions.bcid==="LPCode"?eg=getLastCacheLpcode(gg):this.barcode2dOptions.bcid==="LPMixQrCode"&&(eg=getLastMixCacheLpcode(gg)),eg}drawLpCode(eg,gg,ig,ng,og,ag="",Ig=null){var lg;let sg=eg||this.lastCtx;if(this._cache.error=void 0,ag==="cache"&&(this.width=ng,this.height=og,this.scaleX=1,this.scaleY=1,Ig&&(this.left=Ig.x,this.top=Ig.y),this.lastDrawOption={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2},ig.w=this.lastDrawOption.w,ig.h=this.lastDrawOption.h,ig.x=this.lastDrawOption.x,ig.y=this.lastDrawOption.y,this.strokeWidth>0&&(ig.x+=this.strokeWidth,ig.y+=this.strokeWidth),this.setCoords()),this.inWorkerRender||(this.workerOtherImgData=gg),sg.drawImage(gg,ig.x,ig.y,ng,og),this.strokeWidth>0){let Ag=this.stroke||"#fff";sg.lineWidth=this.strokeWidth,sg.strokeStyle=Ag,withObjectStrokeDash(sg,this,()=>sg.strokeRect(-this.width/2,-this.height/2,ng+this.strokeWidth*2,og+this.strokeWidth*2))}this.dirty=!0;let Cg=this.group;for(;Cg;)Cg.dirty=!0,Cg=Cg.group;this.isFirstLoad||(this.objectCaching=!1,this.isFirstLoad=!0),(lg=this.canvas)==null||lg.requestRenderAll(),this.objectCaching||setTimeout(()=>{this.objectCaching=!0},60)}getTextLayout(eg,gg,ig){if(!this.shouldShowText(gg))return{showText:!1,textGap:0,textLineHeight:0,textAreaHeight:0,barcodeHeight:ig};const{scaleY:og}=this.getRenderScale(),ag=14/og,Ig=6/og,sg=this.measureTextLineHeight(gg,eg),Cg=Math.ceil(sg/og+ag+Ig);return{showText:!0,textGap:ag,textLineHeight:sg,textAreaHeight:Cg,barcodeHeight:ig}}shouldShowText(eg){return eg.includetext&&eg.textposition!=="none"&&!!eg.text}getMeasureContext(){return typeof document>"u"?null:document.createElement("canvas").getContext("2d")}measureTextLineHeight(eg,gg){const ig=Number(eg.textsize)||14,ng=gg||this.getMeasureContext();if(!ng)return ig*1.2;ng.save(),ng.font=`${ig}px ${eg.textfontname||"Arial"}`;const og=ng.measureText(eg.text||"");return ng.restore(),og.actualBoundingBoxAscent+og.actualBoundingBoxDescent||ig*1.2}measureTextAreaHeight(eg){if(!this.shouldShowText(eg))return 0;const{scaleY:gg}=this.getRenderScale(),ig=14/gg,ng=6/gg;return Math.ceil(this.measureTextLineHeight(eg)/gg+ig+ng)}syncTextHeight(eg){var og;const gg=this.barcodeBodyHeight||Math.max(1,(this.height||1)-this.textAreaHeight),ig=gg+eg;if(this.barcodeBodyHeight=gg,this.textAreaHeight=eg,Math.abs((this.height||0)-ig)<.01)return;this.isSyncingTextHeight=!0,this.set("height",ig),this.isSyncingTextHeight=!1,this.setCoords();let ng=this.group;for(;ng;)ng.dirty=!0,ng==null||ng.triggerLayout("childUpdate"),ng.setCoords(),ng=ng.group;(og=this.canvas)==null||og.requestRenderAll()}getRenderScale(){var ng;const eg=(ng=this.getObjectScaling)==null?void 0:ng.call(this),gg=Math.abs((eg==null?void 0:eg.x)||this.scaleX||1)||1,ig=Math.abs((eg==null?void 0:eg.y)||this.scaleY||1)||1;return{scaleX:gg,scaleY:ig}}renderText(eg,gg,ig,ng,og){if(!gg.includetext||gg.textposition==="none"||!gg.text)return;const ag=gg.textxalign||"center";eg.save();const{scaleX:Ig,scaleY:sg}=this.getRenderScale();eg.scale(1/Ig,1/sg),eg.font=`${gg.textsize||14}px ${gg.textfontname||"Arial"}`,eg.fillStyle=gg.textcolor||"#000";const Cg=Number(gg.textgaps)||0,lg=getTextWidth(eg,gg.text,Cg),Ag=Math.max(0,ig.w-(this.strokeWidth>0?this.strokeWidth*2:0)),cg=getAlignedTextLeft(ig.x,Ag,lg/Ig,ag);eg.textAlign="left",eg.textBaseline="top",Cg&&(eg.letterSpacing=Cg+"px"),eg.fillText(gg.text,cg*Ig,(ig.y+ng+og)*sg),eg.restore()}async _render(eg){var og,ag,Ig,sg,Cg;const gg=cloneDeep(this.barcode2dOptions);this.lastCtx=eg;const ig=this.getTextLayout(eg,gg,this.barcodeBodyHeight||this.height),ng={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2};if(eg.save(),eg.imageSmoothingEnabled=!1,this.dirty){if(gg.width=ng.w,gg.height=ig.barcodeHeight,typeof this.fill=="string"){let lg=rgbaStringToHex8(this.fill);gg.barcolor=hexToHex6_blend(lg)}this.strokeWidth>0&&(gg.width-=this.strokeWidth*2,gg.height-=this.strokeWidth*2);try{lpBcid.includes(gg.bcid)||(this._cache.canvas=generateCanvas(gg),this.dirty=!1,this._cache.error&&(this._cache.error=void 0))}catch(lg){this.dirty=!0,lg instanceof Error&&(console.log("error",lg.message),this._cache.error=lg.message),this._cache.canvas=void 0}}if(this.strokeWidth>0&&(ng.x+=this.strokeWidth,ng.y+=this.strokeWidth),this.lastDrawOption=ng,lpBcid.includes(gg.bcid)){let lg=this.lastDrawOption;const Ag=this.strokeWidth>0?lg.w-this.strokeWidth*2:lg.w,cg=Math.max(1,this.strokeWidth>0?ig.barcodeHeight-this.strokeWidth*2:ig.barcodeHeight);let rg=Ag*this.scaleX,ug=cg*this.scaleY,dg=gg.text,bg=Number((og=gg.extra)==null?void 0:og.eclevel)||1;bg=bg+"";let mg=Math.trunc(rg/Editor.DPI*25.4*100)/100,hg=Math.trunc(ug/Editor.DPI*25.4*100)/100,pg=mg/(hg||1),fg=((ag=gg.custom)==null?void 0:ag.CellSize)||"8",wg=`${dg}-${bg}-${mg+hg}-${pg}-${fg}`,Gg=`${this.id}`,Zg=null;if(gg.bcid==="LPMixQrCode"){let yg=((Ig=gg.custom)==null?void 0:Ig.LPErrLevel)||"0",Bg=((sg=gg.custom)==null?void 0:sg.QRErrLevel)||"0";bg=`${yg}-${Bg}`,wg=`${dg}-${bg}-${mg+hg}-${pg}-${fg}`}try{if(errorLpCodeMap.has(Gg)){errorLpCodeMap.set(Gg,this._cache.error||"龙贝码生成错误");let yg=this.getLpCache();if(yg&&this.useLongbeiCache){let Bg=yg||{};Zg=Bg.img,this.drawLpCode(eg,Zg,lg,Bg.rWidth,Bg.rHeight,"cache",Bg),this._cache.error=void 0}else this._cache.error=errorLpCodeMap.get(Gg)||"龙贝码生成错误"}else{if(lpCodeMap.has(wg)&&this.useLongbeiCache){Zg=lpCodeMap.get(wg);let yg={id:this.id,sKey:wg,img:Zg,rWidth:rg,rHeight:ug,x:this.left,y:this.top};this.barcode2dOptions.bcid==="LPCode"?setCacheLpCode(yg):setCacheMixLpCode(yg)}else if(this.canModified){let yg={Content:dg,ErrLevel:bg,Width:mg,Height:hg,id:this.id,rWidth:rg,rHeight:ug,CellSize:fg,x:this.left,y:this.top,DPI:Editor.DPI};this.useLongbeiCache||lpCodeMap.delete(wg),this.barcode2dOptions.bcid==="LPCode"?Zg=await getBase64Data(yg):Zg=await getMixBase64Data(yg),this.useLongbeiCache=!0}if(lpCodeMap.has(wg)&&this.useLongbeiCache)this._cache.error=void 0,this.drawLpCode(eg,Zg,lg,Ag,cg);else if(this.useLongbeiCache){let yg=this.getLpCache();yg&&(Zg=(yg||{}).img,this.drawLpCode(eg,Zg,lg,Ag,cg),this._cache.error=void 0)}}}catch(yg){let Bg=yg&&yg.code,Wg=this.getLpCache();if(errorLpCodeMap.set(Gg,this._cache.error||"龙贝码生成错误"),Bg&&(longbeiClearCode.includes(Bg+"")&&(this.useLongbeiCache=!1,clearLpAndMixCacheById(this.id),this._cache.error=`龙贝码: ${yg.payload}`),this.emitErrorMessage(yg.payload)),Wg&&this.useLongbeiCache){let $g=Wg||{};Zg=$g.img,this.drawLpCode(eg,Zg,lg,$g.rWidth,$g.rHeight,"cache",$g),this._cache.error=void 0}else Bg&&(this._cache.error=`龙贝码: ${yg.payload}`,this.dirty=!0,(Cg=this.canvas)==null||Cg.requestRenderAll())}}else this.objectCaching=!0;if(!this._cache.error&&!lpBcid.includes(gg.bcid)){if(this._cache.canvas){const lg=this.strokeWidth>0?ng.w-this.strokeWidth*2:ng.w,Ag=Math.max(1,this.strokeWidth>0?ig.barcodeHeight-this.strokeWidth*2:ig.barcodeHeight),cg=this._cache.canvas;if(eg.drawImage(cg,0,0,cg.width,cg.height,ng.x,ng.y,lg,Ag),this.strokeWidth>0){let rg=this.stroke||"#fff";eg.lineWidth=this.strokeWidth,eg.strokeStyle=rg,withObjectStrokeDash(eg,this,()=>eg.strokeRect(-this.width/2,-this.height/2,ng.w,ng.h))}}}if(!this._cache.error&&ig.showText&&this.renderText(eg,gg,ng,ig.barcodeHeight,ig.textGap),eg.translate(.5,.5),this._cache.error){const lg=wrapText(eg,this._cache.error,ng.w,"bold 18px 宋体"),Ag=getLineHeight(eg);let cg=ng.y+Ag;const rg=eg.fillStyle;eg.fillStyle="red";for(const ug of lg)eg.fillText(ug,ng.x,cg),cg+=Ag;eg.fillStyle=rg}eg.restore()}async getLongBeiImg(eg){var dg,bg,mg,hg;if(!lpBcid.includes(eg.bcid))return;let gg=this.lastDrawOption;const ig=this.strokeWidth>0?gg.w-this.strokeWidth*2:gg.w,ng=this.strokeWidth>0?gg.h-this.strokeWidth*2:gg.h;let og=eg.text,ag=Number((dg=eg.extra)==null?void 0:dg.eclevel)||1,Ig=ig*this.scaleX,sg=ng*this.scaleY,Cg=Math.trunc(Ig/Editor.DPI*25.4*100)/100,lg=Math.trunc(sg/Editor.DPI*25.4*100)/100,Ag=Cg/(lg||1),cg=((bg=eg.custom)==null?void 0:bg.CellSize)||"8",rg=`${og}-${ag}-${Cg+lg}-${Ag}-${cg}`,ug=null;if(eg.bcid==="LPMixQrCode"){let pg=((mg=eg.custom)==null?void 0:mg.LPErrLevel)||"0",fg=((hg=eg.custom)==null?void 0:hg.QRErrLevel)||"0";ag=`${pg}-${fg}`,rg=`${og}-${ag}-${Cg+lg}-${Ag}-${cg}`}this.clearErrorLpCodeMap();try{if(lpCodeMap.has(rg)&&this.useLongbeiCache)ug=lpCodeMap.get(rg);else{let pg={Content:og,ErrLevel:ag,Width:Cg,Height:lg,id:this.id,rWidth:Ig,rHeight:sg,CellSize:cg,x:this.left,y:this.top,DPI:Editor.DPI};this.barcode2dOptions.bcid==="LPCode"?ug=await getBase64Data(pg,"noSaveCache"):ug=await getMixBase64Data(pg,"noSaveCache"),this.useLongbeiCache=!0}return this.workerOtherImgData=ug,this._cache.error=void 0,ug}catch(pg){console.error(pg)}}dispose(){super.dispose()}set(eg,gg){return this.isSyncingTextHeight||(typeof eg=="string"?eg==="height"&&typeof gg=="number"&&(this.barcodeBodyHeight=Math.max(1,gg-this.textAreaHeight)):typeof eg.height=="number"&&(this.barcodeBodyHeight=Math.max(1,eg.height-this.textAreaHeight))),super.set(eg,gg)}countDate(eg=""){if(this.barcodeDateFormatType&&this.increaseDate){const gg=formatDate(this.barcodeDateFormatType);return console.log("formatted",gg),this.dirty=!0,eg!=="print"&&this.setBarcode2DOption({bcid:this.barcode2dOptions.bcid,text:gg}),gg}}countCurrent(eg){let gg=this.counterProps||eg;if(gg){let ig=gg;if(!ig.value&&ig.value!==0)return"";const ng=formatCounterValue(ig);return(ig.prefix&&ig.prefix.length>0?ig.prefix:"")+ng+(ig.suffix&&ig.suffix.length>0?ig.suffix:"")}return""}countNext(eg="print"){if(this.counterProps){let gg=this.counterProps;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);let ng=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const og=getNextCounterValue(gg);return og!==null&&(gg.value=og,this.counterProps.value=og),this.dirty=!0,ng}else return""}reviewRecover(){if(this.reviewValueArgs){const eg=this.reviewValueArgs;this.counterProps=eg,this.reviewValueArgs=null;const gg=formatCounterValue(eg);let ig=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"");this.setBarcode2DOption({bcid:this.barcode2dOptions.bcid,text:ig})}}updateInGroup(){this.setCoords(),this.dirty=!0;let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}async updateBarCode2d(eg=[],gg=""){var ig;if(this.concatTextIdListObj||this.connectObjIds&&this.connectObjIds.length>0){let ng=!1,og="",ag=[],Ig=[];const sg=lg=>{if(this.connectObjIds){let Ag=0;for(let cg of this.connectObjIds){if(cg.index=Ag,cg.id&&cg.id===lg.id){ng=!0;let rg=lg.text+"";if(lg.type==="counter"&&(lg._props.mode==="1"?rg=lg.countCurrent():lg._props.mode==="2"&&(lg.updateText({isUpdateBarCodeDate:!1}),rg=lg.text+"")),cg.maxEnd=rg.length,cg.isSplit){cg.start=Math.min(cg.start,cg.maxEnd);let ug=rg.slice(cg.start,cg.end);ag[Ag]=ug}else ag[Ag]=rg}Ag++}}},Cg=lg=>{lg.type==="text"&&this.concatTextIdListObj&&this.concatTextIdListObj[lg.id]&&(ng||(this.barcode2dOptions.bcid==="LPMixQrCode"?lg==null||lg.set("text",this.barcode2dOptions.text.replace(/\|&&&\|/g,"")):lg==null||lg.set("text",this.barcode2dOptions.text),lg.updateInGroup()),Ig.push(lg))};if(eg.length>0)eg.forEach(lg=>{sg(lg),Cg(lg)});else{const lg=Ag=>{Ag.type==="group"&&Ag._objects?Ag._objects.forEach(cg=>lg(cg)):(sg(Ag),Cg(Ag))};(ig=this.canvas)==null||ig.getObjects().forEach(Ag=>lg(Ag))}return ng?(og=ag.join(""),this.barcode2dOptions.text=og,lpBcid.includes(this.barcode2dOptions.bcid)&&gg&&await this.getLongBeiImg(this.barcode2dOptions),this.dirty=!0,gg&&this.updateInGroup(),setTimeout(()=>{var lg;(lg=this.canvas)==null||lg.requestRenderAll()},0),Ig.forEach(lg=>{lg==null||lg.set("text",og),lg.updateInGroup()}),og):""}else return""}setBarcode2DOption(eg){if(this.barcode2dOptions.bcid!==eg.bcid&&(eg.extra={},this.barcode2dOptions.extra={}),merge(this.barcode2dOptions,eg),eg.extra&&(typeof+eg.extra.version=="number"&&eg.extra.version==="0"&&(this.barcode2dOptions.extra=omit(this.barcode2dOptions.extra,["version"])),eg.extra.eclevel==="0"&&(this.barcode2dOptions.extra=omit(this.barcode2dOptions.extra,["eclevel"]))),this.syncTextHeight(this.measureTextAreaHeight(this.barcode2dOptions)),this.dirty=!0,!lpBcid.includes(this.barcode2dOptions.bcid)){let ig=this.group;for(;ig;)ig.dirty=!0,ig=ig.group}let gg=getAllObjectMap();this.updateBarCode2d([...gg.text,...gg.counter])}getBarcode2DOption(){return cloneDeep(this.barcode2dOptions)}toObject(eg){let gg=["barcode2dOptions","counterProps","concatTextIdListObj","increaseDate","barcodeDateFormatType","connectObjIds"];return super.toObject(eg?[...eg,...gg]:gg)}};Cu.type="Barcode2D";let ABarcode2D=Cu;ABarcode2D.fromObject=(tg,eg)=>ABarcode2D._fromObject(tg,{...eg,extraParam:"barcode2dOptions"}),tt.setClass(ABarcode2D),tt.setSVGClass(ABarcode2D);class ContextMenu{constructor(eg,gg){this.container=eg,this.menuItems=gg,this.activeSubmenus=[],this.shown=!1,this.disableTop=!1,this.disableBottom=!1,this.activeSubmenuHandler=this._activeSubmenuHandler.bind(this),this.menuItems=gg,this.menuElement=this.createMenuElement(),eg.appendChild(this.menuElement),this.setupEventListeners()}setTargetObj(eg){this.targetObj=eg}createMenuElement(){const eg=document.createElement("div");return eg.id="custom-context-menu",eg}createMenuItemElement(eg){const gg={itemText:eg.text??""};if(eg.isShow&&!eg.isShow(this.targetObj,gg))return document.createElement("div");if(eg.isSeparator){const ag=document.createElement("div");return ag.classList.add("item-separator"),ag}if(eg.isGroupTitle){const ag=document.createElement("div");return ag.textContent=gg.itemText,ag.classList.add("item-group"),ag}const ig=document.createElement("div");ig.className="menu-item",ig.dataset.id=eg.id,eg.disabled&&ig.classList.add("canvas-contextmenu-disabled"),eg.subItems&&eg.subItems.length>0&&ig.classList.add("has-submenu");const ng=document.createElement("div");ng.textContent=gg.itemText;const og=document.createElement("div");if(og.classList.add("menu-item-content"),og.appendChild(ng),!eg.subItems||eg.subItems.length===0){const ag=document.createElement("div");ag.style.marginLeft="20px",ag.style.color="#999",ag.textContent=eg.hotKey||"",og.appendChild(ag)}if(ig.appendChild(og),eg.subItems&&eg.subItems.length>0){const ag=document.createElement("span");ag.className="arrow",ag.textContent="›",ig.appendChild(ag)}if(eg.subItems&&!eg.disabled){if(eg.subItems.length>0){const ag=this.activeSubmenus.length+1,Ig=document.createElement("div");Ig.className="submenu",Ig.style.zIndex=ag+"",eg.subItems.forEach(sg=>{const Cg=this.createMenuItemElement(sg);Cg&&Ig.appendChild(Cg)}),ig.appendChild(Ig),ig.addEventListener("mouseenter",sg=>{this.activeSubmenuHandler(sg)||(Ig.style.display="block",this.positionSubmenu(ig,Ig),this.activeSubmenus.push(ig,Ig))})}}else eg.disabled||(ig.addEventListener("click",ag=>{if(eg.handler){const Ig=eg.handler(eg,ag);this.canvasContainer&&this.canvasContainer.focus({preventScroll:!0}),Ig!==!1&&this.hide()}else this.hide();ag.stopPropagation()}),ig.addEventListener("mouseenter",this.activeSubmenuHandler));return ig}_activeSubmenuHandler(eg){if(this.activeSubmenus.length>0){const gg=eg.target;for(let ig=this.activeSubmenus.length-1;ig>0;ig-=2){const ng=this.activeSubmenus[ig-1],og=this.activeSubmenus[ig];if(ng.parentElement===gg.parentElement){if(ng===gg)return!0;og.style.display="none"}else{if(og.contains(gg))return!1;og.style.display="none"}this.activeSubmenus.pop(),this.activeSubmenus.pop()}}return!1}setupEventListeners(){document.addEventListener("click",eg=>{!this.menuElement.contains(eg.target)&&this.shown&&this.hide()}),document.addEventListener("keydown",eg=>{eg.key==="Escape"&&this.shown&&this.hide()})}positionMenu(eg,gg){const ig=window.innerWidth,ng=window.innerHeight,og=this.menuElement.offsetWidth,ag=this.menuElement.offsetHeight;eg+og>ig&&(eg=ig-og-5),gg+ag>ng&&(gg=ng-ag-5),this.menuElement.style.left=`${eg}px`,this.menuElement.style.top=`${gg}px`}positionSubmenu(eg,gg){const ig=eg.getBoundingClientRect(),ng=gg.offsetWidth,og=window.innerWidth,ag=getComputedStyle(gg);let Ig=0,sg=0;ig.right+ng>og?(Ig=-ng-parseInt(ag.paddingLeft),gg.classList.add("left")):Ig=ig.width+parseInt(ag.paddingLeft);const Cg=gg.offsetHeight,lg=window.innerHeight;ig.top+Cg>lg?sg=ig.height-Cg+parseInt(ag.paddingBottom):sg=-parseInt(ag.paddingTop),gg.style.left=`${Ig}px`,gg.style.top=`${sg}px`}show(eg,gg){console.time("show"),this.shown&&this.hide(),this.menuElement.innerHTML="",this.menuItems.forEach(ig=>{const ng=this.createMenuItemElement(ig);ng&&this.menuElement.appendChild(ng)}),this.menuElement.style.display="block",this.positionMenu(eg,gg),this.shown=!0,console.timeEnd("show")}hide(){this.shown&&(this.menuElement.style.display="none",this.menuElement.innerHTML="",this.shown=!1)}addItems(eg,gg){gg?this.addItemsToSubmenu(eg,gg,this.menuItems):this.menuItems.push(...eg)}addItemsToSubmenu(eg,gg,ig){for(const ng of ig){if(ng.id===gg)return ng.subItems||(ng.subItems=[]),ng.subItems.push(...eg),!0;if(ng.subItems&&this.addItemsToSubmenu(eg,gg,ng.subItems))return!0}return!1}updateItem(eg,gg){return this.updateItemRecursive(eg,gg,this.menuItems)}updateItemRecursive(eg,gg,ig){for(const ng of ig){if(ng.id===eg)return Object.assign(ng,gg),!0;if(ng.subItems&&this.updateItemRecursive(eg,gg,ng.subItems))return!0}return!1}removeItem(eg){return this.removeItemRecursive(eg,this.menuItems)}removeItemRecursive(eg,gg){const ig=gg.findIndex(ng=>ng.id===eg);if(ig!==-1)return gg.splice(ig,1),!0;for(const ng of gg)if(ng.subItems&&this.removeItemRecursive(eg,ng.subItems))return!0;return!1}getItems(){return this.menuItems}setItems(eg){this.menuItems=eg}}class ContextMenuPlugin{constructor(){this.name="ContextMenuPlugin",this.eventHandler={contextmenu:this.contextMenuHandler.bind(this)}}addItem(eg){var ig;const gg=Array.isArray(eg)?eg:[eg];(ig=this.contextMenu)==null||ig.addItems(gg),gg.forEach(ng=>{!ng.isGroupTitle&&!ng.isSeparator&&ng.hotKey&&ng.hotKeyHandler&&this.editor.addHotKey(ng.hotKey,ng.hotKeyHandler)})}removeItem(eg){var gg;(gg=this.contextMenu)==null||gg.removeItem(eg)}updateItem(eg,gg){if(this.contextMenu&&(this.contextMenu.updateItem(eg,gg),gg.hotKey&&gg.hotKeyHandler)){const ig=this.contextMenu.getItems().find(ng=>ng.id===eg);ig&&(ig.hotKey&&this.editor.removeHotKey(ig.hotKey),ig.hotKey=gg.hotKey,ig.hotKeyHandler=gg.hotKeyHandler,this.editor.addHotKey(ig.hotKey,ig.hotKeyHandler))}}disabled(){this.contextMenu&&this.container&&(this.editor.getCanvas().off("contextmenu",this.eventHandler.contextmenu),this.contextMenu.hide(),this.contextMenu.getItems().forEach(eg=>{!eg.isGroupTitle&&!eg.isSeparator&&eg.hotKey&&eg.hotKeyHandler&&this.editor.removeHotKey(eg.hotKey)}))}contextMenuHandler(eg){var gg;if(eg.e){const ig=eg.e;if(ig.button===2&&eg.target&&this.contextMenu){if(eg.target.id==="workspace")return;let ng=((gg=this.canvas)==null?void 0:gg.getObjects())||[];ng=ng.filter(sg=>sg.id!=="workspace");let og=ng==null?void 0:ng.indexOf(eg.target);const ag=og===(ng==null?void 0:ng.length)-1,Ig=og===0;this.contextMenu.disableTop=ag,this.contextMenu.disableBottom=Ig,eg.target.type==="activeselection"?eg.target.getObjects().length>1?(this.contextMenu.updateItem("lock",{disabled:!0}),this.contextMenu.updateItem("layer",{disabled:!0})):(this.contextMenu.updateItem("lock",{disabled:!1}),this.contextMenu.updateItem("layer",{disabled:!1})):(this.contextMenu.updateItem("lock",{disabled:!1}),this.contextMenu.updateItem("layer",{disabled:!1})),this.contextMenu.updateItem("layer-top",{disabled:!1}),this.contextMenu.updateItem("layer-up",{disabled:!1}),this.contextMenu.updateItem("layer-bottom",{disabled:!1}),this.contextMenu.updateItem("layer-down",{disabled:!1}),ag&&(this.contextMenu.updateItem("layer-top",{disabled:!0}),this.contextMenu.updateItem("layer-up",{disabled:!0})),Ig&&(this.contextMenu.updateItem("layer-bottom",{disabled:!0}),this.contextMenu.updateItem("layer-down",{disabled:!0})),ig.preventDefault(),this.canvas.setActiveObject(eg.target),this.contextMenu.setTargetObj(eg.target),this.contextMenu.show(ig.clientX,ig.clientY)}}}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.container=document.getElementById("app"),this.contextMenu=new ContextMenu(this.container,[]),this.contextMenu.canvasContainer=this.canvas.elements.container,this.enabled()}enabled(){this.contextMenu&&this.container&&(this.editor.getCanvas().on("contextmenu",this.eventHandler.contextmenu),this.contextMenu.getItems().forEach(eg=>{!eg.isGroupTitle&&!eg.isSeparator&&eg.hotKey&&eg.hotKeyHandler&&this.editor.addHotKey(eg.hotKey,eg.hotKeyHandler)}))}}class Ruler{constructor(eg,gg){this.ctx=eg,this.dpi=96,this.isShown=!1,this.gapValue=0,this.getGapMM=ig=>{const ng=[.02,.05,.1,.2,.5,1,2,5,10],og=[500,200,100,50,25,10,5,2,1];let ag=0;for(;ag<ng.length&&ng[ag]<ig;)ag++;return og[ag-1]||1e3},this.options=gg}show(){this.isShown=!0}hide(){this.isShown=!1}drawLine(eg,gg,ig,ng,og,ag){this.ctx.save(),this.ctx.beginPath(),og&&(this.ctx.strokeStyle=og),this.ctx.lineWidth=ag??1,this.ctx.moveTo(eg+.5,gg+.5),this.ctx.lineTo(eg+ig+.5,gg+ng+.5),this.ctx.stroke(),this.ctx.restore()}drawText({text:eg="",left:gg=0,top:ig=0,fillStyle:ng,align:og,angle:ag,fontSize:Ig=this.options.fontSize}){this.ctx.save(),ng&&(this.ctx.fillStyle=ng),this.ctx.textAlign=og??"left",this.ctx.textBaseline="top",this.ctx.font=`${Ig??10}px sans-serif, Noto Sans, SourceHanSansCN`,ag&&(this.ctx.translate(gg,ig),this.ctx.rotate(Math.PI/180*ag),this.ctx.translate(-gg,-ig)),this.ctx.fillText(eg,gg,ig),this.ctx.restore()}darwRect({left:eg=0,top:gg=0,width:ig,height:ng,fillStyle:og,stroke:ag,strokeWidth:Ig}){this.ctx.save(),this.ctx.beginPath(),og&&(this.ctx.fillStyle=og),this.ctx.rect(eg,gg,ig,ng),this.ctx.fill(),ag&&(this.ctx.strokeStyle=ag,this.ctx.lineWidth=Ig??1,this.ctx.stroke()),this.ctx.restore()}drawMask(eg,gg,ig,ng,og,ag){this.ctx.save();const Ig=eg?this.ctx.createLinearGradient(gg,og/2,gg+ng,og/2):this.ctx.createLinearGradient(ng/2,ig,ng/2,og+ig),sg=new Le(ag);sg.setAlpha(0),Ig.addColorStop(0,sg.toRgba()),Ig.addColorStop(.33,ag),Ig.addColorStop(.67,ag),Ig.addColorStop(1,sg.toRgba()),this.darwRect({left:gg,top:ig,width:ng,height:og,fillStyle:Ig}),this.ctx.restore()}drawBackground(eg,gg,ig){const ng=this.options.rulerSize,og=this.options.canvasWidth,ag=this.options.canvasHeight;eg?this.darwRect({left:0,top:0,width:og,height:ng,fillStyle:this.options.backgroundColor}):this.darwRect({left:0,top:0,width:ng,height:ag,fillStyle:this.options.backgroundColor})}drawMM(eg,gg,ig){const ng=this.options.rulerSize,og=this.options.canvasWidth,ag=this.options.canvasHeight,Ig=this.getGapMM(ig);this.gapValue=Ig;const sg=this.dpi/25.4*ig*Ig,Cg=ng*.2,lg=ng*.8,Ag=new Le(this.options.textColor).toRgb();eg?(this.drawLine(0,0,og,0,this.options.borderColor),this.drawLine(0,ng,og,0,Ag)):(this.drawLine(0,0,0,ag,this.options.borderColor),this.drawLine(ng,0,0,ag,Ag)),this.ctx.save(),this.ctx.beginPath();let cg=Ig>2,rg=Ig>10?10:Ig>=5?5:1;if(eg){if(this.ctx.rect(ng,0,og-ng,ng),this.ctx.clip(),gg<0){let bg=-gg*ig-sg,mg=1;for(;bg>ng;){if(cg&&mg===1)for(let wg=1;wg<10;wg++){const Gg=bg+sg/rg*wg;Gg>ng&&this.drawLine(Gg,Cg+13,0,lg*.3,Ag,1)}if(this.drawLine(bg,Cg+10,0,lg*.6,Ag),cg)for(let wg=1;wg<10;wg++){const Gg=bg-sg/rg*wg;Gg>ng&&this.drawLine(Gg,Cg+13,0,lg*.3,Ag,1)}const hg=-mg*Ig+"",pg=10*hg.length/4,fg=ng-this.options.fontSize-2;this.drawText({text:hg,left:bg-pg,top:fg-7,fillStyle:Ag,align:void 0,angle:0}),bg-=sg,mg++}}let ug=-gg*ig,dg=0;for(;ug<og;){if(Math.ceil(ug)>=ng){if(this.drawLine(ug,Cg+10,0,lg*.6,Ag),cg)for(let pg=1;pg<10;pg++){const fg=ug+sg/rg*pg;fg<og&&this.drawLine(fg,Cg+13,0,lg*.3,Ag,1)}const bg=dg*Ig+"",mg=10*bg.length/4,hg=ng-this.options.fontSize-2;this.drawText({text:bg,left:ug-mg,top:hg-7,fillStyle:Ag,align:void 0,angle:0})}ug+=sg,dg++}}else{if(this.ctx.rect(0,ng,ng,ag-ng),this.ctx.clip(),gg<0){let bg=-gg*ig-sg,mg=1;for(;bg>ng;){if(cg&&mg===1)for(let wg=1;wg<10;wg++){const Gg=bg+sg/rg*wg;Gg>ng&&this.drawLine(Cg+13,Gg,lg*.3,0,Ag,1)}if(this.drawLine(Cg+10,bg,lg*.6,0,Ag),cg)for(let wg=1;wg<10;wg++){const Gg=bg-sg/rg*wg;Gg>ng&&this.drawLine(Cg+13,Gg,lg*.3,0,Ag,1)}const hg=-mg*Ig+"",pg=10*hg.length/4,fg=ng-this.options.fontSize-2;this.drawText({text:hg,left:fg-7,top:bg+pg,fillStyle:Ag,align:void 0,angle:-90}),bg-=sg,mg++}}let ug=-gg*ig,dg=0;for(;ug<ag;){if(ug>ng){if(this.drawLine(Cg+10,ug,lg*.6,0,Ag),cg)for(let pg=1;pg<10;pg++){const fg=ug+sg/rg*pg;fg<ag&&this.drawLine(Cg+13,fg,lg*.3,0,Ag,1)}const bg=dg*Ig+"",mg=10*bg.length/4,hg=ng-this.options.fontSize-2;this.drawText({text:bg,left:hg-7,top:ug+mg,fillStyle:Ag,align:void 0,angle:-90})}ug+=sg,dg++}}this.ctx.restore()}drawActiveLine(eg,gg,ig){if(!this.objectRect)return;const ng=this.options.rulerSize,og=eg?"x":"y",ag=new Le(this.options.maskColor);this.objectRect[og].forEach(Ig=>{if(ag.setAlpha(.5),Ig.skip===og)return;let sg=eg?Ig.left:Ig.top,Cg=eg?Ig.width:Ig.height,lg=(sg-gg)*ig,Ag=Cg*ig;const cg={width:eg?Ag:ng-8,height:eg?ng-8:Ag,backgroundColor:this.options.backgroundColor};this.drawMask(eg,eg?lg:0,eg?2:lg,cg.width,cg.height,cg.backgroundColor),this.darwRect({left:eg?lg:ng-8,top:eg?ng-8:lg,width:eg?Ag:8,height:eg?8:Ag,fillStyle:ag.toRgba()});const rg=ng/2-(this.options.fontSize??12)/2-4,ug=pg=>Math.round(pg*(25.4/Editor.DPI)*100)/100+"",dg=ug(sg),bg=ug(sg+Cg),mg={fill:ag.toRgba(),angle:eg?0:-90};this.drawText({text:dg,left:eg?lg-2:rg,top:eg?rg:lg-15,fillStyle:mg.fill,align:eg?"right":"center",angle:mg.angle}),dg!==bg&&this.drawText({text:bg,left:eg?lg+Ag+2:rg,top:eg?rg:lg+Ag+17,fillStyle:mg.fill,align:eg?"left":"center",angle:mg.angle});const hg=dg===bg?8:14;ag.setAlpha(1),this.drawLine(eg?lg:ng-hg,eg?ng-hg:lg,eg?0:hg,eg?hg:0,ag.toRgba()),dg!==bg&&this.drawLine(eg?lg+Ag:ng-hg,eg?ng-hg:lg+Ag,eg?0:hg,eg?hg:0,ag.toRgba())})}}class RulerPlugin{constructor(){this.name="RulerPlugin",this.eventHandler={calcObjectRect:throttle$3(this.calcObjectRect.bind(this),15),selectinClear:throttle$3(this.selectionClear.bind(this),15),renderRuler:eg=>{eg.ctx&&this.renderRuler()},canvasMouseDown:throttle$3(this.canvasMouseDown.bind(this),15),canvasMouseMove:throttle$3(this.canvasMouseMove.bind(this),15),canvasMouseUp:throttle$3(this.canvasMouseUp.bind(this),15)}}uninstall(){}install(eg,gg){this.editor=eg;const ig=Object.assign({rulerSize:25,fontSize:12,canvasWidth:this.editor.getCanvas().width,canvasHeight:this.editor.getCanvas().height,backgroundColor:"#fff",borderColor:"#ddd",maskColor:"#007fff",textColor:"#888"},gg);this.ruler=new Ruler(eg.getCanvas().elements.lower.ctx,ig),eg.getPlugin("ContextMenuPlugin")}enabled(){if(this.editor&&this.ruler&&!this.ruler.isShown){const eg=this.editor.getCanvas();eg.on("after:render",this.eventHandler.calcObjectRect),eg.on("after:render",this.eventHandler.renderRuler),eg.on("mouse:down",this.eventHandler.canvasMouseDown),eg.on("mouse:move",this.eventHandler.canvasMouseMove),eg.on("mouse:up",this.eventHandler.canvasMouseUp),eg.on("selection:cleared",this.eventHandler.selectinClear),this.ruler.dpi=Editor.DPI,this.ruler.show(),this.renderRuler()}}disabled(){if(this.editor&&this.ruler&&this.ruler.isShown){this.ruler.hide();const eg=this.editor.getCanvas();eg.off("after:render",this.eventHandler.calcObjectRect),eg.off("after:render",this.eventHandler.renderRuler),eg.off("mouse:down",this.eventHandler.canvasMouseDown),eg.off("mouse:move",this.eventHandler.canvasMouseMove),eg.off("mouse:up",this.eventHandler.canvasMouseUp),eg.off("selection:cleared",this.eventHandler.selectinClear),this.editor.getCanvas().renderAll()}}setCanvasSize(eg,gg){this.ruler&&(this.ruler.options.canvasWidth=eg,this.ruler.options.canvasHeight=gg)}calcObjectRect(){if(!this.editor)return;const gg=this.editor.getCanvas().getActiveObjects();if(gg.length===0)return;const ig=gg.reduce((ng,og)=>{const ag=og.getBoundingRect();return ng.push(ag),ng},[]);ig.length!==0&&(this.ruler.objectRect={x:mergeLines(ig,!0),y:mergeLines(ig,!1)})}renderRuler(){if(!this.editor||!this.ruler||!this.ruler.isShown)return;const eg=this.editor.getCanvas(),gg=eg.viewportTransform;gg&&(this.ruler.drawBackground(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawBackground(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.drawMM(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawMM(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.drawActiveLine(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawActiveLine(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.options.callback&&this.ruler.options.callback(this.ruler.gapValue))}canvasMouseDown(){}canvasMouseUp(){}canvasMouseMove(){}selectionClear(){this.ruler&&(this.ruler.objectRect=void 0)}}const mergeLines=(tg,eg)=>{const gg=eg?"left":"top",ig=eg?"width":"height",ng=1e-6;if(!tg||tg.length===0)return[];if(tg.length===1)return[Object.assign({},tg[0])];tg.sort((Ig,sg)=>Ig[gg]-sg[gg]);const og=[];let ag=Object.assign({},tg[0]);for(let Ig=1;Ig<tg.length;Ig++){const sg=tg[Ig],Cg=ag[gg]+ag[ig],lg=sg[gg];if(Cg>=lg-ng){const Ag=Math.max(Cg,sg[gg]+sg[ig]);ag[ig]=Ag-ag[gg]}else og.push(ag),ag=Object.assign({},sg)}return og.push(ag),og};class WorkspacePlugin{constructor(){this.name="WorkspacePlugin",this.gapVal=20,this.backgroundColor="#FFFFFFFF",this.backgroundImage="",this.backgroundImageCover=!0,this.backgroundImageElement=null,this.backgroundImageLoadId=0,this.resizeFrame=0,this.resizeTimer=null,this.lastCanvasSize={width:0,height:0},this.resizeObserver=new ResizeObserver(eg=>{!eg.find(ig=>ig.target===this.workspaceEl)||!this.canvas||(cancelAnimationFrame(this.resizeFrame),this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeFrame=requestAnimationFrame(()=>{this.applyCanvasViewportSize()})},80))}),this.initWorkspace=()=>{const eg=this.canvas,gg=this.option.type;let ig;gg==="Rectangle"||gg==="RoundedRectangle"?ig=new Er({fill:this.option.backgroundColor??"yellow",width:this.option.width,height:this.option.height,rx:this.option.rx,ry:this.option.ry,strokeWidth:0}):ig=new _o({fill:this.option.backgroundColor??"yellow",width:this.option.width,height:this.option.height,rx:this.option.rx,ry:this.option.ry,strokeWidth:0}),ig.set("id","workspace"),ig.set("workspaceBackgroundColor",this.backgroundColor),ig.set("workspaceBackgroundImage",this.backgroundImage),ig.set("workspaceBackgroundImageCover",this.backgroundImageCover),this.bindRibbonBorderRender(ig),ig.set("selectable",!1),ig.set("hasControls",!1),ig.excludeFromExport=!0,ig.moveCursor="default",ig.hoverCursor="default",eg.insertAt(0,ig),this.workspace=ig,this.refreshWorkspaceBackground(),eg.renderAll();const{width:ng,height:og}=this.getWorkspaceViewportSize();eg.setDimensions({width:ng,height:og}),this.lastCanvasSize={width:ng,height:og},this.resizeObserver.observe(this.workspaceEl),eg.on("mouse:wheel",this.onWheel);const ag=eg.getWidth()*.7,Ig=eg.getHeight()*.7,sg=ag/this.option.width,Cg=Ig/this.option.height;this.setZoomAuto(Math.min(sg,Cg))},this.onWheel=eg=>{if(!this.canvas)return;const gg=eg.e.deltaY;let ig=this.canvas.getZoom();ig*=.999**gg,ig=this.clampZoom(ig);const ng=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(ng.left,ng.top),ig),eg.e.preventDefault(),eg.e.stopPropagation()}}getWorkspaceViewportSize(){return{width:Math.floor(this.workspaceEl.clientWidth),height:Math.floor(this.workspaceEl.clientHeight)}}applyCanvasViewportSize(){if(!this.canvas)return;const{width:eg,height:gg}=this.getWorkspaceViewportSize();if(!(eg<=0||gg<=0)&&!(eg===this.lastCanvasSize.width&&gg===this.lastCanvasSize.height)){if(this.lastCanvasSize={width:eg,height:gg},this.editor){const ig=this.editor.getPlugin("RulerPlugin");ig&&ig.setCanvasSize(eg,gg)}this.canvas.setDimensions({width:eg,height:gg}),this.workspace&&this.setCenterFromObject(this.workspace)}}findParent(eg){for(;eg;){if(eg.id==="workspace")return eg;eg=eg.parentElement}return null}install(eg,gg){const ig=this.findParent(eg.getCanvas().elements.container);if(!ig)throw new Error("element #workspace is missing, plz check!");this.editor=eg,this.workspaceEl=ig,this.workspace=void 0,this.option=gg,this.backgroundColor=(gg==null?void 0:gg.backgroundColor)||"#FFFFFFFF",this.backgroundImage=(gg==null?void 0:gg.backgroundImage)||"",this.backgroundImageCover=(gg==null?void 0:gg.backgroundImageCover)!==!1,this.loadBackgroundImageElement(this.backgroundImage),this.editor.addHook("setSize",this.initWorkspace);const ng=eg.getCanvas();ng.backgroundImage=void 0,this.canvas=ng,this.initWorkspace()}uninstall(){var eg,gg;cancelAnimationFrame(this.resizeFrame),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.resizeObserver.disconnect(),(eg=this.canvas)==null||eg.off("mouse:wheel",this.onWheel),this.workspace&&((gg=this.canvas)==null||gg.remove(this.workspace)),this.workspace=void 0,this.canvas=void 0,this.editor=void 0}bindRibbonBorderRender(eg){const gg=eg._render.bind(eg);eg._render=ig=>{var Ig,sg,Cg;if(gg(ig),this.drawBackgroundImage(ig,eg),this.drawGrid(ig,eg),(Ig=this.editor)!=null&&Ig.getCanvas().get("flagToDataURL"))return;const ng=(sg=this.editor)==null?void 0:sg.ribbonBorderPattern;if(!ng||ng==="none")return;const og=eg.width||this.option.width,ag=eg.height||this.option.height;drawRibbonBorder(ig,ng,{left:-og/2,top:-ag/2,width:og,height:ag},(Cg=this.editor)==null?void 0:Cg.ribbonBorderTextures)}}createWorkspacePath(eg,gg){const ig=gg.width||this.option.width,ng=gg.height||this.option.height,og=-ig/2,ag=-ng/2;if(eg.beginPath(),gg.type==="ellipse"){eg.ellipse(0,0,ig/2,ng/2,0,0,Math.PI*2);return}const Ig=Math.min(Math.abs(gg.rx||0),ig/2),sg=Math.min(Math.abs(gg.ry||0),ng/2);if(!Ig&&!sg){eg.rect(og,ag,ig,ng);return}eg.moveTo(og+Ig,ag),eg.lineTo(og+ig-Ig,ag),eg.quadraticCurveTo(og+ig,ag,og+ig,ag+sg),eg.lineTo(og+ig,ag+ng-sg),eg.quadraticCurveTo(og+ig,ag+ng,og+ig-Ig,ag+ng),eg.lineTo(og+Ig,ag+ng),eg.quadraticCurveTo(og,ag+ng,og,ag+ng-sg),eg.lineTo(og,ag+sg),eg.quadraticCurveTo(og,ag,og+Ig,ag)}drawBackgroundImage(eg,gg){const ig=this.backgroundImageElement;if(!ig||!this.backgroundImage)return;const ng=gg.width||this.option.width,og=gg.height||this.option.height,ag=ig.naturalWidth||ig.width,Ig=ig.naturalHeight||ig.height;if(!ag||!Ig)return;const sg=this.backgroundImageCover?ng:ag,Cg=this.backgroundImageCover?og:Ig,lg=-sg/2,Ag=-Cg/2;eg.save(),this.createWorkspacePath(eg,gg),eg.clip(),eg.drawImage(ig,lg,Ag,sg,Cg),eg.restore()}drawGrid(eg,gg){var sg;if(!gg.isHasGrid||(sg=this.editor)!=null&&sg.getCanvas().get("flagToDataURL"))return;const ig=gg.width||this.option.width,ng=gg.height||this.option.height,og=-ig/2,ag=-ng/2,Ig=20;eg.save(),this.createWorkspacePath(eg,gg),eg.clip(),eg.strokeStyle="#888",eg.lineWidth=1,eg.globalAlpha=1;for(let Cg=og+Ig;Cg<og+ig;Cg+=Ig)eg.beginPath(),eg.moveTo(Cg,ag),eg.lineTo(Cg,ag+ng),eg.stroke();for(let Cg=ag+Ig;Cg<ag+ng;Cg+=Ig)eg.beginPath(),eg.moveTo(og,Cg),eg.lineTo(og+ig,Cg),eg.stroke();eg.restore()}setZoomAuto(eg){if(!this.editor||!this.canvas)return;this.workspaceEl;const gg=this.editor.getCanvas();if(!gg)return;const ig=gg.getCenterPoint();gg.setViewportTransform(T$1),gg.zoomToPoint(new ot(ig.x,ig.y),eg),this.workspace&&this.setCenterFromObject(this.workspace)}setCenterFromObject(eg){if(!this.editor||!this.canvas)return;const gg=this.editor.getCanvas(),ig=eg.getCenterPoint(),ng=gg.viewportTransform;gg.width===void 0||gg.height===void 0||!ng||(ng[4]=gg.width/2-ig.x*ng[0],ng[5]=gg.height/2-ig.y*ng[3],gg.setViewportTransform(ng),gg.renderAll())}showGrid(){this.createGridBackground()}hideGrid(){this.createGridBackground(!1)}async setBackground({color:eg,image:gg,cover:ig}){eg!==void 0&&(this.backgroundColor=eg||"#FFFFFFFF"),gg!==void 0&&(this.backgroundImage=gg||""),ig!==void 0&&(this.backgroundImageCover=ig),this.workspace&&(this.workspace.set("workspaceBackgroundColor",this.backgroundColor),this.workspace.set("workspaceBackgroundImage",this.backgroundImage),this.workspace.set("workspaceBackgroundImageCover",this.backgroundImageCover)),gg!==void 0&&await this.loadBackgroundImageElement(this.backgroundImage),this.refreshWorkspaceBackground()}refreshWorkspaceBackground(){!this.workspace||!this.canvas||(this.workspace.set("fill",this.backgroundColor||"#FFFFFFFF"),this.workspace.dirty=!0,this.canvas.requestRenderAll())}async loadBackgroundImageElement(eg){var ig;const gg=++this.backgroundImageLoadId;if(!eg){this.backgroundImageElement=null;return}try{const ng=await new Promise((og,ag)=>{const Ig=new Image;Ig.onload=()=>og(Ig),Ig.onerror=ag,Ig.src=eg});if(gg!==this.backgroundImageLoadId)return;this.backgroundImageElement=ng,this.workspace&&(this.workspace.dirty=!0),(ig=this.canvas)==null||ig.requestRenderAll()}catch(ng){if(gg!==this.backgroundImageLoadId)return;this.backgroundImageElement=null,console.log("load background image error",ng)}}createGridBackground(eg=!0){!this.canvas||!this.workspace||(this.workspace.set("isHasGrid",eg),this.workspace.dirty=!0,this.canvas.renderAll())}getFitZoom(){if(!this.canvas||!this.option)return .2;const eg=this.canvas.getWidth()*.7,gg=this.canvas.getHeight()*.7,ig=eg/this.option.width,ng=gg/this.option.height;return Math.min(ig,ng)}getMinZoom(){return Math.max(.005,Math.min(.2,this.getFitZoom()*.5))}getMaxZoom(){return 12}clampZoom(eg){return Math.min(this.getMaxZoom(),Math.max(this.getMinZoom(),eg))}big(){let eg=this.canvas.getZoom();eg+=.05;const gg=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(gg.left,gg.top),this.clampZoom(eg))}small(){let eg=this.canvas.getZoom();eg-=.05;const gg=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(gg.left,gg.top),this.clampZoom(eg))}auto(){this.setZoomAuto(this.getFitZoom())}one(){this.setZoomAuto(1)}createExportWorkspace(eg){if(!this.workspace)return null;const gg=this.workspace,ig=gg.type==="ellipse",ng={fill:this.backgroundColor,width:gg.width,height:gg.height,rx:gg.rx,ry:gg.ry,strokeWidth:0,left:gg.left,top:gg.top};let og;if(ig?og=new _o(ng):og=new Er(ng),og.set("id","workspace"),og.set("selectable",!1),this.backgroundImageElement&&this.backgroundImage){const ag=og._render.bind(og);og._render=Ig=>{ag(Ig),this.drawBackgroundImage(Ig,og)}}return eg.insertAt(0,og),og}enabled(){}disabled(){}}const aligningLineConfig={margin:4,width:1,color:"rgb(255,0,0,0.9)"};function getDistance(tg,eg){return Math.abs(tg-eg)}function setPositionDir(tg,eg,gg){const ig=tg.translateToCenterPoint(eg,"center","center"),ng=tg.translateToOriginPoint(ig,tg.originX,tg.originY);gg=="x"?tg.setX(ng.x):tg.setY(ng.y)}const originXArr=["left","center","right"],originYArr=["top","center","bottom"];function collectVerticalPoint(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,isScale:og,index:ag,point:Ig,list:sg}=tg,{dis:Cg,arr:lg}=getDistanceList(Ig,sg,"x"),Ag=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1);if(Cg>Ag)return[];let cg=lg[lg.length-1].x-Ig.x;const rg=ag==0||ag==3?-1:1;cg*=rg;const{width:ug,scaleX:dg,left:bg}=ng,mg=ng._getTransformedDimensions(),hg=(cg+mg.x)/mg.x;og?ng.set("scaleX",dg*hg):ng.set("width",ug*hg);const pg=[0,cg/2*rg,cg*rg];rg<0&&pg.reverse();const fg=pg[originXArr.indexOf(ng.originX)];return ng.set("left",bg+fg),ng.setCoords(),lg.map(wg=>({x:wg.x,y1:wg.y,y2:Ig.y}))}function collectHorizontalPoint(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,isScale:og,index:ag,point:Ig,list:sg}=tg,{dis:Cg,arr:lg}=getDistanceList(Ig,sg,"y"),Ag=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1);if(Cg>Ag)return[];let cg=lg[lg.length-1].y-Ig.y;const rg=ag<2?-1:1;cg*=rg;const{height:ug,scaleY:dg,top:bg}=ng,mg=ng._getTransformedDimensions(),hg=(cg+mg.y)/mg.y;og?ng.set("scaleY",dg*hg):ng.set("height",ug*hg);const pg=[0,cg/2*rg,cg*rg];rg<0&&pg.reverse();const fg=pg[originYArr.indexOf(ng.originY)];return ng.set("top",bg+fg),ng.setCoords(),lg.map(wg=>({y:wg.y,x1:wg.x,x2:Ig.x}))}function getDistanceList(tg,eg,gg){let ig=1/0,ng=[];for(const og of eg){const ag=getDistance(tg[gg],og[gg]);ig>ag&&(ng=[],ig=ag),ig==ag&&ng.push(og)}return{dis:ig,arr:ng}}function drawLine(tg,eg,gg){const{width:ig,color:ng}=aligningLineConfig,og=tg.getSelectionContext(),ag=tg.viewportTransform,Ig=tg.getZoom();og.save(),og.transform(...ag),og.lineWidth=ig/Ig,og.strokeStyle=ng,og.beginPath(),og.moveTo(eg.x,eg.y),og.lineTo(gg.x,gg.y),og.stroke(),drawX(og,Ig,eg),drawX(og,Ig,gg),og.restore()}const xSize=2.4;function drawX(tg,eg,gg){const ig=xSize/eg;tg.save(),tg.translate(gg.x,gg.y),tg.beginPath(),tg.moveTo(-ig,-ig),tg.lineTo(ig,ig),tg.moveTo(ig,-ig),tg.lineTo(-ig,ig),tg.stroke(),tg.restore()}function drawPoint(tg,eg){const{width:gg,color:ig}=aligningLineConfig,ng=tg.getSelectionContext(),og=tg.viewportTransform,ag=tg.getZoom();ng.save(),ng.transform(...og),ng.lineWidth=gg/ag,ng.strokeStyle=ig;for(const Ig of eg)drawX(ng,ag,Ig);ng.restore()}function drawPointList(tg,eg){const gg=eg.map(ig=>{const ng="y2"in ig,og=ng?ig.x:ig.x1,ag=ng?ig.y1:ig.y;return new ot(og,ag)});drawPoint(tg,gg)}function drawVerticalLine(tg,eg){const gg=eg.x,ig=new ot(gg,eg.y1),ng=new ot(gg,eg.y2);drawLine(tg,ig,ng)}function drawHorizontalLine(tg,eg){const gg=eg.y,ig=new ot(eg.x1,gg),ng=new ot(eg.x2,gg);drawLine(tg,ig,ng)}function getObjectsByTarget(tg){const eg=new Set,gg=tg.canvas;if(!gg)return eg;const ig=tg instanceof Jo?tg.getObjects():[tg];return gg.forEachObject(ng=>{if(ng.isOnScreen()&&ng.visible){if(ng.constructor==Hr){collectObjectsByGroup(eg,ng);return}eg.add(ng)}}),deleteObjectsByList(eg,ig),eg}function deleteObjectsByList(tg,eg){for(const gg of eg)gg.constructor==Hr?deleteObjectsByList(tg,gg.getObjects()):tg.delete(gg)}function collectObjectsByGroup(tg,eg){const gg=eg.getObjects();for(const ig of gg)if(ig.visible){if(ig.constructor==Hr){collectObjectsByGroup(tg,ig);continue}tg.add(ig)}}function collectLine(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,activeObjectRect:og,objectRect:ag}=tg,Ig=makeLineByRect(ag),sg=makeLineByRect(og),Cg=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1),lg={target:ng,list:Ig,aList:sg,margin:Cg},Ag=collectVerticalLine(lg),cg=collectHorizontalLine(lg);return{vLines:Ag,hLines:cg}}function collectVerticalLine(tg){const{target:eg,list:gg,aList:ig,margin:ng}=tg,og=ig.map(Ag=>getDistanceLine(Ag,gg,"x")),ag=Math.min(...og.map(Ag=>Ag.dis));if(ag>ng)return[];const Ig=[],sg=ig[0].x2-ig[0].x,Cg=ig[0].y2-ig[0].y;let lg=!1;for(let Ag=0;Ag<og.length;Ag++){const cg=og[Ag];if(ag==cg.dis){const rg=gg[cg.index],ug=ig[cg.index],dg=rg.x,bg=ug.y,mg=Math.min(rg.y,rg.y2,bg,ug.y2),hg=Math.max(rg.y,rg.y2,bg,ug.y2);if(Ig.push({x:dg,y1:mg,y2:hg}),lg)continue;lg=!0,setPos({target:eg,x:dg,y:bg,centerX:Ag-1,centerY:cg.index-1,width:sg,height:Cg,dir:"x"});const pg=ag*cg.dir;ig.forEach(fg=>fg.x-=pg)}}return Ig}function collectHorizontalLine(tg){const{target:eg,list:gg,aList:ig,margin:ng}=tg,og=ig.map(Ag=>getDistanceLine(Ag,gg,"y")),ag=Math.min(...og.map(Ag=>Ag.dis));if(ag>ng)return[];const Ig=[],sg=ig[0].x2-ig[0].x,Cg=ig[0].y2-ig[0].y;let lg=!1;for(let Ag=0;Ag<og.length;Ag++){const cg=og[Ag];if(ag==cg.dis){const rg=gg[cg.index],ug=ig[cg.index],dg=rg.y,bg=ug.x,mg=Math.min(rg.x,rg.x2,bg,ug.x2),hg=Math.max(rg.x,rg.x2,bg,ug.x2);if(Ig.push({y:dg,x1:mg,x2:hg}),lg)continue;lg=!0,setPos({target:eg,x:bg,y:dg,centerX:cg.index-1,centerY:Ag-1,width:sg,height:Cg,dir:"y"});const pg=ag*cg.dir;ig.forEach(fg=>fg.y-=pg)}}return Ig}function getDistanceLine(tg,eg,gg){let ig=1/0,ng=-1,og=1;for(let ag=0;ag<eg.length;ag++){const Ig=getDistance(tg[gg],eg[ag][gg]);ig>Ig&&(ng=ag,ig=Ig,og=tg[gg]>eg[ag][gg]?1:-1)}return{dis:ig,index:ng,dir:og}}function makeLineByRect(tg){const{left:eg,top:gg,width:ig,height:ng}=tg,og={x:eg,y:gg,x2:eg+ig,y2:gg+ng},ag=eg+ig/2,Ig=gg+ng/2,sg={x:ag,y:Ig,x2:ag,y2:Ig},Cg={x:eg+ig,x2:eg,y:gg+ng,y2:gg};return[og,sg,Cg]}function setPos(tg){const{target:eg,centerX:gg,centerY:ig,width:ng,height:og,dir:ag}=tg;let{x:Ig,y:sg}=tg;Ig-=gg*ng/2,sg-=ig*og/2,setPositionDir(eg,new ot(Ig,sg),ag),eg.setCoords()}function initAligningGuidelines(tg){let eg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Object.assign(aligningLineConfig,eg);const gg=new Set,ig=new Set;let ng=!1;const og=new Map,ag=cg=>{const rg=[cg.calcTransformMatrix().toString(),cg.width,cg.height].join(),ug=og.get(rg);if(ug)return ug;const dg=cg.getCoords(),mg=[kn.makeBoundingBoxFromPoints(dg),dg];return og.set(rg,mg),mg};function Ig(cg){const rg=cg.target;rg.setCoords(),ng=!1,ig.clear(),gg.clear();const ug=getObjectsByTarget(rg),dg=rg.getBoundingRect();for(const bg of ug){const mg=ag(bg)[0],{vLines:hg,hLines:pg}=collectLine({activeObject:rg,activeObjectRect:dg,objectRect:mg});hg.forEach(fg=>{ig.add(JSON.stringify(fg))}),pg.forEach(fg=>{gg.add(JSON.stringify(fg))})}}function sg(cg){const rg=cg.target;rg.setCoords();const ug=String(cg.transform.action).startsWith("scale");ig.clear(),gg.clear();const dg=getObjectsByTarget(rg);let bg=cg.transform.corner;rg.flipX&&(bg=bg.replace("l","r").replace("r","l")),rg.flipY&&(bg=bg.replace("t","b").replace("b","t"));let mg=["tl","tr","br","bl","mt","mr","mb","ml"].indexOf(bg);if(mg==-1)return;if(ng=mg>3,ng){if(rg.getTotalAngle()%90!=0)return;mg-=4}let hg=rg.getCoords()[mg];for(const pg of dg){const[fg,wg]=ag(pg),Gg=new ot(fg.left+fg.width/2,fg.top+fg.height/2),Zg=[...wg,Gg],yg={activeObject:rg,point:hg,list:Zg,isScale:ug,index:mg},Bg=collectVerticalPoint(yg),Wg=collectHorizontalPoint(yg);Bg.forEach($g=>{ig.add(JSON.stringify($g))}),Wg.forEach($g=>{gg.add(JSON.stringify($g))}),(Bg.length||Wg.length)&&(hg=rg.getCoords()[mg])}}function Cg(){tg.clearContext(tg.contextTop)}function lg(){if(ng){const cg=[];for(const rg of ig)cg.push(JSON.parse(rg));for(const rg of gg)cg.push(JSON.parse(rg));drawPointList(tg,cg)}else{for(const cg of ig)drawVerticalLine(tg,JSON.parse(cg));for(const cg of gg)drawHorizontalLine(tg,JSON.parse(cg))}}function Ag(){ig.clear(),gg.clear(),og.clear(),tg.requestRenderAll()}return tg.on("object:resizing",sg),tg.on("object:scaling",sg),tg.on("object:moving",Ig),tg.on("before:render",Cg),tg.on("after:render",lg),tg.on("mouse:up",Ag),()=>{tg.off("object:resizing",sg),tg.off("object:scaling",sg),tg.off("object:moving",Ig),tg.off("before:render",Cg),tg.off("after:render",lg),tg.off("mouse:up",Ag)}}class GuidelinesPlugin{constructor(){this.name="GuidelinesPlugin"}install(eg,gg={}){this.editor=eg,this.options=gg,this.enabled()}enabled(){this.editor&&(this.deactivate=initAligningGuidelines(this.editor.getCanvas(),this.options))}disabled(){this.deactivate&&this.deactivate()}}const getEffectiveCanvasTool=(tg,eg)=>eg.size>0?"pan":tg,isEditableShortcutTarget=tg=>{var ig;if(!tg||typeof tg.tagName!="string")return!1;const eg=tg,gg=eg.tagName.toUpperCase();return gg==="INPUT"||gg==="TEXTAREA"||gg==="SELECT"||!!((ig=eg.closest)!=null&&ig.call(eg,'[contenteditable="true"]'))};class DringPlugin{constructor(){this.name="DringPlugin",this.persistentTool="select",this.temporaryPanSources=new Set,this.isDragging=!1,this.isEnabled=!1,this.lastPosX=0,this.lastPosY=0,this.previousCanvasSelection=!0,this.previousSkipTargetFind=!1,this.previousDefaultCursor="default",this.dispose=[],this.mouseDown=eg=>{const gg=eg.e,ig=this.getPointerPanSource(gg);ig&&this.temporaryPanSources.add(ig),!(!(gg.button===0&&this.getEffectiveTool()==="pan")&&!ig)&&(gg.preventDefault(),this.isDragging=!0,this.lastPosX=gg.clientX,this.lastPosY=gg.clientY,this.applyEffectiveTool())},this.mouseMove=eg=>{if(!this.isDragging||!this.canvas.viewportTransform)return;const gg=eg.e,ig=this.canvas.viewportTransform;ig[4]+=gg.clientX-this.lastPosX,ig[5]+=gg.clientY-this.lastPosY,this.lastPosX=gg.clientX,this.lastPosY=gg.clientY,this.canvas.setCursor("grabbing"),this.canvas.requestRenderAll()},this.mouseUp=()=>{this.finishDragging()},this.windowMouseUp=()=>{this.finishDragging()},this.keyDown=eg=>{if(isEditableShortcutTarget(eg.target)||this.isFabricTextEditing())return;if(eg.code==="Space"){eg.preventDefault(),this.temporaryPanSources.add("space"),this.applyEffectiveTool();return}if(eg.repeat)return;const gg=eg.key.toLowerCase();gg==="v"?this.setTool("select"):gg==="h"&&this.setTool("pan")},this.keyUp=eg=>{eg.code==="Space"&&(this.temporaryPanSources.delete("space"),this.applyEffectiveTool())},this.windowBlur=()=>{this.temporaryPanSources.clear(),this.isDragging=!1,this.applyEffectiveTool()}}install(eg){this.editor=eg,this.canvas=eg.getCanvas(),this.previousCanvasSelection=this.canvas.selection,this.previousSkipTargetFind=this.canvas.skipTargetFind,this.previousDefaultCursor=this.canvas.defaultCursor,this.enabled()}uninstall(){this.disabled()}enabled(){this.isEnabled||(this.isEnabled=!0,this.dispose.push(this.canvas.on("mouse:down",this.mouseDown)),this.dispose.push(this.canvas.on("mouse:move",this.mouseMove)),this.dispose.push(this.canvas.on("mouse:up",this.mouseUp)),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("mouseup",this.windowMouseUp),window.addEventListener("blur",this.windowBlur),this.applyEffectiveTool())}disabled(){this.isEnabled&&(this.isEnabled=!1,this.dispose.forEach(eg=>eg()),this.dispose.length=0,document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("mouseup",this.windowMouseUp),window.removeEventListener("blur",this.windowBlur),this.temporaryPanSources.clear(),this.isDragging=!1,this.canvas.selection=this.previousCanvasSelection,this.canvas.skipTargetFind=this.previousSkipTargetFind,this.canvas.defaultCursor=this.previousDefaultCursor,this.canvas.setCursor(this.previousDefaultCursor),this.canvas.requestRenderAll())}getTool(){return this.persistentTool}setTool(eg){this.persistentTool!==eg&&(this.persistentTool=eg,eg==="pan"&&this.canvas.discardActiveObject(),this.applyEffectiveTool(),canvasEventBus.emit("canvasToolChanged",{editor:this.editor,tool:eg}))}getEffectiveTool(){return getEffectiveCanvasTool(this.persistentTool,this.temporaryPanSources)}applyEffectiveTool(){const eg=this.getEffectiveTool()==="pan",gg=this.isDragging?"grabbing":eg?"grab":this.previousDefaultCursor;this.canvas.selection=eg?!1:this.previousCanvasSelection,this.canvas.skipTargetFind=eg?!0:this.previousSkipTargetFind,this.canvas.defaultCursor=gg,this.canvas.setCursor(gg),this.canvas.requestRenderAll()}finishDragging(){!this.isDragging&&!this.hasPointerPanSource()||(this.isDragging=!1,this.temporaryPanSources.delete("middle"),this.temporaryPanSources.delete("alt"),this.applyEffectiveTool())}getPointerPanSource(eg){if(eg.button===1)return"middle";if(eg.altKey)return"alt"}hasPointerPanSource(){return this.temporaryPanSources.has("middle")||this.temporaryPanSources.has("alt")}isFabricTextEditing(){const eg=this.canvas.getActiveObject();return!!(eg&&"isEditing"in eg&&eg.isEditing)}}class LockPlugin{constructor(){this.name="LockPlugin"}install(eg,gg){this.editor=eg,this.enabled()}switchLock(){const eg=this.editor;if(eg){const gg=eg.getCanvas(),ig=gg.getActiveObject();ig&&(ig.locked=!ig.locked,gg.fire("custom:object:history",{target:ig,action:"history:update"}))}}enabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.addItem([{id:"lock",text:"锁定/解锁对象",hotKey:"Ctrl+L",hotKeyHandler:ig=>{this.switchLock()},handler:(ig,ng)=>(this.switchLock(),!0),isShow:(ig,ng)=>(ng&&(ng.itemText=(ig!=null&&ig.locked?"解锁":"锁定")+"对象"),!!ig)}])}}disabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.removeItem("lock")}}}class LayerPlugin{constructor(){this.name="LayerPlugin"}workspaceSendToBack(){const eg=this.canvas,gg=eg.getObjects().find(ig=>ig.id==="workspace");gg&&eg.sendObjectToBack(gg)}layerChangeRefresh(){this.canvas.fire("custom:object:refreshList")}up(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=eg.getActiveObjects()[0];ig&&eg.bringObjectForward(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}down(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=eg.getActiveObjects()[0];ig&&eg.sendObjectBackwards(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}toFront(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=gg[0];ig&&eg.bringObjectToFront(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}toBack(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=gg[0];ig&&eg.sendObjectToBack(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}install(eg,gg){this.editor=eg;const ig=eg.getCanvas();this.canvas=ig;const ng=eg.getPlugin("ContextMenuPlugin");ng&&ng.addItem({id:"layer",text:"图层管理",subItems:[{id:"layer-up",text:"上一个",handler:(og,ag)=>(this.up(),!0)},{id:"layer-down",text:"下一个",handler:(og,ag)=>(this.down(),!0)},{id:"layer-top",text:"置顶",handler:(og,ag)=>(this.toFront(),!0)},{id:"layer-bottom",text:"置底",handler:(og,ag)=>(this.toBack(),!0)}]})}enabled(){}disabled(){}}class ControlsPlugin{constructor(){this.name="ControlsPlugin",this.controls={}}drawImg(eg,gg,ig,ng,og,ag,Ig){Ig!==void 0&&(eg.save(),eg.translate(gg,ig),eg.rotate(kn.degreesToRadians(Ig)),eg.drawImage(ng,-og/2,-ag/2,og,ag),eg.restore())}intervalControl(){const eg=document.createElement("img");eg.src=this.option.verticalImg;const gg=document.createElement("img");gg.src=this.option.horizontalImg;const ig=(og,ag,Ig,sg,Cg)=>{this.drawImg(og,ag,Ig,eg,20,25,Cg.angle)},ng=(og,ag,Ig,sg,Cg)=>{this.drawImg(og,ag,Ig,gg,25,20,Cg.angle)};return{ml:new ni({x:-.5,y:0,offsetX:-1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingXOrSkewingY,getActionName:ja.scaleOrSkewActionName,render:ig}),mr:new ni({x:.5,y:0,offsetX:1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingXOrSkewingY,getActionName:ja.scaleOrSkewActionName,render:ig}),mb:new ni({x:0,y:.5,offsetY:1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingYOrSkewingX,getActionName:ja.scaleOrSkewActionName,render:ng}),mt:new ni({x:0,y:-.5,offsetY:-1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingYOrSkewingX,getActionName:ja.scaleOrSkewActionName,render:ng})}}peakControl(){const eg=document.createElement("img");eg.src=this.option.edgeImg;const gg=(ig,ng,og,ag,Ig)=>{this.drawImg(ig,ng,og,eg,25,25,Ig.angle)};return{tl:new ni({x:-.5,y:-.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),bl:new ni({x:-.5,y:.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),tr:new ni({x:.5,y:-.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),br:new ni({x:.5,y:.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg})}}rotationControl(){const eg=document.createElement("img");eg.src=this.option.rotateImg;const gg=(ig,ng,og,ag,Ig)=>{this.drawImg(ig,ng,og,eg,40,40,Ig.angle)};return{mtr:new ni({x:0,y:.5,cursorStyleHandler:ja.rotationStyleHandler,actionHandler:ja.rotationWithSnapping,offsetY:30,actionName:"rotate",render:gg})}}install(eg,gg){if(!gg||!gg.verticalImg||!gg.horizontalImg||!gg.edgeImg)throw new Error("ControlsPluginOption参数必需");this.option=gg,this.canvas=eg.getCanvas(),this.controls={...this.peakControl(),...this.intervalControl(),...this.rotationControl()},Ei.createControls=()=>({controls:{...this.controls}}),Ei.ownDefaults.controls={...this.controls},Ei.ownDefaults.snapAngle=15,Ei.ownDefaults.snapThreshold=5,this.refreshObjectControls()}refreshObjectControls(){if(!this.canvas)return;const eg=gg=>{gg.id!=="workspace"&&gg.locked!==!0&&gg.set({selectable:!0,evented:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1}),gg.id!=="workspace"&&gg.hasControls!==!1&&(gg.controls={...this.controls},gg.setCoords());const ig=gg._objects;Array.isArray(ig)&&ig.forEach(eg)};this.canvas.getObjects().forEach(eg),this.canvas.requestRenderAll()}enabled(){}disabled(){}}class AlignPlugin{constructor(){this.name="AlignPlugin",this.left=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0}=ig;gg.discardActiveObject(),ng.forEach(Ig=>{const sg=Ig.getBoundingRect();console.log("getBoundingRect",sg),console.log("item",Ig.left,Ig.width),Ig.set({left:og-sg.left+Number(Ig.left)}),Ig.setCoords()}),console.log("align-left",ng),gg.fire("custom:object:history",{action:"align-left"});const ag=new Jo(ng,{canvas:gg});gg.setActiveObject(ag),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"left")},this.right=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0,width:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({left:og+ag-(Cg.left+Cg.width)+Number(sg.left)})}),gg.fire("custom:object:history",{action:"align-right"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"right")},this.xcenter=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0,width:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({left:og+ag/2-(Cg.left+Cg.width/2)+Number(sg.left)})}),gg.fire("custom:object:history",{action:"align-xcenter"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}},this.ycenter=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0,height:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({top:og+ag/2-(Cg.top+Cg.height/2)+Number(sg.top)})}),gg.fire("custom:object:history",{action:"align-ycenter"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}},this.top=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0}=ig;gg.discardActiveObject(),ng.forEach(Ig=>{const sg=Ig.getBoundingRect();Ig.set({top:og-sg.top+Number(Ig.top)})}),gg.fire("custom:object:history",{action:"align-top"});const ag=new Jo(ng,{canvas:gg});gg.setActiveObject(ag),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"top")},this.bottom=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0,height:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({top:og+ag-(Cg.top+Cg.height)+Number(sg.top)})}),gg.fire("custom:object:history",{action:"align-bottom"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"bottom")},this.xequation=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject();function ng(lg){let Ag=1/0,cg=-1/0;for(const rg in lg.aCoords){const ug=rg;lg.aCoords[ug].x<Ag&&(Ag=lg.aCoords[ug].x),lg.aCoords[ug].x>cg&&(cg=lg.aCoords[ug].x)}return cg-Ag}function og(){let lg=0;return ig&&ig.forEachObject(Ag=>{lg+=ng(Ag)}),lg}function ag(){const lg=og();if(ig)return(Number(ig.width)-lg)/(ig._objects.length-1)}function Ig(lg){if(lg===0)return 0;let Ag=0;if(ig)for(let cg=0;cg<lg;cg++)Ag+=ng(ig._objects[cg]);return Ag}if(ig&&ig.type==="activeselection"){const lg=ig;if(lg.getObjects().length<2)return;lg._objects.sort((rg,ug)=>rg.left-ug.left);const Ag=ag(),cg=Number(ig.width)/2;ig.forEachObject((rg,ug)=>{const dg=Ig(ug),bg=Ag*ug+dg-cg;rg.set("left",bg)})}const sg=gg.getActiveObjects();if(sg.length<2)return;gg.discardActiveObject(),sg.forEach(lg=>{let Ag=1/0;for(const cg in lg.aCoords){const rg=cg;lg.aCoords[rg].x<Ag&&(Ag=lg.aCoords[rg].x)}lg.set("left",2*lg.left-Ag)}),gg.fire("custom:object:history",{action:"align-xequation"});const Cg=new Jo(sg,{canvas:gg});gg.setActiveObject(Cg),gg.requestRenderAll()},this.yequation=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject()||{top:0,height:0};function ng(lg){let Ag=1/0,cg=-1/0;for(const rg in lg.aCoords){const ug=rg;lg.aCoords[ug].y<Ag&&(Ag=lg.aCoords[ug].y),lg.aCoords[ug].y>cg&&(cg=lg.aCoords[ug].y)}return cg-Ag}function og(){let lg=0;return ig.forEachObject(Ag=>{lg+=ng(Ag)}),lg}function ag(){const lg=og();return(ig.height-lg)/(ig._objects.length-1)}function Ig(lg){if(lg===0)return 0;let Ag=0;for(let cg=0;cg<lg;cg++)Ag+=ng(ig._objects[cg]);return Ag}if(console.log("activeObject",ig.type),ig&&ig.type==="activeselection"){const lg=ig;if(lg.getObjects().length<2)return;lg._objects.sort((rg,ug)=>rg.top-ug.top);const Ag=ag(),cg=Number(ig.height)/2;ig.forEachObject((rg,ug)=>{const dg=Ig(ug),bg=Ag*ug+dg-cg;rg.set("top",bg)})}const sg=gg.getActiveObjects();if(sg.length<2)return;gg.discardActiveObject(),sg.forEach(lg=>{let Ag=1/0;for(const cg in lg.aCoords){const rg=cg;lg.aCoords[rg].y<Ag&&(Ag=lg.aCoords[rg].y)}lg.set("top",2*lg.top-Ag)}),gg.fire("custom:object:history",{action:"align-yequation"});const Cg=new Jo(sg,{canvas:gg});gg.setActiveObject(Cg),gg.requestRenderAll()}}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.enabled()}enabled(){this.editor&&(this.editor.addHook("left",this.left),this.editor.addHook("right",this.right),this.editor.addHook("top",this.top),this.editor.addHook("bottom",this.bottom),this.editor.addHook("xcenter",this.xcenter),this.editor.addHook("ycenter",this.ycenter),this.editor.addHook("x-equidistant",this.xequation),this.editor.addHook("y-equidistant",this.yequation))}disabled(){}alignSingleToWorkspace(eg,gg){var Cg;if(!this.canvas)return;const ig=this.canvas.getObjects().find(lg=>lg.id==="workspace");if(!ig)return;const ng=eg.getBoundingRect(),og=ig.getBoundingRect(),ag={};let sg=((Cg=this.editor)==null?void 0:Cg.ribbonBorderPattern)&&this.editor.ribbonBorderPattern!=="none"?30:0;gg==="left"?ag.left=Number(eg.left||0)+og.left+sg-ng.left:gg==="right"?ag.left=Number(eg.left||0)+og.left+og.width-sg-ng.left-ng.width:gg==="top"?ag.top=Number(eg.top||0)+og.top-ng.top:gg==="bottom"&&(ag.top=Number(eg.top||0)+og.top+og.height-ng.top-ng.height),eg.set(ag),eg.setCoords(),this.canvas.fire("custom:object:history",{action:`align-${gg}`}),this.canvas.fire("custom:object:checkdirty",{isToDirty:!0}),this.canvas.requestRenderAll()}}class GroupPlugin{constructor(){this.name="GroupPlugin"}group(){if(!this.editor)return;const eg=this.editor.getCanvas();if(!eg.getActiveObject())return;const gg=this.editor.getPlugin("HistoryPlugin");gg&&(gg.pause=!0);const ig=eg.getActiveObject();console.log("group",ig.type),getObjectList(ig,og=>{(og.type==="text"||og.type==="counter")&&(og.inGroupRemove=!0)});let ng;if(ig.type!=="activeSelection"&&ig.type!=="activeselection"){const og=eg.remove(ig);console.log("rmobj",og),ng=new Hr(og)}else{const og=ig.removeAll();eg.remove(...og),ng=new Hr(og)}console.log("group====1111",ng),ng.id=v4(),addObjName(eg,ng),ng.subTargetCheck=!0,gg&&(gg.pause=!1),eg.add(ng),eg.setActiveObject(ng),eg.requestRenderAll(),this.editor.emit("group",{target:ng}),console.log("group",eg.getObjects())}ungroup(){if(!this.editor)return;const eg=this.editor.getCanvas(),gg=eg.getActiveObject();if(!gg||gg.type!=="group")return;const ig=this.editor.getPlugin("HistoryPlugin");ig&&(ig.pause=!0),eg.remove(gg);const ng=gg.removeAll();eg.add(...ng);var og=new Jo(ng,{canvas:eg});ig&&(ig.pause=!1),eg.setActiveObject(og),eg.requestRenderAll(),this.editor.emit("ungroup",{target:og})}install(eg,gg){this.editor=eg,this.enabled()}enabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.addItem([{id:"group1",text:"成组",isShow:(ig,ng)=>!ig||ig.type!=="group",handler:(ig,ng)=>(this.group(),!0)},{id:"group2",text:"拆分",isShow:(ig,ng)=>!!(ig&&ig.type==="group"),handler:(ig,ng)=>(this.ungroup(),!0)}])}}disabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&(eg.removeItem("group1"),eg.removeItem("group2"))}}}class HistoryList{constructor(eg){this.canvas=eg,this.history=[],this.historyRedo=[],this.customProp={id:"id",locked:!1,name:"name"},this.isProcess=!1,this.flagClearing=!1,this.undoTimer=void 0,this.extraKeys=Object.keys(this.customProp),this.updateList()}async updateList(){if(this.flagClearing||this.isProcess)return;let eg=null;const gg=this.canvas.getObjects();let ig=[...cloneCommonField,"hasSetHistory"];const ng=gg.filter(ag=>ag.id!=="workspace"&&!ag.parent&&ag.drawObjectType!=="ignoreObject").map(async ag=>{if(ag.group&&ag.group.type==="activeselection"){eg||(eg=cloneDeep(ag.group));const Ig=eg._objects.find(Cg=>Cg.id===ag.id);eg.remove(Ig);let sg=await Ig.clone(ig);return sg.set("flagActive",!0),sg.canvas=void 0,sg.evented=!0,sg}else{const Ig=await ag.clone(ig);return Ig.canvas=void 0,Ig.evented=!0,Ig}}),og=await Promise.all(ng);this.history.push(og),console.log("history======",this.history),this.historyRedo=[]}clearCanvas(){this.flagClearing=!0;const eg=this.canvas.getObjects().filter(gg=>gg.id!=="workspace");this.canvas.remove(...eg),this.flagClearing=!1}async canvasRestore(eg){this.canvas.discardActiveObject();let gg;clearObjectMap();for(const ig of eg){const ng=await ig.clone([...cloneCommonField,"flagActive"]);this.canvas.add(ng),ng.get("flagActive")&&(gg||(gg=[]),gg.push(ng)),updateObjectMap(ng)}gg&&this.canvas.setActiveObject(new Jo(gg)),this.canvas.requestRenderAll()}undo(){if(this.isProcess||this.history.length<=1)return;clearTimeout(this.undoTimer);let eg=this.history.pop();this.historyRedo.push(eg);const gg=this.history[this.history.length-1];console.log("history========",this.history,gg),this.isProcess=!0,this.clearCanvas(),this.canvasRestore(gg).then(()=>{this.isProcess=!1})}redo(){if(this.isProcess||this.historyRedo.length===0)return;const eg=this.historyRedo.pop();this.history.push(eg),this.isProcess=!0,this.clearCanvas(),this.canvasRestore(eg).then(()=>{this.isProcess=!1})}}class HistoryPlugin{constructor(){this.name="HistoryPlugin",this.historyScopeId="default",this.historyScopeMap=new Map,this.pause=!1,this.isMouseDown=!1,this.isObjectModify=!1,this.objectAddedTimer=null,this.hotKeyHandle=eg=>{this.pause||(eg.hke.key==="ctrl+z"||eg.hke.key==="⌘+z"?this.toUndo():(eg.hke.key==="ctrl+shift+z"||eg.hke.key==="⌘+shift+z")&&this.toRedo())},this.objectAdded=({target:eg})=>{var gg;clearTimeout(this.objectAddedTimer),!(this.pause||this.isMouseDown||(gg=this.historyList)!=null&&gg.isProcess)&&(eg.drawObjectType&&eg.drawObjectType==="ignoreObject"||(this.objectAddedTimer=setTimeout(()=>{var ig;this.pause||(ig=this.historyList)!=null&&ig.isProcess||this.historyList&&this.historyList.updateList()},10)))},this.objectRemoved=({target:eg})=>{var gg;this.pause||(gg=this.historyList)!=null&&gg.isProcess||eg.drawObjectType&&eg.drawObjectType==="ignoreObject"||(this.historyList&&this.historyList.updateList(),this.canvas&&this.canvas.discardActiveObject())},this.objectModified=({})=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.objectSkewing=()=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.historyUpdate=eg=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.mouseDown=()=>{this.isMouseDown=!0},this.mouseUp=eg=>{var gg;this.isObjectModify?(this.isObjectModify=!1,this.isMouseDown=!1,(gg=this.canvas)==null||gg.fire("custom:object:history",{action:"mouse:up:clear"})):this.isMouseDown=!1}}toUndo(){var eg;(eg=this.historyList)==null||eg.undo()}toRedo(){var eg;(eg=this.historyList)==null||eg.redo()}switchScope(eg="default"){if(!this.canvas)return;clearTimeout(this.objectAddedTimer),this.historyScopeId=eg||"default";let gg=this.historyScopeMap.get(this.historyScopeId);gg||(gg=new HistoryList(this.canvas),this.historyScopeMap.set(this.historyScopeId,gg)),this.historyList=gg,this.isMouseDown=!1,this.isObjectModify=!1}clearScope(eg){if(!eg){if(this.historyScopeMap.clear(),this.canvas){const gg=new HistoryList(this.canvas);this.historyScopeMap.set(this.historyScopeId,gg),this.historyList=gg}return}this.historyScopeMap.delete(eg),this.historyScopeId===eg&&this.switchScope("default")}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.historyScopeId=(gg==null?void 0:gg.scopeId)||"default",this.historyList=new HistoryList(this.canvas),this.historyScopeMap.set(this.historyScopeId,this.historyList),this.enabled()}enabled(){this.editor&&(this.editor.addHotKey("ctrl+z",this.hotKeyHandle),this.editor.addHotKey("⌘+z",this.hotKeyHandle),this.editor.addHotKey("ctrl+shift+z",this.hotKeyHandle),this.editor.addHotKey("⌘+shift+z",this.hotKeyHandle)),this.canvas&&(this.canvas.on("mouse:down",this.mouseDown),this.canvas.on("mouse:up",this.mouseUp),this.canvas.on("object:added",this.objectAdded),this.canvas.on("object:removed",this.objectRemoved),this.canvas.on("object:modified",this.objectModified),this.canvas.on("object:skewing",this.objectSkewing),this.canvas.on("custom:object:history",this.historyUpdate))}disabled(){this.editor&&(this.editor.removeHotKey("ctrl+z"),this.editor.removeHotKey("⌘+z"),this.editor.removeHotKey("ctrl+shift+z"),this.editor.removeHotKey("⌘+shift+z")),this.canvas&&(this.canvas.off("mouse:down",this.mouseDown),this.canvas.off("mouse:up",this.mouseUp),this.canvas.off("object:added",this.objectAdded),this.canvas.off("object:removed",this.objectRemoved),this.canvas.off("object:modified",this.objectModified),this.canvas.off("object:skewing",this.objectSkewing),this.canvas.off("custom:object:history",this.historyUpdate))}uninstall(){this.disabled(),clearTimeout(this.objectAddedTimer),this.objectAddedTimer=null,this.historyScopeMap.clear(),this.historyList=void 0,this.editor=void 0,this.canvas=void 0,this.pause=!1,this.isMouseDown=!1,this.isObjectModify=!1}}class MoveHotKeyPlugin{constructor(){this.name="MoveHotKeyPlugin",this.keys={},this.holder=new Map}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.holder.set("keydown",this.keyDown.bind(this)),this.holder.set("keyup",this.keyUp.bind(this)),this.enabled()}move(){const eg=this.canvas.getActiveObject();if(eg!=null&&eg.locked)return;let gg=!0;if(eg&&eg.top!==void 0&&(this.keys.ArrowUp&&(eg.set("top",eg.top-1),gg=!1),this.keys.ArrowDown&&(eg.set("top",eg.top+1),gg=!1),this.keys.ArrowLeft&&(eg.set("left",eg.left-1),gg=!1),this.keys.ArrowRight&&(eg.set("left",eg.left+1),gg=!1),!gg&&(eg.setCoords(),this.canvas))){this.canvas.renderAll(),this.canvas.fire("custom:object:changed",{target:eg});return}this.intervalHolder,clearInterval(this.intervalHolder),this.intervalHolder=void 0,console.log("clearInterval")}keyDown(eg){if(this.keys[eg.code]=!0,["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(eg.code))eg.preventDefault();else return;this.move(),this.intervalHolder===void 0&&(this.intervalHolder=setInterval(this.move.bind(this),96))}keyUp(eg){this.keys[eg.code]=!1}enabled(){var eg;if((eg=this.canvas)!=null&&eg.elements.container){const gg=this.canvas.elements.container;gg.tabIndex=-1,this.holder.forEach((ig,ng)=>{gg.addEventListener(ng,ig)})}}disabled(){var eg;if((eg=this.canvas)!=null&&eg.elements.container){const gg=this.canvas.elements.container;this.holder.forEach((ig,ng)=>{gg.removeEventListener(ng,ig)})}}}class DeletePlugin{constructor(){this.name="DeletePlugin"}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.enabled()}flat(eg,gg){if(gg.push(eg),eg instanceof Hr){const ig=eg.getObjects();if(ig.length>0)for(const ng of ig)ng.locked||(gg.push(ng),ng instanceof Hr&&this.flat(ng,gg))}}enabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&eg.addItem({id:"delete",text:"删除",hotKey:"delete,backspace",hotKeyHandler:gg=>this.toDelete(),handler:(gg,ig)=>this.toDelete()})}}toDelete(){var og;const gg=this.editor.getPlugin("HistoryPlugin");gg&&(gg.pause=!0);let ig=this.canvas.getActiveObjects();const ng=[];for(const ag of ig)this.flat(ag,ng);return ng.length>0&&(this.canvas.remove(...ng),this.canvas.requestRenderAll(),ig=ig.filter(ag=>{ng.includes(ag)}),ig.length>0?this.canvas.setActiveObject(new Jo(ig)):this.canvas.discardActiveObject()),gg&&(gg.pause=!1),(og=this.canvas)==null||og.fire("custom:object:history",{target:null,action:"delete"}),!0}disabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&eg.removeItem("delete")}}}let isDrawing=!1;class AddObjectPlugin{constructor(){this.name="AddObjectPlugin",this.startPoint={},this.isMoverUp=!1,this.mouseDown=eg=>{if(!this.canvas)return;this.isMoverUp=!1;const gg=this.canvas,ig=eg.scenePoint;this.startPoint=ig,this.canvas.off("mouse:move",this.mouseMove),this.canvas.off("mouse:up",this.mouseUp),gg.on("mouse:move",this.mouseMove),gg.on("mouse:up",this.mouseUp)},this.mouseMove=eg=>{if(!this.canvas||this.isMoverUp)return;const gg=this.canvas,ig=eg.scenePoint;this.object||(this.object=new ALine([this.startPoint.x,this.startPoint.y,ig.x,ig.y],{...this.objectProps,id:v4(),evented:!1,strokeUniform:!0,hasControls:!1}),addObjName(this.canvas,this.object),this.object.strokeWidth=3,gg.add(this.object)),this.object.set({x2:ig.x,y2:ig.y}),this.object.setCoords(),gg.renderAll()},this.mouseUp=eg=>{var gg;!this.canvas||!this.object||(this.isMoverUp=!0,console.log("end",this.object),this.canvas.fire("object:modified",{target:this.object}),(gg=this.canvas)==null||gg.setActiveObject(this.object),this.object=void 0,this.canvas.off("mouse:move",this.mouseMove),this.canvas.off("mouse:up",this.mouseUp),this.end())},this.start=eg=>{if(!this.canvas||isDrawing)return;isDrawing=!0,this.objectProps=eg;const gg=this.canvas;gg.defaultCursor="crosshair",gg.selection=!1,gg.forEachObject(ig=>{ig.set({evented:!1})}),this.canvas.on("mouse:down",this.mouseDown)},this.end=()=>{if(!this.canvas)return;const eg=this.canvas;eg.defaultCursor="default",eg.selection=!0,eg.forEachObject(gg=>{gg.set({evented:!0})}),eg.off("mouse:down",this.mouseDown),isDrawing=!1}}install(eg,gg){this.editor=eg,this.canvas=this.editor.getCanvas(),this.enabled()}enabled(){var eg,gg;this.canvas&&((eg=this.editor)==null||eg.addHook("addLine",this.start),(gg=this.editor)==null||gg.addHook("cancelAdd",this.end))}disabled(){this.canvas&&this.canvas.off("mouse:down",this.mouseDown)}}let _clipboard=null,isInCut=!1;const getClipboard=()=>{if(!(typeof navigator>"u"))return navigator.clipboard},writeClipboardText=async tg=>{const eg=getClipboard();if(!(eg!=null&&eg.writeText))return!1;try{return await eg.writeText(tg),!0}catch{return!1}},readClipboardText=async()=>{const tg=getClipboard();if(!(tg!=null&&tg.readText))return"";try{return await tg.readText()}catch{return""}};class CopyPaste{constructor(eg){this.canvas=eg,this.copyId="",this.pasteId="",this.cloneField=[...cloneCommonField,"hasSetHistory"]}getObjData(eg="copy"){return new Promise(async(gg,ig)=>{let ng=this.canvas.getActiveObject();if(ng){let og=null;if(await writeClipboardText(JSON.stringify({type:"fabric",data:""})),eg==="copy"){let ag=this.cloneField.filter(Ig=>Ig!=="locked");og=await ng.clone(ag)}else ng instanceof Jo?(og=this.canvas.remove(...ng._objects),og=new Jo(og)):og=this.canvas.remove(ng)[0],this.canvas.discardActiveObject(),this.canvas.requestRenderAll();_clipboard=og,gg(og)}else gg(null)})}async copy(){this.getObjData()}handleObject(eg,gg=!1){var ig;if(!gg){if(eg.counterProps&&typeof eg.counterProps=="object"&&(eg.counterProps={...eg.counterProps}),eg._props&&typeof eg._props=="object"&&(eg._props=JSON.parse(JSON.stringify(eg._props))),eg.databaseMixConcat&&typeof eg.databaseMixConcat=="object"&&(eg.databaseMixConcat=JSON.parse(JSON.stringify(eg.databaseMixConcat))),eg.connectObjIds&&typeof eg.connectObjIds=="object"&&(eg.connectObjIds=JSON.parse(JSON.stringify(eg.connectObjIds))),(eg.type==="text"||eg.type==="counter")&&delete eg.connectBar2dMap,eg.type==="barcode2d"||eg.type==="barcode")delete eg.concatTextIdListObj;else if(eg.type==="text"&&eg.fromBarCode2dID){const og=ag=>{if(ag.type==="group"&&ag._objects)return ag._objects.some(Ig=>og(Ig));if((ag.type==="barcode2d"||ag.type==="barcode")&&ag.id===eg.fromBarCode2dID){let Ig=ag.concatTextIdListObj;return Ig&&(Ig[eg.id]=!0,ag.set("concatTextIdListObj",Ig)),!0}};(ig=this.canvas)==null||ig.getObjects().some(ag=>og(ag))}}}async paste(){if(!_clipboard)return"no-data";let eg=this.cloneField;this.copyId!==this.pasteId&&(eg=eg.filter(og=>!["databaseSheet","databaseColumn","databaseTid","outsideInput","increaseCount","fromBarCode2d","fromBarCode2dID","increaseDate","barcodeDateFormatType"].includes(og)));let ig=await _clipboard.clone(eg);if(!ig)return"no-data";let ng=isInCut;if(isInCut?isInCut=!1:(ig.set({left:ig.left+10,top:ig.top+10,evented:!0}),_clipboard&&(_clipboard.left+=10,_clipboard.top+=10)),ig.type==="activeselection")ig.canvas=this.canvas,deepTraverse(ig.getObjects(),(og,ag)=>{addObjName(this.canvas,og),ag&&(ng||(og.id=v4()),this.handleObject(og,ng),this.canvas.add(og))});else if(ig.type==="group"){ig.canvas=this.canvas;const og=new Hr;og.id=v4(),addObjName(this.canvas,og),deepTraverse(ig.getObjects(),(ag,Ig)=>{addObjName(this.canvas,ag),Ig&&(ng||(ag.id=v4()),this.handleObject(ag,ng),og.add(ag))}),this.canvas.add(og),ig=og}else ng||(ig.id=v4()),this.handleObject(ig,ng),addObjName(this.canvas,ig),this.canvas.add(ig);this.canvas.setActiveObject(ig),this.canvas.requestRenderAll()}async cut(){if(isInCut=!0,!await this.getObjData("cut"))return"no-data"}}class CopyPlugin{constructor(){this.name="CopyPlugin",this.pause=!1,this.pasteHandleFn=function(){},this.shouldHandleClipboardEvent=eg=>{var ng;const gg=eg.target;if(gg instanceof Element&&gg.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]'))return!1;const ig=(ng=this.canvas)==null?void 0:ng.getActiveObject();return!!(ig&&!ig.isEditing)},this.setFabricClipboardData=eg=>{eg.clipboardData&&(eg.clipboardData.setData("text/plain",JSON.stringify({type:"fabric",data:""})),eg.preventDefault())},this.copyHandle=eg=>{this.pause||!this.shouldHandleClipboardEvent(eg)||(this.setFabricClipboardData(eg),this.toCopy())},this.cutHandle=eg=>{this.pause||!this.shouldHandleClipboardEvent(eg)||(this.setFabricClipboardData(eg),this.toCut())},this.pasteHandle=eg=>{var Ig;const gg=(Ig=this.canvas)==null?void 0:Ig.getActiveObject(),ig=eg.target,ng=ig instanceof Element&&!!ig.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]');if(gg&&gg.isEditing||ng)return;let og=eg.clipboardData,ag=(og==null?void 0:og.items)||[];for(let sg of ag){if(sg.type.startsWith("image")){console.log("粘贴图片");let Cg=sg.getAsFile();canvasEventBus.emit("copyAddImageObj",Cg),console.log("file=====",Cg)}sg.type==="text/plain"&&sg.kind==="string"&&sg.getAsString(Cg=>{console.log("粘贴文本=====",Cg);let lg=Cg;try{lg=JSON.parse(Cg)}catch{lg=Cg}typeof lg=="string"?canvasEventBus.emit("copyAddTextObj",lg):lg.type&&lg.type==="fabric"&&this.toPaste(lg)})}},this.pasteHandleFn=throttle$1(this.pasteHandle,80)}toCopy(){var gg;const eg=this.editor;this.CopyPaste.copyId=eg.id||"",(gg=this.CopyPaste)==null||gg.copy()}async toPaste(eg=null){var og;const gg=this.editor;this.CopyPaste.pasteId=gg.id||"";const ig=gg.getPlugin("HistoryPlugin");ig&&(ig.pause=!0);let ng={};if(window.isInElectron)try{ng=await window.dsapi.systemApi.readClipboard(),ng=JSON.parse(ng)}catch{}else eg?ng.text=eg:(ng.text=await readClipboardText(),!ng.text&&_clipboard&&(ng.text=JSON.stringify({type:"fabric",data:""})));if(ng.text){let ag=ng.text;try{ag=JSON.parse(ng.text)}catch{ag=ng.text}typeof ag=="string"?(ig&&(ig.pause=!1),canvasEventBus.emit("copyAddTextObj",ag)):ag.type&&ag.type==="fabric"&&((og=this.CopyPaste)==null||og.paste().then(Ig=>{var sg;ig&&(ig.pause=!1),Ig!=="no-data"&&((sg=this.canvas)==null||sg.fire("custom:object:history",{action:"paste"}))}))}else ng.imageData&&ng.imageData.length?ng.imageData.forEach(ag=>{canvasEventBus.emit("copyAddImageObj",ag)}):ig&&(ig.pause=!1)}toCut(){var ig;const eg=this.editor;this.CopyPaste.copyId=eg.id||"";const gg=eg.getPlugin("HistoryPlugin");gg&&(gg.pause=!0),(ig=this.CopyPaste)==null||ig.cut().then(ng=>{var og;gg&&(gg.pause=!1),ng!=="no-data"&&((og=this.canvas)==null||og.fire("custom:object:history",{target:null,action:"cut"}))})}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.CopyPaste=new CopyPaste(this.canvas),this.enabled()}enabled(){this.editor&&(document.removeEventListener("copy",this.copyHandle),document.addEventListener("copy",this.copyHandle),document.removeEventListener("cut",this.cutHandle),document.addEventListener("cut",this.cutHandle),document.removeEventListener("paste",this.pasteHandleFn),document.addEventListener("paste",this.pasteHandleFn))}disabled(){this.editor&&(document.removeEventListener("copy",this.copyHandle),document.removeEventListener("cut",this.cutHandle),document.removeEventListener("paste",this.pasteHandleFn))}}class SelectPlugin{constructor(){this.name="SelectPlugin",this.selectAll=()=>{if(this.canvas){const eg=this.canvas.getObjects().filter(ig=>ig.id!=="workspace"),gg=new Jo(eg);this.canvas.setActiveObject(gg),this.canvas.requestRenderAll()}}}install(eg,gg){this.canvas=eg.getCanvas(),this.enabled()}uninstall(){this.disabled()}enabled(){hotkeys("ctrl+a",this.selectAll)}disabled(){hotkeys.unbind("ctrl+a",this.selectAll)}}class LineContorlPlugin{constructor(){this.name="LineContorlPlugin",this._lastLeft=0,this._lastTop=0,this.moveTimer=null}install(eg,gg){this.canvas=eg.getCanvas(),this.enabled()}uninstall(){this.disabled()}_createHandle(eg,gg){return new ho({drawObjectType:"ignoreObject",idType:"lineHandle",excludeFromExport:!0,left:eg,top:gg,radius:6,fill:"#fff",stroke:"#1976d2",strokeWidth:2,originX:"center",originY:"center",hasControls:!1,hasBorders:!1,selectable:!0,hoverCursor:"pointer",objectCaching:!1})}_bindEvents(){this.canvas&&(canvasEventBus.off("positionChange"),canvasEventBus.on("positionChange",eg=>{eg.type==="line"&&setTimeout(()=>{this._onSelection({selected:[eg]})},0)}),this.canvas.on("selection:created",eg=>this._onSelection(eg)),this.canvas.on("selection:updated",eg=>this._onSelection(eg)),this.canvas.on("custom:object:basechanged",eg=>{let gg=eg.type,ig=eg.activeObj,ng=eg.val,og=eg.oldVal,ag=ng-og;gg==="x"?(ig.x1=ig.x1+ag,ig.x2=ig.x2+ag):gg==="y"?(ig.y1=ig.y1+ag,ig.y2=ig.y2+ag):gg==="w"?ig.x2>ig.x1?ig.x2=ig.x2+ag:ig.x1=ig.x1+ag:gg==="h"&&(ig.y2>ig.y1?ig.y2=ig.y2+ag:ig.y1=ig.y1+ag),this._onSelection({selected:[ig]})}),this.canvas.on("selection:cleared",()=>this._hideHandles()))}_updateLineFromHandles(){var eg;this.lineObject&&this.handle1&&this.handle2&&(this.lineObject.set({x1:this.handle1.left,y1:this.handle1.top,x2:this.handle2.left,y2:this.handle2.top}),this.lineObject.setCoords(),(eg=this.canvas)==null||eg.requestRenderAll())}_updateHandlesFromLine(){var ig,ng,og;if(!this.lineObject||!this.handle1||!this.handle2)return;const eg=this.lineObject.left-(this._lastLeft??this.lineObject.left),gg=this.lineObject.top-(this._lastTop??this.lineObject.top);(eg!==0||gg!==0)&&((ig=this.handle1)==null||ig.set({left:this.handle1.left+eg,top:this.handle1.top+gg}),(ng=this.handle2)==null||ng.set({left:this.handle2.left+eg,top:this.handle2.top+gg}),this.lineObject.set({x1:this.handle1.left,y1:this.handle1.top,x2:this.handle2.left,y2:this.handle2.top}),this.handle1.setCoords(),this.handle2.setCoords(),this.lineObject.setCoords()),this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,(og=this.canvas)==null||og.requestRenderAll()}_onSelection(eg){var ig,ng,og,ag,Ig,sg,Cg,lg;let gg=(eg==null?void 0:eg.selected[0])||{};if(eg.selected.length===1&&gg.type==="line"){if(this.lineObject=eg.selected[0],!this.lineObject||(this.handle1&&this.handle2&&((ig=this.canvas)==null||ig.remove(this.handle1,this.handle2)),this.lineObject.group))return;this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top;let Ag=0,cg=0,rg=0,ug=0;this.lineObject.x1<=this.lineObject.x2?(this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,Ag=this._lastLeft,cg=this._lastLeft+this.lineObject.width):this.lineObject.x1>this.lineObject.x2&&(this._lastLeft=this.lineObject.left+this.lineObject.width,this._lastTop=this.lineObject.top,Ag=this._lastLeft,cg=this._lastLeft-this.lineObject.width),this.lineObject.y1>=this.lineObject.y2?(this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,rg=this._lastTop+this.lineObject.height,ug=this._lastTop):this.lineObject.y1<this.lineObject.y2&&(rg=this._lastTop,ug=this._lastTop+this.lineObject.height),this.handle1=this._createHandle(Ag,rg),this.handle2=this._createHandle(cg,ug),(ng=this.handle1)==null||ng.on("moving",()=>this._updateLineFromHandles()),(og=this.handle2)==null||og.on("moving",()=>this._updateLineFromHandles()),(ag=this.handle2)==null||ag.on("mouseup",()=>{var dg;(dg=this.canvas)==null||dg.discardActiveObject(),setTimeout(()=>{var bg,mg;this.lineObject&&((bg=this.canvas)==null||bg.setActiveObject(this.lineObject)),(mg=this.canvas)==null||mg.requestRenderAll()},220)}),(Ig=this.handle1)==null||Ig.on("mouseup",()=>{var dg;(dg=this.canvas)==null||dg.discardActiveObject(),setTimeout(()=>{var bg;this.lineObject&&((bg=this.canvas)==null||bg.setActiveObject(this.lineObject))},220)}),(sg=this.lineObject)==null||sg.on("moving",()=>this._updateHandlesFromLine()),(Cg=this.canvas)==null||Cg.add(this.handle1,this.handle2),(lg=this.canvas)==null||lg.requestRenderAll()}else gg&&gg.drawObjectType!=="ignoreObject"&&this._hideHandles()}_showHandles(){}_hideHandles(){var eg,gg;this.handle1&&this.handle2&&((eg=this.canvas)==null||eg.remove(this.handle1,this.handle2),(gg=this.canvas)==null||gg.requestRenderAll())}enabled(){this._bindEvents()}disabled(){canvasEventBus.off("positionChange")}}function applyJsonFieldDiff(tg,eg,gg){const ig={renamedCount:0,unlinkedCount:0,valueUpdatedCount:0,unlinkedIds:[]};if(!(eg!=null&&eg.length))return ig;const ng=collectObjects(eg).filter(Ig=>Ig.fromJson);for(const{from:Ig,to:sg}of tg.renamed)for(const Cg of ng)Cg.jsonFieldKey===Ig&&(Cg.jsonFieldKey=sg,Cg.dirty=!0,ig.renamedCount++);if(gg!=null&&gg.jsonData)return reconcileWithJsonData(ng,gg.jsonData,ig),ig;const og=new Set(tg.renamed.map(({to:Ig})=>Ig));for(const{key:Ig,newValue:sg}of tg.valueChanged){if(og.has(Ig)){for(const Cg of ng)Cg.jsonFieldKey===Ig&&(setElementContent(Cg,sg),Cg.dirty=!0,ig.valueUpdatedCount++);continue}for(const Cg of ng)Cg.jsonFieldKey===Ig&&(setElementContent(Cg,sg),Cg.dirty=!0,ig.valueUpdatedCount++)}const ag=new Set(tg.removed);for(const Ig of ng)Ig.jsonFieldKey&&ag.has(Ig.jsonFieldKey)&&unlinkObject(Ig,ig);return ig}function collectObjects(tg){const eg=[],gg=new Set,ig=ng=>{var ag;if(!ng||gg.has(ng))return;gg.add(ng),eg.push(ng),(((ag=ng.getObjects)==null?void 0:ag.call(ng))??ng._objects??ng.objects??[]).forEach(ig)};return tg.forEach(ig),eg}function reconcileWithJsonData(tg,eg,gg){for(const ig of tg){const ng=ig.jsonFieldKey;if(!ng||!Object.prototype.hasOwnProperty.call(eg,ng)){unlinkObject(ig,gg);continue}setElementContent(ig,toElementValue(eg[ng])),ig.dirty=!0,gg.valueUpdatedCount++}}function unlinkObject(tg,eg){tg.jsonFieldKey="",tg.fromJson=!1,tg.type==="text"&&(tg.set?tg.set("editable",!0):tg.editable=!0),tg.dirty=!0,tg.id&&eg.unlinkedIds.push(tg.id),eg.unlinkedCount++}function toElementValue(tg){return typeof tg=="object"&&tg!==null?JSON.stringify(tg):String(tg??"")}function setElementContent(tg,eg){var gg;if(tg.type==="barcode"){tg.setBarcodeOption?tg.setBarcodeOption({text:eg}):tg.barcodeOptions&&(tg.barcodeOptions.text=eg);return}if(tg.type==="barcode2d"){tg.setBarcode2DOption?tg.setBarcode2DOption({text:eg}):tg.barcode2dOptions&&(tg.barcode2dOptions.text=eg);return}tg.set?tg.set("text",eg):tg.text=eg,(gg=tg.updateInGroup)==null||gg.call(tg)}ji.customProperties=["customExportFields"];const _hoisted_1$13={class:"nest-menu"},_sfc_main$15=defineComponent({__name:"nest-menu",props:{items:{type:Array,required:!0}},setup(tg){const eg=useSlots(),gg=(ig,ng="")=>ig.map((og,ag)=>{if(og.children&&og.children.length){let Ig=(ng?ng+"-":"")+(ag+1);return h$2(Menu.SubMenu,{key:Ig,title:og.label,popupClassName:"le-target-menu"},{default:()=>gg(og.children,Ig)})}else return h$2(Menu.Item,{key:(ng?ng+"-":"")+(ag+1)},{default:()=>eg.item({data:og})})});return(ig,ng)=>(openBlock(),createElementBlock("div",_hoisted_1$13,[createVNode(unref(Menu),mergeProps({mode:"horizontal"},ig.$attrs),{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(gg(tg.items),og=>(openBlock(),createBlock(resolveDynamicComponent(og),{key:og.key}))),128))]),_:1},16)]))}}),_export_sfc=(tg,eg)=>{const gg=tg.__vccOpts||tg;for(const[ig,ng]of eg)gg[ig]=ng;return gg},nestedMenu=_export_sfc(_sfc_main$15,[["__scopeId","data-v-ebd540f8"]]),emitter=mitt(),IconClose$1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='21'%20height='20.5078125'%20viewBox='0%200%2021%2020.5078125'%3e%3cg%3e%3cg%3e%3cellipse%20cx='10.5'%20cy='10.25390625'%20rx='10.5'%20ry='10.25390625'%20fill='%23EAEAEA'%20fill-opacity='1'%20/%3e%3c/g%3e%3cg%20transform='matrix(0,1,-1,0,21.315007209777832,-11.299349784851074)'%3e%3cpath%20d='M26.872478497314454,5.368129712463379L26.872478497314454,5.368129712463379Q26.914278497314456,5.410926712463379,26.951778497314454,5.457711712463379Q26.98927849731445,5.504496712463379,27.022078497314453,5.554820712463379Q27.054878497314455,5.605143712463379,27.082778497314454,5.658520712463379Q27.110678497314453,5.7118977124633785,27.133278497314453,5.767813712463379Q27.155878497314454,5.823730712463379,27.173078497314453,5.881647712463379Q27.190178497314452,5.939565712463379,27.201778497314454,5.998925712463379Q27.213278497314455,6.058288712463379,27.219078497314452,6.118518712463379Q27.224878497314453,6.178748712463379,27.224878497314453,6.239278712463379Q27.224878497314453,6.299798712463379,27.219078497314452,6.360028712463379Q27.213278497314455,6.420258712463379,27.201778497314454,6.479618712463379Q27.190178497314452,6.538978712463379,27.173078497314453,6.5968987124633784Q27.155878497314454,6.654818712463379,27.133278497314453,6.7107287124633785Q27.110678497314453,6.766648712463379,27.082778497314454,6.820028712463379Q27.054878497314455,6.8734087124633785,27.022078497314453,6.923728712463379Q26.98927849731445,6.974048712463379,26.951778497314454,7.020838712463378Q26.914278497314456,7.0676187124633785,26.872478497314454,7.110418712463379L18.361158497314452,15.826028712463378Q18.319358497314454,15.86882871246338,18.273668497314453,15.907228712463379Q18.227988497314453,15.945628712463378,18.17883849731445,15.979228712463378Q18.129698497314454,16.01282871246338,18.077568497314452,16.04132871246338Q18.025448497314454,16.06992871246338,17.970838497314453,16.09302871246338Q17.916228497314453,16.11622871246338,17.859668497314452,16.133828712463377Q17.803108497314454,16.15132871246338,17.745148497314453,16.16312871246338Q17.687178497314452,16.174928712463377,17.62835849731445,16.180928712463377Q17.569538497314454,16.18682871246338,17.510428497314454,16.18682871246338Q17.451328497314453,16.18682871246338,17.392508497314452,16.180928712463377Q17.333688497314455,16.174928712463377,17.275714497314453,16.16312871246338Q17.217745497314453,16.15132871246338,17.161185497314452,16.133828712463377Q17.10462549731445,16.11622871246338,17.05001949731445,16.09302871246338Q16.995413497314452,16.06992871246338,16.943287497314454,16.04132871246338Q16.891162497314454,16.01282871246338,16.842018497314452,15.979228712463378Q16.792874497314454,15.945628712463378,16.747185497314454,15.907228712463379Q16.70149649731445,15.86882871246338,16.659703497314453,15.826028712463378L16.659703497314453,15.826028712463378Q16.617909497314454,15.783228712463378,16.580413497314453,15.736428712463379Q16.542918497314453,15.68962871246338,16.510081497314452,15.63932871246338Q16.47724449731445,15.58902871246338,16.449382497314453,15.535628712463378Q16.421520497314454,15.482228712463378,16.398901797314455,15.426328712463379Q16.376283297314455,15.37042871246338,16.359125997314454,15.31252871246338Q16.341968697314453,15.25452871246338,16.330437797314453,15.19522871246338Q16.318906997314453,15.135828712463379,16.313113657314453,15.075628712463379Q16.307320322314453,15.015428712463379,16.307320289314454,14.954858712463379Q16.307320256314455,14.894338712463378,16.313113517314452,14.834098712463378Q16.318906797314455,14.77386871246338,16.330437597314454,14.71450871246338Q16.34196829731445,14.65514871246338,16.359125597314453,14.597228712463378Q16.376282797314452,14.539308712463379,16.398901297314453,14.483398712463378Q16.421519497314453,14.42747871246338,16.44938149731445,14.374098712463379Q16.477243497314454,14.32072871246338,16.510080497314455,14.270398712463379Q16.542917497314452,14.220078712463378,16.580413497314453,14.173298712463378Q16.617908497314453,14.126508712463378,16.659702497314452,14.083708712463379L25.171018497314453,5.368129712463379Q25.212808497314455,5.325333712463379,25.258498497314456,5.286937712463379Q25.304188497314453,5.248541712463379,25.353328497314454,5.214916712463379Q25.40246849731445,5.181291712463379,25.454598497314453,5.152761712463379Q25.506728497314455,5.124230712463379,25.561328497314452,5.101069512463379Q25.615938497314453,5.077908212463379,25.672498497314454,5.060339212463379Q25.729058497314455,5.042770112463379,25.787028497314452,5.030962612463379Q25.844998497314453,5.019155012463379,25.903818497314454,5.013222702463379Q25.96263849731445,5.007290366463379,26.021738497314452,5.007290366463379Q26.080848497314452,5.007290366463379,26.139668497314453,5.013222702463379Q26.198488497314454,5.019155012463379,26.256458497314455,5.030962612463379Q26.31437849731445,5.042770112463379,26.370978497314454,5.060339212463379Q26.427578497314453,5.077908212463379,26.482178497314454,5.101069512463379Q26.53677849731445,5.124230712463379,26.588878497314454,5.152761712463379Q26.640978497314453,5.181291712463379,26.690178497314452,5.214916712463379Q26.73927849731445,5.248541712463379,26.784978497314455,5.286937712463379Q26.83067849731445,5.325333712463379,26.872478497314454,5.368129712463379Z'%20fill='%238C8C8C'%20fill-opacity='1'%20/%3e%3c/g%3e%3cg%20transform='rotate(90%2010.5%2010.5)%20matrix(0,1,-1,0,21.315007209777832,-11.299349784851074)'%3e%3cpath%20d='M26.872478497314454,5.368129712463379L26.872478497314454,5.368129712463379Q26.914278497314456,5.410926712463379,26.951778497314454,5.457711712463379Q26.98927849731445,5.504496712463379,27.022078497314453,5.554820712463379Q27.054878497314455,5.605143712463379,27.082778497314454,5.658520712463379Q27.110678497314453,5.7118977124633785,27.133278497314453,5.767813712463379Q27.155878497314454,5.823730712463379,27.173078497314453,5.881647712463379Q27.190178497314452,5.939565712463379,27.201778497314454,5.998925712463379Q27.213278497314455,6.058288712463379,27.219078497314452,6.118518712463379Q27.224878497314453,6.178748712463379,27.224878497314453,6.239278712463379Q27.224878497314453,6.299798712463379,27.219078497314452,6.360028712463379Q27.213278497314455,6.420258712463379,27.201778497314454,6.479618712463379Q27.190178497314452,6.538978712463379,27.173078497314453,6.5968987124633784Q27.155878497314454,6.654818712463379,27.133278497314453,6.7107287124633785Q27.110678497314453,6.766648712463379,27.082778497314454,6.820028712463379Q27.054878497314455,6.8734087124633785,27.022078497314453,6.923728712463379Q26.98927849731445,6.974048712463379,26.951778497314454,7.020838712463378Q26.914278497314456,7.0676187124633785,26.872478497314454,7.110418712463379L18.361158497314452,15.826028712463378Q18.319358497314454,15.86882871246338,18.273668497314453,15.907228712463379Q18.227988497314453,15.945628712463378,18.17883849731445,15.979228712463378Q18.129698497314454,16.01282871246338,18.077568497314452,16.04132871246338Q18.025448497314454,16.06992871246338,17.970838497314453,16.09302871246338Q17.916228497314453,16.11622871246338,17.859668497314452,16.133828712463377Q17.803108497314454,16.15132871246338,17.745148497314453,16.16312871246338Q17.687178497314452,16.174928712463377,17.62835849731445,16.180928712463377Q17.569538497314454,16.18682871246338,17.510428497314454,16.18682871246338Q17.451328497314453,16.18682871246338,17.392508497314452,16.180928712463377Q17.333688497314455,16.174928712463377,17.275714497314453,16.16312871246338Q17.217745497314453,16.15132871246338,17.161185497314452,16.133828712463377Q17.10462549731445,16.11622871246338,17.05001949731445,16.09302871246338Q16.995413497314452,16.06992871246338,16.943287497314454,16.04132871246338Q16.891162497314454,16.01282871246338,16.842018497314452,15.979228712463378Q16.792874497314454,15.945628712463378,16.747185497314454,15.907228712463379Q16.70149649731445,15.86882871246338,16.659703497314453,15.826028712463378L16.659703497314453,15.826028712463378Q16.617909497314454,15.783228712463378,16.580413497314453,15.736428712463379Q16.542918497314453,15.68962871246338,16.510081497314452,15.63932871246338Q16.47724449731445,15.58902871246338,16.449382497314453,15.535628712463378Q16.421520497314454,15.482228712463378,16.398901797314455,15.426328712463379Q16.376283297314455,15.37042871246338,16.359125997314454,15.31252871246338Q16.341968697314453,15.25452871246338,16.330437797314453,15.19522871246338Q16.318906997314453,15.135828712463379,16.313113657314453,15.075628712463379Q16.307320322314453,15.015428712463379,16.307320289314454,14.954858712463379Q16.307320256314455,14.894338712463378,16.313113517314452,14.834098712463378Q16.318906797314455,14.77386871246338,16.330437597314454,14.71450871246338Q16.34196829731445,14.65514871246338,16.359125597314453,14.597228712463378Q16.376282797314452,14.539308712463379,16.398901297314453,14.483398712463378Q16.421519497314453,14.42747871246338,16.44938149731445,14.374098712463379Q16.477243497314454,14.32072871246338,16.510080497314455,14.270398712463379Q16.542917497314452,14.220078712463378,16.580413497314453,14.173298712463378Q16.617908497314453,14.126508712463378,16.659702497314452,14.083708712463379L25.171018497314453,5.368129712463379Q25.212808497314455,5.325333712463379,25.258498497314456,5.286937712463379Q25.304188497314453,5.248541712463379,25.353328497314454,5.214916712463379Q25.40246849731445,5.181291712463379,25.454598497314453,5.152761712463379Q25.506728497314455,5.124230712463379,25.561328497314452,5.101069512463379Q25.615938497314453,5.077908212463379,25.672498497314454,5.060339212463379Q25.729058497314455,5.042770112463379,25.787028497314452,5.030962612463379Q25.844998497314453,5.019155012463379,25.903818497314454,5.013222702463379Q25.96263849731445,5.007290366463379,26.021738497314452,5.007290366463379Q26.080848497314452,5.007290366463379,26.139668497314453,5.013222702463379Q26.198488497314454,5.019155012463379,26.256458497314455,5.030962612463379Q26.31437849731445,5.042770112463379,26.370978497314454,5.060339212463379Q26.427578497314453,5.077908212463379,26.482178497314454,5.101069512463379Q26.53677849731445,5.124230712463379,26.588878497314454,5.152761712463379Q26.640978497314453,5.181291712463379,26.690178497314452,5.214916712463379Q26.73927849731445,5.248541712463379,26.784978497314455,5.286937712463379Q26.83067849731445,5.325333712463379,26.872478497314454,5.368129712463379Z'%20fill='%238C8C8C'%20fill-opacity='1'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function useDraggableWithBoundary(tg){const{elRef:eg}=tg,gg=ref(0),ig=ref(0),ng=ref(!1);let og=0,ag=0,Ig=0,sg=0;const Cg=()=>{if(!eg.value)return;const dg=eg.value.getBoundingClientRect();Ig=dg.width,sg=dg.height},lg=(dg,bg)=>Math.min(Math.max(dg,-bg),bg),Ag=dg=>{if(!ng.value)return;let bg=dg.clientX-og,mg=dg.clientY-ag;const hg=(window.innerWidth-Ig)/2,pg=(window.innerHeight-sg)/2;bg=lg(bg,hg),mg=lg(mg,pg),gg.value=bg,ig.value=mg},cg=()=>{ng.value=!1,document.removeEventListener("mousemove",Ag),document.removeEventListener("mouseup",cg)},rg=async dg=>{dg.button===0&&(ng.value=!0,await nextTick(),Cg(),og=dg.clientX-gg.value,ag=dg.clientY-ig.value,document.addEventListener("mousemove",Ag),document.addEventListener("mouseup",cg))},ug=()=>{Cg(),gg.value=lg(gg.value,window.innerWidth-Ig),ig.value=lg(ig.value,window.innerHeight-sg)};return window.addEventListener("resize",ug),onUnmounted(()=>{document.removeEventListener("mousemove",Ag),document.removeEventListener("mouseup",cg),window.removeEventListener("resize",ug)}),{x:gg,y:ig,onMouseDown:rg}}const _hoisted_1$12={class:"d-container"},_hoisted_2$N={key:0,class:"d-mask"},_hoisted_3$G={class:"d-t-header"},_hoisted_4$C=["src"],_hoisted_5$y={key:0,class:"footer"},_sfc_main$14=defineComponent({__name:"Dialog",props:mergeModels({width:{type:String,default:"40%",required:!1},height:{type:String,default:"50%",required:!1},minHeight:{type:String,default:"300px",required:!1},maxHeight:{type:String,default:"auto",required:!1},minWidth:{type:String,default:void 0,required:!1},title:{type:String,required:!1},okBtnText:{type:String,default:void 0,require:!1},cancelBtnText:{type:String,default:void 0,require:!1},showOkBtn:{type:Boolean,default:!0,require:!1},showCancelBtn:{type:Boolean,default:!0,require:!1},showClose:{type:Boolean,default:!0,require:!1},noFooter:{type:Boolean,default:!1},maskShow:{type:Boolean,default:!1}},{open:{type:Boolean,default:!0},openModifiers:{},enabledOk:{type:Boolean,default:!0},enabledOkModifiers:{}}),emits:mergeModels(["finish"],["update:open","update:enabledOk"]),setup(tg,{emit:eg}){const{t:gg}=useI18n(),ig=ref(),ng=eg,og=useModel(tg,"open"),ag=tg;useModel(tg,"enabledOk");const{x:Ig,y:sg,onMouseDown:Cg}=useDraggableWithBoundary({elRef:ig}),lg=Ag=>{Ag.stopPropagation(),ng("finish","close")};return(Ag,cg)=>{const rg=Button$1;return og.value?(openBlock(),createBlock(Teleport,{key:0,to:"body"},[createBaseVNode("div",_hoisted_1$12,[tg.maskShow?(openBlock(),createElementBlock("div",_hoisted_2$N)):createCommentVNode("",!0),createBaseVNode("div",{ref_key:"dialogRef",ref:ig,class:"dialog-content",style:normalizeStyle$1({height:ag.height,minHeight:ag.minHeight,width:ag.width,minWidth:ag.minWidth,maxHeight:ag.maxHeight,transform:`translate(${unref(Ig)}px, ${unref(sg)}px)`})},[createBaseVNode("div",_hoisted_3$G,[createBaseVNode("div",{class:"d-t-header-title",onMousedown:cg[0]||(cg[0]=(...ug)=>unref(Cg)&&unref(Cg)(...ug))},toDisplayString$1(ag.title),33),tg.showClose?(openBlock(),createElementBlock("img",{key:0,class:"m-close-icon",src:unref(IconClose$1),onClick:lg},null,8,_hoisted_4$C)):createCommentVNode("",!0)]),createBaseVNode("div",mergeProps({class:"custom-content"},Ag.$attrs),[renderSlot(Ag.$slots,"default",{},void 0)],16),tg.noFooter?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_5$y,[renderSlot(Ag.$slots,"ext-button",{},void 0),tg.showOkBtn?(openBlock(),createBlock(rg,{key:0,type:"primary",onClick:cg[1]||(cg[1]=ug=>ng("finish","ok")),disabled:!tg.enabledOk},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ag.okBtnText??unref(gg)("common.actions.confirm")),1)]),_:1},8,["disabled"])):createCommentVNode("",!0),tg.showCancelBtn?(openBlock(),createBlock(rg,{key:1,style:{background:"#ffffff",color:"#828282"},onClick:cg[2]||(cg[2]=ug=>ng("finish","cancel"))},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ag.cancelBtnText??unref(gg)("common.actions.cancel")),1)]),_:1})):createCommentVNode("",!0)]))],4)])])):createCommentVNode("",!0)}}}),__unplugin_components_1$1=_export_sfc(_sfc_main$14,[["__scopeId","data-v-e477a1bc"]]);function formatSafeError(tg){const eg=getActiveEditorLocale(),gg=toSafeError(tg);if(gg.logDetail!==void 0&&console.error("[Service error]",gg.logDetail),eg==="zh-CN"&&gg.key.startsWith("errors.unknown")){const ig=getErrorParts(tg).detail;if(ig)return ig}return translate(gg.key,{code:gg.code??""})}var browser={},canPromise,hasRequiredCanPromise;function requireCanPromise(){return hasRequiredCanPromise||(hasRequiredCanPromise=1,canPromise=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),canPromise}var qrcode$1={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;let tg;const eg=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return utils$1.getSymbolSize=function(ig){if(!ig)throw new Error('"version" cannot be null or undefined');if(ig<1||ig>40)throw new Error('"version" should be in range from 1 to 40');return ig*4+17},utils$1.getSymbolTotalCodewords=function(ig){return eg[ig]},utils$1.getBCHDigit=function(gg){let ig=0;for(;gg!==0;)ig++,gg>>>=1;return ig},utils$1.setToSJISFunction=function(ig){if(typeof ig!="function")throw new Error('"toSJISFunc" is not a valid function.');tg=ig},utils$1.isKanjiModeEnabled=function(){return typeof tg<"u"},utils$1.toSJIS=function(ig){return tg(ig)},utils$1}var errorCorrectionLevel={},hasRequiredErrorCorrectionLevel;function requireErrorCorrectionLevel(){return hasRequiredErrorCorrectionLevel||(hasRequiredErrorCorrectionLevel=1,(function(tg){tg.L={bit:1},tg.M={bit:0},tg.Q={bit:3},tg.H={bit:2};function eg(gg){if(typeof gg!="string")throw new Error("Param is not a string");switch(gg.toLowerCase()){case"l":case"low":return tg.L;case"m":case"medium":return tg.M;case"q":case"quartile":return tg.Q;case"h":case"high":return tg.H;default:throw new Error("Unknown EC Level: "+gg)}}tg.isValid=function(ig){return ig&&typeof ig.bit<"u"&&ig.bit>=0&&ig.bit<4},tg.from=function(ig,ng){if(tg.isValid(ig))return ig;try{return eg(ig)}catch{return ng}}})(errorCorrectionLevel)),errorCorrectionLevel}var bitBuffer,hasRequiredBitBuffer;function requireBitBuffer(){if(hasRequiredBitBuffer)return bitBuffer;hasRequiredBitBuffer=1;function tg(){this.buffer=[],this.length=0}return tg.prototype={get:function(eg){const gg=Math.floor(eg/8);return(this.buffer[gg]>>>7-eg%8&1)===1},put:function(eg,gg){for(let ig=0;ig<gg;ig++)this.putBit((eg>>>gg-ig-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(eg){const gg=Math.floor(this.length/8);this.buffer.length<=gg&&this.buffer.push(0),eg&&(this.buffer[gg]|=128>>>this.length%8),this.length++}},bitBuffer=tg,bitBuffer}var bitMatrix,hasRequiredBitMatrix;function requireBitMatrix(){if(hasRequiredBitMatrix)return bitMatrix;hasRequiredBitMatrix=1;function tg(eg){if(!eg||eg<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=eg,this.data=new Uint8Array(eg*eg),this.reservedBit=new Uint8Array(eg*eg)}return tg.prototype.set=function(eg,gg,ig,ng){const og=eg*this.size+gg;this.data[og]=ig,ng&&(this.reservedBit[og]=!0)},tg.prototype.get=function(eg,gg){return this.data[eg*this.size+gg]},tg.prototype.xor=function(eg,gg,ig){this.data[eg*this.size+gg]^=ig},tg.prototype.isReserved=function(eg,gg){return this.reservedBit[eg*this.size+gg]},bitMatrix=tg,bitMatrix}var alignmentPattern={},hasRequiredAlignmentPattern;function requireAlignmentPattern(){return hasRequiredAlignmentPattern||(hasRequiredAlignmentPattern=1,(function(tg){const eg=requireUtils$1().getSymbolSize;tg.getRowColCoords=function(ig){if(ig===1)return[];const ng=Math.floor(ig/7)+2,og=eg(ig),ag=og===145?26:Math.ceil((og-13)/(2*ng-2))*2,Ig=[og-7];for(let sg=1;sg<ng-1;sg++)Ig[sg]=Ig[sg-1]-ag;return Ig.push(6),Ig.reverse()},tg.getPositions=function(ig){const ng=[],og=tg.getRowColCoords(ig),ag=og.length;for(let Ig=0;Ig<ag;Ig++)for(let sg=0;sg<ag;sg++)Ig===0&&sg===0||Ig===0&&sg===ag-1||Ig===ag-1&&sg===0||ng.push([og[Ig],og[sg]]);return ng}})(alignmentPattern)),alignmentPattern}var finderPattern={},hasRequiredFinderPattern;function requireFinderPattern(){if(hasRequiredFinderPattern)return finderPattern;hasRequiredFinderPattern=1;const tg=requireUtils$1().getSymbolSize,eg=7;return finderPattern.getPositions=function(ig){const ng=tg(ig);return[[0,0],[ng-eg,0],[0,ng-eg]]},finderPattern}var maskPattern={},hasRequiredMaskPattern;function requireMaskPattern(){return hasRequiredMaskPattern||(hasRequiredMaskPattern=1,(function(tg){tg.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const eg={N1:3,N2:3,N3:40,N4:10};tg.isValid=function(ng){return ng!=null&&ng!==""&&!isNaN(ng)&&ng>=0&&ng<=7},tg.from=function(ng){return tg.isValid(ng)?parseInt(ng,10):void 0},tg.getPenaltyN1=function(ng){const og=ng.size;let ag=0,Ig=0,sg=0,Cg=null,lg=null;for(let Ag=0;Ag<og;Ag++){Ig=sg=0,Cg=lg=null;for(let cg=0;cg<og;cg++){let rg=ng.get(Ag,cg);rg===Cg?Ig++:(Ig>=5&&(ag+=eg.N1+(Ig-5)),Cg=rg,Ig=1),rg=ng.get(cg,Ag),rg===lg?sg++:(sg>=5&&(ag+=eg.N1+(sg-5)),lg=rg,sg=1)}Ig>=5&&(ag+=eg.N1+(Ig-5)),sg>=5&&(ag+=eg.N1+(sg-5))}return ag},tg.getPenaltyN2=function(ng){const og=ng.size;let ag=0;for(let Ig=0;Ig<og-1;Ig++)for(let sg=0;sg<og-1;sg++){const Cg=ng.get(Ig,sg)+ng.get(Ig,sg+1)+ng.get(Ig+1,sg)+ng.get(Ig+1,sg+1);(Cg===4||Cg===0)&&ag++}return ag*eg.N2},tg.getPenaltyN3=function(ng){const og=ng.size;let ag=0,Ig=0,sg=0;for(let Cg=0;Cg<og;Cg++){Ig=sg=0;for(let lg=0;lg<og;lg++)Ig=Ig<<1&2047|ng.get(Cg,lg),lg>=10&&(Ig===1488||Ig===93)&&ag++,sg=sg<<1&2047|ng.get(lg,Cg),lg>=10&&(sg===1488||sg===93)&&ag++}return ag*eg.N3},tg.getPenaltyN4=function(ng){let og=0;const ag=ng.data.length;for(let sg=0;sg<ag;sg++)og+=ng.data[sg];return Math.abs(Math.ceil(og*100/ag/5)-10)*eg.N4};function gg(ig,ng,og){switch(ig){case tg.Patterns.PATTERN000:return(ng+og)%2===0;case tg.Patterns.PATTERN001:return ng%2===0;case tg.Patterns.PATTERN010:return og%3===0;case tg.Patterns.PATTERN011:return(ng+og)%3===0;case tg.Patterns.PATTERN100:return(Math.floor(ng/2)+Math.floor(og/3))%2===0;case tg.Patterns.PATTERN101:return ng*og%2+ng*og%3===0;case tg.Patterns.PATTERN110:return(ng*og%2+ng*og%3)%2===0;case tg.Patterns.PATTERN111:return(ng*og%3+(ng+og)%2)%2===0;default:throw new Error("bad maskPattern:"+ig)}}tg.applyMask=function(ng,og){const ag=og.size;for(let Ig=0;Ig<ag;Ig++)for(let sg=0;sg<ag;sg++)og.isReserved(sg,Ig)||og.xor(sg,Ig,gg(ng,sg,Ig))},tg.getBestMask=function(ng,og){const ag=Object.keys(tg.Patterns).length;let Ig=0,sg=1/0;for(let Cg=0;Cg<ag;Cg++){og(Cg),tg.applyMask(Cg,ng);const lg=tg.getPenaltyN1(ng)+tg.getPenaltyN2(ng)+tg.getPenaltyN3(ng)+tg.getPenaltyN4(ng);tg.applyMask(Cg,ng),lg<sg&&(sg=lg,Ig=Cg)}return Ig}})(maskPattern)),maskPattern}var errorCorrectionCode={},hasRequiredErrorCorrectionCode;function requireErrorCorrectionCode(){if(hasRequiredErrorCorrectionCode)return errorCorrectionCode;hasRequiredErrorCorrectionCode=1;const tg=requireErrorCorrectionLevel(),eg=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],gg=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return errorCorrectionCode.getBlocksCount=function(ng,og){switch(og){case tg.L:return eg[(ng-1)*4+0];case tg.M:return eg[(ng-1)*4+1];case tg.Q:return eg[(ng-1)*4+2];case tg.H:return eg[(ng-1)*4+3];default:return}},errorCorrectionCode.getTotalCodewordsCount=function(ng,og){switch(og){case tg.L:return gg[(ng-1)*4+0];case tg.M:return gg[(ng-1)*4+1];case tg.Q:return gg[(ng-1)*4+2];case tg.H:return gg[(ng-1)*4+3];default:return}},errorCorrectionCode}var polynomial={},galoisField={},hasRequiredGaloisField;function requireGaloisField(){if(hasRequiredGaloisField)return galoisField;hasRequiredGaloisField=1;const tg=new Uint8Array(512),eg=new Uint8Array(256);return(function(){let ig=1;for(let ng=0;ng<255;ng++)tg[ng]=ig,eg[ig]=ng,ig<<=1,ig&256&&(ig^=285);for(let ng=255;ng<512;ng++)tg[ng]=tg[ng-255]})(),galoisField.log=function(ig){if(ig<1)throw new Error("log("+ig+")");return eg[ig]},galoisField.exp=function(ig){return tg[ig]},galoisField.mul=function(ig,ng){return ig===0||ng===0?0:tg[eg[ig]+eg[ng]]},galoisField}var hasRequiredPolynomial;function requirePolynomial(){return hasRequiredPolynomial||(hasRequiredPolynomial=1,(function(tg){const eg=requireGaloisField();tg.mul=function(ig,ng){const og=new Uint8Array(ig.length+ng.length-1);for(let ag=0;ag<ig.length;ag++)for(let Ig=0;Ig<ng.length;Ig++)og[ag+Ig]^=eg.mul(ig[ag],ng[Ig]);return og},tg.mod=function(ig,ng){let og=new Uint8Array(ig);for(;og.length-ng.length>=0;){const ag=og[0];for(let sg=0;sg<ng.length;sg++)og[sg]^=eg.mul(ng[sg],ag);let Ig=0;for(;Ig<og.length&&og[Ig]===0;)Ig++;og=og.slice(Ig)}return og},tg.generateECPolynomial=function(ig){let ng=new Uint8Array([1]);for(let og=0;og<ig;og++)ng=tg.mul(ng,new Uint8Array([1,eg.exp(og)]));return ng}})(polynomial)),polynomial}var reedSolomonEncoder,hasRequiredReedSolomonEncoder;function requireReedSolomonEncoder(){if(hasRequiredReedSolomonEncoder)return reedSolomonEncoder;hasRequiredReedSolomonEncoder=1;const tg=requirePolynomial();function eg(gg){this.genPoly=void 0,this.degree=gg,this.degree&&this.initialize(this.degree)}return eg.prototype.initialize=function(ig){this.degree=ig,this.genPoly=tg.generateECPolynomial(this.degree)},eg.prototype.encode=function(ig){if(!this.genPoly)throw new Error("Encoder not initialized");const ng=new Uint8Array(ig.length+this.degree);ng.set(ig);const og=tg.mod(ng,this.genPoly),ag=this.degree-og.length;if(ag>0){const Ig=new Uint8Array(this.degree);return Ig.set(og,ag),Ig}return og},reedSolomonEncoder=eg,reedSolomonEncoder}var version={},mode={},versionCheck={},hasRequiredVersionCheck;function requireVersionCheck(){return hasRequiredVersionCheck||(hasRequiredVersionCheck=1,versionCheck.isValid=function(eg){return!isNaN(eg)&&eg>=1&&eg<=40}),versionCheck}var regex={},hasRequiredRegex;function requireRegex(){if(hasRequiredRegex)return regex;hasRequiredRegex=1;const tg="[0-9]+",eg="[A-Z $%*+\\-./:]+";let gg="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";gg=gg.replace(/u/g,"\\u");const ig="(?:(?![A-Z0-9 $%*+\\-./:]|"+gg+`)(?:.|[\r
930
+ `).flatMap(ng=>{let og="";const ag=ng.split(/\s+/).filter(Ig=>Ig);return ag.reduce((Ig,sg,Cg)=>{const lg=og?`${og} ${sg}`:sg;return tg.measureText(lg).width<=gg?og=lg:(og&&Ig.push(og),og=sg,(Cg===ag.length-1||tg.measureText(sg).width>gg)&&(Ig.push(...splitLongWord(tg,sg,gg)),og="")),Cg===ag.length-1&&og&&Ig.push(og),Ig},[])})}function getLineHeight(tg){const eg=tg.font.match(/\d+/),gg=10;return eg?parseInt(eg[0],gg):gg}function generateThumbnail(tg,eg,gg){let{width:ig,height:ng}=tg;const og=Math.min(eg/ig,gg/ng);ig*=og,ng*=og;const ag=document.createElement("canvas"),Ig=ag.getContext("2d");if(!Ig)throw new Error("Canvas context not available");return ag.width=ig,ag.height=ng,Ig.drawImage(tg,0,0,ig,ng),ag.toDataURL("image/png",.85)}class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(eg){super(`Invalid DateTime: ${eg.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(eg){super(`Invalid Interval: ${eg.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(eg){super(`Invalid Duration: ${eg.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(eg){super(`Invalid unit ${eg}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const n="numeric",s="short",l="long",DATE_SHORT={year:n,month:n,day:n},DATE_MED={year:n,month:s,day:n},DATE_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s},DATE_FULL={year:n,month:l,day:n},DATE_HUGE={year:n,month:l,day:n,weekday:l},TIME_SIMPLE={hour:n,minute:n},TIME_WITH_SECONDS={hour:n,minute:n,second:n},TIME_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,timeZoneName:s},TIME_WITH_LONG_OFFSET={hour:n,minute:n,second:n,timeZoneName:l},TIME_24_SIMPLE={hour:n,minute:n,hourCycle:"h23"},TIME_24_WITH_SECONDS={hour:n,minute:n,second:n,hourCycle:"h23"},TIME_24_WITH_SHORT_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:s},TIME_24_WITH_LONG_OFFSET={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:l},DATETIME_SHORT={year:n,month:n,day:n,hour:n,minute:n},DATETIME_SHORT_WITH_SECONDS={year:n,month:n,day:n,hour:n,minute:n,second:n},DATETIME_MED={year:n,month:s,day:n,hour:n,minute:n},DATETIME_MED_WITH_SECONDS={year:n,month:s,day:n,hour:n,minute:n,second:n},DATETIME_MED_WITH_WEEKDAY={year:n,month:s,day:n,weekday:s,hour:n,minute:n},DATETIME_FULL={year:n,month:l,day:n,hour:n,minute:n,timeZoneName:s},DATETIME_FULL_WITH_SECONDS={year:n,month:l,day:n,hour:n,minute:n,second:n,timeZoneName:s},DATETIME_HUGE={year:n,month:l,day:n,weekday:l,hour:n,minute:n,timeZoneName:l},DATETIME_HUGE_WITH_SECONDS={year:n,month:l,day:n,weekday:l,hour:n,minute:n,second:n,timeZoneName:l};class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(eg,gg){throw new ZoneIsAbstractError}formatOffset(eg,gg){throw new ZoneIsAbstractError}offset(eg){throw new ZoneIsAbstractError}equals(eg){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let singleton$1=null;class SystemZone extends Zone{static get instance(){return singleton$1===null&&(singleton$1=new SystemZone),singleton$1}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(eg,{format:gg,locale:ig}){return parseZoneInfo(eg,gg,ig)}formatOffset(eg,gg){return formatOffset(this.offset(eg),gg)}offset(eg){return-new Date(eg).getTimezoneOffset()}equals(eg){return eg.type==="system"}get isValid(){return!0}}const dtfCache=new Map;function makeDTF(tg){let eg=dtfCache.get(tg);return eg===void 0&&(eg=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:tg,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),dtfCache.set(tg,eg)),eg}const typeToPos={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(tg,eg){const gg=tg.format(eg).replace(/\u200E/g,""),ig=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(gg),[,ng,og,ag,Ig,sg,Cg,lg]=ig;return[ag,ng,og,Ig,sg,Cg,lg]}function partsOffset(tg,eg){const gg=tg.formatToParts(eg),ig=[];for(let ng=0;ng<gg.length;ng++){const{type:og,value:ag}=gg[ng],Ig=typeToPos[og];og==="era"?ig[Ig]=ag:isUndefined$1(Ig)||(ig[Ig]=parseInt(ag,10))}return ig}const ianaZoneCache=new Map;class IANAZone extends Zone{static create(eg){let gg=ianaZoneCache.get(eg);return gg===void 0&&ianaZoneCache.set(eg,gg=new IANAZone(eg)),gg}static resetCache(){ianaZoneCache.clear(),dtfCache.clear()}static isValidSpecifier(eg){return this.isValidZone(eg)}static isValidZone(eg){if(!eg)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:eg}).format(),!0}catch{return!1}}constructor(eg){super(),this.zoneName=eg,this.valid=IANAZone.isValidZone(eg)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(eg,{format:gg,locale:ig}){return parseZoneInfo(eg,gg,ig,this.name)}formatOffset(eg,gg){return formatOffset(this.offset(eg),gg)}offset(eg){if(!this.valid)return NaN;const gg=new Date(eg);if(isNaN(gg))return NaN;const ig=makeDTF(this.name);let[ng,og,ag,Ig,sg,Cg,lg]=ig.formatToParts?partsOffset(ig,gg):hackyOffset(ig,gg);Ig==="BC"&&(ng=-Math.abs(ng)+1);const cg=objToLocalTS({year:ng,month:og,day:ag,hour:sg===24?0:sg,minute:Cg,second:lg,millisecond:0});let rg=+gg;const ug=rg%1e3;return rg-=ug>=0?ug:1e3+ug,(cg-rg)/(60*1e3)}equals(eg){return eg.type==="iana"&&eg.name===this.name}get isValid(){return this.valid}}let intlLFCache={};function getCachedLF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlLFCache[gg];return ig||(ig=new Intl.ListFormat(tg,eg),intlLFCache[gg]=ig),ig}const intlDTCache=new Map;function getCachedDTF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlDTCache.get(gg);return ig===void 0&&(ig=new Intl.DateTimeFormat(tg,eg),intlDTCache.set(gg,ig)),ig}const intlNumCache=new Map;function getCachedINF(tg,eg={}){const gg=JSON.stringify([tg,eg]);let ig=intlNumCache.get(gg);return ig===void 0&&(ig=new Intl.NumberFormat(tg,eg),intlNumCache.set(gg,ig)),ig}const intlRelCache=new Map;function getCachedRTF(tg,eg={}){const{base:gg,...ig}=eg,ng=JSON.stringify([tg,ig]);let og=intlRelCache.get(ng);return og===void 0&&(og=new Intl.RelativeTimeFormat(tg,eg),intlRelCache.set(ng,og)),og}let sysLocaleCache=null;function systemLocale(){return sysLocaleCache||(sysLocaleCache=new Intl.DateTimeFormat().resolvedOptions().locale,sysLocaleCache)}const intlResolvedOptionsCache=new Map;function getCachedIntResolvedOptions(tg){let eg=intlResolvedOptionsCache.get(tg);return eg===void 0&&(eg=new Intl.DateTimeFormat(tg).resolvedOptions(),intlResolvedOptionsCache.set(tg,eg)),eg}const weekInfoCache=new Map;function getCachedWeekInfo(tg){let eg=weekInfoCache.get(tg);if(!eg){const gg=new Intl.Locale(tg);eg="getWeekInfo"in gg?gg.getWeekInfo():gg.weekInfo,"minimalDays"in eg||(eg={...fallbackWeekSettings,...eg}),weekInfoCache.set(tg,eg)}return eg}function parseLocaleString(tg){const eg=tg.indexOf("-x-");eg!==-1&&(tg=tg.substring(0,eg));const gg=tg.indexOf("-u-");if(gg===-1)return[tg];{let ig,ng;try{ig=getCachedDTF(tg).resolvedOptions(),ng=tg}catch{const sg=tg.substring(0,gg);ig=getCachedDTF(sg).resolvedOptions(),ng=sg}const{numberingSystem:og,calendar:ag}=ig;return[ng,og,ag]}}function intlConfigString(tg,eg,gg){return(gg||eg)&&(tg.includes("-u-")||(tg+="-u"),gg&&(tg+=`-ca-${gg}`),eg&&(tg+=`-nu-${eg}`)),tg}function mapMonths(tg){const eg=[];for(let gg=1;gg<=12;gg++){const ig=DateTime.utc(2009,gg,1);eg.push(tg(ig))}return eg}function mapWeekdays(tg){const eg=[];for(let gg=1;gg<=7;gg++){const ig=DateTime.utc(2016,11,13+gg);eg.push(tg(ig))}return eg}function listStuff(tg,eg,gg,ig){const ng=tg.listingMode();return ng==="error"?null:ng==="en"?gg(eg):ig(eg)}function supportsFastNumbers(tg){return tg.numberingSystem&&tg.numberingSystem!=="latn"?!1:tg.numberingSystem==="latn"||!tg.locale||tg.locale.startsWith("en")||getCachedIntResolvedOptions(tg.locale).numberingSystem==="latn"}class PolyNumberFormatter{constructor(eg,gg,ig){this.padTo=ig.padTo||0,this.floor=ig.floor||!1;const{padTo:ng,floor:og,...ag}=ig;if(!gg||Object.keys(ag).length>0){const Ig={useGrouping:!1,...ig};ig.padTo>0&&(Ig.minimumIntegerDigits=ig.padTo),this.inf=getCachedINF(eg,Ig)}}format(eg){if(this.inf){const gg=this.floor?Math.floor(eg):eg;return this.inf.format(gg)}else{const gg=this.floor?Math.floor(eg):roundTo(eg,3);return padStart(gg,this.padTo)}}}class PolyDateFormatter{constructor(eg,gg,ig){this.opts=ig,this.originalZone=void 0;let ng;if(this.opts.timeZone)this.dt=eg;else if(eg.zone.type==="fixed"){const ag=-1*(eg.offset/60),Ig=ag>=0?`Etc/GMT+${ag}`:`Etc/GMT${ag}`;eg.offset!==0&&IANAZone.create(Ig).valid?(ng=Ig,this.dt=eg):(ng="UTC",this.dt=eg.offset===0?eg:eg.setZone("UTC").plus({minutes:eg.offset}),this.originalZone=eg.zone)}else eg.zone.type==="system"?this.dt=eg:eg.zone.type==="iana"?(this.dt=eg,ng=eg.zone.name):(ng="UTC",this.dt=eg.setZone("UTC").plus({minutes:eg.offset}),this.originalZone=eg.zone);const og={...this.opts};og.timeZone=og.timeZone||ng,this.dtf=getCachedDTF(gg,og)}format(){return this.originalZone?this.formatToParts().map(({value:eg})=>eg).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const eg=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?eg.map(gg=>{if(gg.type==="timeZoneName"){const ig=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...gg,value:ig}}else return gg}):eg}resolvedOptions(){return this.dtf.resolvedOptions()}}class PolyRelFormatter{constructor(eg,gg,ig){this.opts={style:"long",...ig},!gg&&hasRelative()&&(this.rtf=getCachedRTF(eg,ig))}format(eg,gg){return this.rtf?this.rtf.format(eg,gg):formatRelativeTime(gg,eg,this.opts.numeric,this.opts.style!=="long")}formatToParts(eg,gg){return this.rtf?this.rtf.formatToParts(eg,gg):[]}}const fallbackWeekSettings={firstDay:1,minimalDays:4,weekend:[6,7]};class Locale{static fromOpts(eg){return Locale.create(eg.locale,eg.numberingSystem,eg.outputCalendar,eg.weekSettings,eg.defaultToEN)}static create(eg,gg,ig,ng,og=!1){const ag=eg||Settings.defaultLocale,Ig=ag||(og?"en-US":systemLocale()),sg=gg||Settings.defaultNumberingSystem,Cg=ig||Settings.defaultOutputCalendar,lg=validateWeekSettings(ng)||Settings.defaultWeekSettings;return new Locale(Ig,sg,Cg,lg,ag)}static resetCache(){sysLocaleCache=null,intlDTCache.clear(),intlNumCache.clear(),intlRelCache.clear(),intlResolvedOptionsCache.clear(),weekInfoCache.clear()}static fromObject({locale:eg,numberingSystem:gg,outputCalendar:ig,weekSettings:ng}={}){return Locale.create(eg,gg,ig,ng)}constructor(eg,gg,ig,ng,og){const[ag,Ig,sg]=parseLocaleString(eg);this.locale=ag,this.numberingSystem=gg||Ig||null,this.outputCalendar=ig||sg||null,this.weekSettings=ng,this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=og,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=supportsFastNumbers(this)),this.fastNumbersCached}listingMode(){const eg=this.isEnglish(),gg=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return eg&&gg?"en":"intl"}clone(eg){return!eg||Object.getOwnPropertyNames(eg).length===0?this:Locale.create(eg.locale||this.specifiedLocale,eg.numberingSystem||this.numberingSystem,eg.outputCalendar||this.outputCalendar,validateWeekSettings(eg.weekSettings)||this.weekSettings,eg.defaultToEN||!1)}redefaultToEN(eg={}){return this.clone({...eg,defaultToEN:!0})}redefaultToSystem(eg={}){return this.clone({...eg,defaultToEN:!1})}months(eg,gg=!1){return listStuff(this,eg,months,()=>{const ig=this.intl==="ja"||this.intl.startsWith("ja-");gg&=!ig;const ng=gg?{month:eg,day:"numeric"}:{month:eg},og=gg?"format":"standalone";if(!this.monthsCache[og][eg]){const ag=ig?Ig=>this.dtFormatter(Ig,ng).format():Ig=>this.extract(Ig,ng,"month");this.monthsCache[og][eg]=mapMonths(ag)}return this.monthsCache[og][eg]})}weekdays(eg,gg=!1){return listStuff(this,eg,weekdays,()=>{const ig=gg?{weekday:eg,year:"numeric",month:"long",day:"numeric"}:{weekday:eg},ng=gg?"format":"standalone";return this.weekdaysCache[ng][eg]||(this.weekdaysCache[ng][eg]=mapWeekdays(og=>this.extract(og,ig,"weekday"))),this.weekdaysCache[ng][eg]})}meridiems(){return listStuff(this,void 0,()=>meridiems,()=>{if(!this.meridiemCache){const eg={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(gg=>this.extract(gg,eg,"dayperiod"))}return this.meridiemCache})}eras(eg){return listStuff(this,eg,eras,()=>{const gg={era:eg};return this.eraCache[eg]||(this.eraCache[eg]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(ig=>this.extract(ig,gg,"era"))),this.eraCache[eg]})}extract(eg,gg,ig){const ng=this.dtFormatter(eg,gg),og=ng.formatToParts(),ag=og.find(Ig=>Ig.type.toLowerCase()===ig);return ag?ag.value:null}numberFormatter(eg={}){return new PolyNumberFormatter(this.intl,eg.forceSimple||this.fastNumbers,eg)}dtFormatter(eg,gg={}){return new PolyDateFormatter(eg,this.intl,gg)}relFormatter(eg={}){return new PolyRelFormatter(this.intl,this.isEnglish(),eg)}listFormatter(eg={}){return getCachedLF(this.intl,eg)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hasLocaleWeekInfo()?getCachedWeekInfo(this.locale):fallbackWeekSettings}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(eg){return this.locale===eg.locale&&this.numberingSystem===eg.numberingSystem&&this.outputCalendar===eg.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let singleton=null;class FixedOffsetZone extends Zone{static get utcInstance(){return singleton===null&&(singleton=new FixedOffsetZone(0)),singleton}static instance(eg){return eg===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(eg)}static parseSpecifier(eg){if(eg){const gg=eg.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(gg)return new FixedOffsetZone(signedOffset(gg[1],gg[2]))}return null}constructor(eg){super(),this.fixed=eg}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(eg,gg){return formatOffset(this.fixed,gg)}get isUniversal(){return!0}offset(){return this.fixed}equals(eg){return eg.type==="fixed"&&eg.fixed===this.fixed}get isValid(){return!0}}class InvalidZone extends Zone{constructor(eg){super(),this.zoneName=eg}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function normalizeZone(tg,eg){if(isUndefined$1(tg)||tg===null)return eg;if(tg instanceof Zone)return tg;if(isString$1(tg)){const gg=tg.toLowerCase();return gg==="default"?eg:gg==="local"||gg==="system"?SystemZone.instance:gg==="utc"||gg==="gmt"?FixedOffsetZone.utcInstance:FixedOffsetZone.parseSpecifier(gg)||IANAZone.create(tg)}else return isNumber$1(tg)?FixedOffsetZone.instance(tg):typeof tg=="object"&&"offset"in tg&&typeof tg.offset=="function"?tg:new InvalidZone(tg)}const numberingSystems={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(tg){let eg=parseInt(tg,10);if(isNaN(eg)){eg="";for(let gg=0;gg<tg.length;gg++){const ig=tg.charCodeAt(gg);if(tg[gg].search(numberingSystems.hanidec)!==-1)eg+=hanidecChars.indexOf(tg[gg]);else for(const ng in numberingSystemsUTF16){const[og,ag]=numberingSystemsUTF16[ng];ig>=og&&ig<=ag&&(eg+=ig-og)}}return parseInt(eg,10)}else return eg}const digitRegexCache=new Map;function resetDigitRegexCache(){digitRegexCache.clear()}function digitRegex({numberingSystem:tg},eg=""){const gg=tg||"latn";let ig=digitRegexCache.get(gg);ig===void 0&&(ig=new Map,digitRegexCache.set(gg,ig));let ng=ig.get(eg);return ng===void 0&&(ng=new RegExp(`${numberingSystems[gg]}${eg}`),ig.set(eg,ng)),ng}let now=()=>Date.now(),defaultZone="system",defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,twoDigitCutoffYear=60,throwOnInvalid,defaultWeekSettings=null;class Settings{static get now(){return now}static set now(eg){now=eg}static set defaultZone(eg){defaultZone=eg}static get defaultZone(){return normalizeZone(defaultZone,SystemZone.instance)}static get defaultLocale(){return defaultLocale}static set defaultLocale(eg){defaultLocale=eg}static get defaultNumberingSystem(){return defaultNumberingSystem}static set defaultNumberingSystem(eg){defaultNumberingSystem=eg}static get defaultOutputCalendar(){return defaultOutputCalendar}static set defaultOutputCalendar(eg){defaultOutputCalendar=eg}static get defaultWeekSettings(){return defaultWeekSettings}static set defaultWeekSettings(eg){defaultWeekSettings=validateWeekSettings(eg)}static get twoDigitCutoffYear(){return twoDigitCutoffYear}static set twoDigitCutoffYear(eg){twoDigitCutoffYear=eg%100}static get throwOnInvalid(){return throwOnInvalid}static set throwOnInvalid(eg){throwOnInvalid=eg}static resetCaches(){Locale.resetCache(),IANAZone.resetCache(),DateTime.resetCache(),resetDigitRegexCache()}}class Invalid{constructor(eg,gg){this.reason=eg,this.explanation=gg}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(tg,eg){return new Invalid("unit out of range",`you specified ${eg} (of type ${typeof eg}) as a ${tg}, which is invalid`)}function dayOfWeek(tg,eg,gg){const ig=new Date(Date.UTC(tg,eg-1,gg));tg<100&&tg>=0&&ig.setUTCFullYear(ig.getUTCFullYear()-1900);const ng=ig.getUTCDay();return ng===0?7:ng}function computeOrdinal(tg,eg,gg){return gg+(isLeapYear(tg)?leapLadder:nonLeapLadder)[eg-1]}function uncomputeOrdinal(tg,eg){const gg=isLeapYear(tg)?leapLadder:nonLeapLadder,ig=gg.findIndex(og=>og<eg),ng=eg-gg[ig];return{month:ig+1,day:ng}}function isoWeekdayToLocal(tg,eg){return(tg-eg+7)%7+1}function gregorianToWeek(tg,eg=4,gg=1){const{year:ig,month:ng,day:og}=tg,ag=computeOrdinal(ig,ng,og),Ig=isoWeekdayToLocal(dayOfWeek(ig,ng,og),gg);let sg=Math.floor((ag-Ig+14-eg)/7),Cg;return sg<1?(Cg=ig-1,sg=weeksInWeekYear(Cg,eg,gg)):sg>weeksInWeekYear(ig,eg,gg)?(Cg=ig+1,sg=1):Cg=ig,{weekYear:Cg,weekNumber:sg,weekday:Ig,...timeObject(tg)}}function weekToGregorian(tg,eg=4,gg=1){const{weekYear:ig,weekNumber:ng,weekday:og}=tg,ag=isoWeekdayToLocal(dayOfWeek(ig,1,eg),gg),Ig=daysInYear(ig);let sg=ng*7+og-ag-7+eg,Cg;sg<1?(Cg=ig-1,sg+=daysInYear(Cg)):sg>Ig?(Cg=ig+1,sg-=daysInYear(ig)):Cg=ig;const{month:lg,day:Ag}=uncomputeOrdinal(Cg,sg);return{year:Cg,month:lg,day:Ag,...timeObject(tg)}}function gregorianToOrdinal(tg){const{year:eg,month:gg,day:ig}=tg,ng=computeOrdinal(eg,gg,ig);return{year:eg,ordinal:ng,...timeObject(tg)}}function ordinalToGregorian(tg){const{year:eg,ordinal:gg}=tg,{month:ig,day:ng}=uncomputeOrdinal(eg,gg);return{year:eg,month:ig,day:ng,...timeObject(tg)}}function usesLocalWeekValues(tg,eg){if(!isUndefined$1(tg.localWeekday)||!isUndefined$1(tg.localWeekNumber)||!isUndefined$1(tg.localWeekYear)){if(!isUndefined$1(tg.weekday)||!isUndefined$1(tg.weekNumber)||!isUndefined$1(tg.weekYear))throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");return isUndefined$1(tg.localWeekday)||(tg.weekday=tg.localWeekday),isUndefined$1(tg.localWeekNumber)||(tg.weekNumber=tg.localWeekNumber),isUndefined$1(tg.localWeekYear)||(tg.weekYear=tg.localWeekYear),delete tg.localWeekday,delete tg.localWeekNumber,delete tg.localWeekYear,{minDaysInFirstWeek:eg.getMinDaysInFirstWeek(),startOfWeek:eg.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hasInvalidWeekData(tg,eg=4,gg=1){const ig=isInteger(tg.weekYear),ng=integerBetween(tg.weekNumber,1,weeksInWeekYear(tg.weekYear,eg,gg)),og=integerBetween(tg.weekday,1,7);return ig?ng?og?!1:unitOutOfRange("weekday",tg.weekday):unitOutOfRange("week",tg.weekNumber):unitOutOfRange("weekYear",tg.weekYear)}function hasInvalidOrdinalData(tg){const eg=isInteger(tg.year),gg=integerBetween(tg.ordinal,1,daysInYear(tg.year));return eg?gg?!1:unitOutOfRange("ordinal",tg.ordinal):unitOutOfRange("year",tg.year)}function hasInvalidGregorianData(tg){const eg=isInteger(tg.year),gg=integerBetween(tg.month,1,12),ig=integerBetween(tg.day,1,daysInMonth(tg.year,tg.month));return eg?gg?ig?!1:unitOutOfRange("day",tg.day):unitOutOfRange("month",tg.month):unitOutOfRange("year",tg.year)}function hasInvalidTimeData(tg){const{hour:eg,minute:gg,second:ig,millisecond:ng}=tg,og=integerBetween(eg,0,23)||eg===24&&gg===0&&ig===0&&ng===0,ag=integerBetween(gg,0,59),Ig=integerBetween(ig,0,59),sg=integerBetween(ng,0,999);return og?ag?Ig?sg?!1:unitOutOfRange("millisecond",ng):unitOutOfRange("second",ig):unitOutOfRange("minute",gg):unitOutOfRange("hour",eg)}function isUndefined$1(tg){return typeof tg>"u"}function isNumber$1(tg){return typeof tg=="number"}function isInteger(tg){return typeof tg=="number"&&tg%1===0}function isString$1(tg){return typeof tg=="string"}function isDate$1(tg){return Object.prototype.toString.call(tg)==="[object Date]"}function hasRelative(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hasLocaleWeekInfo(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function maybeArray(tg){return Array.isArray(tg)?tg:[tg]}function bestBy(tg,eg,gg){if(tg.length!==0)return tg.reduce((ig,ng)=>{const og=[eg(ng),ng];return ig&&gg(ig[0],og[0])===ig[0]?ig:og},null)[1]}function pick(tg,eg){return eg.reduce((gg,ig)=>(gg[ig]=tg[ig],gg),{})}function hasOwnProperty(tg,eg){return Object.prototype.hasOwnProperty.call(tg,eg)}function validateWeekSettings(tg){if(tg==null)return null;if(typeof tg!="object")throw new InvalidArgumentError("Week settings must be an object");if(!integerBetween(tg.firstDay,1,7)||!integerBetween(tg.minimalDays,1,7)||!Array.isArray(tg.weekend)||tg.weekend.some(eg=>!integerBetween(eg,1,7)))throw new InvalidArgumentError("Invalid week settings");return{firstDay:tg.firstDay,minimalDays:tg.minimalDays,weekend:Array.from(tg.weekend)}}function integerBetween(tg,eg,gg){return isInteger(tg)&&tg>=eg&&tg<=gg}function floorMod(tg,eg){return tg-eg*Math.floor(tg/eg)}function padStart(tg,eg=2){const gg=tg<0;let ig;return gg?ig="-"+(""+-tg).padStart(eg,"0"):ig=(""+tg).padStart(eg,"0"),ig}function parseInteger(tg){if(!(isUndefined$1(tg)||tg===null||tg===""))return parseInt(tg,10)}function parseFloating(tg){if(!(isUndefined$1(tg)||tg===null||tg===""))return parseFloat(tg)}function parseMillis(tg){if(!(isUndefined$1(tg)||tg===null||tg==="")){const eg=parseFloat("0."+tg)*1e3;return Math.floor(eg)}}function roundTo(tg,eg,gg="round"){const ig=10**eg;switch(gg){case"expand":return tg>0?Math.ceil(tg*ig)/ig:Math.floor(tg*ig)/ig;case"trunc":return Math.trunc(tg*ig)/ig;case"round":return Math.round(tg*ig)/ig;case"floor":return Math.floor(tg*ig)/ig;case"ceil":return Math.ceil(tg*ig)/ig;default:throw new RangeError(`Value rounding ${gg} is out of range`)}}function isLeapYear(tg){return tg%4===0&&(tg%100!==0||tg%400===0)}function daysInYear(tg){return isLeapYear(tg)?366:365}function daysInMonth(tg,eg){const gg=floorMod(eg-1,12)+1,ig=tg+(eg-gg)/12;return gg===2?isLeapYear(ig)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][gg-1]}function objToLocalTS(tg){let eg=Date.UTC(tg.year,tg.month-1,tg.day,tg.hour,tg.minute,tg.second,tg.millisecond);return tg.year<100&&tg.year>=0&&(eg=new Date(eg),eg.setUTCFullYear(tg.year,tg.month-1,tg.day)),+eg}function firstWeekOffset(tg,eg,gg){return-isoWeekdayToLocal(dayOfWeek(tg,1,eg),gg)+eg-1}function weeksInWeekYear(tg,eg=4,gg=1){const ig=firstWeekOffset(tg,eg,gg),ng=firstWeekOffset(tg+1,eg,gg);return(daysInYear(tg)-ig+ng)/7}function untruncateYear(tg){return tg>99?tg:tg>Settings.twoDigitCutoffYear?1900+tg:2e3+tg}function parseZoneInfo(tg,eg,gg,ig=null){const ng=new Date(tg),og={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};ig&&(og.timeZone=ig);const ag={timeZoneName:eg,...og},Ig=new Intl.DateTimeFormat(gg,ag).formatToParts(ng).find(sg=>sg.type.toLowerCase()==="timezonename");return Ig?Ig.value:null}function signedOffset(tg,eg){let gg=parseInt(tg,10);Number.isNaN(gg)&&(gg=0);const ig=parseInt(eg,10)||0,ng=gg<0||Object.is(gg,-0)?-ig:ig;return gg*60+ng}function asNumber(tg){const eg=Number(tg);if(typeof tg=="boolean"||tg===""||!Number.isFinite(eg))throw new InvalidArgumentError(`Invalid unit value ${tg}`);return eg}function normalizeObject(tg,eg){const gg={};for(const ig in tg)if(hasOwnProperty(tg,ig)){const ng=tg[ig];if(ng==null)continue;gg[eg(ig)]=asNumber(ng)}return gg}function formatOffset(tg,eg){const gg=Math.trunc(Math.abs(tg/60)),ig=Math.trunc(Math.abs(tg%60)),ng=tg>=0?"+":"-";switch(eg){case"short":return`${ng}${padStart(gg,2)}:${padStart(ig,2)}`;case"narrow":return`${ng}${gg}${ig>0?`:${ig}`:""}`;case"techie":return`${ng}${padStart(gg,2)}${padStart(ig,2)}`;default:throw new RangeError(`Value format ${eg} is out of range for property format`)}}function timeObject(tg){return pick(tg,["hour","minute","second","millisecond"])}const monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(tg){switch(tg){case"narrow":return[...monthsNarrow];case"short":return[...monthsShort];case"long":return[...monthsLong];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(tg){switch(tg){case"narrow":return[...weekdaysNarrow];case"short":return[...weekdaysShort];case"long":return[...weekdaysLong];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const meridiems=["AM","PM"],erasLong=["Before Christ","Anno Domini"],erasShort=["BC","AD"],erasNarrow=["B","A"];function eras(tg){switch(tg){case"narrow":return[...erasNarrow];case"short":return[...erasShort];case"long":return[...erasLong];default:return null}}function meridiemForDateTime(tg){return meridiems[tg.hour<12?0:1]}function weekdayForDateTime(tg,eg){return weekdays(eg)[tg.weekday-1]}function monthForDateTime(tg,eg){return months(eg)[tg.month-1]}function eraForDateTime(tg,eg){return eras(eg)[tg.year<0?0:1]}function formatRelativeTime(tg,eg,gg="always",ig=!1){const ng={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},og=["hours","minutes","seconds"].indexOf(tg)===-1;if(gg==="auto"&&og){const Ag=tg==="days";switch(eg){case 1:return Ag?"tomorrow":`next ${ng[tg][0]}`;case-1:return Ag?"yesterday":`last ${ng[tg][0]}`;case 0:return Ag?"today":`this ${ng[tg][0]}`}}const ag=Object.is(eg,-0)||eg<0,Ig=Math.abs(eg),sg=Ig===1,Cg=ng[tg],lg=ig?sg?Cg[1]:Cg[2]||Cg[1]:sg?ng[tg][0]:tg;return ag?`${Ig} ${lg} ago`:`in ${Ig} ${lg}`}function stringifyTokens(tg,eg){let gg="";for(const ig of tg)ig.literal?gg+=ig.val:gg+=eg(ig.val);return gg}const macroTokenToFormatOpts={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS};class Formatter{static create(eg,gg={}){return new Formatter(eg,gg)}static parseFormat(eg){let gg=null,ig="",ng=!1;const og=[];for(let ag=0;ag<eg.length;ag++){const Ig=eg.charAt(ag);Ig==="'"?((ig.length>0||ng)&&og.push({literal:ng||/^\s+$/.test(ig),val:ig===""?"'":ig}),gg=null,ig="",ng=!ng):ng||Ig===gg?ig+=Ig:(ig.length>0&&og.push({literal:/^\s+$/.test(ig),val:ig}),ig=Ig,gg=Ig)}return ig.length>0&&og.push({literal:ng||/^\s+$/.test(ig),val:ig}),og}static macroTokenToFormatOpts(eg){return macroTokenToFormatOpts[eg]}constructor(eg,gg){this.opts=gg,this.loc=eg,this.systemLoc=null}formatWithSystemDefault(eg,gg){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(eg,{...this.opts,...gg}).format()}dtFormatter(eg,gg={}){return this.loc.dtFormatter(eg,{...this.opts,...gg})}formatDateTime(eg,gg){return this.dtFormatter(eg,gg).format()}formatDateTimeParts(eg,gg){return this.dtFormatter(eg,gg).formatToParts()}formatInterval(eg,gg){return this.dtFormatter(eg.start,gg).dtf.formatRange(eg.start.toJSDate(),eg.end.toJSDate())}resolvedOptions(eg,gg){return this.dtFormatter(eg,gg).resolvedOptions()}num(eg,gg=0,ig=void 0){if(this.opts.forceSimple)return padStart(eg,gg);const ng={...this.opts};return gg>0&&(ng.padTo=gg),ig&&(ng.signDisplay=ig),this.loc.numberFormatter(ng).format(eg)}formatDateTimeFromString(eg,gg){const ig=this.loc.listingMode()==="en",ng=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",og=(rg,ug)=>this.loc.extract(eg,rg,ug),ag=rg=>eg.isOffsetFixed&&eg.offset===0&&rg.allowZ?"Z":eg.isValid?eg.zone.formatOffset(eg.ts,rg.format):"",Ig=()=>ig?meridiemForDateTime(eg):og({hour:"numeric",hourCycle:"h12"},"dayperiod"),sg=(rg,ug)=>ig?monthForDateTime(eg,rg):og(ug?{month:rg}:{month:rg,day:"numeric"},"month"),Cg=(rg,ug)=>ig?weekdayForDateTime(eg,rg):og(ug?{weekday:rg}:{weekday:rg,month:"long",day:"numeric"},"weekday"),lg=rg=>{const ug=Formatter.macroTokenToFormatOpts(rg);return ug?this.formatWithSystemDefault(eg,ug):rg},Ag=rg=>ig?eraForDateTime(eg,rg):og({era:rg},"era"),cg=rg=>{switch(rg){case"S":return this.num(eg.millisecond);case"u":case"SSS":return this.num(eg.millisecond,3);case"s":return this.num(eg.second);case"ss":return this.num(eg.second,2);case"uu":return this.num(Math.floor(eg.millisecond/10),2);case"uuu":return this.num(Math.floor(eg.millisecond/100));case"m":return this.num(eg.minute);case"mm":return this.num(eg.minute,2);case"h":return this.num(eg.hour%12===0?12:eg.hour%12);case"hh":return this.num(eg.hour%12===0?12:eg.hour%12,2);case"H":return this.num(eg.hour);case"HH":return this.num(eg.hour,2);case"Z":return ag({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ag({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ag({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return eg.zone.offsetName(eg.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return eg.zone.offsetName(eg.ts,{format:"long",locale:this.loc.locale});case"z":return eg.zoneName;case"a":return Ig();case"d":return ng?og({day:"numeric"},"day"):this.num(eg.day);case"dd":return ng?og({day:"2-digit"},"day"):this.num(eg.day,2);case"c":return this.num(eg.weekday);case"ccc":return Cg("short",!0);case"cccc":return Cg("long",!0);case"ccccc":return Cg("narrow",!0);case"E":return this.num(eg.weekday);case"EEE":return Cg("short",!1);case"EEEE":return Cg("long",!1);case"EEEEE":return Cg("narrow",!1);case"L":return ng?og({month:"numeric",day:"numeric"},"month"):this.num(eg.month);case"LL":return ng?og({month:"2-digit",day:"numeric"},"month"):this.num(eg.month,2);case"LLL":return sg("short",!0);case"LLLL":return sg("long",!0);case"LLLLL":return sg("narrow",!0);case"M":return ng?og({month:"numeric"},"month"):this.num(eg.month);case"MM":return ng?og({month:"2-digit"},"month"):this.num(eg.month,2);case"MMM":return sg("short",!1);case"MMMM":return sg("long",!1);case"MMMMM":return sg("narrow",!1);case"y":return ng?og({year:"numeric"},"year"):this.num(eg.year);case"yy":return ng?og({year:"2-digit"},"year"):this.num(eg.year.toString().slice(-2),2);case"yyyy":return ng?og({year:"numeric"},"year"):this.num(eg.year,4);case"yyyyyy":return ng?og({year:"numeric"},"year"):this.num(eg.year,6);case"G":return Ag("short");case"GG":return Ag("long");case"GGGGG":return Ag("narrow");case"kk":return this.num(eg.weekYear.toString().slice(-2),2);case"kkkk":return this.num(eg.weekYear,4);case"W":return this.num(eg.weekNumber);case"WW":return this.num(eg.weekNumber,2);case"n":return this.num(eg.localWeekNumber);case"nn":return this.num(eg.localWeekNumber,2);case"ii":return this.num(eg.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(eg.localWeekYear,4);case"o":return this.num(eg.ordinal);case"ooo":return this.num(eg.ordinal,3);case"q":return this.num(eg.quarter);case"qq":return this.num(eg.quarter,2);case"X":return this.num(Math.floor(eg.ts/1e3));case"x":return this.num(eg.ts);default:return lg(rg)}};return stringifyTokens(Formatter.parseFormat(gg),cg)}formatDurationFromString(eg,gg){const ig=this.opts.signMode==="negativeLargestOnly"?-1:1,ng=lg=>{switch(lg[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},og=(lg,Ag)=>cg=>{const rg=ng(cg);if(rg){const ug=Ag.isNegativeDuration&&rg!==Ag.largestUnit?ig:1;let dg;return this.opts.signMode==="negativeLargestOnly"&&rg!==Ag.largestUnit?dg="never":this.opts.signMode==="all"?dg="always":dg="auto",this.num(lg.get(rg)*ug,cg.length,dg)}else return cg},ag=Formatter.parseFormat(gg),Ig=ag.reduce((lg,{literal:Ag,val:cg})=>Ag?lg:lg.concat(cg),[]),sg=eg.shiftTo(...Ig.map(ng).filter(lg=>lg)),Cg={isNegativeDuration:sg<0,largestUnit:Object.keys(sg.values)[0]};return stringifyTokens(ag,og(sg,Cg))}}const ianaRegex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...tg){const eg=tg.reduce((gg,ig)=>gg+ig.source,"");return RegExp(`^${eg}$`)}function combineExtractors(...tg){return eg=>tg.reduce(([gg,ig,ng],og)=>{const[ag,Ig,sg]=og(eg,ng);return[{...gg,...ag},Ig||ig,sg]},[{},null,1]).slice(0,2)}function parse(tg,...eg){if(tg==null)return[null,null];for(const[gg,ig]of eg){const ng=gg.exec(tg);if(ng)return ig(ng)}return[null,null]}function simpleParse(...tg){return(eg,gg)=>{const ig={};let ng;for(ng=0;ng<tg.length;ng++)ig[tg[ng]]=parseInteger(eg[gg+ng]);return[ig,null,gg+ng]}}const offsetRegex=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,isoExtendedZone=`(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`,isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,isoTimeRegex=RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`),isoTimeExtensionRegex=RegExp(`(?:[Tt]${isoTimeRegex.source})?`),isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/,isoOrdinalRegex=/(\d{4})-?(\d{3})/,extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay"),extractISOOrdinalData=simpleParse("year","ordinal"),sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/,sqlTimeRegex=RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`),sqlTimeExtensionRegex=RegExp(`(?: ${sqlTimeRegex.source})?`);function int(tg,eg,gg){const ig=tg[eg];return isUndefined$1(ig)?gg:parseInteger(ig)}function extractISOYmd(tg,eg){return[{year:int(tg,eg),month:int(tg,eg+1,1),day:int(tg,eg+2,1)},null,eg+3]}function extractISOTime(tg,eg){return[{hours:int(tg,eg,0),minutes:int(tg,eg+1,0),seconds:int(tg,eg+2,0),milliseconds:parseMillis(tg[eg+3])},null,eg+4]}function extractISOOffset(tg,eg){const gg=!tg[eg]&&!tg[eg+1],ig=signedOffset(tg[eg+1],tg[eg+2]),ng=gg?null:FixedOffsetZone.instance(ig);return[{},ng,eg+3]}function extractIANAZone(tg,eg){const gg=tg[eg]?IANAZone.create(tg[eg]):null;return[{},gg,eg+1]}const isoTimeOnly=RegExp(`^T?${isoTimeBaseRegex.source}$`),isoDuration=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(tg){const[eg,gg,ig,ng,og,ag,Ig,sg,Cg]=tg,lg=eg[0]==="-",Ag=sg&&sg[0]==="-",cg=(rg,ug=!1)=>rg!==void 0&&(ug||rg&&lg)?-rg:rg;return[{years:cg(parseFloating(gg)),months:cg(parseFloating(ig)),weeks:cg(parseFloating(ng)),days:cg(parseFloating(og)),hours:cg(parseFloating(ag)),minutes:cg(parseFloating(Ig)),seconds:cg(parseFloating(sg),sg==="-0"),milliseconds:cg(parseMillis(Cg),Ag)}]}const obsOffsets={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(tg,eg,gg,ig,ng,og,ag){const Ig={year:eg.length===2?untruncateYear(parseInteger(eg)):parseInteger(eg),month:monthsShort.indexOf(gg)+1,day:parseInteger(ig),hour:parseInteger(ng),minute:parseInteger(og)};return ag&&(Ig.second=parseInteger(ag)),tg&&(Ig.weekday=tg.length>3?weekdaysLong.indexOf(tg)+1:weekdaysShort.indexOf(tg)+1),Ig}const rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(tg){const[,eg,gg,ig,ng,og,ag,Ig,sg,Cg,lg,Ag]=tg,cg=fromStrings(eg,ng,ig,gg,og,ag,Ig);let rg;return sg?rg=obsOffsets[sg]:Cg?rg=0:rg=signedOffset(lg,Ag),[cg,new FixedOffsetZone(rg)]}function preprocessRFC2822(tg){return tg.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(tg){const[,eg,gg,ig,ng,og,ag,Ig]=tg;return[fromStrings(eg,ng,ig,gg,og,ag,Ig),FixedOffsetZone.utcInstance]}function extractASCII(tg){const[,eg,gg,ig,ng,og,ag,Ig]=tg;return[fromStrings(eg,Ig,gg,ig,ng,og,ag),FixedOffsetZone.utcInstance]}const isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex),isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex),isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex),isoTimeCombinedRegex=combineRegexes(isoTimeRegex),extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset,extractIANAZone),extractISOOrdinalDateAndTime=combineExtractors(extractISOOrdinalData,extractISOTime,extractISOOffset,extractIANAZone),extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(tg){return parse(tg,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDateAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset])}function parseRFC2822Date(tg){return parse(preprocessRFC2822(tg),[rfc2822,extractRFC2822])}function parseHTTPDate(tg){return parse(tg,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII])}function parseISODuration(tg){return parse(tg,[isoDuration,extractISODuration])}const extractISOTimeOnly=combineExtractors(extractISOTime);function parseISOTimeOnly(tg){return parse(tg,[isoTimeOnly,extractISOTimeOnly])}const sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex),sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex),extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(tg){return parse(tg,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone])}const INVALID$2="Invalid Duration",lowOrderMatrix={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},casualMatrix={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...lowOrderMatrix},daysInYearAccurate=146097/400,daysInMonthAccurate=146097/4800,accurateMatrix={years:{quarters:4,months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:daysInYearAccurate*24,minutes:daysInYearAccurate*24*60,seconds:daysInYearAccurate*24*60*60,milliseconds:daysInYearAccurate*24*60*60*1e3},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:daysInYearAccurate*24/4,minutes:daysInYearAccurate*24*60/4,seconds:daysInYearAccurate*24*60*60/4,milliseconds:daysInYearAccurate*24*60*60*1e3/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:daysInMonthAccurate*24,minutes:daysInMonthAccurate*24*60,seconds:daysInMonthAccurate*24*60*60,milliseconds:daysInMonthAccurate*24*60*60*1e3},...lowOrderMatrix},orderedUnits$1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],reverseUnits=orderedUnits$1.slice(0).reverse();function clone$1(tg,eg,gg=!1){const ig={values:gg?eg.values:{...tg.values,...eg.values||{}},loc:tg.loc.clone(eg.loc),conversionAccuracy:eg.conversionAccuracy||tg.conversionAccuracy,matrix:eg.matrix||tg.matrix};return new Duration(ig)}function durationToMillis(tg,eg){let gg=eg.milliseconds??0;for(const ig of reverseUnits.slice(1))eg[ig]&&(gg+=eg[ig]*tg[ig].milliseconds);return gg}function normalizeValues(tg,eg){const gg=durationToMillis(tg,eg)<0?-1:1;orderedUnits$1.reduceRight((ig,ng)=>{if(isUndefined$1(eg[ng]))return ig;if(ig){const og=eg[ig]*gg,ag=tg[ng][ig],Ig=Math.floor(og/ag);eg[ng]+=Ig*gg,eg[ig]-=Ig*ag*gg}return ng},null),orderedUnits$1.reduce((ig,ng)=>{if(isUndefined$1(eg[ng]))return ig;if(ig){const og=eg[ig]%1;eg[ig]-=og,eg[ng]+=og*tg[ig][ng]}return ng},null)}function removeZeroes(tg){const eg={};for(const[gg,ig]of Object.entries(tg))ig!==0&&(eg[gg]=ig);return eg}class Duration{constructor(eg){const gg=eg.conversionAccuracy==="longterm"||!1;let ig=gg?accurateMatrix:casualMatrix;eg.matrix&&(ig=eg.matrix),this.values=eg.values,this.loc=eg.loc||Locale.create(),this.conversionAccuracy=gg?"longterm":"casual",this.invalid=eg.invalid||null,this.matrix=ig,this.isLuxonDuration=!0}static fromMillis(eg,gg){return Duration.fromObject({milliseconds:eg},gg)}static fromObject(eg,gg={}){if(eg==null||typeof eg!="object")throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${eg===null?"null":typeof eg}`);return new Duration({values:normalizeObject(eg,Duration.normalizeUnit),loc:Locale.fromObject(gg),conversionAccuracy:gg.conversionAccuracy,matrix:gg.matrix})}static fromDurationLike(eg){if(isNumber$1(eg))return Duration.fromMillis(eg);if(Duration.isDuration(eg))return eg;if(typeof eg=="object")return Duration.fromObject(eg);throw new InvalidArgumentError(`Unknown duration argument ${eg} of type ${typeof eg}`)}static fromISO(eg,gg){const[ig]=parseISODuration(eg);return ig?Duration.fromObject(ig,gg):Duration.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static fromISOTime(eg,gg){const[ig]=parseISOTimeOnly(eg);return ig?Duration.fromObject(ig,gg):Duration.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidDurationError(ig);return new Duration({invalid:ig})}static normalizeUnit(eg){const gg={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[eg&&eg.toLowerCase()];if(!gg)throw new InvalidUnitError(eg);return gg}static isDuration(eg){return eg&&eg.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(eg,gg={}){const ig={...gg,floor:gg.round!==!1&&gg.floor!==!1};return this.isValid?Formatter.create(this.loc,ig).formatDurationFromString(this,eg):INVALID$2}toHuman(eg={}){if(!this.isValid)return INVALID$2;const gg=eg.showZeros!==!1,ig=orderedUnits$1.map(ng=>{const og=this.values[ng];return isUndefined$1(og)||og===0&&!gg?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...eg,unit:ng.slice(0,-1)}).format(og)}).filter(ng=>ng);return this.loc.listFormatter({type:"conjunction",style:eg.listStyle||"narrow",...eg}).format(ig)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let eg="P";return this.years!==0&&(eg+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(eg+=this.months+this.quarters*3+"M"),this.weeks!==0&&(eg+=this.weeks+"W"),this.days!==0&&(eg+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(eg+="T"),this.hours!==0&&(eg+=this.hours+"H"),this.minutes!==0&&(eg+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(eg+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),eg==="P"&&(eg+="T0S"),eg}toISOTime(eg={}){if(!this.isValid)return null;const gg=this.toMillis();return gg<0||gg>=864e5?null:(eg={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...eg,includeOffset:!1},DateTime.fromMillis(gg,{zone:"UTC"}).toISOTime(eg))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?durationToMillis(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg),ig={};for(const ng of orderedUnits$1)(hasOwnProperty(gg.values,ng)||hasOwnProperty(this.values,ng))&&(ig[ng]=gg.get(ng)+this.get(ng));return clone$1(this,{values:ig},!0)}minus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg);return this.plus(gg.negate())}mapUnits(eg){if(!this.isValid)return this;const gg={};for(const ig of Object.keys(this.values))gg[ig]=asNumber(eg(this.values[ig],ig));return clone$1(this,{values:gg},!0)}get(eg){return this[Duration.normalizeUnit(eg)]}set(eg){if(!this.isValid)return this;const gg={...this.values,...normalizeObject(eg,Duration.normalizeUnit)};return clone$1(this,{values:gg})}reconfigure({locale:eg,numberingSystem:gg,conversionAccuracy:ig,matrix:ng}={}){const ag={loc:this.loc.clone({locale:eg,numberingSystem:gg}),matrix:ng,conversionAccuracy:ig};return clone$1(this,ag)}as(eg){return this.isValid?this.shiftTo(eg).get(eg):NaN}normalize(){if(!this.isValid)return this;const eg=this.toObject();return normalizeValues(this.matrix,eg),clone$1(this,{values:eg},!0)}rescale(){if(!this.isValid)return this;const eg=removeZeroes(this.normalize().shiftToAll().toObject());return clone$1(this,{values:eg},!0)}shiftTo(...eg){if(!this.isValid)return this;if(eg.length===0)return this;eg=eg.map(ag=>Duration.normalizeUnit(ag));const gg={},ig={},ng=this.toObject();let og;for(const ag of orderedUnits$1)if(eg.indexOf(ag)>=0){og=ag;let Ig=0;for(const Cg in ig)Ig+=this.matrix[Cg][ag]*ig[Cg],ig[Cg]=0;isNumber$1(ng[ag])&&(Ig+=ng[ag]);const sg=Math.trunc(Ig);gg[ag]=sg,ig[ag]=(Ig*1e3-sg*1e3)/1e3}else isNumber$1(ng[ag])&&(ig[ag]=ng[ag]);for(const ag in ig)ig[ag]!==0&&(gg[og]+=ag===og?ig[ag]:ig[ag]/this.matrix[og][ag]);return normalizeValues(this.matrix,gg),clone$1(this,{values:gg},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const eg={};for(const gg of Object.keys(this.values))eg[gg]=this.values[gg]===0?0:-this.values[gg];return clone$1(this,{values:eg},!0)}removeZeros(){if(!this.isValid)return this;const eg=removeZeroes(this.values);return clone$1(this,{values:eg},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(eg){if(!this.isValid||!eg.isValid||!this.loc.equals(eg.loc))return!1;function gg(ig,ng){return ig===void 0||ig===0?ng===void 0||ng===0:ig===ng}for(const ig of orderedUnits$1)if(!gg(this.values[ig],eg.values[ig]))return!1;return!0}}const INVALID$1="Invalid Interval";function validateStartEnd(tg,eg){return!tg||!tg.isValid?Interval.invalid("missing or invalid start"):!eg||!eg.isValid?Interval.invalid("missing or invalid end"):eg<tg?Interval.invalid("end before start",`The end of an interval must be after its start, but you had start=${tg.toISO()} and end=${eg.toISO()}`):null}class Interval{constructor(eg){this.s=eg.start,this.e=eg.end,this.invalid=eg.invalid||null,this.isLuxonInterval=!0}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidIntervalError(ig);return new Interval({invalid:ig})}static fromDateTimes(eg,gg){const ig=friendlyDateTime(eg),ng=friendlyDateTime(gg),og=validateStartEnd(ig,ng);return og??new Interval({start:ig,end:ng})}static after(eg,gg){const ig=Duration.fromDurationLike(gg),ng=friendlyDateTime(eg);return Interval.fromDateTimes(ng,ng.plus(ig))}static before(eg,gg){const ig=Duration.fromDurationLike(gg),ng=friendlyDateTime(eg);return Interval.fromDateTimes(ng.minus(ig),ng)}static fromISO(eg,gg){const[ig,ng]=(eg||"").split("/",2);if(ig&&ng){let og,ag;try{og=DateTime.fromISO(ig,gg),ag=og.isValid}catch{ag=!1}let Ig,sg;try{Ig=DateTime.fromISO(ng,gg),sg=Ig.isValid}catch{sg=!1}if(ag&&sg)return Interval.fromDateTimes(og,Ig);if(ag){const Cg=Duration.fromISO(ng,gg);if(Cg.isValid)return Interval.after(og,Cg)}else if(sg){const Cg=Duration.fromISO(ig,gg);if(Cg.isValid)return Interval.before(Ig,Cg)}}return Interval.invalid("unparsable",`the input "${eg}" can't be parsed as ISO 8601`)}static isInterval(eg){return eg&&eg.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(eg="milliseconds"){return this.isValid?this.toDuration(eg).get(eg):NaN}count(eg="milliseconds",gg){if(!this.isValid)return NaN;const ig=this.start.startOf(eg,gg);let ng;return gg!=null&&gg.useLocaleWeeks?ng=this.end.reconfigure({locale:ig.locale}):ng=this.end,ng=ng.startOf(eg,gg),Math.floor(ng.diff(ig,eg).get(eg))+(ng.valueOf()!==this.end.valueOf())}hasSame(eg){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,eg):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(eg){return this.isValid?this.s>eg:!1}isBefore(eg){return this.isValid?this.e<=eg:!1}contains(eg){return this.isValid?this.s<=eg&&this.e>eg:!1}set({start:eg,end:gg}={}){return this.isValid?Interval.fromDateTimes(eg||this.s,gg||this.e):this}splitAt(...eg){if(!this.isValid)return[];const gg=eg.map(friendlyDateTime).filter(ag=>this.contains(ag)).sort((ag,Ig)=>ag.toMillis()-Ig.toMillis()),ig=[];let{s:ng}=this,og=0;for(;ng<this.e;){const ag=gg[og]||this.e,Ig=+ag>+this.e?this.e:ag;ig.push(Interval.fromDateTimes(ng,Ig)),ng=Ig,og+=1}return ig}splitBy(eg){const gg=Duration.fromDurationLike(eg);if(!this.isValid||!gg.isValid||gg.as("milliseconds")===0)return[];let{s:ig}=this,ng=1,og;const ag=[];for(;ig<this.e;){const Ig=this.start.plus(gg.mapUnits(sg=>sg*ng));og=+Ig>+this.e?this.e:Ig,ag.push(Interval.fromDateTimes(ig,og)),ig=og,ng+=1}return ag}divideEqually(eg){return this.isValid?this.splitBy(this.length()/eg).slice(0,eg):[]}overlaps(eg){return this.e>eg.s&&this.s<eg.e}abutsStart(eg){return this.isValid?+this.e==+eg.s:!1}abutsEnd(eg){return this.isValid?+eg.e==+this.s:!1}engulfs(eg){return this.isValid?this.s<=eg.s&&this.e>=eg.e:!1}equals(eg){return!this.isValid||!eg.isValid?!1:this.s.equals(eg.s)&&this.e.equals(eg.e)}intersection(eg){if(!this.isValid)return this;const gg=this.s>eg.s?this.s:eg.s,ig=this.e<eg.e?this.e:eg.e;return gg>=ig?null:Interval.fromDateTimes(gg,ig)}union(eg){if(!this.isValid)return this;const gg=this.s<eg.s?this.s:eg.s,ig=this.e>eg.e?this.e:eg.e;return Interval.fromDateTimes(gg,ig)}static merge(eg){const[gg,ig]=eg.sort((ng,og)=>ng.s-og.s).reduce(([ng,og],ag)=>og?og.overlaps(ag)||og.abutsStart(ag)?[ng,og.union(ag)]:[ng.concat([og]),ag]:[ng,ag],[[],null]);return ig&&gg.push(ig),gg}static xor(eg){let gg=null,ig=0;const ng=[],og=eg.map(sg=>[{time:sg.s,type:"s"},{time:sg.e,type:"e"}]),ag=Array.prototype.concat(...og),Ig=ag.sort((sg,Cg)=>sg.time-Cg.time);for(const sg of Ig)ig+=sg.type==="s"?1:-1,ig===1?gg=sg.time:(gg&&+gg!=+sg.time&&ng.push(Interval.fromDateTimes(gg,sg.time)),gg=null);return Interval.merge(ng)}difference(...eg){return Interval.xor([this].concat(eg)).map(gg=>this.intersection(gg)).filter(gg=>gg&&!gg.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:INVALID$1}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(eg=DATE_SHORT,gg={}){return this.isValid?Formatter.create(this.s.loc.clone(gg),eg).formatInterval(this):INVALID$1}toISO(eg){return this.isValid?`${this.s.toISO(eg)}/${this.e.toISO(eg)}`:INVALID$1}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:INVALID$1}toISOTime(eg){return this.isValid?`${this.s.toISOTime(eg)}/${this.e.toISOTime(eg)}`:INVALID$1}toFormat(eg,{separator:gg=" – "}={}){return this.isValid?`${this.s.toFormat(eg)}${gg}${this.e.toFormat(eg)}`:INVALID$1}toDuration(eg,gg){return this.isValid?this.e.diff(this.s,eg,gg):Duration.invalid(this.invalidReason)}mapEndpoints(eg){return Interval.fromDateTimes(eg(this.s),eg(this.e))}}class Info{static hasDST(eg=Settings.defaultZone){const gg=DateTime.now().setZone(eg).set({month:12});return!eg.isUniversal&&gg.offset!==gg.set({month:6}).offset}static isValidIANAZone(eg){return IANAZone.isValidZone(eg)}static normalizeZone(eg){return normalizeZone(eg,Settings.defaultZone)}static getStartOfWeek({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:eg=null,locObj:gg=null}={}){return(gg||Locale.create(eg)).getWeekendDays().slice()}static months(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null,outputCalendar:og="gregory"}={}){return(ng||Locale.create(gg,ig,og)).months(eg)}static monthsFormat(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null,outputCalendar:og="gregory"}={}){return(ng||Locale.create(gg,ig,og)).months(eg,!0)}static weekdays(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null}={}){return(ng||Locale.create(gg,ig,null)).weekdays(eg)}static weekdaysFormat(eg="long",{locale:gg=null,numberingSystem:ig=null,locObj:ng=null}={}){return(ng||Locale.create(gg,ig,null)).weekdays(eg,!0)}static meridiems({locale:eg=null}={}){return Locale.create(eg).meridiems()}static eras(eg="short",{locale:gg=null}={}){return Locale.create(gg,null,"gregory").eras(eg)}static features(){return{relative:hasRelative(),localeWeek:hasLocaleWeekInfo()}}}function dayDiff(tg,eg){const gg=ng=>ng.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),ig=gg(eg)-gg(tg);return Math.floor(Duration.fromMillis(ig).as("days"))}function highOrderDiffs(tg,eg,gg){const ig=[["years",(sg,Cg)=>Cg.year-sg.year],["quarters",(sg,Cg)=>Cg.quarter-sg.quarter+(Cg.year-sg.year)*4],["months",(sg,Cg)=>Cg.month-sg.month+(Cg.year-sg.year)*12],["weeks",(sg,Cg)=>{const lg=dayDiff(sg,Cg);return(lg-lg%7)/7}],["days",dayDiff]],ng={},og=tg;let ag,Ig;for(const[sg,Cg]of ig)gg.indexOf(sg)>=0&&(ag=sg,ng[sg]=Cg(tg,eg),Ig=og.plus(ng),Ig>eg?(ng[sg]--,tg=og.plus(ng),tg>eg&&(Ig=tg,ng[sg]--,tg=og.plus(ng))):tg=Ig);return[tg,ng,Ig,ag]}function diff(tg,eg,gg,ig){let[ng,og,ag,Ig]=highOrderDiffs(tg,eg,gg);const sg=eg-ng,Cg=gg.filter(Ag=>["hours","minutes","seconds","milliseconds"].indexOf(Ag)>=0);Cg.length===0&&(ag<eg&&(ag=ng.plus({[Ig]:1})),ag!==ng&&(og[Ig]=(og[Ig]||0)+sg/(ag-ng)));const lg=Duration.fromObject(og,ig);return Cg.length>0?Duration.fromMillis(sg,ig).shiftTo(...Cg).plus(lg):lg}const MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(tg,eg=gg=>gg){return{regex:tg,deser:([gg])=>eg(parseDigits(gg))}}const NBSP=" ",spaceOrNBSP=`[ ${NBSP}]`,spaceOrNBSPRegExp=new RegExp(spaceOrNBSP,"g");function fixListRegex(tg){return tg.replace(/\./g,"\\.?").replace(spaceOrNBSPRegExp,spaceOrNBSP)}function stripInsensitivities(tg){return tg.replace(/\./g,"").replace(spaceOrNBSPRegExp," ").toLowerCase()}function oneOf(tg,eg){return tg===null?null:{regex:RegExp(tg.map(fixListRegex).join("|")),deser:([gg])=>tg.findIndex(ig=>stripInsensitivities(gg)===stripInsensitivities(ig))+eg}}function offset(tg,eg){return{regex:tg,deser:([,gg,ig])=>signedOffset(gg,ig),groups:eg}}function simple(tg){return{regex:tg,deser:([eg])=>eg}}function escapeToken(tg){return tg.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function unitForToken(tg,eg){const gg=digitRegex(eg),ig=digitRegex(eg,"{2}"),ng=digitRegex(eg,"{3}"),og=digitRegex(eg,"{4}"),ag=digitRegex(eg,"{6}"),Ig=digitRegex(eg,"{1,2}"),sg=digitRegex(eg,"{1,3}"),Cg=digitRegex(eg,"{1,6}"),lg=digitRegex(eg,"{1,9}"),Ag=digitRegex(eg,"{2,4}"),cg=digitRegex(eg,"{4,6}"),rg=bg=>({regex:RegExp(escapeToken(bg.val)),deser:([mg])=>mg,literal:!0}),dg=(bg=>{if(tg.literal)return rg(bg);switch(bg.val){case"G":return oneOf(eg.eras("short"),0);case"GG":return oneOf(eg.eras("long"),0);case"y":return intUnit(Cg);case"yy":return intUnit(Ag,untruncateYear);case"yyyy":return intUnit(og);case"yyyyy":return intUnit(cg);case"yyyyyy":return intUnit(ag);case"M":return intUnit(Ig);case"MM":return intUnit(ig);case"MMM":return oneOf(eg.months("short",!0),1);case"MMMM":return oneOf(eg.months("long",!0),1);case"L":return intUnit(Ig);case"LL":return intUnit(ig);case"LLL":return oneOf(eg.months("short",!1),1);case"LLLL":return oneOf(eg.months("long",!1),1);case"d":return intUnit(Ig);case"dd":return intUnit(ig);case"o":return intUnit(sg);case"ooo":return intUnit(ng);case"HH":return intUnit(ig);case"H":return intUnit(Ig);case"hh":return intUnit(ig);case"h":return intUnit(Ig);case"mm":return intUnit(ig);case"m":return intUnit(Ig);case"q":return intUnit(Ig);case"qq":return intUnit(ig);case"s":return intUnit(Ig);case"ss":return intUnit(ig);case"S":return intUnit(sg);case"SSS":return intUnit(ng);case"u":return simple(lg);case"uu":return simple(Ig);case"uuu":return intUnit(gg);case"a":return oneOf(eg.meridiems(),0);case"kkkk":return intUnit(og);case"kk":return intUnit(Ag,untruncateYear);case"W":return intUnit(Ig);case"WW":return intUnit(ig);case"E":case"c":return intUnit(gg);case"EEE":return oneOf(eg.weekdays("short",!1),1);case"EEEE":return oneOf(eg.weekdays("long",!1),1);case"ccc":return oneOf(eg.weekdays("short",!0),1);case"cccc":return oneOf(eg.weekdays("long",!0),1);case"Z":case"ZZ":return offset(new RegExp(`([+-]${Ig.source})(?::(${ig.source}))?`),2);case"ZZZ":return offset(new RegExp(`([+-]${Ig.source})(${ig.source})?`),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);case" ":return simple(/[^\S\n\r]/);default:return rg(bg)}})(tg)||{invalidReason:MISSING_FTP};return dg.token=tg,dg}const partTypeStyleToTokenVal={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function tokenForPart(tg,eg,gg){const{type:ig,value:ng}=tg;if(ig==="literal"){const sg=/^\s+$/.test(ng);return{literal:!sg,val:sg?" ":ng}}const og=eg[ig];let ag=ig;ig==="hour"&&(eg.hour12!=null?ag=eg.hour12?"hour12":"hour24":eg.hourCycle!=null?eg.hourCycle==="h11"||eg.hourCycle==="h12"?ag="hour12":ag="hour24":ag=gg.hour12?"hour12":"hour24");let Ig=partTypeStyleToTokenVal[ag];if(typeof Ig=="object"&&(Ig=Ig[og]),Ig)return{literal:!1,val:Ig}}function buildRegex(tg){return[`^${tg.map(gg=>gg.regex).reduce((gg,ig)=>`${gg}(${ig.source})`,"")}$`,tg]}function match(tg,eg,gg){const ig=tg.match(eg);if(ig){const ng={};let og=1;for(const ag in gg)if(hasOwnProperty(gg,ag)){const Ig=gg[ag],sg=Ig.groups?Ig.groups+1:1;!Ig.literal&&Ig.token&&(ng[Ig.token.val[0]]=Ig.deser(ig.slice(og,og+sg))),og+=sg}return[ig,ng]}else return[ig,{}]}function dateTimeFromMatches(tg){const eg=og=>{switch(og){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let gg=null,ig;return isUndefined$1(tg.z)||(gg=IANAZone.create(tg.z)),isUndefined$1(tg.Z)||(gg||(gg=new FixedOffsetZone(tg.Z)),ig=tg.Z),isUndefined$1(tg.q)||(tg.M=(tg.q-1)*3+1),isUndefined$1(tg.h)||(tg.h<12&&tg.a===1?tg.h+=12:tg.h===12&&tg.a===0&&(tg.h=0)),tg.G===0&&tg.y&&(tg.y=-tg.y),isUndefined$1(tg.u)||(tg.S=parseMillis(tg.u)),[Object.keys(tg).reduce((og,ag)=>{const Ig=eg(ag);return Ig&&(og[Ig]=tg[ag]),og},{}),gg,ig]}let dummyDateTimeCache=null;function getDummyDateTime(){return dummyDateTimeCache||(dummyDateTimeCache=DateTime.fromMillis(1555555555555)),dummyDateTimeCache}function maybeExpandMacroToken(tg,eg){if(tg.literal)return tg;const gg=Formatter.macroTokenToFormatOpts(tg.val),ig=formatOptsToTokens(gg,eg);return ig==null||ig.includes(void 0)?tg:ig}function expandMacroTokens(tg,eg){return Array.prototype.concat(...tg.map(gg=>maybeExpandMacroToken(gg,eg)))}class TokenParser{constructor(eg,gg){if(this.locale=eg,this.format=gg,this.tokens=expandMacroTokens(Formatter.parseFormat(gg),eg),this.units=this.tokens.map(ig=>unitForToken(ig,eg)),this.disqualifyingUnit=this.units.find(ig=>ig.invalidReason),!this.disqualifyingUnit){const[ig,ng]=buildRegex(this.units);this.regex=RegExp(ig,"i"),this.handlers=ng}}explainFromTokens(eg){if(this.isValid){const[gg,ig]=match(eg,this.regex,this.handlers),[ng,og,ag]=ig?dateTimeFromMatches(ig):[null,null,void 0];if(hasOwnProperty(ig,"a")&&hasOwnProperty(ig,"H"))throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");return{input:eg,tokens:this.tokens,regex:this.regex,rawMatches:gg,matches:ig,result:ng,zone:og,specificOffset:ag}}else return{input:eg,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function explainFromTokens(tg,eg,gg){return new TokenParser(tg,gg).explainFromTokens(eg)}function parseFromTokens(tg,eg,gg){const{result:ig,zone:ng,specificOffset:og,invalidReason:ag}=explainFromTokens(tg,eg,gg);return[ig,ng,og,ag]}function formatOptsToTokens(tg,eg){if(!tg)return null;const ig=Formatter.create(eg,tg).dtFormatter(getDummyDateTime()),ng=ig.formatToParts(),og=ig.resolvedOptions();return ng.map(ag=>tokenForPart(ag,tg,og))}const INVALID="Invalid DateTime",MAX_DATE=864e13;function unsupportedZone(tg){return new Invalid("unsupported zone",`the zone "${tg.name}" is not supported`)}function possiblyCachedWeekData(tg){return tg.weekData===null&&(tg.weekData=gregorianToWeek(tg.c)),tg.weekData}function possiblyCachedLocalWeekData(tg){return tg.localWeekData===null&&(tg.localWeekData=gregorianToWeek(tg.c,tg.loc.getMinDaysInFirstWeek(),tg.loc.getStartOfWeek())),tg.localWeekData}function clone(tg,eg){const gg={ts:tg.ts,zone:tg.zone,c:tg.c,o:tg.o,loc:tg.loc,invalid:tg.invalid};return new DateTime({...gg,...eg,old:gg})}function fixOffset(tg,eg,gg){let ig=tg-eg*60*1e3;const ng=gg.offset(ig);if(eg===ng)return[ig,eg];ig-=(ng-eg)*60*1e3;const og=gg.offset(ig);return ng===og?[ig,ng]:[tg-Math.min(ng,og)*60*1e3,Math.max(ng,og)]}function tsToObj(tg,eg){tg+=eg*60*1e3;const gg=new Date(tg);return{year:gg.getUTCFullYear(),month:gg.getUTCMonth()+1,day:gg.getUTCDate(),hour:gg.getUTCHours(),minute:gg.getUTCMinutes(),second:gg.getUTCSeconds(),millisecond:gg.getUTCMilliseconds()}}function objToTS(tg,eg,gg){return fixOffset(objToLocalTS(tg),eg,gg)}function adjustTime(tg,eg){const gg=tg.o,ig=tg.c.year+Math.trunc(eg.years),ng=tg.c.month+Math.trunc(eg.months)+Math.trunc(eg.quarters)*3,og={...tg.c,year:ig,month:ng,day:Math.min(tg.c.day,daysInMonth(ig,ng))+Math.trunc(eg.days)+Math.trunc(eg.weeks)*7},ag=Duration.fromObject({years:eg.years-Math.trunc(eg.years),quarters:eg.quarters-Math.trunc(eg.quarters),months:eg.months-Math.trunc(eg.months),weeks:eg.weeks-Math.trunc(eg.weeks),days:eg.days-Math.trunc(eg.days),hours:eg.hours,minutes:eg.minutes,seconds:eg.seconds,milliseconds:eg.milliseconds}).as("milliseconds"),Ig=objToLocalTS(og);let[sg,Cg]=fixOffset(Ig,gg,tg.zone);return ag!==0&&(sg+=ag,Cg=tg.zone.offset(sg)),{ts:sg,o:Cg}}function parseDataToDateTime(tg,eg,gg,ig,ng,og){const{setZone:ag,zone:Ig}=gg;if(tg&&Object.keys(tg).length!==0||eg){const sg=eg||Ig,Cg=DateTime.fromObject(tg,{...gg,zone:sg,specificOffset:og});return ag?Cg:Cg.setZone(Ig)}else return DateTime.invalid(new Invalid("unparsable",`the input "${ng}" can't be parsed as ${ig}`))}function toTechFormat(tg,eg,gg=!0){return tg.isValid?Formatter.create(Locale.create("en-US"),{allowZ:gg,forceSimple:!0}).formatDateTimeFromString(tg,eg):null}function toISODate(tg,eg,gg){const ig=tg.c.year>9999||tg.c.year<0;let ng="";if(ig&&tg.c.year>=0&&(ng+="+"),ng+=padStart(tg.c.year,ig?6:4),gg==="year")return ng;if(eg){if(ng+="-",ng+=padStart(tg.c.month),gg==="month")return ng;ng+="-"}else if(ng+=padStart(tg.c.month),gg==="month")return ng;return ng+=padStart(tg.c.day),ng}function toISOTime(tg,eg,gg,ig,ng,og,ag){let Ig=!gg||tg.c.millisecond!==0||tg.c.second!==0,sg="";switch(ag){case"day":case"month":case"year":break;default:if(sg+=padStart(tg.c.hour),ag==="hour")break;if(eg){if(sg+=":",sg+=padStart(tg.c.minute),ag==="minute")break;Ig&&(sg+=":",sg+=padStart(tg.c.second))}else{if(sg+=padStart(tg.c.minute),ag==="minute")break;Ig&&(sg+=padStart(tg.c.second))}if(ag==="second")break;Ig&&(!ig||tg.c.millisecond!==0)&&(sg+=".",sg+=padStart(tg.c.millisecond,3))}return ng&&(tg.isOffsetFixed&&tg.offset===0&&!og?sg+="Z":tg.o<0?(sg+="-",sg+=padStart(Math.trunc(-tg.o/60)),sg+=":",sg+=padStart(Math.trunc(-tg.o%60))):(sg+="+",sg+=padStart(Math.trunc(tg.o/60)),sg+=":",sg+=padStart(Math.trunc(tg.o%60)))),og&&(sg+="["+tg.zone.ianaName+"]"),sg}const defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0},orderedUnits=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(tg){const eg={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[tg.toLowerCase()];if(!eg)throw new InvalidUnitError(tg);return eg}function normalizeUnitWithLocalWeeks(tg){switch(tg.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return normalizeUnit(tg)}}function guessOffsetForZone(tg){if(zoneOffsetTs===void 0&&(zoneOffsetTs=Settings.now()),tg.type!=="iana")return tg.offset(zoneOffsetTs);const eg=tg.name;let gg=zoneOffsetGuessCache.get(eg);return gg===void 0&&(gg=tg.offset(zoneOffsetTs),zoneOffsetGuessCache.set(eg,gg)),gg}function quickDT(tg,eg){const gg=normalizeZone(eg.zone,Settings.defaultZone);if(!gg.isValid)return DateTime.invalid(unsupportedZone(gg));const ig=Locale.fromObject(eg);let ng,og;if(isUndefined$1(tg.year))ng=Settings.now();else{for(const sg of orderedUnits)isUndefined$1(tg[sg])&&(tg[sg]=defaultUnitValues[sg]);const ag=hasInvalidGregorianData(tg)||hasInvalidTimeData(tg);if(ag)return DateTime.invalid(ag);const Ig=guessOffsetForZone(gg);[ng,og]=objToTS(tg,Ig,gg)}return new DateTime({ts:ng,zone:gg,loc:ig,o:og})}function diffRelative(tg,eg,gg){const ig=isUndefined$1(gg.round)?!0:gg.round,ng=isUndefined$1(gg.rounding)?"trunc":gg.rounding,og=(Ig,sg)=>(Ig=roundTo(Ig,ig||gg.calendary?0:2,gg.calendary?"round":ng),eg.loc.clone(gg).relFormatter(gg).format(Ig,sg)),ag=Ig=>gg.calendary?eg.hasSame(tg,Ig)?0:eg.startOf(Ig).diff(tg.startOf(Ig),Ig).get(Ig):eg.diff(tg,Ig).get(Ig);if(gg.unit)return og(ag(gg.unit),gg.unit);for(const Ig of gg.units){const sg=ag(Ig);if(Math.abs(sg)>=1)return og(sg,Ig)}return og(tg>eg?-0:0,gg.units[gg.units.length-1])}function lastOpts(tg){let eg={},gg;return tg.length>0&&typeof tg[tg.length-1]=="object"?(eg=tg[tg.length-1],gg=Array.from(tg).slice(0,tg.length-1)):gg=Array.from(tg),[eg,gg]}let zoneOffsetTs;const zoneOffsetGuessCache=new Map;class DateTime{constructor(eg){const gg=eg.zone||Settings.defaultZone;let ig=eg.invalid||(Number.isNaN(eg.ts)?new Invalid("invalid input"):null)||(gg.isValid?null:unsupportedZone(gg));this.ts=isUndefined$1(eg.ts)?Settings.now():eg.ts;let ng=null,og=null;if(!ig)if(eg.old&&eg.old.ts===this.ts&&eg.old.zone.equals(gg))[ng,og]=[eg.old.c,eg.old.o];else{const Ig=isNumber$1(eg.o)&&!eg.old?eg.o:gg.offset(this.ts);ng=tsToObj(this.ts,Ig),ig=Number.isNaN(ng.year)?new Invalid("invalid input"):null,ng=ig?null:ng,og=ig?null:Ig}this._zone=gg,this.loc=eg.loc||Locale.create(),this.invalid=ig,this.weekData=null,this.localWeekData=null,this.c=ng,this.o=og,this.isLuxonDateTime=!0}static now(){return new DateTime({})}static local(){const[eg,gg]=lastOpts(arguments),[ig,ng,og,ag,Ig,sg,Cg]=gg;return quickDT({year:ig,month:ng,day:og,hour:ag,minute:Ig,second:sg,millisecond:Cg},eg)}static utc(){const[eg,gg]=lastOpts(arguments),[ig,ng,og,ag,Ig,sg,Cg]=gg;return eg.zone=FixedOffsetZone.utcInstance,quickDT({year:ig,month:ng,day:og,hour:ag,minute:Ig,second:sg,millisecond:Cg},eg)}static fromJSDate(eg,gg={}){const ig=isDate$1(eg)?eg.valueOf():NaN;if(Number.isNaN(ig))return DateTime.invalid("invalid input");const ng=normalizeZone(gg.zone,Settings.defaultZone);return ng.isValid?new DateTime({ts:ig,zone:ng,loc:Locale.fromObject(gg)}):DateTime.invalid(unsupportedZone(ng))}static fromMillis(eg,gg={}){if(isNumber$1(eg))return eg<-MAX_DATE||eg>MAX_DATE?DateTime.invalid("Timestamp out of range"):new DateTime({ts:eg,zone:normalizeZone(gg.zone,Settings.defaultZone),loc:Locale.fromObject(gg)});throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof eg} with value ${eg}`)}static fromSeconds(eg,gg={}){if(isNumber$1(eg))return new DateTime({ts:eg*1e3,zone:normalizeZone(gg.zone,Settings.defaultZone),loc:Locale.fromObject(gg)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}static fromObject(eg,gg={}){eg=eg||{};const ig=normalizeZone(gg.zone,Settings.defaultZone);if(!ig.isValid)return DateTime.invalid(unsupportedZone(ig));const ng=Locale.fromObject(gg),og=normalizeObject(eg,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:ag,startOfWeek:Ig}=usesLocalWeekValues(og,ng),sg=Settings.now(),Cg=isUndefined$1(gg.specificOffset)?ig.offset(sg):gg.specificOffset,lg=!isUndefined$1(og.ordinal),Ag=!isUndefined$1(og.year),cg=!isUndefined$1(og.month)||!isUndefined$1(og.day),rg=Ag||cg,ug=og.weekYear||og.weekNumber;if((rg||lg)&&ug)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(cg&&lg)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");const dg=ug||og.weekday&&!rg;let bg,mg,hg=tsToObj(sg,Cg);dg?(bg=orderedWeekUnits,mg=defaultWeekUnitValues,hg=gregorianToWeek(hg,ag,Ig)):lg?(bg=orderedOrdinalUnits,mg=defaultOrdinalUnitValues,hg=gregorianToOrdinal(hg)):(bg=orderedUnits,mg=defaultUnitValues);let pg=!1;for(const Wg of bg){const $g=og[Wg];isUndefined$1($g)?pg?og[Wg]=mg[Wg]:og[Wg]=hg[Wg]:pg=!0}const fg=dg?hasInvalidWeekData(og,ag,Ig):lg?hasInvalidOrdinalData(og):hasInvalidGregorianData(og),wg=fg||hasInvalidTimeData(og);if(wg)return DateTime.invalid(wg);const Gg=dg?weekToGregorian(og,ag,Ig):lg?ordinalToGregorian(og):og,[Zg,yg]=objToTS(Gg,Cg,ig),Bg=new DateTime({ts:Zg,zone:ig,o:yg,loc:ng});return og.weekday&&rg&&eg.weekday!==Bg.weekday?DateTime.invalid("mismatched weekday",`you can't specify both a weekday of ${og.weekday} and a date of ${Bg.toISO()}`):Bg.isValid?Bg:DateTime.invalid(Bg.invalid)}static fromISO(eg,gg={}){const[ig,ng]=parseISODate(eg);return parseDataToDateTime(ig,ng,gg,"ISO 8601",eg)}static fromRFC2822(eg,gg={}){const[ig,ng]=parseRFC2822Date(eg);return parseDataToDateTime(ig,ng,gg,"RFC 2822",eg)}static fromHTTP(eg,gg={}){const[ig,ng]=parseHTTPDate(eg);return parseDataToDateTime(ig,ng,gg,"HTTP",gg)}static fromFormat(eg,gg,ig={}){if(isUndefined$1(eg)||isUndefined$1(gg))throw new InvalidArgumentError("fromFormat requires an input string and a format");const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0}),[Ig,sg,Cg,lg]=parseFromTokens(ag,eg,gg);return lg?DateTime.invalid(lg):parseDataToDateTime(Ig,sg,ig,`format ${gg}`,eg,Cg)}static fromString(eg,gg,ig={}){return DateTime.fromFormat(eg,gg,ig)}static fromSQL(eg,gg={}){const[ig,ng]=parseSQL(eg);return parseDataToDateTime(ig,ng,gg,"SQL",eg)}static invalid(eg,gg=null){if(!eg)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");const ig=eg instanceof Invalid?eg:new Invalid(eg,gg);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(ig);return new DateTime({invalid:ig})}static isDateTime(eg){return eg&&eg.isLuxonDateTime||!1}static parseFormatForOpts(eg,gg={}){const ig=formatOptsToTokens(eg,Locale.fromObject(gg));return ig?ig.map(ng=>ng?ng.val:null).join(""):null}static expandFormat(eg,gg={}){return expandMacroTokens(Formatter.parseFormat(eg),Locale.fromObject(gg)).map(ng=>ng.val).join("")}static resetCache(){zoneOffsetTs=void 0,zoneOffsetGuessCache.clear()}get(eg){return this[eg]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}get weekNumber(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}get weekday(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?possiblyCachedLocalWeekData(this).weekday:NaN}get localWeekNumber(){return this.isValid?possiblyCachedLocalWeekData(this).weekNumber:NaN}get localWeekYear(){return this.isValid?possiblyCachedLocalWeekData(this).weekYear:NaN}get ordinal(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}get monthShort(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const eg=864e5,gg=6e4,ig=objToLocalTS(this.c),ng=this.zone.offset(ig-eg),og=this.zone.offset(ig+eg),ag=this.zone.offset(ig-ng*gg),Ig=this.zone.offset(ig-og*gg);if(ag===Ig)return[this];const sg=ig-ag*gg,Cg=ig-Ig*gg,lg=tsToObj(sg,ag),Ag=tsToObj(Cg,Ig);return lg.hour===Ag.hour&&lg.minute===Ag.minute&&lg.second===Ag.second&&lg.millisecond===Ag.millisecond?[clone(this,{ts:sg}),clone(this,{ts:Cg})]:[this]}get isInLeapYear(){return isLeapYear(this.year)}get daysInMonth(){return daysInMonth(this.year,this.month)}get daysInYear(){return this.isValid?daysInYear(this.year):NaN}get weeksInWeekYear(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?weeksInWeekYear(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(eg={}){const{locale:gg,numberingSystem:ig,calendar:ng}=Formatter.create(this.loc.clone(eg),eg).resolvedOptions(this);return{locale:gg,numberingSystem:ig,outputCalendar:ng}}toUTC(eg=0,gg={}){return this.setZone(FixedOffsetZone.instance(eg),gg)}toLocal(){return this.setZone(Settings.defaultZone)}setZone(eg,{keepLocalTime:gg=!1,keepCalendarTime:ig=!1}={}){if(eg=normalizeZone(eg,Settings.defaultZone),eg.equals(this.zone))return this;if(eg.isValid){let ng=this.ts;if(gg||ig){const og=eg.offset(this.ts),ag=this.toObject();[ng]=objToTS(ag,og,eg)}return clone(this,{ts:ng,zone:eg})}else return DateTime.invalid(unsupportedZone(eg))}reconfigure({locale:eg,numberingSystem:gg,outputCalendar:ig}={}){const ng=this.loc.clone({locale:eg,numberingSystem:gg,outputCalendar:ig});return clone(this,{loc:ng})}setLocale(eg){return this.reconfigure({locale:eg})}set(eg){if(!this.isValid)return this;const gg=normalizeObject(eg,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:ig,startOfWeek:ng}=usesLocalWeekValues(gg,this.loc),og=!isUndefined$1(gg.weekYear)||!isUndefined$1(gg.weekNumber)||!isUndefined$1(gg.weekday),ag=!isUndefined$1(gg.ordinal),Ig=!isUndefined$1(gg.year),sg=!isUndefined$1(gg.month)||!isUndefined$1(gg.day),Cg=Ig||sg,lg=gg.weekYear||gg.weekNumber;if((Cg||ag)&&lg)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(sg&&ag)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let Ag;og?Ag=weekToGregorian({...gregorianToWeek(this.c,ig,ng),...gg},ig,ng):isUndefined$1(gg.ordinal)?(Ag={...this.toObject(),...gg},isUndefined$1(gg.day)&&(Ag.day=Math.min(daysInMonth(Ag.year,Ag.month),Ag.day))):Ag=ordinalToGregorian({...gregorianToOrdinal(this.c),...gg});const[cg,rg]=objToTS(Ag,this.o,this.zone);return clone(this,{ts:cg,o:rg})}plus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg);return clone(this,adjustTime(this,gg))}minus(eg){if(!this.isValid)return this;const gg=Duration.fromDurationLike(eg).negate();return clone(this,adjustTime(this,gg))}startOf(eg,{useLocaleWeeks:gg=!1}={}){if(!this.isValid)return this;const ig={},ng=Duration.normalizeUnit(eg);switch(ng){case"years":ig.month=1;case"quarters":case"months":ig.day=1;case"weeks":case"days":ig.hour=0;case"hours":ig.minute=0;case"minutes":ig.second=0;case"seconds":ig.millisecond=0;break}if(ng==="weeks")if(gg){const og=this.loc.getStartOfWeek(),{weekday:ag}=this;ag<og&&(ig.weekNumber=this.weekNumber-1),ig.weekday=og}else ig.weekday=1;if(ng==="quarters"){const og=Math.ceil(this.month/3);ig.month=(og-1)*3+1}return this.set(ig)}endOf(eg,gg){return this.isValid?this.plus({[eg]:1}).startOf(eg,gg).minus(1):this}toFormat(eg,gg={}){return this.isValid?Formatter.create(this.loc.redefaultToEN(gg)).formatDateTimeFromString(this,eg):INVALID}toLocaleString(eg=DATE_SHORT,gg={}){return this.isValid?Formatter.create(this.loc.clone(gg),eg).formatDateTime(this):INVALID}toLocaleParts(eg={}){return this.isValid?Formatter.create(this.loc.clone(eg),eg).formatDateTimeParts(this):[]}toISO({format:eg="extended",suppressSeconds:gg=!1,suppressMilliseconds:ig=!1,includeOffset:ng=!0,extendedZone:og=!1,precision:ag="milliseconds"}={}){if(!this.isValid)return null;ag=normalizeUnit(ag);const Ig=eg==="extended";let sg=toISODate(this,Ig,ag);return orderedUnits.indexOf(ag)>=3&&(sg+="T"),sg+=toISOTime(this,Ig,gg,ig,ng,og,ag),sg}toISODate({format:eg="extended",precision:gg="day"}={}){return this.isValid?toISODate(this,eg==="extended",normalizeUnit(gg)):null}toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:eg=!1,suppressSeconds:gg=!1,includeOffset:ig=!0,includePrefix:ng=!1,extendedZone:og=!1,format:ag="extended",precision:Ig="milliseconds"}={}){return this.isValid?(Ig=normalizeUnit(Ig),(ng&&orderedUnits.indexOf(Ig)>=3?"T":"")+toISOTime(this,ag==="extended",gg,eg,ig,og,Ig)):null}toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?toISODate(this,!0):null}toSQLTime({includeOffset:eg=!0,includeZone:gg=!1,includeOffsetSpace:ig=!0}={}){let ng="HH:mm:ss.SSS";return(gg||eg)&&(ig&&(ng+=" "),gg?ng+="z":eg&&(ng+="ZZ")),toTechFormat(this,ng,!0)}toSQL(eg={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(eg)}`:null}toString(){return this.isValid?this.toISO():INVALID}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(eg={}){if(!this.isValid)return{};const gg={...this.c};return eg.includeConfig&&(gg.outputCalendar=this.outputCalendar,gg.numberingSystem=this.loc.numberingSystem,gg.locale=this.loc.locale),gg}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(eg,gg="milliseconds",ig={}){if(!this.isValid||!eg.isValid)return Duration.invalid("created by diffing an invalid DateTime");const ng={locale:this.locale,numberingSystem:this.numberingSystem,...ig},og=maybeArray(gg).map(Duration.normalizeUnit),ag=eg.valueOf()>this.valueOf(),Ig=ag?this:eg,sg=ag?eg:this,Cg=diff(Ig,sg,og,ng);return ag?Cg.negate():Cg}diffNow(eg="milliseconds",gg={}){return this.diff(DateTime.now(),eg,gg)}until(eg){return this.isValid?Interval.fromDateTimes(this,eg):this}hasSame(eg,gg,ig){if(!this.isValid)return!1;const ng=eg.valueOf(),og=this.setZone(eg.zone,{keepLocalTime:!0});return og.startOf(gg,ig)<=ng&&ng<=og.endOf(gg,ig)}equals(eg){return this.isValid&&eg.isValid&&this.valueOf()===eg.valueOf()&&this.zone.equals(eg.zone)&&this.loc.equals(eg.loc)}toRelative(eg={}){if(!this.isValid)return null;const gg=eg.base||DateTime.fromObject({},{zone:this.zone}),ig=eg.padding?this<gg?-eg.padding:eg.padding:0;let ng=["years","months","days","hours","minutes","seconds"],og=eg.unit;return Array.isArray(eg.unit)&&(ng=eg.unit,og=void 0),diffRelative(gg,this.plus(ig),{...eg,numeric:"always",units:ng,unit:og})}toRelativeCalendar(eg={}){return this.isValid?diffRelative(eg.base||DateTime.fromObject({},{zone:this.zone}),this,{...eg,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...eg){if(!eg.every(DateTime.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(eg,gg=>gg.valueOf(),Math.min)}static max(...eg){if(!eg.every(DateTime.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(eg,gg=>gg.valueOf(),Math.max)}static fromFormatExplain(eg,gg,ig={}){const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0});return explainFromTokens(ag,eg,gg)}static fromStringExplain(eg,gg,ig={}){return DateTime.fromFormatExplain(eg,gg,ig)}static buildFormatParser(eg,gg={}){const{locale:ig=null,numberingSystem:ng=null}=gg,og=Locale.fromOpts({locale:ig,numberingSystem:ng,defaultToEN:!0});return new TokenParser(og,eg)}static fromFormatParser(eg,gg,ig={}){if(isUndefined$1(eg)||isUndefined$1(gg))throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser");const{locale:ng=null,numberingSystem:og=null}=ig,ag=Locale.fromOpts({locale:ng,numberingSystem:og,defaultToEN:!0});if(!ag.equals(gg.locale))throw new InvalidArgumentError(`fromFormatParser called with a locale of ${ag}, but the format parser was created for ${gg.locale}`);const{result:Ig,zone:sg,specificOffset:Cg,invalidReason:lg}=gg.explainFromTokens(eg);return lg?DateTime.invalid(lg):parseDataToDateTime(Ig,sg,ig,`format ${gg.format}`,eg,Cg)}static get DATE_SHORT(){return DATE_SHORT}static get DATE_MED(){return DATE_MED}static get DATE_MED_WITH_WEEKDAY(){return DATE_MED_WITH_WEEKDAY}static get DATE_FULL(){return DATE_FULL}static get DATE_HUGE(){return DATE_HUGE}static get TIME_SIMPLE(){return TIME_SIMPLE}static get TIME_WITH_SECONDS(){return TIME_WITH_SECONDS}static get TIME_WITH_SHORT_OFFSET(){return TIME_WITH_SHORT_OFFSET}static get TIME_WITH_LONG_OFFSET(){return TIME_WITH_LONG_OFFSET}static get TIME_24_SIMPLE(){return TIME_24_SIMPLE}static get TIME_24_WITH_SECONDS(){return TIME_24_WITH_SECONDS}static get TIME_24_WITH_SHORT_OFFSET(){return TIME_24_WITH_SHORT_OFFSET}static get TIME_24_WITH_LONG_OFFSET(){return TIME_24_WITH_LONG_OFFSET}static get DATETIME_SHORT(){return DATETIME_SHORT}static get DATETIME_SHORT_WITH_SECONDS(){return DATETIME_SHORT_WITH_SECONDS}static get DATETIME_MED(){return DATETIME_MED}static get DATETIME_MED_WITH_SECONDS(){return DATETIME_MED_WITH_SECONDS}static get DATETIME_MED_WITH_WEEKDAY(){return DATETIME_MED_WITH_WEEKDAY}static get DATETIME_FULL(){return DATETIME_FULL}static get DATETIME_FULL_WITH_SECONDS(){return DATETIME_FULL_WITH_SECONDS}static get DATETIME_HUGE(){return DATETIME_HUGE}static get DATETIME_HUGE_WITH_SECONDS(){return DATETIME_HUGE_WITH_SECONDS}}function friendlyDateTime(tg){if(DateTime.isDateTime(tg))return tg;if(tg&&tg.valueOf&&isNumber$1(tg.valueOf()))return DateTime.fromJSDate(tg);if(tg&&typeof tg=="object")return DateTime.fromObject(tg);throw new InvalidArgumentError(`Unknown datetime argument: ${tg}, of type ${typeof tg}`)}const WEEK_ZH=["一","二","三","四","五","六","日"],MONTH_ZH_NUM=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],MONTH_ZH_CN=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];function formatDate(tg,{years:eg=0,months:gg=0,days:ig=0}={}){const ng=DateTime.now().plus({years:eg,months:gg,days:ig}).setLocale("zh-CN");let og=formatWithZhMonth(ng,tg),ag=ng.toFormat(og);return ag=formatWithZhWeekday(ng,ag),ag}function formatWithZhWeekday(tg,eg){const gg=WEEK_ZH[tg.weekday-1];return eg.replace(/dddd/g,`星期${gg}`).replace(/ddd/g,`周${gg}`)}function formatWithZhMonth(tg,eg){const gg=tg.month-1;return eg.replace(/MMMM/g,MONTH_ZH_CN[gg]).replace(/MMM/g,MONTH_ZH_NUM[gg])}function throttle$1(tg,eg=300){let gg=0;return function(...ig){const ng=Date.now();ng-gg>=eg&&(tg.apply(this,ig),gg=ng)}}function ptToPx$1(tg,eg=o.DPI){return tg*eg/72}function mitt(tg){return{all:tg=tg||new Map,on:function(eg,gg){var ig=tg.get(eg);ig?ig.push(gg):tg.set(eg,[gg])},off:function(eg,gg){var ig=tg.get(eg);ig&&(gg?ig.splice(ig.indexOf(gg)>>>0,1):tg.set(eg,[]))},emit:function(eg,gg){var ig=tg.get(eg);ig&&ig.slice().map(function(ng){ng(gg)}),(ig=tg.get("*"))&&ig.slice().map(function(ng){ng(eg,gg)})}}}const canvasEventBus=mitt();let allObjMap=new Proxy({},{get(tg,eg){return eg in tg?tg[eg]:[]},set(tg,eg,gg){return tg[eg]=gg,!0}});function clearObjectMap(){allObjMap=new Proxy({},{get(tg,eg){return eg in tg?tg[eg]:[]},set(tg,eg,gg){return tg[eg]=gg,!0}})}function updateObjectMap(tg){tg.type!=="group"&&tg.id!=="workspace"?!allObjMap[tg.type]||allObjMap[tg.type]&&allObjMap[tg.type].length===0?allObjMap[tg.type]=[tg]:allObjMap[tg.type].push(tg):tg._objects.forEach(eg=>updateObjectMap(eg))}function getAllObjectMap(tg=null,eg="get"){if(eg==="get"&&Object.keys(allObjMap).length)return allObjMap;{if(!tg)return allObjMap;clearObjectMap();const gg=ig=>{ig.type==="group"&&ig._objects?ig._objects.forEach(ng=>gg(ng)):ig.id!=="workspace"&&(!allObjMap[ig.type]||allObjMap[ig.type]&&allObjMap[ig.type].length===0?allObjMap[ig.type]=[ig]:allObjMap[ig.type].push(ig))};tg==null||tg.getObjects().forEach(ig=>gg(ig))}return allObjMap}function getObjectList(tg,eg){tg.type!=="group"&&tg.type!=="activeselection"?eg&&eg(tg):tg._objects.forEach(gg=>getObjectList(gg,eg))}function getCounterIncrement(tg){const eg=Number(tg.incremental);return Number.isFinite(eg)?Math.trunc(eg):0}function getCounterValueType(tg){return tg.valueType==="letter"?"letter":"number"}function normalizeLetterValue(tg){return String(tg??"").toUpperCase().replace(/[^A-Z]/g,"")||"A"}function letterValueToNumber(tg){return normalizeLetterValue(tg).split("").reduce((eg,gg)=>eg*26+gg.charCodeAt(0)-64,0)}function numberToLetterValue(tg){let eg=Math.max(1,Math.trunc(tg)),gg="";for(;eg>0;)eg--,gg=String.fromCharCode(65+eg%26)+gg,eg=Math.floor(eg/26);return gg}function formatCounterValue(tg){if(getCounterValueType(tg)==="letter"){const ig=normalizeLetterValue(tg.value);return tg.zeroPadding?ig.padStart(Math.max(0,tg.length),"0"):ig}let eg=String(tg.value??"");if(!tg.zeroPadding)return eg;let gg=Number(eg);return gg<0?(gg=Math.abs(gg),`-${gg.toString().padStart(tg.length,"0")}`):eg.padStart(tg.length,"0")}function getNextCounterValue(tg){const eg=getCounterIncrement(tg);if(getCounterValueType(tg)==="letter"){const ng=letterValueToNumber(normalizeLetterValue(tg.value))+eg;if(ng<1)return null;const og=numberToLetterValue(ng);return og.length<=tg.length?og:null}const gg=Number(tg.value);if(!Number.isFinite(gg))return null;const ig=gg+eg;return Math.abs(ig).toString().length<=tg.length?ig:null}const GS1_AI_TABLE={"00":{length:18,desc:"SSCC"},"01":{length:14,desc:"GTIN"},"02":{length:14,desc:"GTIN inside"},11:{length:6,desc:"生产日期"},12:{length:6,desc:"付款截止日"},13:{length:6,desc:"包装日期"},15:{length:6,desc:"最佳保质期"},16:{length:6,desc:"销售截止日"},17:{length:6,desc:"有效期"},18:{length:6,desc:"接收日期"},20:{length:2,desc:"产品变体"},410:{length:13,desc:"收货方GLN"},411:{length:13,desc:"付款方GLN"},412:{length:13,desc:"购方GLN"},413:{length:13,desc:"发货方GLN"},414:{length:13,desc:"交货方GLN"},415:{length:13,desc:"开票方GLN"},416:{length:13,desc:"生产/服务方GLN"},417:{length:13,desc:"参与方GLN"},7001:{length:13,desc:"NHS编号"},10:{variable:!0,max:20,desc:"批号"},21:{variable:!0,max:20,desc:"序列号"},22:{variable:!0,max:20,desc:"次级数据"},30:{variable:!0,max:8,desc:"数量(件)"},37:{variable:!0,max:8,desc:"物流单元数量"},400:{variable:!0,max:30,desc:"客户订单号"},401:{variable:!0,max:30,desc:"货物标识号"},402:{variable:!0,max:20,desc:"GSIN"},403:{variable:!0,max:30,desc:"路线代码"},420:{variable:!0,max:20,desc:"收货方邮编"},421:{variable:!0,max:20,desc:"收货方邮编(含ISO)"},7002:{variable:!0,max:30,desc:"CE标识"},7010:{variable:!0,max:30,desc:"医院编号"},8001:{variable:!0,max:14,desc:"卷材信息"},8002:{variable:!0,max:20,desc:"手机电子序列号"},8003:{variable:!0,max:30,desc:"全球可回收资产标识"},8004:{variable:!0,max:30,desc:"全球单个资产标识"},8005:{variable:!0,max:6,desc:"价格"},8006:{variable:!0,max:18,desc:"组件标识"},8007:{variable:!0,max:34,desc:"IBAN"},8008:{variable:!0,max:12,desc:"生产日期时间"},8010:{variable:!0,max:30,desc:"CPID"},8011:{variable:!0,max:30,desc:"CPID序列号"},8012:{variable:!0,max:20,desc:"软件版本"},8013:{variable:!0,max:30,desc:"型号"},8017:{variable:!0,max:18,desc:"GSRN"},8018:{variable:!0,max:18,desc:"GSRN-Provider"},8020:{variable:!0,max:25,desc:"支付单号"},8110:{variable:!0,max:70,desc:"优惠券扩展"},8200:{variable:!0,max:25,desc:"包裹编号"},90:{variable:!0,max:30,desc:"双方约定"},91:{variable:!0,max:90,desc:"双方约定"},92:{variable:!0,max:90,desc:"双方约定"},93:{variable:!0,max:90,desc:"双方约定"},94:{variable:!0,max:90,desc:"双方约定"},95:{variable:!0,max:90,desc:"双方约定"},96:{variable:!0,max:90,desc:"双方约定"},97:{variable:!0,max:90,desc:"双方约定"},98:{variable:!0,max:90,desc:"双方约定"},99:{variable:!0,max:90,desc:"双方约定"}};for(let tg=310;tg<=369;tg++)GS1_AI_TABLE[String(tg)]={length:6,desc:"量度值"};class GS1Parser{static getAIInfo(eg){return GS1_AI_TABLE[eg]||null}static matchAIPrefix(eg,gg){for(const ig of[4,3,2]){if(gg+ig>eg.length)continue;const ng=eg.slice(gg,gg+ig);if(GS1_AI_TABLE[ng])return{ai:ng,info:GS1_AI_TABLE[ng]}}return null}static parse(eg){const gg=/\((\d{2,4})\)/g;let ig;const ng=[];for(;(ig=gg.exec(eg))!==null;){if(ng.length>0){const og=ng[ng.length-1];og.data=eg.slice(og.dataStart,ig.index)}ng.push({ai:ig[1],dataStart:ig.index+ig[0].length})}return ng.length>0&&(ng[ng.length-1].data=eg.slice(ng[ng.length-1].dataStart)),ng.map(og=>({ai:og.ai,data:og.data??""}))}static calcCheckDigit(eg){const gg=String(eg).split("").map(Number);let ig=0;for(let ng=0;ng<gg.length;ng++){const og=(gg.length-ng)%2===1?3:1;ig+=gg[ng]*og}return(10-ig%10)%10}static normalizeGTIN(eg){let gg=String(eg).replace(/\D/g,"");if(gg.length===14)return gg;gg=gg.padStart(13,"0");const ig=this.calcCheckDigit(gg);return gg+ig}static format(eg){return Array.isArray(eg)?eg.map(({ai:gg,data:ig})=>`(${gg})${ig}`).join(""):eg}static process(eg){const gg=this.parse(eg);return gg.length===0?`(01)${this.normalizeGTIN(eg)}`:gg.map(({ai:ig,data:ng})=>{if(this.getAIInfo(ig),ig==="01"||ig==="02")return{ai:ig,data:this.normalizeGTIN(ng)};if(ig==="00"){const og=String(ng).padStart(17,"0"),ag=this.calcCheckDigit(og);return{ai:ig,data:og+ag}}if(ig>="410"&&ig<="417"){const og=String(ng).padStart(12,"0"),ag=this.calcCheckDigit(og);return{ai:ig,data:og+ag}}return{ai:ig,data:ng}})}}function withObjectStrokeDash(tg,eg,gg){const ig=tg.getLineDash(),ng=tg.lineDashOffset,og=eg.strokeDashArray;tg.setLineDash(Array.isArray(og)&&og.length?og:[]),tg.lineDashOffset=eg.strokeDashOffset||0;try{gg()}finally{tg.setLineDash(ig),tg.lineDashOffset=ng}}function getBarcodeRenderWidth(tg,eg){if(eg>tg)return eg;const gg=Math.round(tg/eg)||1;return eg*gg}const Pl=class Pl extends ji{constructor(eg,gg){super(gg),this.hasFireChange=!1,this.minScaleLimit=.1,this.orginTextWidth=0,this.orginTextgaps=2,this.orginTextSize=0,this.orginTextHeight=0,this.lockScalingFlip=!0,this.objectCaching=!1,this._scaleAnchor=void 0,this.counterProps=null,this.reviewValueArgs=null,this.barcodeDateFormatType="",this.increaseDate=!1,this.concatTextIdListObj=null,this.connectObjIds=[],this.stretchMode="scale",this.barcodeTextHeight=0,this.barcodeTextGap=5,this._textLayoutInitialized=!1,this._lastTextAreaHeight=0,this._cache={canvas:void 0,error:void 0,update:!0},this.increaseDate=gg&&gg.increaseDate?gg.increaseDate:this.increaseDate,this.barcodeDateFormatType=gg&&gg.barcodeDateFormatType?gg.barcodeDateFormatType:this.barcodeDateFormatType,this.counterProps=gg&&gg.counterProps?gg.counterProps:this.counterProps,this.stretchMode=gg&&gg.stretchMode?gg.stretchMode:this.stretchMode,this.barcodeTextGap=gg&&gg.barcodeTextGap!=null?gg.barcodeTextGap:this.barcodeTextGap,this.barcodeOptions=cloneDeep(eg),this.barcodeOptions.textsize=eg.textsize||14,this.barcodeOptions.textposition=eg.includetext?eg.textposition||"bottom":void 0,this.barcodeOptions.textfontname=eg.textfontname||"Arial",this.set({width:this.width||1,height:this.height||80}),this.barcodeBaseWidth=this.width,this.on("scaling",ig=>{const ng=ig.transform;if(!ng)return;const og=ng.corner,ag=["ml","tl","bl"].includes(og),Ig=["mr","tr","br"].includes(og),sg=["mt","tl","tr"].includes(og),Cg=["mb","bl","br"].includes(og);if(!this._scaleAnchor){const dg=ag?"right":Ig?"left":"center",bg=sg?"bottom":Cg?"top":"center",mg=this.getPointByOrigin(dg,bg);this._scaleAnchor={p:mg,ox:dg,oy:bg}}const lg=Math.max(1,this.width*this.scaleX),Ag=Math.max(1,this.height*this.scaleY);this.width=lg,this.height=Ag,this.scaleX=1,this.scaleY=1,this.barcodeBaseWidth=this.width;const{p:cg,ox:rg,oy:ug}=this._scaleAnchor;if(this.group){const dg=kn.invertTransform(this.group.calcTransformMatrix()),bg=kn.transformPoint(cg,dg);this.setPositionByOrigin(bg,rg,ug)}else this.setPositionByOrigin(cg,rg,ug);this.setCoords()}),this.on("modified",()=>{this._scaleAnchor=void 0}),this.concatTextIdListObj=gg.concatTextIdListObj??this.concatTextIdListObj,this.connectObjIds=gg.connectObjIds??this.connectObjIds,canvasEventBus.off(`update:barcode:${this.id}`),canvasEventBus.on(`update:barcode:${this.id}`,async({list:ig,callback:ng=function(){}}={})=>{let og=await this.updateBarCode2d(ig);ng&&ng(og)})}measureText(eg,gg,ig){if(gg.textposition&&gg.textposition!=="none"&&gg.textsize){eg.font=`${gg.textsize}px ${gg.textfontname}`,gg.textgaps&&(eg.letterSpacing=gg.textgaps+"px");const ng=eg.measureText(gg.text);ig.textWidth=ng.actualBoundingBoxRight-ng.actualBoundingBoxLeft,ig.textHeight=ng.fontBoundingBoxAscent+ng.fontBoundingBoxDescent}}drawText(eg,gg,ig){if(gg.textposition&&gg.textposition!=="none"&&gg.textsize){gg.textcolor&&(eg.fillStyle=gg.textcolor);const ng=(sg,Cg)=>{let lg=(sg==null?void 0:sg.textWidth)||0;return Cg.textxalign==="left"?-this.width/2+this.strokeWidth/2:Cg.textxalign==="center"?-lg/2:Cg.textxalign==="right"&&this._cache.canvas?this.width/2-this.strokeWidth/2-lg:0},og=(sg,Cg)=>{let lg=(sg==null?void 0:sg.textHeight)||0;if(Cg.textposition==="top"){if(this._cache.canvas){const Ag=-this.height/2+lg+this.strokeWidth/2;return sg.y+=sg.textHeight,Ag}}else if(Cg.textposition==="bottom"&&this._cache.canvas)return this.height/2-this.strokeWidth/2;return 0},ag=ng(ig,gg),Ig=og(ig,gg);eg.save(),eg.fillText(gg.text,ag*this.scaleX,Ig*this.scaleY),eg.restore()}}countDate(){if(this.barcodeDateFormatType&&this.increaseDate){const eg=formatDate(this.barcodeDateFormatType);return console.log("formatted",eg),this.dirty=!0,this.setBarcodeOption({bcid:this.barcodeOptions.bcid,text:eg}),eg}}countCurrent(eg){let gg=this.counterProps||eg;if(gg){let ig=gg;if(!ig.value&&ig.value!==0)return"";const ng=formatCounterValue(ig);return(ig.prefix&&ig.prefix.length>0?ig.prefix:"")+ng+(ig.suffix&&ig.suffix.length>0?ig.suffix:"")}return""}countNext(eg="print"){if(this.counterProps){let gg=this.counterProps;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);let ng=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const og=getNextCounterValue(gg);return og!==null&&(gg.value=og,this.counterProps.value=og),this.dirty=!0,this._cache.update=!0,ng}else return""}reviewRecover(){if(this.reviewValueArgs){const eg=this.reviewValueArgs;this.counterProps=eg,this.reviewValueArgs=null;const gg=formatCounterValue(eg);let ig=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"");this.setBarcodeOption({bcid:this.barcodeOptions.bcid,text:ig})}}calculateCheckDigit(eg){if(!/^\d{13}$/.test(eg))return"";let gg=0;for(let ig=0;ig<13;ig++){const ng=parseInt(eg[ig]);gg+=ng*(ig%2===0?3:1)}return(10-gg%10)%10}_render(eg){var ug,dg,bg,mg;let gg=cloneDeep(this.barcodeOptions);console.log("_render======",gg);let ig=gg.bcid==="ean13",ng=gg.bcid==="upca",og=gg.bcid==="upce",ag=gg.bcid==="ean8";if(this.scaleX!==1&&(this.scaleX=1),this.scaleY!==1&&(this.scaleY=1),this.orginTextgaps>Number(gg.textgaps),this.orginTextSize>Number(gg.textsize),gg.bcid==="gs1-128"){const hg=GS1Parser.process(gg.text);gg.text=GS1Parser.format(hg)}gg.textgaps=gg.textgaps||1,this.orginTextgaps=gg.textgaps||1,this.orginTextSize=gg.textsize||0,eg.font=`${gg.textsize}px ${gg.textfontname}`,gg.textgaps&&(eg.letterSpacing=gg.textgaps+"px");const Ig=eg.measureText(gg.text);let sg=Ig.width/this.scaleX,Cg=(Ig.actualBoundingBoxAscent+Ig.actualBoundingBoxDescent)/this.scaleY;this.orginTextWidth=sg,this.orginTextHeight=Cg,this.height>0||(this.height=Cg+30);const lg=["ean13","upca","upce","ean8"],Ag=!lg.includes(gg.bcid)&&(gg.textposition==="top"||gg.textposition==="bottom"),cg=Ag?Cg+this.barcodeTextGap:0;this._textLayoutInitialized&&(this.height=Math.max(1,this.height+cg-this._lastTextAreaHeight)),this._textLayoutInitialized=!0,this._lastTextAreaHeight=cg,this.barcodeTextHeight=Ag?Cg:0,this._lastTextVisible=Ag;let rg={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2};if(rg.textWidth=sg,rg.textHeight=Cg,gg.includetext=!1,gg.scale=1,gg.paddingleft=0,gg.paddingright=0,lg.includes(gg.bcid)&&(gg={...gg,includetext:!0,textyoffset:-10},gg.bcid==="upca"&&(gg.textyoffset=-15),delete gg.paddingtop,delete gg.paddingbottom,delete gg.paddingleft,delete gg.paddingright,delete gg.textposition,delete gg.textxalign),typeof this.fill=="string"){let hg=rgbaStringToHex8(this.fill);gg.barcolor=hexToHex6_blend(hg)}if(this._cache.update)if(console.log("this._cache.update=====",this._cache.update),/[\u4e00-\u9fff]/.test(gg.text||""))this._cache.error="Not Support zh-CN character",this._cache.canvas=void 0,this._cache.update=!1;else try{if(this._cache.canvas=generateCanvas(gg),lg.includes(gg.bcid)){const pg=this._cache.canvas,fg=pg.getContext("2d");if(fg){const Gg=Math.trunc(pg.height*.125);fg.clearRect(0,pg.height-Gg,pg.width,Gg)}}let hg=this._cache.canvas.width;if(!lg.includes(gg.bcid)){let pg=getTargetDpi();this.canvas&&pg===300&&(hg=hg*1.32)}if(this.stretchMode==="free"){if((!this.width||this.width<1)&&(this.width=hg),this.width>hg){let pg=Math.min(32,Math.max(1,Math.ceil(this.width/hg)));pg>1&&(gg.scale=pg,this._cache.canvas=generateCanvas(gg),console.log("barcodeOption=====",gg),hg=this._cache.canvas.width)}}else{const pg=this.barcodeBaseWidth??this.width;this.width=getBarcodeRenderWidth(pg,hg)}rg.w=this.width,rg.x=-this.width/2,this._cache.error&&(this._cache.error=void 0),this.setCoords(),(ug=this.canvas)==null||ug.requestRenderAll(),this._cache.update=!1,(dg=this.canvas)!=null&&dg.getActiveObject&&((bg=this.canvas)==null?void 0:bg.getActiveObject())===this&&((mg=this.canvas)==null||mg.fire("custom:object:changed",{target:this,action:"barcode"}))}catch(hg){console.warn("draw barcode",hg),this.dirty=!0,hg instanceof Error&&(console.log("error",hg.message),this._cache.error="error:"+hg.message),this._cache.canvas=void 0}if(eg.imageSmoothingEnabled=!1,this.strokeWidth>0&&typeof this.stroke=="string"&&(eg.lineWidth=this.strokeWidth,eg.strokeStyle=this.stroke,withObjectStrokeDash(eg,this,()=>eg.strokeRect(rg.x,rg.y,rg.w,rg.h))),rg.barcodeCanvas=this._cache.canvas,!this._cache.error&&rg.barcodeCanvas){this.strokeWidth>0&&(rg.x+=this.strokeWidth/2,rg.y+=this.strokeWidth/2);let hg=rg.h-(rg.textHeight||0)-this.strokeWidth/2,pg=rg.y;gg.textposition==="top"?(hg=hg-this.barcodeTextGap,pg=pg+rg.textHeight/this.scaleY+this.barcodeTextGap):gg.textposition==="bottom"?hg=hg-this.barcodeTextGap/this.scaleY:hg=rg.h-this.strokeWidth/2;let wg=rg.w-this.strokeWidth/2,Gg=hg;lg.includes(gg.bcid)&&(Gg=rg.h-this.strokeWidth/2),eg.drawImage(rg.barcodeCanvas,0,0,rg.barcodeCanvas.width,rg.barcodeCanvas.height,rg.x,pg,wg,Gg);let Zg=this.barcodeOptions.text;const yg=this.width;if(ig){let Bg=this.calcEAN13CheckDigit(Zg);Zg=Zg+""+Bg,eg.save();const Wg=Math.trunc(yg/95),$g=-rg.y-Math.trunc(Gg/6);let Ng=rg.x+Math.trunc(wg/13);eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let vg=rg.barcodeCanvas.width;this.width/vg===1&&(eg.letterSpacing="-2px"),eg.fillText(Zg[0],-Wg*2+Ng,$g),eg.fillText(Zg.slice(1,7),Wg*(3+42/2)+rg.x+Math.trunc(wg/10),$g),eg.fillText(Zg.slice(7),Wg*(50+42/2)+rg.x+Math.trunc(wg/10),$g),eg.restore()}else if(ag){let Bg=this.calcEAN8CheckDigit(Zg);Zg=Zg+""+Bg,eg.save();const Wg=Math.trunc(yg/67),$g=-rg.y-Math.trunc(Gg/6);rg.x+Math.trunc(wg/13),eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let Ng=rg.barcodeCanvas.width;this.width/Ng===1&&(eg.letterSpacing="-1px");const Xg=Wg*12+rg.x+4,Vg=Wg*55+rg.x-4;eg.fillText(Zg.slice(0,4),Xg,$g),eg.fillText(Zg.slice(4),Vg,$g),eg.restore()}else if(ng){eg.save();const Bg=-rg.y-Math.trunc(Gg/6),Wg=rg.x;let $g=this.calcUPCACheckDigit(Zg);Zg=Zg+""+$g,eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top";let Ng=rg.barcodeCanvas.width;this.width/Ng===1&&(eg.letterSpacing="-1px"),this.drawUPCAText(eg,Zg,yg,Bg,Wg),eg.restore()}else if(og){eg.save();const Bg=-rg.y-Math.trunc(Gg/8),Wg=rg.x;let $g=this.calcUPCECheckDigit(Zg);Zg=Zg+""+$g,console.log("digits========",Zg),eg.font=`${gg.textsize}px ${gg.textfontname}`,eg.fillStyle=gg.textcolor||"#000",eg.textAlign="center",eg.textBaseline="top",this.drawUPCEText(eg,Zg,yg,Bg,Wg),eg.restore()}else this.drawText(eg,gg,rg)}if(eg.save(),/[\u4e00-\u9fff]/.test(gg.text||"")&&(this._cache.error="Not Support zh-CN character"),this._cache.error){const hg=wrapText(eg,this._cache.error,rg.w),pg=getLineHeight(eg);let fg=rg.y+pg;const wg=eg.fillStyle;eg.fillStyle="red";for(const Gg of hg)if(eg.fillText(Gg,rg.x,fg),fg+=pg,fg>rg.y+this.height)break;eg.fillStyle=wg}eg.restore(),console.log("_render barcode")}calcEAN13CheckDigit(eg){if(!/^\d{12}$/.test(eg))return"";let gg=0,ig=0;for(let ag=0;ag<12;ag++){const Ig=Number(eg[11-ag]);(ag+1)%2===1?gg+=Ig:ig+=Ig}const og=(gg+ig*3)%10;return og===0?0:10-og}calcEAN8CheckDigit(eg){if(!/^\d{7}$/.test(eg))return"";let gg=0,ig=0;for(let ag=0;ag<7;ag++){const Ig=Number(eg[6-ag]);(ag+1)%2===1?ig+=Ig:gg+=Ig}const og=(gg*3+ig)%10;return og===0?0:10-og}calcUPCACheckDigit(eg){if(!/^\d{11}$/.test(eg))return"";let gg=0,ig=0;for(let Ig=0;Ig<11;Ig++){const sg=parseInt(eg[Ig],10);(Ig+1)%2===1?gg+=sg:ig+=sg}const og=(gg*3+ig)%10;return(og===0?0:10-og).toString()}calcUPCECheckDigit(eg){if(!/^\d{7}$/.test(eg))return"";const gg=eg.split("").map(Number),ig=gg[0],[ng,og,ag,Ig,sg,Cg]=gg.slice(1);let lg="";switch(Cg){case 0:case 1:case 2:lg=`${ig}${ng}${og}${Cg}0000${ag}${Ig}${sg}`;break;case 3:lg=`${ig}${ng}${og}${ag}00000${Ig}${sg}`;break;case 4:lg=`${ig}${ng}${og}${ag}${Ig}00000${sg}`;break;default:lg=`${ig}${ng}${og}${ag}${Ig}${sg}0000${Cg}`}const Ag=lg.split("").map(Number);let cg=0;for(let rg=0;rg<Ag.length;rg++)rg%2===0?cg+=Ag[rg]*3:cg+=Ag[rg];return(10-cg%10)%10}drawUPCAText(eg,gg,ig,ng,og){const ag=gg[0],Ig=gg.substring(1,6),sg=gg.substring(6,11),Cg=gg[11],lg=ng,Ag=ig/95;[{text:ag,x:og+Ag*3.5},{text:Ig,x:og+Ag*28+10},{text:sg,x:og+Ag*67},{text:Cg,x:og+Ag*91.5+10}].forEach(rg=>{rg.text&&eg.fillText(rg.text,rg.x,lg)})}drawUPCEText(eg,gg,ig,ng,og){[{i:0,x:og+4},{i:1,x:og+ig*.25},{i:2,x:og+ig*.33},{i:3,x:og+ig*.44},{i:4,x:og+ig*.56},{i:5,x:og+ig*.68},{i:6,x:og+ig*.78},{i:7,x:og+ig+4}].forEach(Ig=>{gg[Ig.i]&&eg.fillText(gg[Ig.i],Ig.x,ng)})}set(eg,gg){return this._cache&&(this._cache.update=!0),super.set(eg,gg)}setBarcodeOption(eg){eg.bcid!==this.barcodeOptions.bcid&&(this.barcodeBaseWidth=void 0),merge(this.barcodeOptions,eg),this.dirty=!0,this._cache.update=!0;let gg=this.group;for(;gg;)gg.dirty=!0,gg=gg.group;let ig=getAllObjectMap();this.updateBarCode2d([...ig.text,...ig.counter])}updateInGroup(){this.dirty=!0,this.setCoords();let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}getBarcodeOption(){return cloneDeep(this.barcodeOptions)}async updateBarCode2d(eg=[],gg=""){var ig;if(this.concatTextIdListObj||this.connectObjIds&&this.connectObjIds.length>0){let ng=!1,og="",ag=[],Ig=[];const sg=lg=>{if(this.connectObjIds){let Ag=0;for(let cg of this.connectObjIds){if(cg.index=Ag,cg.id&&cg.id===lg.id){ng=!0;let rg=lg.text+"";if(lg.type==="counter"&&(lg._props.mode==="1"?rg=lg.countCurrent():lg._props.mode==="2"&&(lg.updateText({isUpdateBarCodeDate:!1}),rg=lg.text+"")),cg.maxEnd=rg.length,cg.isSplit){cg.start=Math.min(cg.start,cg.maxEnd);let ug=rg.slice(cg.start,cg.end);ag[Ag]=ug}else ag[Ag]=rg}Ag++}}},Cg=lg=>{lg.type==="text"&&this.concatTextIdListObj&&this.concatTextIdListObj[lg.id]&&(ng||(lg==null||lg.set("text",this.barcodeOptions.text),lg.updateInGroup()),Ig.push(lg))};if(eg.length>0)eg.forEach(lg=>{sg(lg),Cg(lg)});else{const lg=Ag=>{Ag.type==="group"&&Ag._objects?Ag._objects.forEach(cg=>lg(cg)):(sg(Ag),Cg(Ag))};(ig=this.canvas)==null||ig.getObjects().forEach(Ag=>lg(Ag))}return ng?(og=ag.join(""),this.barcodeOptions.text=og,this.dirty=!0,this._cache.update=!0,gg&&this.updateInGroup(),Ig.forEach(lg=>{lg.updateInGroup(),lg==null||lg.set("text",og)}),setTimeout(()=>{var lg;(lg=this.canvas)==null||lg.requestRenderAll()},0),og):""}else return""}toObject(eg){let gg=["barcodeOptions","connectObjIds","concatTextIdListObj","counterProps","increaseDate","barcodeDateFormatType","stretchMode","barcodeTextHeight","barcodeTextGap"];return super.toObject(eg?[...eg,...gg]:gg)}};Pl.type="Barcode";let ABarcode=Pl;ABarcode.fromObject=(tg,eg)=>ABarcode._fromObject(tg,{...eg,extraParam:"barcodeOptions"}),tt.setClass(ABarcode),tt.setSVGClass(ABarcode);function getBase64Data({x:tg=0,y:eg=0,Content:gg="",ErrLevel:ig=1,Width:ng=0,Height:og=0,id:ag="",rWidth:Ig=0,rHeight:sg=0,CellSize:Cg="8"}={},lg=""){let Ag=ng/(og||1),cg=`${gg}-${ig}-${ng+og}-${Ag}-${Cg}`;if(lpCodeMap.has(cg)){let rg=lpCodeMap.get(cg);return lg!=="noSaveCache"&&setCacheLpCode({sKey:cg,img:rg,rWidth:Ig,rHeight:sg,x:tg,y:eg}),rg}return new Promise(async(rg,ug)=>{console.log("getLongbeiBase64Data=====");let dg=[JSON.stringify({Content:gg,ErrLevel:ig,Width:ng,Height:og,CellSize:Cg})],bg=await window.dsapi.driverAction.DSLE_Custom_LPCodeCreate(dg);if(bg=JSON.parse(bg),bg.code===0){let mg=bg.payload;if(mg){let hg=await loadBase64ToPic(mg);lpCodeMap.set(cg,hg),lg!=="noSaveCache"&&setCacheLpCode({sKey:cg,img:hg,rWidth:Ig,rHeight:sg,x:tg,y:eg}),rg(hg)}else ug("")}else ug(bg)})}function getMixBase64Data({x:tg=0,y:eg=0,Content:gg="",ErrLevel:ig="",Width:ng=0,Height:og=0,id:ag="",DPI:Ig=203,rWidth:sg=0,rHeight:Cg=0,CellSize:lg="8"}={},Ag=""){let cg=ng/(og||1),rg=`${gg}-${ig}-${ng+og}-${cg}-${lg}`;if(lpCodeMap.has(rg)){let ug=lpCodeMap.get(rg);return Ag!=="noSaveCache"&&setCacheMixLpCode({sKey:rg,img:ug,rWidth:sg,rHeight:Cg,x:tg,y:eg}),ug}return new Promise(async(ug,dg)=>{console.log("getMixLongbeiBase64Data=====");let bg=ig.split("-"),mg=bg[0]||"0",hg=bg[1]||"0",pg=gg.split("|&&&|"),fg=pg.shift(),wg=pg.join("")||fg,Gg=[JSON.stringify({LPContent:fg||"",LPErrLevel:mg,QRContent:wg,QRErrLevel:hg,Width:ng,Height:og,DPI:Ig+"",CellSize:lg})],Zg=await window.dsapi.driverAction.DSLE_Custom_LPMixCreate(Gg);if(Zg=JSON.parse(Zg),Zg.code===0){let yg=Zg.payload;if(yg){let Bg=await loadBase64ToPic(yg);lpCodeMap.set(rg,Bg),Ag!=="noSaveCache"&&setCacheMixLpCode({sKey:rg,img:Bg,rWidth:sg,rHeight:Cg,x:tg,y:eg}),ug(Bg)}else dg("")}else dg(Zg)})}function loadBase64ToPic(tg){return new Promise(async(eg,gg)=>{let ig=new Image;ig.onload=()=>{eg(ig)},ig.src=tg})}let maxCacheLength=2e3;function setCacheLpCode({x:tg=0,y:eg=0,id:gg="",sKey:ig="",img:ng=null,rWidth:og=0,rHeight:ag=0}={}){if(!ig||!ng||!gg)return;let Ig={sKey:ig,img:ng,rWidth:og,rHeight:ag,x:tg,y:eg};if(!cacheLpCodeMap.has(gg))cacheLpCodeMap.set(gg,[Ig]);else{let sg=cacheLpCodeMap.get(gg);sg.length>maxCacheLength&&sg.splice(0,500),sg.push(Ig),cacheLpCodeMap.set(gg,sg)}}function setCacheMixLpCode({x:tg=0,y:eg=0,id:gg="",sKey:ig="",img:ng=null,rWidth:og=0,rHeight:ag=0}={}){if(!ig||!ng||!gg)return;let Ig={sKey:ig,img:ng,rWidth:og,rHeight:ag,x:tg,y:eg};if(!cacheMixLpCodeMap.has(gg))cacheMixLpCodeMap.set(gg,[Ig]);else{let sg=cacheMixLpCodeMap.get(gg);sg.length>maxCacheLength&&sg.splice(0,500),sg.push(Ig),cacheMixLpCodeMap.set(gg,sg)}console.log("cacheMixLpCodeMap========",cacheMixLpCodeMap)}class cappedMap extends Map{constructor(eg=60){super(),this.limit=eg}set(eg,gg){if(!this.has(eg)&&this.size>=this.limit){const ig=this.keys().next().value;this.delete(ig)}return super.set(eg,gg)}}class fastMap extends Map{constructor(eg=60){super(),this.lastKey=null,this.limit=eg}set(eg,gg){if(!this.has(eg)&&this.size>=this.limit){const ig=this.keys().next().value;this.delete(ig)}return this.lastKey=eg,super.set(eg,gg)}getLast(){return super.get(this.lastKey)||null}}let cacheMixLpCodeMap=new fastMap(2e3),cacheLpCodeMap=new fastMap(2e3),errorLpCodeMap=new cappedMap(5555),lpCodeMap=new cappedMap(5555),lpBcid=["LPCode","LPMixQrCode"];function clearLpAndMixCacheById(tg){cacheMixLpCodeMap.has(tg)&&cacheMixLpCodeMap.delete(tg),cacheLpCodeMap.has(tg)&&cacheLpCodeMap.delete(tg)}function getLastCacheLpcode(tg){let eg=cacheLpCodeMap.get(tg);return eg?eg[eg.length-1]:null}function getLastMixCacheLpcode(tg){let eg=cacheMixLpCodeMap.get(tg);return eg?eg[eg.length-1]:null}const isff=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function addEvent(tg,eg,gg,ig){tg.addEventListener?tg.addEventListener(eg,gg,ig):tg.attachEvent&&tg.attachEvent("on".concat(eg),gg)}function removeEvent(tg,eg,gg,ig){tg.removeEventListener?tg.removeEventListener(eg,gg,ig):tg.detachEvent&&tg.detachEvent("on".concat(eg),gg)}function getMods(tg,eg){const gg=eg.slice(0,eg.length-1);for(let ig=0;ig<gg.length;ig++)gg[ig]=tg[gg[ig].toLowerCase()];return gg}function getKeys(tg){typeof tg!="string"&&(tg=""),tg=tg.replace(/\s/g,"");const eg=tg.split(",");let gg=eg.lastIndexOf("");for(;gg>=0;)eg[gg-1]+=",",eg.splice(gg,1),gg=eg.lastIndexOf("");return eg}function compareArray(tg,eg){const gg=tg.length>=eg.length?tg:eg,ig=tg.length>=eg.length?eg:tg;let ng=!0;for(let og=0;og<gg.length;og++)ig.indexOf(gg[og])===-1&&(ng=!1);return ng}const _keyMap={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":isff?173:189,"=":isff?61:187,";":isff?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},_modifier={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},modifierMap={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},_mods={16:!1,18:!1,17:!1,91:!1},_handlers={};for(let tg=1;tg<20;tg++)_keyMap["f".concat(tg)]=111+tg;let _downKeys=[],winListendFocus=null,_scope="all";const elementEventMap=new Map,code=tg=>_keyMap[tg.toLowerCase()]||_modifier[tg.toLowerCase()]||tg.toUpperCase().charCodeAt(0),getKey=tg=>Object.keys(_keyMap).find(eg=>_keyMap[eg]===tg),getModifier=tg=>Object.keys(_modifier).find(eg=>_modifier[eg]===tg);function setScope(tg){_scope=tg||"all"}function getScope(){return _scope||"all"}function getPressedKeyCodes(){return _downKeys.slice(0)}function getPressedKeyString(){return _downKeys.map(tg=>getKey(tg)||getModifier(tg)||String.fromCharCode(tg))}function getAllKeyCodes(){const tg=[];return Object.keys(_handlers).forEach(eg=>{_handlers[eg].forEach(gg=>{let{key:ig,scope:ng,mods:og,shortcut:ag}=gg;tg.push({scope:ng,shortcut:ag,mods:og,keys:ig.split("+").map(Ig=>code(Ig))})})}),tg}function filter(tg){const eg=tg.target||tg.srcElement,{tagName:gg}=eg;let ig=!0;const ng=gg==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(eg.type);return(eg.isContentEditable||(ng||gg==="TEXTAREA"||gg==="SELECT")&&!eg.readOnly)&&(ig=!1),ig}function isPressed(tg){return typeof tg=="string"&&(tg=code(tg)),_downKeys.indexOf(tg)!==-1}function deleteScope(tg,eg){let gg,ig;tg||(tg=getScope());for(const ng in _handlers)if(Object.prototype.hasOwnProperty.call(_handlers,ng))for(gg=_handlers[ng],ig=0;ig<gg.length;)gg[ig].scope===tg?gg.splice(ig,1).forEach(ag=>{let{element:Ig}=ag;return removeKeyEvent(Ig)}):ig++;getScope()===tg&&setScope(eg||"all")}function clearModifier(tg){let eg=tg.keyCode||tg.which||tg.charCode;tg.key&&tg.key.toLowerCase()==="capslock"&&(eg=code(tg.key));const gg=_downKeys.indexOf(eg);if(gg>=0&&_downKeys.splice(gg,1),tg.key&&tg.key.toLowerCase()==="meta"&&_downKeys.splice(0,_downKeys.length),(eg===93||eg===224)&&(eg=91),eg in _mods){_mods[eg]=!1;for(const ig in _modifier)_modifier[ig]===eg&&(hotkeys[ig]=!1)}}function unbind(tg){if(typeof tg>"u")Object.keys(_handlers).forEach(ng=>{Array.isArray(_handlers[ng])&&_handlers[ng].forEach(og=>eachUnbind(og)),delete _handlers[ng]}),removeKeyEvent(null);else if(Array.isArray(tg))tg.forEach(ng=>{ng.key&&eachUnbind(ng)});else if(typeof tg=="object")tg.key&&eachUnbind(tg);else if(typeof tg=="string"){for(var eg=arguments.length,gg=new Array(eg>1?eg-1:0),ig=1;ig<eg;ig++)gg[ig-1]=arguments[ig];let[ng,og]=gg;typeof ng=="function"&&(og=ng,ng=""),eachUnbind({key:tg,scope:ng,method:og,splitKey:"+"})}}const eachUnbind=tg=>{let{key:eg,scope:gg,method:ig,splitKey:ng="+"}=tg;getKeys(eg).forEach(ag=>{const Ig=ag.split(ng),sg=Ig.length,Cg=Ig[sg-1],lg=Cg==="*"?"*":code(Cg);if(!_handlers[lg])return;gg||(gg=getScope());const Ag=sg>1?getMods(_modifier,Ig):[],cg=[];_handlers[lg]=_handlers[lg].filter(rg=>{const dg=(ig?rg.method===ig:!0)&&rg.scope===gg&&compareArray(rg.mods,Ag);return dg&&cg.push(rg.element),!dg}),cg.forEach(rg=>removeKeyEvent(rg))})};function eventHandler(tg,eg,gg,ig){if(eg.element!==ig)return;let ng;if(eg.scope===gg||eg.scope==="all"){ng=eg.mods.length>0;for(const og in _mods)Object.prototype.hasOwnProperty.call(_mods,og)&&(!_mods[og]&&eg.mods.indexOf(+og)>-1||_mods[og]&&eg.mods.indexOf(+og)===-1)&&(ng=!1);(eg.mods.length===0&&!_mods[16]&&!_mods[18]&&!_mods[17]&&!_mods[91]||ng||eg.shortcut==="*")&&(eg.keys=[],eg.keys=eg.keys.concat(_downKeys),eg.method(tg,eg)===!1&&(tg.preventDefault?tg.preventDefault():tg.returnValue=!1,tg.stopPropagation&&tg.stopPropagation(),tg.cancelBubble&&(tg.cancelBubble=!0)))}}function dispatch(tg,eg){const gg=_handlers["*"];let ig=tg.keyCode||tg.which||tg.charCode;if(tg.key&&tg.key.toLowerCase()==="capslock"||!hotkeys.filter.call(this,tg))return;if((ig===93||ig===224)&&(ig=91),_downKeys.indexOf(ig)===-1&&ig!==229&&_downKeys.push(ig),["metaKey","ctrlKey","altKey","shiftKey"].forEach(Ig=>{const sg=modifierMap[Ig];tg[Ig]&&_downKeys.indexOf(sg)===-1?_downKeys.push(sg):!tg[Ig]&&_downKeys.indexOf(sg)>-1?_downKeys.splice(_downKeys.indexOf(sg),1):Ig==="metaKey"&&tg[Ig]&&(_downKeys=_downKeys.filter(Cg=>Cg in modifierMap||Cg===ig))}),ig in _mods){_mods[ig]=!0;for(const Ig in _modifier)if(Object.prototype.hasOwnProperty.call(_modifier,Ig)){const sg=modifierMap[_modifier[Ig]];hotkeys[Ig]=tg[sg]}if(!gg)return}for(const Ig in _mods)Object.prototype.hasOwnProperty.call(_mods,Ig)&&(_mods[Ig]=tg[modifierMap[Ig]]);tg.getModifierState&&!(tg.altKey&&!tg.ctrlKey)&&tg.getModifierState("AltGraph")&&(_downKeys.indexOf(17)===-1&&_downKeys.push(17),_downKeys.indexOf(18)===-1&&_downKeys.push(18),_mods[17]=!0,_mods[18]=!0);const ng=getScope();if(gg)for(let Ig=0;Ig<gg.length;Ig++)gg[Ig].scope===ng&&(tg.type==="keydown"&&gg[Ig].keydown||tg.type==="keyup"&&gg[Ig].keyup)&&eventHandler(tg,gg[Ig],ng,eg);if(!(ig in _handlers))return;const og=_handlers[ig],ag=og.length;for(let Ig=0;Ig<ag;Ig++)if((tg.type==="keydown"&&og[Ig].keydown||tg.type==="keyup"&&og[Ig].keyup)&&og[Ig].key){const sg=og[Ig],{splitKey:Cg}=sg,lg=sg.key.split(Cg),Ag=[];for(let cg=0;cg<lg.length;cg++)Ag.push(code(lg[cg]));Ag.sort().join("")===_downKeys.sort().join("")&&eventHandler(tg,sg,ng,eg)}}function hotkeys(tg,eg,gg){_downKeys=[];const ig=getKeys(tg);let ng=[],og="all",ag=document,Ig=0,sg=!1,Cg=!0,lg="+",Ag=!1,cg=!1;for(gg===void 0&&typeof eg=="function"&&(gg=eg),Object.prototype.toString.call(eg)==="[object Object]"&&(eg.scope&&(og=eg.scope),eg.element&&(ag=eg.element),eg.keyup&&(sg=eg.keyup),eg.keydown!==void 0&&(Cg=eg.keydown),eg.capture!==void 0&&(Ag=eg.capture),typeof eg.splitKey=="string"&&(lg=eg.splitKey),eg.single===!0&&(cg=!0)),typeof eg=="string"&&(og=eg),cg&&unbind(tg,og);Ig<ig.length;Ig++)tg=ig[Ig].split(lg),ng=[],tg.length>1&&(ng=getMods(_modifier,tg)),tg=tg[tg.length-1],tg=tg==="*"?"*":code(tg),tg in _handlers||(_handlers[tg]=[]),_handlers[tg].push({keyup:sg,keydown:Cg,scope:og,mods:ng,shortcut:ig[Ig],method:gg,key:ig[Ig],splitKey:lg,element:ag});if(typeof ag<"u"&&window){if(!elementEventMap.has(ag)){const rg=function(){let dg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return dispatch(dg,ag)},ug=function(){let dg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;dispatch(dg,ag),clearModifier(dg)};elementEventMap.set(ag,{keydownListener:rg,keyupListenr:ug,capture:Ag}),addEvent(ag,"keydown",rg,Ag),addEvent(ag,"keyup",ug,Ag)}if(!winListendFocus){const rg=()=>{_downKeys=[]};winListendFocus={listener:rg,capture:Ag},addEvent(window,"focus",rg,Ag)}}}function trigger(tg){let eg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(_handlers).forEach(gg=>{_handlers[gg].filter(ng=>ng.scope===eg&&ng.shortcut===tg).forEach(ng=>{ng&&ng.method&&ng.method()})})}function removeKeyEvent(tg){const eg=Object.values(_handlers).flat();if(eg.findIndex(ig=>{let{element:ng}=ig;return ng===tg})<0){const{keydownListener:ig,keyupListenr:ng,capture:og}=elementEventMap.get(tg)||{};ig&&ng&&(removeEvent(tg,"keyup",ng,og),removeEvent(tg,"keydown",ig,og),elementEventMap.delete(tg))}if((eg.length<=0||elementEventMap.size<=0)&&(Object.keys(elementEventMap).forEach(ng=>{const{keydownListener:og,keyupListenr:ag,capture:Ig}=elementEventMap.get(ng)||{};og&&ag&&(removeEvent(ng,"keyup",ag,Ig),removeEvent(ng,"keydown",og,Ig),elementEventMap.delete(ng))}),elementEventMap.clear(),Object.keys(_handlers).forEach(ng=>delete _handlers[ng]),winListendFocus)){const{listener:ng,capture:og}=winListendFocus;removeEvent(window,"focus",ng,og),winListendFocus=null}}const _api={getPressedKeyString,setScope,getScope,deleteScope,getPressedKeyCodes,getAllKeyCodes,isPressed,filter,trigger,unbind,keyMap:_keyMap,modifier:_modifier,modifierMap};for(const tg in _api)Object.prototype.hasOwnProperty.call(_api,tg)&&(hotkeys[tg]=_api[tg]);if(typeof window<"u"){const tg=window.hotkeys;hotkeys.noConflict=eg=>(eg&&window.hotkeys===hotkeys&&(window.hotkeys=tg),hotkeys),window.hotkeys=hotkeys}class EditorData{constructor(){this.enabled=!0,this.dirty=!1,this.originState="",this.hasSetActiveSelection=!1,this.handle={selectionHandles:new Set,modifyHandles:new Set,mouseDownHandles:new Set,mouseUpHandles:new Set,doubleClickHandles:new Set,objectUpdateHandles:new Set,mouseOverHandles:new Set,mouseOutHandles:new Set,checkDirtyHandles:new Set},this.selectHandle=eg=>{if(this.enabled)for(const gg of this.handle.selectionHandles)if(eg.selected){const ig=this.canvas.getActiveObject();gg(eg.e,ig?[ig]:[]),this.canvas&&this.canvas.elements.container.focus({preventScroll:!0})}else gg(eg.e,[])},this.modifyHandle=throttle$3(eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))){if(eg.target)for(const gg of this.handle.modifyHandles)gg(eg.e,eg.target);this.checkDirty(eg)}},200),this.doubleClickHandle=eg=>{var gg,ig;if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target){eg.target.type==="table"&&eg.scenePoint&&(this.canvas.getActiveObject()!==eg.target&&(this.canvas.setActiveObject(eg.target,eg.e),this.canvas.requestRenderAll()),(ig=(gg=eg.target).handleCellDoubleClick)==null||ig.call(gg,eg.scenePoint));for(const ng of this.handle.doubleClickHandles)ng(eg.e,eg.target)}},this.mouseDownHandle=eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target)for(const gg of this.handle.mouseDownHandles)gg(eg.e,eg.target)},this.mouseUpHandle=eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))&&eg.target)for(const gg of this.handle.mouseUpHandles)gg(eg.e,eg.target)},this.checkDirty=debounce$2(eg=>{if(!this.canvas)return!1;const gg=this.canvas.toJSON(),ig=JSON.stringify(gg);this.originState||(this.originState=ig),this.dirty=this.originState!==ig,eg.isToDirty&&(this.dirty=!0),console.log("this.dirty=========",this.dirty);for(const ng of this.handle.checkDirtyHandles)ng();return this.dirty},100),this.objectUpdateHandle=debounce$2(eg=>{if(!(!this.enabled||this.isWorkspace(eg.target))){for(const gg of this.handle.objectUpdateHandles)gg(eg.target);this.checkDirty(eg)}},100),this.mouseOver=eg=>{for(const gg of this.handle.mouseOverHandles)gg()},this.mouseOut=eg=>{for(const gg of this.handle.mouseOutHandles)gg()}}init(eg){this.editor=eg,this.canvas=eg.getCanvas(),this.bind(),this.originState=JSON.stringify(this.canvas.toJSON())}getActiveObject(){return this.canvas.getActiveObject()}getActiveObjects(){return this.canvas.getActiveObjects()}getObjects(){return this.canvas.getObjects()||[]}getAllObjects(){if(!this.canvas)return[];const eg=[];function gg(ig){ig.type==="group"&&ig._objects?ig._objects.forEach(ng=>gg(ng)):ig.id!=="workspace"&&eg.push(ig)}return this.canvas.getObjects().forEach(ig=>gg(ig)),eg}clearActiveSelection(){this.canvas&&this.hasSetActiveSelection&&(this.canvas.discardActiveObject(),this.canvas.requestRenderAll(),this.hasSetActiveSelection=!1)}setObjectsActive(eg){if(!(!this.canvas||eg.length===0)){if(this.canvas.discardActiveObject(),eg.length===1)this.canvas.setActiveObject(eg[0]);else{this.hasSetActiveSelection=!0;const gg=new Jo(eg,{canvas:this.canvas});this.canvas.setActiveObject(gg)}this.canvas.requestRenderAll()}}getObjectsList(){if(!this.canvas)return[];const eg=this.canvas.getObjects(),gg=[];for(const ig of eg)if(ig.id!=="workspace"&&ig.drawObjectType!=="ignoreObject"){if(ig instanceof Jo)continue;ig.parent?ig.parent instanceof Jo?gg.push(ig):console.log("obj.parent isn't ActiveSelection",ig.parent,ig.parent.type):gg.push(ig)}return gg}setActiveObjectProps(eg,gg=!0){if(this.canvas){const ig=this.canvas.getActiveObject();if(ig){for(const ng in eg)console.error("objet set",ng,eg[ng]),ig.type==="text"?(ig.set(ng,eg[ng]),ig.splitByGrapheme&&ig.verticalTypeChange()):ig.set(ng,eg[ng]);return gg&&this.canvas.fire("custom:object:history",{target:ig,action:"history:update"}),!0}}return!1}setActiveObjectPos(eg){var gg;this.setActiveObjectProps(eg)&&((gg=this.canvas)==null||gg.getActiveObject().setCoords())}updateCanvas(){this.canvas.renderAll()}addModifyHandle(eg){this.handle.modifyHandles.add(eg)}addSelectionHandle(eg){this.handle.selectionHandles.add(eg)}addMouseDownHandle(eg){this.handle.mouseDownHandles.add(eg)}addMouseUpHandle(eg){this.handle.mouseUpHandles.add(eg)}addDoubleClickHandle(eg){this.handle.doubleClickHandles.add(eg)}addObjectUpdateHandle(eg){this.handle.objectUpdateHandles.add(eg)}addMouseOverHandle(eg){this.handle.mouseOverHandles.add(eg)}addMouseOutHandle(eg){this.handle.mouseOutHandles.add(eg)}removeMouseOverHandle(eg){this.handle.mouseOverHandles.delete(eg)}removeMouseOutHandle(eg){this.handle.mouseOutHandles.delete(eg)}removeModifyHandle(eg){this.handle.modifyHandles.delete(eg)}removeSelectionHandle(eg){this.handle.selectionHandles.delete(eg)}removeMouseDownHandle(eg){this.handle.mouseDownHandles.delete(eg)}removeMouseUpHandle(eg){this.handle.mouseUpHandles.delete(eg)}removeDoubleClickHandle(eg){this.handle.doubleClickHandles.delete(eg)}remvoeObjectUpdateHandle(eg){this.handle.objectUpdateHandles.delete(eg)}addCheckDirtyHandles(eg){this.handle.checkDirtyHandles.add(eg)}removeCheckDirtyHandles(eg){this.handle.checkDirtyHandles.delete(eg)}setOriginState(){if(!this.canvas)return!1;const eg=this.canvas.toJSON(),gg=JSON.stringify(eg);this.originState=gg}isWorkspace(eg){return eg&&eg.id==="workspace"}setEnabled(eg){this.enabled=eg}bind(){if(!this.canvas)return;const eg=this.canvas,gg=eg.findTarget.bind(eg);eg.findTarget=ig=>{if(ig&&ig.type==="dblclick"){const ng=[],og=[];for(const Ig of eg.getObjects())Ig.type==="table"&&Ig.perPixelTargetFind&&(ng.push(Ig),og.push(Ig.perPixelTargetFind),Ig.perPixelTargetFind=!1);const ag=gg(ig);return ng.forEach((Ig,sg)=>{Ig.perPixelTargetFind=og[sg]}),ag}return gg(ig)},eg.on("selection:created",this.selectHandle),eg.on("selection:updated",this.selectHandle),eg.on("selection:cleared",this.selectHandle),eg.on("object:modified",this.modifyHandle),eg.on("object:scaling",this.modifyHandle),eg.on("object:rotating",this.modifyHandle),eg.on("object:moving",this.modifyHandle),eg.on("object:skewing",this.modifyHandle),eg.on("custom:object:changed",this.modifyHandle),eg.on("custom:object:basechanged",this.modifyHandle),eg.on("mouse:dblclick",this.doubleClickHandle),eg.on("mouse:down",this.mouseDownHandle),eg.on("mouse:up",this.mouseUpHandle),eg.on("object:added",this.objectUpdateHandle),eg.on("object:removed",this.objectUpdateHandle),eg.on("custom:object:checkdirty",this.checkDirty),this.editor.on("group",this.objectUpdateHandle),this.editor.on("ungroup",this.objectUpdateHandle)}unbind(){if(!this.canvas)return;const eg=this.canvas;eg.off("selection:created",this.selectHandle),eg.off("selection:updated",this.selectHandle),eg.off("selection:cleared",this.selectHandle),eg.off("object:modified",this.modifyHandle),eg.off("object:scaling",this.modifyHandle),eg.off("object:rotating",this.modifyHandle),eg.off("object:moving",this.modifyHandle),eg.off("object:skewing",this.modifyHandle),eg.off("custom:object:changed",this.modifyHandle),eg.off("custom:object:basechanged",this.modifyHandle),eg.off("mouse:dblclick",this.doubleClickHandle),eg.off("mouse:down",this.mouseDownHandle),eg.off("mouse:up",this.mouseUpHandle),eg.off("object:added",this.objectUpdateHandle),eg.off("object:removed",this.objectUpdateHandle),eg.off("custom:object:checkdirty",this.checkDirty),this.editor.off("group",this.objectUpdateHandle),this.editor.off("ungroup",this.objectUpdateHandle)}}const byteToHex=[];for(let tg=0;tg<256;++tg)byteToHex.push((tg+256).toString(16).slice(1));function unsafeStringify(tg,eg=0){return(byteToHex[tg[eg+0]]+byteToHex[tg[eg+1]]+byteToHex[tg[eg+2]]+byteToHex[tg[eg+3]]+"-"+byteToHex[tg[eg+4]]+byteToHex[tg[eg+5]]+"-"+byteToHex[tg[eg+6]]+byteToHex[tg[eg+7]]+"-"+byteToHex[tg[eg+8]]+byteToHex[tg[eg+9]]+"-"+byteToHex[tg[eg+10]]+byteToHex[tg[eg+11]]+byteToHex[tg[eg+12]]+byteToHex[tg[eg+13]]+byteToHex[tg[eg+14]]+byteToHex[tg[eg+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(tg,eg,gg){var ng;if(native.randomUUID&&!tg)return native.randomUUID();tg=tg||{};const ig=tg.random??((ng=tg.rng)==null?void 0:ng.call(tg))??rng();if(ig.length<16)throw new Error("Random bytes length must be >= 16");return ig[6]=ig[6]&15|64,ig[8]=ig[8]&63|128,unsafeStringify(ig)}function handleConcatBarcode2d(tg,eg,gg=!0,ig=null){if(tg){let ng=[],og=getAllObjectMap(eg);ng=[...og.text,...og.counter];let ag=[...og.barcode2d],Ig=[...og.barcode],sg={};ag.forEach(lg=>{sg[lg.id]=lg});let Cg={};Ig.forEach(lg=>{Cg[lg.id]=lg});for(let lg of Object.keys(tg)){if(ag.length){let Ag=sg[lg];if(!Ag)return;let cg=!0;if(ig&&ig.type==="counter"&&ig.data==="2"&&(Ag.barcode2dOptions.bcid==="LPCode"?(cg=!Ag.hasLpemit,Ag.hasLpemit=!0):Ag.barcode2dOptions.bcid==="LPMixQrCode"&&(cg=!Ag.hasLpMixemit,Ag.hasLpMixemit=!0)),!cg)return;canvasEventBus.emit(`update:barcode2d:${lg}`,{list:ng,callback:rg=>{Ag.dirty=!0,Ag.barcode2dOptions.text=rg||Ag.barcode2dOptions.text,Ag.updateInGroup(),gg&&setTimeout(()=>{eg==null||eg.requestRenderAll()},30)}})}if(Ig.length){let Ag=Cg[lg];if(!Ag)return;canvasEventBus.emit(`update:barcode:${lg}`,{list:ng,callback:cg=>{Ag.dirty=!0,Ag.barcodeOptions.text=cg||Ag.barcodeOptions.text,Ag.updateInGroup(),gg&&setTimeout(()=>{eg==null||eg.requestRenderAll(),Ag.group&&setTimeout(()=>{Ag.updateInGroup(),eg==null||eg.requestRenderAll()},0)},30)}})}}}}function addHandle(tg,eg,gg){if(tg){let ig={},ng=getAllObjectMap(eg);[...ng.barcode2d,...ng.barcode].forEach(ag=>{ig[ag.id]=ag});for(let ag of Object.keys(tg)){let Ig=ig[ag];if(Ig){let sg=Ig.connectObjIds||[],Cg=cacheObj[gg];Cg&&(sg.some(lg=>lg.id===Cg.id)||(sg.splice(Cg.index,0,Cg),Ig.set("connectObjIds",sg)))}}}}let cacheObj={};function deleteHandle(tg,eg,gg){if(tg){let ig={},ng=getAllObjectMap(eg);[...ng.barcode2d,...ng.barcode].forEach(ag=>{ig[ag.id]=ag});for(let ag of Object.keys(tg)){let Ig=ig[ag];if(Ig){let sg=Ig.connectObjIds||[];sg=sg.filter(Cg=>(Cg.id===gg&&(cacheObj[gg]=Cg),Cg.id!==gg)),Ig.set("connectObjIds",sg)}}}}const eC=class eC extends No{constructor(eg,gg){if(super(eg,gg),this.hasSetSplit=!1,this.objectCaching=!0,this.hasSetItalic=!1,this.isClearCopyTextStyle=!1,this.propsMinHeight=0,this.strokeUniform=!0,this.isBgBlackColor=!1,this.customExportFields={varnish:"none"},this.backgroundColor="",this.connectBar2dMap=null,this.__canvasRef=null,this.fontFamily="微软雅黑",this.verticalType="top",this.arcEnable=!1,this.arcRadius=100,this.customExportFields=gg.customExportFields??this.customExportFields,this._originGetTopOffset=this._getTopOffset?this._getTopOffset.bind(this):()=>0,this.fontFamily=gg.fontFamily??this.fontFamily,gg.hasSetItalic&&gg.fontStyle!=="italic"&&(this.fontStyle="italic",gg.skewX===-15&&(this.skewX=0)),gg.propsMinHeight){this.propsMinHeight=gg.propsMinHeight;let ig=Math.max(this.height,this.propsMinHeight);this.height=ig}gg.verticalType&&(this.verticalType=gg.verticalType),gg.backgroundColor&&(this.backgroundColor=gg.backgroundColor),this.isBgBlackColor=gg.isBgBlackColor??this.isBgBlackColor,this.connectBar2dMap=gg.connectBar2dMap??this.connectBar2dMap,gg.arcEnable!==void 0&&(this.arcEnable=gg.arcEnable),gg.arcRadius!==void 0&&(this.arcRadius=gg.arcRadius),this.on("removed",ig=>{if(ig.target.type!=="activeselection"){if(this.inGroupRemove){this.inGroupRemove=!1;return}deleteHandle(this.connectBar2dMap,this.__canvasRef,this.id)}}),this.on("added",()=>{this.__canvasRef=this.canvas,addHandle(this.connectBar2dMap,this.__canvasRef,this.id)}),this.on("modified",ig=>{(ig==null?void 0:ig.action)!=="drag"&&this.type==="text"&&(this.verticalTypeChange(),this.tiggerHandleConcatBarcode2d())}),this.on("changed",()=>{this.type==="text"&&this.verticalTypeChange()}),this.verticalTypeChange()}tiggerHandleConcatBarcode2d(){this.connectBar2dMap&&handleConcatBarcode2d(this.connectBar2dMap,this.canvas)}updateInGroup(){this.dirty=!0,this.setCoords();let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}_calcTextHeight(){const eg=this._textLines&&this._textLines.length||0,gg=this.fontSize*this.lineHeight,ig=(this.padding||0)*2;return eg*gg+ig}verticalTypeChange(){var gg;if(!this.splitByGrapheme||!this.propsMinHeight)return;const eg=Math.max(this._calcTextHeight(),this.propsMinHeight);this.height!==eg&&(this.height=eg),this.verticalType==="top"?this._getTopOffset=this._originGetTopOffset:this.verticalType==="vcenter"?this._getTopOffset=()=>{let ig=this._calcTextHeight();return(this.fontSize*this.lineHeight-this.fontSize)/2-ig/2}:this.verticalType==="bottom"&&(this._getTopOffset=()=>{const ig=this._calcTextHeight(),og=Math.max(ig,this.propsMinHeight)-ig;return this._originGetTopOffset()+og}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}set(eg,gg){if(eg==="hasSetItalic")return this.hasSetItalic=!1,gg===!0?super.set("fontStyle","italic"):this;if(typeof eg=="object"&&eg){const ig={...eg};return"hasSetItalic"in ig&&(ig.hasSetItalic===!0&&(ig.fontStyle="italic"),delete ig.hasSetItalic),super.set(ig)}return(eg==="fill"||eg==="stroke"||eg==="underline"||eg==="overline"||eg==="linethrough"||eg==="fontWeight"||eg==="fontStyle")&&(this.styles={}),super.set(eg,gg)}set locked(eg){super.locked=eg,this.editable=!eg}get locked(){return super.locked}_measureLine(eg){let gg=this._textLines[eg];return Array.isArray(gg)&&(gg=gg.map(ig=>ig.replace(" "," "))),this._textLines[eg]=gg,super._measureLine(eg)}getStandardSpaceWidth(eg=" ",gg="Arial"){const ng=kn.createCanvasElement().getContext("2d");let og=0;return ng&&(ng.font=`${this.fontSize}px ${gg}`,og=ng.measureText(eg).width),og}getTextWidth(eg="",gg=0,ig="Arial"){const og=kn.createCanvasElement().getContext("2d");let ag=0;return og&&(og.font=`${gg}px ${ig}`,ag=og.measureText(eg).width),ag}getTextHeight(eg="测",gg=!0){const ng=kn.createCanvasElement().getContext("2d");let og=0;if(ng){ng.font=`${this.fontSize}px ${this.fontFamily}`;let ag=ng.measureText(eg);og=ag.fontBoundingBoxAscent+ag.fontBoundingBoxDescent+(gg?Math.trunc(this.fontSize/3):0)}return og*this._textLines.length}_measureChar(eg,gg,ig,ng){if(eg!==" "&&eg!==" ")return super._measureChar(eg,gg,ig,ng);{const og=this.getStandardSpaceWidth(" ",this.fontFamily);return{width:og,kernedWidth:og}}}parseColor(eg){if(!eg)return null;if(eg.startsWith("#")){let ig=eg.slice(1);ig.length===3&&(ig=ig.split("").map(og=>og+og).join(""));const ng=parseInt(ig,16);return{r:ng>>16&255,g:ng>>8&255,b:ng&255,a:1}}const gg=eg.match(/rgba?\(([^)]+)\)/);if(gg){const[ig,ng,og,ag=1]=gg[1].split(",").map(Ig=>Number(Ig.trim()));return{r:ig,g:ng,b:og,a:ag}}return null}luminance({r:eg,g:gg,b:ig}){return .2126*eg+.7152*gg+.0722*ig}isDark(eg,gg=40){const ig=this.parseColor(eg);return ig?this.luminance(ig)<=gg:!1}_renderArcText(eg){const gg=this.text.replace(/\u00A0/g," "),ig=this.fontSize,ng=Math.abs(this.arcRadius),og=this.arcRadius>=0;eg.save(),eg.font=`${this.fontStyle==="italic"?"italic ":""}${this.fontWeight==="bold"?"bold ":""}${ig}px ${this.fontFamily}`,eg.fillStyle=this.fill||"#000000",eg.textAlign="center",eg.textBaseline="middle";const ag=(this.charSpacing||0)/1e3*ig,Ig=[];let sg=0;for(const ug of gg){const dg=eg.measureText(ug).width+ag;Ig.push(dg),sg+=dg}const Cg=sg/ng,lg=ng-ng*Math.cos(Cg/2),Ag=og?ng-lg/2:-(ng-lg/2);let rg=(og?-Math.PI/2:Math.PI/2)-Cg/2;for(let ug=0;ug<gg.length;ug++){const dg=gg[ug],bg=Ig[ug]/2,mg=rg+bg/ng,hg=Math.cos(mg)*ng,pg=Math.sin(mg)*ng;eg.save(),eg.translate(hg,Ag+pg),og?eg.rotate(mg+Math.PI/2):eg.rotate(mg-Math.PI/2),eg.fillText(dg,0,0),eg.restore(),rg+=Ig[ug]/ng}eg.restore()}_getArcParams(){const eg=this.text.replace(/\u00A0/g," "),gg=this.fontSize,ig=Math.abs(this.arcRadius),ng=this.arcRadius>=0,ag=kn.createCanvasElement().getContext("2d");ag.font=`${this.fontStyle==="italic"?"italic ":""}${this.fontWeight==="bold"?"bold ":""}${gg}px ${this.fontFamily}`;const Ig=(this.charSpacing||0)/1e3*gg,sg=[];let Cg=0;for(const ug of eg){const dg=ag.measureText(ug).width+Ig;sg.push(dg),Cg+=dg}const lg=Cg/ig,Ag=ig-ig*Math.cos(lg/2),cg=ng?ig-Ag/2:-(ig-Ag/2),rg=ng?-Math.PI/2:Math.PI/2;return{text:eg,fontSize:gg,r:ig,bendUp:ng,charWidths:sg,totalWidth:Cg,totalAngle:lg,sagitta:Ag,circleCenterOffsetY:cg,baseAngle:rg}}_getArcCursorInfo(eg){const{text:gg,r:ig,bendUp:ng,charWidths:og,totalAngle:ag,circleCenterOffsetY:Ig,baseAngle:sg}=this._getArcParams();let Cg=0;for(let bg=0;bg<Math.min(eg,gg.length);bg++)Cg+=og[bg]/ig;const lg=sg-ag/2+Cg,Ag=Math.cos(lg)*ig,cg=Math.sin(lg)*ig,rg=Ag,ug=Ig+cg,dg=ng?lg+Math.PI/2:lg-Math.PI/2;return{x:rg,y:ug,angle:dg}}_calcArcBoundingBox(){const{text:eg,r:gg,bendUp:ig,charWidths:ng,totalAngle:og,circleCenterOffsetY:ag,baseAngle:Ig}=this._getArcParams(),sg=this.fontSize,Cg=sg/2+4;if(!eg.length)return{w:sg+Cg*2,h:sg*1.2+Cg*2};let lg=1/0,Ag=-1/0,cg=1/0,rg=-1/0,ug=Ig-og/2;for(let mg=0;mg<eg.length;mg++){const hg=ug,pg=ug+ng[mg]/gg,fg=(hg+pg)/2,wg=Math.cos(fg)*gg,Gg=Math.sin(fg)*gg,Zg=wg,yg=ag+Gg,Bg=ig?fg+Math.PI/2:fg-Math.PI/2,Wg=Math.cos(Bg),$g=Math.sin(Bg),Ng=ng[mg]/2+Cg,vg=sg/2+Cg,Xg=[{dx:-Ng,dy:-vg},{dx:Ng,dy:-vg},{dx:Ng,dy:vg},{dx:-Ng,dy:vg}];for(const{dx:Vg,dy:Mg}of Xg){const Rg=Zg+Vg*Wg-Mg*$g,Sg=yg+Vg*$g+Mg*Wg;Rg<lg&&(lg=Rg),Rg>Ag&&(Ag=Rg),Sg<cg&&(cg=Sg),Sg>rg&&(rg=Sg)}ug=pg}const dg=Ag-lg,bg=rg-cg;return{w:Math.max(dg,1),h:Math.max(bg,1)}}initDimensions(){if(this.arcEnable&&!this.splitByGrapheme){this._splitText(),this._clearCache(),this.dirty=!0;const eg=this._calcArcBoundingBox();this.width=eg.w,this.height=eg.h}else super.initDimensions()}_render(eg){this.arcEnable&&!this.splitByGrapheme?this._renderArcText(eg):super._render(eg)}__getCursorBoundariesOffsets(eg){if(this.arcEnable&&!this.splitByGrapheme){const{charIndex:gg}=this.get2DCursorLocation(eg),ig=this._getArcCursorInfo(gg);return{left:ig.x+this.width/2,top:ig.y+this.height/2}}return super.__getCursorBoundariesOffsets(eg)}_renderCursor(eg,gg,ig){if(this.arcEnable&&!this.splitByGrapheme){const{charIndex:ng}=this.get2DCursorLocation(ig),og=this._getArcCursorInfo(ng),ag=this.fontSize,Ig=this.getObjectScaling().x*this.canvas.getZoom(),sg=this.cursorWidth/Ig;eg.save(),eg.fillStyle=this.cursorColor||this.fill||"#000000",eg.globalAlpha=this._currentCursorOpacity,eg.translate(og.x,og.y),eg.rotate(og.angle),eg.fillRect(-sg/2,-ag/2,sg,ag),eg.restore()}else super._renderCursor(eg,gg,ig)}getSelectionStartFromPointer(eg){if(this.arcEnable&&!this.splitByGrapheme){const gg=this.canvas.getScenePoint(eg).transform(kn.invertTransform(this.calcTransformMatrix())),{text:ig,r:ng,bendUp:og,charWidths:ag,totalAngle:Ig,circleCenterOffsetY:sg,baseAngle:Cg}=this._getArcParams();let lg=1/0,Ag=0,cg=Cg-Ig/2;for(let rg=0;rg<=ig.length;rg++){const ug=cg,dg=Math.cos(ug)*ng,bg=Math.sin(ug)*ng,mg=dg,hg=sg+bg,pg=gg.x-mg,fg=gg.y-hg,wg=pg*pg+fg*fg;wg<lg&&(lg=wg,Ag=rg),rg<ig.length&&(cg+=ag[rg]/ng)}return Math.min(Ag,this._text.length)}return super.getSelectionStartFromPointer(eg)}_renderSelection(eg,gg,ig){if(this.arcEnable&&!this.splitByGrapheme){const{text:ng,r:og,bendUp:ag,charWidths:Ig,totalAngle:sg,circleCenterOffsetY:Cg,baseAngle:lg}=this._getArcParams(),Ag=this.fontSize,cg=Math.min(gg.selectionStart,gg.selectionEnd),rg=Math.max(gg.selectionStart,gg.selectionEnd);eg.save(),eg.fillStyle=this.selectionColor||"rgba(0,0,255,0.3)";let ug=lg-sg/2;for(let dg=0;dg<ng.length;dg++){const bg=ug,mg=ug+Ig[dg]/og,hg=(bg+mg)/2;if(dg>=cg&&dg<rg){const pg=Math.cos(hg)*og,fg=Math.sin(hg)*og,wg=pg,Gg=Cg+fg,Zg=ag?hg+Math.PI/2:hg-Math.PI/2;eg.save(),eg.translate(wg,Gg),eg.rotate(Zg),eg.fillRect(-Ig[dg]/2,-Ag/2,Ig[dg],Ag),eg.restore()}ug=mg}eg.restore()}else super._renderSelection(eg,gg,ig)}render(eg){if(eg.shadowBlur=0,eg.shadowColor="transparent",eg.imageSmoothingEnabled=!1,eg.textRendering="geometricPrecision",this.isClearCopyTextStyle&&(this.styles={},this.isClearCopyTextStyle=!1),this.splitByGrapheme){let gg=this.width*this.scaleX,ig=this.height*this.scaleY,ng=this.getTextHeight();ig<ng&&(ig=ng),this.hasSetSplit=!0,(gg!==this.width||ig!==this.height||this.scaleY!==1)&&(this.set({width:gg,height:ig,scaleX:1,scaleY:1}),this.height=ig,this.propsMinHeight=this.height,this.setCoords())}else if(this.arcEnable){this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this._calcArcBoundingBox();(this.width!==gg.w||this.height!==gg.h||this.scaleX!==1||this.scaleY!==1)&&(this.set({width:gg.w,height:gg.h,scaleX:1,scaleY:1}),this.setCoords()),this._forceClearCache=!0}else{this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this.text.replace(/ /g," ");gg!==this.text&&(this.text=gg);let ig=eg.measureText(this.text);ig.width!==this.width&&this.set({width:ig.width}),this._forceClearCache=!0}this.objectCaching=this.charSpacing<=1e5&&this.text.length<=800,this.dirty=!0,super.render(eg)}toObject(eg){let gg=["propsMinHeight","verticalType","backgroundColor","isBgBlackColor","fromBarCodeID","fromBarCode2dID","connectBar2dMap","arcEnable","arcRadius"];return super.toObject(eg?[...eg,...gg]:gg)}};eC.type="Text";let AText=eC;tt.setClass(AText);const aC=class aC extends AText{constructor(eg,gg){super("",gg),this.update=!0,this.reviewValueArgs=null,this.toStopDateUpdateBarcode=!1,this.fontSize=ptToPx$1(12),this.increaseYearVal=0,this.increaseMonthVal=0,this.increaseDayVal=0,this.charSpacing=1,this.fontFamily="微软雅黑",console.log("ACounter",eg),this.props=eg,this._props.mode==="3"&&this.updateText(),aC.isMode1Args(this._props.args)&&(this._props.args.nextValue=void 0),this.fontSize=gg.fontSize??this.fontSize,this.charSpacing=gg.charSpacing??this.charSpacing,this.fontFamily=gg.fontFamily??this.fontFamily,this.increaseYearVal=gg.increaseYearVal??this.increaseYearVal,this.increaseMonthVal=gg.increaseMonthVal??this.increaseMonthVal,this.increaseDayVal=gg.increaseDayVal??this.increaseDayVal}render(eg){console.log("_render======"),this.updateText(),super.render(eg)}reviewRecover(){if(this._props.mode==="1"&&aC.isMode1Args(this._props.args)&&this.reviewValueArgs){this._props.args=this.reviewValueArgs,this.reviewValueArgs=null;const eg=this._props.args,gg=formatCounterValue(eg);this.text=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:""),this.dirty=!1,this.update=!1,this._forceClearCache=!0}}countCurrent(){if(this._props.mode==="1"){const eg=this._props.args;if(!eg.value&&eg.value!==0)return"";const gg=formatCounterValue(eg);return(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"")}return""}countNext(eg="print"){if(this._props.mode==="1"&&aC.isMode1Args(this._props.args)){const gg=this._props.args;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);this.text=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const ng=getNextCounterValue(gg);ng!==null&&(gg.value=ng,console.log("update value f",gg.value)),this.update=!0,this.dirty=!0,this._forceClearCache=!0}}updateText({isUpdateBarCodeDate:eg=!0}={}){if(this.update&&this._props.mode==="1")if(aC.isMode1Args(this._props.args)){const gg=this._props.args;if(!gg.value&&gg.value!==0)return;const ig=formatCounterValue(gg);this.text=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:""),this.dirty=!0,this._forceClearCache=!0,console.log("updateText",this.text,gg)}else return;else if(this._props.mode==="2")if(aC.isMode2Args(this._props.args)){if(!this.toStopDateUpdateBarcode){const gg=formatDate(this._props.args.format,{years:this.increaseYearVal,months:this.increaseMonthVal,days:this.increaseDayVal});console.log("formatted",this._props.args.format,gg),this.text=gg,this.dirty=!0,this._forceClearCache=!0,eg&&handleConcatBarcode2d(this.connectBar2dMap,this.canvas,!1,{type:this.type,data:this._props.mode})}}else return;else this.update&&this._props.mode==="3"&&aC.isMode3Args(this._props.args)&&(this.text=this._props.args.text,this.dirty=!0,this._forceClearCache=!0);this.set("dirty",!0),this.update&&(this.initDimensions(),this.setCoords(),this.update=!1,this.canvas&&this._props.mode!=="2"&&(handleConcatBarcode2d(this.connectBar2dMap,this.canvas),this.canvas.fire("custom:object:changed",{target:this})))}set(eg,gg){return super.set(eg,gg)}set props(eg){this.editable=eg.mode==="3",this._props=eg,this.dirty=!0,this.update=!0}get props(){return this._props}static isMode1Args(eg){return"value"in eg}static isMode2Args(eg){return"format"in eg}static isMode3Args(eg){return"text"in eg}toObject(eg){aC.isMode3Args(this._props.args)&&(this._props.args.text=this.text);let gg=["connectBar2dMap","increaseYearVal","increaseMonthVal","increaseDayVal"];return super.toObject(eg?[...eg,"_props",...gg]:["_props",...gg])}};aC.type="Counter";let ACounter=aC;ACounter.fromObject=tg=>ACounter._fromObject(tg,{extraParam:"_props"}),tt.setClass(ACounter),tt.setSVGClass(ACounter);const Yc=class Yc extends na{constructor(eg,gg){super(eg,gg),this.imgScaleType="1",this.originRatio=0,this.setGrayFilter=!1,this.isScaleOtherSidedys=!1,this.isSetSharpen=!1,this.imageAlign="leftTop",this.customExportFields={varnish:"none"},this.prevCoordsPoints=null,this.gasolineLayer="none",this.noSetOtherPrevCoordsPoints=!1,this.customExportFields=gg.customExportFields??this.customExportFields,gg.imgScaleType&&(this.imgScaleType=gg.imgScaleType),gg.setGrayFilter&&(this.setGrayFilter=gg.setGrayFilter),this.isScaleOtherSidedys=gg.isScaleOtherSidedys??this.isScaleOtherSidedys,this.isSetSharpen=gg.isSetSharpen??this.isSetSharpen,this.imageAlign=gg.imageAlign??this.imageAlign,this.prevCoordsPoints=gg.prevCoordsPoints??this.prevCoordsPoints,this.gasolineLayer=gg.gasolineLayer??this.gasolineLayer}refreshAlignCoords(eg=203){var gg;if(this.prevCoordsPoints){this.setCoords();let ig=o.DPI/eg;const{bl:ng,br:og,tl:ag,tr:Ig}=this.aCoords,{bl:sg,br:Cg,tl:lg,tr:Ag}=this.prevCoordsPoints;sg.x=sg.x*ig,sg.y=sg.y*ig,Cg.x=Cg.x*ig,Cg.y=Cg.y*ig,lg.x=lg.x*ig,lg.y=lg.y*ig,Ag.x=Ag.x*ig,Ag.y=Ag.y*ig;const cg={x:0,y:0};switch(this.imageAlign){case"leftTop":break;case"leftBottom":cg.x=sg.x-ng.x,cg.y=sg.y-ng.y;break;case"leftCenter":let rg={x:ng.x,y:(ng.y-ag.y)/2},ug={x:sg.x,y:(sg.y-lg.y)/2};cg.x=ug.x-rg.x,cg.y=ug.y-rg.y;break;case"topCenter":let dg={x:(Ig.x-ag.x)/2,y:Ig.y},bg={x:(Ag.x-lg.x)/2,y:Ag.y};cg.x=bg.x-dg.x,cg.y=bg.y-dg.y;break;case"rightCenter":let mg={x:Ig.x,y:(og.y-Ig.y)/2},hg={x:Ag.x,y:(Cg.y-Ag.y)/2};cg.x=hg.x-mg.x,cg.y=hg.y-mg.y;break;case"bottomCenter":let pg={x:(og.x-ng.x)/2,y:og.y},fg={x:(Cg.x-sg.x)/2,y:Cg.y};cg.x=fg.x-pg.x,cg.y=fg.y-pg.y;break;case"center":let wg={x:(Ig.x-ag.x)/2,y:(ng.y-ag.y)/2},Gg={x:(Ag.x-lg.x)/2,y:(sg.y-lg.y)/2};cg.x=Gg.x-wg.x,cg.y=Gg.y-wg.y;break;case"rightTop":cg.x=Ag.x-Ig.x,cg.y=Ag.y-Ig.y;break;case"rightBottom":cg.x=Cg.x-og.x,cg.y=Cg.y-og.y;break}this.set({left:this.left+cg.x,top:this.top+cg.y}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}}_render(eg){const gg=this._element;if(!gg)return;let ig=this._filterScalingX,ng=this._filterScalingY,og=this.width,ag=this.height,Ig=Math.max(this.cropX,0),sg=Math.max(this.cropY,0),Cg=gg.naturalWidth||gg.width,lg=gg.naturalHeight||gg.height,Ag=Ig*ig,cg=sg*ng,rg=-og/2,ug=-ag/2;this.originRatio=Cg/lg;let dg=this.originRatio;this.imgScaleType==="2"?(og=this.height*dg,rg=-og/2,this.isScaleOtherSidedys&&this.width!==og&&(this.width=og,!this.noSetOtherPrevCoordsPoints&&this.setCoords())):this.imgScaleType==="3"&&(ag=this.width/dg,ug=-ag/2,this.isScaleOtherSidedys&&this.height!==ag&&(this.height=ag,!this.noSetOtherPrevCoordsPoints&&this.setCoords())),eg.save(),eg.beginPath(),eg.rect(-this.width/2,-this.height/2,this.width,this.height),eg.clip(),this.fill&&(eg.fillStyle=this.fill,eg.fillRect(-this.width/2,-this.height/2,this.width,this.height)),this.stroke&&this.strokeWidth&&(eg.strokeStyle=this.stroke,eg.lineWidth=this.strokeWidth,withObjectStrokeDash(eg,this,()=>eg.strokeRect(-this.width/2,-this.height/2,this.width,this.height))),eg.imageSmoothingEnabled=!0,eg.imageSmoothingQuality="high",eg.drawImage(gg,Ag,cg,Cg,lg,rg,ug,og,ag),eg.restore();const bg=this.filters.findIndex(mg=>mg.type==="Grayscale");if(this.setGrayFilter&&bg<0){const mg=new bh.Grayscale;this.filters.push(mg)}else!this.setGrayFilter&&bg>=0&&this.filters.splice(bg,1);this.applyFilters(),this.canvas.leRenderEnv!=="transform"&&!this.noSetOtherPrevCoordsPoints&&(this.prevCoordsPoints=this.aCoords)}set(eg,gg){return super.set(eg,gg)}toObject(eg){let gg=["imgScaleType","setGrayFilter","isScaleOtherSidedys","isSetSharpen","imageAlign","prevCoordsPoints","gasolineLayer"];return super.toObject(eg?[...eg,...gg]:gg)}fromObject(eg){return Yc._fromObject(eg)}};Yc.type="Image";let AImage=Yc;tt.setClass(AImage),tt.setSVGClass(AImage);const rd=class rd extends ho{constructor(){super(...arguments),this.perPixelTargetFind=!0}_render(eg){eg.beginPath();const{width:gg,height:ig}=this,ng=gg/2,og=ig/2;eg.ellipse(0,0,ng,og,0,0,Math.PI*2),this._renderPaintInOrder(eg)}set(eg,gg){return super.set(eg,gg)}};rd.type="Circle";let ACircle=rd;tt.setClass(ACircle);class ARect extends Er{constructor(eg){super(eg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ARect);class ATriangle extends vo{constructor(eg={}){super(eg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ATriangle),tt.setSVGClass(ATriangle);class ALine extends mo{constructor(eg,gg={}){super(eg,gg),this.perPixelTargetFind=!0}set(eg,gg){return super.set(eg,gg)}}tt.setClass(ALine);const Iu=class Iu extends na{constructor(){super(...arguments),this.hasControls=!1,this.selectable=!1,this.evented=!0,this.hoverCursor="pointer"}_renderFill(eg){const gg=this._element;if(!gg)return;const ig=this._filterScalingX,ng=this._filterScalingY,og=this.width,ag=this.height,Ig=Math.max(this.cropX,0),sg=Math.max(this.cropY,0),Cg=gg.naturalWidth||gg.width,lg=gg.naturalHeight||gg.height,Ag=Ig*ig,cg=sg*ng,rg=-og/2,ug=-ag/2;gg&&eg.drawImage(gg,Ag,cg,Cg,lg,rg,ug,og,ag)}};Iu.type="Rfid";let RfidIcon=Iu;tt.setClass(RfidIcon),tt.setSVGClass(RfidIcon);const su=class su extends No{constructor(eg,gg){if(super(eg,gg),this.hasSetSplit=!1,this.objectCaching=!0,this.hasSetItalic=!1,this.isClearCopyTextStyle=!1,this.propsMinHeight=0,this.splitByGrapheme=!0,this.customExportFields={varnish:"none"},this.fontFamily="微软雅黑",this._renderTimer=null,this.verticalType="top",this.currentFontLevel=0,this.baseFontSize=118,this.splitByGrapheme=!0,this._originGetTopOffset=this._getTopOffset?this._getTopOffset.bind(this):()=>0,this.fontFamily=gg.fontFamily??this.fontFamily,gg.hasSetItalic&&gg.fontStyle!=="italic"&&(this.fontStyle="italic",gg.skewX===-15&&(this.skewX=0)),gg.propsMinHeight){this.propsMinHeight=gg.propsMinHeight;let ig=Math.max(this.height,this.propsMinHeight);this.height=ig}gg.verticalType&&(this.verticalType=gg.verticalType),this.customExportFields=gg.customExportFields??this.customExportFields,this.on("modified",()=>{this.verticalTypeChange()}),this.on("changed",()=>{this.verticalTypeChange()}),this.verticalTypeChange()}_calcTextHeight(){const eg=this._textLines&&this._textLines.length||0,gg=this.fontSize*this.lineHeight,ig=(this.padding||0)*2;return eg*gg+ig}_handleDotLineBreak(eg,gg){var ig;if(eg.includes("·")){const ng=eg.indexOf("·"),og=/[\u4e00-\u9fa5]/g,ag=((ig=eg.substring(ng+1).match(og))==null?void 0:ig.length)||0;if(this.charSpacing=1,ng==2&&(ag==2||ag==1))return[eg];let Ig=0;if(ag>=11||ng>=10?Ig=5:ag>=10||ng>=9?Ig=4:ag>=9||ng>=8?Ig=3:ag>=8||ng>=7?Ig=2:ag>=7||ng>=6?Ig=1:Ig=0,Ig!==this.currentFontLevel){switch(Ig){case 5:this.fontSize=64;break;case 4:this.fontSize=70;break;case 3:this.fontSize=78;break;case 2:this.fontSize=88;break;case 1:this.fontSize=100;break;case 0:this.fontSize=this.baseFontSize??118;break}this.currentFontLevel=Ig}const sg=eg.substring(0,ng+1),Cg=eg.substring(ng+1).trim();return Cg?[sg,Cg]:[eg]}else eg.length<=4?(this.fontSize=this.baseFontSize??118,this.currentFontLevel=0,eg.length===2?this.charSpacing=800:eg.length===3?this.charSpacing=300:eg.length===4&&(this.charSpacing=300)):(this.charSpacing=1,this.fontSize=this.baseFontSize,this.currentFontLevel=0);return[...gg]}_wrapText(eg,gg){if(this.isClearCopyTextStyle&&(this.styles={},this.verticalTypeChange()),this.splitByGrapheme){const ig=o.DPI??96,ag=3*.393701*ig,Ig=this.text;let sg=[...eg];return sg=this._handleDotLineBreak(Ig,eg),this.width!==ag&&(this.width=ag,this.setCoords(),this._renderTimer&&clearTimeout(this._renderTimer),this._renderTimer=setTimeout(()=>{var Cg;(Cg=this.canvas)==null||Cg.requestRenderAll()},0)),super._wrapText(sg,ag)}else return super._wrapText(eg,gg)}verticalTypeChange(){var gg;if(!this.splitByGrapheme||!this.propsMinHeight)return;const eg=Math.max(this._calcTextHeight(),this.propsMinHeight);this.height!==eg&&(this.height=eg),this.verticalType==="top"?this._getTopOffset=this._originGetTopOffset:this.verticalType==="vcenter"?this._getTopOffset=()=>{let ig=this._calcTextHeight();return(this.fontSize*this.lineHeight-this.fontSize)/2-ig/2}:this.verticalType==="bottom"&&(this._getTopOffset=()=>{const ig=this._calcTextHeight(),og=Math.max(ig,this.propsMinHeight)-ig;return this._originGetTopOffset()+og}),this.setCoords(),(gg=this.canvas)==null||gg.requestRenderAll()}set(eg,gg){if(eg==="hasSetItalic")return this.hasSetItalic=!1,gg===!0?super.set("fontStyle","italic"):this;if(typeof eg=="object"&&eg){const ig={...eg};return"hasSetItalic"in ig&&(ig.hasSetItalic===!0&&(ig.fontStyle="italic"),delete ig.hasSetItalic),super.set(ig)}return(eg==="fill"||eg==="stroke"||eg==="underline"||eg==="overline"||eg==="linethrough"||eg==="fontWeight"||eg==="fontStyle")&&(this.styles={}),super.set(eg,gg)}set locked(eg){super.locked=eg,this.editable=!eg}get locked(){return super.locked}_measureLine(eg){let gg=this._textLines[eg];return Array.isArray(gg)&&(gg=gg.map(ig=>ig.replace(" "," "))),this._textLines[eg]=gg,super._measureLine(eg)}getStandardSpaceWidth(eg=" ",gg="Arial"){const ng=kn.createCanvasElement().getContext("2d");let og=0;return ng&&(ng.font=`${this.fontSize}px ${gg}`,og=ng.measureText(eg).width),og}getTextWidth(eg="",gg=0,ig="Arial"){const og=kn.createCanvasElement().getContext("2d");let ag=0;return og&&(og.font=`${gg}px ${ig}`,ag=og.measureText(eg).width),ag}getTextHeight(eg="测",gg=!0){const ng=kn.createCanvasElement().getContext("2d");let og=0;if(ng){ng.font=`${this.fontSize}px ${this.fontFamily}`;let ag=ng.measureText(eg);og=ag.fontBoundingBoxAscent+ag.fontBoundingBoxDescent+(gg?Math.trunc(this.fontSize/3):0)}return og*this._textLines.length}_measureChar(eg,gg,ig,ng){if(eg!==" "&&eg!==" ")return super._measureChar(eg,gg,ig,ng);{const og=this.getStandardSpaceWidth(" ",this.fontFamily);return{width:og,kernedWidth:og}}}render(eg){if(eg.shadowBlur=0,eg.shadowColor="transparent",eg.imageSmoothingEnabled=!1,this.isClearCopyTextStyle&&(this.styles={}),this.splitByGrapheme){let gg=this.width*this.scaleX,ig=this.height*this.scaleY,ng=this.getTextHeight();ig<ng&&(ig=ng),this.hasSetSplit=!0,(gg!==this.width||ig!==this.height||this.scaleY!==1)&&(this.set({width:gg,height:ig,scaleX:1,scaleY:1}),this.height=ig,this.propsMinHeight=this.height,this.setCoords())}else{this.propsMinHeight=0,this.hasSetSplit&&(this.hasSetSplit=!1);const gg=this.text.replace(/ /g," ");gg!==this.text&&(this.text=gg);let ig=eg.measureText(this.text);ig.width!==this.width&&this.set({width:ig.width}),this._forceClearCache=!0}this.charSpacing>1e5?this.objectCaching=!1:this.objectCaching=!0,this.dirty=!0,super.render(eg)}toObject(eg){let gg=["propsMinHeight","verticalType","customExportFields"];return super.toObject(eg?[...eg,...gg]:gg)}};su.type="TextName";let ATextName=su;tt.setClass(ATextName);const lu=class lu extends Er{constructor(eg={}){const{rows:gg,columns:ig,tableTexts:ng,tableCellStyles:og,tableCellBorders:ag,tableCellSpans:Ig,columnWidths:sg,rowHeights:Cg,fontSize:lg,fontFamily:Ag,fontWeight:cg,fontStyle:rg,underline:ug,linethrough:dg,charSpacing:bg,lineHeight:mg,textAlign:hg,verticalType:pg,...fg}=eg;super({fill:"#000000FF",backgroundColor:"#FFFFFF00",stroke:"#000000",strokeWidth:1,...fg}),this.perPixelTargetFind=!0,this.rows=2,this.columns=2,this.tableTexts=[],this.tableCellStyles=[],this.tableCellBorders=[],this.tableCellSpans=[],this.columnWidths=[],this.rowHeights=[],this.fontSize=24,this.fontFamily="微软雅黑",this.fontWeight="normal",this.fontStyle="normal",this.underline=!1,this.linethrough=!1,this.charSpacing=0,this.lineHeight=1.2,this.textAlign="center",this.verticalType="vcenter",this.strokeUniform=!0,this.selectedCellIndex=null,this.editingTextarea=null,this.keepEditingOnNextBlur=!1,this.editingPointerDownHandler=null,this.editingViewportChangeHandler=null,this.editingResizeObserver=null,this.editingUpdateFrame=0,this.rows=this.normalizeCount(gg,2),this.columns=this.normalizeCount(ig,2),this.tableTexts=[...ng||[]],this.tableCellStyles=[...og||[]],this.tableCellBorders=[...ag||[]],this.tableCellSpans=[...Ig||[]],this.columnWidths=[...sg||[]],this.rowHeights=[...Cg||[]],this.syncTextCount(),this.applyTextOptions({fontSize:lg,fontFamily:Ag,fontWeight:cg,fontStyle:rg,underline:ug,linethrough:dg,charSpacing:bg,lineHeight:mg,textAlign:hg,verticalType:pg}),this.on("scaling",wg=>this.resizeDuringScaling(wg)),this.on("modified",()=>{this.scaleAnchor=void 0}),this.on("removed",()=>{this.removeEditingTextarea(!1)})}get isEditing(){return this.editingTextarea!==null}set(eg,gg){var ng,og,ag,Ig,sg,Cg,lg;if(typeof eg=="object"&&eg)return Object.keys(eg).forEach(Ag=>this.set(Ag,eg[Ag])),this;if(eg==="rows"||eg==="columns"){this.removeEditingTextarea(!0);const Ag=this.normalizeCount(gg,eg==="rows"?this.rows:this.columns),cg=this.rows,rg=this.columns,ug=eg==="rows"?Ag:this.rows,dg=eg==="columns"?Ag:this.columns;return this.resizeByCountChange(eg,Ag),this.remapCellData(cg,rg,ug,dg),this[eg]=Ag,this.syncTextCount(),this.selectedCellIndex!==null&&this.selectedCellIndex>=this.rows*this.columns&&(this.selectedCellIndex=null),this.dirty=!0,this.setCoords(),(ng=this.canvas)==null||ng.requestRenderAll(),this}if(eg==="tableTexts")return this.tableTexts=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(og=this.canvas)==null||og.requestRenderAll(),this;if(eg==="tableCellStyles")return this.tableCellStyles=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll(),this;if(eg==="tableCellBorders")return this.tableCellBorders=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),this;if(eg==="tableCellSpans")return this.tableCellSpans=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(sg=this.canvas)==null||sg.requestRenderAll(),this;if(eg==="columnWidths"||eg==="rowHeights")return this[eg]=Array.isArray(gg)?[...gg]:[],this.syncTextCount(),this.dirty=!0,(Cg=this.canvas)==null||Cg.requestRenderAll(),this;const ig=super.set(eg,gg);return this.isTextStyleKey(eg)&&(this.dirty=!0,(lg=this.canvas)==null||lg.requestRenderAll(),this.updateEditingTextarea()),ig}toObject(eg){const gg=["rows","columns","tableTexts","tableCellStyles","tableCellBorders","tableCellSpans","columnWidths","rowHeights","fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType","backgroundColor"];return super.toObject(eg?[...eg,...gg]:gg)}normalizeCount(eg,gg){const ig=Math.floor(Number(eg));return Number.isFinite(ig)?Math.min(Math.max(ig,1),50):gg}resizeDuringScaling(eg){const gg=eg==null?void 0:eg.transform;if(!gg)return;const ig=gg.corner,ng=["ml","tl","bl"].includes(ig),og=["mr","tr","br"].includes(ig),ag=["mt","tl","tr"].includes(ig),Ig=["mb","bl","br"].includes(ig);if(!this.scaleAnchor){const Ag=ng?"right":og?"left":"center",cg=ag?"bottom":Ig?"top":"center";this.scaleAnchor={point:this.getPointByOrigin(Ag,cg),originX:Ag,originY:cg}}this.width=Math.max(1,(this.width||1)*Math.abs(this.scaleX||1)),this.height=Math.max(1,(this.height||1)*Math.abs(this.scaleY||1)),this.scaleX=1,this.scaleY=1;const{point:sg,originX:Cg,originY:lg}=this.scaleAnchor;if(this.group){const Ag=kn.invertTransform(this.group.calcTransformMatrix()),cg=kn.transformPoint(sg,Ag);this.setPositionByOrigin(cg,Cg,lg)}else this.setPositionByOrigin(sg,Cg,lg);this.updateEditingTextarea(),this.dirty=!0,this.setCoords()}resizeByCountChange(eg,gg){if(eg==="columns"){const ig=this.width||0,ng=Array.from({length:this.columns},(Cg,lg)=>(this.columnWidths[lg]||1/this.columns)*ig),og=ng.reduce((Cg,lg)=>Cg+lg,0)/(ng.length||1)||ig/(this.columns||1)||1,ag=Array.from({length:gg},(Cg,lg)=>lg<ng.length?ng[lg]:og),Ig=ag.reduce((Cg,lg)=>Cg+lg,0);this.width=Ig;const sg=Ig||1;this.columnWidths=ag.map(Cg=>Cg/sg)}if(eg==="rows"){const ig=this.height||0,ng=Array.from({length:this.rows},(Cg,lg)=>(this.rowHeights[lg]||1/this.rows)*ig),og=ng.reduce((Cg,lg)=>Cg+lg,0)/(ng.length||1)||ig/(this.rows||1)||1,ag=Array.from({length:gg},(Cg,lg)=>lg<ng.length?ng[lg]:og),Ig=ag.reduce((Cg,lg)=>Cg+lg,0);this.height=Ig;const sg=Ig||1;this.rowHeights=ag.map(Cg=>Cg/sg)}}remapCellData(eg,gg,ig,ng){if(eg===ig&&gg===ng)return;const og=Array.isArray(this.tableTexts)?[...this.tableTexts]:[],ag=Array.isArray(this.tableCellStyles)?[...this.tableCellStyles]:[],Ig=Array.isArray(this.tableCellBorders)?[...this.tableCellBorders]:[],sg=Array.isArray(this.tableCellSpans)?[...this.tableCellSpans]:[],Cg=ig*ng;this.tableTexts=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?"":og[cg*gg+rg]||""}),this.tableCellStyles=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?{}:{...ag[cg*gg+rg]||{}}}),this.tableCellBorders=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;return cg>=eg||rg>=gg?{}:{...Ig[cg*gg+rg]||{}}}),this.tableCellSpans=Array.from({length:Cg},(lg,Ag)=>{const cg=Math.floor(Ag/ng),rg=Ag%ng;if(cg>=eg||rg>=gg)return this.createDefaultCellSpan();const ug=sg[cg*gg+rg]||{},dg=Number(ug.masterIndex),bg=Number.isFinite(dg)&&dg>=0?this.mapOldCellIndex(dg,gg,ig,ng):null;return{...this.createDefaultCellSpan(),...ug,masterIndex:bg}}),this.selectedCellIndex!==null&&(this.selectedCellIndex=this.mapOldCellIndex(this.selectedCellIndex,gg,ig,ng))}mapOldCellIndex(eg,gg,ig,ng){const og=Math.floor(eg/gg),ag=eg%gg;return og>=ig||ag>=ng?null:og*ng+ag}createDefaultCellSpan(){return{rowSpan:1,colSpan:1,hidden:!1,masterIndex:null}}getCellData(eg){return{text:this.tableTexts[eg]||"",style:{...this.tableCellStyles[eg]||{}},border:{...this.tableCellBorders[eg]||{}},span:{...this.createDefaultCellSpan(),...this.tableCellSpans[eg]||{}}}}applyStructureChange(eg,gg,ig,ng,og,ag,Ig,sg,Cg){var ug,dg;const lg=this.getPointByOrigin(sg,Cg),Ag=eg*gg,cg=new Map;for(let bg=0;bg<eg;bg++)for(let mg=0;mg<gg;mg++){const hg=ig(bg,mg);hg!==null&&cg.set(hg,bg*gg+mg)}const rg=Array.from({length:Ag},(bg,mg)=>{const hg=Math.floor(mg/gg),pg=mg%gg,fg=ig(hg,pg);if(fg===null)return null;const wg=this.getCellData(fg),Gg=Number(wg.span.masterIndex);return wg.span.masterIndex=Number.isFinite(Gg)&&Gg>=0?cg.get(Gg)??null:null,wg});if(this.rows=eg,this.columns=gg,this.width=ag.reduce((bg,mg)=>bg+mg,0),this.height=Ig.reduce((bg,mg)=>bg+mg,0),this.columnWidths=this.normalizeRatios(ag,gg),this.rowHeights=this.normalizeRatios(Ig,eg),this.tableTexts=rg.map(bg=>(bg==null?void 0:bg.text)||""),this.tableCellStyles=rg.map(bg=>(bg==null?void 0:bg.style)||{}),this.tableCellBorders=rg.map(bg=>(bg==null?void 0:bg.border)||{}),this.tableCellSpans=rg.map(bg=>(bg==null?void 0:bg.span)||this.createDefaultCellSpan()),this.selectedCellIndex=Math.min(ng,eg-1)*gg+Math.min(og,gg-1),this.group){const bg=kn.invertTransform(this.group.calcTransformMatrix());this.setPositionByOrigin(kn.transformPoint(lg,bg),sg,Cg)}else this.setPositionByOrigin(lg,sg,Cg);this.syncTextCount(),this.dirty=!0,this.setCoords(),(ug=this.canvas)==null||ug.requestRenderAll(),(dg=this.canvas)==null||dg.fire("object:modified",{target:this,action:"modifyprops"})}insertColumn(eg,gg="right"){if(this.columns>=50)return;const ig=!!this.editingTextarea,ng=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const og=Math.min(Math.max(eg,0),this.columns),ag=this.columns,Ig=this.columnWidths.map(Ag=>Ag*(this.width||0)),sg=Math.min(og,ag-1),Cg=Ig[sg]||(this.width||1)/Math.max(ag,1);Ig.splice(og,0,Cg);const lg=this.rowHeights.map(Ag=>Ag*(this.height||0));this.applyStructureChange(this.rows,ag+1,(Ag,cg)=>{if(cg===og)return null;const rg=cg>og?cg-1:cg;return Ag*ag+rg},Math.floor(ng/ag),ng%ag+(gg==="left"?1:0),Ig,lg,gg==="left"?"right":"left","top"),this.restoreEditingTextareaAfterStructureChange(ig)}insertRow(eg,gg="down"){if(this.rows>=50)return;const ig=!!this.editingTextarea,ng=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const og=Math.min(Math.max(eg,0),this.rows),ag=this.rows,Ig=this.columns,sg=this.rowHeights.map(cg=>cg*(this.height||0)),Cg=Math.min(og,ag-1),lg=sg[Cg]||(this.height||1)/Math.max(ag,1);sg.splice(og,0,lg);const Ag=this.columnWidths.map(cg=>cg*(this.width||0));this.applyStructureChange(ag+1,Ig,(cg,rg)=>cg===og?null:(cg>og?cg-1:cg)*Ig+rg,Math.floor(ng/Ig)+(gg==="up"?1:0),ng%Ig,Ag,sg,"left",gg==="up"?"bottom":"top"),this.restoreEditingTextareaAfterStructureChange(ig)}deleteColumn(eg){if(this.columns<=1)return;const gg=!!this.editingTextarea,ig=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const ng=Math.min(Math.max(eg,0),this.columns-1),og=this.columns,ag=this.columnWidths.map(sg=>sg*(this.width||0));ag.splice(ng,1);const Ig=this.rowHeights.map(sg=>sg*(this.height||0));this.applyStructureChange(this.rows,og-1,(sg,Cg)=>{const lg=Cg>=ng?Cg+1:Cg;return sg*og+lg},Math.floor(ig/og),Math.min(ng,og-2),ag,Ig,ng===0?"right":"left","top"),this.restoreEditingTextareaAfterStructureChange(gg)}deleteRow(eg){if(this.rows<=1)return;const gg=!!this.editingTextarea,ig=this.selectedCellIndex||0;this.removeEditingTextarea(!0);const ng=Math.min(Math.max(eg,0),this.rows-1),og=this.rows,ag=this.columns,Ig=this.rowHeights.map(Cg=>Cg*(this.height||0));Ig.splice(ng,1);const sg=this.columnWidths.map(Cg=>Cg*(this.width||0));this.applyStructureChange(og-1,ag,(Cg,lg)=>(Cg>=ng?Cg+1:Cg)*ag+lg,Math.min(ng,og-2),ig%ag,sg,Ig,"left",ng===0?"bottom":"top"),this.restoreEditingTextareaAfterStructureChange(gg)}restoreEditingTextareaAfterStructureChange(eg){if(!eg||this.selectedCellIndex===null)return;const gg=this.selectedCellIndex;requestAnimationFrame(()=>{this.selectedCellIndex!==gg||this.editingTextarea||this.startCellEditing(gg)})}syncTextCount(){Array.isArray(this.tableTexts)||(this.tableTexts=[]);const eg=this.rows*this.columns;for(this.tableTexts.length>eg&&(this.tableTexts=this.tableTexts.slice(0,eg));this.tableTexts.length<eg;)this.tableTexts.push("");for(Array.isArray(this.tableCellStyles)||(this.tableCellStyles=[]),this.tableCellStyles.length>eg&&(this.tableCellStyles=this.tableCellStyles.slice(0,eg));this.tableCellStyles.length<eg;)this.tableCellStyles.push({});for(Array.isArray(this.tableCellBorders)||(this.tableCellBorders=[]),this.tableCellBorders.length>eg&&(this.tableCellBorders=this.tableCellBorders.slice(0,eg));this.tableCellBorders.length<eg;)this.tableCellBorders.push({});for(Array.isArray(this.tableCellSpans)||(this.tableCellSpans=[]),this.tableCellSpans.length>eg&&(this.tableCellSpans=this.tableCellSpans.slice(0,eg));this.tableCellSpans.length<eg;)this.tableCellSpans.push(this.createDefaultCellSpan());this.syncDimensionRatios(),this.selectedCellIndex!==null&&this.selectedCellIndex>=eg&&(this.selectedCellIndex=null)}syncDimensionRatios(){this.columnWidths=this.normalizeRatios(this.columnWidths,this.columns),this.rowHeights=this.normalizeRatios(this.rowHeights,this.rows)}normalizeRatios(eg,gg){const ig=Array.from({length:gg},(og,ag)=>{const Ig=Number(eg[ag]);return Number.isFinite(Ig)&&Ig>0?Ig:1}),ng=ig.reduce((og,ag)=>og+ag,0)||gg||1;return ig.map(og=>og/ng)}applyTextOptions(eg){["fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType"].forEach(ig=>{eg[ig]!==void 0&&(this[ig]=eg[ig])})}isTextStyleKey(eg){return["fontSize","fontFamily","fontWeight","fontStyle","underline","linethrough","charSpacing","lineHeight","textAlign","verticalType","fill"].includes(eg)}getTextX(eg,gg,ig){return this.getTextXByAlign(eg,gg,ig,this.textAlign)}getTextXByAlign(eg,gg,ig,ng="center"){return ng==="left"?eg+ig:ng==="right"?eg+gg-ig:eg+gg/2}getTextStartYByVertical(eg,gg,ig,ng,og,ag="vcenter"){return ag==="top"?eg+ig+og/2:ag==="bottom"?eg+gg-ig-ng+og/2:eg+gg/2-ng/2+og/2}getTextareaVerticalPadding(eg,gg,ig){if(eg.verticalType==="top")return{top:0,bottom:0};const ng=Math.max(gg-ig,0);return eg.verticalType==="bottom"?{top:ng,bottom:0}:{top:ng/2,bottom:0}}getDefaultCellStyle(){return{fontSize:Number(this.fontSize)||12,fontFamily:this.fontFamily||"微软雅黑",fill:this.fill||"#000000",fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",underline:!!this.underline,linethrough:!!this.linethrough,charSpacing:Number(this.charSpacing)||0,lineHeight:Number(this.lineHeight)||1.2,textAlign:this.textAlign||"center",verticalType:this.verticalType||"vcenter"}}getCellStyle(eg){return this.syncTextCount(),{...this.getDefaultCellStyle(),...this.tableCellStyles[eg]||{}}}setCellStyle(eg,gg){var ig,ng;this.syncTextCount(),!(eg<0||eg>=this.rows*this.columns)&&(this.tableCellStyles[eg]={...this.tableCellStyles[eg]||{},...gg},this.updateEditingTextarea(eg),this.dirty=!0,(ig=this.canvas)==null||ig.requestRenderAll(),(ng=this.canvas)==null||ng.fire("object:modified",{target:this}))}getCellBorderStyle(eg){return this.syncTextCount(),{top:"solid",right:"solid",bottom:"solid",left:"solid",...this.tableCellBorders[eg]||{}}}setCellBorderStyle(eg,gg){var ig,ng;this.syncTextCount(),!(eg<0||eg>=this.rows*this.columns)&&(this.tableCellBorders[eg]={...this.tableCellBorders[eg]||{},...gg},this.dirty=!0,(ig=this.canvas)==null||ig.requestRenderAll(),(ng=this.canvas)==null||ng.fire("object:modified",{target:this}))}setAllCellBorderStyle(eg){var gg,ig;this.syncTextCount(),this.tableCellBorders=Array.from({length:this.rows*this.columns},()=>({top:eg,right:eg,bottom:eg,left:eg})),this.dirty=!0,(gg=this.canvas)==null||gg.requestRenderAll(),(ig=this.canvas)==null||ig.fire("object:modified",{target:this,action:"modifyprops"})}getCellLayout(eg){return{...this.getCellRect(eg),row:Math.floor(eg/this.columns),col:eg%this.columns}}setColumnWidth(eg,gg){var Ig,sg;const ig=this.width||0;if(eg<0||eg>=this.columns||!ig)return;const ng=Math.max(Number(gg)||0,8),og=Array.from({length:this.columns},(Cg,lg)=>(this.columnWidths[lg]||1/this.columns)*ig);og[eg]=ng;const ag=og.reduce((Cg,lg)=>Cg+lg,0)||ng;this.width=ag,this.columnWidths=og.map(Cg=>Cg/ag),this.setCoords(),this.updateEditingTextarea(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),(sg=this.canvas)==null||sg.fire("object:modified",{target:this})}setRowHeight(eg,gg){var Ig,sg;const ig=this.height||0;if(eg<0||eg>=this.rows||!ig)return;const ng=Math.max(Number(gg)||0,8),og=Array.from({length:this.rows},(Cg,lg)=>(this.rowHeights[lg]||1/this.rows)*ig);og[eg]=ng;const ag=og.reduce((Cg,lg)=>Cg+lg,0)||ng;this.height=ag,this.rowHeights=og.map(Cg=>Cg/ag),this.setCoords(),this.updateEditingTextarea(),this.dirty=!0,(Ig=this.canvas)==null||Ig.requestRenderAll(),(sg=this.canvas)==null||sg.fire("object:modified",{target:this})}getColumnOffset(eg){const gg=this.width||0;return-gg/2+this.columnWidths.slice(0,eg).reduce((ig,ng)=>ig+ng*gg,0)}getRowOffset(eg){const gg=this.height||0;return-gg/2+this.rowHeights.slice(0,eg).reduce((ig,ng)=>ig+ng*gg,0)}getCellRect(eg){const gg=this.width||0,ig=this.height||0,ng=Math.floor(eg/this.columns),og=eg%this.columns,ag=(this.columnWidths[og]||0)*gg,Ig=(this.rowHeights[ng]||0)*ig;return{left:this.getColumnOffset(og),top:this.getRowOffset(ng),width:ag,height:Ig}}getCellIndexByPoint(eg){const gg=this.width||0,ig=this.height||0;if(!gg||!ig||!this.rows||!this.columns)return-1;const ng=kn.invertTransform(this.calcTransformMatrix()),og=kn.transformPoint(new ot(eg.x,eg.y),ng),ag=og.x+gg/2,Ig=og.y+ig/2;if(ag<0||Ig<0||ag>gg||Ig>ig)return-1;let sg=0,Cg=this.columns-1;for(let cg=0;cg<this.columns;cg++)if(sg+=this.columnWidths[cg]*gg,ag<=sg){Cg=cg;break}let lg=0,Ag=this.rows-1;for(let cg=0;cg<this.rows;cg++)if(lg+=this.rowHeights[cg]*ig,Ig<=lg){Ag=cg;break}return Ag*this.columns+Cg}getViewportCellTransform(eg){if(!this.canvas)return null;const gg=this.getCellRect(eg),ig=this.calcTransformMatrix(),ng=this.canvas.viewportTransform||[1,0,0,1,0,0],og=kn.multiplyTransformMatrices(ng,ig),ag=Math.hypot(og[0],og[1])||1,Ig=Math.hypot(og[2],og[3])||1;return{...gg,matrix:og,scaleX:ag,scaleY:Ig}}getCanvasElementRect(){var gg,ig;return this.canvas?(((ig=(gg=this.canvas.elements)==null?void 0:gg.upper)==null?void 0:ig.el)||this.canvas.upperCanvasEl||this.canvas.getElement()).getBoundingClientRect():null}removeEditingTextarea(eg=!0){var ng,og,ag;if(!this.editingTextarea)return;const gg=this.editingTextarea;this.editingTextarea=null;const ig=Number(gg.dataset.cellIndex);this.editingPointerDownHandler&&(document.removeEventListener("pointerdown",this.editingPointerDownHandler,!0),this.editingPointerDownHandler=null),this.unbindEditingViewportChange(),eg&&Number.isFinite(ig)&&(this.tableTexts[ig]=gg.value,this.dirty=!0,(ng=this.canvas)==null||ng.fire("object:modified",{target:this})),(og=gg.parentNode)==null||og.removeChild(gg),this.selectedCellIndex=null,this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll()}isEditingAssistantTarget(eg){return!!eg.closest([".right-side-bar",".ant-select-dropdown",".ant-select-item",".ant-select-selector",".ant-select-selection-search-input",".ant-input-number",".ant-input-number-dropdown",".ant-dropdown",".ant-tooltip",".ant-popover",".color-wrap",".color-preview-wrap",".hu-color-picker"].join(","))}bindEditingPointerDown(eg){this.editingPointerDownHandler&&document.removeEventListener("pointerdown",this.editingPointerDownHandler,!0),this.editingPointerDownHandler=gg=>{const ig=gg.target;if(!(!ig||ig===eg||eg.contains(ig))){if(this.isEditingAssistantTarget(ig)){this.keepEditingOnNextBlur=!0;return}this.removeEditingTextarea(!0)}},document.addEventListener("pointerdown",this.editingPointerDownHandler,!0)}scheduleEditingTextareaUpdate(eg){this.editingUpdateFrame&&cancelAnimationFrame(this.editingUpdateFrame),this.editingUpdateFrame=requestAnimationFrame(()=>{this.editingUpdateFrame=0,this.updateEditingTextarea(eg)})}bindEditingViewportChange(eg){var ng,og,ag,Ig,sg,Cg,lg;this.unbindEditingViewportChange(),this.editingViewportChangeHandler=()=>{this.scheduleEditingTextareaUpdate(eg)},window.addEventListener("resize",this.editingViewportChangeHandler),window.addEventListener("scroll",this.editingViewportChangeHandler,!0),(ng=window.visualViewport)==null||ng.addEventListener("resize",this.editingViewportChangeHandler),(og=window.visualViewport)==null||og.addEventListener("scroll",this.editingViewportChangeHandler);const gg=((sg=(Ig=(ag=this.canvas)==null?void 0:ag.elements)==null?void 0:Ig.upper)==null?void 0:sg.el)||((Cg=this.canvas)==null?void 0:Cg.upperCanvasEl)||((lg=this.canvas)==null?void 0:lg.getElement()),ig=(gg==null?void 0:gg.parentElement)||gg;ig&&typeof ResizeObserver<"u"&&(this.editingResizeObserver=new ResizeObserver(()=>{this.scheduleEditingTextareaUpdate(eg)}),this.editingResizeObserver.observe(ig))}unbindEditingViewportChange(){var eg,gg,ig;this.editingUpdateFrame&&(cancelAnimationFrame(this.editingUpdateFrame),this.editingUpdateFrame=0),this.editingViewportChangeHandler&&(window.removeEventListener("resize",this.editingViewportChangeHandler),window.removeEventListener("scroll",this.editingViewportChangeHandler,!0),(eg=window.visualViewport)==null||eg.removeEventListener("resize",this.editingViewportChangeHandler),(gg=window.visualViewport)==null||gg.removeEventListener("scroll",this.editingViewportChangeHandler),this.editingViewportChangeHandler=null),(ig=this.editingResizeObserver)==null||ig.disconnect(),this.editingResizeObserver=null}updateEditingTextarea(eg){if(!this.editingTextarea)return;const gg=this.editingTextarea,ig=Number(gg.dataset.cellIndex);if(!Number.isFinite(ig)||eg!==void 0&&eg!==ig)return;const ng=this.getViewportCellTransform(ig),og=this.getCanvasElementRect();if(!ng||!og)return;const ag=this.getCellStyle(ig),Ig=this.getCellEditFontSize(ig,ng.scaleY),sg=Math.max(Math.min(ng.scaleX,ng.scaleY),.01),Cg=Math.max(2/sg,Math.min(Ig*.18,8)),lg=Math.max(ng.width-Cg*2,12/ng.scaleX),Ag=Math.max(ng.height-Cg*2,12/ng.scaleY),cg=Ig*(Number(ag.lineHeight)||1.2),rg=this.getEditingLineCount(gg.value,ag,Ig,lg),ug=this.getTextareaVerticalPadding(ag,Ag,cg*rg),dg=kn.transformPoint(new ot(ng.left+Cg,ng.top+Cg),ng.matrix);gg.style.left=`${og.left+dg.x}px`,gg.style.top=`${og.top+dg.y}px`,gg.style.width=`${lg}px`,gg.style.height=`${Ag}px`,gg.style.transform=`matrix(${ng.matrix[0]}, ${ng.matrix[1]}, ${ng.matrix[2]}, ${ng.matrix[3]}, 0, 0)`,gg.style.color=ag.fill,gg.style.font=this.getFont(Ig,ag),gg.style.lineHeight=`${cg}px`,gg.style.textAlign=ag.textAlign,gg.style.letterSpacing=`${this.getSpacingPx(ag,Ig)}px`,gg.style.padding=`${ug.top}px 0 ${ug.bottom}px 0`}startCellEditing(eg){if(!this.canvas)return;this.removeEditingTextarea(!0),this.selectedCellIndex=eg;const gg=this.getViewportCellTransform(eg);if(!gg)return;const ig=this.getCanvasElementRect();if(!ig)return;const ng=this.getCellEditFontSize(eg,gg.scaleY),og=Math.max(Math.min(gg.scaleX,gg.scaleY),.01),ag=Math.max(2/og,Math.min(ng*.18,8)),Ig=kn.transformPoint(new ot(gg.left+ag,gg.top+ag),gg.matrix),sg=document.createElement("textarea");sg.value=this.tableTexts[eg]||"",sg.dataset.cellIndex=`${eg}`,sg.spellcheck=!1,sg.style.position="fixed",sg.style.left=`${ig.left+Ig.x}px`,sg.style.top=`${ig.top+Ig.y}px`,sg.style.width=`${Math.max(gg.width-ag*2,12/gg.scaleX)}px`,sg.style.height=`${Math.max(gg.height-ag*2,12/gg.scaleY)}px`,sg.style.zIndex="9999",sg.style.padding="0",sg.style.margin="0",sg.style.border="1px solid #2F54EB",sg.style.outline="none",sg.style.resize="none",sg.style.overflow="hidden",sg.style.background="rgba(255, 255, 255, 0.92)",sg.style.whiteSpace="pre-wrap",sg.style.overflowWrap="break-word";const Cg=this.getCellStyle(eg);sg.style.color=Cg.fill,sg.style.font=this.getFont(ng,Cg),sg.style.lineHeight=`${Cg.lineHeight}`,sg.style.textAlign=Cg.textAlign,sg.style.letterSpacing=`${this.getSpacingPx(Cg,ng)}px`,sg.style.boxSizing="border-box",sg.style.transformOrigin="left top",sg.style.transform=`matrix(${gg.matrix[0]}, ${gg.matrix[1]}, ${gg.matrix[2]}, ${gg.matrix[3]}, 0, 0)`;const lg=Ag=>Ag.stopPropagation();sg.addEventListener("mousedown",lg),sg.addEventListener("pointerdown",lg),sg.addEventListener("dblclick",lg),sg.addEventListener("keydown",Ag=>{Ag.stopPropagation(),Ag.key==="Escape"&&(Ag.preventDefault(),this.removeEditingTextarea(!1))}),sg.addEventListener("input",()=>this.updateEditingTextarea(eg)),sg.addEventListener("paste",Ag=>this.handleCellEditPaste(eg,Ag)),sg.addEventListener("copy",Ag=>this.handleCellEditCopy(eg,Ag)),sg.addEventListener("cut",Ag=>this.handleCellEditCut(eg,Ag)),sg.addEventListener("blur",()=>{if(this.keepEditingOnNextBlur){this.keepEditingOnNextBlur=!1;return}this.removeEditingTextarea(!0)}),document.body.appendChild(sg),this.editingTextarea=sg,this.bindEditingPointerDown(sg),this.bindEditingViewportChange(eg),this.updateEditingTextarea(eg),sg.focus(),sg.select()}handleCellEditPaste(eg,gg){const ig=gg.clipboardData;if(!ig)return;const ng=ig.getData("text/html");if(!ng)return;const og=this.extractCellStyleFromHtml(ng);og&&Object.keys(og).length>0&&this.setCellStyle(eg,og)}handleCellEditCopy(eg,gg){const ig=gg.clipboardData;if(!ig)return;const ng=this.editingTextarea;if(!ng)return;const og=ng.value.substring(ng.selectionStart,ng.selectionEnd);if(!og)return;const ag=this.getCellStyle(eg),Ig=this.buildClipboardHtml(og,ag);gg.preventDefault(),ig.setData("text/plain",og),ig.setData("text/html",Ig)}handleCellEditCut(eg,gg){var ag;this.handleCellEditCopy(eg,gg);const ig=this.editingTextarea;if(!ig)return;const ng=ig.selectionStart,og=ig.selectionEnd;ng!==og&&(ig.value=ig.value.slice(0,ng)+ig.value.slice(og),ig.selectionStart=ig.selectionEnd=ng,this.tableTexts[eg]=ig.value,this.updateEditingTextarea(eg),this.dirty=!0,(ag=this.canvas)==null||ag.requestRenderAll())}buildClipboardHtml(eg,gg){const ig=[];gg.fill&&ig.push(`color:${gg.fill}`),gg.fontSize&&ig.push(`font-size:${gg.fontSize}px`),gg.fontFamily&&ig.push(`font-family:${gg.fontFamily}`),gg.fontWeight&&ig.push(`font-weight:${gg.fontWeight}`),gg.fontStyle&&ig.push(`font-style:${gg.fontStyle}`);const ng=[];gg.underline&&ng.push("underline"),gg.linethrough&&ng.push("line-through"),ng.length&&ig.push(`text-decoration:${ng.join(" ")}`),gg.textAlign&&ig.push(`text-align:${gg.textAlign}`),gg.lineHeight&&ig.push(`line-height:${gg.lineHeight}`);const og=eg.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>");return`<span style="${ig.join(";")}">${og}</span>`}extractCellStyleFromHtml(eg){try{const gg=document.createElement("div");gg.style.position="absolute",gg.style.left="-9999px",gg.style.top="-9999px",gg.style.visibility="hidden",gg.innerHTML=eg,document.body.appendChild(gg);let ig=null;const ng=document.createTreeWalker(gg,NodeFilter.SHOW_TEXT);let og;for(;og=ng.nextNode();)if(og.textContent&&og.textContent.trim()){ig=og.parentElement;break}ig||(ig=gg);const ag=window.getComputedStyle(ig),Ig={};ag.color&&(Ig.fill=ag.color);const sg=parseFloat(ag.fontSize);if(Number.isFinite(sg)&&sg>0&&(Ig.fontSize=sg),ag.fontFamily){const cg=(ag.fontFamily.split(",")[0]||"").trim();Ig.fontFamily=cg.replace(/^["']|["']$/g,"")}if(ag.fontWeight&&ag.fontWeight!=="normal"&&ag.fontWeight!=="400"){const cg=Number(ag.fontWeight);Ig.fontWeight=ag.fontWeight==="bold"||Number.isFinite(cg)&&cg>=600?"bold":ag.fontWeight}ag.fontStyle&&ag.fontStyle!=="normal"&&(Ig.fontStyle=ag.fontStyle);const Cg=ag.textDecorationLine||ag.textDecoration||"";/underline/i.test(Cg)&&(Ig.underline=!0),/line-through/i.test(Cg)&&(Ig.linethrough=!0);const lg=ag.textAlign;(lg==="left"||lg==="center"||lg==="right")&&(Ig.textAlign=lg);const Ag=parseFloat(ag.lineHeight);return Number.isFinite(Ag)&&Ag>=.5&&Ag<=5&&(Ig.lineHeight=Ag),document.body.removeChild(gg),Ig}catch{return null}}selectCell(eg){var gg;this.selectedCellIndex=eg,this.dirty=!0,(gg=this.canvas)==null||gg.requestRenderAll()}handleCellDoubleClick(eg){const gg=this.getCellIndexByPoint(eg);gg<0||(this.removeEditingTextarea(!0),this.selectCell(gg),this.startCellEditing(gg))}getFont(eg,gg){const ig=gg.fontStyle==="italic"?"italic ":"",ng=Number(gg.fontWeight),ag=gg.fontWeight==="bold"||Number.isFinite(ng)&&ng>=600?"bold ":"";return`${ig}${ag}${eg}px ${gg.fontFamily}`}getCellEditFontSize(eg,gg=1){const ig=this.getCellStyle(eg).fontSize||12;return Math.max(ig,8/Math.max(gg,.01))}getSpacingPx(eg,gg){return(Number(eg.charSpacing)||0)/1e3*gg}getEditingLineCount(eg,gg,ig,ng){const ag=document.createElement("canvas").getContext("2d");return ag?(ag.font=this.getFont(ig,gg),Math.max(this.wrapTextLines(ag,eg,gg,ig,ng).length,1)):Math.max(eg.split(/\r?\n/).length,1)}measureTextWidth(eg,gg,ig,ng){const og=this.getSpacingPx(ig,ng);return!gg||!og?eg.measureText(gg).width:Array.from(gg).reduce((ag,Ig)=>ag+eg.measureText(Ig).width,0)+Math.max(Array.from(gg).length-1,0)*og}wrapTextLine(eg,gg,ig,ng,og){if(!gg)return[""];if(this.measureTextWidth(eg,gg,ig,ng)<=og)return[gg];const ag=[];let Ig="";return Array.from(gg).forEach(sg=>{const Cg=`${Ig}${sg}`;if(Ig&&this.measureTextWidth(eg,Cg,ig,ng)>og){ag.push(Ig),Ig=sg;return}Ig=Cg}),ag.push(Ig),ag}wrapTextLines(eg,gg,ig,ng,og){return String(gg).split(/\r?\n/).flatMap(ag=>this.wrapTextLine(eg,ag,ig,ng,og))}drawTextLine(eg,gg,ig,ng,og,ag){const Ig=this.getSpacingPx(ig,ag);if(!Ig){eg.fillText(gg,ng,og);return}const sg=Array.from(gg);let Cg=ng;const lg=this.measureTextWidth(eg,gg,ig,ag);ig.textAlign==="center"&&(Cg=ng-lg/2),ig.textAlign==="right"&&(Cg=ng-lg),eg.textAlign="left",sg.forEach(Ag=>{eg.fillText(Ag,Cg,og),Cg+=eg.measureText(Ag).width+Ig})}drawTextDecoration(eg,gg,ig,ng,og,ag,Ig){if(!Ig.underline&&!Ig.linethrough)return;const sg=Math.min(this.measureTextWidth(eg,gg,Ig,ag),og);let Cg=ig-sg/2;if(Ig.textAlign==="left"&&(Cg=ig),Ig.textAlign==="right"&&(Cg=ig-sg),eg.strokeStyle=Ig.fill||"#000000",eg.lineWidth=Math.max(ag/16,1),Ig.underline){const lg=ng+ag*.38;eg.beginPath(),eg.moveTo(Cg,lg),eg.lineTo(Cg+sg,lg),eg.stroke()}Ig.linethrough&&(eg.beginPath(),eg.moveTo(Cg,ng),eg.lineTo(Cg+sg,ng),eg.stroke())}drawCellText(eg,gg,ig,ng,og,ag,Ig){if(!gg)return;const sg=Math.min(4,og/6,ag/6),Cg=Math.max(og-sg*2,1),lg=this.getCellStyle(Ig),Ag=this.getTextXByAlign(ig,og,sg,lg.textAlign),cg=this.scaleX||1,rg=this.scaleY||1,ug=Math.max(Number(lg.fontSize)||12,1),dg=ug*(Number(lg.lineHeight)||1.2);eg.font=this.getFont(ug,lg);const bg=this.wrapTextLines(eg,gg,lg,ug,Cg*cg),mg=bg.length*dg,hg=this.getTextStartYByVertical(ng,ag,sg,mg,dg,lg.verticalType);eg.save(),eg.beginPath(),eg.rect(ig+.5,ng+.5,Math.max(og-1,1),Math.max(ag-1,1)),eg.clip(),eg.translate(Ag,hg),eg.scale(1/cg,1/rg),eg.fillStyle=lg.fill||"#000000",eg.font=this.getFont(ug,lg),eg.textAlign=lg.textAlign,eg.textBaseline="middle",bg.forEach((pg,fg)=>{const wg=fg*dg*rg;this.drawTextLine(eg,pg,lg,0,wg,ug),this.drawTextDecoration(eg,pg,0,wg,Cg*cg,ug,lg)}),eg.restore()}drawSelectedCell(eg){if(this.selectedCellIndex===null)return;const gg=this.selectedCellIndex;if(gg<0||gg>=this.rows*this.columns)return;const ig=this.getCellRect(gg);eg.save(),eg.fillStyle="rgba(47, 84, 235, 0.14)",eg.strokeStyle="#2F54EB",eg.lineWidth=1,eg.fillRect(ig.left,ig.top,ig.width,ig.height),eg.strokeRect(ig.left+.5,ig.top+.5,Math.max(ig.width-1,1),Math.max(ig.height-1,1)),eg.restore()}resolveBorderStyle(eg,gg){return eg==="none"||gg==="none"?"none":eg==="dashed"||gg==="dashed"?"dashed":"solid"}getDefaultBorderStyle(){return Array.isArray(this.strokeDashArray)&&this.strokeDashArray.length?"dashed":"solid"}getBorderSideStyle(eg,gg){var ig;return((ig=this.tableCellBorders[eg])==null?void 0:ig[gg])||this.getDefaultBorderStyle()}drawBorderSegment(eg,gg,ig,ng,og,ag){gg!=="none"&&(eg.save(),eg.strokeStyle=this.stroke||"#000000",eg.lineWidth=this.strokeWidth||1,eg.setLineDash(gg==="dashed"&&Array.isArray(this.strokeDashArray)?this.strokeDashArray:gg==="dashed"?[6,4]:[]),eg.beginPath(),eg.moveTo(ig,ng),eg.lineTo(og,ag),eg.stroke(),eg.restore())}drawTableBorders(eg){for(let gg=0;gg<=this.rows;gg++){const ig=this.getRowOffset(gg);for(let ng=0;ng<this.columns;ng++){const og=this.getColumnOffset(ng),ag=this.getColumnOffset(ng+1),Ig=gg>0?(gg-1)*this.columns+ng:-1,sg=gg<this.rows?gg*this.columns+ng:-1,Cg=Ig>=0?this.getBorderSideStyle(Ig,"bottom"):void 0,lg=sg>=0?this.getBorderSideStyle(sg,"top"):void 0,Ag=this.resolveBorderStyle(Cg||lg||"solid",Cg&&lg?lg:void 0);this.drawBorderSegment(eg,Ag,og,ig,ag,ig)}}for(let gg=0;gg<=this.columns;gg++){const ig=this.getColumnOffset(gg);for(let ng=0;ng<this.rows;ng++){const og=this.getRowOffset(ng),ag=this.getRowOffset(ng+1),Ig=gg>0?ng*this.columns+gg-1:-1,sg=gg<this.columns?ng*this.columns+gg:-1,Cg=Ig>=0?this.getBorderSideStyle(Ig,"right"):void 0,lg=sg>=0?this.getBorderSideStyle(sg,"left"):void 0,Ag=this.resolveBorderStyle(Cg||lg||"solid",Cg&&lg?lg:void 0);this.drawBorderSegment(eg,Ag,ig,og,ig,ag)}}}_render(eg){const gg=this.width||0,ig=this.height||0;if(!gg||!ig||!this.rows||!this.columns)return;const ng=-gg/2,og=-ig/2;eg.save(),eg.fillStyle=this.backgroundColor||"#FFFFFF00",eg.fillRect(ng,og,gg,ig),eg.restore(),this.drawSelectedCell(eg),this.drawTableBorders(eg),this.syncTextCount();for(let ag=0;ag<this.rows;ag++)for(let Ig=0;Ig<this.columns;Ig++){const sg=ag*this.columns+Ig,Cg=this.getCellRect(sg);this.drawCellText(eg,this.tableTexts[sg]||"",Cg.left,Cg.top,Cg.width,Cg.height,sg)}}};lu.type="table";let ATable=lu;tt.setClass(ATable);const RIBBON_BORDER_PATTERN_OPTIONS=[{label:"无描边",value:"none",source:{x:57,y:29,width:169,height:169}},{label:"图案 1",value:"ribbon-01",source:{x:293,y:29,width:169,height:169}},{label:"图案 2",value:"ribbon-02",source:{x:546,y:29,width:169,height:169}},{label:"图案 3",value:"ribbon-03",source:{x:781,y:29,width:169,height:169}},{label:"图案 4",value:"ribbon-04",source:{x:1005,y:29,width:169,height:169}},{label:"图案 5",value:"ribbon-05",source:{x:1230,y:29,width:169,height:169}},{label:"图案 6",value:"ribbon-06",source:{x:1436,y:29,width:169,height:169}},{label:"图案 7",value:"ribbon-07",source:{x:1660,y:29,width:169,height:169}},{label:"图案 8",value:"ribbon-08",source:{x:57,y:255,width:169,height:169}},{label:"图案 9",value:"ribbon-09",source:{x:296,y:255,width:169,height:169}},{label:"图案 10",value:"ribbon-10",source:{x:550,y:254,width:168,height:169}},{label:"图案 11",value:"ribbon-11",source:{x:781,y:255,width:169,height:169}},{label:"图案 12",value:"ribbon-12",source:{x:1003,y:254,width:169,height:169}},{label:"图案 13",value:"ribbon-13",source:{x:1230,y:255,width:169,height:169}},{label:"图案 14",value:"ribbon-14",source:{x:1436,y:255,width:169,height:169}},{label:"图案 15",value:"ribbon-15",source:{x:1660,y:254,width:169,height:169}},{label:"图案 16",value:"ribbon-16",source:{x:57,y:629,width:169,height:169}},{label:"图案 17",value:"ribbon-17",source:{x:550,y:480,width:168,height:169}},{label:"图案 18",value:"ribbon-18",source:{x:781,y:483,width:169,height:169}},{label:"图案 19",value:"ribbon-19",source:{x:1003,y:483,width:169,height:169}},{label:"图案 20",value:"ribbon-20",source:{x:1230,y:471,width:169,height:169}},{label:"图案 21",value:"ribbon-21",source:{x:1436,y:473,width:169,height:169}},{label:"图案 22",value:"ribbon-22",source:{x:1660,y:473,width:169,height:169}},{label:"图案 23",value:"ribbon-23",source:{x:781,y:693,width:169,height:169}},{label:"图案 24",value:"ribbon-24",source:{x:1003,y:686,width:169,height:169}},{label:"图案 25",value:"ribbon-25",source:{x:1230,y:683,width:169,height:169}},{label:"图案 26",value:"ribbon-26",source:{x:1436,y:683,width:169,height:169}},{label:"图案 27",value:"ribbon-27",source:{x:1660,y:683,width:169,height:169}}];RIBBON_BORDER_PATTERN_OPTIONS.map(tg=>tg.value);function drawRibbonBorder(tg,eg,gg,ig){if(eg==="none"||!(ig!=null&&ig.left)||!(ig!=null&&ig.right))return;const{width:ng,height:og}=gg,ag=gg.left??0,Ig=gg.top??0,sg=getRibbonBorderBandWidth(ng);drawTextureSide(tg,ig.left,ag,Ig,sg,og,"left"),drawTextureSide(tg,ig.right,ag+ng-sg,Ig,sg,og,"right")}function getRibbonBorderBandWidth(tg){return Math.max(16,Math.min(56,Math.round(tg*.11)))}function drawTextureSide(tg,eg,gg,ig,ng,og,ag){const Ig=getImageSourceWidth(eg),sg=Number(eg.naturalHeight||eg.height);if(!Ig||!sg)return;const Cg=Math.max(1,Math.min(ng,Math.round(Ig))),lg=ag==="right"?gg+ng-Cg:gg,Ag=Math.max(1,Math.round(sg*(Cg/Ig)));let cg=ig;for(;cg<ig+og;){const rg=Math.min(Ag,ig+og-cg),ug=Math.max(1,Math.round(sg*(rg/Ag)));tg.drawImage(eg,0,0,Ig,ug,lg,cg,Cg,rg),cg+=Ag}}function getImageSourceWidth(tg){return tg?Number(tg.naturalWidth||tg.width||0):0}const objectMap={line:(tg,eg)=>new ALine([0,0,0,0],{...tg}),rect:(tg,eg)=>new ARect(tg),triangle:(tg,eg)=>new ATriangle(tg),table:(tg,eg)=>new ATable(tg),circle:(tg,eg)=>new ACircle(tg),barcode:(tg,eg)=>new ABarcode(eg,tg),barcode2d:(tg,eg)=>new ABarcode2D(eg,tg),text:(tg,eg)=>new AText(eg??"",tg),textname:(tg,eg)=>new ATextName(eg??"",tg),counter:(tg,eg)=>new ACounter(eg,tg),image:(tg,eg)=>new AImage(eg,tg),rfid:(tg,eg)=>new RfidIcon(eg,tg)};o.DPI=203;class BaseEditor{constructor(){this.bindData=new EditorData,this.ribbonBorderPattern="none",this.ribbonBorderTextures=null}get width(){var eg;return(eg=this.canvas)==null?void 0:eg.elements.lower.el.offsetWidth}get height(){var eg;return(eg=this.canvas)==null?void 0:eg.elements.lower.el.offsetHeight}init(eg,gg){this.canvas=new In(eg,{...gg,imageSmoothingEnabled:!1,fireMiddleClick:!0,fireRightClick:!0,stopContextMenu:!1,controlsAboveOverlay:!0,preserveObjectStacking:!0,selectionKey:"ctrlKey"}),this.bindData.init(this);const ig=ng=>{if(!this.canvas)return;const og=this.canvas.getActiveObject();if(!og||og.type!=="textname")return;const ag=og;ag.isEditing===!0&&(ng.key==="Enter"||ng.keyCode===13||ng.key===" "||ng.key==="Space"||ng.keyCode===32)&&(ng.preventDefault(),ng.stopImmediatePropagation(),ag.selectionStart!==void 0&&(ag.selectionStart=ag.selectionEnd=ag.selectionStart))};document.addEventListener("keydown",ig),this.canvas.on("dispose",()=>{document.removeEventListener("keydown",ig)})}removeObject(eg){var gg;eg&&((gg=this.canvas)==null||gg.remove(eg))}addObject(eg,gg,ig,ng){if(this.canvas)if(eg==="image")kn.loadImage(ig,{crossOrigin:"anonymous"}).then(og=>{let ag=og.width/og.height;gg.imgScaleType=ag>1?"3":ag<1?"2":"1";const Ig=new AImage(og,gg);Ig.id=v4(),Ig.canvas=this.canvas,Ig.padding=3,addObjName(this.canvas,Ig),this.canvas.add(Ig),this.canvas.setActiveObject(Ig)});else{const og=objectMap[eg](gg,ig);og.id=v4(),og.canvas=this.canvas,og.padding=3,addObjName(this.canvas,og),this.canvas.add(og),this.canvas.setActiveObject(og)}}getActiveObjects(){return this.canvas.getActiveObjects()}getActiveObject(){return this.canvas.getActiveObject()}getObjects(){return this.canvas.getObjects()}getAllObjects(){const eg=this.getCanvas(),gg=[];function ig(ng){ng.type==="group"&&ng._objects?ng._objects.forEach(og=>ig(og)):ng.id!=="workspace"&&gg.push(ng)}return eg.getObjects().forEach(ng=>ig(ng)),gg}getBind(){return this.bindData}setRibbonBorderTextures(eg){var gg;this.ribbonBorderTextures=eg,(gg=this.canvas)==null||gg.requestRenderAll()}_toDataUrl(eg,gg,{exclude:ig=[],targetDPI:ng=203,type:og="",ribbonBorderPattern:ag=this.ribbonBorderPattern}={},Ig=null){let sg=Ig;if(gg&&sg){const{left:Zg,top:yg,right:Bg,bottom:Wg}=gg;sg.width=sg.width+Zg+Bg,sg.height=sg.height+yg+Wg}const{left:Cg,top:lg,width:Ag,height:cg}=sg,rg=eg.viewportTransform,ug=new ot(Cg,lg).transform(rg),dg=new ot(Ag,cg).transform(rg),bg=dg.x-ug.x,mg=dg.y-ug.y;let hg=Ag/bg*(Math.trunc(ng/o.DPI*100)/100);const pg={format:"png",quality:1,width:bg,height:mg,left:ug.x,top:ug.y,multiplier:hg};eg.set("flagToDataURL",!0),(sg&&sg.type==="ellipse"||sg.type==="rect"&&sg.rx&&sg.ry)&&(eg.clipPath=sg);let fg="",wg="",Gg="";if(og==="print"){let Zg=["text","counter","rect","circle","barcode","group","table","triangle"],yg=["line","ellipse","image","barcode2d"];wg=eg.toCanvasElement(hg,{...pg,filter:Vg=>!ig.includes(Vg.id)&&(Zg.includes(Vg.type)||Vg.id==="workspace")}),Gg=eg.toCanvasElement(hg,{...pg,filter:Vg=>!ig.includes(Vg.id)&&Vg.id!=="workspace"&&yg.includes(Vg.type)});let Bg=wg.getContext("2d"),Wg=Bg.getImageData(0,0,wg.width,wg.height),$g=Wg.data;const Ng=$g.length,vg=Ng-Ng%16;let Xg=window.myThreshold||200;for(let Vg=0;Vg<vg;Vg+=16){let Mg=$g[Vg],Rg=$g[Vg+1],Sg=$g[Vg+2],Yg=.299*Mg+.587*Rg+.114*Sg;Yg=Yg>Xg?255:0,$g[Vg]=$g[Vg+1]=$g[Vg+2]=Yg,Mg=$g[Vg+4],Rg=$g[Vg+5],Sg=$g[Vg+6],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+4]=$g[Vg+5]=$g[Vg+6]=Yg,Mg=$g[Vg+8],Rg=$g[Vg+9],Sg=$g[Vg+10],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+8]=$g[Vg+9]=$g[Vg+10]=Yg,Mg=$g[Vg+12],Rg=$g[Vg+13],Sg=$g[Vg+14],Yg=.299*Mg+.587*Rg+.114*Sg,Yg=Yg>Xg?255:0,$g[Vg+12]=$g[Vg+13]=$g[Vg+14]=Yg}for(let Vg=vg;Vg<Ng;Vg+=4){const Mg=$g[Vg],Rg=$g[Vg+1],Sg=$g[Vg+2];let Yg=.299*Mg+.587*Rg+.114*Sg;Yg=Yg>Xg?255:0,$g[Vg]=$g[Vg+1]=$g[Vg+2]=Yg}if(Bg.save(),Bg.putImageData(Wg,0,0),Bg.globalCompositeOperation="multiply",Bg.fillStyle="rgba(255, 255, 255, 1)",Bg==null||Bg.fillRect(0,0,wg.width,wg.height),Bg.drawImage(Gg,0,0,Gg.width,Gg.height),Gg.width=0,Gg.height=0,Bg.restore(),fg=wg,fg instanceof HTMLCanvasElement){const{width:Vg,height:Mg}=fg,Rg=document.createElement("canvas");Rg.width=Vg,Rg.height=Mg,Rg.getContext("2d",{willReadFrequently:!0}).drawImage(fg,0,0),fg.width=0,fg.height=0,fg=Rg}}else og==="review"?fg=eg.toCanvasElement(hg,{...pg,filter:Zg=>!ig.includes(Zg.id)}):ag!=="none"?fg=eg.toCanvasElement(hg,{...pg,filter:Zg=>!ig.includes(Zg.id)}):fg=eg.toDataURL({...pg,filter:Zg=>!ig.includes(Zg.id)});if(ag!=="none"&&fg instanceof HTMLCanvasElement){const Zg=fg.getContext("2d");Zg&&drawRibbonBorder(Zg,ag,{width:fg.width,height:fg.height},this.ribbonBorderTextures),og!=="print"&&og!=="review"&&(fg=fg.toDataURL("image/png",1))}return eg.clipPath&&(eg.clipPath=void 0),eg.set("flagToDataURL",!1),fg}storeStatus(){var eg;this.activeObjects=(eg=this.canvas)==null?void 0:eg.getActiveObject()}restoreStatus(eg=!1){var gg,ig,ng;this.activeObjects?(console.log("restoreStatus"),(gg=this.canvas)==null||gg.setActiveObject(this.activeObjects),(ig=this.canvas)==null||ig.requestRenderAll(),this.activeObjects=void 0):eg&&((ng=this.canvas)==null||ng.requestRenderAll())}getCanvas(){if(!this.canvas)throw new Error("Editor uninit!!!");return this.canvas}static set DPI(eg){o.DPI=eg}static get DPI(){return o.DPI}dispose(){this.canvas&&this.canvas.dispose()}}Object.defineProperty(ji.prototype,"locked",{configurable:!0,enumerable:!0,get:function(){return this.lockMovementX&&this.lockMovementY&&this.lockRotation&&this.lockScalingX&&this.lockScalingY&&this.lockSkewingX&&this.lockSkewingY&&this.lockScalingFlip},set:function(tg){this.lockMovementX=this.lockMovementY=this.lockRotation=this.lockScalingX=this.lockScalingY=this.lockSkewingX=this.lockSkewingY=this.lockScalingFlip=tg,this.canvas&&this.canvas.fire("custom:object:locked",{target:this})}});class Editor extends BaseEditor{constructor(){super(...arguments),this.plugins=new Map,this.hooks=new Map,this.events=new Map,this.id=v4(),this._isShown=!1,this._isHasRfid=!1}get filePath(){return this._filePath}set filePath(eg){this._filePath=eg}get labelConfig(){return this._labelConfig}set labelConfig(eg){this._labelConfig=eg}get rfidConfig(){return this._rfidConfig}set rfidConfig(eg){this._rfidConfig=eg}get databaseConfig(){return this._databaseConfig}set databaseConfig(eg){this._databaseConfig=eg}init(eg,gg){super.init(eg,gg),this.canvas&&(this.canvas.on("custom:object:locked",ig=>{this.emit("custom:object:locked",ig)}),this.canvas.on("custom:object:refreshList",ig=>{this.emit("custom:object:refreshList",ig)}))}dispose(){this.canvas&&(this.canvas.off("custom:object:locked"),this.canvas.off("custom:object:refreshList")),this.plugins.forEach(eg=>eg.uninstall&&eg.uninstall()),super.dispose()}addHotKey(eg,gg){hotkeys(eg,{single:!0},(ig,ng)=>{ig.preventDefault(),gg({kbe:ig,hke:ng})})}removeHotKey(eg){hotkeys.unbind(eg)}editActivated(){for(let eg of this.plugins.values())eg.enabled&&eg.enabled()}editDeactivated(){for(let eg of this.plugins.values())eg.disabled&&eg.disabled()}use(eg,gg){const ig=typeof eg=="function"?new eg(gg):eg;return this.checkDependencies(ig),this.runLifecycleHooks(ig,gg),ig.name&&this.plugins.set(ig.name,ig),this}checkDependencies(eg){eg.dependencies&&eg.dependencies.forEach(gg=>{if(!this.plugins.has(gg))throw new Error(`Plugin ${eg.name} requires ${gg} to be installed first`)})}runLifecycleHooks(eg,gg){eg.install&&eg.install(this,gg)}addHook(eg,gg){this.hooks.set(eg,gg)}triggerHook(eg,...gg){const ig=this.hooks.get(eg);if(ig)return ig(...gg)}getPlugin(eg){return this.plugins.get(eg)}on(eg,gg){this.events.has(eg)||this.events.set(eg,[]),this.events.get(eg).push(gg)}emit(eg,...gg){this.events.has(eg)&&this.events.get(eg).forEach(ig=>ig(...gg))}off(eg,gg){this.events.has(eg)&&(gg?this.events.set(eg,this.events.get(eg).filter(ig=>ig!==gg)):this.events.delete(eg))}toDataUrl({padding:eg,type:gg="",exclude:ig=[],targetDPI:ng=203,isJudgeGrid:og=!1,ribbonBorderPattern:ag=this.ribbonBorderPattern}={}){if(!this.canvas)return;this.canvas.discardActiveObject();const Ig=this.getPlugin("RulerPlugin"),sg=this.getPlugin("HistoryPlugin"),Cg=this.getPlugin("WorkspacePlugin"),lg=Cg.workspace;let Ag=!1;og&&(Ag=(lg==null?void 0:lg.isHasGrid)||!1,Ag&&(Cg==null||Cg.hideGrid())),Ig&&Ig.disabled(),sg&&sg.disabled();const cg=this._toDataUrl(this.canvas,eg,{exclude:ig,targetDPI:ng,type:gg,ribbonBorderPattern:ag},lg);return this.canvas.renderAll(),Ig&&Ig.enabled(),sg&&sg.enabled(),og&&Ag&&(Cg==null||Cg.showGrid()),cg}async toDataUrlOffscreen({padding:eg,type:gg="",exclude:ig=[],targetDPI:ng=203,isJudgeGrid:og=!1,ribbonBorderPattern:ag=this.ribbonBorderPattern,json:Ig}={}){if(!this.canvas)return"";const sg=this.getPlugin("WorkspacePlugin"),Cg=sg==null?void 0:sg.workspace;if(!Cg)return"";const lg=Ig||this.canvas.toObject(cloneCommonField),Ag=this.canvas.getWidth(),cg=this.canvas.getHeight(),rg=document.createElement("canvas");rg.width=Ag,rg.height=cg;const ug=new In(rg,{enableRetinaScaling:!1,skipOffscreen:!1,selection:!1,preserveObjectStacking:!0});ug.setViewportTransform(this.canvas.viewportTransform?Array.from(this.canvas.viewportTransform):[1,0,0,1,0,0]);let dg=!1;const bg=Cg.width,mg=Cg.height;try{return await ug.loadFromJSON(lg),ug.renderAll(),typeof(sg==null?void 0:sg.createExportWorkspace)=="function"&&(sg.createExportWorkspace(ug),ug.renderAll()),og&&(dg=Cg.isHasGrid||!1),this._toDataUrl(ug,eg,{exclude:ig,targetDPI:ng,type:gg,ribbonBorderPattern:ag},Cg)}finally{Cg.width=bg,Cg.height=mg,ug.dispose(),rg.remove()}}toTemplateJson(){const eg={};eg.Version="1.0.0-alpha.1",refreshObjectCenterProperties(this.canvas.getObjects());let gg=this.canvas.toObject(cloneCommonField);if(eg.canvas=JSON.stringify(gg),this._labelConfig){const ig=this._labelConfig;ig.fileId.length===0&&(ig.fileId=v4()),eg.labelConfig=ig}return this._databaseConfig&&(eg.databaseConfig=this._databaseConfig),this._rfidConfig&&(eg.rfidConfig=this._rfidConfig),this._filePath&&(eg.filePath=this._filePath),JSON.stringify(eg)}toJSON(){return refreshObjectCenterProperties(this.canvas.getObjects()),JSON.stringify(this.canvas.toObject(cloneCommonField))}fromTemplateJson(eg,gg){this.canvas&&this.canvas.loadFromJSON(eg).then(ig=>{ig.renderAll(),gg(),this.bindData&&this.canvas&&(this.bindData.originState=JSON.stringify(this.canvas.toJSON()))})}}const state$2=reactive({barcode2dSizeRatio:""});function getAlignedTextLeft(tg,eg,gg,ig){return ig==="center"?tg+(eg-gg)/2:ig==="right"?tg+eg-gg:tg}function getTextWidth(tg,eg,gg=0){return tg.measureText(eg).width+Math.max(0,Array.from(eg).length-1)*gg}let sRatio=Math.trunc(4/3*100)/100,longbeiClearCode=["10000502","10002500","10000503"];const Cu=class Cu extends ji{constructor(eg,gg){var og,ag;super(gg),this.lastCtx=null,this.lastDrawOption=null,this.hasToDataUrl=!1,this.counterProps=null,this.reviewValueArgs=null,this.barcodeDateFormatType="",this.increaseDate=!1,this.concatTextIdListObj=null,this.connectObjIds=[],this.isFirstLoad=!1,this.canModified=!0,this.useLongbeiCache=!0,this.inWorkerRender=!1,this.workerOtherImgData="",this.barcodeBodyHeight=0,this.textAreaHeight=0,this.isSyncingTextHeight=!1,this.emitErrorMessage=throttle$1(Ig=>{canvasEventBus.emit("canvasShowError",Ig)},800),this._cache={canvas:void 0,error:void 0},this.counterProps=gg&&gg.counterProps?gg.counterProps:this.counterProps,this.increaseDate=gg&&gg.increaseDate?gg.increaseDate:this.increaseDate,this.barcodeDateFormatType=gg&&gg.barcodeDateFormatType?gg.barcodeDateFormatType:this.barcodeDateFormatType,((og=eg.extra)==null?void 0:og.version)==="0"&&(eg.extra=omit(eg.extra,["version"])),((ag=eg.extra)==null?void 0:ag.eclevel)==="0"&&(eg.extra=omit(eg.extra,["eclevel"])),eg.custom||(eg.custom={}),this.barcode2dOptions=cloneDeep(eg),this.concatTextIdListObj=gg&&gg.concatTextIdListObj?gg.concatTextIdListObj:this.concatTextIdListObj,this.connectObjIds=gg.connectObjIds??this.connectObjIds,this.barcode2dOptions.includetext=eg.includetext??!1,this.barcode2dOptions.textposition=this.barcode2dOptions.includetext?this.barcode2dOptions.textposition||"bottom":"none",this.barcode2dOptions.textsize=this.barcode2dOptions.textsize||14,this.barcode2dOptions.textfontname=this.barcode2dOptions.textfontname||"Arial",this.barcode2dOptions.textxalign=this.barcode2dOptions.textxalign||"center",this.barcode2dOptions.textgaps=this.barcode2dOptions.textgaps||0,this.textAreaHeight=this.measureTextAreaHeight(this.barcode2dOptions),this.barcodeBodyHeight=Math.max(1,(this.height||1)-this.textAreaHeight),this.set({width:this.width,height:this.height}),this.on("modified",Ig=>{console.log("eee=======",Ig),lpBcid.includes(this.barcode2dOptions.bcid)&&(Ig==null?void 0:Ig.action)!=="drag"&&(this.canModified=!0,setTimeout(()=>{let sg=this.barcode2dOptions.custom,Cg=this.width*this.scaleX,lg=this.height*this.scaleY,Ag=Math.max(Cg/lg,lg/Cg);Ag=Math.trunc(Ag*100)/100,[1,2,sRatio].includes(Ag)?(sg.sizeRatio=Ag===1?"1x1":Ag===2?"2x1":"4x3",state$2.barcode2dSizeRatio=sg.sizeRatio):(sg.sizeRatio="auto",state$2.barcode2dSizeRatio=sg.sizeRatio),console.log("state.barcode2dSizeRatio========",state$2.barcode2dSizeRatio)},30)),lpBcid.includes(this.barcode2dOptions.bcid)&&(Ig==null?void 0:Ig.action)==="drag"&&this.updateLpCodePosition()}),this.on("scaling",()=>{lpBcid.includes(this.barcode2dOptions.bcid)&&(this.canModified=!1,this.clearErrorLpCodeMap())}),canvasEventBus.off(`update:barcode2d:${this.id}`),canvasEventBus.on(`update:barcode2d:${this.id}`,async({list:Ig,callback:sg=function(){}}={})=>{let Cg=await this.updateBarCode2d(Ig);sg&&sg(Cg)})}updateLpCodePosition(){let eg=this.getLpCache();eg&&(eg.x=this.left,eg.y=this.top)}clearErrorLpCodeMap(){errorLpCodeMap.delete(this.id)}getLpCache(){let eg="",gg=this.id;return this.barcode2dOptions.bcid==="LPCode"?eg=getLastCacheLpcode(gg):this.barcode2dOptions.bcid==="LPMixQrCode"&&(eg=getLastMixCacheLpcode(gg)),eg}drawLpCode(eg,gg,ig,ng,og,ag="",Ig=null){var lg;let sg=eg||this.lastCtx;if(this._cache.error=void 0,ag==="cache"&&(this.width=ng,this.height=og,this.scaleX=1,this.scaleY=1,Ig&&(this.left=Ig.x,this.top=Ig.y),this.lastDrawOption={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2},ig.w=this.lastDrawOption.w,ig.h=this.lastDrawOption.h,ig.x=this.lastDrawOption.x,ig.y=this.lastDrawOption.y,this.strokeWidth>0&&(ig.x+=this.strokeWidth,ig.y+=this.strokeWidth),this.setCoords()),this.inWorkerRender||(this.workerOtherImgData=gg),sg.drawImage(gg,ig.x,ig.y,ng,og),this.strokeWidth>0){let Ag=this.stroke||"#fff";sg.lineWidth=this.strokeWidth,sg.strokeStyle=Ag,withObjectStrokeDash(sg,this,()=>sg.strokeRect(-this.width/2,-this.height/2,ng+this.strokeWidth*2,og+this.strokeWidth*2))}this.dirty=!0;let Cg=this.group;for(;Cg;)Cg.dirty=!0,Cg=Cg.group;this.isFirstLoad||(this.objectCaching=!1,this.isFirstLoad=!0),(lg=this.canvas)==null||lg.requestRenderAll(),this.objectCaching||setTimeout(()=>{this.objectCaching=!0},60)}getTextLayout(eg,gg,ig){if(!this.shouldShowText(gg))return{showText:!1,textGap:0,textLineHeight:0,textAreaHeight:0,barcodeHeight:ig};const{scaleY:og}=this.getRenderScale(),ag=14/og,Ig=6/og,sg=this.measureTextLineHeight(gg,eg),Cg=Math.ceil(sg/og+ag+Ig);return{showText:!0,textGap:ag,textLineHeight:sg,textAreaHeight:Cg,barcodeHeight:ig}}shouldShowText(eg){return eg.includetext&&eg.textposition!=="none"&&!!eg.text}getMeasureContext(){return typeof document>"u"?null:document.createElement("canvas").getContext("2d")}measureTextLineHeight(eg,gg){const ig=Number(eg.textsize)||14,ng=gg||this.getMeasureContext();if(!ng)return ig*1.2;ng.save(),ng.font=`${ig}px ${eg.textfontname||"Arial"}`;const og=ng.measureText(eg.text||"");return ng.restore(),og.actualBoundingBoxAscent+og.actualBoundingBoxDescent||ig*1.2}measureTextAreaHeight(eg){if(!this.shouldShowText(eg))return 0;const{scaleY:gg}=this.getRenderScale(),ig=14/gg,ng=6/gg;return Math.ceil(this.measureTextLineHeight(eg)/gg+ig+ng)}syncTextHeight(eg){var og;const gg=this.barcodeBodyHeight||Math.max(1,(this.height||1)-this.textAreaHeight),ig=gg+eg;if(this.barcodeBodyHeight=gg,this.textAreaHeight=eg,Math.abs((this.height||0)-ig)<.01)return;this.isSyncingTextHeight=!0,this.set("height",ig),this.isSyncingTextHeight=!1,this.setCoords();let ng=this.group;for(;ng;)ng.dirty=!0,ng==null||ng.triggerLayout("childUpdate"),ng.setCoords(),ng=ng.group;(og=this.canvas)==null||og.requestRenderAll()}getRenderScale(){var ng;const eg=(ng=this.getObjectScaling)==null?void 0:ng.call(this),gg=Math.abs((eg==null?void 0:eg.x)||this.scaleX||1)||1,ig=Math.abs((eg==null?void 0:eg.y)||this.scaleY||1)||1;return{scaleX:gg,scaleY:ig}}renderText(eg,gg,ig,ng,og){if(!gg.includetext||gg.textposition==="none"||!gg.text)return;const ag=gg.textxalign||"center";eg.save();const{scaleX:Ig,scaleY:sg}=this.getRenderScale();eg.scale(1/Ig,1/sg),eg.font=`${gg.textsize||14}px ${gg.textfontname||"Arial"}`,eg.fillStyle=gg.textcolor||"#000";const Cg=Number(gg.textgaps)||0,lg=getTextWidth(eg,gg.text,Cg),Ag=Math.max(0,ig.w-(this.strokeWidth>0?this.strokeWidth*2:0)),cg=getAlignedTextLeft(ig.x,Ag,lg/Ig,ag);eg.textAlign="left",eg.textBaseline="top",Cg&&(eg.letterSpacing=Cg+"px"),eg.fillText(gg.text,cg*Ig,(ig.y+ng+og)*sg),eg.restore()}async _render(eg){var og,ag,Ig,sg,Cg;const gg=cloneDeep(this.barcode2dOptions);this.lastCtx=eg;const ig=this.getTextLayout(eg,gg,this.barcodeBodyHeight||this.height),ng={w:this.width,h:this.height,x:-this.width/2,y:-this.height/2};if(eg.save(),eg.imageSmoothingEnabled=!1,this.dirty){if(gg.width=ng.w,gg.height=ig.barcodeHeight,typeof this.fill=="string"){let lg=rgbaStringToHex8(this.fill);gg.barcolor=hexToHex6_blend(lg)}this.strokeWidth>0&&(gg.width-=this.strokeWidth*2,gg.height-=this.strokeWidth*2);try{lpBcid.includes(gg.bcid)||(this._cache.canvas=generateCanvas(gg),this.dirty=!1,this._cache.error&&(this._cache.error=void 0))}catch(lg){this.dirty=!0,lg instanceof Error&&(console.log("error",lg.message),this._cache.error=lg.message),this._cache.canvas=void 0}}if(this.strokeWidth>0&&(ng.x+=this.strokeWidth,ng.y+=this.strokeWidth),this.lastDrawOption=ng,lpBcid.includes(gg.bcid)){let lg=this.lastDrawOption;const Ag=this.strokeWidth>0?lg.w-this.strokeWidth*2:lg.w,cg=Math.max(1,this.strokeWidth>0?ig.barcodeHeight-this.strokeWidth*2:ig.barcodeHeight);let rg=Ag*this.scaleX,ug=cg*this.scaleY,dg=gg.text,bg=Number((og=gg.extra)==null?void 0:og.eclevel)||1;bg=bg+"";let mg=Math.trunc(rg/Editor.DPI*25.4*100)/100,hg=Math.trunc(ug/Editor.DPI*25.4*100)/100,pg=mg/(hg||1),fg=((ag=gg.custom)==null?void 0:ag.CellSize)||"8",wg=`${dg}-${bg}-${mg+hg}-${pg}-${fg}`,Gg=`${this.id}`,Zg=null;if(gg.bcid==="LPMixQrCode"){let yg=((Ig=gg.custom)==null?void 0:Ig.LPErrLevel)||"0",Bg=((sg=gg.custom)==null?void 0:sg.QRErrLevel)||"0";bg=`${yg}-${Bg}`,wg=`${dg}-${bg}-${mg+hg}-${pg}-${fg}`}try{if(errorLpCodeMap.has(Gg)){errorLpCodeMap.set(Gg,this._cache.error||"龙贝码生成错误");let yg=this.getLpCache();if(yg&&this.useLongbeiCache){let Bg=yg||{};Zg=Bg.img,this.drawLpCode(eg,Zg,lg,Bg.rWidth,Bg.rHeight,"cache",Bg),this._cache.error=void 0}else this._cache.error=errorLpCodeMap.get(Gg)||"龙贝码生成错误"}else{if(lpCodeMap.has(wg)&&this.useLongbeiCache){Zg=lpCodeMap.get(wg);let yg={id:this.id,sKey:wg,img:Zg,rWidth:rg,rHeight:ug,x:this.left,y:this.top};this.barcode2dOptions.bcid==="LPCode"?setCacheLpCode(yg):setCacheMixLpCode(yg)}else if(this.canModified){let yg={Content:dg,ErrLevel:bg,Width:mg,Height:hg,id:this.id,rWidth:rg,rHeight:ug,CellSize:fg,x:this.left,y:this.top,DPI:Editor.DPI};this.useLongbeiCache||lpCodeMap.delete(wg),this.barcode2dOptions.bcid==="LPCode"?Zg=await getBase64Data(yg):Zg=await getMixBase64Data(yg),this.useLongbeiCache=!0}if(lpCodeMap.has(wg)&&this.useLongbeiCache)this._cache.error=void 0,this.drawLpCode(eg,Zg,lg,Ag,cg);else if(this.useLongbeiCache){let yg=this.getLpCache();yg&&(Zg=(yg||{}).img,this.drawLpCode(eg,Zg,lg,Ag,cg),this._cache.error=void 0)}}}catch(yg){let Bg=yg&&yg.code,Wg=this.getLpCache();if(errorLpCodeMap.set(Gg,this._cache.error||"龙贝码生成错误"),Bg&&(longbeiClearCode.includes(Bg+"")&&(this.useLongbeiCache=!1,clearLpAndMixCacheById(this.id),this._cache.error=`龙贝码: ${yg.payload}`),this.emitErrorMessage(yg.payload)),Wg&&this.useLongbeiCache){let $g=Wg||{};Zg=$g.img,this.drawLpCode(eg,Zg,lg,$g.rWidth,$g.rHeight,"cache",$g),this._cache.error=void 0}else Bg&&(this._cache.error=`龙贝码: ${yg.payload}`,this.dirty=!0,(Cg=this.canvas)==null||Cg.requestRenderAll())}}else this.objectCaching=!0;if(!this._cache.error&&!lpBcid.includes(gg.bcid)){if(this._cache.canvas){const lg=this.strokeWidth>0?ng.w-this.strokeWidth*2:ng.w,Ag=Math.max(1,this.strokeWidth>0?ig.barcodeHeight-this.strokeWidth*2:ig.barcodeHeight),cg=this._cache.canvas;if(eg.drawImage(cg,0,0,cg.width,cg.height,ng.x,ng.y,lg,Ag),this.strokeWidth>0){let rg=this.stroke||"#fff";eg.lineWidth=this.strokeWidth,eg.strokeStyle=rg,withObjectStrokeDash(eg,this,()=>eg.strokeRect(-this.width/2,-this.height/2,ng.w,ng.h))}}}if(!this._cache.error&&ig.showText&&this.renderText(eg,gg,ng,ig.barcodeHeight,ig.textGap),eg.translate(.5,.5),this._cache.error){const lg=wrapText(eg,this._cache.error,ng.w,"bold 18px 宋体"),Ag=getLineHeight(eg);let cg=ng.y+Ag;const rg=eg.fillStyle;eg.fillStyle="red";for(const ug of lg)eg.fillText(ug,ng.x,cg),cg+=Ag;eg.fillStyle=rg}eg.restore()}async getLongBeiImg(eg){var dg,bg,mg,hg;if(!lpBcid.includes(eg.bcid))return;let gg=this.lastDrawOption;const ig=this.strokeWidth>0?gg.w-this.strokeWidth*2:gg.w,ng=this.strokeWidth>0?gg.h-this.strokeWidth*2:gg.h;let og=eg.text,ag=Number((dg=eg.extra)==null?void 0:dg.eclevel)||1,Ig=ig*this.scaleX,sg=ng*this.scaleY,Cg=Math.trunc(Ig/Editor.DPI*25.4*100)/100,lg=Math.trunc(sg/Editor.DPI*25.4*100)/100,Ag=Cg/(lg||1),cg=((bg=eg.custom)==null?void 0:bg.CellSize)||"8",rg=`${og}-${ag}-${Cg+lg}-${Ag}-${cg}`,ug=null;if(eg.bcid==="LPMixQrCode"){let pg=((mg=eg.custom)==null?void 0:mg.LPErrLevel)||"0",fg=((hg=eg.custom)==null?void 0:hg.QRErrLevel)||"0";ag=`${pg}-${fg}`,rg=`${og}-${ag}-${Cg+lg}-${Ag}-${cg}`}this.clearErrorLpCodeMap();try{if(lpCodeMap.has(rg)&&this.useLongbeiCache)ug=lpCodeMap.get(rg);else{let pg={Content:og,ErrLevel:ag,Width:Cg,Height:lg,id:this.id,rWidth:Ig,rHeight:sg,CellSize:cg,x:this.left,y:this.top,DPI:Editor.DPI};this.barcode2dOptions.bcid==="LPCode"?ug=await getBase64Data(pg,"noSaveCache"):ug=await getMixBase64Data(pg,"noSaveCache"),this.useLongbeiCache=!0}return this.workerOtherImgData=ug,this._cache.error=void 0,ug}catch(pg){console.error(pg)}}dispose(){super.dispose()}set(eg,gg){return this.isSyncingTextHeight||(typeof eg=="string"?eg==="height"&&typeof gg=="number"&&(this.barcodeBodyHeight=Math.max(1,gg-this.textAreaHeight)):typeof eg.height=="number"&&(this.barcodeBodyHeight=Math.max(1,eg.height-this.textAreaHeight))),super.set(eg,gg)}countDate(eg=""){if(this.barcodeDateFormatType&&this.increaseDate){const gg=formatDate(this.barcodeDateFormatType);return console.log("formatted",gg),this.dirty=!0,eg!=="print"&&this.setBarcode2DOption({bcid:this.barcode2dOptions.bcid,text:gg}),gg}}countCurrent(eg){let gg=this.counterProps||eg;if(gg){let ig=gg;if(!ig.value&&ig.value!==0)return"";const ng=formatCounterValue(ig);return(ig.prefix&&ig.prefix.length>0?ig.prefix:"")+ng+(ig.suffix&&ig.suffix.length>0?ig.suffix:"")}return""}countNext(eg="print"){if(this.counterProps){let gg=this.counterProps;if(!gg.value&&gg.value!==0)return;eg==="review"&&!this.reviewValueArgs&&(this.reviewValueArgs={...gg});const ig=formatCounterValue(gg);let ng=(gg.prefix&&gg.prefix.length>0?gg.prefix:"")+ig+(gg.suffix&&gg.suffix.length>0?gg.suffix:"");const og=getNextCounterValue(gg);return og!==null&&(gg.value=og,this.counterProps.value=og),this.dirty=!0,ng}else return""}reviewRecover(){if(this.reviewValueArgs){const eg=this.reviewValueArgs;this.counterProps=eg,this.reviewValueArgs=null;const gg=formatCounterValue(eg);let ig=(eg.prefix&&eg.prefix.length>0?eg.prefix:"")+gg+(eg.suffix&&eg.suffix.length>0?eg.suffix:"");this.setBarcode2DOption({bcid:this.barcode2dOptions.bcid,text:ig})}}updateInGroup(){this.setCoords(),this.dirty=!0;let eg=this.group;for(;eg;)eg.dirty=!0,eg==null||eg.triggerLayout("childUpdate"),eg.setCoords(),eg=eg.group}async updateBarCode2d(eg=[],gg=""){var ig;if(this.concatTextIdListObj||this.connectObjIds&&this.connectObjIds.length>0){let ng=!1,og="",ag=[],Ig=[];const sg=lg=>{if(this.connectObjIds){let Ag=0;for(let cg of this.connectObjIds){if(cg.index=Ag,cg.id&&cg.id===lg.id){ng=!0;let rg=lg.text+"";if(lg.type==="counter"&&(lg._props.mode==="1"?rg=lg.countCurrent():lg._props.mode==="2"&&(lg.updateText({isUpdateBarCodeDate:!1}),rg=lg.text+"")),cg.maxEnd=rg.length,cg.isSplit){cg.start=Math.min(cg.start,cg.maxEnd);let ug=rg.slice(cg.start,cg.end);ag[Ag]=ug}else ag[Ag]=rg}Ag++}}},Cg=lg=>{lg.type==="text"&&this.concatTextIdListObj&&this.concatTextIdListObj[lg.id]&&(ng||(this.barcode2dOptions.bcid==="LPMixQrCode"?lg==null||lg.set("text",this.barcode2dOptions.text.replace(/\|&&&\|/g,"")):lg==null||lg.set("text",this.barcode2dOptions.text),lg.updateInGroup()),Ig.push(lg))};if(eg.length>0)eg.forEach(lg=>{sg(lg),Cg(lg)});else{const lg=Ag=>{Ag.type==="group"&&Ag._objects?Ag._objects.forEach(cg=>lg(cg)):(sg(Ag),Cg(Ag))};(ig=this.canvas)==null||ig.getObjects().forEach(Ag=>lg(Ag))}return ng?(og=ag.join(""),this.barcode2dOptions.text=og,lpBcid.includes(this.barcode2dOptions.bcid)&&gg&&await this.getLongBeiImg(this.barcode2dOptions),this.dirty=!0,gg&&this.updateInGroup(),setTimeout(()=>{var lg;(lg=this.canvas)==null||lg.requestRenderAll()},0),Ig.forEach(lg=>{lg==null||lg.set("text",og),lg.updateInGroup()}),og):""}else return""}setBarcode2DOption(eg){if(this.barcode2dOptions.bcid!==eg.bcid&&(eg.extra={},this.barcode2dOptions.extra={}),merge(this.barcode2dOptions,eg),eg.extra&&(typeof+eg.extra.version=="number"&&eg.extra.version==="0"&&(this.barcode2dOptions.extra=omit(this.barcode2dOptions.extra,["version"])),eg.extra.eclevel==="0"&&(this.barcode2dOptions.extra=omit(this.barcode2dOptions.extra,["eclevel"]))),this.syncTextHeight(this.measureTextAreaHeight(this.barcode2dOptions)),this.dirty=!0,!lpBcid.includes(this.barcode2dOptions.bcid)){let ig=this.group;for(;ig;)ig.dirty=!0,ig=ig.group}let gg=getAllObjectMap();this.updateBarCode2d([...gg.text,...gg.counter])}getBarcode2DOption(){return cloneDeep(this.barcode2dOptions)}toObject(eg){let gg=["barcode2dOptions","counterProps","concatTextIdListObj","increaseDate","barcodeDateFormatType","connectObjIds"];return super.toObject(eg?[...eg,...gg]:gg)}};Cu.type="Barcode2D";let ABarcode2D=Cu;ABarcode2D.fromObject=(tg,eg)=>ABarcode2D._fromObject(tg,{...eg,extraParam:"barcode2dOptions"}),tt.setClass(ABarcode2D),tt.setSVGClass(ABarcode2D);let contextMenuTextResolver=null;function setContextMenuTextResolver(tg){contextMenuTextResolver=tg}class ContextMenu{constructor(eg,gg){this.container=eg,this.menuItems=gg,this.activeSubmenus=[],this.shown=!1,this.disableTop=!1,this.disableBottom=!1,this.activeSubmenuHandler=this._activeSubmenuHandler.bind(this),this.menuItems=gg,this.menuElement=this.createMenuElement(),eg.appendChild(this.menuElement),this.setupEventListeners()}setTargetObj(eg){this.targetObj=eg}createMenuElement(){const eg=document.createElement("div");return eg.id="custom-context-menu",eg}resolveText(eg){if(eg==null)return"";const gg=eg;return(contextMenuTextResolver==null?void 0:contextMenuTextResolver(gg))??gg}createMenuItemElement(eg){const gg={itemText:eg.text??""};if(eg.isShow&&!eg.isShow(this.targetObj,gg))return document.createElement("div");if(gg.itemText=this.resolveText(gg.itemText),eg.isSeparator){const ag=document.createElement("div");return ag.classList.add("item-separator"),ag}if(eg.isGroupTitle){const ag=document.createElement("div");return ag.textContent=gg.itemText,ag.classList.add("item-group"),ag}const ig=document.createElement("div");ig.className="menu-item",ig.dataset.id=eg.id,eg.disabled&&ig.classList.add("canvas-contextmenu-disabled"),eg.subItems&&eg.subItems.length>0&&ig.classList.add("has-submenu");const ng=document.createElement("div");ng.textContent=gg.itemText;const og=document.createElement("div");if(og.classList.add("menu-item-content"),og.appendChild(ng),!eg.subItems||eg.subItems.length===0){const ag=document.createElement("div");ag.style.marginLeft="20px",ag.style.color="#999",ag.textContent=eg.hotKey||"",og.appendChild(ag)}if(ig.appendChild(og),eg.subItems&&eg.subItems.length>0){const ag=document.createElement("span");ag.className="arrow",ag.textContent="›",ig.appendChild(ag)}if(eg.subItems&&!eg.disabled){if(eg.subItems.length>0){const ag=this.activeSubmenus.length+1,Ig=document.createElement("div");Ig.className="submenu",Ig.style.zIndex=ag+"",eg.subItems.forEach(sg=>{const Cg=this.createMenuItemElement(sg);Cg&&Ig.appendChild(Cg)}),ig.appendChild(Ig),ig.addEventListener("mouseenter",sg=>{this.activeSubmenuHandler(sg)||(Ig.style.display="block",this.positionSubmenu(ig,Ig),this.activeSubmenus.push(ig,Ig))})}}else eg.disabled||(ig.addEventListener("click",ag=>{if(eg.handler){const Ig=eg.handler(eg,ag);this.canvasContainer&&this.canvasContainer.focus({preventScroll:!0}),Ig!==!1&&this.hide()}else this.hide();ag.stopPropagation()}),ig.addEventListener("mouseenter",this.activeSubmenuHandler));return ig}_activeSubmenuHandler(eg){if(this.activeSubmenus.length>0){const gg=eg.target;for(let ig=this.activeSubmenus.length-1;ig>0;ig-=2){const ng=this.activeSubmenus[ig-1],og=this.activeSubmenus[ig];if(ng.parentElement===gg.parentElement){if(ng===gg)return!0;og.style.display="none"}else{if(og.contains(gg))return!1;og.style.display="none"}this.activeSubmenus.pop(),this.activeSubmenus.pop()}}return!1}setupEventListeners(){document.addEventListener("click",eg=>{!this.menuElement.contains(eg.target)&&this.shown&&this.hide()}),document.addEventListener("keydown",eg=>{eg.key==="Escape"&&this.shown&&this.hide()})}positionMenu(eg,gg){const ig=window.innerWidth,ng=window.innerHeight,og=this.menuElement.offsetWidth,ag=this.menuElement.offsetHeight;eg+og>ig&&(eg=ig-og-5),gg+ag>ng&&(gg=ng-ag-5),this.menuElement.style.left=`${eg}px`,this.menuElement.style.top=`${gg}px`}positionSubmenu(eg,gg){const ig=eg.getBoundingClientRect(),ng=gg.offsetWidth,og=window.innerWidth,ag=getComputedStyle(gg);let Ig=0,sg=0;ig.right+ng>og?(Ig=-ng-parseInt(ag.paddingLeft),gg.classList.add("left")):Ig=ig.width+parseInt(ag.paddingLeft);const Cg=gg.offsetHeight,lg=window.innerHeight;ig.top+Cg>lg?sg=ig.height-Cg+parseInt(ag.paddingBottom):sg=-parseInt(ag.paddingTop),gg.style.left=`${Ig}px`,gg.style.top=`${sg}px`}show(eg,gg){console.time("show"),this.shown&&this.hide(),this.menuElement.innerHTML="",this.menuItems.forEach(ig=>{const ng=this.createMenuItemElement(ig);ng&&this.menuElement.appendChild(ng)}),this.menuElement.style.display="block",this.positionMenu(eg,gg),this.shown=!0,console.timeEnd("show")}hide(){this.shown&&(this.menuElement.style.display="none",this.menuElement.innerHTML="",this.shown=!1)}addItems(eg,gg){gg?this.addItemsToSubmenu(eg,gg,this.menuItems):this.menuItems.push(...eg)}addItemsToSubmenu(eg,gg,ig){for(const ng of ig){if(ng.id===gg)return ng.subItems||(ng.subItems=[]),ng.subItems.push(...eg),!0;if(ng.subItems&&this.addItemsToSubmenu(eg,gg,ng.subItems))return!0}return!1}updateItem(eg,gg){return this.updateItemRecursive(eg,gg,this.menuItems)}updateItemRecursive(eg,gg,ig){for(const ng of ig){if(ng.id===eg)return Object.assign(ng,gg),!0;if(ng.subItems&&this.updateItemRecursive(eg,gg,ng.subItems))return!0}return!1}removeItem(eg){return this.removeItemRecursive(eg,this.menuItems)}removeItemRecursive(eg,gg){const ig=gg.findIndex(ng=>ng.id===eg);if(ig!==-1)return gg.splice(ig,1),!0;for(const ng of gg)if(ng.subItems&&this.removeItemRecursive(eg,ng.subItems))return!0;return!1}getItems(){return this.menuItems}setItems(eg){this.menuItems=eg}}class ContextMenuPlugin{constructor(){this.name="ContextMenuPlugin",this.eventHandler={contextmenu:this.contextMenuHandler.bind(this)}}addItem(eg){var ig;const gg=Array.isArray(eg)?eg:[eg];(ig=this.contextMenu)==null||ig.addItems(gg),gg.forEach(ng=>{!ng.isGroupTitle&&!ng.isSeparator&&ng.hotKey&&ng.hotKeyHandler&&this.editor.addHotKey(ng.hotKey,ng.hotKeyHandler)})}removeItem(eg){var gg;(gg=this.contextMenu)==null||gg.removeItem(eg)}updateItem(eg,gg){if(this.contextMenu&&(this.contextMenu.updateItem(eg,gg),gg.hotKey&&gg.hotKeyHandler)){const ig=this.contextMenu.getItems().find(ng=>ng.id===eg);ig&&(ig.hotKey&&this.editor.removeHotKey(ig.hotKey),ig.hotKey=gg.hotKey,ig.hotKeyHandler=gg.hotKeyHandler,this.editor.addHotKey(ig.hotKey,ig.hotKeyHandler))}}disabled(){this.contextMenu&&this.container&&(this.editor.getCanvas().off("contextmenu",this.eventHandler.contextmenu),this.contextMenu.hide(),this.contextMenu.getItems().forEach(eg=>{!eg.isGroupTitle&&!eg.isSeparator&&eg.hotKey&&eg.hotKeyHandler&&this.editor.removeHotKey(eg.hotKey)}))}contextMenuHandler(eg){var gg;if(eg.e){const ig=eg.e;if(ig.button===2&&eg.target&&this.contextMenu){if(eg.target.id==="workspace")return;let ng=((gg=this.canvas)==null?void 0:gg.getObjects())||[];ng=ng.filter(sg=>sg.id!=="workspace");let og=ng==null?void 0:ng.indexOf(eg.target);const ag=og===(ng==null?void 0:ng.length)-1,Ig=og===0;this.contextMenu.disableTop=ag,this.contextMenu.disableBottom=Ig,eg.target.type==="activeselection"?eg.target.getObjects().length>1?(this.contextMenu.updateItem("lock",{disabled:!0}),this.contextMenu.updateItem("layer",{disabled:!0})):(this.contextMenu.updateItem("lock",{disabled:!1}),this.contextMenu.updateItem("layer",{disabled:!1})):(this.contextMenu.updateItem("lock",{disabled:!1}),this.contextMenu.updateItem("layer",{disabled:!1})),this.contextMenu.updateItem("layer-top",{disabled:!1}),this.contextMenu.updateItem("layer-up",{disabled:!1}),this.contextMenu.updateItem("layer-bottom",{disabled:!1}),this.contextMenu.updateItem("layer-down",{disabled:!1}),ag&&(this.contextMenu.updateItem("layer-top",{disabled:!0}),this.contextMenu.updateItem("layer-up",{disabled:!0})),Ig&&(this.contextMenu.updateItem("layer-bottom",{disabled:!0}),this.contextMenu.updateItem("layer-down",{disabled:!0})),ig.preventDefault(),this.canvas.setActiveObject(eg.target),this.contextMenu.setTargetObj(eg.target),this.contextMenu.show(ig.clientX,ig.clientY)}}}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.container=document.getElementById("app"),this.contextMenu=new ContextMenu(this.container,[]),this.contextMenu.canvasContainer=this.canvas.elements.container,this.enabled()}enabled(){this.contextMenu&&this.container&&(this.editor.getCanvas().on("contextmenu",this.eventHandler.contextmenu),this.contextMenu.getItems().forEach(eg=>{!eg.isGroupTitle&&!eg.isSeparator&&eg.hotKey&&eg.hotKeyHandler&&this.editor.addHotKey(eg.hotKey,eg.hotKeyHandler)}))}}class Ruler{constructor(eg,gg){this.ctx=eg,this.dpi=96,this.isShown=!1,this.gapValue=0,this.getGapMM=ig=>{const ng=[.02,.05,.1,.2,.5,1,2,5,10],og=[500,200,100,50,25,10,5,2,1];let ag=0;for(;ag<ng.length&&ng[ag]<ig;)ag++;return og[ag-1]||1e3},this.options=gg}show(){this.isShown=!0}hide(){this.isShown=!1}drawLine(eg,gg,ig,ng,og,ag){this.ctx.save(),this.ctx.beginPath(),og&&(this.ctx.strokeStyle=og),this.ctx.lineWidth=ag??1,this.ctx.moveTo(eg+.5,gg+.5),this.ctx.lineTo(eg+ig+.5,gg+ng+.5),this.ctx.stroke(),this.ctx.restore()}drawText({text:eg="",left:gg=0,top:ig=0,fillStyle:ng,align:og,angle:ag,fontSize:Ig=this.options.fontSize}){this.ctx.save(),ng&&(this.ctx.fillStyle=ng),this.ctx.textAlign=og??"left",this.ctx.textBaseline="top",this.ctx.font=`${Ig??10}px sans-serif, Noto Sans, SourceHanSansCN`,ag&&(this.ctx.translate(gg,ig),this.ctx.rotate(Math.PI/180*ag),this.ctx.translate(-gg,-ig)),this.ctx.fillText(eg,gg,ig),this.ctx.restore()}darwRect({left:eg=0,top:gg=0,width:ig,height:ng,fillStyle:og,stroke:ag,strokeWidth:Ig}){this.ctx.save(),this.ctx.beginPath(),og&&(this.ctx.fillStyle=og),this.ctx.rect(eg,gg,ig,ng),this.ctx.fill(),ag&&(this.ctx.strokeStyle=ag,this.ctx.lineWidth=Ig??1,this.ctx.stroke()),this.ctx.restore()}drawMask(eg,gg,ig,ng,og,ag){this.ctx.save();const Ig=eg?this.ctx.createLinearGradient(gg,og/2,gg+ng,og/2):this.ctx.createLinearGradient(ng/2,ig,ng/2,og+ig),sg=new Le(ag);sg.setAlpha(0),Ig.addColorStop(0,sg.toRgba()),Ig.addColorStop(.33,ag),Ig.addColorStop(.67,ag),Ig.addColorStop(1,sg.toRgba()),this.darwRect({left:gg,top:ig,width:ng,height:og,fillStyle:Ig}),this.ctx.restore()}drawBackground(eg,gg,ig){const ng=this.options.rulerSize,og=this.options.canvasWidth,ag=this.options.canvasHeight;eg?this.darwRect({left:0,top:0,width:og,height:ng,fillStyle:this.options.backgroundColor}):this.darwRect({left:0,top:0,width:ng,height:ag,fillStyle:this.options.backgroundColor})}drawMM(eg,gg,ig){const ng=this.options.rulerSize,og=this.options.canvasWidth,ag=this.options.canvasHeight,Ig=this.getGapMM(ig);this.gapValue=Ig;const sg=this.dpi/25.4*ig*Ig,Cg=ng*.2,lg=ng*.8,Ag=new Le(this.options.textColor).toRgb();eg?(this.drawLine(0,0,og,0,this.options.borderColor),this.drawLine(0,ng,og,0,Ag)):(this.drawLine(0,0,0,ag,this.options.borderColor),this.drawLine(ng,0,0,ag,Ag)),this.ctx.save(),this.ctx.beginPath();let cg=Ig>2,rg=Ig>10?10:Ig>=5?5:1;if(eg){if(this.ctx.rect(ng,0,og-ng,ng),this.ctx.clip(),gg<0){let bg=-gg*ig-sg,mg=1;for(;bg>ng;){if(cg&&mg===1)for(let wg=1;wg<10;wg++){const Gg=bg+sg/rg*wg;Gg>ng&&this.drawLine(Gg,Cg+13,0,lg*.3,Ag,1)}if(this.drawLine(bg,Cg+10,0,lg*.6,Ag),cg)for(let wg=1;wg<10;wg++){const Gg=bg-sg/rg*wg;Gg>ng&&this.drawLine(Gg,Cg+13,0,lg*.3,Ag,1)}const hg=-mg*Ig+"",pg=10*hg.length/4,fg=ng-this.options.fontSize-2;this.drawText({text:hg,left:bg-pg,top:fg-7,fillStyle:Ag,align:void 0,angle:0}),bg-=sg,mg++}}let ug=-gg*ig,dg=0;for(;ug<og;){if(Math.ceil(ug)>=ng){if(this.drawLine(ug,Cg+10,0,lg*.6,Ag),cg)for(let pg=1;pg<10;pg++){const fg=ug+sg/rg*pg;fg<og&&this.drawLine(fg,Cg+13,0,lg*.3,Ag,1)}const bg=dg*Ig+"",mg=10*bg.length/4,hg=ng-this.options.fontSize-2;this.drawText({text:bg,left:ug-mg,top:hg-7,fillStyle:Ag,align:void 0,angle:0})}ug+=sg,dg++}}else{if(this.ctx.rect(0,ng,ng,ag-ng),this.ctx.clip(),gg<0){let bg=-gg*ig-sg,mg=1;for(;bg>ng;){if(cg&&mg===1)for(let wg=1;wg<10;wg++){const Gg=bg+sg/rg*wg;Gg>ng&&this.drawLine(Cg+13,Gg,lg*.3,0,Ag,1)}if(this.drawLine(Cg+10,bg,lg*.6,0,Ag),cg)for(let wg=1;wg<10;wg++){const Gg=bg-sg/rg*wg;Gg>ng&&this.drawLine(Cg+13,Gg,lg*.3,0,Ag,1)}const hg=-mg*Ig+"",pg=10*hg.length/4,fg=ng-this.options.fontSize-2;this.drawText({text:hg,left:fg-7,top:bg+pg,fillStyle:Ag,align:void 0,angle:-90}),bg-=sg,mg++}}let ug=-gg*ig,dg=0;for(;ug<ag;){if(ug>ng){if(this.drawLine(Cg+10,ug,lg*.6,0,Ag),cg)for(let pg=1;pg<10;pg++){const fg=ug+sg/rg*pg;fg<ag&&this.drawLine(Cg+13,fg,lg*.3,0,Ag,1)}const bg=dg*Ig+"",mg=10*bg.length/4,hg=ng-this.options.fontSize-2;this.drawText({text:bg,left:hg-7,top:ug+mg,fillStyle:Ag,align:void 0,angle:-90})}ug+=sg,dg++}}this.ctx.restore()}drawActiveLine(eg,gg,ig){if(!this.objectRect)return;const ng=this.options.rulerSize,og=eg?"x":"y",ag=new Le(this.options.maskColor);this.objectRect[og].forEach(Ig=>{if(ag.setAlpha(.5),Ig.skip===og)return;let sg=eg?Ig.left:Ig.top,Cg=eg?Ig.width:Ig.height,lg=(sg-gg)*ig,Ag=Cg*ig;const cg={width:eg?Ag:ng-8,height:eg?ng-8:Ag,backgroundColor:this.options.backgroundColor};this.drawMask(eg,eg?lg:0,eg?2:lg,cg.width,cg.height,cg.backgroundColor),this.darwRect({left:eg?lg:ng-8,top:eg?ng-8:lg,width:eg?Ag:8,height:eg?8:Ag,fillStyle:ag.toRgba()});const rg=ng/2-(this.options.fontSize??12)/2-4,ug=pg=>Math.round(pg*(25.4/Editor.DPI)*100)/100+"",dg=ug(sg),bg=ug(sg+Cg),mg={fill:ag.toRgba(),angle:eg?0:-90};this.drawText({text:dg,left:eg?lg-2:rg,top:eg?rg:lg-15,fillStyle:mg.fill,align:eg?"right":"center",angle:mg.angle}),dg!==bg&&this.drawText({text:bg,left:eg?lg+Ag+2:rg,top:eg?rg:lg+Ag+17,fillStyle:mg.fill,align:eg?"left":"center",angle:mg.angle});const hg=dg===bg?8:14;ag.setAlpha(1),this.drawLine(eg?lg:ng-hg,eg?ng-hg:lg,eg?0:hg,eg?hg:0,ag.toRgba()),dg!==bg&&this.drawLine(eg?lg+Ag:ng-hg,eg?ng-hg:lg+Ag,eg?0:hg,eg?hg:0,ag.toRgba())})}}class RulerPlugin{constructor(){this.name="RulerPlugin",this.eventHandler={calcObjectRect:throttle$3(this.calcObjectRect.bind(this),15),selectinClear:throttle$3(this.selectionClear.bind(this),15),renderRuler:eg=>{eg.ctx&&this.renderRuler()},canvasMouseDown:throttle$3(this.canvasMouseDown.bind(this),15),canvasMouseMove:throttle$3(this.canvasMouseMove.bind(this),15),canvasMouseUp:throttle$3(this.canvasMouseUp.bind(this),15)}}uninstall(){}install(eg,gg){this.editor=eg;const ig=Object.assign({rulerSize:25,fontSize:12,canvasWidth:this.editor.getCanvas().width,canvasHeight:this.editor.getCanvas().height,backgroundColor:"#fff",borderColor:"#ddd",maskColor:"#007fff",textColor:"#888"},gg);this.ruler=new Ruler(eg.getCanvas().elements.lower.ctx,ig),eg.getPlugin("ContextMenuPlugin")}enabled(){if(this.editor&&this.ruler&&!this.ruler.isShown){const eg=this.editor.getCanvas();eg.on("after:render",this.eventHandler.calcObjectRect),eg.on("after:render",this.eventHandler.renderRuler),eg.on("mouse:down",this.eventHandler.canvasMouseDown),eg.on("mouse:move",this.eventHandler.canvasMouseMove),eg.on("mouse:up",this.eventHandler.canvasMouseUp),eg.on("selection:cleared",this.eventHandler.selectinClear),this.ruler.dpi=Editor.DPI,this.ruler.show(),this.renderRuler()}}disabled(){if(this.editor&&this.ruler&&this.ruler.isShown){this.ruler.hide();const eg=this.editor.getCanvas();eg.off("after:render",this.eventHandler.calcObjectRect),eg.off("after:render",this.eventHandler.renderRuler),eg.off("mouse:down",this.eventHandler.canvasMouseDown),eg.off("mouse:move",this.eventHandler.canvasMouseMove),eg.off("mouse:up",this.eventHandler.canvasMouseUp),eg.off("selection:cleared",this.eventHandler.selectinClear),this.editor.getCanvas().renderAll()}}setCanvasSize(eg,gg){this.ruler&&(this.ruler.options.canvasWidth=eg,this.ruler.options.canvasHeight=gg)}calcObjectRect(){if(!this.editor)return;const gg=this.editor.getCanvas().getActiveObjects();if(gg.length===0)return;const ig=gg.reduce((ng,og)=>{const ag=og.getBoundingRect();return ng.push(ag),ng},[]);ig.length!==0&&(this.ruler.objectRect={x:mergeLines(ig,!0),y:mergeLines(ig,!1)})}renderRuler(){if(!this.editor||!this.ruler||!this.ruler.isShown)return;const eg=this.editor.getCanvas(),gg=eg.viewportTransform;gg&&(this.ruler.drawBackground(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawBackground(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.drawMM(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawMM(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.drawActiveLine(!0,-(gg[4]/gg[0]),eg.getZoom()),this.ruler.drawActiveLine(!1,-(gg[5]/gg[3]),eg.getZoom()),this.ruler.options.callback&&this.ruler.options.callback(this.ruler.gapValue))}canvasMouseDown(){}canvasMouseUp(){}canvasMouseMove(){}selectionClear(){this.ruler&&(this.ruler.objectRect=void 0)}}const mergeLines=(tg,eg)=>{const gg=eg?"left":"top",ig=eg?"width":"height",ng=1e-6;if(!tg||tg.length===0)return[];if(tg.length===1)return[Object.assign({},tg[0])];tg.sort((Ig,sg)=>Ig[gg]-sg[gg]);const og=[];let ag=Object.assign({},tg[0]);for(let Ig=1;Ig<tg.length;Ig++){const sg=tg[Ig],Cg=ag[gg]+ag[ig],lg=sg[gg];if(Cg>=lg-ng){const Ag=Math.max(Cg,sg[gg]+sg[ig]);ag[ig]=Ag-ag[gg]}else og.push(ag),ag=Object.assign({},sg)}return og.push(ag),og};class WorkspacePlugin{constructor(){this.name="WorkspacePlugin",this.gapVal=20,this.backgroundColor="#FFFFFFFF",this.backgroundImage="",this.backgroundImageCover=!0,this.backgroundImageElement=null,this.backgroundImageLoadId=0,this.resizeFrame=0,this.resizeTimer=null,this.lastCanvasSize={width:0,height:0},this.resizeObserver=new ResizeObserver(eg=>{!eg.find(ig=>ig.target===this.workspaceEl)||!this.canvas||(cancelAnimationFrame(this.resizeFrame),this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>{this.resizeFrame=requestAnimationFrame(()=>{this.applyCanvasViewportSize()})},80))}),this.initWorkspace=()=>{const eg=this.canvas,gg=this.option.type;let ig;gg==="Rectangle"||gg==="RoundedRectangle"?ig=new Er({fill:this.option.backgroundColor??"yellow",width:this.option.width,height:this.option.height,rx:this.option.rx,ry:this.option.ry,strokeWidth:0}):ig=new _o({fill:this.option.backgroundColor??"yellow",width:this.option.width,height:this.option.height,rx:this.option.rx,ry:this.option.ry,strokeWidth:0}),ig.set("id","workspace"),ig.set("workspaceBackgroundColor",this.backgroundColor),ig.set("workspaceBackgroundImage",this.backgroundImage),ig.set("workspaceBackgroundImageCover",this.backgroundImageCover),this.bindRibbonBorderRender(ig),ig.set("selectable",!1),ig.set("hasControls",!1),ig.excludeFromExport=!0,ig.moveCursor="default",ig.hoverCursor="default",eg.insertAt(0,ig),this.workspace=ig,this.refreshWorkspaceBackground(),eg.renderAll();const{width:ng,height:og}=this.getWorkspaceViewportSize();eg.setDimensions({width:ng,height:og}),this.lastCanvasSize={width:ng,height:og},this.resizeObserver.observe(this.workspaceEl),eg.on("mouse:wheel",this.onWheel);const ag=eg.getWidth()*.7,Ig=eg.getHeight()*.7,sg=ag/this.option.width,Cg=Ig/this.option.height;this.setZoomAuto(Math.min(sg,Cg))},this.onWheel=eg=>{if(!this.canvas)return;const gg=eg.e.deltaY;let ig=this.canvas.getZoom();ig*=.999**gg,ig=this.clampZoom(ig);const ng=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(ng.left,ng.top),ig),eg.e.preventDefault(),eg.e.stopPropagation()}}getWorkspaceViewportSize(){return{width:Math.floor(this.workspaceEl.clientWidth),height:Math.floor(this.workspaceEl.clientHeight)}}applyCanvasViewportSize(){if(!this.canvas)return;const{width:eg,height:gg}=this.getWorkspaceViewportSize();if(!(eg<=0||gg<=0)&&!(eg===this.lastCanvasSize.width&&gg===this.lastCanvasSize.height)){if(this.lastCanvasSize={width:eg,height:gg},this.editor){const ig=this.editor.getPlugin("RulerPlugin");ig&&ig.setCanvasSize(eg,gg)}this.canvas.setDimensions({width:eg,height:gg}),this.workspace&&this.setCenterFromObject(this.workspace)}}findParent(eg){for(;eg;){if(eg.id==="workspace")return eg;eg=eg.parentElement}return null}install(eg,gg){const ig=this.findParent(eg.getCanvas().elements.container);if(!ig)throw new Error("element #workspace is missing, plz check!");this.editor=eg,this.workspaceEl=ig,this.workspace=void 0,this.option=gg,this.backgroundColor=(gg==null?void 0:gg.backgroundColor)||"#FFFFFFFF",this.backgroundImage=(gg==null?void 0:gg.backgroundImage)||"",this.backgroundImageCover=(gg==null?void 0:gg.backgroundImageCover)!==!1,this.loadBackgroundImageElement(this.backgroundImage),this.editor.addHook("setSize",this.initWorkspace);const ng=eg.getCanvas();ng.backgroundImage=void 0,this.canvas=ng,this.initWorkspace()}uninstall(){var eg,gg;cancelAnimationFrame(this.resizeFrame),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.resizeObserver.disconnect(),(eg=this.canvas)==null||eg.off("mouse:wheel",this.onWheel),this.workspace&&((gg=this.canvas)==null||gg.remove(this.workspace)),this.workspace=void 0,this.canvas=void 0,this.editor=void 0}bindRibbonBorderRender(eg){const gg=eg._render.bind(eg);eg._render=ig=>{var Ig,sg,Cg;if(gg(ig),this.drawBackgroundImage(ig,eg),this.drawGrid(ig,eg),(Ig=this.editor)!=null&&Ig.getCanvas().get("flagToDataURL"))return;const ng=(sg=this.editor)==null?void 0:sg.ribbonBorderPattern;if(!ng||ng==="none")return;const og=eg.width||this.option.width,ag=eg.height||this.option.height;drawRibbonBorder(ig,ng,{left:-og/2,top:-ag/2,width:og,height:ag},(Cg=this.editor)==null?void 0:Cg.ribbonBorderTextures)}}createWorkspacePath(eg,gg){const ig=gg.width||this.option.width,ng=gg.height||this.option.height,og=-ig/2,ag=-ng/2;if(eg.beginPath(),gg.type==="ellipse"){eg.ellipse(0,0,ig/2,ng/2,0,0,Math.PI*2);return}const Ig=Math.min(Math.abs(gg.rx||0),ig/2),sg=Math.min(Math.abs(gg.ry||0),ng/2);if(!Ig&&!sg){eg.rect(og,ag,ig,ng);return}eg.moveTo(og+Ig,ag),eg.lineTo(og+ig-Ig,ag),eg.quadraticCurveTo(og+ig,ag,og+ig,ag+sg),eg.lineTo(og+ig,ag+ng-sg),eg.quadraticCurveTo(og+ig,ag+ng,og+ig-Ig,ag+ng),eg.lineTo(og+Ig,ag+ng),eg.quadraticCurveTo(og,ag+ng,og,ag+ng-sg),eg.lineTo(og,ag+sg),eg.quadraticCurveTo(og,ag,og+Ig,ag)}drawBackgroundImage(eg,gg){const ig=this.backgroundImageElement;if(!ig||!this.backgroundImage)return;const ng=gg.width||this.option.width,og=gg.height||this.option.height,ag=ig.naturalWidth||ig.width,Ig=ig.naturalHeight||ig.height;if(!ag||!Ig)return;const sg=this.backgroundImageCover?ng:ag,Cg=this.backgroundImageCover?og:Ig,lg=-sg/2,Ag=-Cg/2;eg.save(),this.createWorkspacePath(eg,gg),eg.clip(),eg.drawImage(ig,lg,Ag,sg,Cg),eg.restore()}drawGrid(eg,gg){var sg;if(!gg.isHasGrid||(sg=this.editor)!=null&&sg.getCanvas().get("flagToDataURL"))return;const ig=gg.width||this.option.width,ng=gg.height||this.option.height,og=-ig/2,ag=-ng/2,Ig=20;eg.save(),this.createWorkspacePath(eg,gg),eg.clip(),eg.strokeStyle="#888",eg.lineWidth=1,eg.globalAlpha=1;for(let Cg=og+Ig;Cg<og+ig;Cg+=Ig)eg.beginPath(),eg.moveTo(Cg,ag),eg.lineTo(Cg,ag+ng),eg.stroke();for(let Cg=ag+Ig;Cg<ag+ng;Cg+=Ig)eg.beginPath(),eg.moveTo(og,Cg),eg.lineTo(og+ig,Cg),eg.stroke();eg.restore()}setZoomAuto(eg){if(!this.editor||!this.canvas)return;this.workspaceEl;const gg=this.editor.getCanvas();if(!gg)return;const ig=gg.getCenterPoint();gg.setViewportTransform(T$1),gg.zoomToPoint(new ot(ig.x,ig.y),eg),this.workspace&&this.setCenterFromObject(this.workspace)}setCenterFromObject(eg){if(!this.editor||!this.canvas)return;const gg=this.editor.getCanvas(),ig=eg.getCenterPoint(),ng=gg.viewportTransform;gg.width===void 0||gg.height===void 0||!ng||(ng[4]=gg.width/2-ig.x*ng[0],ng[5]=gg.height/2-ig.y*ng[3],gg.setViewportTransform(ng),gg.renderAll())}showGrid(){this.createGridBackground()}hideGrid(){this.createGridBackground(!1)}async setBackground({color:eg,image:gg,cover:ig}){eg!==void 0&&(this.backgroundColor=eg||"#FFFFFFFF"),gg!==void 0&&(this.backgroundImage=gg||""),ig!==void 0&&(this.backgroundImageCover=ig),this.workspace&&(this.workspace.set("workspaceBackgroundColor",this.backgroundColor),this.workspace.set("workspaceBackgroundImage",this.backgroundImage),this.workspace.set("workspaceBackgroundImageCover",this.backgroundImageCover)),gg!==void 0&&await this.loadBackgroundImageElement(this.backgroundImage),this.refreshWorkspaceBackground()}refreshWorkspaceBackground(){!this.workspace||!this.canvas||(this.workspace.set("fill",this.backgroundColor||"#FFFFFFFF"),this.workspace.dirty=!0,this.canvas.requestRenderAll())}async loadBackgroundImageElement(eg){var ig;const gg=++this.backgroundImageLoadId;if(!eg){this.backgroundImageElement=null;return}try{const ng=await new Promise((og,ag)=>{const Ig=new Image;Ig.onload=()=>og(Ig),Ig.onerror=ag,Ig.src=eg});if(gg!==this.backgroundImageLoadId)return;this.backgroundImageElement=ng,this.workspace&&(this.workspace.dirty=!0),(ig=this.canvas)==null||ig.requestRenderAll()}catch(ng){if(gg!==this.backgroundImageLoadId)return;this.backgroundImageElement=null,console.log("load background image error",ng)}}createGridBackground(eg=!0){!this.canvas||!this.workspace||(this.workspace.set("isHasGrid",eg),this.workspace.dirty=!0,this.canvas.renderAll())}getFitZoom(){if(!this.canvas||!this.option)return .2;const eg=this.canvas.getWidth()*.7,gg=this.canvas.getHeight()*.7,ig=eg/this.option.width,ng=gg/this.option.height;return Math.min(ig,ng)}getMinZoom(){return Math.max(.005,Math.min(.2,this.getFitZoom()*.5))}getMaxZoom(){return 12}clampZoom(eg){return Math.min(this.getMaxZoom(),Math.max(this.getMinZoom(),eg))}big(){let eg=this.canvas.getZoom();eg+=.05;const gg=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(gg.left,gg.top),this.clampZoom(eg))}small(){let eg=this.canvas.getZoom();eg-=.05;const gg=this.canvas.getCenter();this.canvas.zoomToPoint(new ot(gg.left,gg.top),this.clampZoom(eg))}auto(){this.setZoomAuto(this.getFitZoom())}one(){this.setZoomAuto(1)}createExportWorkspace(eg){if(!this.workspace)return null;const gg=this.workspace,ig=gg.type==="ellipse",ng={fill:this.backgroundColor,width:gg.width,height:gg.height,rx:gg.rx,ry:gg.ry,strokeWidth:0,left:gg.left,top:gg.top};let og;if(ig?og=new _o(ng):og=new Er(ng),og.set("id","workspace"),og.set("selectable",!1),this.backgroundImageElement&&this.backgroundImage){const ag=og._render.bind(og);og._render=Ig=>{ag(Ig),this.drawBackgroundImage(Ig,og)}}return eg.insertAt(0,og),og}enabled(){}disabled(){}}const aligningLineConfig={margin:4,width:1,color:"rgb(255,0,0,0.9)"};function getDistance(tg,eg){return Math.abs(tg-eg)}function setPositionDir(tg,eg,gg){const ig=tg.translateToCenterPoint(eg,"center","center"),ng=tg.translateToOriginPoint(ig,tg.originX,tg.originY);gg=="x"?tg.setX(ng.x):tg.setY(ng.y)}const originXArr=["left","center","right"],originYArr=["top","center","bottom"];function collectVerticalPoint(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,isScale:og,index:ag,point:Ig,list:sg}=tg,{dis:Cg,arr:lg}=getDistanceList(Ig,sg,"x"),Ag=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1);if(Cg>Ag)return[];let cg=lg[lg.length-1].x-Ig.x;const rg=ag==0||ag==3?-1:1;cg*=rg;const{width:ug,scaleX:dg,left:bg}=ng,mg=ng._getTransformedDimensions(),hg=(cg+mg.x)/mg.x;og?ng.set("scaleX",dg*hg):ng.set("width",ug*hg);const pg=[0,cg/2*rg,cg*rg];rg<0&&pg.reverse();const fg=pg[originXArr.indexOf(ng.originX)];return ng.set("left",bg+fg),ng.setCoords(),lg.map(wg=>({x:wg.x,y1:wg.y,y2:Ig.y}))}function collectHorizontalPoint(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,isScale:og,index:ag,point:Ig,list:sg}=tg,{dis:Cg,arr:lg}=getDistanceList(Ig,sg,"y"),Ag=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1);if(Cg>Ag)return[];let cg=lg[lg.length-1].y-Ig.y;const rg=ag<2?-1:1;cg*=rg;const{height:ug,scaleY:dg,top:bg}=ng,mg=ng._getTransformedDimensions(),hg=(cg+mg.y)/mg.y;og?ng.set("scaleY",dg*hg):ng.set("height",ug*hg);const pg=[0,cg/2*rg,cg*rg];rg<0&&pg.reverse();const fg=pg[originYArr.indexOf(ng.originY)];return ng.set("top",bg+fg),ng.setCoords(),lg.map(wg=>({y:wg.y,x1:wg.x,x2:Ig.x}))}function getDistanceList(tg,eg,gg){let ig=1/0,ng=[];for(const og of eg){const ag=getDistance(tg[gg],og[gg]);ig>ag&&(ng=[],ig=ag),ig==ag&&ng.push(og)}return{dis:ig,arr:ng}}function drawLine(tg,eg,gg){const{width:ig,color:ng}=aligningLineConfig,og=tg.getSelectionContext(),ag=tg.viewportTransform,Ig=tg.getZoom();og.save(),og.transform(...ag),og.lineWidth=ig/Ig,og.strokeStyle=ng,og.beginPath(),og.moveTo(eg.x,eg.y),og.lineTo(gg.x,gg.y),og.stroke(),drawX(og,Ig,eg),drawX(og,Ig,gg),og.restore()}const xSize=2.4;function drawX(tg,eg,gg){const ig=xSize/eg;tg.save(),tg.translate(gg.x,gg.y),tg.beginPath(),tg.moveTo(-ig,-ig),tg.lineTo(ig,ig),tg.moveTo(ig,-ig),tg.lineTo(-ig,ig),tg.stroke(),tg.restore()}function drawPoint(tg,eg){const{width:gg,color:ig}=aligningLineConfig,ng=tg.getSelectionContext(),og=tg.viewportTransform,ag=tg.getZoom();ng.save(),ng.transform(...og),ng.lineWidth=gg/ag,ng.strokeStyle=ig;for(const Ig of eg)drawX(ng,ag,Ig);ng.restore()}function drawPointList(tg,eg){const gg=eg.map(ig=>{const ng="y2"in ig,og=ng?ig.x:ig.x1,ag=ng?ig.y1:ig.y;return new ot(og,ag)});drawPoint(tg,gg)}function drawVerticalLine(tg,eg){const gg=eg.x,ig=new ot(gg,eg.y1),ng=new ot(gg,eg.y2);drawLine(tg,ig,ng)}function drawHorizontalLine(tg,eg){const gg=eg.y,ig=new ot(eg.x1,gg),ng=new ot(eg.x2,gg);drawLine(tg,ig,ng)}function getObjectsByTarget(tg){const eg=new Set,gg=tg.canvas;if(!gg)return eg;const ig=tg instanceof Jo?tg.getObjects():[tg];return gg.forEachObject(ng=>{if(ng.isOnScreen()&&ng.visible){if(ng.constructor==Hr){collectObjectsByGroup(eg,ng);return}eg.add(ng)}}),deleteObjectsByList(eg,ig),eg}function deleteObjectsByList(tg,eg){for(const gg of eg)gg.constructor==Hr?deleteObjectsByList(tg,gg.getObjects()):tg.delete(gg)}function collectObjectsByGroup(tg,eg){const gg=eg.getObjects();for(const ig of gg)if(ig.visible){if(ig.constructor==Hr){collectObjectsByGroup(tg,ig);continue}tg.add(ig)}}function collectLine(tg){var eg,gg;const ig=aligningLineConfig.margin,{activeObject:ng,activeObjectRect:og,objectRect:ag}=tg,Ig=makeLineByRect(ag),sg=makeLineByRect(og),Cg=ig/((eg=(gg=ng.canvas)===null||gg===void 0?void 0:gg.getZoom())!==null&&eg!==void 0?eg:1),lg={target:ng,list:Ig,aList:sg,margin:Cg},Ag=collectVerticalLine(lg),cg=collectHorizontalLine(lg);return{vLines:Ag,hLines:cg}}function collectVerticalLine(tg){const{target:eg,list:gg,aList:ig,margin:ng}=tg,og=ig.map(Ag=>getDistanceLine(Ag,gg,"x")),ag=Math.min(...og.map(Ag=>Ag.dis));if(ag>ng)return[];const Ig=[],sg=ig[0].x2-ig[0].x,Cg=ig[0].y2-ig[0].y;let lg=!1;for(let Ag=0;Ag<og.length;Ag++){const cg=og[Ag];if(ag==cg.dis){const rg=gg[cg.index],ug=ig[cg.index],dg=rg.x,bg=ug.y,mg=Math.min(rg.y,rg.y2,bg,ug.y2),hg=Math.max(rg.y,rg.y2,bg,ug.y2);if(Ig.push({x:dg,y1:mg,y2:hg}),lg)continue;lg=!0,setPos({target:eg,x:dg,y:bg,centerX:Ag-1,centerY:cg.index-1,width:sg,height:Cg,dir:"x"});const pg=ag*cg.dir;ig.forEach(fg=>fg.x-=pg)}}return Ig}function collectHorizontalLine(tg){const{target:eg,list:gg,aList:ig,margin:ng}=tg,og=ig.map(Ag=>getDistanceLine(Ag,gg,"y")),ag=Math.min(...og.map(Ag=>Ag.dis));if(ag>ng)return[];const Ig=[],sg=ig[0].x2-ig[0].x,Cg=ig[0].y2-ig[0].y;let lg=!1;for(let Ag=0;Ag<og.length;Ag++){const cg=og[Ag];if(ag==cg.dis){const rg=gg[cg.index],ug=ig[cg.index],dg=rg.y,bg=ug.x,mg=Math.min(rg.x,rg.x2,bg,ug.x2),hg=Math.max(rg.x,rg.x2,bg,ug.x2);if(Ig.push({y:dg,x1:mg,x2:hg}),lg)continue;lg=!0,setPos({target:eg,x:bg,y:dg,centerX:cg.index-1,centerY:Ag-1,width:sg,height:Cg,dir:"y"});const pg=ag*cg.dir;ig.forEach(fg=>fg.y-=pg)}}return Ig}function getDistanceLine(tg,eg,gg){let ig=1/0,ng=-1,og=1;for(let ag=0;ag<eg.length;ag++){const Ig=getDistance(tg[gg],eg[ag][gg]);ig>Ig&&(ng=ag,ig=Ig,og=tg[gg]>eg[ag][gg]?1:-1)}return{dis:ig,index:ng,dir:og}}function makeLineByRect(tg){const{left:eg,top:gg,width:ig,height:ng}=tg,og={x:eg,y:gg,x2:eg+ig,y2:gg+ng},ag=eg+ig/2,Ig=gg+ng/2,sg={x:ag,y:Ig,x2:ag,y2:Ig},Cg={x:eg+ig,x2:eg,y:gg+ng,y2:gg};return[og,sg,Cg]}function setPos(tg){const{target:eg,centerX:gg,centerY:ig,width:ng,height:og,dir:ag}=tg;let{x:Ig,y:sg}=tg;Ig-=gg*ng/2,sg-=ig*og/2,setPositionDir(eg,new ot(Ig,sg),ag),eg.setCoords()}function initAligningGuidelines(tg){let eg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Object.assign(aligningLineConfig,eg);const gg=new Set,ig=new Set;let ng=!1;const og=new Map,ag=cg=>{const rg=[cg.calcTransformMatrix().toString(),cg.width,cg.height].join(),ug=og.get(rg);if(ug)return ug;const dg=cg.getCoords(),mg=[kn.makeBoundingBoxFromPoints(dg),dg];return og.set(rg,mg),mg};function Ig(cg){const rg=cg.target;rg.setCoords(),ng=!1,ig.clear(),gg.clear();const ug=getObjectsByTarget(rg),dg=rg.getBoundingRect();for(const bg of ug){const mg=ag(bg)[0],{vLines:hg,hLines:pg}=collectLine({activeObject:rg,activeObjectRect:dg,objectRect:mg});hg.forEach(fg=>{ig.add(JSON.stringify(fg))}),pg.forEach(fg=>{gg.add(JSON.stringify(fg))})}}function sg(cg){const rg=cg.target;rg.setCoords();const ug=String(cg.transform.action).startsWith("scale");ig.clear(),gg.clear();const dg=getObjectsByTarget(rg);let bg=cg.transform.corner;rg.flipX&&(bg=bg.replace("l","r").replace("r","l")),rg.flipY&&(bg=bg.replace("t","b").replace("b","t"));let mg=["tl","tr","br","bl","mt","mr","mb","ml"].indexOf(bg);if(mg==-1)return;if(ng=mg>3,ng){if(rg.getTotalAngle()%90!=0)return;mg-=4}let hg=rg.getCoords()[mg];for(const pg of dg){const[fg,wg]=ag(pg),Gg=new ot(fg.left+fg.width/2,fg.top+fg.height/2),Zg=[...wg,Gg],yg={activeObject:rg,point:hg,list:Zg,isScale:ug,index:mg},Bg=collectVerticalPoint(yg),Wg=collectHorizontalPoint(yg);Bg.forEach($g=>{ig.add(JSON.stringify($g))}),Wg.forEach($g=>{gg.add(JSON.stringify($g))}),(Bg.length||Wg.length)&&(hg=rg.getCoords()[mg])}}function Cg(){tg.clearContext(tg.contextTop)}function lg(){if(ng){const cg=[];for(const rg of ig)cg.push(JSON.parse(rg));for(const rg of gg)cg.push(JSON.parse(rg));drawPointList(tg,cg)}else{for(const cg of ig)drawVerticalLine(tg,JSON.parse(cg));for(const cg of gg)drawHorizontalLine(tg,JSON.parse(cg))}}function Ag(){ig.clear(),gg.clear(),og.clear(),tg.requestRenderAll()}return tg.on("object:resizing",sg),tg.on("object:scaling",sg),tg.on("object:moving",Ig),tg.on("before:render",Cg),tg.on("after:render",lg),tg.on("mouse:up",Ag),()=>{tg.off("object:resizing",sg),tg.off("object:scaling",sg),tg.off("object:moving",Ig),tg.off("before:render",Cg),tg.off("after:render",lg),tg.off("mouse:up",Ag)}}class GuidelinesPlugin{constructor(){this.name="GuidelinesPlugin"}install(eg,gg={}){this.editor=eg,this.options=gg,this.enabled()}enabled(){this.editor&&(this.deactivate=initAligningGuidelines(this.editor.getCanvas(),this.options))}disabled(){this.deactivate&&this.deactivate()}}const getEffectiveCanvasTool=(tg,eg)=>eg.size>0?"pan":tg,isEditableShortcutTarget=tg=>{var ig;if(!tg||typeof tg.tagName!="string")return!1;const eg=tg,gg=eg.tagName.toUpperCase();return gg==="INPUT"||gg==="TEXTAREA"||gg==="SELECT"||!!((ig=eg.closest)!=null&&ig.call(eg,'[contenteditable="true"]'))};class DringPlugin{constructor(){this.name="DringPlugin",this.persistentTool="select",this.temporaryPanSources=new Set,this.isDragging=!1,this.isEnabled=!1,this.lastPosX=0,this.lastPosY=0,this.previousCanvasSelection=!0,this.previousSkipTargetFind=!1,this.previousDefaultCursor="default",this.dispose=[],this.mouseDown=eg=>{const gg=eg.e,ig=this.getPointerPanSource(gg);ig&&this.temporaryPanSources.add(ig),!(!(gg.button===0&&this.getEffectiveTool()==="pan")&&!ig)&&(gg.preventDefault(),this.isDragging=!0,this.lastPosX=gg.clientX,this.lastPosY=gg.clientY,this.applyEffectiveTool())},this.mouseMove=eg=>{if(!this.isDragging||!this.canvas.viewportTransform)return;const gg=eg.e,ig=this.canvas.viewportTransform;ig[4]+=gg.clientX-this.lastPosX,ig[5]+=gg.clientY-this.lastPosY,this.lastPosX=gg.clientX,this.lastPosY=gg.clientY,this.canvas.setCursor("grabbing"),this.canvas.requestRenderAll()},this.mouseUp=()=>{this.finishDragging()},this.windowMouseUp=()=>{this.finishDragging()},this.keyDown=eg=>{if(isEditableShortcutTarget(eg.target)||this.isFabricTextEditing())return;if(eg.code==="Space"){eg.preventDefault(),this.temporaryPanSources.add("space"),this.applyEffectiveTool();return}if(eg.repeat)return;const gg=eg.key.toLowerCase();gg==="v"?this.setTool("select"):gg==="h"&&this.setTool("pan")},this.keyUp=eg=>{eg.code==="Space"&&(this.temporaryPanSources.delete("space"),this.applyEffectiveTool())},this.windowBlur=()=>{this.temporaryPanSources.clear(),this.isDragging=!1,this.applyEffectiveTool()}}install(eg){this.editor=eg,this.canvas=eg.getCanvas(),this.previousCanvasSelection=this.canvas.selection,this.previousSkipTargetFind=this.canvas.skipTargetFind,this.previousDefaultCursor=this.canvas.defaultCursor,this.enabled()}uninstall(){this.disabled()}enabled(){this.isEnabled||(this.isEnabled=!0,this.dispose.push(this.canvas.on("mouse:down",this.mouseDown)),this.dispose.push(this.canvas.on("mouse:move",this.mouseMove)),this.dispose.push(this.canvas.on("mouse:up",this.mouseUp)),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("mouseup",this.windowMouseUp),window.addEventListener("blur",this.windowBlur),this.applyEffectiveTool())}disabled(){this.isEnabled&&(this.isEnabled=!1,this.dispose.forEach(eg=>eg()),this.dispose.length=0,document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("mouseup",this.windowMouseUp),window.removeEventListener("blur",this.windowBlur),this.temporaryPanSources.clear(),this.isDragging=!1,this.canvas.selection=this.previousCanvasSelection,this.canvas.skipTargetFind=this.previousSkipTargetFind,this.canvas.defaultCursor=this.previousDefaultCursor,this.canvas.setCursor(this.previousDefaultCursor),this.canvas.requestRenderAll())}getTool(){return this.persistentTool}setTool(eg){this.persistentTool!==eg&&(this.persistentTool=eg,eg==="pan"&&this.canvas.discardActiveObject(),this.applyEffectiveTool(),canvasEventBus.emit("canvasToolChanged",{editor:this.editor,tool:eg}))}getEffectiveTool(){return getEffectiveCanvasTool(this.persistentTool,this.temporaryPanSources)}applyEffectiveTool(){const eg=this.getEffectiveTool()==="pan",gg=this.isDragging?"grabbing":eg?"grab":this.previousDefaultCursor;this.canvas.selection=eg?!1:this.previousCanvasSelection,this.canvas.skipTargetFind=eg?!0:this.previousSkipTargetFind,this.canvas.defaultCursor=gg,this.canvas.setCursor(gg),this.canvas.requestRenderAll()}finishDragging(){!this.isDragging&&!this.hasPointerPanSource()||(this.isDragging=!1,this.temporaryPanSources.delete("middle"),this.temporaryPanSources.delete("alt"),this.applyEffectiveTool())}getPointerPanSource(eg){if(eg.button===1)return"middle";if(eg.altKey)return"alt"}hasPointerPanSource(){return this.temporaryPanSources.has("middle")||this.temporaryPanSources.has("alt")}isFabricTextEditing(){const eg=this.canvas.getActiveObject();return!!(eg&&"isEditing"in eg&&eg.isEditing)}}class LockPlugin{constructor(){this.name="LockPlugin"}install(eg,gg){this.editor=eg,this.enabled()}switchLock(){const eg=this.editor;if(eg){const gg=eg.getCanvas(),ig=gg.getActiveObject();ig&&(ig.locked=!ig.locked,gg.fire("custom:object:history",{target:ig,action:"history:update"}))}}enabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.addItem([{id:"lock",text:"editor.contextMenu.lock",hotKey:"Ctrl+L",hotKeyHandler:ig=>{this.switchLock()},handler:(ig,ng)=>(this.switchLock(),!0),isShow:(ig,ng)=>(ng&&(ng.itemText=ig!=null&&ig.locked?"editor.contextMenu.unlock":"editor.contextMenu.lock"),!!ig)}])}}disabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.removeItem("lock")}}}class LayerPlugin{constructor(){this.name="LayerPlugin"}workspaceSendToBack(){const eg=this.canvas,gg=eg.getObjects().find(ig=>ig.id==="workspace");gg&&eg.sendObjectToBack(gg)}layerChangeRefresh(){this.canvas.fire("custom:object:refreshList")}up(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=eg.getActiveObjects()[0];ig&&eg.bringObjectForward(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}down(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=eg.getActiveObjects()[0];ig&&eg.sendObjectBackwards(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}toFront(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=gg[0];ig&&eg.bringObjectToFront(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}toBack(){const eg=this.canvas,gg=eg.getActiveObjects();if(gg&&gg.length===1){const ig=gg[0];ig&&eg.sendObjectToBack(ig),eg.renderAll(),this.workspaceSendToBack(),this.layerChangeRefresh()}}install(eg,gg){this.editor=eg;const ig=eg.getCanvas();this.canvas=ig;const ng=eg.getPlugin("ContextMenuPlugin");ng&&ng.addItem({id:"layer",text:"editor.contextMenu.layers",subItems:[{id:"layer-up",text:"editor.contextMenu.bringForward",handler:(og,ag)=>(this.up(),!0)},{id:"layer-down",text:"editor.contextMenu.sendBackwards",handler:(og,ag)=>(this.down(),!0)},{id:"layer-top",text:"editor.contextMenu.bringToFront",handler:(og,ag)=>(this.toFront(),!0)},{id:"layer-bottom",text:"editor.contextMenu.sendToBack",handler:(og,ag)=>(this.toBack(),!0)}]})}enabled(){}disabled(){}}class ControlsPlugin{constructor(){this.name="ControlsPlugin",this.controls={}}drawImg(eg,gg,ig,ng,og,ag,Ig){Ig!==void 0&&(eg.save(),eg.translate(gg,ig),eg.rotate(kn.degreesToRadians(Ig)),eg.drawImage(ng,-og/2,-ag/2,og,ag),eg.restore())}intervalControl(){const eg=document.createElement("img");eg.src=this.option.verticalImg;const gg=document.createElement("img");gg.src=this.option.horizontalImg;const ig=(og,ag,Ig,sg,Cg)=>{this.drawImg(og,ag,Ig,eg,20,25,Cg.angle)},ng=(og,ag,Ig,sg,Cg)=>{this.drawImg(og,ag,Ig,gg,25,20,Cg.angle)};return{ml:new ni({x:-.5,y:0,offsetX:-1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingXOrSkewingY,getActionName:ja.scaleOrSkewActionName,render:ig}),mr:new ni({x:.5,y:0,offsetX:1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingXOrSkewingY,getActionName:ja.scaleOrSkewActionName,render:ig}),mb:new ni({x:0,y:.5,offsetY:1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingYOrSkewingX,getActionName:ja.scaleOrSkewActionName,render:ng}),mt:new ni({x:0,y:-.5,offsetY:-1,cursorStyleHandler:ja.scaleSkewCursorStyleHandler,actionHandler:ja.scalingYOrSkewingX,getActionName:ja.scaleOrSkewActionName,render:ng})}}peakControl(){const eg=document.createElement("img");eg.src=this.option.edgeImg;const gg=(ig,ng,og,ag,Ig)=>{this.drawImg(ig,ng,og,eg,25,25,Ig.angle)};return{tl:new ni({x:-.5,y:-.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),bl:new ni({x:-.5,y:.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),tr:new ni({x:.5,y:-.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg}),br:new ni({x:.5,y:.5,cursorStyleHandler:ja.scaleCursorStyleHandler,actionHandler:ja.scalingEqually,render:gg})}}rotationControl(){const eg=document.createElement("img");eg.src=this.option.rotateImg;const gg=(ig,ng,og,ag,Ig)=>{this.drawImg(ig,ng,og,eg,40,40,Ig.angle)};return{mtr:new ni({x:0,y:.5,cursorStyleHandler:ja.rotationStyleHandler,actionHandler:ja.rotationWithSnapping,offsetY:30,actionName:"rotate",render:gg})}}install(eg,gg){if(!gg||!gg.verticalImg||!gg.horizontalImg||!gg.edgeImg)throw new Error("ControlsPluginOption参数必需");this.option=gg,this.canvas=eg.getCanvas(),this.controls={...this.peakControl(),...this.intervalControl(),...this.rotationControl()},Ei.createControls=()=>({controls:{...this.controls}}),Ei.ownDefaults.controls={...this.controls},Ei.ownDefaults.snapAngle=15,Ei.ownDefaults.snapThreshold=5,this.refreshObjectControls()}refreshObjectControls(){if(!this.canvas)return;const eg=gg=>{gg.id!=="workspace"&&gg.locked!==!0&&gg.set({selectable:!0,evented:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1}),gg.id!=="workspace"&&gg.hasControls!==!1&&(gg.controls={...this.controls},gg.setCoords());const ig=gg._objects;Array.isArray(ig)&&ig.forEach(eg)};this.canvas.getObjects().forEach(eg),this.canvas.requestRenderAll()}enabled(){}disabled(){}}class AlignPlugin{constructor(){this.name="AlignPlugin",this.left=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0}=ig;gg.discardActiveObject(),ng.forEach(Ig=>{const sg=Ig.getBoundingRect();console.log("getBoundingRect",sg),console.log("item",Ig.left,Ig.width),Ig.set({left:og-sg.left+Number(Ig.left)}),Ig.setCoords()}),console.log("align-left",ng),gg.fire("custom:object:history",{action:"align-left"});const ag=new Jo(ng,{canvas:gg});gg.setActiveObject(ag),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"left")},this.right=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0,width:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({left:og+ag-(Cg.left+Cg.width)+Number(sg.left)})}),gg.fire("custom:object:history",{action:"align-right"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"right")},this.xcenter=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{left:og=0,width:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({left:og+ag/2-(Cg.left+Cg.width/2)+Number(sg.left)})}),gg.fire("custom:object:history",{action:"align-xcenter"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}},this.ycenter=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0,height:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({top:og+ag/2-(Cg.top+Cg.height/2)+Number(sg.top)})}),gg.fire("custom:object:history",{action:"align-ycenter"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}},this.top=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0}=ig;gg.discardActiveObject(),ng.forEach(Ig=>{const sg=Ig.getBoundingRect();Ig.set({top:og-sg.top+Number(Ig.top)})}),gg.fire("custom:object:history",{action:"align-top"});const ag=new Jo(ng,{canvas:gg});gg.setActiveObject(ag),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"top")},this.bottom=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject(),ng=gg.getActiveObjects();if(ig&&ng.length>1){const{top:og=0,height:ag=0}=ig;gg.discardActiveObject(),ng.forEach(sg=>{const Cg=sg.getBoundingRect();sg.set({top:og+ag-(Cg.top+Cg.height)+Number(sg.top)})}),gg.fire("custom:object:history",{action:"align-bottom"});const Ig=new Jo(ng,{canvas:gg});gg.setActiveObject(Ig),gg.requestRenderAll()}else ig&&ng.length===1&&this.alignSingleToWorkspace(ig,"bottom")},this.xequation=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject();function ng(lg){let Ag=1/0,cg=-1/0;for(const rg in lg.aCoords){const ug=rg;lg.aCoords[ug].x<Ag&&(Ag=lg.aCoords[ug].x),lg.aCoords[ug].x>cg&&(cg=lg.aCoords[ug].x)}return cg-Ag}function og(){let lg=0;return ig&&ig.forEachObject(Ag=>{lg+=ng(Ag)}),lg}function ag(){const lg=og();if(ig)return(Number(ig.width)-lg)/(ig._objects.length-1)}function Ig(lg){if(lg===0)return 0;let Ag=0;if(ig)for(let cg=0;cg<lg;cg++)Ag+=ng(ig._objects[cg]);return Ag}if(ig&&ig.type==="activeselection"){const lg=ig;if(lg.getObjects().length<2)return;lg._objects.sort((rg,ug)=>rg.left-ug.left);const Ag=ag(),cg=Number(ig.width)/2;ig.forEachObject((rg,ug)=>{const dg=Ig(ug),bg=Ag*ug+dg-cg;rg.set("left",bg)})}const sg=gg.getActiveObjects();if(sg.length<2)return;gg.discardActiveObject(),sg.forEach(lg=>{let Ag=1/0;for(const cg in lg.aCoords){const rg=cg;lg.aCoords[rg].x<Ag&&(Ag=lg.aCoords[rg].x)}lg.set("left",2*lg.left-Ag)}),gg.fire("custom:object:history",{action:"align-xequation"});const Cg=new Jo(sg,{canvas:gg});gg.setActiveObject(Cg),gg.requestRenderAll()},this.yequation=(...eg)=>{if(!this.canvas)return;const gg=this.canvas,ig=gg.getActiveObject()||{top:0,height:0};function ng(lg){let Ag=1/0,cg=-1/0;for(const rg in lg.aCoords){const ug=rg;lg.aCoords[ug].y<Ag&&(Ag=lg.aCoords[ug].y),lg.aCoords[ug].y>cg&&(cg=lg.aCoords[ug].y)}return cg-Ag}function og(){let lg=0;return ig.forEachObject(Ag=>{lg+=ng(Ag)}),lg}function ag(){const lg=og();return(ig.height-lg)/(ig._objects.length-1)}function Ig(lg){if(lg===0)return 0;let Ag=0;for(let cg=0;cg<lg;cg++)Ag+=ng(ig._objects[cg]);return Ag}if(console.log("activeObject",ig.type),ig&&ig.type==="activeselection"){const lg=ig;if(lg.getObjects().length<2)return;lg._objects.sort((rg,ug)=>rg.top-ug.top);const Ag=ag(),cg=Number(ig.height)/2;ig.forEachObject((rg,ug)=>{const dg=Ig(ug),bg=Ag*ug+dg-cg;rg.set("top",bg)})}const sg=gg.getActiveObjects();if(sg.length<2)return;gg.discardActiveObject(),sg.forEach(lg=>{let Ag=1/0;for(const cg in lg.aCoords){const rg=cg;lg.aCoords[rg].y<Ag&&(Ag=lg.aCoords[rg].y)}lg.set("top",2*lg.top-Ag)}),gg.fire("custom:object:history",{action:"align-yequation"});const Cg=new Jo(sg,{canvas:gg});gg.setActiveObject(Cg),gg.requestRenderAll()}}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.enabled()}enabled(){this.editor&&(this.editor.addHook("left",this.left),this.editor.addHook("right",this.right),this.editor.addHook("top",this.top),this.editor.addHook("bottom",this.bottom),this.editor.addHook("xcenter",this.xcenter),this.editor.addHook("ycenter",this.ycenter),this.editor.addHook("x-equidistant",this.xequation),this.editor.addHook("y-equidistant",this.yequation))}disabled(){}alignSingleToWorkspace(eg,gg){var Cg;if(!this.canvas)return;const ig=this.canvas.getObjects().find(lg=>lg.id==="workspace");if(!ig)return;const ng=eg.getBoundingRect(),og=ig.getBoundingRect(),ag={};let sg=((Cg=this.editor)==null?void 0:Cg.ribbonBorderPattern)&&this.editor.ribbonBorderPattern!=="none"?30:0;gg==="left"?ag.left=Number(eg.left||0)+og.left+sg-ng.left:gg==="right"?ag.left=Number(eg.left||0)+og.left+og.width-sg-ng.left-ng.width:gg==="top"?ag.top=Number(eg.top||0)+og.top-ng.top:gg==="bottom"&&(ag.top=Number(eg.top||0)+og.top+og.height-ng.top-ng.height),eg.set(ag),eg.setCoords(),this.canvas.fire("custom:object:history",{action:`align-${gg}`}),this.canvas.fire("custom:object:checkdirty",{isToDirty:!0}),this.canvas.requestRenderAll()}}class GroupPlugin{constructor(){this.name="GroupPlugin"}group(){if(!this.editor)return;const eg=this.editor.getCanvas();if(!eg.getActiveObject())return;const gg=this.editor.getPlugin("HistoryPlugin");gg&&(gg.pause=!0);const ig=eg.getActiveObject();console.log("group",ig.type),getObjectList(ig,og=>{(og.type==="text"||og.type==="counter")&&(og.inGroupRemove=!0)});let ng;if(ig.type!=="activeSelection"&&ig.type!=="activeselection"){const og=eg.remove(ig);console.log("rmobj",og),ng=new Hr(og)}else{const og=ig.removeAll();eg.remove(...og),ng=new Hr(og)}console.log("group====1111",ng),ng.id=v4(),addObjName(eg,ng),ng.subTargetCheck=!0,gg&&(gg.pause=!1),eg.add(ng),eg.setActiveObject(ng),eg.requestRenderAll(),this.editor.emit("group",{target:ng}),console.log("group",eg.getObjects())}ungroup(){if(!this.editor)return;const eg=this.editor.getCanvas(),gg=eg.getActiveObject();if(!gg||gg.type!=="group")return;const ig=this.editor.getPlugin("HistoryPlugin");ig&&(ig.pause=!0),eg.remove(gg);const ng=gg.removeAll();eg.add(...ng);var og=new Jo(ng,{canvas:eg});ig&&(ig.pause=!1),eg.setActiveObject(og),eg.requestRenderAll(),this.editor.emit("ungroup",{target:og})}install(eg,gg){this.editor=eg,this.enabled()}enabled(){if(this.editor){const gg=this.editor.getPlugin("ContextMenuPlugin");gg&&gg.addItem([{id:"group1",text:"editor.contextMenu.group",isShow:(ig,ng)=>!ig||ig.type!=="group",handler:(ig,ng)=>(this.group(),!0)},{id:"group2",text:"editor.contextMenu.ungroup",isShow:(ig,ng)=>!!(ig&&ig.type==="group"),handler:(ig,ng)=>(this.ungroup(),!0)}])}}disabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&(eg.removeItem("group1"),eg.removeItem("group2"))}}}class HistoryList{constructor(eg){this.canvas=eg,this.history=[],this.historyRedo=[],this.customProp={id:"id",locked:!1,name:"name"},this.isProcess=!1,this.flagClearing=!1,this.undoTimer=void 0,this.extraKeys=Object.keys(this.customProp),this.updateList()}async updateList(){if(this.flagClearing||this.isProcess)return;let eg=null;const gg=this.canvas.getObjects();let ig=[...cloneCommonField,"hasSetHistory"];const ng=gg.filter(ag=>ag.id!=="workspace"&&!ag.parent&&ag.drawObjectType!=="ignoreObject").map(async ag=>{if(ag.group&&ag.group.type==="activeselection"){eg||(eg=cloneDeep(ag.group));const Ig=eg._objects.find(Cg=>Cg.id===ag.id);eg.remove(Ig);let sg=await Ig.clone(ig);return sg.set("flagActive",!0),sg.canvas=void 0,sg.evented=!0,sg}else{const Ig=await ag.clone(ig);return Ig.canvas=void 0,Ig.evented=!0,Ig}}),og=await Promise.all(ng);this.history.push(og),console.log("history======",this.history),this.historyRedo=[]}clearCanvas(){this.flagClearing=!0;const eg=this.canvas.getObjects().filter(gg=>gg.id!=="workspace");this.canvas.remove(...eg),this.flagClearing=!1}async canvasRestore(eg){this.canvas.discardActiveObject();let gg;clearObjectMap();for(const ig of eg){const ng=await ig.clone([...cloneCommonField,"flagActive"]);this.canvas.add(ng),ng.get("flagActive")&&(gg||(gg=[]),gg.push(ng)),updateObjectMap(ng)}gg&&this.canvas.setActiveObject(new Jo(gg)),this.canvas.requestRenderAll()}undo(){if(this.isProcess||this.history.length<=1)return;clearTimeout(this.undoTimer);let eg=this.history.pop();this.historyRedo.push(eg);const gg=this.history[this.history.length-1];console.log("history========",this.history,gg),this.isProcess=!0,this.clearCanvas(),this.canvasRestore(gg).then(()=>{this.isProcess=!1})}redo(){if(this.isProcess||this.historyRedo.length===0)return;const eg=this.historyRedo.pop();this.history.push(eg),this.isProcess=!0,this.clearCanvas(),this.canvasRestore(eg).then(()=>{this.isProcess=!1})}}class HistoryPlugin{constructor(){this.name="HistoryPlugin",this.historyScopeId="default",this.historyScopeMap=new Map,this.pause=!1,this.isMouseDown=!1,this.isObjectModify=!1,this.objectAddedTimer=null,this.hotKeyHandle=eg=>{this.pause||(eg.hke.key==="ctrl+z"||eg.hke.key==="⌘+z"?this.toUndo():(eg.hke.key==="ctrl+shift+z"||eg.hke.key==="⌘+shift+z")&&this.toRedo())},this.objectAdded=({target:eg})=>{var gg;clearTimeout(this.objectAddedTimer),!(this.pause||this.isMouseDown||(gg=this.historyList)!=null&&gg.isProcess)&&(eg.drawObjectType&&eg.drawObjectType==="ignoreObject"||(this.objectAddedTimer=setTimeout(()=>{var ig;this.pause||(ig=this.historyList)!=null&&ig.isProcess||this.historyList&&this.historyList.updateList()},10)))},this.objectRemoved=({target:eg})=>{var gg;this.pause||(gg=this.historyList)!=null&&gg.isProcess||eg.drawObjectType&&eg.drawObjectType==="ignoreObject"||(this.historyList&&this.historyList.updateList(),this.canvas&&this.canvas.discardActiveObject())},this.objectModified=({})=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.objectSkewing=()=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.historyUpdate=eg=>{if(!this.pause){if(this.isMouseDown){this.isObjectModify=!0;return}this.historyList&&this.historyList.updateList()}},this.mouseDown=()=>{this.isMouseDown=!0},this.mouseUp=eg=>{var gg;this.isObjectModify?(this.isObjectModify=!1,this.isMouseDown=!1,(gg=this.canvas)==null||gg.fire("custom:object:history",{action:"mouse:up:clear"})):this.isMouseDown=!1}}toUndo(){var eg;(eg=this.historyList)==null||eg.undo()}toRedo(){var eg;(eg=this.historyList)==null||eg.redo()}switchScope(eg="default"){if(!this.canvas)return;clearTimeout(this.objectAddedTimer),this.historyScopeId=eg||"default";let gg=this.historyScopeMap.get(this.historyScopeId);gg||(gg=new HistoryList(this.canvas),this.historyScopeMap.set(this.historyScopeId,gg)),this.historyList=gg,this.isMouseDown=!1,this.isObjectModify=!1}clearScope(eg){if(!eg){if(this.historyScopeMap.clear(),this.canvas){const gg=new HistoryList(this.canvas);this.historyScopeMap.set(this.historyScopeId,gg),this.historyList=gg}return}this.historyScopeMap.delete(eg),this.historyScopeId===eg&&this.switchScope("default")}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.historyScopeId=(gg==null?void 0:gg.scopeId)||"default",this.historyList=new HistoryList(this.canvas),this.historyScopeMap.set(this.historyScopeId,this.historyList),this.enabled()}enabled(){this.editor&&(this.editor.addHotKey("ctrl+z",this.hotKeyHandle),this.editor.addHotKey("⌘+z",this.hotKeyHandle),this.editor.addHotKey("ctrl+shift+z",this.hotKeyHandle),this.editor.addHotKey("⌘+shift+z",this.hotKeyHandle)),this.canvas&&(this.canvas.on("mouse:down",this.mouseDown),this.canvas.on("mouse:up",this.mouseUp),this.canvas.on("object:added",this.objectAdded),this.canvas.on("object:removed",this.objectRemoved),this.canvas.on("object:modified",this.objectModified),this.canvas.on("object:skewing",this.objectSkewing),this.canvas.on("custom:object:history",this.historyUpdate))}disabled(){this.editor&&(this.editor.removeHotKey("ctrl+z"),this.editor.removeHotKey("⌘+z"),this.editor.removeHotKey("ctrl+shift+z"),this.editor.removeHotKey("⌘+shift+z")),this.canvas&&(this.canvas.off("mouse:down",this.mouseDown),this.canvas.off("mouse:up",this.mouseUp),this.canvas.off("object:added",this.objectAdded),this.canvas.off("object:removed",this.objectRemoved),this.canvas.off("object:modified",this.objectModified),this.canvas.off("object:skewing",this.objectSkewing),this.canvas.off("custom:object:history",this.historyUpdate))}uninstall(){this.disabled(),clearTimeout(this.objectAddedTimer),this.objectAddedTimer=null,this.historyScopeMap.clear(),this.historyList=void 0,this.editor=void 0,this.canvas=void 0,this.pause=!1,this.isMouseDown=!1,this.isObjectModify=!1}}class MoveHotKeyPlugin{constructor(){this.name="MoveHotKeyPlugin",this.keys={},this.holder=new Map}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.holder.set("keydown",this.keyDown.bind(this)),this.holder.set("keyup",this.keyUp.bind(this)),this.enabled()}move(){const eg=this.canvas.getActiveObject();if(eg!=null&&eg.locked)return;let gg=!0;if(eg&&eg.top!==void 0&&(this.keys.ArrowUp&&(eg.set("top",eg.top-1),gg=!1),this.keys.ArrowDown&&(eg.set("top",eg.top+1),gg=!1),this.keys.ArrowLeft&&(eg.set("left",eg.left-1),gg=!1),this.keys.ArrowRight&&(eg.set("left",eg.left+1),gg=!1),!gg&&(eg.setCoords(),this.canvas))){this.canvas.renderAll(),this.canvas.fire("custom:object:changed",{target:eg});return}this.intervalHolder,clearInterval(this.intervalHolder),this.intervalHolder=void 0,console.log("clearInterval")}keyDown(eg){if(this.keys[eg.code]=!0,["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(eg.code))eg.preventDefault();else return;this.move(),this.intervalHolder===void 0&&(this.intervalHolder=setInterval(this.move.bind(this),96))}keyUp(eg){this.keys[eg.code]=!1}enabled(){var eg;if((eg=this.canvas)!=null&&eg.elements.container){const gg=this.canvas.elements.container;gg.tabIndex=-1,this.holder.forEach((ig,ng)=>{gg.addEventListener(ng,ig)})}}disabled(){var eg;if((eg=this.canvas)!=null&&eg.elements.container){const gg=this.canvas.elements.container;this.holder.forEach((ig,ng)=>{gg.removeEventListener(ng,ig)})}}}class DeletePlugin{constructor(){this.name="DeletePlugin"}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.enabled()}flat(eg,gg){if(gg.push(eg),eg instanceof Hr){const ig=eg.getObjects();if(ig.length>0)for(const ng of ig)ng.locked||(gg.push(ng),ng instanceof Hr&&this.flat(ng,gg))}}enabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&eg.addItem({id:"delete",text:"editor.contextMenu.delete",hotKey:"delete,backspace",hotKeyHandler:gg=>this.toDelete(),handler:(gg,ig)=>this.toDelete()})}}toDelete(){var og;const gg=this.editor.getPlugin("HistoryPlugin");gg&&(gg.pause=!0);let ig=this.canvas.getActiveObjects();const ng=[];for(const ag of ig)this.flat(ag,ng);return ng.length>0&&(this.canvas.remove(...ng),this.canvas.requestRenderAll(),ig=ig.filter(ag=>{ng.includes(ag)}),ig.length>0?this.canvas.setActiveObject(new Jo(ig)):this.canvas.discardActiveObject()),gg&&(gg.pause=!1),(og=this.canvas)==null||og.fire("custom:object:history",{target:null,action:"delete"}),!0}disabled(){if(this.editor){const eg=this.editor.getPlugin("ContextMenuPlugin");eg&&eg.removeItem("delete")}}}let isDrawing=!1;class AddObjectPlugin{constructor(){this.name="AddObjectPlugin",this.startPoint={},this.isMoverUp=!1,this.mouseDown=eg=>{if(!this.canvas)return;this.isMoverUp=!1;const gg=this.canvas,ig=eg.scenePoint;this.startPoint=ig,this.canvas.off("mouse:move",this.mouseMove),this.canvas.off("mouse:up",this.mouseUp),gg.on("mouse:move",this.mouseMove),gg.on("mouse:up",this.mouseUp)},this.mouseMove=eg=>{if(!this.canvas||this.isMoverUp)return;const gg=this.canvas,ig=eg.scenePoint;this.object||(this.object=new ALine([this.startPoint.x,this.startPoint.y,ig.x,ig.y],{...this.objectProps,id:v4(),evented:!1,strokeUniform:!0,hasControls:!1}),addObjName(this.canvas,this.object),this.object.strokeWidth=3,gg.add(this.object)),this.object.set({x2:ig.x,y2:ig.y}),this.object.setCoords(),gg.renderAll()},this.mouseUp=eg=>{var gg;!this.canvas||!this.object||(this.isMoverUp=!0,console.log("end",this.object),this.canvas.fire("object:modified",{target:this.object}),(gg=this.canvas)==null||gg.setActiveObject(this.object),this.object=void 0,this.canvas.off("mouse:move",this.mouseMove),this.canvas.off("mouse:up",this.mouseUp),this.end())},this.start=eg=>{if(!this.canvas||isDrawing)return;isDrawing=!0,this.objectProps=eg;const gg=this.canvas;gg.defaultCursor="crosshair",gg.selection=!1,gg.forEachObject(ig=>{ig.set({evented:!1})}),this.canvas.on("mouse:down",this.mouseDown)},this.end=()=>{if(!this.canvas)return;const eg=this.canvas;eg.defaultCursor="default",eg.selection=!0,eg.forEachObject(gg=>{gg.set({evented:!0})}),eg.off("mouse:down",this.mouseDown),isDrawing=!1}}install(eg,gg){this.editor=eg,this.canvas=this.editor.getCanvas(),this.enabled()}enabled(){var eg,gg;this.canvas&&((eg=this.editor)==null||eg.addHook("addLine",this.start),(gg=this.editor)==null||gg.addHook("cancelAdd",this.end))}disabled(){this.canvas&&this.canvas.off("mouse:down",this.mouseDown)}}let _clipboard=null,isInCut=!1;const getClipboard=()=>{if(!(typeof navigator>"u"))return navigator.clipboard},writeClipboardText=async tg=>{const eg=getClipboard();if(!(eg!=null&&eg.writeText))return!1;try{return await eg.writeText(tg),!0}catch{return!1}},readClipboardText=async()=>{const tg=getClipboard();if(!(tg!=null&&tg.readText))return"";try{return await tg.readText()}catch{return""}};class CopyPaste{constructor(eg){this.canvas=eg,this.copyId="",this.pasteId="",this.cloneField=[...cloneCommonField,"hasSetHistory"]}getObjData(eg="copy"){return new Promise(async(gg,ig)=>{let ng=this.canvas.getActiveObject();if(ng){let og=null;if(await writeClipboardText(JSON.stringify({type:"fabric",data:""})),eg==="copy"){let ag=this.cloneField.filter(Ig=>Ig!=="locked");og=await ng.clone(ag)}else ng instanceof Jo?(og=this.canvas.remove(...ng._objects),og=new Jo(og)):og=this.canvas.remove(ng)[0],this.canvas.discardActiveObject(),this.canvas.requestRenderAll();_clipboard=og,gg(og)}else gg(null)})}async copy(){this.getObjData()}handleObject(eg,gg=!1){var ig;if(!gg){if(eg.counterProps&&typeof eg.counterProps=="object"&&(eg.counterProps={...eg.counterProps}),eg._props&&typeof eg._props=="object"&&(eg._props=JSON.parse(JSON.stringify(eg._props))),eg.databaseMixConcat&&typeof eg.databaseMixConcat=="object"&&(eg.databaseMixConcat=JSON.parse(JSON.stringify(eg.databaseMixConcat))),eg.connectObjIds&&typeof eg.connectObjIds=="object"&&(eg.connectObjIds=JSON.parse(JSON.stringify(eg.connectObjIds))),(eg.type==="text"||eg.type==="counter")&&delete eg.connectBar2dMap,eg.type==="barcode2d"||eg.type==="barcode")delete eg.concatTextIdListObj;else if(eg.type==="text"&&eg.fromBarCode2dID){const og=ag=>{if(ag.type==="group"&&ag._objects)return ag._objects.some(Ig=>og(Ig));if((ag.type==="barcode2d"||ag.type==="barcode")&&ag.id===eg.fromBarCode2dID){let Ig=ag.concatTextIdListObj;return Ig&&(Ig[eg.id]=!0,ag.set("concatTextIdListObj",Ig)),!0}};(ig=this.canvas)==null||ig.getObjects().some(ag=>og(ag))}}}async paste(){if(!_clipboard)return"no-data";let eg=this.cloneField;this.copyId!==this.pasteId&&(eg=eg.filter(og=>!["databaseSheet","databaseColumn","databaseTid","outsideInput","increaseCount","fromBarCode2d","fromBarCode2dID","increaseDate","barcodeDateFormatType"].includes(og)));let ig=await _clipboard.clone(eg);if(!ig)return"no-data";let ng=isInCut;if(isInCut?isInCut=!1:(ig.set({left:ig.left+10,top:ig.top+10,evented:!0}),_clipboard&&(_clipboard.left+=10,_clipboard.top+=10)),ig.type==="activeselection")ig.canvas=this.canvas,deepTraverse(ig.getObjects(),(og,ag)=>{addObjName(this.canvas,og),ag&&(ng||(og.id=v4()),this.handleObject(og,ng),this.canvas.add(og))});else if(ig.type==="group"){ig.canvas=this.canvas;const og=new Hr;og.id=v4(),addObjName(this.canvas,og),deepTraverse(ig.getObjects(),(ag,Ig)=>{addObjName(this.canvas,ag),Ig&&(ng||(ag.id=v4()),this.handleObject(ag,ng),og.add(ag))}),this.canvas.add(og),ig=og}else ng||(ig.id=v4()),this.handleObject(ig,ng),addObjName(this.canvas,ig),this.canvas.add(ig);this.canvas.setActiveObject(ig),this.canvas.requestRenderAll()}async cut(){if(isInCut=!0,!await this.getObjData("cut"))return"no-data"}}class CopyPlugin{constructor(){this.name="CopyPlugin",this.pause=!1,this.pasteHandleFn=function(){},this.shouldHandleClipboardEvent=eg=>{var ng;const gg=eg.target;if(gg instanceof Element&&gg.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]'))return!1;const ig=(ng=this.canvas)==null?void 0:ng.getActiveObject();return!!(ig&&!ig.isEditing)},this.setFabricClipboardData=eg=>{eg.clipboardData&&(eg.clipboardData.setData("text/plain",JSON.stringify({type:"fabric",data:""})),eg.preventDefault())},this.copyHandle=eg=>{this.pause||!this.shouldHandleClipboardEvent(eg)||(this.setFabricClipboardData(eg),this.toCopy())},this.cutHandle=eg=>{this.pause||!this.shouldHandleClipboardEvent(eg)||(this.setFabricClipboardData(eg),this.toCut())},this.pasteHandle=eg=>{var Ig;const gg=(Ig=this.canvas)==null?void 0:Ig.getActiveObject(),ig=eg.target,ng=ig instanceof Element&&!!ig.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]');if(gg&&gg.isEditing||ng)return;let og=eg.clipboardData,ag=(og==null?void 0:og.items)||[];for(let sg of ag){if(sg.type.startsWith("image")){console.log("粘贴图片");let Cg=sg.getAsFile();canvasEventBus.emit("copyAddImageObj",Cg),console.log("file=====",Cg)}sg.type==="text/plain"&&sg.kind==="string"&&sg.getAsString(Cg=>{console.log("粘贴文本=====",Cg);let lg=Cg;try{lg=JSON.parse(Cg)}catch{lg=Cg}typeof lg=="string"?canvasEventBus.emit("copyAddTextObj",lg):lg.type&&lg.type==="fabric"&&this.toPaste(lg)})}},this.pasteHandleFn=throttle$1(this.pasteHandle,80)}toCopy(){var gg;const eg=this.editor;this.CopyPaste.copyId=eg.id||"",(gg=this.CopyPaste)==null||gg.copy()}async toPaste(eg=null){var og;const gg=this.editor;this.CopyPaste.pasteId=gg.id||"";const ig=gg.getPlugin("HistoryPlugin");ig&&(ig.pause=!0);let ng={};if(window.isInElectron)try{ng=await window.dsapi.systemApi.readClipboard(),ng=JSON.parse(ng)}catch{}else eg?ng.text=eg:(ng.text=await readClipboardText(),!ng.text&&_clipboard&&(ng.text=JSON.stringify({type:"fabric",data:""})));if(ng.text){let ag=ng.text;try{ag=JSON.parse(ng.text)}catch{ag=ng.text}typeof ag=="string"?(ig&&(ig.pause=!1),canvasEventBus.emit("copyAddTextObj",ag)):ag.type&&ag.type==="fabric"&&((og=this.CopyPaste)==null||og.paste().then(Ig=>{var sg;ig&&(ig.pause=!1),Ig!=="no-data"&&((sg=this.canvas)==null||sg.fire("custom:object:history",{action:"paste"}))}))}else ng.imageData&&ng.imageData.length?ng.imageData.forEach(ag=>{canvasEventBus.emit("copyAddImageObj",ag)}):ig&&(ig.pause=!1)}toCut(){var ig;const eg=this.editor;this.CopyPaste.copyId=eg.id||"";const gg=eg.getPlugin("HistoryPlugin");gg&&(gg.pause=!0),(ig=this.CopyPaste)==null||ig.cut().then(ng=>{var og;gg&&(gg.pause=!1),ng!=="no-data"&&((og=this.canvas)==null||og.fire("custom:object:history",{target:null,action:"cut"}))})}install(eg,gg){this.editor=eg,this.canvas=eg.getCanvas(),this.CopyPaste=new CopyPaste(this.canvas),this.enabled()}enabled(){this.editor&&(document.removeEventListener("copy",this.copyHandle),document.addEventListener("copy",this.copyHandle),document.removeEventListener("cut",this.cutHandle),document.addEventListener("cut",this.cutHandle),document.removeEventListener("paste",this.pasteHandleFn),document.addEventListener("paste",this.pasteHandleFn))}disabled(){this.editor&&(document.removeEventListener("copy",this.copyHandle),document.removeEventListener("cut",this.cutHandle),document.removeEventListener("paste",this.pasteHandleFn))}}class SelectPlugin{constructor(){this.name="SelectPlugin",this.selectAll=()=>{if(this.canvas){const eg=this.canvas.getObjects().filter(ig=>ig.id!=="workspace"),gg=new Jo(eg);this.canvas.setActiveObject(gg),this.canvas.requestRenderAll()}}}install(eg,gg){this.canvas=eg.getCanvas(),this.enabled()}uninstall(){this.disabled()}enabled(){hotkeys("ctrl+a",this.selectAll)}disabled(){hotkeys.unbind("ctrl+a",this.selectAll)}}class LineContorlPlugin{constructor(){this.name="LineContorlPlugin",this._lastLeft=0,this._lastTop=0,this.moveTimer=null}install(eg,gg){this.canvas=eg.getCanvas(),this.enabled()}uninstall(){this.disabled()}_createHandle(eg,gg){return new ho({drawObjectType:"ignoreObject",idType:"lineHandle",excludeFromExport:!0,left:eg,top:gg,radius:6,fill:"#fff",stroke:"#1976d2",strokeWidth:2,originX:"center",originY:"center",hasControls:!1,hasBorders:!1,selectable:!0,hoverCursor:"pointer",objectCaching:!1})}_bindEvents(){this.canvas&&(canvasEventBus.off("positionChange"),canvasEventBus.on("positionChange",eg=>{eg.type==="line"&&setTimeout(()=>{this._onSelection({selected:[eg]})},0)}),this.canvas.on("selection:created",eg=>this._onSelection(eg)),this.canvas.on("selection:updated",eg=>this._onSelection(eg)),this.canvas.on("custom:object:basechanged",eg=>{let gg=eg.type,ig=eg.activeObj,ng=eg.val,og=eg.oldVal,ag=ng-og;gg==="x"?(ig.x1=ig.x1+ag,ig.x2=ig.x2+ag):gg==="y"?(ig.y1=ig.y1+ag,ig.y2=ig.y2+ag):gg==="w"?ig.x2>ig.x1?ig.x2=ig.x2+ag:ig.x1=ig.x1+ag:gg==="h"&&(ig.y2>ig.y1?ig.y2=ig.y2+ag:ig.y1=ig.y1+ag),this._onSelection({selected:[ig]})}),this.canvas.on("selection:cleared",()=>this._hideHandles()))}_updateLineFromHandles(){var eg;this.lineObject&&this.handle1&&this.handle2&&(this.lineObject.set({x1:this.handle1.left,y1:this.handle1.top,x2:this.handle2.left,y2:this.handle2.top}),this.lineObject.setCoords(),(eg=this.canvas)==null||eg.requestRenderAll())}_updateHandlesFromLine(){var ig,ng,og;if(!this.lineObject||!this.handle1||!this.handle2)return;const eg=this.lineObject.left-(this._lastLeft??this.lineObject.left),gg=this.lineObject.top-(this._lastTop??this.lineObject.top);(eg!==0||gg!==0)&&((ig=this.handle1)==null||ig.set({left:this.handle1.left+eg,top:this.handle1.top+gg}),(ng=this.handle2)==null||ng.set({left:this.handle2.left+eg,top:this.handle2.top+gg}),this.lineObject.set({x1:this.handle1.left,y1:this.handle1.top,x2:this.handle2.left,y2:this.handle2.top}),this.handle1.setCoords(),this.handle2.setCoords(),this.lineObject.setCoords()),this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,(og=this.canvas)==null||og.requestRenderAll()}_onSelection(eg){var ig,ng,og,ag,Ig,sg,Cg,lg;let gg=(eg==null?void 0:eg.selected[0])||{};if(eg.selected.length===1&&gg.type==="line"){if(this.lineObject=eg.selected[0],!this.lineObject||(this.handle1&&this.handle2&&((ig=this.canvas)==null||ig.remove(this.handle1,this.handle2)),this.lineObject.group))return;this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top;let Ag=0,cg=0,rg=0,ug=0;this.lineObject.x1<=this.lineObject.x2?(this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,Ag=this._lastLeft,cg=this._lastLeft+this.lineObject.width):this.lineObject.x1>this.lineObject.x2&&(this._lastLeft=this.lineObject.left+this.lineObject.width,this._lastTop=this.lineObject.top,Ag=this._lastLeft,cg=this._lastLeft-this.lineObject.width),this.lineObject.y1>=this.lineObject.y2?(this._lastLeft=this.lineObject.left,this._lastTop=this.lineObject.top,rg=this._lastTop+this.lineObject.height,ug=this._lastTop):this.lineObject.y1<this.lineObject.y2&&(rg=this._lastTop,ug=this._lastTop+this.lineObject.height),this.handle1=this._createHandle(Ag,rg),this.handle2=this._createHandle(cg,ug),(ng=this.handle1)==null||ng.on("moving",()=>this._updateLineFromHandles()),(og=this.handle2)==null||og.on("moving",()=>this._updateLineFromHandles()),(ag=this.handle2)==null||ag.on("mouseup",()=>{var dg;(dg=this.canvas)==null||dg.discardActiveObject(),setTimeout(()=>{var bg,mg;this.lineObject&&((bg=this.canvas)==null||bg.setActiveObject(this.lineObject)),(mg=this.canvas)==null||mg.requestRenderAll()},220)}),(Ig=this.handle1)==null||Ig.on("mouseup",()=>{var dg;(dg=this.canvas)==null||dg.discardActiveObject(),setTimeout(()=>{var bg;this.lineObject&&((bg=this.canvas)==null||bg.setActiveObject(this.lineObject))},220)}),(sg=this.lineObject)==null||sg.on("moving",()=>this._updateHandlesFromLine()),(Cg=this.canvas)==null||Cg.add(this.handle1,this.handle2),(lg=this.canvas)==null||lg.requestRenderAll()}else gg&&gg.drawObjectType!=="ignoreObject"&&this._hideHandles()}_showHandles(){}_hideHandles(){var eg,gg;this.handle1&&this.handle2&&((eg=this.canvas)==null||eg.remove(this.handle1,this.handle2),(gg=this.canvas)==null||gg.requestRenderAll())}enabled(){this._bindEvents()}disabled(){canvasEventBus.off("positionChange")}}function applyJsonFieldDiff(tg,eg,gg){const ig={renamedCount:0,unlinkedCount:0,valueUpdatedCount:0,unlinkedIds:[]};if(!(eg!=null&&eg.length))return ig;const ng=collectObjects(eg).filter(Ig=>Ig.fromJson);for(const{from:Ig,to:sg}of tg.renamed)for(const Cg of ng)Cg.jsonFieldKey===Ig&&(Cg.jsonFieldKey=sg,Cg.dirty=!0,ig.renamedCount++);if(gg!=null&&gg.jsonData)return reconcileWithJsonData(ng,gg.jsonData,ig),ig;const og=new Set(tg.renamed.map(({to:Ig})=>Ig));for(const{key:Ig,newValue:sg}of tg.valueChanged){if(og.has(Ig)){for(const Cg of ng)Cg.jsonFieldKey===Ig&&(setElementContent(Cg,sg),Cg.dirty=!0,ig.valueUpdatedCount++);continue}for(const Cg of ng)Cg.jsonFieldKey===Ig&&(setElementContent(Cg,sg),Cg.dirty=!0,ig.valueUpdatedCount++)}const ag=new Set(tg.removed);for(const Ig of ng)Ig.jsonFieldKey&&ag.has(Ig.jsonFieldKey)&&unlinkObject(Ig,ig);return ig}function collectObjects(tg){const eg=[],gg=new Set,ig=ng=>{var ag;if(!ng||gg.has(ng))return;gg.add(ng),eg.push(ng),(((ag=ng.getObjects)==null?void 0:ag.call(ng))??ng._objects??ng.objects??[]).forEach(ig)};return tg.forEach(ig),eg}function reconcileWithJsonData(tg,eg,gg){for(const ig of tg){const ng=ig.jsonFieldKey;if(!ng||!Object.prototype.hasOwnProperty.call(eg,ng)){unlinkObject(ig,gg);continue}setElementContent(ig,toElementValue(eg[ng])),ig.dirty=!0,gg.valueUpdatedCount++}}function unlinkObject(tg,eg){tg.jsonFieldKey="",tg.fromJson=!1,tg.type==="text"&&(tg.set?tg.set("editable",!0):tg.editable=!0),tg.dirty=!0,tg.id&&eg.unlinkedIds.push(tg.id),eg.unlinkedCount++}function toElementValue(tg){return typeof tg=="object"&&tg!==null?JSON.stringify(tg):String(tg??"")}function setElementContent(tg,eg){var gg;if(tg.type==="barcode"){tg.setBarcodeOption?tg.setBarcodeOption({text:eg}):tg.barcodeOptions&&(tg.barcodeOptions.text=eg);return}if(tg.type==="barcode2d"){tg.setBarcode2DOption?tg.setBarcode2DOption({text:eg}):tg.barcode2dOptions&&(tg.barcode2dOptions.text=eg);return}tg.set?tg.set("text",eg):tg.text=eg,(gg=tg.updateInGroup)==null||gg.call(tg)}ji.customProperties=["customExportFields"];const _hoisted_1$13={class:"nest-menu"},_sfc_main$15=defineComponent({__name:"nest-menu",props:{items:{type:Array,required:!0}},setup(tg){const eg=useSlots(),gg=(ig,ng="")=>ig.map((og,ag)=>{if(og.children&&og.children.length){let Ig=(ng?ng+"-":"")+(ag+1);return h$2(Menu.SubMenu,{key:Ig,title:og.label,popupClassName:"le-target-menu"},{default:()=>gg(og.children,Ig)})}else return h$2(Menu.Item,{key:(ng?ng+"-":"")+(ag+1)},{default:()=>eg.item({data:og})})});return(ig,ng)=>(openBlock(),createElementBlock("div",_hoisted_1$13,[createVNode(unref(Menu),mergeProps({mode:"horizontal"},ig.$attrs),{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(gg(tg.items),og=>(openBlock(),createBlock(resolveDynamicComponent(og),{key:og.key}))),128))]),_:1},16)]))}}),_export_sfc=(tg,eg)=>{const gg=tg.__vccOpts||tg;for(const[ig,ng]of eg)gg[ig]=ng;return gg},nestedMenu=_export_sfc(_sfc_main$15,[["__scopeId","data-v-ebd540f8"]]),emitter=mitt(),IconClose$1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='21'%20height='20.5078125'%20viewBox='0%200%2021%2020.5078125'%3e%3cg%3e%3cg%3e%3cellipse%20cx='10.5'%20cy='10.25390625'%20rx='10.5'%20ry='10.25390625'%20fill='%23EAEAEA'%20fill-opacity='1'%20/%3e%3c/g%3e%3cg%20transform='matrix(0,1,-1,0,21.315007209777832,-11.299349784851074)'%3e%3cpath%20d='M26.872478497314454,5.368129712463379L26.872478497314454,5.368129712463379Q26.914278497314456,5.410926712463379,26.951778497314454,5.457711712463379Q26.98927849731445,5.504496712463379,27.022078497314453,5.554820712463379Q27.054878497314455,5.605143712463379,27.082778497314454,5.658520712463379Q27.110678497314453,5.7118977124633785,27.133278497314453,5.767813712463379Q27.155878497314454,5.823730712463379,27.173078497314453,5.881647712463379Q27.190178497314452,5.939565712463379,27.201778497314454,5.998925712463379Q27.213278497314455,6.058288712463379,27.219078497314452,6.118518712463379Q27.224878497314453,6.178748712463379,27.224878497314453,6.239278712463379Q27.224878497314453,6.299798712463379,27.219078497314452,6.360028712463379Q27.213278497314455,6.420258712463379,27.201778497314454,6.479618712463379Q27.190178497314452,6.538978712463379,27.173078497314453,6.5968987124633784Q27.155878497314454,6.654818712463379,27.133278497314453,6.7107287124633785Q27.110678497314453,6.766648712463379,27.082778497314454,6.820028712463379Q27.054878497314455,6.8734087124633785,27.022078497314453,6.923728712463379Q26.98927849731445,6.974048712463379,26.951778497314454,7.020838712463378Q26.914278497314456,7.0676187124633785,26.872478497314454,7.110418712463379L18.361158497314452,15.826028712463378Q18.319358497314454,15.86882871246338,18.273668497314453,15.907228712463379Q18.227988497314453,15.945628712463378,18.17883849731445,15.979228712463378Q18.129698497314454,16.01282871246338,18.077568497314452,16.04132871246338Q18.025448497314454,16.06992871246338,17.970838497314453,16.09302871246338Q17.916228497314453,16.11622871246338,17.859668497314452,16.133828712463377Q17.803108497314454,16.15132871246338,17.745148497314453,16.16312871246338Q17.687178497314452,16.174928712463377,17.62835849731445,16.180928712463377Q17.569538497314454,16.18682871246338,17.510428497314454,16.18682871246338Q17.451328497314453,16.18682871246338,17.392508497314452,16.180928712463377Q17.333688497314455,16.174928712463377,17.275714497314453,16.16312871246338Q17.217745497314453,16.15132871246338,17.161185497314452,16.133828712463377Q17.10462549731445,16.11622871246338,17.05001949731445,16.09302871246338Q16.995413497314452,16.06992871246338,16.943287497314454,16.04132871246338Q16.891162497314454,16.01282871246338,16.842018497314452,15.979228712463378Q16.792874497314454,15.945628712463378,16.747185497314454,15.907228712463379Q16.70149649731445,15.86882871246338,16.659703497314453,15.826028712463378L16.659703497314453,15.826028712463378Q16.617909497314454,15.783228712463378,16.580413497314453,15.736428712463379Q16.542918497314453,15.68962871246338,16.510081497314452,15.63932871246338Q16.47724449731445,15.58902871246338,16.449382497314453,15.535628712463378Q16.421520497314454,15.482228712463378,16.398901797314455,15.426328712463379Q16.376283297314455,15.37042871246338,16.359125997314454,15.31252871246338Q16.341968697314453,15.25452871246338,16.330437797314453,15.19522871246338Q16.318906997314453,15.135828712463379,16.313113657314453,15.075628712463379Q16.307320322314453,15.015428712463379,16.307320289314454,14.954858712463379Q16.307320256314455,14.894338712463378,16.313113517314452,14.834098712463378Q16.318906797314455,14.77386871246338,16.330437597314454,14.71450871246338Q16.34196829731445,14.65514871246338,16.359125597314453,14.597228712463378Q16.376282797314452,14.539308712463379,16.398901297314453,14.483398712463378Q16.421519497314453,14.42747871246338,16.44938149731445,14.374098712463379Q16.477243497314454,14.32072871246338,16.510080497314455,14.270398712463379Q16.542917497314452,14.220078712463378,16.580413497314453,14.173298712463378Q16.617908497314453,14.126508712463378,16.659702497314452,14.083708712463379L25.171018497314453,5.368129712463379Q25.212808497314455,5.325333712463379,25.258498497314456,5.286937712463379Q25.304188497314453,5.248541712463379,25.353328497314454,5.214916712463379Q25.40246849731445,5.181291712463379,25.454598497314453,5.152761712463379Q25.506728497314455,5.124230712463379,25.561328497314452,5.101069512463379Q25.615938497314453,5.077908212463379,25.672498497314454,5.060339212463379Q25.729058497314455,5.042770112463379,25.787028497314452,5.030962612463379Q25.844998497314453,5.019155012463379,25.903818497314454,5.013222702463379Q25.96263849731445,5.007290366463379,26.021738497314452,5.007290366463379Q26.080848497314452,5.007290366463379,26.139668497314453,5.013222702463379Q26.198488497314454,5.019155012463379,26.256458497314455,5.030962612463379Q26.31437849731445,5.042770112463379,26.370978497314454,5.060339212463379Q26.427578497314453,5.077908212463379,26.482178497314454,5.101069512463379Q26.53677849731445,5.124230712463379,26.588878497314454,5.152761712463379Q26.640978497314453,5.181291712463379,26.690178497314452,5.214916712463379Q26.73927849731445,5.248541712463379,26.784978497314455,5.286937712463379Q26.83067849731445,5.325333712463379,26.872478497314454,5.368129712463379Z'%20fill='%238C8C8C'%20fill-opacity='1'%20/%3e%3c/g%3e%3cg%20transform='rotate(90%2010.5%2010.5)%20matrix(0,1,-1,0,21.315007209777832,-11.299349784851074)'%3e%3cpath%20d='M26.872478497314454,5.368129712463379L26.872478497314454,5.368129712463379Q26.914278497314456,5.410926712463379,26.951778497314454,5.457711712463379Q26.98927849731445,5.504496712463379,27.022078497314453,5.554820712463379Q27.054878497314455,5.605143712463379,27.082778497314454,5.658520712463379Q27.110678497314453,5.7118977124633785,27.133278497314453,5.767813712463379Q27.155878497314454,5.823730712463379,27.173078497314453,5.881647712463379Q27.190178497314452,5.939565712463379,27.201778497314454,5.998925712463379Q27.213278497314455,6.058288712463379,27.219078497314452,6.118518712463379Q27.224878497314453,6.178748712463379,27.224878497314453,6.239278712463379Q27.224878497314453,6.299798712463379,27.219078497314452,6.360028712463379Q27.213278497314455,6.420258712463379,27.201778497314454,6.479618712463379Q27.190178497314452,6.538978712463379,27.173078497314453,6.5968987124633784Q27.155878497314454,6.654818712463379,27.133278497314453,6.7107287124633785Q27.110678497314453,6.766648712463379,27.082778497314454,6.820028712463379Q27.054878497314455,6.8734087124633785,27.022078497314453,6.923728712463379Q26.98927849731445,6.974048712463379,26.951778497314454,7.020838712463378Q26.914278497314456,7.0676187124633785,26.872478497314454,7.110418712463379L18.361158497314452,15.826028712463378Q18.319358497314454,15.86882871246338,18.273668497314453,15.907228712463379Q18.227988497314453,15.945628712463378,18.17883849731445,15.979228712463378Q18.129698497314454,16.01282871246338,18.077568497314452,16.04132871246338Q18.025448497314454,16.06992871246338,17.970838497314453,16.09302871246338Q17.916228497314453,16.11622871246338,17.859668497314452,16.133828712463377Q17.803108497314454,16.15132871246338,17.745148497314453,16.16312871246338Q17.687178497314452,16.174928712463377,17.62835849731445,16.180928712463377Q17.569538497314454,16.18682871246338,17.510428497314454,16.18682871246338Q17.451328497314453,16.18682871246338,17.392508497314452,16.180928712463377Q17.333688497314455,16.174928712463377,17.275714497314453,16.16312871246338Q17.217745497314453,16.15132871246338,17.161185497314452,16.133828712463377Q17.10462549731445,16.11622871246338,17.05001949731445,16.09302871246338Q16.995413497314452,16.06992871246338,16.943287497314454,16.04132871246338Q16.891162497314454,16.01282871246338,16.842018497314452,15.979228712463378Q16.792874497314454,15.945628712463378,16.747185497314454,15.907228712463379Q16.70149649731445,15.86882871246338,16.659703497314453,15.826028712463378L16.659703497314453,15.826028712463378Q16.617909497314454,15.783228712463378,16.580413497314453,15.736428712463379Q16.542918497314453,15.68962871246338,16.510081497314452,15.63932871246338Q16.47724449731445,15.58902871246338,16.449382497314453,15.535628712463378Q16.421520497314454,15.482228712463378,16.398901797314455,15.426328712463379Q16.376283297314455,15.37042871246338,16.359125997314454,15.31252871246338Q16.341968697314453,15.25452871246338,16.330437797314453,15.19522871246338Q16.318906997314453,15.135828712463379,16.313113657314453,15.075628712463379Q16.307320322314453,15.015428712463379,16.307320289314454,14.954858712463379Q16.307320256314455,14.894338712463378,16.313113517314452,14.834098712463378Q16.318906797314455,14.77386871246338,16.330437597314454,14.71450871246338Q16.34196829731445,14.65514871246338,16.359125597314453,14.597228712463378Q16.376282797314452,14.539308712463379,16.398901297314453,14.483398712463378Q16.421519497314453,14.42747871246338,16.44938149731445,14.374098712463379Q16.477243497314454,14.32072871246338,16.510080497314455,14.270398712463379Q16.542917497314452,14.220078712463378,16.580413497314453,14.173298712463378Q16.617908497314453,14.126508712463378,16.659702497314452,14.083708712463379L25.171018497314453,5.368129712463379Q25.212808497314455,5.325333712463379,25.258498497314456,5.286937712463379Q25.304188497314453,5.248541712463379,25.353328497314454,5.214916712463379Q25.40246849731445,5.181291712463379,25.454598497314453,5.152761712463379Q25.506728497314455,5.124230712463379,25.561328497314452,5.101069512463379Q25.615938497314453,5.077908212463379,25.672498497314454,5.060339212463379Q25.729058497314455,5.042770112463379,25.787028497314452,5.030962612463379Q25.844998497314453,5.019155012463379,25.903818497314454,5.013222702463379Q25.96263849731445,5.007290366463379,26.021738497314452,5.007290366463379Q26.080848497314452,5.007290366463379,26.139668497314453,5.013222702463379Q26.198488497314454,5.019155012463379,26.256458497314455,5.030962612463379Q26.31437849731445,5.042770112463379,26.370978497314454,5.060339212463379Q26.427578497314453,5.077908212463379,26.482178497314454,5.101069512463379Q26.53677849731445,5.124230712463379,26.588878497314454,5.152761712463379Q26.640978497314453,5.181291712463379,26.690178497314452,5.214916712463379Q26.73927849731445,5.248541712463379,26.784978497314455,5.286937712463379Q26.83067849731445,5.325333712463379,26.872478497314454,5.368129712463379Z'%20fill='%238C8C8C'%20fill-opacity='1'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function useDraggableWithBoundary(tg){const{elRef:eg}=tg,gg=ref(0),ig=ref(0),ng=ref(!1);let og=0,ag=0,Ig=0,sg=0;const Cg=()=>{if(!eg.value)return;const dg=eg.value.getBoundingClientRect();Ig=dg.width,sg=dg.height},lg=(dg,bg)=>Math.min(Math.max(dg,-bg),bg),Ag=dg=>{if(!ng.value)return;let bg=dg.clientX-og,mg=dg.clientY-ag;const hg=(window.innerWidth-Ig)/2,pg=(window.innerHeight-sg)/2;bg=lg(bg,hg),mg=lg(mg,pg),gg.value=bg,ig.value=mg},cg=()=>{ng.value=!1,document.removeEventListener("mousemove",Ag),document.removeEventListener("mouseup",cg)},rg=async dg=>{dg.button===0&&(ng.value=!0,await nextTick(),Cg(),og=dg.clientX-gg.value,ag=dg.clientY-ig.value,document.addEventListener("mousemove",Ag),document.addEventListener("mouseup",cg))},ug=()=>{Cg(),gg.value=lg(gg.value,window.innerWidth-Ig),ig.value=lg(ig.value,window.innerHeight-sg)};return window.addEventListener("resize",ug),onUnmounted(()=>{document.removeEventListener("mousemove",Ag),document.removeEventListener("mouseup",cg),window.removeEventListener("resize",ug)}),{x:gg,y:ig,onMouseDown:rg}}const _hoisted_1$12={class:"d-container"},_hoisted_2$N={key:0,class:"d-mask"},_hoisted_3$G={class:"d-t-header"},_hoisted_4$C=["src"],_hoisted_5$y={key:0,class:"footer"},_sfc_main$14=defineComponent({__name:"Dialog",props:mergeModels({width:{type:String,default:"40%",required:!1},height:{type:String,default:"50%",required:!1},minHeight:{type:String,default:"300px",required:!1},maxHeight:{type:String,default:"auto",required:!1},minWidth:{type:String,default:void 0,required:!1},title:{type:String,required:!1},okBtnText:{type:String,default:void 0,require:!1},cancelBtnText:{type:String,default:void 0,require:!1},showOkBtn:{type:Boolean,default:!0,require:!1},showCancelBtn:{type:Boolean,default:!0,require:!1},showClose:{type:Boolean,default:!0,require:!1},noFooter:{type:Boolean,default:!1},maskShow:{type:Boolean,default:!1}},{open:{type:Boolean,default:!0},openModifiers:{},enabledOk:{type:Boolean,default:!0},enabledOkModifiers:{}}),emits:mergeModels(["finish"],["update:open","update:enabledOk"]),setup(tg,{emit:eg}){const{t:gg}=useI18n(),ig=ref(),ng=eg,og=useModel(tg,"open"),ag=tg;useModel(tg,"enabledOk");const{x:Ig,y:sg,onMouseDown:Cg}=useDraggableWithBoundary({elRef:ig}),lg=Ag=>{Ag.stopPropagation(),ng("finish","close")};return(Ag,cg)=>{const rg=Button$1;return og.value?(openBlock(),createBlock(Teleport,{key:0,to:"body"},[createBaseVNode("div",_hoisted_1$12,[tg.maskShow?(openBlock(),createElementBlock("div",_hoisted_2$N)):createCommentVNode("",!0),createBaseVNode("div",{ref_key:"dialogRef",ref:ig,class:"dialog-content",style:normalizeStyle$1({height:ag.height,minHeight:ag.minHeight,width:ag.width,minWidth:ag.minWidth,maxHeight:ag.maxHeight,transform:`translate(${unref(Ig)}px, ${unref(sg)}px)`})},[createBaseVNode("div",_hoisted_3$G,[createBaseVNode("div",{class:"d-t-header-title",onMousedown:cg[0]||(cg[0]=(...ug)=>unref(Cg)&&unref(Cg)(...ug))},toDisplayString$1(ag.title),33),tg.showClose?(openBlock(),createElementBlock("img",{key:0,class:"m-close-icon",src:unref(IconClose$1),onClick:lg},null,8,_hoisted_4$C)):createCommentVNode("",!0)]),createBaseVNode("div",mergeProps({class:"custom-content"},Ag.$attrs),[renderSlot(Ag.$slots,"default",{},void 0)],16),tg.noFooter?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_5$y,[renderSlot(Ag.$slots,"ext-button",{},void 0),tg.showOkBtn?(openBlock(),createBlock(rg,{key:0,type:"primary",onClick:cg[1]||(cg[1]=ug=>ng("finish","ok")),disabled:!tg.enabledOk},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ag.okBtnText??unref(gg)("common.actions.confirm")),1)]),_:1},8,["disabled"])):createCommentVNode("",!0),tg.showCancelBtn?(openBlock(),createBlock(rg,{key:1,style:{background:"#ffffff",color:"#828282"},onClick:cg[2]||(cg[2]=ug=>ng("finish","cancel"))},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ag.cancelBtnText??unref(gg)("common.actions.cancel")),1)]),_:1})):createCommentVNode("",!0)]))],4)])])):createCommentVNode("",!0)}}}),__unplugin_components_1$1=_export_sfc(_sfc_main$14,[["__scopeId","data-v-e477a1bc"]]);function formatSafeError(tg){const eg=getActiveEditorLocale(),gg=toSafeError(tg);if(gg.logDetail!==void 0&&console.error("[Service error]",gg.logDetail),eg==="zh-CN"&&gg.key.startsWith("errors.unknown")){const ig=getErrorParts(tg).detail;if(ig)return ig}return translate(gg.key,{code:gg.code??""})}var browser={},canPromise,hasRequiredCanPromise;function requireCanPromise(){return hasRequiredCanPromise||(hasRequiredCanPromise=1,canPromise=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),canPromise}var qrcode$1={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;let tg;const eg=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return utils$1.getSymbolSize=function(ig){if(!ig)throw new Error('"version" cannot be null or undefined');if(ig<1||ig>40)throw new Error('"version" should be in range from 1 to 40');return ig*4+17},utils$1.getSymbolTotalCodewords=function(ig){return eg[ig]},utils$1.getBCHDigit=function(gg){let ig=0;for(;gg!==0;)ig++,gg>>>=1;return ig},utils$1.setToSJISFunction=function(ig){if(typeof ig!="function")throw new Error('"toSJISFunc" is not a valid function.');tg=ig},utils$1.isKanjiModeEnabled=function(){return typeof tg<"u"},utils$1.toSJIS=function(ig){return tg(ig)},utils$1}var errorCorrectionLevel={},hasRequiredErrorCorrectionLevel;function requireErrorCorrectionLevel(){return hasRequiredErrorCorrectionLevel||(hasRequiredErrorCorrectionLevel=1,(function(tg){tg.L={bit:1},tg.M={bit:0},tg.Q={bit:3},tg.H={bit:2};function eg(gg){if(typeof gg!="string")throw new Error("Param is not a string");switch(gg.toLowerCase()){case"l":case"low":return tg.L;case"m":case"medium":return tg.M;case"q":case"quartile":return tg.Q;case"h":case"high":return tg.H;default:throw new Error("Unknown EC Level: "+gg)}}tg.isValid=function(ig){return ig&&typeof ig.bit<"u"&&ig.bit>=0&&ig.bit<4},tg.from=function(ig,ng){if(tg.isValid(ig))return ig;try{return eg(ig)}catch{return ng}}})(errorCorrectionLevel)),errorCorrectionLevel}var bitBuffer,hasRequiredBitBuffer;function requireBitBuffer(){if(hasRequiredBitBuffer)return bitBuffer;hasRequiredBitBuffer=1;function tg(){this.buffer=[],this.length=0}return tg.prototype={get:function(eg){const gg=Math.floor(eg/8);return(this.buffer[gg]>>>7-eg%8&1)===1},put:function(eg,gg){for(let ig=0;ig<gg;ig++)this.putBit((eg>>>gg-ig-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(eg){const gg=Math.floor(this.length/8);this.buffer.length<=gg&&this.buffer.push(0),eg&&(this.buffer[gg]|=128>>>this.length%8),this.length++}},bitBuffer=tg,bitBuffer}var bitMatrix,hasRequiredBitMatrix;function requireBitMatrix(){if(hasRequiredBitMatrix)return bitMatrix;hasRequiredBitMatrix=1;function tg(eg){if(!eg||eg<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=eg,this.data=new Uint8Array(eg*eg),this.reservedBit=new Uint8Array(eg*eg)}return tg.prototype.set=function(eg,gg,ig,ng){const og=eg*this.size+gg;this.data[og]=ig,ng&&(this.reservedBit[og]=!0)},tg.prototype.get=function(eg,gg){return this.data[eg*this.size+gg]},tg.prototype.xor=function(eg,gg,ig){this.data[eg*this.size+gg]^=ig},tg.prototype.isReserved=function(eg,gg){return this.reservedBit[eg*this.size+gg]},bitMatrix=tg,bitMatrix}var alignmentPattern={},hasRequiredAlignmentPattern;function requireAlignmentPattern(){return hasRequiredAlignmentPattern||(hasRequiredAlignmentPattern=1,(function(tg){const eg=requireUtils$1().getSymbolSize;tg.getRowColCoords=function(ig){if(ig===1)return[];const ng=Math.floor(ig/7)+2,og=eg(ig),ag=og===145?26:Math.ceil((og-13)/(2*ng-2))*2,Ig=[og-7];for(let sg=1;sg<ng-1;sg++)Ig[sg]=Ig[sg-1]-ag;return Ig.push(6),Ig.reverse()},tg.getPositions=function(ig){const ng=[],og=tg.getRowColCoords(ig),ag=og.length;for(let Ig=0;Ig<ag;Ig++)for(let sg=0;sg<ag;sg++)Ig===0&&sg===0||Ig===0&&sg===ag-1||Ig===ag-1&&sg===0||ng.push([og[Ig],og[sg]]);return ng}})(alignmentPattern)),alignmentPattern}var finderPattern={},hasRequiredFinderPattern;function requireFinderPattern(){if(hasRequiredFinderPattern)return finderPattern;hasRequiredFinderPattern=1;const tg=requireUtils$1().getSymbolSize,eg=7;return finderPattern.getPositions=function(ig){const ng=tg(ig);return[[0,0],[ng-eg,0],[0,ng-eg]]},finderPattern}var maskPattern={},hasRequiredMaskPattern;function requireMaskPattern(){return hasRequiredMaskPattern||(hasRequiredMaskPattern=1,(function(tg){tg.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const eg={N1:3,N2:3,N3:40,N4:10};tg.isValid=function(ng){return ng!=null&&ng!==""&&!isNaN(ng)&&ng>=0&&ng<=7},tg.from=function(ng){return tg.isValid(ng)?parseInt(ng,10):void 0},tg.getPenaltyN1=function(ng){const og=ng.size;let ag=0,Ig=0,sg=0,Cg=null,lg=null;for(let Ag=0;Ag<og;Ag++){Ig=sg=0,Cg=lg=null;for(let cg=0;cg<og;cg++){let rg=ng.get(Ag,cg);rg===Cg?Ig++:(Ig>=5&&(ag+=eg.N1+(Ig-5)),Cg=rg,Ig=1),rg=ng.get(cg,Ag),rg===lg?sg++:(sg>=5&&(ag+=eg.N1+(sg-5)),lg=rg,sg=1)}Ig>=5&&(ag+=eg.N1+(Ig-5)),sg>=5&&(ag+=eg.N1+(sg-5))}return ag},tg.getPenaltyN2=function(ng){const og=ng.size;let ag=0;for(let Ig=0;Ig<og-1;Ig++)for(let sg=0;sg<og-1;sg++){const Cg=ng.get(Ig,sg)+ng.get(Ig,sg+1)+ng.get(Ig+1,sg)+ng.get(Ig+1,sg+1);(Cg===4||Cg===0)&&ag++}return ag*eg.N2},tg.getPenaltyN3=function(ng){const og=ng.size;let ag=0,Ig=0,sg=0;for(let Cg=0;Cg<og;Cg++){Ig=sg=0;for(let lg=0;lg<og;lg++)Ig=Ig<<1&2047|ng.get(Cg,lg),lg>=10&&(Ig===1488||Ig===93)&&ag++,sg=sg<<1&2047|ng.get(lg,Cg),lg>=10&&(sg===1488||sg===93)&&ag++}return ag*eg.N3},tg.getPenaltyN4=function(ng){let og=0;const ag=ng.data.length;for(let sg=0;sg<ag;sg++)og+=ng.data[sg];return Math.abs(Math.ceil(og*100/ag/5)-10)*eg.N4};function gg(ig,ng,og){switch(ig){case tg.Patterns.PATTERN000:return(ng+og)%2===0;case tg.Patterns.PATTERN001:return ng%2===0;case tg.Patterns.PATTERN010:return og%3===0;case tg.Patterns.PATTERN011:return(ng+og)%3===0;case tg.Patterns.PATTERN100:return(Math.floor(ng/2)+Math.floor(og/3))%2===0;case tg.Patterns.PATTERN101:return ng*og%2+ng*og%3===0;case tg.Patterns.PATTERN110:return(ng*og%2+ng*og%3)%2===0;case tg.Patterns.PATTERN111:return(ng*og%3+(ng+og)%2)%2===0;default:throw new Error("bad maskPattern:"+ig)}}tg.applyMask=function(ng,og){const ag=og.size;for(let Ig=0;Ig<ag;Ig++)for(let sg=0;sg<ag;sg++)og.isReserved(sg,Ig)||og.xor(sg,Ig,gg(ng,sg,Ig))},tg.getBestMask=function(ng,og){const ag=Object.keys(tg.Patterns).length;let Ig=0,sg=1/0;for(let Cg=0;Cg<ag;Cg++){og(Cg),tg.applyMask(Cg,ng);const lg=tg.getPenaltyN1(ng)+tg.getPenaltyN2(ng)+tg.getPenaltyN3(ng)+tg.getPenaltyN4(ng);tg.applyMask(Cg,ng),lg<sg&&(sg=lg,Ig=Cg)}return Ig}})(maskPattern)),maskPattern}var errorCorrectionCode={},hasRequiredErrorCorrectionCode;function requireErrorCorrectionCode(){if(hasRequiredErrorCorrectionCode)return errorCorrectionCode;hasRequiredErrorCorrectionCode=1;const tg=requireErrorCorrectionLevel(),eg=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],gg=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return errorCorrectionCode.getBlocksCount=function(ng,og){switch(og){case tg.L:return eg[(ng-1)*4+0];case tg.M:return eg[(ng-1)*4+1];case tg.Q:return eg[(ng-1)*4+2];case tg.H:return eg[(ng-1)*4+3];default:return}},errorCorrectionCode.getTotalCodewordsCount=function(ng,og){switch(og){case tg.L:return gg[(ng-1)*4+0];case tg.M:return gg[(ng-1)*4+1];case tg.Q:return gg[(ng-1)*4+2];case tg.H:return gg[(ng-1)*4+3];default:return}},errorCorrectionCode}var polynomial={},galoisField={},hasRequiredGaloisField;function requireGaloisField(){if(hasRequiredGaloisField)return galoisField;hasRequiredGaloisField=1;const tg=new Uint8Array(512),eg=new Uint8Array(256);return(function(){let ig=1;for(let ng=0;ng<255;ng++)tg[ng]=ig,eg[ig]=ng,ig<<=1,ig&256&&(ig^=285);for(let ng=255;ng<512;ng++)tg[ng]=tg[ng-255]})(),galoisField.log=function(ig){if(ig<1)throw new Error("log("+ig+")");return eg[ig]},galoisField.exp=function(ig){return tg[ig]},galoisField.mul=function(ig,ng){return ig===0||ng===0?0:tg[eg[ig]+eg[ng]]},galoisField}var hasRequiredPolynomial;function requirePolynomial(){return hasRequiredPolynomial||(hasRequiredPolynomial=1,(function(tg){const eg=requireGaloisField();tg.mul=function(ig,ng){const og=new Uint8Array(ig.length+ng.length-1);for(let ag=0;ag<ig.length;ag++)for(let Ig=0;Ig<ng.length;Ig++)og[ag+Ig]^=eg.mul(ig[ag],ng[Ig]);return og},tg.mod=function(ig,ng){let og=new Uint8Array(ig);for(;og.length-ng.length>=0;){const ag=og[0];for(let sg=0;sg<ng.length;sg++)og[sg]^=eg.mul(ng[sg],ag);let Ig=0;for(;Ig<og.length&&og[Ig]===0;)Ig++;og=og.slice(Ig)}return og},tg.generateECPolynomial=function(ig){let ng=new Uint8Array([1]);for(let og=0;og<ig;og++)ng=tg.mul(ng,new Uint8Array([1,eg.exp(og)]));return ng}})(polynomial)),polynomial}var reedSolomonEncoder,hasRequiredReedSolomonEncoder;function requireReedSolomonEncoder(){if(hasRequiredReedSolomonEncoder)return reedSolomonEncoder;hasRequiredReedSolomonEncoder=1;const tg=requirePolynomial();function eg(gg){this.genPoly=void 0,this.degree=gg,this.degree&&this.initialize(this.degree)}return eg.prototype.initialize=function(ig){this.degree=ig,this.genPoly=tg.generateECPolynomial(this.degree)},eg.prototype.encode=function(ig){if(!this.genPoly)throw new Error("Encoder not initialized");const ng=new Uint8Array(ig.length+this.degree);ng.set(ig);const og=tg.mod(ng,this.genPoly),ag=this.degree-og.length;if(ag>0){const Ig=new Uint8Array(this.degree);return Ig.set(og,ag),Ig}return og},reedSolomonEncoder=eg,reedSolomonEncoder}var version={},mode={},versionCheck={},hasRequiredVersionCheck;function requireVersionCheck(){return hasRequiredVersionCheck||(hasRequiredVersionCheck=1,versionCheck.isValid=function(eg){return!isNaN(eg)&&eg>=1&&eg<=40}),versionCheck}var regex={},hasRequiredRegex;function requireRegex(){if(hasRequiredRegex)return regex;hasRequiredRegex=1;const tg="[0-9]+",eg="[A-Z $%*+\\-./:]+";let gg="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";gg=gg.replace(/u/g,"\\u");const ig="(?:(?![A-Z0-9 $%*+\\-./:]|"+gg+`)(?:.|[\r
931
931
  ]))+`;regex.KANJI=new RegExp(gg,"g"),regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),regex.BYTE=new RegExp(ig,"g"),regex.NUMERIC=new RegExp(tg,"g"),regex.ALPHANUMERIC=new RegExp(eg,"g");const ng=new RegExp("^"+gg+"$"),og=new RegExp("^"+tg+"$"),ag=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return regex.testKanji=function(sg){return ng.test(sg)},regex.testNumeric=function(sg){return og.test(sg)},regex.testAlphanumeric=function(sg){return ag.test(sg)},regex}var hasRequiredMode;function requireMode(){return hasRequiredMode||(hasRequiredMode=1,(function(tg){const eg=requireVersionCheck(),gg=requireRegex();tg.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},tg.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},tg.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},tg.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},tg.MIXED={bit:-1},tg.getCharCountIndicator=function(og,ag){if(!og.ccBits)throw new Error("Invalid mode: "+og);if(!eg.isValid(ag))throw new Error("Invalid version: "+ag);return ag>=1&&ag<10?og.ccBits[0]:ag<27?og.ccBits[1]:og.ccBits[2]},tg.getBestModeForData=function(og){return gg.testNumeric(og)?tg.NUMERIC:gg.testAlphanumeric(og)?tg.ALPHANUMERIC:gg.testKanji(og)?tg.KANJI:tg.BYTE},tg.toString=function(og){if(og&&og.id)return og.id;throw new Error("Invalid mode")},tg.isValid=function(og){return og&&og.bit&&og.ccBits};function ig(ng){if(typeof ng!="string")throw new Error("Param is not a string");switch(ng.toLowerCase()){case"numeric":return tg.NUMERIC;case"alphanumeric":return tg.ALPHANUMERIC;case"kanji":return tg.KANJI;case"byte":return tg.BYTE;default:throw new Error("Unknown mode: "+ng)}}tg.from=function(og,ag){if(tg.isValid(og))return og;try{return ig(og)}catch{return ag}}})(mode)),mode}var hasRequiredVersion;function requireVersion(){return hasRequiredVersion||(hasRequiredVersion=1,(function(tg){const eg=requireUtils$1(),gg=requireErrorCorrectionCode(),ig=requireErrorCorrectionLevel(),ng=requireMode(),og=requireVersionCheck(),ag=7973,Ig=eg.getBCHDigit(ag);function sg(cg,rg,ug){for(let dg=1;dg<=40;dg++)if(rg<=tg.getCapacity(dg,ug,cg))return dg}function Cg(cg,rg){return ng.getCharCountIndicator(cg,rg)+4}function lg(cg,rg){let ug=0;return cg.forEach(function(dg){const bg=Cg(dg.mode,rg);ug+=bg+dg.getBitsLength()}),ug}function Ag(cg,rg){for(let ug=1;ug<=40;ug++)if(lg(cg,ug)<=tg.getCapacity(ug,rg,ng.MIXED))return ug}tg.from=function(rg,ug){return og.isValid(rg)?parseInt(rg,10):ug},tg.getCapacity=function(rg,ug,dg){if(!og.isValid(rg))throw new Error("Invalid QR Code version");typeof dg>"u"&&(dg=ng.BYTE);const bg=eg.getSymbolTotalCodewords(rg),mg=gg.getTotalCodewordsCount(rg,ug),hg=(bg-mg)*8;if(dg===ng.MIXED)return hg;const pg=hg-Cg(dg,rg);switch(dg){case ng.NUMERIC:return Math.floor(pg/10*3);case ng.ALPHANUMERIC:return Math.floor(pg/11*2);case ng.KANJI:return Math.floor(pg/13);case ng.BYTE:default:return Math.floor(pg/8)}},tg.getBestVersionForData=function(rg,ug){let dg;const bg=ig.from(ug,ig.M);if(Array.isArray(rg)){if(rg.length>1)return Ag(rg,bg);if(rg.length===0)return 1;dg=rg[0]}else dg=rg;return sg(dg.mode,dg.getLength(),bg)},tg.getEncodedBits=function(rg){if(!og.isValid(rg)||rg<7)throw new Error("Invalid QR Code version");let ug=rg<<12;for(;eg.getBCHDigit(ug)-Ig>=0;)ug^=ag<<eg.getBCHDigit(ug)-Ig;return rg<<12|ug}})(version)),version}var formatInfo={},hasRequiredFormatInfo;function requireFormatInfo(){if(hasRequiredFormatInfo)return formatInfo;hasRequiredFormatInfo=1;const tg=requireUtils$1(),eg=1335,gg=21522,ig=tg.getBCHDigit(eg);return formatInfo.getEncodedBits=function(og,ag){const Ig=og.bit<<3|ag;let sg=Ig<<10;for(;tg.getBCHDigit(sg)-ig>=0;)sg^=eg<<tg.getBCHDigit(sg)-ig;return(Ig<<10|sg)^gg},formatInfo}var segments={},numericData,hasRequiredNumericData;function requireNumericData(){if(hasRequiredNumericData)return numericData;hasRequiredNumericData=1;const tg=requireMode();function eg(gg){this.mode=tg.NUMERIC,this.data=gg.toString()}return eg.getBitsLength=function(ig){return 10*Math.floor(ig/3)+(ig%3?ig%3*3+1:0)},eg.prototype.getLength=function(){return this.data.length},eg.prototype.getBitsLength=function(){return eg.getBitsLength(this.data.length)},eg.prototype.write=function(ig){let ng,og,ag;for(ng=0;ng+3<=this.data.length;ng+=3)og=this.data.substr(ng,3),ag=parseInt(og,10),ig.put(ag,10);const Ig=this.data.length-ng;Ig>0&&(og=this.data.substr(ng),ag=parseInt(og,10),ig.put(ag,Ig*3+1))},numericData=eg,numericData}var alphanumericData,hasRequiredAlphanumericData;function requireAlphanumericData(){if(hasRequiredAlphanumericData)return alphanumericData;hasRequiredAlphanumericData=1;const tg=requireMode(),eg=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function gg(ig){this.mode=tg.ALPHANUMERIC,this.data=ig}return gg.getBitsLength=function(ng){return 11*Math.floor(ng/2)+6*(ng%2)},gg.prototype.getLength=function(){return this.data.length},gg.prototype.getBitsLength=function(){return gg.getBitsLength(this.data.length)},gg.prototype.write=function(ng){let og;for(og=0;og+2<=this.data.length;og+=2){let ag=eg.indexOf(this.data[og])*45;ag+=eg.indexOf(this.data[og+1]),ng.put(ag,11)}this.data.length%2&&ng.put(eg.indexOf(this.data[og]),6)},alphanumericData=gg,alphanumericData}var byteData,hasRequiredByteData;function requireByteData(){if(hasRequiredByteData)return byteData;hasRequiredByteData=1;const tg=requireMode();function eg(gg){this.mode=tg.BYTE,typeof gg=="string"?this.data=new TextEncoder().encode(gg):this.data=new Uint8Array(gg)}return eg.getBitsLength=function(ig){return ig*8},eg.prototype.getLength=function(){return this.data.length},eg.prototype.getBitsLength=function(){return eg.getBitsLength(this.data.length)},eg.prototype.write=function(gg){for(let ig=0,ng=this.data.length;ig<ng;ig++)gg.put(this.data[ig],8)},byteData=eg,byteData}var kanjiData,hasRequiredKanjiData;function requireKanjiData(){if(hasRequiredKanjiData)return kanjiData;hasRequiredKanjiData=1;const tg=requireMode(),eg=requireUtils$1();function gg(ig){this.mode=tg.KANJI,this.data=ig}return gg.getBitsLength=function(ng){return ng*13},gg.prototype.getLength=function(){return this.data.length},gg.prototype.getBitsLength=function(){return gg.getBitsLength(this.data.length)},gg.prototype.write=function(ig){let ng;for(ng=0;ng<this.data.length;ng++){let og=eg.toSJIS(this.data[ng]);if(og>=33088&&og<=40956)og-=33088;else if(og>=57408&&og<=60351)og-=49472;else throw new Error("Invalid SJIS character: "+this.data[ng]+`
932
932
  Make sure your charset is UTF-8`);og=(og>>>8&255)*192+(og&255),ig.put(og,13)}},kanjiData=gg,kanjiData}var dijkstra={exports:{}},hasRequiredDijkstra;function requireDijkstra(){return hasRequiredDijkstra||(hasRequiredDijkstra=1,(function(tg){var eg={single_source_shortest_paths:function(gg,ig,ng){var og={},ag={};ag[ig]=0;var Ig=eg.PriorityQueue.make();Ig.push(ig,0);for(var sg,Cg,lg,Ag,cg,rg,ug,dg,bg;!Ig.empty();){sg=Ig.pop(),Cg=sg.value,Ag=sg.cost,cg=gg[Cg]||{};for(lg in cg)cg.hasOwnProperty(lg)&&(rg=cg[lg],ug=Ag+rg,dg=ag[lg],bg=typeof ag[lg]>"u",(bg||dg>ug)&&(ag[lg]=ug,Ig.push(lg,ug),og[lg]=Cg))}if(typeof ng<"u"&&typeof ag[ng]>"u"){var mg=["Could not find a path from ",ig," to ",ng,"."].join("");throw new Error(mg)}return og},extract_shortest_path_from_predecessor_list:function(gg,ig){for(var ng=[],og=ig;og;)ng.push(og),gg[og],og=gg[og];return ng.reverse(),ng},find_path:function(gg,ig,ng){var og=eg.single_source_shortest_paths(gg,ig,ng);return eg.extract_shortest_path_from_predecessor_list(og,ng)},PriorityQueue:{make:function(gg){var ig=eg.PriorityQueue,ng={},og;gg=gg||{};for(og in ig)ig.hasOwnProperty(og)&&(ng[og]=ig[og]);return ng.queue=[],ng.sorter=gg.sorter||ig.default_sorter,ng},default_sorter:function(gg,ig){return gg.cost-ig.cost},push:function(gg,ig){var ng={value:gg,cost:ig};this.queue.push(ng),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};tg.exports=eg})(dijkstra)),dijkstra.exports}var hasRequiredSegments;function requireSegments(){return hasRequiredSegments||(hasRequiredSegments=1,(function(tg){const eg=requireMode(),gg=requireNumericData(),ig=requireAlphanumericData(),ng=requireByteData(),og=requireKanjiData(),ag=requireRegex(),Ig=requireUtils$1(),sg=requireDijkstra();function Cg(mg){return unescape(encodeURIComponent(mg)).length}function lg(mg,hg,pg){const fg=[];let wg;for(;(wg=mg.exec(pg))!==null;)fg.push({data:wg[0],index:wg.index,mode:hg,length:wg[0].length});return fg}function Ag(mg){const hg=lg(ag.NUMERIC,eg.NUMERIC,mg),pg=lg(ag.ALPHANUMERIC,eg.ALPHANUMERIC,mg);let fg,wg;return Ig.isKanjiModeEnabled()?(fg=lg(ag.BYTE,eg.BYTE,mg),wg=lg(ag.KANJI,eg.KANJI,mg)):(fg=lg(ag.BYTE_KANJI,eg.BYTE,mg),wg=[]),hg.concat(pg,fg,wg).sort(function(Zg,yg){return Zg.index-yg.index}).map(function(Zg){return{data:Zg.data,mode:Zg.mode,length:Zg.length}})}function cg(mg,hg){switch(hg){case eg.NUMERIC:return gg.getBitsLength(mg);case eg.ALPHANUMERIC:return ig.getBitsLength(mg);case eg.KANJI:return og.getBitsLength(mg);case eg.BYTE:return ng.getBitsLength(mg)}}function rg(mg){return mg.reduce(function(hg,pg){const fg=hg.length-1>=0?hg[hg.length-1]:null;return fg&&fg.mode===pg.mode?(hg[hg.length-1].data+=pg.data,hg):(hg.push(pg),hg)},[])}function ug(mg){const hg=[];for(let pg=0;pg<mg.length;pg++){const fg=mg[pg];switch(fg.mode){case eg.NUMERIC:hg.push([fg,{data:fg.data,mode:eg.ALPHANUMERIC,length:fg.length},{data:fg.data,mode:eg.BYTE,length:fg.length}]);break;case eg.ALPHANUMERIC:hg.push([fg,{data:fg.data,mode:eg.BYTE,length:fg.length}]);break;case eg.KANJI:hg.push([fg,{data:fg.data,mode:eg.BYTE,length:Cg(fg.data)}]);break;case eg.BYTE:hg.push([{data:fg.data,mode:eg.BYTE,length:Cg(fg.data)}])}}return hg}function dg(mg,hg){const pg={},fg={start:{}};let wg=["start"];for(let Gg=0;Gg<mg.length;Gg++){const Zg=mg[Gg],yg=[];for(let Bg=0;Bg<Zg.length;Bg++){const Wg=Zg[Bg],$g=""+Gg+Bg;yg.push($g),pg[$g]={node:Wg,lastCount:0},fg[$g]={};for(let Ng=0;Ng<wg.length;Ng++){const vg=wg[Ng];pg[vg]&&pg[vg].node.mode===Wg.mode?(fg[vg][$g]=cg(pg[vg].lastCount+Wg.length,Wg.mode)-cg(pg[vg].lastCount,Wg.mode),pg[vg].lastCount+=Wg.length):(pg[vg]&&(pg[vg].lastCount=Wg.length),fg[vg][$g]=cg(Wg.length,Wg.mode)+4+eg.getCharCountIndicator(Wg.mode,hg))}}wg=yg}for(let Gg=0;Gg<wg.length;Gg++)fg[wg[Gg]].end=0;return{map:fg,table:pg}}function bg(mg,hg){let pg;const fg=eg.getBestModeForData(mg);if(pg=eg.from(hg,fg),pg!==eg.BYTE&&pg.bit<fg.bit)throw new Error('"'+mg+'" cannot be encoded with mode '+eg.toString(pg)+`.
933
933
  Suggested mode is: `+eg.toString(fg));switch(pg===eg.KANJI&&!Ig.isKanjiModeEnabled()&&(pg=eg.BYTE),pg){case eg.NUMERIC:return new gg(mg);case eg.ALPHANUMERIC:return new ig(mg);case eg.KANJI:return new og(mg);case eg.BYTE:return new ng(mg)}}tg.fromArray=function(hg){return hg.reduce(function(pg,fg){return typeof fg=="string"?pg.push(bg(fg,null)):fg.data&&pg.push(bg(fg.data,fg.mode)),pg},[])},tg.fromString=function(hg,pg){const fg=Ag(hg,Ig.isKanjiModeEnabled()),wg=ug(fg),Gg=dg(wg,pg),Zg=sg.find_path(Gg.map,"start","end"),yg=[];for(let Bg=1;Bg<Zg.length-1;Bg++)yg.push(Gg.table[Zg[Bg]].node);return tg.fromArray(rg(yg))},tg.rawSplit=function(hg){return tg.fromArray(Ag(hg,Ig.isKanjiModeEnabled()))}})(segments)),segments}var hasRequiredQrcode;function requireQrcode(){if(hasRequiredQrcode)return qrcode$1;hasRequiredQrcode=1;const tg=requireUtils$1(),eg=requireErrorCorrectionLevel(),gg=requireBitBuffer(),ig=requireBitMatrix(),ng=requireAlignmentPattern(),og=requireFinderPattern(),ag=requireMaskPattern(),Ig=requireErrorCorrectionCode(),sg=requireReedSolomonEncoder(),Cg=requireVersion(),lg=requireFormatInfo(),Ag=requireMode(),cg=requireSegments();function rg(Gg,Zg){const yg=Gg.size,Bg=og.getPositions(Zg);for(let Wg=0;Wg<Bg.length;Wg++){const $g=Bg[Wg][0],Ng=Bg[Wg][1];for(let vg=-1;vg<=7;vg++)if(!($g+vg<=-1||yg<=$g+vg))for(let Xg=-1;Xg<=7;Xg++)Ng+Xg<=-1||yg<=Ng+Xg||(vg>=0&&vg<=6&&(Xg===0||Xg===6)||Xg>=0&&Xg<=6&&(vg===0||vg===6)||vg>=2&&vg<=4&&Xg>=2&&Xg<=4?Gg.set($g+vg,Ng+Xg,!0,!0):Gg.set($g+vg,Ng+Xg,!1,!0))}}function ug(Gg){const Zg=Gg.size;for(let yg=8;yg<Zg-8;yg++){const Bg=yg%2===0;Gg.set(yg,6,Bg,!0),Gg.set(6,yg,Bg,!0)}}function dg(Gg,Zg){const yg=ng.getPositions(Zg);for(let Bg=0;Bg<yg.length;Bg++){const Wg=yg[Bg][0],$g=yg[Bg][1];for(let Ng=-2;Ng<=2;Ng++)for(let vg=-2;vg<=2;vg++)Ng===-2||Ng===2||vg===-2||vg===2||Ng===0&&vg===0?Gg.set(Wg+Ng,$g+vg,!0,!0):Gg.set(Wg+Ng,$g+vg,!1,!0)}}function bg(Gg,Zg){const yg=Gg.size,Bg=Cg.getEncodedBits(Zg);let Wg,$g,Ng;for(let vg=0;vg<18;vg++)Wg=Math.floor(vg/3),$g=vg%3+yg-8-3,Ng=(Bg>>vg&1)===1,Gg.set(Wg,$g,Ng,!0),Gg.set($g,Wg,Ng,!0)}function mg(Gg,Zg,yg){const Bg=Gg.size,Wg=lg.getEncodedBits(Zg,yg);let $g,Ng;for($g=0;$g<15;$g++)Ng=(Wg>>$g&1)===1,$g<6?Gg.set($g,8,Ng,!0):$g<8?Gg.set($g+1,8,Ng,!0):Gg.set(Bg-15+$g,8,Ng,!0),$g<8?Gg.set(8,Bg-$g-1,Ng,!0):$g<9?Gg.set(8,15-$g-1+1,Ng,!0):Gg.set(8,15-$g-1,Ng,!0);Gg.set(Bg-8,8,1,!0)}function hg(Gg,Zg){const yg=Gg.size;let Bg=-1,Wg=yg-1,$g=7,Ng=0;for(let vg=yg-1;vg>0;vg-=2)for(vg===6&&vg--;;){for(let Xg=0;Xg<2;Xg++)if(!Gg.isReserved(Wg,vg-Xg)){let Vg=!1;Ng<Zg.length&&(Vg=(Zg[Ng]>>>$g&1)===1),Gg.set(Wg,vg-Xg,Vg),$g--,$g===-1&&(Ng++,$g=7)}if(Wg+=Bg,Wg<0||yg<=Wg){Wg-=Bg,Bg=-Bg;break}}}function pg(Gg,Zg,yg){const Bg=new gg;yg.forEach(function(Xg){Bg.put(Xg.mode.bit,4),Bg.put(Xg.getLength(),Ag.getCharCountIndicator(Xg.mode,Gg)),Xg.write(Bg)});const Wg=tg.getSymbolTotalCodewords(Gg),$g=Ig.getTotalCodewordsCount(Gg,Zg),Ng=(Wg-$g)*8;for(Bg.getLengthInBits()+4<=Ng&&Bg.put(0,4);Bg.getLengthInBits()%8!==0;)Bg.putBit(0);const vg=(Ng-Bg.getLengthInBits())/8;for(let Xg=0;Xg<vg;Xg++)Bg.put(Xg%2?17:236,8);return fg(Bg,Gg,Zg)}function fg(Gg,Zg,yg){const Bg=tg.getSymbolTotalCodewords(Zg),Wg=Ig.getTotalCodewordsCount(Zg,yg),$g=Bg-Wg,Ng=Ig.getBlocksCount(Zg,yg),vg=Bg%Ng,Xg=Ng-vg,Vg=Math.floor(Bg/Ng),Mg=Math.floor($g/Ng),Rg=Mg+1,Sg=Vg-Mg,Yg=new sg(Sg);let xg=0;const Og=new Array(Ng),Kg=new Array(Ng);let Dg=0;const Fg=new Uint8Array(Gg.buffer);for(let da=0;da<Ng;da++){const ma=da<Xg?Mg:Rg;Og[da]=Fg.slice(xg,xg+ma),Kg[da]=Yg.encode(Og[da]),xg+=ma,Dg=Math.max(Dg,ma)}const Tg=new Uint8Array(Bg);let Jg=0,Eg,co;for(Eg=0;Eg<Dg;Eg++)for(co=0;co<Ng;co++)Eg<Og[co].length&&(Tg[Jg++]=Og[co][Eg]);for(Eg=0;Eg<Sg;Eg++)for(co=0;co<Ng;co++)Tg[Jg++]=Kg[co][Eg];return Tg}function wg(Gg,Zg,yg,Bg){let Wg;if(Array.isArray(Gg))Wg=cg.fromArray(Gg);else if(typeof Gg=="string"){let Vg=Zg;if(!Vg){const Mg=cg.rawSplit(Gg);Vg=Cg.getBestVersionForData(Mg,yg)}Wg=cg.fromString(Gg,Vg||40)}else throw new Error("Invalid data");const $g=Cg.getBestVersionForData(Wg,yg);if(!$g)throw new Error("The amount of data is too big to be stored in a QR Code");if(!Zg)Zg=$g;else if(Zg<$g)throw new Error(`
@@ -952,12 +952,12 @@ This will fail in production.`);ag=activePinia,ag._s.has(tg)||(ng?createSetupSto
952
952
  <img src=${ig.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
953
953
  scale(${gg})translate3d(${ng}px, ${og}px, ${ag}px)rotateZ(${this.rotate*90}deg)">
954
954
  </div>
955
- </div>`,this.$emit("real-time",ig)},reload(){let tg=new Image;tg.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=tg.width,this.trueHeight=tg.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},tg.onerror=()=>{this.$emit("img-load","error")},tg.src=this.imgs},checkedMode(){let tg=1,eg=this.trueWidth,gg=this.trueHeight;const ig=this.mode.split(" ");switch(ig[0]){case"contain":this.trueWidth>this.w&&(tg=this.w/this.trueWidth),this.trueHeight*tg>this.h&&(tg=this.h/this.trueHeight);break;case"cover":eg=this.w,tg=eg/this.trueWidth,gg=gg*tg,gg<this.h&&(gg=this.h,tg=gg/this.trueHeight);break;default:try{let ng=ig[0];if(ng.search("px")!==-1){ng=ng.replace("px",""),eg=parseFloat(ng);const og=eg/this.trueWidth;let ag=1,Ig=ig[1];Ig.search("px")!==-1&&(Ig=Ig.replace("px",""),gg=parseFloat(Ig),ag=gg/this.trueHeight),tg=Math.min(og,ag)}if(ng.search("%")!==-1&&(ng=ng.replace("%",""),eg=parseFloat(ng)/100*this.w,tg=eg/this.trueWidth),ig.length===2&&ng==="auto"){let og=ig[1];og.search("px")!==-1&&(og=og.replace("px",""),gg=parseFloat(og),tg=gg/this.trueHeight),og.search("%")!==-1&&(og=og.replace("%",""),gg=parseFloat(og)/100*this.h,tg=gg/this.trueHeight)}}catch{tg=1}}return tg},goAutoCrop(tg,eg){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let gg=this.w,ig=this.h;if(this.centerBox){const ag=Math.abs(this.rotate)%2>0;let Ig=(ag?this.trueHeight:this.trueWidth)*this.scale,sg=(ag?this.trueWidth:this.trueHeight)*this.scale;gg=Ig<gg?Ig:gg,ig=sg<ig?sg:ig}var ng=tg||parseFloat(this.autoCropWidth),og=eg||parseFloat(this.autoCropHeight);(ng===0||og===0)&&(ng=gg*.8,og=ig*.8),ng=ng>gg?gg:ng,og=og>ig?ig:og,this.fixed&&(og=ng/this.fixedNumber[0]*this.fixedNumber[1]),og>this.h&&(og=this.h,ng=og/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(ng,og)},changeCrop(tg,eg){if(this.centerBox){let gg=this.getImgAxis();tg>gg.x2-gg.x1&&(tg=gg.x2-gg.x1,eg=tg/this.fixedNumber[0]*this.fixedNumber[1]),eg>gg.y2-gg.y1&&(eg=gg.y2-gg.y1,tg=eg/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=tg,this.cropH=eg,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(tg,eg,gg){tg=tg||this.x,eg=eg||this.y,gg=gg||this.scale;let ig=!0;if(this.centerBox){let ng=this.getImgAxis(tg,eg,gg),og=this.getCropAxis();ng.x1>=og.x1&&(ig=!1),ng.x2<=og.x2&&(ig=!1),ng.y1>=og.y1&&(ig=!1),ng.y2<=og.y2&&(ig=!1),ig||this.changeImgScale(ng,og,gg)}return ig},changeImgScale(tg,eg,gg){let ig=this.trueWidth,ng=this.trueHeight,og=ig*gg,ag=ng*gg;if(og>=this.cropW&&ag>=this.cropH)this.scale=gg;else{const Ig=this.cropW/ig,sg=this.cropH/ng,Cg=this.cropH<=ng*Ig?Ig:sg;this.scale=Cg,og=ig*Cg,ag=ng*Cg}this.imgIsQqualCrop||(tg.x1>=eg.x1&&(this.isRotateRightOrLeft?this.x=eg.x1-(ig-og)/2-(og-ag)/2:this.x=eg.x1-(ig-og)/2),tg.x2<=eg.x2&&(this.isRotateRightOrLeft?this.x=eg.x1-(ig-og)/2-(og-ag)/2-ag+this.cropW:this.x=eg.x2-(ig-og)/2-og),tg.y1>=eg.y1&&(this.isRotateRightOrLeft?this.y=eg.y1-(ng-ag)/2-(ag-og)/2:this.y=eg.y1-(ng-ag)/2),tg.y2<=eg.y2&&(this.isRotateRightOrLeft?this.y=eg.y2-(ng-ag)/2-(ag-og)/2-og:this.y=eg.y2-(ng-ag)/2-ag)),(og<this.cropW||ag<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let tg=this;var eg=navigator.userAgent;this.isIOS=!!eg.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(gg,ig,ng){for(var og=atob(this.toDataURL(ig,ng).split(",")[1]),ag=og.length,Ig=new Uint8Array(ag),sg=0;sg<ag;sg++)Ig[sg]=og.charCodeAt(sg);gg(new Blob([Ig],{type:tg.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),A={key:0,class:"cropper-box"},B=["src"],P={class:"cropper-view-box"},R=["src"],D={key:1};function U(tg,eg,gg,ig,ng,og){return openBlock(),createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:eg[28]||(eg[28]=(...ag)=>tg.scaleImg&&tg.scaleImg(...ag)),onMouseout:eg[29]||(eg[29]=(...ag)=>tg.cancelScale&&tg.cancelScale(...ag))},[tg.imgs?(openBlock(),createElementBlock("div",A,[withDirectives(createBaseVNode("div",{class:"cropper-box-canvas",style:normalizeStyle$1({width:tg.trueWidth+"px",height:tg.trueHeight+"px",transform:"scale("+tg.scale+","+tg.scale+") translate3d("+tg.x/tg.scale+"px,"+tg.y/tg.scale+"px,0)rotateZ("+tg.rotate*90+"deg)"})},[createBaseVNode("img",{src:tg.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,B)],4),[[vShow,!tg.loading]])])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["cropper-drag-box",{"cropper-move":tg.move&&!tg.crop,"cropper-crop":tg.crop,"cropper-modal":tg.cropping}]),onMousedown:eg[0]||(eg[0]=(...ag)=>tg.startMove&&tg.startMove(...ag)),onTouchstart:eg[1]||(eg[1]=(...ag)=>tg.startMove&&tg.startMove(...ag))},null,34),withDirectives(createBaseVNode("div",{class:"cropper-crop-box",style:normalizeStyle$1({width:tg.cropW+"px",height:tg.cropH+"px",transform:"translate3d("+tg.cropOffsertX+"px,"+tg.cropOffsertY+"px,0)"})},[createBaseVNode("span",P,[createBaseVNode("img",{style:normalizeStyle$1({width:tg.trueWidth+"px",height:tg.trueHeight+"px",transform:"scale("+tg.scale+","+tg.scale+") translate3d("+(tg.x-tg.cropOffsertX)/tg.scale+"px,"+(tg.y-tg.cropOffsertY)/tg.scale+"px,0)rotateZ("+tg.rotate*90+"deg)"}),src:tg.imgs,alt:"cropper-img"},null,12,R)]),createBaseVNode("span",{class:"cropper-face cropper-move",onMousedown:eg[2]||(eg[2]=(...ag)=>tg.cropMove&&tg.cropMove(...ag)),onTouchstart:eg[3]||(eg[3]=(...ag)=>tg.cropMove&&tg.cropMove(...ag))},null,32),tg.info?(openBlock(),createElementBlock("span",{key:0,class:"crop-info",style:normalizeStyle$1({top:tg.cropInfo.top})},toDisplayString$1(tg.cropInfo.width)+" × "+toDisplayString$1(tg.cropInfo.height),5)):createCommentVNode("",!0),tg.fixedBox?createCommentVNode("",!0):(openBlock(),createElementBlock("span",D,[createBaseVNode("span",{class:"crop-line line-w",onMousedown:eg[4]||(eg[4]=ag=>tg.changeCropSize(ag,!1,!0,0,1)),onTouchstart:eg[5]||(eg[5]=ag=>tg.changeCropSize(ag,!1,!0,0,1))},null,32),createBaseVNode("span",{class:"crop-line line-a",onMousedown:eg[6]||(eg[6]=ag=>tg.changeCropSize(ag,!0,!1,1,0)),onTouchstart:eg[7]||(eg[7]=ag=>tg.changeCropSize(ag,!0,!1,1,0))},null,32),createBaseVNode("span",{class:"crop-line line-s",onMousedown:eg[8]||(eg[8]=ag=>tg.changeCropSize(ag,!1,!0,0,2)),onTouchstart:eg[9]||(eg[9]=ag=>tg.changeCropSize(ag,!1,!0,0,2))},null,32),createBaseVNode("span",{class:"crop-line line-d",onMousedown:eg[10]||(eg[10]=ag=>tg.changeCropSize(ag,!0,!1,2,0)),onTouchstart:eg[11]||(eg[11]=ag=>tg.changeCropSize(ag,!0,!1,2,0))},null,32),createBaseVNode("span",{class:"crop-point point1",onMousedown:eg[12]||(eg[12]=ag=>tg.changeCropSize(ag,!0,!0,1,1)),onTouchstart:eg[13]||(eg[13]=ag=>tg.changeCropSize(ag,!0,!0,1,1))},null,32),createBaseVNode("span",{class:"crop-point point2",onMousedown:eg[14]||(eg[14]=ag=>tg.changeCropSize(ag,!1,!0,0,1)),onTouchstart:eg[15]||(eg[15]=ag=>tg.changeCropSize(ag,!1,!0,0,1))},null,32),createBaseVNode("span",{class:"crop-point point3",onMousedown:eg[16]||(eg[16]=ag=>tg.changeCropSize(ag,!0,!0,2,1)),onTouchstart:eg[17]||(eg[17]=ag=>tg.changeCropSize(ag,!0,!0,2,1))},null,32),createBaseVNode("span",{class:"crop-point point4",onMousedown:eg[18]||(eg[18]=ag=>tg.changeCropSize(ag,!0,!1,1,0)),onTouchstart:eg[19]||(eg[19]=ag=>tg.changeCropSize(ag,!0,!1,1,0))},null,32),createBaseVNode("span",{class:"crop-point point5",onMousedown:eg[20]||(eg[20]=ag=>tg.changeCropSize(ag,!0,!1,2,0)),onTouchstart:eg[21]||(eg[21]=ag=>tg.changeCropSize(ag,!0,!1,2,0))},null,32),createBaseVNode("span",{class:"crop-point point6",onMousedown:eg[22]||(eg[22]=ag=>tg.changeCropSize(ag,!0,!0,1,2)),onTouchstart:eg[23]||(eg[23]=ag=>tg.changeCropSize(ag,!0,!0,1,2))},null,32),createBaseVNode("span",{class:"crop-point point7",onMousedown:eg[24]||(eg[24]=ag=>tg.changeCropSize(ag,!1,!0,0,2)),onTouchstart:eg[25]||(eg[25]=ag=>tg.changeCropSize(ag,!1,!0,0,2))},null,32),createBaseVNode("span",{class:"crop-point point8",onMousedown:eg[26]||(eg[26]=ag=>tg.changeCropSize(ag,!0,!0,2,2)),onTouchstart:eg[27]||(eg[27]=ag=>tg.changeCropSize(ag,!0,!0,2,2))},null,32)]))],4),[[vShow,tg.cropping]])],544)}const M=$(z,[["render",U],["__scopeId","data-v-a742df44"]]),_hoisted_1$8={key:0,class:"cut-img-box"},_hoisted_2$5={class:"c-footer-tool"},_hoisted_3$5={class:"c-footer-btns"},_sfc_main$9=defineComponent({__name:"cut-img-modal",props:{open:{type:Boolean,default:!1},openModifiers:{},img:{default:""},imgModifiers:{},imgInfo:{default:{width:1,height:1}},imgInfoModifiers:{}},emits:mergeModels(["getData"],["update:open","update:img","update:imgInfo"]),setup(tg,{emit:eg}){const{t:gg}=useI18n(),ig=eg,ng=useModel(tg,"open"),og=useModel(tg,"img"),ag=useModel(tg,"imgInfo"),Ig=ref(),sg=ref(!1),Cg=ref([1,1]),lg=()=>{Ig.value&&Ig.value.rotateLeft()},Ag=()=>{Ig.value&&Ig.value.rotateRight()},cg=dg=>{Ig.value&&Ig.value.changeScale(dg)},rg=()=>{ng.value=!1,Ig.value&&Ig.value.getCropData(dg=>{ig("getData",dg)})},ug=()=>{ng.value=!1};return watch(sg,dg=>{dg&&(Cg.value=[ag.value.width,ag.value.height])}),(dg,bg)=>{const mg=Checkbox,hg=Space,pg=Button$1,fg=Modal$1;return openBlock(),createBlock(fg,{open:ng.value,"onUpdate:open":bg[3]||(bg[3]=wg=>ng.value=wg),width:"800px",title:unref(gg)("common.commonUi.cropImage"),centered:"",footer:null,"mask-closable":!1},{default:withCtx(()=>[og.value?(openBlock(),createElementBlock("div",_hoisted_1$8,[(openBlock(),createElementBlock("div",{class:"cropper-box",key:unref(sg)+""},[createVNode(unref(M),{ref_key:"cropper",ref:Ig,img:og.value,autoCrop:"",outputType:"png",fixed:unref(sg),fixedNumber:unref(Cg)},null,8,["img","fixed","fixedNumber"])])),createBaseVNode("div",_hoisted_2$5,[createVNode(mg,{checked:unref(sg),"onUpdate:checked":bg[0]||(bg[0]=wg=>isRef$1(sg)?sg.value=wg:null),class:"keep-ratio"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.commonUi.keepAspectRatio")),1)]),_:1},8,["checked"]),createVNode(hg,null,{default:withCtx(()=>[createVNode(unref(RotateLeftOutlined),{onClick:lg}),createVNode(unref(RotateRightOutlined),{onClick:Ag}),createVNode(unref(PlusSquareOutlined),{onClick:bg[1]||(bg[1]=wg=>cg(1))}),createVNode(unref(MinusSquareOutlined),{onClick:bg[2]||(bg[2]=wg=>cg(-1))})]),_:1})]),createBaseVNode("div",_hoisted_3$5,[createVNode(hg,null,{default:withCtx(()=>[createVNode(pg,{onClick:ug,size:"large"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.actions.cancel")),1)]),_:1}),createVNode(pg,{type:"primary",onClick:rg,size:"large"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.commonUi.crop")),1)]),_:1})]),_:1})])])):createCommentVNode("",!0)]),_:1},8,["open","title"])}}}),cutImgModal=_export_sfc(_sfc_main$9,[["__scopeId","data-v-e323664b"]]),_hoisted_1$7={key:0,class:"property"},_hoisted_2$4={class:"title"},_hoisted_3$4=["src","title"],_hoisted_4$4=["src","title"],_hoisted_5$4=["src","title"],_hoisted_6$4=["src","title"],_sfc_main$8=defineComponent({__name:"text-group-config",props:{selectObj:{type:Object,default:{}},editorCtrl:{type:Object,default:{}}},setup(tg){var mg;const{t:eg}=useI18n(),gg=tg,ig=ref();let ng=((mg=gg.selectObj)==null?void 0:mg.getObjects())||[],og=[];const ag=ref([]),Ig=ref(!1),sg=ref(void 0);useFont(sg);const Cg=ref([]),lg=ref("");function Ag(hg){var fg;(hg.type==="text"||hg.type==="textbox"||hg.type==="counter")&&hg.initDimensions(),hg.setCoords();let pg=hg.group;for(;pg;)pg.dirty=!0,pg.triggerLayout("childUpdate"),pg.setCoords(),pg=pg.group;(fg=hg.canvas)==null||fg.requestRenderAll()}const cg=()=>{let hg=Number((lg.value+"").replace(/[^\d.]/g,""));og.forEach(pg=>{hg>0&&(pg.type==="text"||pg.type==="counter")&&(pg.set("fontSize",ptToPx(+hg)),pg.set("scaleX",1),pg.set("scaleY",1),Ag(pg))})},rg=hg=>{hg.preventDefault(),hg.stopPropagation(),ig.value&&ig.value.blur()},ug=()=>{};let dg=()=>{};onMounted(()=>{getFontList().then(pg=>{ag.value=pg});const hg=pg=>{pg.type==="group"&&pg._objects?pg._objects.forEach(fg=>hg(fg)):(pg.type==="text"||pg.type==="counter")&&og.push(pg)};if(ng.forEach(pg=>hg(pg)),Ig.value=og.length>0,og.length){const pg=og[0],fg=Gg=>og.every(Zg=>Gg(Zg)===Gg(pg)),wg=Gg=>{const Zg=[];return Gg.underline&&Zg.push("underline"),Gg.linethrough&&Zg.push("linethrough"),Gg.fontWeight&&Zg.push(Gg.fontWeight),(Gg.fontStyle==="italic"||Gg.hasSetItalic)&&Zg.push("italic"),Zg.join(",")};sg.value=fg(Gg=>Gg.fontFamily)?pg.fontFamily:void 0,lg.value=fg(Gg=>pxToPt(Gg.fontSize))?pxToPt(pg.fontSize):"",Cg.value=fg(wg)?wg(pg).split(",").filter(Boolean):[],dg=watch(Cg,Gg=>{og.forEach(Zg=>{(Zg.type==="text"||Zg.type==="counter")&&(Zg.set("underline",Gg.includes("underline")),Zg.set("linethrough",Gg.includes("linethrough")),Zg.set("fontWeight",Gg.includes("bold")?"bold":"normal"),Zg.set("fontStyle",Gg.includes("italic")?"italic":"normal"),Zg.canvas.requestRenderAll())})})}});const bg=hg=>{og.forEach(pg=>{(pg.type==="text"||pg.type==="counter")&&(pg.set("fontFamily",hg),pg.canvas.requestRenderAll())})};return onUnmounted(()=>{dg()}),(hg,pg)=>{const fg=Select,wg=__unplugin_components_3$3,Gg=Input,Zg=__unplugin_components_3$5,yg=__unplugin_components_5$2;return unref(Ig)?(openBlock(),createElementBlock("div",_hoisted_1$7,[createBaseVNode("span",_hoisted_2$4,toDisplayString$1(unref(eg)("editor.copy.f4d3dab8e0")),1),createVNode(fg,{placeholder:unref(eg)("editor.copy.b088a3713a"),"show-search":"",value:unref(sg),"onUpdate:value":pg[0]||(pg[0]=Bg=>isRef$1(sg)?sg.value=Bg:null),style:{width:"100%","margin-bottom":"10px"},options:unref(ag),onChange:bg},null,8,["placeholder","value","options"]),createVNode(yg,{justify:"space-between"},{default:withCtx(()=>[createVNode(wg,null,{default:withCtx(()=>[createVNode(IconCheckBox,{value:unref(Cg),"onUpdate:value":pg[1]||(pg[1]=Bg=>isRef$1(Cg)?Cg.value=Bg:null),values:["bold","italic","linethrough","underline"]},{default:withCtx(({index:Bg})=>[Bg===0?(openBlock(),createElementBlock("img",{key:0,src:unref(IconTextBold),title:unref(eg)("editor.copy.f670b2adc0")},null,8,_hoisted_3$4)):createCommentVNode("",!0),Bg===1?(openBlock(),createElementBlock("img",{key:1,src:unref(IconTextItalic),title:unref(eg)("editor.copy.af5a2c8bff")},null,8,_hoisted_4$4)):createCommentVNode("",!0),Bg===2?(openBlock(),createElementBlock("img",{key:2,src:unref(IconTextStrikethrough),title:unref(eg)("editor.copy.c85de9e58a")},null,8,_hoisted_5$4)):createCommentVNode("",!0),Bg===3?(openBlock(),createElementBlock("img",{key:3,src:unref(IconTextUnderline),title:unref(eg)("editor.copy.9bc18ae51e")},null,8,_hoisted_6$4)):createCommentVNode("",!0)]),_:1},8,["value"])]),_:1}),createVNode(wg,{class:"font-size-box",title:unref(eg)("editor.copy.576ccdb1f1")},{default:withCtx(()=>[createVNode(Zg,{ref_key:"autoRef",ref:ig,placeholder:unref(eg)("editor.copy.cee8bcba20"),onChange:cg,value:unref(lg),"onUpdate:value":pg[2]||(pg[2]=Bg=>isRef$1(lg)?lg.value=Bg:null),options:unref(defaultFontSize),style:{width:"90px"},"show-arrow":!0},{default:withCtx(()=>[createVNode(Gg,{onKeydown:withKeys(rg,["enter"]),onBlur:ug})]),_:1},8,["placeholder","value","options"]),pg[3]||(pg[3]=createBaseVNode("div",{class:"font-pt"},"pt",-1))]),_:1},8,["title"])]),_:1})])):createCommentVNode("",!0)}}}),textGroupConfig=_export_sfc(_sfc_main$8,[["__scopeId","data-v-e436c067"]]),_hoisted_1$6={class:"property"},_hoisted_2$3={class:"title"},_hoisted_3$3={class:"laser-fields"},_hoisted_4$3={class:"laser-label"},_hoisted_5$3={class:"laser-unit"},_hoisted_6$3={key:1,class:"no-preset-tip"},_sfc_main$7=defineComponent({__name:"LaserConfig",props:{editorCtrl:{type:Object},selectObj:{type:Object,default:null}},setup(tg){const eg=getLaserPresets(),{t:gg}=useI18n(),ig=tg,ng=[{key:"repeatTimes",label:"laserConfig.paramLabels.repeatTimes",min:0,max:1e4,defaultValue:1,unit:"",status:0},{key:"scanSpeed",label:"laserConfig.paramLabels.scanSpeed",min:0,max:65535,defaultValue:3e3,unit:"mm/s",status:0},{key:"jumpSpeed",label:"laserConfig.paramLabels.jumpSpeed",min:0,max:65535,defaultValue:3e3,unit:"mm/s",status:0},{key:"power",label:"laserConfig.paramLabels.power",min:0,max:100,defaultValue:20,unit:"%",status:1},{key:"frequence",label:"laserConfig.paramLabels.frequence",min:0,max:4e3,defaultValue:200,unit:"khz",status:0},{key:"pulseWidth",label:"laserConfig.paramLabels.pulseWidth",min:0,max:500,defaultValue:50,unit:"ns",status:0},{key:"openLightDelay",label:"laserConfig.paramLabels.openLightDelay",min:-1e3,max:2e3,defaultValue:0,unit:"us",status:0},{key:"closeLightDelay",label:"laserConfig.paramLabels.closeLightDelay",min:-1e3,max:2e3,defaultValue:0,unit:"us",status:0},{key:"endDelay",label:"laserConfig.paramLabels.endDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0},{key:"trunDelay",label:"laserConfig.paramLabels.trunDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0},{key:"jumpDelay",label:"laserConfig.paramLabels.jumpDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0}],og=hg=>gg(hg.label),ag=ref([...ng]),Ig=ref(void 0),sg=reactive({});(()=>{ng.forEach(hg=>{sg[hg.key]=hg.defaultValue})})();const lg=hg=>eg.value.find(pg=>pg.configId===hg),Ag=()=>{var fg,wg;const hg=new Set;return(((wg=(fg=ig.editorCtrl)==null?void 0:fg.getObjects)==null?void 0:wg.call(fg))||[]).forEach(Gg=>{var yg;const Zg=(yg=Gg.customExportFields)==null?void 0:yg.laserConfigId;Zg&&hg.add(Zg)}),hg},cg=hg=>{const pg=getLaserMaxPresets();if(pg<=0||hg===Ig.value)return!1;const fg=Ag();return fg.has(hg)?!1:fg.size>=pg},rg=()=>{if(!Ig.value)return;const hg=lg(Ig.value);hg&&(ag.value=hg.params.map(pg=>{const fg=ng.find(wg=>wg.key===pg.key);return{...pg,status:pg.status??(fg==null?void 0:fg.status)??0}}),hg.params.forEach(pg=>{sg[pg.key]=pg.defaultValue}))},ug=()=>{var pg,fg,wg;const hg=ig.selectObj;hg&&(hg.set("customExportFields",{laserConfigId:Ig.value||""}),(wg=(fg=(pg=ig.editorCtrl)==null?void 0:pg.editor)==null?void 0:fg.canvas)==null||wg.fire("custom:object:checkdirty",{isToDirty:!0}))},dg=()=>{if(!Ig.value)return;const hg=lg(Ig.value);hg&&(hg.params.forEach(pg=>{sg[pg.key]!=null&&(pg.defaultValue=sg[pg.key])}),ug())},bg=hg=>{Ig.value=hg||void 0,hg?rg():ag.value=[...ng],ug()},mg=()=>{var fg;const hg=ig.selectObj;if(!hg)return;const pg=(fg=hg.customExportFields)==null?void 0:fg.laserConfigId;if(pg&&lg(pg)){Ig.value=pg,rg();return}if(eg.value.length>0){const wg=eg.value[0];Ig.value=wg.configId,ag.value=wg.params,rg(),ug()}};return watch(()=>ig.selectObj,()=>{ig.selectObj&&mg()},{immediate:!0}),watch(eg,()=>{ig.selectObj&&mg()},{deep:!0}),(hg,pg)=>{const fg=__unplugin_components_0$4,wg=SelectOption,Gg=Select,Zg=__unplugin_components_3$3,yg=__unplugin_components_4$1,Bg=__unplugin_components_5$2;return openBlock(),createElementBlock(Fragment,null,[createVNode(fg),createBaseVNode("div",_hoisted_1$6,[createBaseVNode("span",_hoisted_2$3,toDisplayString$1(unref(gg)("editor.specialist.laser.title")),1),unref(eg).length?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(Gg,{value:Ig.value,"onUpdate:value":pg[0]||(pg[0]=Wg=>Ig.value=Wg),style:{width:"100%","margin-bottom":"10px"},placeholder:unref(gg)("editor.specialist.laser.selectPreset"),onChange:bg},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(eg),Wg=>(openBlock(),createBlock(wg,{key:Wg.configId,value:Wg.configId,disabled:cg(Wg.configId)},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Wg.configName),1)]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["value","placeholder"]),createBaseVNode("div",_hoisted_3$3,[(openBlock(!0),createElementBlock(Fragment,null,renderList(ag.value,Wg=>(openBlock(),createBlock(Bg,{key:Wg.key,class:"laser-row"},{default:withCtx(()=>[createVNode(Zg,{span:11,class:"laser-label-col"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_4$3,toDisplayString$1(og(Wg)),1)]),_:2},1024),createVNode(Zg,{span:8},{default:withCtx(()=>[createVNode(yg,{value:sg[Wg.key],"onUpdate:value":$g=>sg[Wg.key]=$g,step:1,min:Wg.min,max:Wg.max,precision:0,disabled:Wg.status!==1,style:{width:"100%"},size:"small",onChange:dg},null,8,["value","onUpdate:value","min","max","disabled"])]),_:2},1024),createVNode(Zg,{span:2,class:"laser-unit-col"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_5$3,toDisplayString$1(Wg.unit),1)]),_:2},1024)]),_:2},1024))),128))])],64)):(openBlock(),createElementBlock("span",_hoisted_6$3,toDisplayString$1(unref(gg)("editor.specialist.laser.noPreset")),1))])],64)}}}),LaserConfig=_export_sfc(_sfc_main$7,[["__scopeId","data-v-37af2c09"]]),_hoisted_1$5={class:"preview-panel"},_hoisted_2$2={class:"preview-title"},_hoisted_3$2=["title"],_hoisted_4$2=["src"],_hoisted_5$2={class:"preview-hover-tip"},_hoisted_6$2={class:"preview-modal-picture"},_hoisted_7$1=["src"],_sfc_main$6=defineComponent({__name:"PreviewPanel",props:{images:{}},setup(tg){const eg=ref(!1),gg=()=>{eg.value=!0};return(ig,ng)=>{const og=Modal$1;return openBlock(),createElementBlock("div",_hoisted_1$5,[createBaseVNode("div",_hoisted_2$2,toDisplayString$1(ig.$t("common.commonUi.preview"))+":",1),createBaseVNode("button",{type:"button",class:"preview-picture",title:ig.$t("common.commonUi.clickPreview"),onClick:gg},[(openBlock(!0),createElementBlock(Fragment,null,renderList(tg.images,(ag,Ig)=>(openBlock(),createElementBlock("img",{key:Ig+"-"+ag.length,class:normalizeClass(["preview-layer-img",{single:tg.images.length===1}]),src:ag,alt:"",style:normalizeStyle$1({zIndex:Ig+1})},null,14,_hoisted_4$2))),128)),createBaseVNode("span",_hoisted_5$2,toDisplayString$1(ig.$t("common.commonUi.clickPreview")),1)],8,_hoisted_3$2),createVNode(og,{open:eg.value,"onUpdate:open":ng[0]||(ng[0]=ag=>eg.value=ag),title:ig.$t("common.commonUi.preview"),width:"760px",footer:null,centered:"","destroy-on-close":!1,"wrap-class-name":"preview-modal-wrap"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_6$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tg.images,(ag,Ig)=>(openBlock(),createElementBlock("img",{key:Ig+"-"+ag.length,class:"preview-modal-layer-img",src:ag,alt:"",style:normalizeStyle$1({zIndex:Ig+1})},null,12,_hoisted_7$1))),128))])]),_:1},8,["open","title"])])}}}),PreviewPanel=_export_sfc(_sfc_main$6,[["__scopeId","data-v-0eb09ddb"]]);function createLatestAsyncTaskRunner(tg){let eg,gg=!1,ig;const ng=async()=>{for(;gg;)gg=!1,await tg(eg)};return og=>(eg=og,gg=!0,ig||(ig=ng().finally(()=>{ig=void 0})),ig)}const _hoisted_1$4={key:0,class:"right-side-bar"},_hoisted_2$1={key:1,class:"preview-box"},_hoisted_3$1={class:"preview-settings-scroll"},_hoisted_4$1={class:"background-panel"},_hoisted_5$1={class:"background-row"},_hoisted_6$1={class:"background-label"},_hoisted_7={class:"background-row background-image-row"},_hoisted_8={class:"background-label"},_hoisted_9={class:"background-actions"},_hoisted_10={key:0,class:"background-thumb"},_hoisted_11=["src"],_hoisted_12={key:0,class:"ribbon-pattern"},_hoisted_13={class:"ribbon-title"},_hoisted_14={key:0,class:"ribbon-current-preview"},_hoisted_15=["src"],_hoisted_16={class:"ribbon-modal-grid"},_hoisted_17=["onClick"],_hoisted_18=["src"],_hoisted_19={key:1,class:"layer-panel"},_hoisted_20={class:"layer-title"},_hoisted_21=["disabled"],_hoisted_22={class:"layer-list"},_hoisted_23=["onClick"],_hoisted_24=["onDblclick"],_hoisted_25=["onClick"],_hoisted_26=["onClick"],_sfc_main$5=defineComponent({__name:"index@RightSideBar",setup(tg){const eg=ref("1"),{t:gg}=useI18n(),ig=maxCountVal,ng=ref(""),og=ref([]),ag=ref({}),Ig=useTabsStore(),sg=useAppStore(),Cg=ref("none"),lg=ref(!1),Ag=RIBBON_BORDER_PATTERN_OPTIONS,cg=ref({}),rg=ref("#FFFFFFFF"),ug=ref(""),dg=ref(!0),bg=ref(0),mg=ref(!1),hg=ref(!1),pg=ref(""),fg=ref(""),wg=ref(null),Gg=computed(()=>{var uI;const mI=(uI=Ig.getActiveTab)==null?void 0:uI.call(Ig);return(mI==null?void 0:mI.layers)||[]}),Zg=computed(()=>{var mI,uI;return((uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))==null?void 0:uI.activeLayerId)||""}),yg=computed(()=>{var mI;return getTabLayerMaxCount((mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))}),Bg=computed(()=>{var mI,uI;return state$1.isSeparateLayerMode||((uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))==null?void 0:uI.separateLayerMode)===!0}),Wg=computed(()=>state$1.isMultiLayerEnabled&&yg.value>1&&Gg.value.length>0),$g=computed(()=>Ng(Cg.value)),Ng=mI=>mI==="none"?gg("editor.shell.noStroke"):gg("editor.shell.patternNumber",{number:Number(mI.replace("ribbon-",""))}),vg=computed(()=>cg.value[Cg.value]||""),Xg=ref(!1),Vg=ref(""),Mg=ref(!0),Rg=ref(),Sg=ref(""),Yg=ref(),xg=ref(""),Og=new Set(barcodeType.map(mI=>mI.type)),Kg=computed(()=>Og.has(Vg.value)?"1D":"2D"),Dg=getEditorConfig(),Fg=ref(new EditorCtrl),Tg=ref(!1),Jg=ref(!0),Eg=ref(!0),co=ref(null),da=ref(!1),ma=ref(!1),pa=ref(""),eI=ref(""),Qg=ref({width:0,height:0}),Ca=ref(0),uo=computed(()=>{var mI;return(mI=co.value)==null?void 0:mI.id}),eo=computed(()=>Eg.value&&xg.value!==""&&!!co.value);watch(uo,()=>{eg.value="1"});let no=[],kg,Lg=0,Pg=null;const ua=()=>kg==null?void 0:kg.getPlugin("HistoryPlugin"),ya=mI=>{var uI;mI&&((uI=ua())==null||uI.switchScope(mI))},oI=()=>{setFileDirty(Ig.activeId,!0)},iI=mI=>{if(!mI)return"#FFFFFFFF";if(mI.startsWith("#")){if(mI.length===7||mI.length===9)return mI;if(mI.length===4)return`${expandHexColor(mI)}FF`}const uI=mI.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!uI)return"#FFFFFFFF";const[,$I,NI,MI,KI="1"]=uI,JI=Number(KI)<=1?Number(KI):Number(KI)/255,qI=[$I,NI,MI].map(vI=>Math.max(0,Math.min(255,Number(vI))).toString(16).toUpperCase().padStart(2,"0")).join(""),is=Math.round(JI*255).toString(16).toUpperCase().padStart(2,"0");return`#${qI}${is}`},oa=()=>{var NI,MI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=(mI==null?void 0:mI.config)||(kg==null?void 0:kg.labelConfig),$I=resolveLayerStyle(uI,mI!=null&&mI.layerStyleIndependent?(MI=getActiveLayer(mI))==null?void 0:MI.style:void 0);rg.value=iI($I.backgroundColor),ug.value=$I.backgroundImage||"",dg.value=$I.backgroundImageCover!==!1,bg.value++},ha=async(mI=!1,uI)=>{var vI;const $I=(vI=Ig.getActiveTab)==null?void 0:vI.call(Ig),NI=uI||getActiveLayer($I),MI=resolveLayerStyle(($I==null?void 0:$I.config)||(kg==null?void 0:kg.labelConfig),$I!=null&&$I.layerStyleIndependent?NI==null?void 0:NI.style:void 0),KI=iI(mI?rg.value:MI.backgroundColor),JI=mI?ug.value||"":MI.backgroundImage||"",qI=mI?dg.value:MI.backgroundImageCover;mI&&($I!=null&&$I.config)&&($I.layerStyleIndependent&&NI?NI.style=diffLayerStyle($I.config,{...MI,backgroundColor:KI,backgroundImage:JI,backgroundImageCover:qI}):($I.config.backgroundColor=KI,$I.config.backgroundImage=JI,$I.config.backgroundImageCover=qI,kg!=null&&kg.labelConfig&&(kg.labelConfig.backgroundColor=KI,kg.labelConfig.backgroundImage=JI,kg.labelConfig.backgroundImageCover=qI)));const is=kg==null?void 0:kg.getPlugin("WorkspacePlugin");await(is==null?void 0:is.setBackground({color:KI,image:JI,cover:qI})),mI&&(ag.value={},oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0}),xa(!0))},nI=async(mI,uI)=>{mI.length===7?rg.value=addAlphaToHex(mI,uI):mI.length===4&&(rg.value=addAlphaToHex(expandHexColor(mI),uI)),await ha(!0)},cI=()=>{mg.value=!0},dI=async mI=>{ug.value=mI||"",await ha(!0)},pI=async mI=>{var uI;dg.value=((uI=mI.target)==null?void 0:uI.checked)===!0,await ha(!0)},Ug=async()=>{ug.value="",await ha(!0)},La=mI=>{if(!mI)return!1;try{const uI=JSON.parse(mI);return Array.isArray(uI.objects)?uI.objects.some($I=>$I.id!=="workspace"):!1}catch{return!1}},aI=(mI,uI)=>{var $I,NI;return((NI=($I=Ig.getActiveTab)==null?void 0:$I.call(Ig))==null?void 0:NI.layerStyleIndependent)===!0||uI===0||La(mI.canvas)},CI=(mI,uI)=>{const $I=uI??(mI?ag.value[mI.id]:"");return og.value=$I?[$I]:[],ng.value=$I||"",!0},fa=(mI,uI=!1)=>{var MI;if(Bg.value)return CI(getActiveLayer((MI=Ig.getActiveTab)==null?void 0:MI.call(Ig)));const $I=mI.filter(aI),NI=$I.map(KI=>ag.value[KI.id]).filter(Boolean);return!NI.length||!uI&&NI.length!==$I.length?!1:(og.value=NI,ng.value=NI[NI.length-1]||"",!0)},zg=(mI,uI,$I=!1)=>{var vI,TI,us;const NI=Math.max(0,mI.findIndex(hs=>hs.id===uI.id)),MI=!!ag.value[((vI=mI[0])==null?void 0:vI.id)||""];if(!Bg.value&&NI>0&&!La(uI.canvas)){const hs={...ag.value};return delete hs[uI.id],ag.value=hs,""}const KI=$I&&!MI,JI=!((us=(TI=Ig.getActiveTab)==null?void 0:TI.call(Ig))!=null&&us.layerStyleIndependent)&&!Bg.value&&NI>0&&!KI,qI=qg(JI),is=KI&&NI>0;return qI&&!is&&(ag.value={...ag.value,[uI.id]:qI}),qI},Hg=()=>{ma.value=!0,pa.value="";let mI=kg==null?void 0:kg.getActiveObject();if(pa.value=mI&&mI.getSrc?mI.getSrc():"",mI){let uI=mI._element;Qg.value={width:uI.width,height:uI.height}}},ca=mI=>{if(!kg)return;let uI=kg==null?void 0:kg.getActiveObject();sa(kg,uI,mI)},tI=()=>{if(!kg)return;pa.value="",da.value=!0,Sg.value=gg("editor.shell.replaceImage");let mI=kg==null?void 0:kg.getActiveObject();pa.value=mI&&mI.getSrc?mI.getSrc():"",eI.value=new Date().valueOf()+""},jg=mI=>{if(!kg)return;let uI=kg==null?void 0:kg.getActiveObject();sa(kg,uI,mI||"")},lo=({editorCtrl:mI,object:uI})=>{console.log("doubleClick",uI,mI);let $I=(uI==null?void 0:uI.increaseCount)||(uI==null?void 0:uI.increaseDate)&&(uI==null?void 0:uI.barcodeDateFormatType)||!1,NI=!0;if(uI.addCombObject){let MI=uI.connectObjIds;NI=!MI||MI.length===1&&!MI[0].id||MI.length===0}Mg.value=!$I&&NI,Yg.value&&Yg.value.stop(),uI.type==="barcode"?(Vg.value=uI==null?void 0:uI.barcodeOptions.bcid,Sg.value=Mg.value?gg("editor.shell.enterBarcode"):gg("editor.shell.viewBarcode"),Rg.value=mI.bcConfig.content,Yg.value=watch(Xg,MI=>{!MI&&Rg.value&&(mI.bcConfig.content=Rg.value)},{immediate:!1}),Xg.value=!0):uI.type==="barcode2d"&&(((uI==null?void 0:uI.barcode2dOptions.bcid)==="LPCode"||(uI==null?void 0:uI.barcode2dOptions.bcid)==="LPMixQrCode")&&(uI==null||uI.clearErrorLpCodeMap()),Vg.value=uI==null?void 0:uI.barcode2dOptions.bcid,Sg.value=Mg.value?gg("editor.shell.enterQrCode"):gg("editor.shell.viewQrCode"),Rg.value=mI.bc2dConfig.content,Yg.value=watch(Xg,MI=>{!MI&&Rg.value&&(mI.bc2dConfig.content=Rg.value)},{immediate:!1}),Xg.value=!0)},sa=async(mI,uI,$I)=>{if(!$I)return;let NI=uI;NI.setCoords(),NI.set("prevCoordsPoints",NI.aCoords);const MI={left:NI.left,top:NI.top,width:NI.getScaledWidth(),height:NI.getScaledHeight(),angle:NI.angle,imgScaleType:NI.imgScaleType,scaleX:1,scaleY:1,flipX:NI.flipX,flipY:NI.flipY,setGrayFilter:NI.setGrayFilter||!1};let KI=mI==null?void 0:mI.getCanvas();KI.discardActiveObject();try{NI.visible=!1,NI.set("noSetOtherPrevCoordsPoints",!0),await NI.setSrc($I,{crossOrigin:"anonymous"});let JI=NI._element,qI=JI.width/JI.height,is=NI.imgScaleType,vI=qI>1?"3":(qI<1,"2");["2","3"].includes(is)&&(is=vI),NI.set({...MI,isScaleOtherSidedys:["2","3"].includes(is),imgScaleType:is}),NI.visible=!0,KI.setActiveObject(NI),KI==null||KI.requestRenderAll(),setTimeout(()=>{NI.dirty=!0,NI.set("noSetOtherPrevCoordsPoints",!1),NI.refreshAlignCoords(),KI==null||KI.fire("custom:object:history",{target:NI,action:"history:update"})},100)}catch{NI.set("noSetOtherPrevCoordsPoints",!1)}},qg=(mI=!1,uI=Cg.value)=>{if(!kg)return;kg.ribbonBorderPattern=uI;const $I=kg.toDataUrl({exclude:mI?["workspace"]:[],ribbonBorderPattern:uI,isJudgeGrid:!0});return typeof $I=="string"?$I:($I==null?void 0:$I.toDataURL("image/png",1))||""},ga=async mI=>{var KI,JI;if(!kg)return;const uI=(KI=Ig.getActiveTab)==null?void 0:KI.call(Ig),$I=resolveLayerStyle(uI==null?void 0:uI.config,uI!=null&&uI.layerStyleIndependent?mI.style:void 0),NI=((JI=$I.ribbonBorder)==null?void 0:JI.pattern)||"none",MI=$I.ribbonBorder||await createRibbonBorderTextureData(NI);return kg.ribbonBorderPattern=NI,!(uI!=null&&uI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=MI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(MI)),await ha(!1,mI),NI},va=mI=>new Promise(uI=>{if(!kg){uI();return}if(mI.canvas){kg.fromTemplateJson(mI.canvas,()=>{emitter.emit("refresh-editor",kg),setTimeout(uI,30)});return}kg.getObjects().filter($I=>$I.id!=="workspace").forEach($I=>kg==null?void 0:kg.removeObject($I)),kg.getCanvas().requestRenderAll(),uI()}),sI=async(mI,uI,$I)=>{var MI;if(!kg)return;await new Promise(KI=>{kg==null||kg.fromTemplateJson(uI,()=>{emitter.emit("refresh-editor",kg),setTimeout(KI,30)})});const NI=(MI=Ig.getActiveTab)==null?void 0:MI.call(Ig);NI&&setTabActiveLayer(NI,mI),await II(),await ha(!1,mI),$I&&(kg.getCanvas().setViewportTransform($I),kg.getCanvas().requestRenderAll())},_g=createLatestAsyncTaskRunner(async(mI=!1)=>{var hs,dl;if(!kg)return;const uI=++Lg,$I=(hs=Ig.getActiveTab)==null?void 0:hs.call(Ig),NI=$I?normalizeLayers($I):[],MI=getActiveLayer($I);if(!state$1.isMultiLayerEnabled||!$I||!MI||NI.length<=1){const EI=qg()||"";ng.value=EI,og.value=EI?[EI]:[];return}if(!isLayerCanvasStable())return;MI.canvas=attachLayerIdToCanvas(kg.toJSON(),MI.id);const KI=zg(NI,MI,mI);if(Bg.value){CI(MI,KI);return}if(fa(NI))return;const JI=kg.getCanvas().elements.container,qI=(dl=kg.getCanvas().viewportTransform)==null?void 0:dl.slice(),is=JI.style.visibility,vI=ua(),TI=(vI==null?void 0:vI.pause)||!1;vI&&(vI.pause=!0),JI.style.visibility="hidden",clearTimeout(Pg),setPreviewRendering(!0);const us=[];try{for(const[EI,ul]of NI.entries()){if(uI!==Lg)return;if(!aI(ul,EI)){const nl={...ag.value};delete nl[ul.id],ag.value=nl;continue}await va(ul);const Al=await ga(ul),$l=qg(EI>0&&$I.layerStyleIndependent!==!0,Al);$l&&(us.push($l),ag.value={...ag.value,[ul.id]:$l})}uI===Lg&&(og.value=us,ng.value=us[us.length-1]||"")}finally{try{await sI(MI,MI.canvas||kg.toJSON(),qI),ya(MI.id)}finally{vI&&(vI.pause=TI),JI.style.visibility=is,setPreviewRendering(!1)}}}),xa=(mI=!1)=>_g(mI),lI=async()=>{if(Object.keys(cg.value).length===Ag.length)return;const mI=await Promise.all(Ag.map(async uI=>{const $I=await createRibbonBorderPreview(uI.value);return[uI.value,$I]}));cg.value=Object.fromEntries(mI)},gI=async()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=await createRibbonBorderTextureData(Cg.value);if(mI)if(mI.layerStyleIndependent){const MI=getActiveLayer(mI);MI&&(MI.style=diffLayerStyle(mI.config,{...resolveLayerStyle(mI.config,MI.style),ribbonBorder:uI}))}else mI.ribbonBorderPattern=Cg.value,mI.config.ribbonBorder=uI;const $I=await createRibbonBorderPreview(Cg.value);cg.value={...cg.value,[Cg.value]:$I},kg&&(kg.ribbonBorderPattern=Cg.value,!(mI!=null&&mI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=uI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(uI)),kg.getCanvas().requestRenderAll(),kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})),oI(),xa(!0)},II=async()=>{var $I,NI,MI;const mI=($I=Ig.getActiveTab)==null?void 0:$I.call(Ig),uI=resolveLayerStyle(mI==null?void 0:mI.config,mI!=null&&mI.layerStyleIndependent?(NI=getActiveLayer(mI))==null?void 0:NI.style:void 0);if(Cg.value=((MI=uI.ribbonBorder)==null?void 0:MI.pattern)||(mI==null?void 0:mI.ribbonBorderPattern)||(kg==null?void 0:kg.ribbonBorderPattern)||"none",!cg.value[Cg.value]){const KI=await createRibbonBorderPreview(Cg.value);cg.value={...cg.value,[Cg.value]:KI}}if(kg){kg.ribbonBorderPattern=Cg.value;try{const KI=await createRibbonBorderTextureData(Cg.value);mI&&!mI.layerStyleIndependent&&(mI.ribbonBorderPattern=Cg.value,mI.config.ribbonBorder=KI),!(mI!=null&&mI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=KI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(KI))}catch(KI){console.log("loadRibbonBorderTextureImages error",KI)}kg.getCanvas().requestRenderAll()}},AI=async()=>{await lI(),lg.value=!0},rI=async mI=>{Cg.value=mI,lg.value=!1,await gI()},bI=()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=getActiveLayer(mI);if(!mI||!uI||!kg)return;uI.canvas=attachLayerIdToCanvas(kg.toJSON(),uI.id);const $I=normalizeLayers(mI);zg($I,uI),fa($I,!0),setTabActiveLayer(mI,uI)},hI=mI=>{var is,vI;const uI=(is=Ig.getActiveTab)==null?void 0:is.call(Ig);if(!uI||!kg)return Promise.resolve();const $I=kg.getCanvas().elements.container,NI=(vI=kg.getCanvas().viewportTransform)==null?void 0:vI.slice(),MI=ua(),KI=(MI==null?void 0:MI.pause)||!1;MI&&(MI.pause=!0),$I.style.visibility="hidden";const JI=()=>{!NI||!kg||(kg.getCanvas().setViewportTransform(NI),kg.getCanvas().requestRenderAll())},qI=()=>new Promise(TI=>{setTimeout(async()=>{try{oa(),await II(),await ha(!1),JI(),ya(mI.id)}finally{MI&&(MI.pause=KI),$I.style.visibility=""}emitter.emit("refresh-object-list");const hs=normalizeLayers(uI);zg(hs,mI),fa(hs,!0),TI()},30)});return setTabActiveLayer(uI,mI),mI.canvas?new Promise(TI=>{kg.fromTemplateJson(mI.canvas,async()=>{kg==null||kg.getCanvas().discardActiveObject(),emitter.emit("refresh-editor",kg),Fg.value.init(kg),Fg.value.bind(),await qI(),TI()})}):(kg.getObjects().filter(TI=>TI.id!=="workspace").forEach(TI=>kg==null?void 0:kg.removeObject(TI)),qI())},WI=async mI=>{var NI;const uI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!uI||uI.activeLayerId===mI)return;bI();const $I=normalizeLayers(uI).find(MI=>MI.id===mI);if($I){setSwitchingLayer(!0);try{await hI($I)}finally{setSwitchingLayer(!1)}}},wI=async()=>{var NI;if(Bg.value)return;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!mI)return;if(normalizeLayers(mI).length>=yg.value){Message.error(gg("editor.shell.maxLayers",{count:yg.value}));return}bI();const $I=appendLocalizedLayer(mI,mI.config,gg,oI);setSwitchingLayer(!0);try{await hI($I)}finally{setSwitchingLayer(!1)}kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})},fI=async mI=>{var qI,is;if(Bg.value)return;const uI=(qI=Ig.getActiveTab)==null?void 0:qI.call(Ig);if(!uI||Gg.value.length<=1)return;const $I=normalizeLayers(uI),NI=$I.findIndex(vI=>vI.id===mI);if(NI<0)return;const MI=uI.activeLayerId===mI;MI||bI();const KI=$I.filter(vI=>vI.id!==mI);uI.layers=KI;const JI={...ag.value};if(delete JI[mI],ag.value=JI,(is=ua())==null||is.clearScope(mI),MI){const vI=KI[Math.max(0,NI-1)]||KI[0];setSwitchingLayer(!0);try{await hI(vI)}finally{setSwitchingLayer(!1)}}else{const vI=getActiveLayer(uI);vI&&setTabActiveLayer(uI,vI),await xa(!1)}oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})},GI=mI=>{var NI;if(Bg.value)return;const uI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!uI||Gg.value.length<=1)return;const $I=normalizeLayers(uI).find(MI=>MI.id===mI);$I&&showAntModal({title:gg("editor.shell.deleteLayer"),content:gg("editor.shell.deleteLayerConfirm",{name:$I.name}),okText:gg("common.actions.delete"),okType:"danger",cancelText:gg("common.actions.cancel"),centered:!0,onOk:()=>fI(mI)})},VI=mI=>{Bg.value||(pg.value=mI.id,fg.value=mI.name,hg.value=!0,nextTick(()=>{var uI,$I;($I=(uI=wg.value)==null?void 0:uI.focus)==null||$I.call(uI)}))},YI=()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!mI){kI();return}const uI=normalizeLayers(mI).find(MI=>MI.id===pg.value),$I=fg.value.trim();if(!$I){Message.error(gg("editor.shell.layerNamePlaceholder"));return}uI&&$I&&uI.name!==$I&&(uI.name=$I,oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})),kI()},kI=()=>{hg.value=!1,pg.value="",fg.value=""},jI=()=>{var mI;if(kg&&shouldSyncSelectionPreview(sg.isPrinting,!!kg.getCanvas().getActiveObject())){if(state$1.isMultiLayerEnabled){const uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig),$I=uI?normalizeLayers(uI):[],NI=getActiveLayer(uI);NI&&(NI.canvas=attachLayerIdToCanvas(kg.toJSON(),NI.id),zg($I,NI)),fa($I,!0);return}xa(!0)}},FI=mI=>{if(clearTimeout(Pg),!mI.object){if(kg&&!kg._isShown)return;kg&&!sg.isPrinting&&(Pg=setTimeout(()=>{kg!=null&&kg.getCanvas().getActiveObject()||(Jg.value=!0,xg.value="",Tg.value=!Tg.value,Eg.value=!1,co.value=null,Ca.value=Date.now(),nextTick(jI))},80));return}Jg.value=mI.selectedType!=="line",xg.value=mI.selectedType,Tg.value=!Tg.value,Eg.value=!mI.object.locked,co.value=mI.object,Ca.value=Date.now(),Eg.value&&(ng.value="",og.value=[]),kg&&kg._isShown},xI=mI=>{const uI=mI.target;console.log("objectLockedState",uI,uI.locked),uI&&(Eg.value=!uI.locked)};let UI=null,XI=ref(0);const PI=mI=>{var uI;if(console.log("right update",mI),Fg.value=mI.editorCtrl,kg!==mI.editor){if(kg&&kg.off("custom:object:locked",xI),kg=mI.editor,kg){kg.on("custom:object:locked",xI),oa(),ha(!1),II();const $I=getActiveLayer((uI=Ig.getActiveTab)==null?void 0:uI.call(Ig));ya($I==null?void 0:$I.id)}kg&&(ng.value="",og.value=[],ag.value={},XI.value=Date.now(),Ig.$state.activeSheet=[],Ig.$state.activeSheetTableHeader={},Ig.$state.activeSheetTableData={},Ig.tableDataIndexMap[Ig.activeId]=0,clearTimeout(UI),console.log("eidtorSwitch====="),UI=setTimeout(()=>{cs(),xa()},300))}},HI=mI=>{no=mI;let uI=0,$I=[];no.forEach(NI=>{let MI=NI.databaseSheet,KI=NI.databaseColumn,JI=Ig.$state.sheetMaxLenMap[MI]||0;uI=Math.max(uI,JI),uI>ig&&(uI=ig),NI.databaseMixConcat&&Object.values(NI.databaseMixConcat).forEach(is=>{let vI=Ig.$state.sheetMaxLenMap[is.sheet]||0;uI=Math.max(uI,vI),uI>ig&&(uI=ig)}),(MI&&KI||NI.databaseMixConcat)&&$I.push(NI)}),Ig.$state.maxShowLengthMap[Ig.$state.activeId]=uI||0,emitter.emit("has-database-objects",$I)},gl=computed(()=>Ig.tableDataIndexMap[Ig.activeId]||0),cs=async()=>{if(!Fg.value)return;let mI=[];mI=Fg.value.getConnectDatabaseObjects2(),no=mI,console.log("databaseIndex=====activeId",no),emitter.emit("has-database-objects",no);let uI=0;for(let $I of no){if($I.databaseMixConcat){let NI=Object.values($I.databaseMixConcat);for(let MI of NI){await toGetDatabaseTable({sheet:MI.sheet,start:"0",count:ig});let KI=Ig.$state.sheetMaxLenMap[MI.sheet]||0;uI=Math.max(uI,KI),uI>ig&&(uI=ig)}continue}if($I.databaseSheet){await toGetDatabaseTable({sheet:$I.databaseSheet,start:"0",count:ig});let NI=Ig.$state.sheetMaxLenMap[$I.databaseSheet]||0;uI=Math.max(uI,NI),uI>ig&&(uI=ig)}}Ig.$state.maxShowLengthMap[Ig.$state.activeId]=uI||0,il(0)};function il(mI){let uI=mI<0?0:mI;no.forEach($I=>{let NI=Ig.activeSheetTableData;if($I.type==="barcode2d"&&$I.databaseMixConcat){let JI=$I.barcode2dOptions,qI=[],is=$I.barcode2dOptions.bcid,vI=mixMultCode[is],TI=Object.entries($I.databaseMixConcat);TI.length<vI.length&&(qI=new Array(vI.length).fill(""));for(let[us,hs]of TI){let dl=hs.sheet,EI=hs.column,ul=NI[dl]&&NI[dl][uI]&&NI[dl][uI][EI]||"";qI[us]=ul}$I.setBarcode2DOption({bcid:JI.bcid,text:qI.join("|&&&|")});return}let MI=$I.databaseSheet,KI=$I.databaseColumn;if(NI[MI]){let JI=NI[MI][uI]&&NI[MI][uI][KI]||"",qI=getObjectType($I);if(qI==="text")$I.set("text",JI),$I.tiggerHandleConcatBarcode2d();else if(qI==="barcode2d"){let is=$I.barcode2dOptions;$I.setBarcode2DOption({bcid:is.bcid,text:JI})}else if(qI==="barcode"){let is=$I.barcodeOptions;$I.setBarcodeOption({bcid:is.bcid,text:JI})}}}),no.length&&Fg&&Fg.value.toUpdateCanvas()}let ol=null;watch([gl],([mI])=>{clearTimeout(ol),ol=setTimeout(()=>{Fg.value&&(no=Fg.value.getConnectDatabaseObjects2()),il(mI)},30)});let pl=null;function sl(){Eg.value=!1}const wl=async({done:mI})=>{try{oa(),await II(),await ha(!1),ag.value={},await xa()}finally{mI()}};return emitter.on("editor-switch",PI),onMounted(()=>{emitter.on("dbclick-object",lo),emitter.on("selected-object",FI),emitter.on("refresh-select-obj",mI=>{Eg.value=!mI.locked,co.value=mI,Ca.value=Date.now()}),emitter.on("editor-empty",sl),emitter.on("layer-style-independent-change",wl),emitter.on("refresh-preview",()=>{xa()}),emitter.on("refresh-database",async()=>{Ig.$state.activeSheet=[],Ig.tableDataIndexMap[Ig.activeId]=0,Ig.$state.activeSheetTableHeader={},Ig.$state.activeSheetTableData={},await disconnDatabase("justDisconnect"),await toGetDatabaseSheetList(!0),await cs(),setTimeout(()=>{Message.success(gg("editor.shell.updateSuccess"))},500)}),emitter.on("switch-database",async()=>{clearTimeout(pl),pl=setTimeout(async()=>{await toGetDatabaseSheetList(),await cs()},100)})}),onUnmounted(()=>{clearTimeout(Pg),kg&&kg.off("custom:object:locked",xI),emitter.off("editor-empty",sl),emitter.off("layer-style-independent-change",wl),emitter.off("switch-database"),emitter.off("refresh-database"),emitter.off("editor-switch",PI),emitter.off("dbclick-object",lo),emitter.off("selected-object",FI),emitter.off("refresh-select-obj"),Yg.value!=null&&Yg.value.stop(),emitter.off("refresh-preview")}),(mI,uI)=>{var qI,is;const $I=__unplugin_components_0$5,NI=Tabs,MI=Checkbox,KI=Modal$1,JI=Input;return openBlock(),createElementBlock(Fragment,null,[eo.value?(openBlock(),createElementBlock("div",_hoisted_1$4,[createVNode(NI,{"active-key":eg.value,"onUpdate:activeKey":uI[12]||(uI[12]=vI=>eg.value=vI),size:"small","tab-position":"left",type:"card"},{default:withCtx(()=>[createVNode($I,{key:"1",tab:unref(gg)("editor.shell.settings")},{default:withCtx(()=>[xg.value!==""?(openBlock(),createBlock(resolveDynamicComponent(PositionConfig),{selectedType:xg.value,key:uo.value,data:Fg.value.baseConfig,"onUpdate:data":uI[0]||(uI[0]=vI=>Fg.value.baseConfig=vI),editorCtrl:Fg.value,selectObj:co.value},null,40,["selectedType","data","editorCtrl","selectObj"])):createCommentVNode("",!0),xg.value==="text"||xg.value==="barcode"||xg.value==="barcode2d"||xg.value==="counter"?(openBlock(),createBlock(resolveDynamicComponent(emConfigDatabase),{key:unref(XI)+""+uo.value,data:Fg.value.databaseConfig,"onUpdate:data":uI[1]||(uI[1]=vI=>Fg.value.databaseConfig=vI),selectedType:xg.value,selectObj:co.value,editorCtrl:Fg.value,getObjectList:HI,databaseIndex:gl.value},null,40,["data","selectedType","selectObj","editorCtrl","databaseIndex"])):createCommentVNode("",!0),xg.value==="table"?(openBlock(),createBlock(resolveDynamicComponent(TableConfig),{key:2,data:Fg.value.tableConfig,"onUpdate:data":uI[2]||(uI[2]=vI=>Fg.value.tableConfig=vI)},null,40,["data"])):createCommentVNode("",!0),xg.value==="text"||xg.value==="textname"?(openBlock(),createBlock(resolveDynamicComponent(TextConfig),{key:unref(XI)+""+uo.value,data:Fg.value.textConfig,"onUpdate:data":uI[3]||(uI[3]=vI=>Fg.value.textConfig=vI),editorCtrl:Fg.value,selectObj:co.value,selectedType:xg.value},null,40,["data","editorCtrl","selectObj","selectedType"])):createCommentVNode("",!0),xg.value==="barcode"?(openBlock(),createBlock(resolveDynamicComponent(BCConfig),{key:unref(XI)+""+uo.value,data:Fg.value.bcConfig,"onUpdate:data":uI[4]||(uI[4]=vI=>Fg.value.bcConfig=vI),editorCtrl:Fg.value},null,40,["data","editorCtrl"])):createCommentVNode("",!0),xg.value==="barcode2d"?(openBlock(),createBlock(resolveDynamicComponent(BC2DConfig),{selectObj:co.value,editorCtrl:Fg.value,key:unref(XI)+""+uo.value,data:Fg.value.bc2dConfig,"onUpdate:data":uI[5]||(uI[5]=vI=>Fg.value.bc2dConfig=vI)},null,40,["selectObj","editorCtrl","data"])):createCommentVNode("",!0),xg.value==="rect"?(openBlock(),createBlock(resolveDynamicComponent(RectConfig),{key:6,data:Fg.value.rectConfig,"onUpdate:data":uI[6]||(uI[6]=vI=>Fg.value.rectConfig=vI),editorCtrl:Fg.value},null,40,["data","editorCtrl"])):createCommentVNode("",!0),xg.value==="counter"?(openBlock(),createBlock(resolveDynamicComponent(CounterConfig),{key:unref(XI)+""+uo.value,data:Fg.value.counterConfig,"onUpdate:data":uI[7]||(uI[7]=vI=>Fg.value.counterConfig=vI),selectObj:co.value},null,40,["data","selectObj"])):createCommentVNode("",!0),xg.value==="image"?(openBlock(),createBlock(resolveDynamicComponent(imageConfig),{key:unref(XI)+""+uo.value,editorCtrl:Fg.value,data:Fg.value.imageConfig,"onUpdate:data":uI[8]||(uI[8]=vI=>Fg.value.imageConfig=vI),onToCut:Hg,onToSwitch:tI},null,40,["editorCtrl","data"])):createCommentVNode("",!0),xg.value==="group"||xg.value==="activeselection"?(openBlock(),createBlock(resolveDynamicComponent(textGroupConfig),{selectObj:co.value,editorCtrl:Fg.value,key:unref(XI)+""+uo.value+Ca.value},null,8,["selectObj","editorCtrl"])):createCommentVNode("",!0),unref(Dg).showLaser&&xg.value!=="group"&&xg.value!==""?(openBlock(),createBlock(LaserConfig,{key:10,editorCtrl:Fg.value,selectObj:co.value},null,8,["editorCtrl","selectObj"])):createCommentVNode("",!0)]),_:1},8,["tab"]),createVNode($I,{key:"2",tab:unref(gg)("editor.shell.fillStroke")},{default:withCtx(()=>[xg.value!=="group"&&xg.value!==""?(openBlock(),createBlock(resolveDynamicComponent(FillAndBorder),{key:unref(XI)+""+uo.value,selectedType:xg.value,data:Fg.value.baseConfig,"onUpdate:data":uI[9]||(uI[9]=vI=>Fg.value.baseConfig=vI),"update-flag":Tg.value,"onUpdate:updateFlag":uI[10]||(uI[10]=vI=>Tg.value=vI),"show-fill-config":Jg.value,"onUpdate:showFillConfig":uI[11]||(uI[11]=vI=>Jg.value=vI),selectObj:co.value},null,40,["selectedType","data","update-flag","show-fill-config","selectObj"])):createCommentVNode("",!0)]),_:1},8,["tab"])]),_:1},8,["active-key"])])):createCommentVNode("",!0),eo.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_2$1,[createVNode(PreviewPanel,{images:og.value},null,8,["images"]),createBaseVNode("div",_hoisted_3$1,[createBaseVNode("div",_hoisted_4$1,[createBaseVNode("div",_hoisted_5$1,[createBaseVNode("span",_hoisted_6$1,toDisplayString$1(unref(gg)("editor.shell.backgroundColor")),1),(openBlock(),createBlock(_sfc_main$s,{key:bg.value,class:"background-color","init-color":rg.value,onChangeColor:nI},null,8,["init-color"]))]),createBaseVNode("div",_hoisted_7,[createBaseVNode("span",_hoisted_8,toDisplayString$1(unref(gg)("editor.shell.backgroundImage")),1),createBaseVNode("div",_hoisted_9,[createBaseVNode("button",{class:"background-action",type:"button",onClick:cI},toDisplayString$1(ug.value?unref(gg)("editor.shell.replace"):unref(gg)("common.actions.select")),1),ug.value?(openBlock(),createElementBlock("button",{key:0,class:"background-action danger",type:"button",onClick:Ug},toDisplayString$1(unref(gg)("editor.shell.clear")),1)):createCommentVNode("",!0),ug.value?(openBlock(),createBlock(MI,{key:1,class:"background-cover-checkbox",checked:dg.value,onChange:pI},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("editor.shell.cover")),1)]),_:1},8,["checked"])):createCommentVNode("",!0)])]),ug.value?(openBlock(),createElementBlock("div",_hoisted_10,[createBaseVNode("img",{src:ug.value,alt:""},null,8,_hoisted_11)])):createCommentVNode("",!0)]),yg.value>1&&((is=(qI=unref(Ig).activeTab)==null?void 0:qI.config)==null?void 0:is.pageShape)!=="Ellipse"?(openBlock(),createElementBlock("div",_hoisted_12,[createBaseVNode("div",_hoisted_13,toDisplayString$1(unref(gg)("editor.shell.borderPattern")),1),createBaseVNode("button",{class:"ribbon-current",type:"button",onClick:AI},[vg.value?(openBlock(),createElementBlock("img",{key:1,class:"ribbon-current-preview",src:vg.value,alt:""},null,8,_hoisted_15)):(openBlock(),createElementBlock("span",_hoisted_14)),createBaseVNode("span",null,toDisplayString$1($g.value),1)]),createVNode(KI,{open:lg.value,"onUpdate:open":uI[13]||(uI[13]=vI=>lg.value=vI),title:unref(gg)("editor.shell.borderPattern"),width:"800px",footer:null,"destroy-on-close":!1},{default:withCtx(()=>[createBaseVNode("div",_hoisted_16,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(Ag),vI=>(openBlock(),createElementBlock("button",{key:vI.value,class:normalizeClass(["ribbon-modal-item",{active:vI.value===Cg.value}]),type:"button",onClick:TI=>rI(vI.value)},[createBaseVNode("img",{class:"ribbon-modal-preview",src:cg.value[vI.value],alt:""},null,8,_hoisted_18),createBaseVNode("span",null,toDisplayString$1(Ng(vI.value)),1)],10,_hoisted_17))),128))])]),_:1},8,["open","title"])])):createCommentVNode("",!0),Wg.value?(openBlock(),createElementBlock("div",_hoisted_19,[createBaseVNode("div",_hoisted_20,[createBaseVNode("span",null,toDisplayString$1(unref(gg)("editor.shell.layers")),1),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("button",{key:0,type:"button",class:normalizeClass(["layer-add",{disabled:Gg.value.length>=yg.value}]),disabled:Gg.value.length>=yg.value,onClick:wI}," + ",10,_hoisted_21))]),createBaseVNode("div",_hoisted_22,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gg.value,vI=>(openBlock(),createElementBlock("button",{key:vI.id,class:normalizeClass(["layer-item",{active:vI.id===Zg.value}]),type:"button",onClick:TI=>WI(vI.id)},[createBaseVNode("span",{class:"layer-name",onDblclick:withModifiers(TI=>VI(vI),["stop"])},toDisplayString$1(vI.name),41,_hoisted_24),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("span",{key:0,class:"layer-edit",onClick:withModifiers(TI=>VI(vI),["stop"])},toDisplayString$1(unref(gg)("editor.shell.rename")),9,_hoisted_25)),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(["layer-delete",{disabled:Gg.value.length<=1}]),onClick:withModifiers(TI=>GI(vI.id),["stop"])},toDisplayString$1(unref(gg)("common.actions.delete")),11,_hoisted_26))],10,_hoisted_23))),128))])])):createCommentVNode("",!0)])])),createVNode(TextAreaInputModal,{open:Xg.value,"onUpdate:open":uI[14]||(uI[14]=vI=>Xg.value=vI),input:Rg.value,"onUpdate:input":uI[15]||(uI[15]=vI=>Rg.value=vI),title:Sg.value,"onUpdate:title":uI[16]||(uI[16]=vI=>Sg.value=vI),bcid:Vg.value,isCanEdit:Mg.value,barcodeDimension:Kg.value},null,8,["open","input","title","bcid","isCanEdit","barcodeDimension"]),(openBlock(),createBlock(imageInputModal,{key:eI.value,open:da.value,"onUpdate:open":uI[17]||(uI[17]=vI=>da.value=vI),title:Sg.value,"onUpdate:title":uI[18]||(uI[18]=vI=>Sg.value=vI),src:pa.value,onResult:jg},null,8,["open","title","src"])),(openBlock(),createBlock(imageInputModal,{open:mg.value,"onUpdate:open":uI[19]||(uI[19]=vI=>mg.value=vI),src:ug.value,title:unref(gg)("editor.shell.backgroundImage"),key:mg.value+"",onResult:dI},null,8,["open","src","title"])),(openBlock(),createBlock(cutImgModal,{open:ma.value,"onUpdate:open":uI[20]||(uI[20]=vI=>ma.value=vI),key:eI.value,imgInfo:Qg.value,img:pa.value,onGetData:ca},null,8,["open","imgInfo","img"])),createVNode(KI,{open:hg.value,"onUpdate:open":uI[22]||(uI[22]=vI=>hg.value=vI),title:unref(gg)("editor.shell.renameLayer"),"ok-text":unref(gg)("common.actions.confirm"),"cancel-text":unref(gg)("common.actions.cancel"),centered:"",onOk:YI,onCancel:kI},{default:withCtx(()=>[createVNode(JI,{ref_key:"renameLayerInputRef",ref:wg,value:fg.value,"onUpdate:value":uI[21]||(uI[21]=vI=>fg.value=vI),placeholder:unref(gg)("editor.shell.layerNamePlaceholder"),maxlength:30,"allow-clear":"",onPressEnter:YI},null,8,["value","placeholder"])]),_:1},8,["open","title","ok-text","cancel-text"])],64)}}}),RightSideBar=_export_sfc(_sfc_main$5,[["__scopeId","data-v-998607b0"]]),ControlMiddleVerticalImg="data:image/svg+xml,%3csvg%20width='12'%20height='24'%20viewBox='0%200%2012%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3crect%20x='4'%20y='4'%20width='4'%20height='16'%20rx='2'%20fill='white'/%3e%3crect%20x='4.25'%20y='4.25'%20width='3.5'%20height='15.5'%20rx='1.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='12'%20height='24'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlMiddleHorizontalImg="data:image/svg+xml,%3csvg%20width='24'%20height='12'%20viewBox='0%200%2024%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3crect%20x='20'%20y='4'%20width='4'%20height='16'%20rx='2'%20transform='rotate(90%2020%204)'%20fill='white'/%3e%3crect%20x='19.75'%20y='4.25'%20width='3.5'%20height='15.5'%20rx='1.75'%20transform='rotate(90%2019.75%204.25)'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='24'%20height='12'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlEdgeImage="data:image/svg+xml,%3csvg%20width='19'%20height='18'%20viewBox='0%200%2019%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3ccircle%20cx='9.99609'%20cy='9'%20r='5'%20fill='white'/%3e%3ccircle%20cx='9.99609'%20cy='9'%20r='4.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0.996094'%20y='0'%20width='18'%20height='18'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlRotateImage="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3ccircle%20cx='9'%20cy='9'%20r='5'%20fill='white'/%3e%3ccircle%20cx='9'%20cy='9'%20r='4.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cpath%20d='M10.8047%2011.1242L9.49934%2011.1242L9.49934%209.81885'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.94856%206.72607L8.25391%206.72607L8.25391%208.03142'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.69517%206.92267C10.007%207.03301%2010.2858%207.22054%2010.5055%207.46776C10.7252%207.71497%2010.8787%208.01382%2010.9517%208.33642C11.0247%208.65902%2011.0148%208.99485%2010.9229%209.31258C10.831%209.63031%2010.6601%209.91958%2010.4262%2010.1534L9.49701%2011.0421M8.25792%206.72607L7.30937%207.73554C7.07543%207.96936%206.90454%208.25863%206.81264%208.57636C6.72073%208.89408%206.71081%209.22992%206.78381%209.55251C6.8568%209.87511%207.01032%2010.174%207.23005%2010.4212C7.44978%2010.6684%207.72855%2010.8559%208.04036%2010.9663'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='18'%20height='18'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",iconRfid="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='35'%20height='35'%20viewBox='0%200%2035%2035'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_25_0440'%3e%3crect%20x='0'%20y='0'%20width='35'%20height='35'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_25_0440)'%3e%3cg%3e%3cg%3e%3cg%20style='opacity:0;'%3e%3cg%3e%3crect%20x='5'%20y='5'%20width='25'%20height='25'%20rx='0'%20fill='%234D7B36'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M23.940601,13.1393909C22.123299,11.2938004,19.710701,10.2749901,17.143397999999998,10.2749901C14.5760498,10.2749901,12.1608391,11.2911301,10.3461494,13.1393909C10.3461494,13.1393909,8.7648602,11.531160400000001,8.7648602,11.531160400000001C11.001750900000001,9.2535105,13.9781494,8,17.143397999999998,8C20.308601,8,23.285,9.2535105,25.5219,11.531160400000001C25.5219,11.531160400000001,23.940601,13.1393909,23.940601,13.1393909ZM10.7473793,26.997299C10.7473793,26.997299,9.470279699999999,24.514299,9.470279699999999,24.514299C9.470279699999999,24.514299,8.6678295,24.514299,8.6678295,24.514299C8.6678295,24.514299,8.6678295,26.997299,8.6678295,26.997299C8.6678295,26.997299,7,26.997299,7,26.997299C7,26.997299,7,19.943001000000002,7,19.943001000000002C7,19.943001000000002,9.5437107,19.943001000000002,9.5437107,19.943001000000002C11.0253506,19.943001000000002,12.2578697,20.455099,12.2578697,22.162001C12.2578697,23.1968,11.780590100000001,23.8582,11.0646801,24.1996C11.0646801,24.1996,12.611890800000001,26.997299,12.611890800000001,26.997299C12.611890800000001,26.997299,10.7473793,26.997299,10.7473793,26.997299ZM8.6678295,23.175501C8.6678295,23.175501,9.4152107,23.175501,9.4152107,23.175501C10.2071705,23.175501,10.626750900000001,22.8234,10.626750900000001,22.162001C10.626750900000001,21.500601,10.2071705,21.2819,9.4152107,21.2819C9.4152107,21.2819,8.6678295,21.2819,8.6678295,21.2819C8.6678295,21.2819,8.6678295,23.175501,8.6678295,23.175501ZM13.5979004,19.943001000000002C13.5979004,19.943001000000002,18.0271,19.943001000000002,18.0271,19.943001000000002C18.0271,19.943001000000002,18.0271,21.3459,18.0271,21.3459C18.0271,21.3459,15.2683601,21.3459,15.2683601,21.3459C15.2683601,21.3459,15.2683601,22.892799,15.2683601,22.892799C15.2683601,22.892799,17.636398,22.892799,17.636398,22.892799C17.636398,22.892799,17.636398,24.306299,17.636398,24.306299C17.636398,24.306299,15.2683601,24.306299,15.2683601,24.306299C15.2683601,24.306299,15.2683601,27,15.2683601,27C15.2683601,27,13.5979004,27,13.5979004,27C13.5979004,27,13.5979004,19.943001000000002,13.5979004,19.943001000000002ZM19.228099999999998,19.943001000000002C19.228099999999998,19.943001000000002,20.898602,19.943001000000002,20.898602,19.943001000000002C20.898602,19.943001000000002,20.898602,26.997299,20.898602,26.997299C20.898602,26.997299,19.228099999999998,26.997299,19.228099999999998,26.997299C19.228099999999998,26.997299,19.228099999999998,19.943001000000002,19.228099999999998,19.943001000000002ZM22.490398,19.943001000000002C22.490398,19.943001000000002,24.486,19.943001000000002,24.486,19.943001000000002C26.602299,19.943001000000002,28,20.977800000000002,28,23.431499000000002C28,25.8878,26.602299,26.997299,24.577801,26.997299C24.577801,26.997299,22.490398,26.997299,22.490398,26.997299C22.490398,26.997299,22.490398,19.943001000000002,22.490398,19.943001000000002ZM24.383701,25.6318C25.503502,25.6318,26.295502,25.1091,26.295502,23.431499000000002C26.295502,21.753901,25.503502,21.2899,24.383701,21.2899C24.383701,21.2899,24.160801,21.2899,24.160801,21.2899C24.160801,21.2899,24.160801,25.6318,24.160801,25.6318C24.160801,25.6318,24.383701,25.6318,24.383701,25.6318Z'%20fill='%232F54EB'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M13.80933,18C13.80933,18,12,15.7879696,12,15.7879696C13.4702702,13.99046135,15.4236202,13,17.5,13C19.57938,13,21.532730100000002,13.99046135,23,15.7879696C23,15.7879696,21.19067,18,21.19067,18C20.206489599999998,16.7931004,18.8952484,16.1327991,17.5,16.1327991C16.1047497,16.1291294,14.7935104,16.7931004,13.80933,18Z'%20fill='%232F54EB'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",_hoisted_1$3=["src"],_sfc_main$4=defineComponent({__name:"rfid-icon",setup(tg){const eg=ref();let gg=0,ig=0,ng=null,og=!1,ag=0,Ig=300;const sg=Ag=>{const cg=Ag.button===0,rg=Ag.button===2;if(Ag.button,rg){Ag.preventDefault(),emitter.emit("showRightMenu",{x:Ag.clientX,y:Ag.clientY});return}if(!cg){console.log("右键点击");return}Ag.preventDefault();let ug=eg.value;ug.setPointerCapture(Ag.pointerId);const dg=ug.getBoundingClientRect();gg=Ag.clientX-dg.left,ig=Ag.clientY-dg.top,ag=Date.now(),ng=setTimeout(()=>{og=!0,ug.classList.add("dragging")},Ig),ug.addEventListener("pointermove",Cg),ug.addEventListener("pointerup",lg,{once:!0}),ug.addEventListener("pointercancel",lg,{once:!0})};function Cg(Ag){if(!og)return;let cg=eg.value;const rg=cg.parentNode.getBoundingClientRect(),ug=cg.getBoundingClientRect();let dg=Ag.clientX-rg.left-gg,bg=Ag.clientY-rg.top-ig;const mg=rg.width-ug.width,hg=rg.height-ug.height;dg=Math.max(0,Math.min(dg,mg)),bg=Math.max(0,Math.min(bg,hg)),cg.style.left=dg+"px",cg.style.top=bg+"px"}function lg(Ag){var ug;let cg=eg.value;clearTimeout(ng);let rg=Date.now()-ag;!og&&rg<Ig&&emitter.emit("show-rfid-modal"),og&&cg.classList.remove("dragging"),og=!1,(ug=cg.releasePointerCapture)==null||ug.call(cg,Ag.pointerId),cg.removeEventListener("pointermove",Cg)}return onMounted(()=>{}),(Ag,cg)=>(openBlock(),createElementBlock("div",{class:"rfid-icon",ref_key:"rfidRef",ref:eg,onPointerdown:sg},[createBaseVNode("img",{src:unref(iconRfid)},null,8,_hoisted_1$3)],544))}}),rfidIcon=_export_sfc(_sfc_main$4,[["__scopeId","data-v-305f6f00"]]),state=reactive({isShowRuler:!0,isShowGrid:!1});function getSettingState(){return state}const _sfc_main$3=defineComponent({__name:"Canvas",props:{config:{},canvas:{},rfidConfig:{},databaseConfig:{},filePath:{},ribbonBorderPattern:{}},setup(tg,{expose:eg}){const{t:gg,te:ig}=useI18n(),ng=tg,og=getSettingState(),ag=useTemplateRef("workspace"),Ig=new EditorCtrl,sg=ref(!1),Cg=ref(!1),lg=ref(!1);function Ag($g){var Ng;if(sg.value=$g,sg.value){const vg=(Ng=ng.config)==null?void 0:Ng.DPI;vg&&vg!==Editor.DPI&&(Editor.DPI=vg),mg==null||mg.editActivated(),emitter.on("edit-nav-trigger",bg),mg&&fg(mg),setTimeout(()=>{if(!mg)return;const Xg=mg.getPlugin("WorkspacePlugin");Xg==null||Xg.auto()},30)}else mg==null||mg.editDeactivated(),emitter.off("edit-nav-trigger",bg)}function cg(){Cg.value=!0}function rg(){return mg}function ug(){return mg==null?void 0:mg.toJSON()}function dg($g,Ng){if(!mg){Ng==null||Ng();return}const vg=()=>{var Xg,Vg;(Xg=mg==null?void 0:mg.getCanvas())==null||Xg.discardActiveObject(),(Vg=mg==null?void 0:mg.getCanvas())==null||Vg.requestRenderAll(),Ig.init(mg),Ig.bind(),nextTick(()=>{let Mg=Ig.getObjects();initCountObjsName(Mg,mg.getCanvas())}),Ng==null||Ng()};if($g){mg.fromTemplateJson($g,vg);return}mg.getObjects().filter(Xg=>Xg.id!=="workspace").forEach(Xg=>mg==null?void 0:mg.removeObject(Xg)),vg()}function bg($g){const Ng=$g.action||"",vg=mg&&mg.getPlugin("CopyPlugin"),Xg=mg&&mg.getPlugin("HistoryPlugin"),Vg=mg&&mg.getPlugin("DeletePlugin"),Mg=mg.getPlugin("WorkspacePlugin"),Rg=mg.getPlugin("RulerPlugin");switch(Ng){case"Ctrl+C":vg.toCopy();break;case"Ctrl+V":vg.toPaste();break;case"Ctrl+X":vg.toCut();break;case"Ctrl+Z":Xg.toUndo();break;case"Ctrl+Shift+Z":Xg.toRedo();break;case"Delete":Vg.toDelete();break;case"ShowRuler":Rg==null||Rg.enabled(),og.isShowRuler=!0;break;case"HideRuler":Rg==null||Rg.disabled(),og.isShowRuler=!1;break;case"ZoomIn":Mg==null||Mg.big();break;case"ZoomOut":Mg==null||Mg.small();break;case"ZoomAuto":Mg==null||Mg.auto();break;case"ObjectProps":emitter.emit("toggle-show-props",{editor:mg,editorCtrl:Ig}),setTimeout(()=>{Mg==null||Mg.auto()},30);break;case"ShowGrid":Mg==null||Mg.showGrid(),og.isShowGrid=!0;break;case"HideGrid":Mg==null||Mg.hideGrid(),og.isShowGrid=!1;break;case"ToSetTag":emitter.emit("to-show-tag-edit");break}}eg({show:Ag,remove:cg,getEidtor:rg,getCanvasJson:ug,loadCanvasJson:dg});let mg;function hg(){const $g=ag.value.querySelector("#canvas");mg=newEditor($g),setObjectNameResolver(mg.getCanvas(),Ng=>{const vg=`editor.objectNames.${Ng}`;return ig(vg)?gg(vg):void 0}),ng.canvas?mg.fromTemplateJson(ng.canvas,()=>{Zg(mg)}):Zg(mg)}const pg=()=>{const $g=ng.config;let Ng=$g.tagWidth,vg=$g.tagHeight;return(!$g.tagWidth||!$g.tagHeight||$g.tagWidth===$g.pageWidth&&$g.tagHeight===$g.pageHeight)&&(Ng=Math.floor(($g.pageWidth-$g.paddingLeft-$g.paddingRight-$g.horizontalSpacing*($g.columns-1))/$g.columns*100)/100,vg=Math.floor(($g.pageHeight-$g.paddingTop-$g.paddingBottom-$g.verticalSpacing*($g.rows-1))/$g.rows*100)/100),{width:Ng,height:vg}},fg=$g=>{if(!$g)return;const Ng=$g.getPlugin("RulerPlugin"),vg=$g.getPlugin("WorkspacePlugin");og.isShowRuler?Ng==null||Ng.enabled():Ng==null||Ng.disabled(),og.isShowGrid?vg==null||vg.showGrid():vg==null||vg.hideGrid()},wg=async $g=>{if(ng.config.pageShape==="Ellipse"){$g.ribbonBorderPattern="none",$g.setRibbonBorderTextures(null),ng.config.ribbonBorder={pattern:"none"};return}const Ng=ng.config.ribbonBorder,vg=(Ng==null?void 0:Ng.pattern)||ng.ribbonBorderPattern||"none";$g.ribbonBorderPattern=vg;try{const Xg=vg==="none"?{pattern:vg}:await createRibbonBorderTextureData(vg);ng.config.ribbonBorder=Xg,$g.setRibbonBorderTextures(await loadRibbonBorderTextureImages(Xg))}catch(Xg){console.log("loadRibbonBorderTextureImages error",Xg)}};function Gg($g){var Kg;if(!$g)return;const Ng=$g.getPlugin("WorkspacePlugin"),vg=$g.getPlugin("RulerPlugin");vg==null||vg.disabled();let Xg=((Kg=Ng==null?void 0:Ng.workspace)==null?void 0:Kg.isHasGrid)||!1;Ng==null||Ng.uninstall();const Vg=ng.config;$g.labelConfig=Vg,$g.filePath=ng.filePath,Vg.DPI&&(Editor.DPI=Vg.DPI);let{width:Mg,height:Rg}=pg();const Sg=Mg/25.4*Editor.DPI,Yg=Rg/25.4*Editor.DPI;let xg,Og;Vg.pageShape==="Ellipse"?(xg=Sg/2,Og=Yg/2):xg=Og=Vg.pageShape==="Rectangle"?0:16,console.log("wpx======",Vg),$g.use(WorkspacePlugin,{width:Sg,height:Yg,backgroundColor:Vg.backgroundColor||"#FFFFFFFF",backgroundImage:Vg.backgroundImage||"",backgroundImageCover:Vg.backgroundImageCover!==!1,rx:xg,ry:Og,type:Vg.pageShape}),nextTick(()=>{var Dg;if(vg==null||vg.enabled(),Xg){const Fg=$g.getPlugin("WorkspacePlugin");Fg==null||Fg.showGrid()}(Dg=$g.getCanvas())==null||Dg.requestRenderAll(),wg($g)})}function Zg($g){var Yg;const Ng=ng.config;$g.labelConfig=Ng,$g.filePath=ng.filePath,Ng.DPI&&(Editor.DPI=Ng.DPI);let{width:vg,height:Xg}=pg();const Vg=vg/25.4*Editor.DPI,Mg=Xg/25.4*Editor.DPI;let Rg,Sg;Ng.pageShape==="Ellipse"?(Rg=Vg/2,Sg=Mg/2):Rg=Sg=Ng.pageShape==="Rectangle"?0:16,$g.use(WorkspacePlugin,{width:Vg,height:Mg,backgroundColor:Ng.backgroundColor||"#FFFFFFFF",backgroundImage:Ng.backgroundImage||"",backgroundImageCover:Ng.backgroundImageCover!==!1,rx:Rg,ry:Sg,type:Ng.pageShape}).use(ContextMenuPlugin).use(RulerPlugin).use(GuidelinesPlugin,{margin:4}).use(DringPlugin).use(LockPlugin).use(LayerPlugin).use(ControlsPlugin,{verticalImg:ControlMiddleVerticalImg,horizontalImg:ControlMiddleHorizontalImg,rotateImg:ControlRotateImage,edgeImg:ControlEdgeImage}).use(AlignPlugin).use(GroupPlugin).use(HistoryPlugin).use(MoveHotKeyPlugin).use(DeletePlugin).use(AddObjectPlugin).use(CopyPlugin).use(SelectPlugin).use(LineContorlPlugin),Ig.init($g),Ig.bind(),fg($g),wg($g),emitter.emit("editor-switch",{editor:$g,editorCtrl:Ig}),(Yg=$g.getCanvas())==null||Yg.on("custom:rfid",yg),nextTick(()=>{let xg=Ig.getObjects();initCountObjsName(xg,$g.getCanvas())})}const yg=$g=>{lg.value=$g.isShow,mg&&(mg._isHasRfid=$g.isShow)},Bg=()=>{var $g;mg&&(($g=mg==null?void 0:mg.getCanvas())==null||$g.requestRenderAll())},Wg=$g=>{if(!mg||!$g)return;const Ng=mg.getCanvas();if(Ng){const vg=getAllObjectMap(Ng,"init"),Xg=[].concat(...Object.values(vg));applyJsonFieldDiff($g,Xg),Ng.requestRenderAll(),Ng.fire("custom:object:history",{})}};return onMounted(()=>{watch(sg,$g=>{$g?(emitter.on("refresh-editor",Gg),emitter.on("refreshCanvasFont",Bg),emitter.on("file-field-json-changed",Wg),nextTick(async()=>{var vg,Xg;const Ng=(vg=ng.config)==null?void 0:vg.DPI;Ng&&(Editor.DPI=Ng),mg?((Xg=mg==null?void 0:mg.getCanvas())==null||Xg.requestRenderAll(),await nextTick(),await new Promise(Vg=>requestAnimationFrame(()=>Vg())),emitter.emit("editor-switch",{editor:mg,editorCtrl:Ig})):hg(),mg._isShown=!0})):(mg&&(mg._isShown=!1),emitter.off("refresh-editor",Gg),emitter.off("refreshCanvasFont",Bg),emitter.off("file-field-json-changed",Wg))})}),onUnmounted(()=>{var $g;console.log("Canvas onUnmounted"),mg&&(($g=mg.getCanvas())==null||$g.off("custom:rfid",yg),delEditor(mg))}),onErrorCaptured(($g,Ng,vg)=>{console.log("onErrorCaptured",$g,Ng,vg)}),($g,Ng)=>unref(Cg)?createCommentVNode("",!0):withDirectives((openBlock(),createElementBlock("div",{key:0,id:"workspace",ref_key:"workspace",ref:ag},[unref(lg)?(openBlock(),createBlock(rfidIcon,{key:0})):createCommentVNode("",!0),Ng[0]||(Ng[0]=createBaseVNode("div",{class:"canvas-box"},[createBaseVNode("div",{class:"inside-shadow"}),createBaseVNode("canvas",{id:"canvas",class:normalizeClass("design-stage-grid")})],-1))],512)),[[vShow,unref(sg)]])}}),Canvas=_export_sfc(_sfc_main$3,[["__scopeId","data-v-25832c0a"]]),IconClose="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='10.000091552734375'%20height='10'%20viewBox='0%200%2010.000091552734375%2010'%3e%3cg%3e%3cg%3e%3cellipse%20cx='5.000091552734375'%20cy='4.999980926513672'%20rx='5'%20ry='5'%20fill='%23D8D8D8'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,1.414311092185244,-3.413998686404966)'%3e%3cpath%20d='M8.941986552734374,0.4573170671386719Q8.941986552734374,0.4122980671386719,8.933206552734376,0.3681430671386719Q8.924416552734375,0.3239880671386719,8.907196552734375,0.2823960671386719Q8.889966552734375,0.24080306713867186,8.864956552734375,0.20337006713867187Q8.839936552734375,0.16593806713867187,8.808106552734376,0.13410406713867187Q8.776276552734375,0.10227006713867187,8.738836552734375,0.07725896713867188Q8.701406552734376,0.052247367138671875,8.659816552734375,0.035019167138671876Q8.618226552734376,0.017790867138671874,8.574066552734376,0.009007967138671875Q8.529916552734376,0.000225067138671875,8.484896552734375,0.000225067138671875Q8.439876552734376,0.000225067138671875,8.395716552734374,0.009007967138671875Q8.351566552734376,0.017790867138671874,8.309976552734375,0.035019167138671876Q8.268376552734376,0.052247367138671875,8.230946552734375,0.07725896713867188Q8.193516552734375,0.10227006713867187,8.161676552734376,0.13410406713867187Q8.129846552734374,0.16593806713867187,8.104836552734374,0.20337006713867187Q8.079826552734374,0.24080306713867186,8.062596552734375,0.2823960671386719Q8.045366552734375,0.3239880671386719,8.036586552734375,0.3681430671386719Q8.027796552734376,0.4122980671386719,8.027796552734376,0.4573170671386719L8.027796552734376,2.9870450671386717L5.254974552734375,2.9870450671386717Q5.212942552734375,2.9870450671386717,5.171717552734375,2.9952450671386717Q5.130493552734375,3.0034450671386717,5.091661552734375,3.0195250671386717Q5.052828552734375,3.035615067138672,5.017880552734375,3.0589650671386717Q4.982932552734375,3.082315067138672,4.953210552734375,3.112035067138672Q4.923489952734375,3.141755067138672,4.900138152734375,3.176705067138672Q4.876786452734375,3.211655067138672,4.860701552734375,3.250485067138672Q4.844616652734375,3.2893150671386717,4.836416582734375,3.330545067138672Q4.828216552734375,3.371765067138672,4.828216552734375,3.413795067138672Q4.828216552734375,3.455835067138672,4.836416582734375,3.497055067138672Q4.844616652734375,3.538275067138672,4.860701552734375,3.577115067138672Q4.876786452734375,3.615945067138672,4.900138152734375,3.6508950671386717Q4.923489952734375,3.685845067138672,4.953210552734375,3.7155650671386717Q4.982932552734375,3.745285067138672,5.017880552734375,3.7686350671386717Q5.052828552734375,3.791985067138672,5.091661552734375,3.808075067138672Q5.130493552734375,3.8241550671386717,5.171717552734375,3.8323550671386717Q5.212942552734375,3.8405550671386717,5.254974552734375,3.8405550671386717L8.027796552734376,3.8405550671386717L8.027796552734376,6.371255067138672Q8.027796552734376,6.416275067138672,8.036586552734375,6.460435067138672Q8.045366552734375,6.504585067138672,8.062596552734375,6.546175067138672Q8.079826552734374,6.587775067138672,8.104836552734374,6.625205067138672Q8.129846552734374,6.662635067138672,8.161676552734376,6.694465067138672Q8.193516552734375,6.7263050671386715,8.230946552734375,6.7513150671386715Q8.268376552734376,6.776325067138671,8.309976552734375,6.793555067138672Q8.351566552734376,6.810785067138672,8.395716552734374,6.819565067138672Q8.439876552734376,6.828345067138672,8.484896552734375,6.828345067138672Q8.529916552734376,6.828345067138672,8.574066552734376,6.819565067138672Q8.618226552734376,6.810785067138672,8.659816552734375,6.793555067138672Q8.701406552734376,6.776325067138671,8.738836552734375,6.7513150671386715Q8.776276552734375,6.7263050671386715,8.808106552734376,6.694465067138672Q8.839936552734375,6.662635067138672,8.864956552734375,6.625205067138672Q8.889966552734375,6.587775067138672,8.907196552734375,6.546175067138672Q8.924416552734375,6.504585067138672,8.933206552734376,6.460435067138672Q8.941986552734374,6.416275067138672,8.941986552734374,6.371255067138672L8.941986552734374,3.8405550671386717L11.714936552734375,3.8405550671386717Q11.756966552734376,3.8405550671386717,11.798186552734375,3.8323550671386717Q11.839416552734374,3.8241550671386717,11.878246552734375,3.808075067138672Q11.917076552734375,3.791985067138672,11.952026552734374,3.7686350671386717Q11.986976552734376,3.745285067138672,12.016696552734375,3.7155650671386717Q12.046416552734375,3.685845067138672,12.069766552734375,3.6508950671386717Q12.093126552734375,3.615945067138672,12.109206552734374,3.577115067138672Q12.125296552734376,3.538275067138672,12.133496552734375,3.497055067138672Q12.141686552734374,3.455835067138672,12.141696552734375,3.413795067138672Q12.141686552734374,3.371765067138672,12.133486552734375,3.330545067138672Q12.125286552734375,3.2893150671386717,12.109206552734374,3.250485067138672Q12.093116552734376,3.211655067138672,12.069766552734375,3.176705067138672Q12.046416552734375,3.141755067138672,12.016696552734375,3.112035067138672Q11.986976552734376,3.082315067138672,11.952026552734374,3.0589650671386717Q11.917076552734375,3.035615067138672,11.878246552734375,3.0195250671386717Q11.839416552734374,3.0034450671386717,11.798186552734375,2.9952450671386717Q11.756966552734376,2.9870450671386717,11.714936552734375,2.9870450671386717L8.941986552734374,2.9870450671386717L8.941986552734374,0.4573170671386719Z'%20fill-rule='evenodd'%20fill='%2362708D'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";async function activateAfterViewUpdate(tg,eg){return await tg(),eg()}const _hoisted_1$2={key:0,class:"file-list-box"},_hoisted_2=["onClick","title"],_hoisted_3={class:"file-item-name"},_hoisted_4={key:0,class:"un-save-tag"},_hoisted_5=["src","onClick"],_hoisted_6={class:"file-tool"},_sfc_main$2=defineComponent({__name:"index",props:{isHasInitFile:{type:Boolean,default:!1}},setup(tg){const{t:eg}=useI18n(),gg=tg,ig=inject("isCanvasReady"),ng=getCheckDirtyState();function og(){const Vg=getSysConfigState(),Mg=[];for(let Rg=0;Rg<1;Rg++){const Sg=Object.assign({},getTempLabelConfig(),{DPI:Vg.DPI});Sg.fileId=v4(),Sg.fileName=eg("editor.remaining.newFileNumber",{number:Rg+1});const Yg={id:Sg.fileId,config:Sg};normalizeLayers(Yg,eg),Mg.push(Yg)}return Mg}const ag=ref([]),Ig=ref(),sg=ref(-1),Cg=ref(),lg=ref(new Map),Ag=ref(),cg=ref(new Map);let rg=-1;function ug(Vg){var Rg,Sg;const Mg=((Rg=Vg.layers)==null?void 0:Rg.find(Yg=>Yg.id===Vg.activeLayerId))||((Sg=Vg.layers)==null?void 0:Sg[0]);return(Mg==null?void 0:Mg.canvas)||Vg.canvas}function dg(Vg){var Sg;const Mg=cg.value.get(Vg.id),Rg=getActiveLayer(Vg);!Mg||!Rg||isLayerCanvasStable()&&(Rg.canvas=(Sg=Mg.getCanvasJson)==null?void 0:Sg.call(Mg),Vg.canvas=Rg.canvas)}function bg(Vg){return Array.isArray(Vg.canvas)&&Vg.canvas.length>1||Array.isArray(Vg.layers)&&Vg.layers.length>1}function mg(Vg){const Mg=Array.isArray(Vg.canvas)?Vg.canvas.length:0,Rg=Array.isArray(Vg.layers)?Vg.layers.length:0;return Math.max(Mg,Rg,getLayerMaxCountFromPayload(Vg))}function hg(Vg){return Vg.newFile?state$1.isSeparateLayerMode:Vg.labelConfig.separateLayerMode===!0}function pg(Vg,Mg){return Vg.newFile?state$1.separateLayerCount:getLayerMaxCount(Vg.labelConfig.separateLayerCount??Mg)}function fg(Vg){const Mg=Vg.newFile?state$1.separateLayerNames:Vg.labelConfig.separateLayerNames;return Array.isArray(Mg)?Mg.map(Rg=>String(Rg||"").trim()).filter(Boolean):[]}const wg=(Vg,Mg)=>{ng[Vg]=!1,yg(Mg)};async function Gg(Vg,Mg){Vg.stopPropagation(),Vg.preventDefault();const Rg=ag.value[Mg];if(!ng[Rg.id]){disconnDatabase(),yg(Mg);return}rg=Mg,Bg(null,rg),await showCloseFileDirtyModal(Rg)==="no-save"&&wg(Rg.id,rg)}function Zg(Vg){if(Vg.flag==="close")yg(rg);else if(Vg.success&&Vg.name){const Mg=ag.value.find(Rg=>Rg.id===Vg.fileId);if(Mg){let Rg;const Sg=Vg.name.lastIndexOf(".");Sg>0?Rg=Vg.name.substring(0,Sg):Rg=Vg.name,Mg.config.fileName=Rg}}}function yg(Vg){const Mg=ag.value.splice(Vg,1);if(Mg.length>0){const Rg=Mg[0].id;cg.value.get(Rg).remove(),console.log("fileItemClose",Vg,sg.value,Rg)}Vg===sg.value&&(sg.value>0?Bg(null,sg.value-1):(sg.value=-1,ag.value.length>0&&Bg(null,0))),ag.value.length===0&&($g.activeId="",emitter.emit("editor-empty"))}function Bg(Vg,Mg){if(console.log("fileItemClick",Mg,sg.value),Mg!==sg.value){const Rg=ag.value[Mg].id;state$1.isShowEditTabs&&(Cg.value&&Cg.value.classList.remove("active"),Cg.value=lg.value.get(Rg),Cg.value.classList.add("active")),Ag.value&&Ag.value.show(!1);const Sg=cg.value.get(Rg);Ag.value=Sg;const Yg=ag.value[Mg],xg=getActiveLayer(Yg);xg&&setTabActiveLayer(Yg,xg),Sg.show(!0),sg.value=Mg,$g.activeId=Rg}}function Wg(Vg){var Og,Kg,Dg,Fg;const Mg=mg(Vg),Rg=hg(Vg),Sg=pg(Vg,Mg),Yg=fg(Vg),xg=Rg?Sg:Math.max(getLayerMaxCountFromPayload(Vg),Mg);if(Vg.labelConfig.separateLayerMode=Rg,Vg.labelConfig.separateLayerCount=Sg,Vg.labelConfig.separateLayerNames=Yg,Vg.labelConfig.layerMaxCount=xg,bg(Vg)&&(state$1.isMultiLayerEnabled=!0),Vg.newFile){resetLaserPresetsFromExternal();const Tg=Vg.labelConfig.fileName,Jg=ag.value.filter(Eg=>Eg.config.fileName.startsWith(Tg));if(Jg.length>0){let Eg=1;Jg.forEach(co=>{const ma=co.config.fileName.substring(Tg.length);try{const pa=parseInt(ma);pa>=Eg&&(Eg=pa+1)}catch(pa){console.log(pa)}}),Vg.labelConfig.fileName=Tg+Eg}}else{let Tg=-1;for(let Jg=0;Jg<ag.value.length;Jg++){const Eg=ag.value[Jg];if(Eg.id===Vg.labelConfig.fileId){Eg.filePath===Vg.filePath?Tg=Jg:Vg.labelConfig.fileId=v4();break}}if(Tg>-1){if(ag.value[Tg]){Vg.labelConfig.ribbonBorder||(Vg.labelConfig.ribbonBorder={pattern:(Vg==null?void 0:Vg.ribbonBorderPattern)||"none"});const Jg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:Vg.labelConfig.ribbonBorder.pattern||Vg.ribbonBorderPattern||"none",filePath:Vg.filePath,refreshKey:new Date().getTime()};if(applySeparateLayerMode(Jg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Jg,xg),applyLayerMeta(Jg,Vg.layers),applyCanvasPayload(Jg,Vg.canvas),Vg.activeLayerId){Jg.activeLayerId=Vg.activeLayerId;const co=getActiveLayer(Jg);co&&setTabActiveLayer(Jg,co)}normalizeLayers(Jg),ag.value[Tg]=Jg;const Eg=Vg.labelConfig.fileId;activateAfterViewUpdate(()=>nextTick(),()=>cg.value.get(Eg)?(Ag.value=void 0,sg.value=-1,Bg(null,Tg),!0):!1)}$g.storeTabs(ag.value),Message.success(eg("editor.remaining.alreadyOpen"));return}}if(Vg.labelConfig.ribbonBorder||(Vg.labelConfig.ribbonBorder={pattern:(Vg==null?void 0:Vg.ribbonBorderPattern)||"none"}),state$1.isShowEditTabs){const Tg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:((Kg=(Og=Vg.labelConfig)==null?void 0:Og.ribbonBorder)==null?void 0:Kg.pattern)||(Vg==null?void 0:Vg.ribbonBorderPattern)||"none",filePath:Vg.filePath};if(applySeparateLayerMode(Tg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Tg,xg),applyLayerMeta(Tg,Vg.layers),applyCanvasPayload(Tg,Vg.canvas),Vg.activeLayerId){Tg.activeLayerId=Vg.activeLayerId;const Jg=getActiveLayer(Tg);Jg&&setTabActiveLayer(Tg,Jg)}normalizeLayers(Tg),ag.value.unshift(Tg)}else{const Tg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:((Fg=(Dg=Vg.labelConfig)==null?void 0:Dg.ribbonBorder)==null?void 0:Fg.pattern)||(Vg==null?void 0:Vg.ribbonBorderPattern)||"none",filePath:Vg.filePath};if(applySeparateLayerMode(Tg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Tg,xg),applyLayerMeta(Tg,Vg.layers),applyCanvasPayload(Tg,Vg.canvas),Vg.activeLayerId){Tg.activeLayerId=Vg.activeLayerId;const Eg=getActiveLayer(Tg);Eg&&setTabActiveLayer(Tg,Eg)}normalizeLayers(Tg);let Jg=ag.value.find(Eg=>{if(Eg.id===Tg.id)return Eg});ag.value=Jg?[Jg]:[Tg]}console.log("fileList.value==========",ag.value),$g.storeTabs(ag.value),nextTick(()=>{sg.value>=0&&(sg.value+=1),Bg(null,0),emitter.emit("label-ready")})}const $g=useTabsStore(),Ng=useAppStore();let vg=!1;const Xg=async()=>{if(vg)return;vg=!0;let Vg={},Mg=[];for(ag.value.forEach((Rg,Sg)=>{Vg[Rg.id]=Sg,Mg.push(Rg)});Mg.length;){let Rg=Mg.pop(),Sg=Vg[Rg.id];if(ng[Rg.id]){Bg(null,Sg);let Yg=await showCloseFileDirtyModal(Rg);if(Yg==="no-save")wg(Rg.id,Sg);else if(Yg==="cancel")break}else wg(Rg.id,Sg)}vg=!1};return emitter.on("checkFileSave",Vg=>{let Mg=!0;for(let Rg of ag.value)if(ng[Rg.id]){Mg=!1;break}Vg&&Vg(Mg)}),emitter.on("label-config",Wg),onMounted(async()=>{if(ig&&(ig.value=!0),$g.tabs.length===0&&(!Ng.firstOpen&&!gg.isHasInitFile&&(ag.value=og(),$g.storeTabs(ag.value),Ng.firstOpen=!0),gg.isHasInitFile&&(Ng.firstOpen=!0)),ag.value=$g.tabs,ag.value.forEach(Vg=>normalizeLayers(Vg)),Ig.value){const Vg=Ig.value;Vg.addEventListener("wheel",Mg=>{Mg.buttons===0&&(Mg.preventDefault(),Vg.scrollLeft+=Mg.deltaY)}),nextTick(()=>{var Mg;if(cg.value.size>0){const Rg=$g.activeId;if(Vg.children.length){const Sg=lg.value.get(Rg);Sg?(Cg.value=Sg,ag.value.forEach((Yg,xg)=>{Yg.id===Rg&&(sg.value=xg)})):(Cg.value=Vg.children[0],sg.value=0),Cg.value.classList.add("active")}Rg&&(Ag.value=cg.value.get(Rg)),Ag.value||(Ag.value=cg.value.get(ag.value[0].id),$g.activeId=ag.value[0].id),(Mg=Ag.value)==null||Mg.show(!0)}}).then(()=>{})}emitter.on("save-file",Zg),emitter.on("sync-active-layer",Vg=>{const Mg=ag.value.find(Rg=>Rg.id===Vg)||ag.value.find(Rg=>Rg.id===$g.activeId);Mg&&dg(Mg)}),emitter.on("separate-layer-config-change",({count:Vg,names:Mg})=>{ag.value.forEach(Rg=>{applySeparateLayerMode(Rg,state$1.isSeparateLayerMode,{count:Vg,names:Mg}),normalizeLayers(Rg)}),$g.storeTabs(ag.value)})}),onUnmounted(()=>{emitter.off("save-file",Zg),emitter.off("label-config",Wg),emitter.off("sync-active-layer"),emitter.off("separate-layer-config-change")}),(Vg,Mg)=>{const Rg=__unplugin_components_0$6,Sg=Menu,Yg=Dropdown;return openBlock(),createElementBlock(Fragment,null,[unref(state$1).isShowEditTabs?(openBlock(),createElementBlock("div",_hoisted_1$2,[createBaseVNode("div",{id:"file-list",ref_key:"fileListWrap",ref:Ig,class:"file-list-scroll"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(ag),(xg,Og)=>(openBlock(),createElementBlock("div",{key:xg.id,ref_for:!0,ref:Kg=>{Kg?unref(lg).set(xg.id,Kg):unref(lg).delete(xg.id)},class:"file-item",style:{"min-width":"150px"},onClick:Kg=>Bg(Kg,Og),title:xg.filePath},[createBaseVNode("div",_hoisted_3,toDisplayString$1(xg.config.fileName),1),unref(ng)[xg.id]?(openBlock(),createElementBlock("div",_hoisted_4,"*")):createCommentVNode("",!0),createBaseVNode("img",{src:unref(IconClose),onClick:Kg=>Gg(Kg,Og),class:"icon-close"},null,8,_hoisted_5)],8,_hoisted_2))),128))],512),createBaseVNode("div",_hoisted_6,[createVNode(Yg,{trigger:["click"]},{overlay:withCtx(()=>[createVNode(Sg,null,{default:withCtx(()=>[createVNode(Rg,{onClick:Xg},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(eg)("editor.remaining.closeAllTabs")),1)]),_:1})]),_:1})]),default:withCtx(()=>[createVNode(unref(EllipsisOutlined))]),_:1})])])):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(ag),(xg,Og)=>(openBlock(),createBlock(Canvas,{config:xg.config,canvas:ug(xg),"rfid-config":xg.rfid,"database-config":xg.database,"file-path":xg.filePath,"ribbon-border-pattern":xg.ribbonBorderPattern,key:xg.id+(xg.refreshKey||""),ref_for:!0,ref:Kg=>{Kg?unref(cg).set(xg.id,Kg):unref(cg).delete(xg.id)}},null,8,["config","canvas","rfid-config","database-config","file-path","ribbon-border-pattern"]))),128))],64)}}}),Index=_export_sfc(_sfc_main$2,[["__scopeId","data-v-e9fc7c8c"]]),_hoisted_1$1={key:0,class:"tran-modal"},_sfc_main$1=defineComponent({__name:"index",setup(tg){const eg=useAppStore(),gg=ref(!1),ig=ref(!0),ng=computed(()=>{const sg=getEditorConfig();return sg.visibleMenus?sg.visibleMenus.length>0:!0}),og=computed(()=>ng.value?"calc(100vh - 96px)":"calc(100vh - 48px)");provide("isCanvasReady",gg);const ag=sg=>{ig.value=!ig.value,ig.value&&nextTick(()=>{emitter.emit("editor-switch",sg)}),console.log("toggleShowRightSideBar",ig.value)},Ig=computed(()=>eg.isShowTranparentModal);return onMounted(()=>{emitter.on("toggle-show-props",ag),(eg.clearLocalStore===void 0||eg.clearLocalStore===null||eg.clearLocalStore)&&(eg.clearLocalStore=!1)}),onUnmounted(()=>{emitter.off("toggle-show-props",ag)}),(sg,Cg)=>{const lg=LayoutHeader,Ag=LayoutSider,cg=LayoutContent,rg=__unplugin_components_3$1,ug=App,dg=ConfigProvider;return openBlock(),createElementBlock(Fragment,null,[createVNode(dg,{theme:{algorithm:unref(theme).compactAlgorithm,components:{Layout:{colorBgHeader:"#FFFFFF;",colorBgBody:"#FFFFFF;"},Collapse:{colorFillAlter:"#EFEFEF",colorBgContainer:"#FFFFFF"},Switch:{colorPrimary:"#0C8CE9",colorPrimaryHover:"#0C8CE9"},Input:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"},InputNumber:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"},Divider:{colorBgBase:"#D8D8D8"},Select:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"}},token:{colorPrimary:"#0C8CE9"}}},{default:withCtx(()=>[createVNode(ug,null,{default:withCtx(()=>[createVNode(rg,null,{default:withCtx(()=>[unref(gg)&&unref(ng)?(openBlock(),createBlock(lg,{key:0,style:{"padding-inline":"0px",display:"flex","align-items":"center",height:"48px","border-bottom":"1px solid #e9e9e9","min-width":"fit-content"}},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(MenuBar)))]),_:1})):createCommentVNode("",!0),createVNode(lg,{style:{"padding-inline":"0px",display:"flex","align-items":"center",height:"48px","min-width":"fit-content","border-bottom":"1px solid #e9e9e9"}},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(ToolBar),{key:0})):createCommentVNode("",!0)]),_:1}),createVNode(rg,{style:normalizeStyle$1({height:unref(og)})},{default:withCtx(()=>[createVNode(Ag,{style:{"background-color":"white","border-right":"1px solid #d8d8d8"},width:"258"},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(LeftSideBar),{key:0})):createCommentVNode("",!0)]),_:1}),createVNode(cg,null,{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Index)))]),_:1}),unref(ig)?(openBlock(),createBlock(Ag,{key:0,style:{"border-left":"1px solid #d8d8d8"},width:"300"},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(RightSideBar),{key:0})):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0)]),_:1},8,["style"])]),_:1})]),_:1})]),_:1},8,["theme"]),unref(Ig)?(openBlock(),createElementBlock("div",_hoisted_1$1)):createCommentVNode("",!0)],64)}}}),home=_export_sfc(_sfc_main$1,[["__scopeId","data-v-37406acf"]]),_hoisted_1={class:"le-editor"},_sfc_main=defineComponent({__name:"App",setup(tg){const{locale:eg}=useI18n(),gg=useEditorAntLocale(eg);return onMounted(async()=>{window.myThreshold=200;const{dpi:ig}=getEditorConfig();o.DPI=ig,setSysConfigState({DPI:ig})}),(ig,ng)=>{const og=ConfigProvider;return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(og,{locale:unref(gg)},{default:withCtx(()=>[createVNode(home)]),_:1},8,["locale"])])}}});/*!
955
+ </div>`,this.$emit("real-time",ig)},reload(){let tg=new Image;tg.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=tg.width,this.trueHeight=tg.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},tg.onerror=()=>{this.$emit("img-load","error")},tg.src=this.imgs},checkedMode(){let tg=1,eg=this.trueWidth,gg=this.trueHeight;const ig=this.mode.split(" ");switch(ig[0]){case"contain":this.trueWidth>this.w&&(tg=this.w/this.trueWidth),this.trueHeight*tg>this.h&&(tg=this.h/this.trueHeight);break;case"cover":eg=this.w,tg=eg/this.trueWidth,gg=gg*tg,gg<this.h&&(gg=this.h,tg=gg/this.trueHeight);break;default:try{let ng=ig[0];if(ng.search("px")!==-1){ng=ng.replace("px",""),eg=parseFloat(ng);const og=eg/this.trueWidth;let ag=1,Ig=ig[1];Ig.search("px")!==-1&&(Ig=Ig.replace("px",""),gg=parseFloat(Ig),ag=gg/this.trueHeight),tg=Math.min(og,ag)}if(ng.search("%")!==-1&&(ng=ng.replace("%",""),eg=parseFloat(ng)/100*this.w,tg=eg/this.trueWidth),ig.length===2&&ng==="auto"){let og=ig[1];og.search("px")!==-1&&(og=og.replace("px",""),gg=parseFloat(og),tg=gg/this.trueHeight),og.search("%")!==-1&&(og=og.replace("%",""),gg=parseFloat(og)/100*this.h,tg=gg/this.trueHeight)}}catch{tg=1}}return tg},goAutoCrop(tg,eg){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let gg=this.w,ig=this.h;if(this.centerBox){const ag=Math.abs(this.rotate)%2>0;let Ig=(ag?this.trueHeight:this.trueWidth)*this.scale,sg=(ag?this.trueWidth:this.trueHeight)*this.scale;gg=Ig<gg?Ig:gg,ig=sg<ig?sg:ig}var ng=tg||parseFloat(this.autoCropWidth),og=eg||parseFloat(this.autoCropHeight);(ng===0||og===0)&&(ng=gg*.8,og=ig*.8),ng=ng>gg?gg:ng,og=og>ig?ig:og,this.fixed&&(og=ng/this.fixedNumber[0]*this.fixedNumber[1]),og>this.h&&(og=this.h,ng=og/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(ng,og)},changeCrop(tg,eg){if(this.centerBox){let gg=this.getImgAxis();tg>gg.x2-gg.x1&&(tg=gg.x2-gg.x1,eg=tg/this.fixedNumber[0]*this.fixedNumber[1]),eg>gg.y2-gg.y1&&(eg=gg.y2-gg.y1,tg=eg/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=tg,this.cropH=eg,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(tg,eg,gg){tg=tg||this.x,eg=eg||this.y,gg=gg||this.scale;let ig=!0;if(this.centerBox){let ng=this.getImgAxis(tg,eg,gg),og=this.getCropAxis();ng.x1>=og.x1&&(ig=!1),ng.x2<=og.x2&&(ig=!1),ng.y1>=og.y1&&(ig=!1),ng.y2<=og.y2&&(ig=!1),ig||this.changeImgScale(ng,og,gg)}return ig},changeImgScale(tg,eg,gg){let ig=this.trueWidth,ng=this.trueHeight,og=ig*gg,ag=ng*gg;if(og>=this.cropW&&ag>=this.cropH)this.scale=gg;else{const Ig=this.cropW/ig,sg=this.cropH/ng,Cg=this.cropH<=ng*Ig?Ig:sg;this.scale=Cg,og=ig*Cg,ag=ng*Cg}this.imgIsQqualCrop||(tg.x1>=eg.x1&&(this.isRotateRightOrLeft?this.x=eg.x1-(ig-og)/2-(og-ag)/2:this.x=eg.x1-(ig-og)/2),tg.x2<=eg.x2&&(this.isRotateRightOrLeft?this.x=eg.x1-(ig-og)/2-(og-ag)/2-ag+this.cropW:this.x=eg.x2-(ig-og)/2-og),tg.y1>=eg.y1&&(this.isRotateRightOrLeft?this.y=eg.y1-(ng-ag)/2-(ag-og)/2:this.y=eg.y1-(ng-ag)/2),tg.y2<=eg.y2&&(this.isRotateRightOrLeft?this.y=eg.y2-(ng-ag)/2-(ag-og)/2-og:this.y=eg.y2-(ng-ag)/2-ag)),(og<this.cropW||ag<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let tg=this;var eg=navigator.userAgent;this.isIOS=!!eg.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(gg,ig,ng){for(var og=atob(this.toDataURL(ig,ng).split(",")[1]),ag=og.length,Ig=new Uint8Array(ag),sg=0;sg<ag;sg++)Ig[sg]=og.charCodeAt(sg);gg(new Blob([Ig],{type:tg.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),A={key:0,class:"cropper-box"},B=["src"],P={class:"cropper-view-box"},R=["src"],D={key:1};function U(tg,eg,gg,ig,ng,og){return openBlock(),createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:eg[28]||(eg[28]=(...ag)=>tg.scaleImg&&tg.scaleImg(...ag)),onMouseout:eg[29]||(eg[29]=(...ag)=>tg.cancelScale&&tg.cancelScale(...ag))},[tg.imgs?(openBlock(),createElementBlock("div",A,[withDirectives(createBaseVNode("div",{class:"cropper-box-canvas",style:normalizeStyle$1({width:tg.trueWidth+"px",height:tg.trueHeight+"px",transform:"scale("+tg.scale+","+tg.scale+") translate3d("+tg.x/tg.scale+"px,"+tg.y/tg.scale+"px,0)rotateZ("+tg.rotate*90+"deg)"})},[createBaseVNode("img",{src:tg.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,B)],4),[[vShow,!tg.loading]])])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["cropper-drag-box",{"cropper-move":tg.move&&!tg.crop,"cropper-crop":tg.crop,"cropper-modal":tg.cropping}]),onMousedown:eg[0]||(eg[0]=(...ag)=>tg.startMove&&tg.startMove(...ag)),onTouchstart:eg[1]||(eg[1]=(...ag)=>tg.startMove&&tg.startMove(...ag))},null,34),withDirectives(createBaseVNode("div",{class:"cropper-crop-box",style:normalizeStyle$1({width:tg.cropW+"px",height:tg.cropH+"px",transform:"translate3d("+tg.cropOffsertX+"px,"+tg.cropOffsertY+"px,0)"})},[createBaseVNode("span",P,[createBaseVNode("img",{style:normalizeStyle$1({width:tg.trueWidth+"px",height:tg.trueHeight+"px",transform:"scale("+tg.scale+","+tg.scale+") translate3d("+(tg.x-tg.cropOffsertX)/tg.scale+"px,"+(tg.y-tg.cropOffsertY)/tg.scale+"px,0)rotateZ("+tg.rotate*90+"deg)"}),src:tg.imgs,alt:"cropper-img"},null,12,R)]),createBaseVNode("span",{class:"cropper-face cropper-move",onMousedown:eg[2]||(eg[2]=(...ag)=>tg.cropMove&&tg.cropMove(...ag)),onTouchstart:eg[3]||(eg[3]=(...ag)=>tg.cropMove&&tg.cropMove(...ag))},null,32),tg.info?(openBlock(),createElementBlock("span",{key:0,class:"crop-info",style:normalizeStyle$1({top:tg.cropInfo.top})},toDisplayString$1(tg.cropInfo.width)+" × "+toDisplayString$1(tg.cropInfo.height),5)):createCommentVNode("",!0),tg.fixedBox?createCommentVNode("",!0):(openBlock(),createElementBlock("span",D,[createBaseVNode("span",{class:"crop-line line-w",onMousedown:eg[4]||(eg[4]=ag=>tg.changeCropSize(ag,!1,!0,0,1)),onTouchstart:eg[5]||(eg[5]=ag=>tg.changeCropSize(ag,!1,!0,0,1))},null,32),createBaseVNode("span",{class:"crop-line line-a",onMousedown:eg[6]||(eg[6]=ag=>tg.changeCropSize(ag,!0,!1,1,0)),onTouchstart:eg[7]||(eg[7]=ag=>tg.changeCropSize(ag,!0,!1,1,0))},null,32),createBaseVNode("span",{class:"crop-line line-s",onMousedown:eg[8]||(eg[8]=ag=>tg.changeCropSize(ag,!1,!0,0,2)),onTouchstart:eg[9]||(eg[9]=ag=>tg.changeCropSize(ag,!1,!0,0,2))},null,32),createBaseVNode("span",{class:"crop-line line-d",onMousedown:eg[10]||(eg[10]=ag=>tg.changeCropSize(ag,!0,!1,2,0)),onTouchstart:eg[11]||(eg[11]=ag=>tg.changeCropSize(ag,!0,!1,2,0))},null,32),createBaseVNode("span",{class:"crop-point point1",onMousedown:eg[12]||(eg[12]=ag=>tg.changeCropSize(ag,!0,!0,1,1)),onTouchstart:eg[13]||(eg[13]=ag=>tg.changeCropSize(ag,!0,!0,1,1))},null,32),createBaseVNode("span",{class:"crop-point point2",onMousedown:eg[14]||(eg[14]=ag=>tg.changeCropSize(ag,!1,!0,0,1)),onTouchstart:eg[15]||(eg[15]=ag=>tg.changeCropSize(ag,!1,!0,0,1))},null,32),createBaseVNode("span",{class:"crop-point point3",onMousedown:eg[16]||(eg[16]=ag=>tg.changeCropSize(ag,!0,!0,2,1)),onTouchstart:eg[17]||(eg[17]=ag=>tg.changeCropSize(ag,!0,!0,2,1))},null,32),createBaseVNode("span",{class:"crop-point point4",onMousedown:eg[18]||(eg[18]=ag=>tg.changeCropSize(ag,!0,!1,1,0)),onTouchstart:eg[19]||(eg[19]=ag=>tg.changeCropSize(ag,!0,!1,1,0))},null,32),createBaseVNode("span",{class:"crop-point point5",onMousedown:eg[20]||(eg[20]=ag=>tg.changeCropSize(ag,!0,!1,2,0)),onTouchstart:eg[21]||(eg[21]=ag=>tg.changeCropSize(ag,!0,!1,2,0))},null,32),createBaseVNode("span",{class:"crop-point point6",onMousedown:eg[22]||(eg[22]=ag=>tg.changeCropSize(ag,!0,!0,1,2)),onTouchstart:eg[23]||(eg[23]=ag=>tg.changeCropSize(ag,!0,!0,1,2))},null,32),createBaseVNode("span",{class:"crop-point point7",onMousedown:eg[24]||(eg[24]=ag=>tg.changeCropSize(ag,!1,!0,0,2)),onTouchstart:eg[25]||(eg[25]=ag=>tg.changeCropSize(ag,!1,!0,0,2))},null,32),createBaseVNode("span",{class:"crop-point point8",onMousedown:eg[26]||(eg[26]=ag=>tg.changeCropSize(ag,!0,!0,2,2)),onTouchstart:eg[27]||(eg[27]=ag=>tg.changeCropSize(ag,!0,!0,2,2))},null,32)]))],4),[[vShow,tg.cropping]])],544)}const M=$(z,[["render",U],["__scopeId","data-v-a742df44"]]),_hoisted_1$8={key:0,class:"cut-img-box"},_hoisted_2$5={class:"c-footer-tool"},_hoisted_3$5={class:"c-footer-btns"},_sfc_main$9=defineComponent({__name:"cut-img-modal",props:{open:{type:Boolean,default:!1},openModifiers:{},img:{default:""},imgModifiers:{},imgInfo:{default:{width:1,height:1}},imgInfoModifiers:{}},emits:mergeModels(["getData"],["update:open","update:img","update:imgInfo"]),setup(tg,{emit:eg}){const{t:gg}=useI18n(),ig=eg,ng=useModel(tg,"open"),og=useModel(tg,"img"),ag=useModel(tg,"imgInfo"),Ig=ref(),sg=ref(!1),Cg=ref([1,1]),lg=()=>{Ig.value&&Ig.value.rotateLeft()},Ag=()=>{Ig.value&&Ig.value.rotateRight()},cg=dg=>{Ig.value&&Ig.value.changeScale(dg)},rg=()=>{ng.value=!1,Ig.value&&Ig.value.getCropData(dg=>{ig("getData",dg)})},ug=()=>{ng.value=!1};return watch(sg,dg=>{dg&&(Cg.value=[ag.value.width,ag.value.height])}),(dg,bg)=>{const mg=Checkbox,hg=Space,pg=Button$1,fg=Modal$1;return openBlock(),createBlock(fg,{open:ng.value,"onUpdate:open":bg[3]||(bg[3]=wg=>ng.value=wg),width:"800px",title:unref(gg)("common.commonUi.cropImage"),centered:"",footer:null,"mask-closable":!1},{default:withCtx(()=>[og.value?(openBlock(),createElementBlock("div",_hoisted_1$8,[(openBlock(),createElementBlock("div",{class:"cropper-box",key:unref(sg)+""},[createVNode(unref(M),{ref_key:"cropper",ref:Ig,img:og.value,autoCrop:"",outputType:"png",fixed:unref(sg),fixedNumber:unref(Cg)},null,8,["img","fixed","fixedNumber"])])),createBaseVNode("div",_hoisted_2$5,[createVNode(mg,{checked:unref(sg),"onUpdate:checked":bg[0]||(bg[0]=wg=>isRef$1(sg)?sg.value=wg:null),class:"keep-ratio"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.commonUi.keepAspectRatio")),1)]),_:1},8,["checked"]),createVNode(hg,null,{default:withCtx(()=>[createVNode(unref(RotateLeftOutlined),{onClick:lg}),createVNode(unref(RotateRightOutlined),{onClick:Ag}),createVNode(unref(PlusSquareOutlined),{onClick:bg[1]||(bg[1]=wg=>cg(1))}),createVNode(unref(MinusSquareOutlined),{onClick:bg[2]||(bg[2]=wg=>cg(-1))})]),_:1})]),createBaseVNode("div",_hoisted_3$5,[createVNode(hg,null,{default:withCtx(()=>[createVNode(pg,{onClick:ug,size:"large"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.actions.cancel")),1)]),_:1}),createVNode(pg,{type:"primary",onClick:rg,size:"large"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("common.commonUi.crop")),1)]),_:1})]),_:1})])])):createCommentVNode("",!0)]),_:1},8,["open","title"])}}}),cutImgModal=_export_sfc(_sfc_main$9,[["__scopeId","data-v-e323664b"]]),_hoisted_1$7={key:0,class:"property"},_hoisted_2$4={class:"title"},_hoisted_3$4=["src","title"],_hoisted_4$4=["src","title"],_hoisted_5$4=["src","title"],_hoisted_6$4=["src","title"],_sfc_main$8=defineComponent({__name:"text-group-config",props:{selectObj:{type:Object,default:{}},editorCtrl:{type:Object,default:{}}},setup(tg){var mg;const{t:eg}=useI18n(),gg=tg,ig=ref();let ng=((mg=gg.selectObj)==null?void 0:mg.getObjects())||[],og=[];const ag=ref([]),Ig=ref(!1),sg=ref(void 0);useFont(sg);const Cg=ref([]),lg=ref("");function Ag(hg){var fg;(hg.type==="text"||hg.type==="textbox"||hg.type==="counter")&&hg.initDimensions(),hg.setCoords();let pg=hg.group;for(;pg;)pg.dirty=!0,pg.triggerLayout("childUpdate"),pg.setCoords(),pg=pg.group;(fg=hg.canvas)==null||fg.requestRenderAll()}const cg=()=>{let hg=Number((lg.value+"").replace(/[^\d.]/g,""));og.forEach(pg=>{hg>0&&(pg.type==="text"||pg.type==="counter")&&(pg.set("fontSize",ptToPx(+hg)),pg.set("scaleX",1),pg.set("scaleY",1),Ag(pg))})},rg=hg=>{hg.preventDefault(),hg.stopPropagation(),ig.value&&ig.value.blur()},ug=()=>{};let dg=()=>{};onMounted(()=>{getFontList().then(pg=>{ag.value=pg});const hg=pg=>{pg.type==="group"&&pg._objects?pg._objects.forEach(fg=>hg(fg)):(pg.type==="text"||pg.type==="counter")&&og.push(pg)};if(ng.forEach(pg=>hg(pg)),Ig.value=og.length>0,og.length){const pg=og[0],fg=Gg=>og.every(Zg=>Gg(Zg)===Gg(pg)),wg=Gg=>{const Zg=[];return Gg.underline&&Zg.push("underline"),Gg.linethrough&&Zg.push("linethrough"),Gg.fontWeight&&Zg.push(Gg.fontWeight),(Gg.fontStyle==="italic"||Gg.hasSetItalic)&&Zg.push("italic"),Zg.join(",")};sg.value=fg(Gg=>Gg.fontFamily)?pg.fontFamily:void 0,lg.value=fg(Gg=>pxToPt(Gg.fontSize))?pxToPt(pg.fontSize):"",Cg.value=fg(wg)?wg(pg).split(",").filter(Boolean):[],dg=watch(Cg,Gg=>{og.forEach(Zg=>{(Zg.type==="text"||Zg.type==="counter")&&(Zg.set("underline",Gg.includes("underline")),Zg.set("linethrough",Gg.includes("linethrough")),Zg.set("fontWeight",Gg.includes("bold")?"bold":"normal"),Zg.set("fontStyle",Gg.includes("italic")?"italic":"normal"),Zg.canvas.requestRenderAll())})})}});const bg=hg=>{og.forEach(pg=>{(pg.type==="text"||pg.type==="counter")&&(pg.set("fontFamily",hg),pg.canvas.requestRenderAll())})};return onUnmounted(()=>{dg()}),(hg,pg)=>{const fg=Select,wg=__unplugin_components_3$3,Gg=Input,Zg=__unplugin_components_3$5,yg=__unplugin_components_5$2;return unref(Ig)?(openBlock(),createElementBlock("div",_hoisted_1$7,[createBaseVNode("span",_hoisted_2$4,toDisplayString$1(unref(eg)("editor.copy.f4d3dab8e0")),1),createVNode(fg,{placeholder:unref(eg)("editor.copy.b088a3713a"),"show-search":"",value:unref(sg),"onUpdate:value":pg[0]||(pg[0]=Bg=>isRef$1(sg)?sg.value=Bg:null),style:{width:"100%","margin-bottom":"10px"},options:unref(ag),onChange:bg},null,8,["placeholder","value","options"]),createVNode(yg,{justify:"space-between"},{default:withCtx(()=>[createVNode(wg,null,{default:withCtx(()=>[createVNode(IconCheckBox,{value:unref(Cg),"onUpdate:value":pg[1]||(pg[1]=Bg=>isRef$1(Cg)?Cg.value=Bg:null),values:["bold","italic","linethrough","underline"]},{default:withCtx(({index:Bg})=>[Bg===0?(openBlock(),createElementBlock("img",{key:0,src:unref(IconTextBold),title:unref(eg)("editor.copy.f670b2adc0")},null,8,_hoisted_3$4)):createCommentVNode("",!0),Bg===1?(openBlock(),createElementBlock("img",{key:1,src:unref(IconTextItalic),title:unref(eg)("editor.copy.af5a2c8bff")},null,8,_hoisted_4$4)):createCommentVNode("",!0),Bg===2?(openBlock(),createElementBlock("img",{key:2,src:unref(IconTextStrikethrough),title:unref(eg)("editor.copy.c85de9e58a")},null,8,_hoisted_5$4)):createCommentVNode("",!0),Bg===3?(openBlock(),createElementBlock("img",{key:3,src:unref(IconTextUnderline),title:unref(eg)("editor.copy.9bc18ae51e")},null,8,_hoisted_6$4)):createCommentVNode("",!0)]),_:1},8,["value"])]),_:1}),createVNode(wg,{class:"font-size-box",title:unref(eg)("editor.copy.576ccdb1f1")},{default:withCtx(()=>[createVNode(Zg,{ref_key:"autoRef",ref:ig,placeholder:unref(eg)("editor.copy.cee8bcba20"),onChange:cg,value:unref(lg),"onUpdate:value":pg[2]||(pg[2]=Bg=>isRef$1(lg)?lg.value=Bg:null),options:unref(defaultFontSize),style:{width:"90px"},"show-arrow":!0},{default:withCtx(()=>[createVNode(Gg,{onKeydown:withKeys(rg,["enter"]),onBlur:ug})]),_:1},8,["placeholder","value","options"]),pg[3]||(pg[3]=createBaseVNode("div",{class:"font-pt"},"pt",-1))]),_:1},8,["title"])]),_:1})])):createCommentVNode("",!0)}}}),textGroupConfig=_export_sfc(_sfc_main$8,[["__scopeId","data-v-e436c067"]]),_hoisted_1$6={class:"property"},_hoisted_2$3={class:"title"},_hoisted_3$3={class:"laser-fields"},_hoisted_4$3={class:"laser-label"},_hoisted_5$3={class:"laser-unit"},_hoisted_6$3={key:1,class:"no-preset-tip"},_sfc_main$7=defineComponent({__name:"LaserConfig",props:{editorCtrl:{type:Object},selectObj:{type:Object,default:null}},setup(tg){const eg=getLaserPresets(),{t:gg}=useI18n(),ig=tg,ng=[{key:"repeatTimes",label:"laserConfig.paramLabels.repeatTimes",min:0,max:1e4,defaultValue:1,unit:"",status:0},{key:"scanSpeed",label:"laserConfig.paramLabels.scanSpeed",min:0,max:65535,defaultValue:3e3,unit:"mm/s",status:0},{key:"jumpSpeed",label:"laserConfig.paramLabels.jumpSpeed",min:0,max:65535,defaultValue:3e3,unit:"mm/s",status:0},{key:"power",label:"laserConfig.paramLabels.power",min:0,max:100,defaultValue:20,unit:"%",status:1},{key:"frequence",label:"laserConfig.paramLabels.frequence",min:0,max:4e3,defaultValue:200,unit:"khz",status:0},{key:"pulseWidth",label:"laserConfig.paramLabels.pulseWidth",min:0,max:500,defaultValue:50,unit:"ns",status:0},{key:"openLightDelay",label:"laserConfig.paramLabels.openLightDelay",min:-1e3,max:2e3,defaultValue:0,unit:"us",status:0},{key:"closeLightDelay",label:"laserConfig.paramLabels.closeLightDelay",min:-1e3,max:2e3,defaultValue:0,unit:"us",status:0},{key:"endDelay",label:"laserConfig.paramLabels.endDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0},{key:"trunDelay",label:"laserConfig.paramLabels.trunDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0},{key:"jumpDelay",label:"laserConfig.paramLabels.jumpDelay",min:0,max:2e3,defaultValue:0,unit:"us",status:0}],og=hg=>gg(hg.label),ag=ref([...ng]),Ig=ref(void 0),sg=reactive({});(()=>{ng.forEach(hg=>{sg[hg.key]=hg.defaultValue})})();const lg=hg=>eg.value.find(pg=>pg.configId===hg),Ag=()=>{var fg,wg;const hg=new Set;return(((wg=(fg=ig.editorCtrl)==null?void 0:fg.getObjects)==null?void 0:wg.call(fg))||[]).forEach(Gg=>{var yg;const Zg=(yg=Gg.customExportFields)==null?void 0:yg.laserConfigId;Zg&&hg.add(Zg)}),hg},cg=hg=>{const pg=getLaserMaxPresets();if(pg<=0||hg===Ig.value)return!1;const fg=Ag();return fg.has(hg)?!1:fg.size>=pg},rg=()=>{if(!Ig.value)return;const hg=lg(Ig.value);hg&&(ag.value=hg.params.map(pg=>{const fg=ng.find(wg=>wg.key===pg.key);return{...pg,status:pg.status??(fg==null?void 0:fg.status)??0}}),hg.params.forEach(pg=>{sg[pg.key]=pg.defaultValue}))},ug=()=>{var pg,fg,wg;const hg=ig.selectObj;hg&&(hg.set("customExportFields",{laserConfigId:Ig.value||""}),(wg=(fg=(pg=ig.editorCtrl)==null?void 0:pg.editor)==null?void 0:fg.canvas)==null||wg.fire("custom:object:checkdirty",{isToDirty:!0}))},dg=()=>{if(!Ig.value)return;const hg=lg(Ig.value);hg&&(hg.params.forEach(pg=>{sg[pg.key]!=null&&(pg.defaultValue=sg[pg.key])}),ug())},bg=hg=>{Ig.value=hg||void 0,hg?rg():ag.value=[...ng],ug()},mg=()=>{var fg;const hg=ig.selectObj;if(!hg)return;const pg=(fg=hg.customExportFields)==null?void 0:fg.laserConfigId;if(pg&&lg(pg)){Ig.value=pg,rg();return}if(eg.value.length>0){const wg=eg.value[0];Ig.value=wg.configId,ag.value=wg.params,rg(),ug()}};return watch(()=>ig.selectObj,()=>{ig.selectObj&&mg()},{immediate:!0}),watch(eg,()=>{ig.selectObj&&mg()},{deep:!0}),(hg,pg)=>{const fg=__unplugin_components_0$4,wg=SelectOption,Gg=Select,Zg=__unplugin_components_3$3,yg=__unplugin_components_4$1,Bg=__unplugin_components_5$2;return openBlock(),createElementBlock(Fragment,null,[createVNode(fg),createBaseVNode("div",_hoisted_1$6,[createBaseVNode("span",_hoisted_2$3,toDisplayString$1(unref(gg)("editor.specialist.laser.title")),1),unref(eg).length?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(Gg,{value:Ig.value,"onUpdate:value":pg[0]||(pg[0]=Wg=>Ig.value=Wg),style:{width:"100%","margin-bottom":"10px"},placeholder:unref(gg)("editor.specialist.laser.selectPreset"),onChange:bg},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(eg),Wg=>(openBlock(),createBlock(wg,{key:Wg.configId,value:Wg.configId,disabled:cg(Wg.configId)},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Wg.configName),1)]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["value","placeholder"]),createBaseVNode("div",_hoisted_3$3,[(openBlock(!0),createElementBlock(Fragment,null,renderList(ag.value,Wg=>(openBlock(),createBlock(Bg,{key:Wg.key,class:"laser-row"},{default:withCtx(()=>[createVNode(Zg,{span:11,class:"laser-label-col"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_4$3,toDisplayString$1(og(Wg)),1)]),_:2},1024),createVNode(Zg,{span:8},{default:withCtx(()=>[createVNode(yg,{value:sg[Wg.key],"onUpdate:value":$g=>sg[Wg.key]=$g,step:1,min:Wg.min,max:Wg.max,precision:0,disabled:Wg.status!==1,style:{width:"100%"},size:"small",onChange:dg},null,8,["value","onUpdate:value","min","max","disabled"])]),_:2},1024),createVNode(Zg,{span:2,class:"laser-unit-col"},{default:withCtx(()=>[createBaseVNode("span",_hoisted_5$3,toDisplayString$1(Wg.unit),1)]),_:2},1024)]),_:2},1024))),128))])],64)):(openBlock(),createElementBlock("span",_hoisted_6$3,toDisplayString$1(unref(gg)("editor.specialist.laser.noPreset")),1))])],64)}}}),LaserConfig=_export_sfc(_sfc_main$7,[["__scopeId","data-v-37af2c09"]]),_hoisted_1$5={class:"preview-panel"},_hoisted_2$2={class:"preview-title"},_hoisted_3$2=["title"],_hoisted_4$2=["src"],_hoisted_5$2={class:"preview-hover-tip"},_hoisted_6$2={class:"preview-modal-picture"},_hoisted_7$1=["src"],_sfc_main$6=defineComponent({__name:"PreviewPanel",props:{images:{}},setup(tg){const eg=ref(!1),gg=()=>{eg.value=!0};return(ig,ng)=>{const og=Modal$1;return openBlock(),createElementBlock("div",_hoisted_1$5,[createBaseVNode("div",_hoisted_2$2,toDisplayString$1(ig.$t("common.commonUi.preview"))+":",1),createBaseVNode("button",{type:"button",class:"preview-picture",title:ig.$t("common.commonUi.clickPreview"),onClick:gg},[(openBlock(!0),createElementBlock(Fragment,null,renderList(tg.images,(ag,Ig)=>(openBlock(),createElementBlock("img",{key:Ig+"-"+ag.length,class:normalizeClass(["preview-layer-img",{single:tg.images.length===1}]),src:ag,alt:"",style:normalizeStyle$1({zIndex:Ig+1})},null,14,_hoisted_4$2))),128)),createBaseVNode("span",_hoisted_5$2,toDisplayString$1(ig.$t("common.commonUi.clickPreview")),1)],8,_hoisted_3$2),createVNode(og,{open:eg.value,"onUpdate:open":ng[0]||(ng[0]=ag=>eg.value=ag),title:ig.$t("common.commonUi.preview"),width:"760px",footer:null,centered:"","destroy-on-close":!1,"wrap-class-name":"preview-modal-wrap"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_6$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tg.images,(ag,Ig)=>(openBlock(),createElementBlock("img",{key:Ig+"-"+ag.length,class:"preview-modal-layer-img",src:ag,alt:"",style:normalizeStyle$1({zIndex:Ig+1})},null,12,_hoisted_7$1))),128))])]),_:1},8,["open","title"])])}}}),PreviewPanel=_export_sfc(_sfc_main$6,[["__scopeId","data-v-0eb09ddb"]]);function createLatestAsyncTaskRunner(tg){let eg,gg=!1,ig;const ng=async()=>{for(;gg;)gg=!1,await tg(eg)};return og=>(eg=og,gg=!0,ig||(ig=ng().finally(()=>{ig=void 0})),ig)}const _hoisted_1$4={key:0,class:"right-side-bar"},_hoisted_2$1={key:1,class:"preview-box"},_hoisted_3$1={class:"preview-settings-scroll"},_hoisted_4$1={class:"background-panel"},_hoisted_5$1={class:"background-row"},_hoisted_6$1={class:"background-label"},_hoisted_7={class:"background-row background-image-row"},_hoisted_8={class:"background-label"},_hoisted_9={class:"background-actions"},_hoisted_10={key:0,class:"background-thumb"},_hoisted_11=["src"],_hoisted_12={key:0,class:"ribbon-pattern"},_hoisted_13={class:"ribbon-title"},_hoisted_14={key:0,class:"ribbon-current-preview"},_hoisted_15=["src"],_hoisted_16={class:"ribbon-modal-grid"},_hoisted_17=["onClick"],_hoisted_18=["src"],_hoisted_19={key:1,class:"layer-panel"},_hoisted_20={class:"layer-title"},_hoisted_21=["disabled"],_hoisted_22={class:"layer-list"},_hoisted_23=["onClick"],_hoisted_24=["onDblclick"],_hoisted_25=["onClick"],_hoisted_26=["onClick"],_sfc_main$5=defineComponent({__name:"index@RightSideBar",setup(tg){const eg=ref("1"),{t:gg}=useI18n(),ig=maxCountVal,ng=ref(""),og=ref([]),ag=ref({}),Ig=useTabsStore(),sg=useAppStore(),Cg=ref("none"),lg=ref(!1),Ag=RIBBON_BORDER_PATTERN_OPTIONS,cg=ref({}),rg=ref("#FFFFFFFF"),ug=ref(""),dg=ref(!0),bg=ref(0),mg=ref(!1),hg=ref(!1),pg=ref(""),fg=ref(""),wg=ref(null),Gg=computed(()=>{var uI;const mI=(uI=Ig.getActiveTab)==null?void 0:uI.call(Ig);return(mI==null?void 0:mI.layers)||[]}),Zg=computed(()=>{var mI,uI;return((uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))==null?void 0:uI.activeLayerId)||""}),yg=computed(()=>{var mI;return getTabLayerMaxCount((mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))}),Bg=computed(()=>{var mI,uI;return state$1.isSeparateLayerMode||((uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig))==null?void 0:uI.separateLayerMode)===!0}),Wg=computed(()=>state$1.isMultiLayerEnabled&&yg.value>1&&Gg.value.length>0),$g=computed(()=>Ng(Cg.value)),Ng=mI=>mI==="none"?gg("editor.shell.noStroke"):gg("editor.shell.patternNumber",{number:Number(mI.replace("ribbon-",""))}),vg=computed(()=>cg.value[Cg.value]||""),Xg=ref(!1),Vg=ref(""),Mg=ref(!0),Rg=ref(),Sg=ref(""),Yg=ref(),xg=ref(""),Og=new Set(barcodeType.map(mI=>mI.type)),Kg=computed(()=>Og.has(Vg.value)?"1D":"2D"),Dg=getEditorConfig(),Fg=ref(new EditorCtrl),Tg=ref(!1),Jg=ref(!0),Eg=ref(!0),co=ref(null),da=ref(!1),ma=ref(!1),pa=ref(""),eI=ref(""),Qg=ref({width:0,height:0}),Ca=ref(0),uo=computed(()=>{var mI;return(mI=co.value)==null?void 0:mI.id}),eo=computed(()=>Eg.value&&xg.value!==""&&!!co.value);watch(uo,()=>{eg.value="1"});let no=[],kg,Lg=0,Pg=null;const ua=()=>kg==null?void 0:kg.getPlugin("HistoryPlugin"),ya=mI=>{var uI;mI&&((uI=ua())==null||uI.switchScope(mI))},oI=()=>{setFileDirty(Ig.activeId,!0)},iI=mI=>{if(!mI)return"#FFFFFFFF";if(mI.startsWith("#")){if(mI.length===7||mI.length===9)return mI;if(mI.length===4)return`${expandHexColor(mI)}FF`}const uI=mI.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)/);if(!uI)return"#FFFFFFFF";const[,$I,NI,MI,KI="1"]=uI,JI=Number(KI)<=1?Number(KI):Number(KI)/255,qI=[$I,NI,MI].map(vI=>Math.max(0,Math.min(255,Number(vI))).toString(16).toUpperCase().padStart(2,"0")).join(""),is=Math.round(JI*255).toString(16).toUpperCase().padStart(2,"0");return`#${qI}${is}`},oa=()=>{var NI,MI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=(mI==null?void 0:mI.config)||(kg==null?void 0:kg.labelConfig),$I=resolveLayerStyle(uI,mI!=null&&mI.layerStyleIndependent?(MI=getActiveLayer(mI))==null?void 0:MI.style:void 0);rg.value=iI($I.backgroundColor),ug.value=$I.backgroundImage||"",dg.value=$I.backgroundImageCover!==!1,bg.value++},ha=async(mI=!1,uI)=>{var vI;const $I=(vI=Ig.getActiveTab)==null?void 0:vI.call(Ig),NI=uI||getActiveLayer($I),MI=resolveLayerStyle(($I==null?void 0:$I.config)||(kg==null?void 0:kg.labelConfig),$I!=null&&$I.layerStyleIndependent?NI==null?void 0:NI.style:void 0),KI=iI(mI?rg.value:MI.backgroundColor),JI=mI?ug.value||"":MI.backgroundImage||"",qI=mI?dg.value:MI.backgroundImageCover;mI&&($I!=null&&$I.config)&&($I.layerStyleIndependent&&NI?NI.style=diffLayerStyle($I.config,{...MI,backgroundColor:KI,backgroundImage:JI,backgroundImageCover:qI}):($I.config.backgroundColor=KI,$I.config.backgroundImage=JI,$I.config.backgroundImageCover=qI,kg!=null&&kg.labelConfig&&(kg.labelConfig.backgroundColor=KI,kg.labelConfig.backgroundImage=JI,kg.labelConfig.backgroundImageCover=qI)));const is=kg==null?void 0:kg.getPlugin("WorkspacePlugin");await(is==null?void 0:is.setBackground({color:KI,image:JI,cover:qI})),mI&&(ag.value={},oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0}),xa(!0))},nI=async(mI,uI)=>{mI.length===7?rg.value=addAlphaToHex(mI,uI):mI.length===4&&(rg.value=addAlphaToHex(expandHexColor(mI),uI)),await ha(!0)},cI=()=>{mg.value=!0},dI=async mI=>{ug.value=mI||"",await ha(!0)},pI=async mI=>{var uI;dg.value=((uI=mI.target)==null?void 0:uI.checked)===!0,await ha(!0)},Ug=async()=>{ug.value="",await ha(!0)},La=mI=>{if(!mI)return!1;try{const uI=JSON.parse(mI);return Array.isArray(uI.objects)?uI.objects.some($I=>$I.id!=="workspace"):!1}catch{return!1}},aI=(mI,uI)=>{var $I,NI;return((NI=($I=Ig.getActiveTab)==null?void 0:$I.call(Ig))==null?void 0:NI.layerStyleIndependent)===!0||uI===0||La(mI.canvas)},CI=(mI,uI)=>{const $I=uI??(mI?ag.value[mI.id]:"");return og.value=$I?[$I]:[],ng.value=$I||"",!0},fa=(mI,uI=!1)=>{var MI;if(Bg.value)return CI(getActiveLayer((MI=Ig.getActiveTab)==null?void 0:MI.call(Ig)));const $I=mI.filter(aI),NI=$I.map(KI=>ag.value[KI.id]).filter(Boolean);return!NI.length||!uI&&NI.length!==$I.length?!1:(og.value=NI,ng.value=NI[NI.length-1]||"",!0)},zg=(mI,uI,$I=!1)=>{var vI,TI,us;const NI=Math.max(0,mI.findIndex(hs=>hs.id===uI.id)),MI=!!ag.value[((vI=mI[0])==null?void 0:vI.id)||""];if(!Bg.value&&NI>0&&!La(uI.canvas)){const hs={...ag.value};return delete hs[uI.id],ag.value=hs,""}const KI=$I&&!MI,JI=!((us=(TI=Ig.getActiveTab)==null?void 0:TI.call(Ig))!=null&&us.layerStyleIndependent)&&!Bg.value&&NI>0&&!KI,qI=qg(JI),is=KI&&NI>0;return qI&&!is&&(ag.value={...ag.value,[uI.id]:qI}),qI},Hg=()=>{ma.value=!0,pa.value="";let mI=kg==null?void 0:kg.getActiveObject();if(pa.value=mI&&mI.getSrc?mI.getSrc():"",mI){let uI=mI._element;Qg.value={width:uI.width,height:uI.height}}},ca=mI=>{if(!kg)return;let uI=kg==null?void 0:kg.getActiveObject();sa(kg,uI,mI)},tI=()=>{if(!kg)return;pa.value="",da.value=!0,Sg.value=gg("editor.shell.replaceImage");let mI=kg==null?void 0:kg.getActiveObject();pa.value=mI&&mI.getSrc?mI.getSrc():"",eI.value=new Date().valueOf()+""},jg=mI=>{if(!kg)return;let uI=kg==null?void 0:kg.getActiveObject();sa(kg,uI,mI||"")},lo=({editorCtrl:mI,object:uI})=>{console.log("doubleClick",uI,mI);let $I=(uI==null?void 0:uI.increaseCount)||(uI==null?void 0:uI.increaseDate)&&(uI==null?void 0:uI.barcodeDateFormatType)||!1,NI=!0;if(uI.addCombObject){let MI=uI.connectObjIds;NI=!MI||MI.length===1&&!MI[0].id||MI.length===0}Mg.value=!$I&&NI,Yg.value&&Yg.value.stop(),uI.type==="barcode"?(Vg.value=uI==null?void 0:uI.barcodeOptions.bcid,Sg.value=Mg.value?gg("editor.shell.enterBarcode"):gg("editor.shell.viewBarcode"),Rg.value=mI.bcConfig.content,Yg.value=watch(Xg,MI=>{!MI&&Rg.value&&(mI.bcConfig.content=Rg.value)},{immediate:!1}),Xg.value=!0):uI.type==="barcode2d"&&(((uI==null?void 0:uI.barcode2dOptions.bcid)==="LPCode"||(uI==null?void 0:uI.barcode2dOptions.bcid)==="LPMixQrCode")&&(uI==null||uI.clearErrorLpCodeMap()),Vg.value=uI==null?void 0:uI.barcode2dOptions.bcid,Sg.value=Mg.value?gg("editor.shell.enterQrCode"):gg("editor.shell.viewQrCode"),Rg.value=mI.bc2dConfig.content,Yg.value=watch(Xg,MI=>{!MI&&Rg.value&&(mI.bc2dConfig.content=Rg.value)},{immediate:!1}),Xg.value=!0)},sa=async(mI,uI,$I)=>{if(!$I)return;let NI=uI;NI.setCoords(),NI.set("prevCoordsPoints",NI.aCoords);const MI={left:NI.left,top:NI.top,width:NI.getScaledWidth(),height:NI.getScaledHeight(),angle:NI.angle,imgScaleType:NI.imgScaleType,scaleX:1,scaleY:1,flipX:NI.flipX,flipY:NI.flipY,setGrayFilter:NI.setGrayFilter||!1};let KI=mI==null?void 0:mI.getCanvas();KI.discardActiveObject();try{NI.visible=!1,NI.set("noSetOtherPrevCoordsPoints",!0),await NI.setSrc($I,{crossOrigin:"anonymous"});let JI=NI._element,qI=JI.width/JI.height,is=NI.imgScaleType,vI=qI>1?"3":(qI<1,"2");["2","3"].includes(is)&&(is=vI),NI.set({...MI,isScaleOtherSidedys:["2","3"].includes(is),imgScaleType:is}),NI.visible=!0,KI.setActiveObject(NI),KI==null||KI.requestRenderAll(),setTimeout(()=>{NI.dirty=!0,NI.set("noSetOtherPrevCoordsPoints",!1),NI.refreshAlignCoords(),KI==null||KI.fire("custom:object:history",{target:NI,action:"history:update"})},100)}catch{NI.set("noSetOtherPrevCoordsPoints",!1)}},qg=(mI=!1,uI=Cg.value)=>{if(!kg)return;kg.ribbonBorderPattern=uI;const $I=kg.toDataUrl({exclude:mI?["workspace"]:[],ribbonBorderPattern:uI,isJudgeGrid:!0});return typeof $I=="string"?$I:($I==null?void 0:$I.toDataURL("image/png",1))||""},ga=async mI=>{var KI,JI;if(!kg)return;const uI=(KI=Ig.getActiveTab)==null?void 0:KI.call(Ig),$I=resolveLayerStyle(uI==null?void 0:uI.config,uI!=null&&uI.layerStyleIndependent?mI.style:void 0),NI=((JI=$I.ribbonBorder)==null?void 0:JI.pattern)||"none",MI=$I.ribbonBorder||await createRibbonBorderTextureData(NI);return kg.ribbonBorderPattern=NI,!(uI!=null&&uI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=MI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(MI)),await ha(!1,mI),NI},va=mI=>new Promise(uI=>{if(!kg){uI();return}if(mI.canvas){kg.fromTemplateJson(mI.canvas,()=>{emitter.emit("refresh-editor",kg),setTimeout(uI,30)});return}kg.getObjects().filter($I=>$I.id!=="workspace").forEach($I=>kg==null?void 0:kg.removeObject($I)),kg.getCanvas().requestRenderAll(),uI()}),sI=async(mI,uI,$I)=>{var MI;if(!kg)return;await new Promise(KI=>{kg==null||kg.fromTemplateJson(uI,()=>{emitter.emit("refresh-editor",kg),setTimeout(KI,30)})});const NI=(MI=Ig.getActiveTab)==null?void 0:MI.call(Ig);NI&&setTabActiveLayer(NI,mI),await II(),await ha(!1,mI),$I&&(kg.getCanvas().setViewportTransform($I),kg.getCanvas().requestRenderAll())},_g=createLatestAsyncTaskRunner(async(mI=!1)=>{var hs,dl;if(!kg)return;const uI=++Lg,$I=(hs=Ig.getActiveTab)==null?void 0:hs.call(Ig),NI=$I?normalizeLayers($I):[],MI=getActiveLayer($I);if(!state$1.isMultiLayerEnabled||!$I||!MI||NI.length<=1){const EI=qg()||"";ng.value=EI,og.value=EI?[EI]:[];return}if(!isLayerCanvasStable())return;MI.canvas=attachLayerIdToCanvas(kg.toJSON(),MI.id);const KI=zg(NI,MI,mI);if(Bg.value){CI(MI,KI);return}if(fa(NI))return;const JI=kg.getCanvas().elements.container,qI=(dl=kg.getCanvas().viewportTransform)==null?void 0:dl.slice(),is=JI.style.visibility,vI=ua(),TI=(vI==null?void 0:vI.pause)||!1;vI&&(vI.pause=!0),JI.style.visibility="hidden",clearTimeout(Pg),setPreviewRendering(!0);const us=[];try{for(const[EI,ul]of NI.entries()){if(uI!==Lg)return;if(!aI(ul,EI)){const nl={...ag.value};delete nl[ul.id],ag.value=nl;continue}await va(ul);const Al=await ga(ul),$l=qg(EI>0&&$I.layerStyleIndependent!==!0,Al);$l&&(us.push($l),ag.value={...ag.value,[ul.id]:$l})}uI===Lg&&(og.value=us,ng.value=us[us.length-1]||"")}finally{try{await sI(MI,MI.canvas||kg.toJSON(),qI),ya(MI.id)}finally{vI&&(vI.pause=TI),JI.style.visibility=is,setPreviewRendering(!1)}}}),xa=(mI=!1)=>_g(mI),lI=async()=>{if(Object.keys(cg.value).length===Ag.length)return;const mI=await Promise.all(Ag.map(async uI=>{const $I=await createRibbonBorderPreview(uI.value);return[uI.value,$I]}));cg.value=Object.fromEntries(mI)},gI=async()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=await createRibbonBorderTextureData(Cg.value);if(mI)if(mI.layerStyleIndependent){const MI=getActiveLayer(mI);MI&&(MI.style=diffLayerStyle(mI.config,{...resolveLayerStyle(mI.config,MI.style),ribbonBorder:uI}))}else mI.ribbonBorderPattern=Cg.value,mI.config.ribbonBorder=uI;const $I=await createRibbonBorderPreview(Cg.value);cg.value={...cg.value,[Cg.value]:$I},kg&&(kg.ribbonBorderPattern=Cg.value,!(mI!=null&&mI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=uI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(uI)),kg.getCanvas().requestRenderAll(),kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})),oI(),xa(!0)},II=async()=>{var $I,NI,MI;const mI=($I=Ig.getActiveTab)==null?void 0:$I.call(Ig),uI=resolveLayerStyle(mI==null?void 0:mI.config,mI!=null&&mI.layerStyleIndependent?(NI=getActiveLayer(mI))==null?void 0:NI.style:void 0);if(Cg.value=((MI=uI.ribbonBorder)==null?void 0:MI.pattern)||(mI==null?void 0:mI.ribbonBorderPattern)||(kg==null?void 0:kg.ribbonBorderPattern)||"none",!cg.value[Cg.value]){const KI=await createRibbonBorderPreview(Cg.value);cg.value={...cg.value,[Cg.value]:KI}}if(kg){kg.ribbonBorderPattern=Cg.value;try{const KI=await createRibbonBorderTextureData(Cg.value);mI&&!mI.layerStyleIndependent&&(mI.ribbonBorderPattern=Cg.value,mI.config.ribbonBorder=KI),!(mI!=null&&mI.layerStyleIndependent)&&kg.labelConfig&&(kg.labelConfig.ribbonBorder=KI),kg.setRibbonBorderTextures(await loadRibbonBorderTextureImages(KI))}catch(KI){console.log("loadRibbonBorderTextureImages error",KI)}kg.getCanvas().requestRenderAll()}},AI=async()=>{await lI(),lg.value=!0},rI=async mI=>{Cg.value=mI,lg.value=!1,await gI()},bI=()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig),uI=getActiveLayer(mI);if(!mI||!uI||!kg)return;uI.canvas=attachLayerIdToCanvas(kg.toJSON(),uI.id);const $I=normalizeLayers(mI);zg($I,uI),fa($I,!0),setTabActiveLayer(mI,uI)},hI=mI=>{var is,vI;const uI=(is=Ig.getActiveTab)==null?void 0:is.call(Ig);if(!uI||!kg)return Promise.resolve();const $I=kg.getCanvas().elements.container,NI=(vI=kg.getCanvas().viewportTransform)==null?void 0:vI.slice(),MI=ua(),KI=(MI==null?void 0:MI.pause)||!1;MI&&(MI.pause=!0),$I.style.visibility="hidden";const JI=()=>{!NI||!kg||(kg.getCanvas().setViewportTransform(NI),kg.getCanvas().requestRenderAll())},qI=()=>new Promise(TI=>{setTimeout(async()=>{try{oa(),await II(),await ha(!1),JI(),ya(mI.id)}finally{MI&&(MI.pause=KI),$I.style.visibility=""}emitter.emit("refresh-object-list");const hs=normalizeLayers(uI);zg(hs,mI),fa(hs,!0),TI()},30)});return setTabActiveLayer(uI,mI),mI.canvas?new Promise(TI=>{kg.fromTemplateJson(mI.canvas,async()=>{kg==null||kg.getCanvas().discardActiveObject(),emitter.emit("refresh-editor",kg),Fg.value.init(kg),Fg.value.bind(),await qI(),TI()})}):(kg.getObjects().filter(TI=>TI.id!=="workspace").forEach(TI=>kg==null?void 0:kg.removeObject(TI)),qI())},WI=async mI=>{var NI;const uI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!uI||uI.activeLayerId===mI)return;bI();const $I=normalizeLayers(uI).find(MI=>MI.id===mI);if($I){setSwitchingLayer(!0);try{await hI($I)}finally{setSwitchingLayer(!1)}}},wI=async()=>{var NI;if(Bg.value)return;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!mI)return;if(normalizeLayers(mI).length>=yg.value){Message.error(gg("editor.shell.maxLayers",{count:yg.value}));return}bI();const $I=appendLocalizedLayer(mI,mI.config,gg,oI);setSwitchingLayer(!0);try{await hI($I)}finally{setSwitchingLayer(!1)}kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})},fI=async mI=>{var qI,is;if(Bg.value)return;const uI=(qI=Ig.getActiveTab)==null?void 0:qI.call(Ig);if(!uI||Gg.value.length<=1)return;const $I=normalizeLayers(uI),NI=$I.findIndex(vI=>vI.id===mI);if(NI<0)return;const MI=uI.activeLayerId===mI;MI||bI();const KI=$I.filter(vI=>vI.id!==mI);uI.layers=KI;const JI={...ag.value};if(delete JI[mI],ag.value=JI,(is=ua())==null||is.clearScope(mI),MI){const vI=KI[Math.max(0,NI-1)]||KI[0];setSwitchingLayer(!0);try{await hI(vI)}finally{setSwitchingLayer(!1)}}else{const vI=getActiveLayer(uI);vI&&setTabActiveLayer(uI,vI),await xa(!1)}oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})},GI=mI=>{var NI;if(Bg.value)return;const uI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!uI||Gg.value.length<=1)return;const $I=normalizeLayers(uI).find(MI=>MI.id===mI);$I&&showAntModal({title:gg("editor.shell.deleteLayer"),content:gg("editor.shell.deleteLayerConfirm",{name:$I.name}),okText:gg("common.actions.delete"),okType:"danger",cancelText:gg("common.actions.cancel"),centered:!0,onOk:()=>fI(mI)})},VI=mI=>{Bg.value||(pg.value=mI.id,fg.value=mI.name,hg.value=!0,nextTick(()=>{var uI,$I;($I=(uI=wg.value)==null?void 0:uI.focus)==null||$I.call(uI)}))},YI=()=>{var NI;const mI=(NI=Ig.getActiveTab)==null?void 0:NI.call(Ig);if(!mI){kI();return}const uI=normalizeLayers(mI).find(MI=>MI.id===pg.value),$I=fg.value.trim();if(!$I){Message.error(gg("editor.shell.layerNamePlaceholder"));return}uI&&$I&&uI.name!==$I&&(uI.name=$I,oI(),kg==null||kg.getCanvas().fire("custom:object:checkdirty",{isToDirty:!0})),kI()},kI=()=>{hg.value=!1,pg.value="",fg.value=""},jI=()=>{var mI;if(kg&&shouldSyncSelectionPreview(sg.isPrinting,!!kg.getCanvas().getActiveObject())){if(state$1.isMultiLayerEnabled){const uI=(mI=Ig.getActiveTab)==null?void 0:mI.call(Ig),$I=uI?normalizeLayers(uI):[],NI=getActiveLayer(uI);NI&&(NI.canvas=attachLayerIdToCanvas(kg.toJSON(),NI.id),zg($I,NI)),fa($I,!0);return}xa(!0)}},FI=mI=>{if(clearTimeout(Pg),!mI.object){if(kg&&!kg._isShown)return;kg&&!sg.isPrinting&&(Pg=setTimeout(()=>{kg!=null&&kg.getCanvas().getActiveObject()||(Jg.value=!0,xg.value="",Tg.value=!Tg.value,Eg.value=!1,co.value=null,Ca.value=Date.now(),nextTick(jI))},80));return}Jg.value=mI.selectedType!=="line",xg.value=mI.selectedType,Tg.value=!Tg.value,Eg.value=!mI.object.locked,co.value=mI.object,Ca.value=Date.now(),Eg.value&&(ng.value="",og.value=[]),kg&&kg._isShown},xI=mI=>{const uI=mI.target;console.log("objectLockedState",uI,uI.locked),uI&&(Eg.value=!uI.locked)};let UI=null,XI=ref(0);const PI=mI=>{var uI;if(console.log("right update",mI),Fg.value=mI.editorCtrl,kg!==mI.editor){if(kg&&kg.off("custom:object:locked",xI),kg=mI.editor,kg){kg.on("custom:object:locked",xI),oa(),ha(!1),II();const $I=getActiveLayer((uI=Ig.getActiveTab)==null?void 0:uI.call(Ig));ya($I==null?void 0:$I.id)}kg&&(ng.value="",og.value=[],ag.value={},XI.value=Date.now(),Ig.$state.activeSheet=[],Ig.$state.activeSheetTableHeader={},Ig.$state.activeSheetTableData={},Ig.tableDataIndexMap[Ig.activeId]=0,clearTimeout(UI),console.log("eidtorSwitch====="),UI=setTimeout(()=>{cs(),xa()},300))}},HI=mI=>{no=mI;let uI=0,$I=[];no.forEach(NI=>{let MI=NI.databaseSheet,KI=NI.databaseColumn,JI=Ig.$state.sheetMaxLenMap[MI]||0;uI=Math.max(uI,JI),uI>ig&&(uI=ig),NI.databaseMixConcat&&Object.values(NI.databaseMixConcat).forEach(is=>{let vI=Ig.$state.sheetMaxLenMap[is.sheet]||0;uI=Math.max(uI,vI),uI>ig&&(uI=ig)}),(MI&&KI||NI.databaseMixConcat)&&$I.push(NI)}),Ig.$state.maxShowLengthMap[Ig.$state.activeId]=uI||0,emitter.emit("has-database-objects",$I)},gl=computed(()=>Ig.tableDataIndexMap[Ig.activeId]||0),cs=async()=>{if(!Fg.value)return;let mI=[];mI=Fg.value.getConnectDatabaseObjects2(),no=mI,console.log("databaseIndex=====activeId",no),emitter.emit("has-database-objects",no);let uI=0;for(let $I of no){if($I.databaseMixConcat){let NI=Object.values($I.databaseMixConcat);for(let MI of NI){await toGetDatabaseTable({sheet:MI.sheet,start:"0",count:ig});let KI=Ig.$state.sheetMaxLenMap[MI.sheet]||0;uI=Math.max(uI,KI),uI>ig&&(uI=ig)}continue}if($I.databaseSheet){await toGetDatabaseTable({sheet:$I.databaseSheet,start:"0",count:ig});let NI=Ig.$state.sheetMaxLenMap[$I.databaseSheet]||0;uI=Math.max(uI,NI),uI>ig&&(uI=ig)}}Ig.$state.maxShowLengthMap[Ig.$state.activeId]=uI||0,il(0)};function il(mI){let uI=mI<0?0:mI;no.forEach($I=>{let NI=Ig.activeSheetTableData;if($I.type==="barcode2d"&&$I.databaseMixConcat){let JI=$I.barcode2dOptions,qI=[],is=$I.barcode2dOptions.bcid,vI=mixMultCode[is],TI=Object.entries($I.databaseMixConcat);TI.length<vI.length&&(qI=new Array(vI.length).fill(""));for(let[us,hs]of TI){let dl=hs.sheet,EI=hs.column,ul=NI[dl]&&NI[dl][uI]&&NI[dl][uI][EI]||"";qI[us]=ul}$I.setBarcode2DOption({bcid:JI.bcid,text:qI.join("|&&&|")});return}let MI=$I.databaseSheet,KI=$I.databaseColumn;if(NI[MI]){let JI=NI[MI][uI]&&NI[MI][uI][KI]||"",qI=getObjectType($I);if(qI==="text")$I.set("text",JI),$I.tiggerHandleConcatBarcode2d();else if(qI==="barcode2d"){let is=$I.barcode2dOptions;$I.setBarcode2DOption({bcid:is.bcid,text:JI})}else if(qI==="barcode"){let is=$I.barcodeOptions;$I.setBarcodeOption({bcid:is.bcid,text:JI})}}}),no.length&&Fg&&Fg.value.toUpdateCanvas()}let ol=null;watch([gl],([mI])=>{clearTimeout(ol),ol=setTimeout(()=>{Fg.value&&(no=Fg.value.getConnectDatabaseObjects2()),il(mI)},30)});let pl=null;function sl(){Eg.value=!1}const wl=async({done:mI})=>{try{oa(),await II(),await ha(!1),ag.value={},await xa()}finally{mI()}};return emitter.on("editor-switch",PI),onMounted(()=>{emitter.on("dbclick-object",lo),emitter.on("selected-object",FI),emitter.on("refresh-select-obj",mI=>{Eg.value=!mI.locked,co.value=mI,Ca.value=Date.now()}),emitter.on("editor-empty",sl),emitter.on("layer-style-independent-change",wl),emitter.on("refresh-preview",()=>{xa()}),emitter.on("refresh-database",async()=>{Ig.$state.activeSheet=[],Ig.tableDataIndexMap[Ig.activeId]=0,Ig.$state.activeSheetTableHeader={},Ig.$state.activeSheetTableData={},await disconnDatabase("justDisconnect"),await toGetDatabaseSheetList(!0),await cs(),setTimeout(()=>{Message.success(gg("editor.shell.updateSuccess"))},500)}),emitter.on("switch-database",async()=>{clearTimeout(pl),pl=setTimeout(async()=>{await toGetDatabaseSheetList(),await cs()},100)})}),onUnmounted(()=>{clearTimeout(Pg),kg&&kg.off("custom:object:locked",xI),emitter.off("editor-empty",sl),emitter.off("layer-style-independent-change",wl),emitter.off("switch-database"),emitter.off("refresh-database"),emitter.off("editor-switch",PI),emitter.off("dbclick-object",lo),emitter.off("selected-object",FI),emitter.off("refresh-select-obj"),Yg.value!=null&&Yg.value.stop(),emitter.off("refresh-preview")}),(mI,uI)=>{var qI,is;const $I=__unplugin_components_0$5,NI=Tabs,MI=Checkbox,KI=Modal$1,JI=Input;return openBlock(),createElementBlock(Fragment,null,[eo.value?(openBlock(),createElementBlock("div",_hoisted_1$4,[createVNode(NI,{"active-key":eg.value,"onUpdate:activeKey":uI[12]||(uI[12]=vI=>eg.value=vI),size:"small","tab-position":"left",type:"card"},{default:withCtx(()=>[createVNode($I,{key:"1",tab:unref(gg)("editor.shell.settings")},{default:withCtx(()=>[xg.value!==""?(openBlock(),createBlock(resolveDynamicComponent(PositionConfig),{selectedType:xg.value,key:uo.value,data:Fg.value.baseConfig,"onUpdate:data":uI[0]||(uI[0]=vI=>Fg.value.baseConfig=vI),editorCtrl:Fg.value,selectObj:co.value},null,40,["selectedType","data","editorCtrl","selectObj"])):createCommentVNode("",!0),xg.value==="text"||xg.value==="barcode"||xg.value==="barcode2d"||xg.value==="counter"?(openBlock(),createBlock(resolveDynamicComponent(emConfigDatabase),{key:unref(XI)+""+uo.value,data:Fg.value.databaseConfig,"onUpdate:data":uI[1]||(uI[1]=vI=>Fg.value.databaseConfig=vI),selectedType:xg.value,selectObj:co.value,editorCtrl:Fg.value,getObjectList:HI,databaseIndex:gl.value},null,40,["data","selectedType","selectObj","editorCtrl","databaseIndex"])):createCommentVNode("",!0),xg.value==="table"?(openBlock(),createBlock(resolveDynamicComponent(TableConfig),{key:2,data:Fg.value.tableConfig,"onUpdate:data":uI[2]||(uI[2]=vI=>Fg.value.tableConfig=vI)},null,40,["data"])):createCommentVNode("",!0),xg.value==="text"||xg.value==="textname"?(openBlock(),createBlock(resolveDynamicComponent(TextConfig),{key:unref(XI)+""+uo.value,data:Fg.value.textConfig,"onUpdate:data":uI[3]||(uI[3]=vI=>Fg.value.textConfig=vI),editorCtrl:Fg.value,selectObj:co.value,selectedType:xg.value},null,40,["data","editorCtrl","selectObj","selectedType"])):createCommentVNode("",!0),xg.value==="barcode"?(openBlock(),createBlock(resolveDynamicComponent(BCConfig),{key:unref(XI)+""+uo.value,data:Fg.value.bcConfig,"onUpdate:data":uI[4]||(uI[4]=vI=>Fg.value.bcConfig=vI),editorCtrl:Fg.value},null,40,["data","editorCtrl"])):createCommentVNode("",!0),xg.value==="barcode2d"?(openBlock(),createBlock(resolveDynamicComponent(BC2DConfig),{selectObj:co.value,editorCtrl:Fg.value,key:unref(XI)+""+uo.value,data:Fg.value.bc2dConfig,"onUpdate:data":uI[5]||(uI[5]=vI=>Fg.value.bc2dConfig=vI)},null,40,["selectObj","editorCtrl","data"])):createCommentVNode("",!0),xg.value==="rect"?(openBlock(),createBlock(resolveDynamicComponent(RectConfig),{key:6,data:Fg.value.rectConfig,"onUpdate:data":uI[6]||(uI[6]=vI=>Fg.value.rectConfig=vI),editorCtrl:Fg.value},null,40,["data","editorCtrl"])):createCommentVNode("",!0),xg.value==="counter"?(openBlock(),createBlock(resolveDynamicComponent(CounterConfig),{key:unref(XI)+""+uo.value,data:Fg.value.counterConfig,"onUpdate:data":uI[7]||(uI[7]=vI=>Fg.value.counterConfig=vI),selectObj:co.value},null,40,["data","selectObj"])):createCommentVNode("",!0),xg.value==="image"?(openBlock(),createBlock(resolveDynamicComponent(imageConfig),{key:unref(XI)+""+uo.value,editorCtrl:Fg.value,data:Fg.value.imageConfig,"onUpdate:data":uI[8]||(uI[8]=vI=>Fg.value.imageConfig=vI),onToCut:Hg,onToSwitch:tI},null,40,["editorCtrl","data"])):createCommentVNode("",!0),xg.value==="group"||xg.value==="activeselection"?(openBlock(),createBlock(resolveDynamicComponent(textGroupConfig),{selectObj:co.value,editorCtrl:Fg.value,key:unref(XI)+""+uo.value+Ca.value},null,8,["selectObj","editorCtrl"])):createCommentVNode("",!0),unref(Dg).showLaser&&xg.value!=="group"&&xg.value!==""?(openBlock(),createBlock(LaserConfig,{key:10,editorCtrl:Fg.value,selectObj:co.value},null,8,["editorCtrl","selectObj"])):createCommentVNode("",!0)]),_:1},8,["tab"]),createVNode($I,{key:"2",tab:unref(gg)("editor.shell.fillStroke")},{default:withCtx(()=>[xg.value!=="group"&&xg.value!==""?(openBlock(),createBlock(resolveDynamicComponent(FillAndBorder),{key:unref(XI)+""+uo.value,selectedType:xg.value,data:Fg.value.baseConfig,"onUpdate:data":uI[9]||(uI[9]=vI=>Fg.value.baseConfig=vI),"update-flag":Tg.value,"onUpdate:updateFlag":uI[10]||(uI[10]=vI=>Tg.value=vI),"show-fill-config":Jg.value,"onUpdate:showFillConfig":uI[11]||(uI[11]=vI=>Jg.value=vI),selectObj:co.value},null,40,["selectedType","data","update-flag","show-fill-config","selectObj"])):createCommentVNode("",!0)]),_:1},8,["tab"])]),_:1},8,["active-key"])])):createCommentVNode("",!0),eo.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_2$1,[createVNode(PreviewPanel,{images:og.value},null,8,["images"]),createBaseVNode("div",_hoisted_3$1,[createBaseVNode("div",_hoisted_4$1,[createBaseVNode("div",_hoisted_5$1,[createBaseVNode("span",_hoisted_6$1,toDisplayString$1(unref(gg)("editor.shell.backgroundColor")),1),(openBlock(),createBlock(_sfc_main$s,{key:bg.value,class:"background-color","init-color":rg.value,onChangeColor:nI},null,8,["init-color"]))]),createBaseVNode("div",_hoisted_7,[createBaseVNode("span",_hoisted_8,toDisplayString$1(unref(gg)("editor.shell.backgroundImage")),1),createBaseVNode("div",_hoisted_9,[createBaseVNode("button",{class:"background-action",type:"button",onClick:cI},toDisplayString$1(ug.value?unref(gg)("editor.shell.replace"):unref(gg)("common.actions.select")),1),ug.value?(openBlock(),createElementBlock("button",{key:0,class:"background-action danger",type:"button",onClick:Ug},toDisplayString$1(unref(gg)("editor.shell.clear")),1)):createCommentVNode("",!0),ug.value?(openBlock(),createBlock(MI,{key:1,class:"background-cover-checkbox",checked:dg.value,onChange:pI},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(gg)("editor.shell.cover")),1)]),_:1},8,["checked"])):createCommentVNode("",!0)])]),ug.value?(openBlock(),createElementBlock("div",_hoisted_10,[createBaseVNode("img",{src:ug.value,alt:""},null,8,_hoisted_11)])):createCommentVNode("",!0)]),yg.value>1&&((is=(qI=unref(Ig).activeTab)==null?void 0:qI.config)==null?void 0:is.pageShape)!=="Ellipse"?(openBlock(),createElementBlock("div",_hoisted_12,[createBaseVNode("div",_hoisted_13,toDisplayString$1(unref(gg)("editor.shell.borderPattern")),1),createBaseVNode("button",{class:"ribbon-current",type:"button",onClick:AI},[vg.value?(openBlock(),createElementBlock("img",{key:1,class:"ribbon-current-preview",src:vg.value,alt:""},null,8,_hoisted_15)):(openBlock(),createElementBlock("span",_hoisted_14)),createBaseVNode("span",null,toDisplayString$1($g.value),1)]),createVNode(KI,{open:lg.value,"onUpdate:open":uI[13]||(uI[13]=vI=>lg.value=vI),title:unref(gg)("editor.shell.borderPattern"),width:"800px",footer:null,"destroy-on-close":!1},{default:withCtx(()=>[createBaseVNode("div",_hoisted_16,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(Ag),vI=>(openBlock(),createElementBlock("button",{key:vI.value,class:normalizeClass(["ribbon-modal-item",{active:vI.value===Cg.value}]),type:"button",onClick:TI=>rI(vI.value)},[createBaseVNode("img",{class:"ribbon-modal-preview",src:cg.value[vI.value],alt:""},null,8,_hoisted_18),createBaseVNode("span",null,toDisplayString$1(Ng(vI.value)),1)],10,_hoisted_17))),128))])]),_:1},8,["open","title"])])):createCommentVNode("",!0),Wg.value?(openBlock(),createElementBlock("div",_hoisted_19,[createBaseVNode("div",_hoisted_20,[createBaseVNode("span",null,toDisplayString$1(unref(gg)("editor.shell.layers")),1),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("button",{key:0,type:"button",class:normalizeClass(["layer-add",{disabled:Gg.value.length>=yg.value}]),disabled:Gg.value.length>=yg.value,onClick:wI}," + ",10,_hoisted_21))]),createBaseVNode("div",_hoisted_22,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gg.value,vI=>(openBlock(),createElementBlock("button",{key:vI.id,class:normalizeClass(["layer-item",{active:vI.id===Zg.value}]),type:"button",onClick:TI=>WI(vI.id)},[createBaseVNode("span",{class:"layer-name",onDblclick:withModifiers(TI=>VI(vI),["stop"])},toDisplayString$1(vI.name),41,_hoisted_24),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("span",{key:0,class:"layer-edit",onClick:withModifiers(TI=>VI(vI),["stop"])},toDisplayString$1(unref(gg)("editor.shell.rename")),9,_hoisted_25)),Bg.value?createCommentVNode("",!0):(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(["layer-delete",{disabled:Gg.value.length<=1}]),onClick:withModifiers(TI=>GI(vI.id),["stop"])},toDisplayString$1(unref(gg)("common.actions.delete")),11,_hoisted_26))],10,_hoisted_23))),128))])])):createCommentVNode("",!0)])])),createVNode(TextAreaInputModal,{open:Xg.value,"onUpdate:open":uI[14]||(uI[14]=vI=>Xg.value=vI),input:Rg.value,"onUpdate:input":uI[15]||(uI[15]=vI=>Rg.value=vI),title:Sg.value,"onUpdate:title":uI[16]||(uI[16]=vI=>Sg.value=vI),bcid:Vg.value,isCanEdit:Mg.value,barcodeDimension:Kg.value},null,8,["open","input","title","bcid","isCanEdit","barcodeDimension"]),(openBlock(),createBlock(imageInputModal,{key:eI.value,open:da.value,"onUpdate:open":uI[17]||(uI[17]=vI=>da.value=vI),title:Sg.value,"onUpdate:title":uI[18]||(uI[18]=vI=>Sg.value=vI),src:pa.value,onResult:jg},null,8,["open","title","src"])),(openBlock(),createBlock(imageInputModal,{open:mg.value,"onUpdate:open":uI[19]||(uI[19]=vI=>mg.value=vI),src:ug.value,title:unref(gg)("editor.shell.backgroundImage"),key:mg.value+"",onResult:dI},null,8,["open","src","title"])),(openBlock(),createBlock(cutImgModal,{open:ma.value,"onUpdate:open":uI[20]||(uI[20]=vI=>ma.value=vI),key:eI.value,imgInfo:Qg.value,img:pa.value,onGetData:ca},null,8,["open","imgInfo","img"])),createVNode(KI,{open:hg.value,"onUpdate:open":uI[22]||(uI[22]=vI=>hg.value=vI),title:unref(gg)("editor.shell.renameLayer"),"ok-text":unref(gg)("common.actions.confirm"),"cancel-text":unref(gg)("common.actions.cancel"),centered:"",onOk:YI,onCancel:kI},{default:withCtx(()=>[createVNode(JI,{ref_key:"renameLayerInputRef",ref:wg,value:fg.value,"onUpdate:value":uI[21]||(uI[21]=vI=>fg.value=vI),placeholder:unref(gg)("editor.shell.layerNamePlaceholder"),maxlength:30,"allow-clear":"",onPressEnter:YI},null,8,["value","placeholder"])]),_:1},8,["open","title","ok-text","cancel-text"])],64)}}}),RightSideBar=_export_sfc(_sfc_main$5,[["__scopeId","data-v-998607b0"]]),ControlMiddleVerticalImg="data:image/svg+xml,%3csvg%20width='12'%20height='24'%20viewBox='0%200%2012%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3crect%20x='4'%20y='4'%20width='4'%20height='16'%20rx='2'%20fill='white'/%3e%3crect%20x='4.25'%20y='4.25'%20width='3.5'%20height='15.5'%20rx='1.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='12'%20height='24'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlMiddleHorizontalImg="data:image/svg+xml,%3csvg%20width='24'%20height='12'%20viewBox='0%200%2024%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3crect%20x='20'%20y='4'%20width='4'%20height='16'%20rx='2'%20transform='rotate(90%2020%204)'%20fill='white'/%3e%3crect%20x='19.75'%20y='4.25'%20width='3.5'%20height='15.5'%20rx='1.75'%20transform='rotate(90%2019.75%204.25)'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='24'%20height='12'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlEdgeImage="data:image/svg+xml,%3csvg%20width='19'%20height='18'%20viewBox='0%200%2019%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3ccircle%20cx='9.99609'%20cy='9'%20r='5'%20fill='white'/%3e%3ccircle%20cx='9.99609'%20cy='9'%20r='4.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0.996094'%20y='0'%20width='18'%20height='18'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ControlRotateImage="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3ccircle%20cx='9'%20cy='9'%20r='5'%20fill='white'/%3e%3ccircle%20cx='9'%20cy='9'%20r='4.75'%20stroke='black'%20stroke-opacity='0.3'%20stroke-width='0.5'/%3e%3c/g%3e%3cpath%20d='M10.8047%2011.1242L9.49934%2011.1242L9.49934%209.81885'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.94856%206.72607L8.25391%206.72607L8.25391%208.03142'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.69517%206.92267C10.007%207.03301%2010.2858%207.22054%2010.5055%207.46776C10.7252%207.71497%2010.8787%208.01382%2010.9517%208.33642C11.0247%208.65902%2011.0148%208.99485%2010.9229%209.31258C10.831%209.63031%2010.6601%209.91958%2010.4262%2010.1534L9.49701%2011.0421M8.25792%206.72607L7.30937%207.73554C7.07543%207.96936%206.90454%208.25863%206.81264%208.57636C6.72073%208.89408%206.71081%209.22992%206.78381%209.55251C6.8568%209.87511%207.01032%2010.174%207.23005%2010.4212C7.44978%2010.6684%207.72855%2010.8559%208.04036%2010.9663'%20stroke='black'%20stroke-width='0.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='0'%20y='0'%20width='18'%20height='18'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='2'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.137674%200%200%200%200%200.190937%200%200%200%200%200.270833%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",iconRfid="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='35'%20height='35'%20viewBox='0%200%2035%2035'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_25_0440'%3e%3crect%20x='0'%20y='0'%20width='35'%20height='35'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_25_0440)'%3e%3cg%3e%3cg%3e%3cg%20style='opacity:0;'%3e%3cg%3e%3crect%20x='5'%20y='5'%20width='25'%20height='25'%20rx='0'%20fill='%234D7B36'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M23.940601,13.1393909C22.123299,11.2938004,19.710701,10.2749901,17.143397999999998,10.2749901C14.5760498,10.2749901,12.1608391,11.2911301,10.3461494,13.1393909C10.3461494,13.1393909,8.7648602,11.531160400000001,8.7648602,11.531160400000001C11.001750900000001,9.2535105,13.9781494,8,17.143397999999998,8C20.308601,8,23.285,9.2535105,25.5219,11.531160400000001C25.5219,11.531160400000001,23.940601,13.1393909,23.940601,13.1393909ZM10.7473793,26.997299C10.7473793,26.997299,9.470279699999999,24.514299,9.470279699999999,24.514299C9.470279699999999,24.514299,8.6678295,24.514299,8.6678295,24.514299C8.6678295,24.514299,8.6678295,26.997299,8.6678295,26.997299C8.6678295,26.997299,7,26.997299,7,26.997299C7,26.997299,7,19.943001000000002,7,19.943001000000002C7,19.943001000000002,9.5437107,19.943001000000002,9.5437107,19.943001000000002C11.0253506,19.943001000000002,12.2578697,20.455099,12.2578697,22.162001C12.2578697,23.1968,11.780590100000001,23.8582,11.0646801,24.1996C11.0646801,24.1996,12.611890800000001,26.997299,12.611890800000001,26.997299C12.611890800000001,26.997299,10.7473793,26.997299,10.7473793,26.997299ZM8.6678295,23.175501C8.6678295,23.175501,9.4152107,23.175501,9.4152107,23.175501C10.2071705,23.175501,10.626750900000001,22.8234,10.626750900000001,22.162001C10.626750900000001,21.500601,10.2071705,21.2819,9.4152107,21.2819C9.4152107,21.2819,8.6678295,21.2819,8.6678295,21.2819C8.6678295,21.2819,8.6678295,23.175501,8.6678295,23.175501ZM13.5979004,19.943001000000002C13.5979004,19.943001000000002,18.0271,19.943001000000002,18.0271,19.943001000000002C18.0271,19.943001000000002,18.0271,21.3459,18.0271,21.3459C18.0271,21.3459,15.2683601,21.3459,15.2683601,21.3459C15.2683601,21.3459,15.2683601,22.892799,15.2683601,22.892799C15.2683601,22.892799,17.636398,22.892799,17.636398,22.892799C17.636398,22.892799,17.636398,24.306299,17.636398,24.306299C17.636398,24.306299,15.2683601,24.306299,15.2683601,24.306299C15.2683601,24.306299,15.2683601,27,15.2683601,27C15.2683601,27,13.5979004,27,13.5979004,27C13.5979004,27,13.5979004,19.943001000000002,13.5979004,19.943001000000002ZM19.228099999999998,19.943001000000002C19.228099999999998,19.943001000000002,20.898602,19.943001000000002,20.898602,19.943001000000002C20.898602,19.943001000000002,20.898602,26.997299,20.898602,26.997299C20.898602,26.997299,19.228099999999998,26.997299,19.228099999999998,26.997299C19.228099999999998,26.997299,19.228099999999998,19.943001000000002,19.228099999999998,19.943001000000002ZM22.490398,19.943001000000002C22.490398,19.943001000000002,24.486,19.943001000000002,24.486,19.943001000000002C26.602299,19.943001000000002,28,20.977800000000002,28,23.431499000000002C28,25.8878,26.602299,26.997299,24.577801,26.997299C24.577801,26.997299,22.490398,26.997299,22.490398,26.997299C22.490398,26.997299,22.490398,19.943001000000002,22.490398,19.943001000000002ZM24.383701,25.6318C25.503502,25.6318,26.295502,25.1091,26.295502,23.431499000000002C26.295502,21.753901,25.503502,21.2899,24.383701,21.2899C24.383701,21.2899,24.160801,21.2899,24.160801,21.2899C24.160801,21.2899,24.160801,25.6318,24.160801,25.6318C24.160801,25.6318,24.383701,25.6318,24.383701,25.6318Z'%20fill='%232F54EB'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M13.80933,18C13.80933,18,12,15.7879696,12,15.7879696C13.4702702,13.99046135,15.4236202,13,17.5,13C19.57938,13,21.532730100000002,13.99046135,23,15.7879696C23,15.7879696,21.19067,18,21.19067,18C20.206489599999998,16.7931004,18.8952484,16.1327991,17.5,16.1327991C16.1047497,16.1291294,14.7935104,16.7931004,13.80933,18Z'%20fill='%232F54EB'%20fill-opacity='1'%20style='mix-blend-mode:passthrough'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",_hoisted_1$3=["src"],_sfc_main$4=defineComponent({__name:"rfid-icon",setup(tg){const eg=ref();let gg=0,ig=0,ng=null,og=!1,ag=0,Ig=300;const sg=Ag=>{const cg=Ag.button===0,rg=Ag.button===2;if(Ag.button,rg){Ag.preventDefault(),emitter.emit("showRightMenu",{x:Ag.clientX,y:Ag.clientY});return}if(!cg){console.log("右键点击");return}Ag.preventDefault();let ug=eg.value;ug.setPointerCapture(Ag.pointerId);const dg=ug.getBoundingClientRect();gg=Ag.clientX-dg.left,ig=Ag.clientY-dg.top,ag=Date.now(),ng=setTimeout(()=>{og=!0,ug.classList.add("dragging")},Ig),ug.addEventListener("pointermove",Cg),ug.addEventListener("pointerup",lg,{once:!0}),ug.addEventListener("pointercancel",lg,{once:!0})};function Cg(Ag){if(!og)return;let cg=eg.value;const rg=cg.parentNode.getBoundingClientRect(),ug=cg.getBoundingClientRect();let dg=Ag.clientX-rg.left-gg,bg=Ag.clientY-rg.top-ig;const mg=rg.width-ug.width,hg=rg.height-ug.height;dg=Math.max(0,Math.min(dg,mg)),bg=Math.max(0,Math.min(bg,hg)),cg.style.left=dg+"px",cg.style.top=bg+"px"}function lg(Ag){var ug;let cg=eg.value;clearTimeout(ng);let rg=Date.now()-ag;!og&&rg<Ig&&emitter.emit("show-rfid-modal"),og&&cg.classList.remove("dragging"),og=!1,(ug=cg.releasePointerCapture)==null||ug.call(cg,Ag.pointerId),cg.removeEventListener("pointermove",Cg)}return onMounted(()=>{}),(Ag,cg)=>(openBlock(),createElementBlock("div",{class:"rfid-icon",ref_key:"rfidRef",ref:eg,onPointerdown:sg},[createBaseVNode("img",{src:unref(iconRfid)},null,8,_hoisted_1$3)],544))}}),rfidIcon=_export_sfc(_sfc_main$4,[["__scopeId","data-v-305f6f00"]]),state=reactive({isShowRuler:!0,isShowGrid:!1});function getSettingState(){return state}const _sfc_main$3=defineComponent({__name:"Canvas",props:{config:{},canvas:{},rfidConfig:{},databaseConfig:{},filePath:{},ribbonBorderPattern:{}},setup(tg,{expose:eg}){const{t:gg,te:ig}=useI18n(),ng=tg,og=getSettingState(),ag=useTemplateRef("workspace"),Ig=new EditorCtrl,sg=ref(!1),Cg=ref(!1),lg=ref(!1);function Ag($g){var Ng;if(sg.value=$g,sg.value){const vg=(Ng=ng.config)==null?void 0:Ng.DPI;vg&&vg!==Editor.DPI&&(Editor.DPI=vg),mg==null||mg.editActivated(),emitter.on("edit-nav-trigger",bg),mg&&fg(mg),setTimeout(()=>{if(!mg)return;const Xg=mg.getPlugin("WorkspacePlugin");Xg==null||Xg.auto()},30)}else mg==null||mg.editDeactivated(),emitter.off("edit-nav-trigger",bg)}function cg(){Cg.value=!0}function rg(){return mg}function ug(){return mg==null?void 0:mg.toJSON()}function dg($g,Ng){if(!mg){Ng==null||Ng();return}const vg=()=>{var Xg,Vg;(Xg=mg==null?void 0:mg.getCanvas())==null||Xg.discardActiveObject(),(Vg=mg==null?void 0:mg.getCanvas())==null||Vg.requestRenderAll(),Ig.init(mg),Ig.bind(),nextTick(()=>{let Mg=Ig.getObjects();initCountObjsName(Mg,mg.getCanvas())}),Ng==null||Ng()};if($g){mg.fromTemplateJson($g,vg);return}mg.getObjects().filter(Xg=>Xg.id!=="workspace").forEach(Xg=>mg==null?void 0:mg.removeObject(Xg)),vg()}function bg($g){const Ng=$g.action||"",vg=mg&&mg.getPlugin("CopyPlugin"),Xg=mg&&mg.getPlugin("HistoryPlugin"),Vg=mg&&mg.getPlugin("DeletePlugin"),Mg=mg.getPlugin("WorkspacePlugin"),Rg=mg.getPlugin("RulerPlugin");switch(Ng){case"Ctrl+C":vg.toCopy();break;case"Ctrl+V":vg.toPaste();break;case"Ctrl+X":vg.toCut();break;case"Ctrl+Z":Xg.toUndo();break;case"Ctrl+Shift+Z":Xg.toRedo();break;case"Delete":Vg.toDelete();break;case"ShowRuler":Rg==null||Rg.enabled(),og.isShowRuler=!0;break;case"HideRuler":Rg==null||Rg.disabled(),og.isShowRuler=!1;break;case"ZoomIn":Mg==null||Mg.big();break;case"ZoomOut":Mg==null||Mg.small();break;case"ZoomAuto":Mg==null||Mg.auto();break;case"ObjectProps":emitter.emit("toggle-show-props",{editor:mg,editorCtrl:Ig}),setTimeout(()=>{Mg==null||Mg.auto()},30);break;case"ShowGrid":Mg==null||Mg.showGrid(),og.isShowGrid=!0;break;case"HideGrid":Mg==null||Mg.hideGrid(),og.isShowGrid=!1;break;case"ToSetTag":emitter.emit("to-show-tag-edit");break}}eg({show:Ag,remove:cg,getEidtor:rg,getCanvasJson:ug,loadCanvasJson:dg});let mg;function hg(){const $g=ag.value.querySelector("#canvas");mg=newEditor($g),setObjectNameResolver(mg.getCanvas(),Ng=>{const vg=`editor.objectNames.${Ng}`;return ig(vg)?gg(vg):void 0}),setContextMenuTextResolver(Ng=>ig(Ng)?gg(Ng):void 0),ng.canvas?mg.fromTemplateJson(ng.canvas,()=>{Zg(mg)}):Zg(mg)}const pg=()=>{const $g=ng.config;let Ng=$g.tagWidth,vg=$g.tagHeight;return(!$g.tagWidth||!$g.tagHeight||$g.tagWidth===$g.pageWidth&&$g.tagHeight===$g.pageHeight)&&(Ng=Math.floor(($g.pageWidth-$g.paddingLeft-$g.paddingRight-$g.horizontalSpacing*($g.columns-1))/$g.columns*100)/100,vg=Math.floor(($g.pageHeight-$g.paddingTop-$g.paddingBottom-$g.verticalSpacing*($g.rows-1))/$g.rows*100)/100),{width:Ng,height:vg}},fg=$g=>{if(!$g)return;const Ng=$g.getPlugin("RulerPlugin"),vg=$g.getPlugin("WorkspacePlugin");og.isShowRuler?Ng==null||Ng.enabled():Ng==null||Ng.disabled(),og.isShowGrid?vg==null||vg.showGrid():vg==null||vg.hideGrid()},wg=async $g=>{if(ng.config.pageShape==="Ellipse"){$g.ribbonBorderPattern="none",$g.setRibbonBorderTextures(null),ng.config.ribbonBorder={pattern:"none"};return}const Ng=ng.config.ribbonBorder,vg=(Ng==null?void 0:Ng.pattern)||ng.ribbonBorderPattern||"none";$g.ribbonBorderPattern=vg;try{const Xg=vg==="none"?{pattern:vg}:await createRibbonBorderTextureData(vg);ng.config.ribbonBorder=Xg,$g.setRibbonBorderTextures(await loadRibbonBorderTextureImages(Xg))}catch(Xg){console.log("loadRibbonBorderTextureImages error",Xg)}};function Gg($g){var Kg;if(!$g)return;const Ng=$g.getPlugin("WorkspacePlugin"),vg=$g.getPlugin("RulerPlugin");vg==null||vg.disabled();let Xg=((Kg=Ng==null?void 0:Ng.workspace)==null?void 0:Kg.isHasGrid)||!1;Ng==null||Ng.uninstall();const Vg=ng.config;$g.labelConfig=Vg,$g.filePath=ng.filePath,Vg.DPI&&(Editor.DPI=Vg.DPI);let{width:Mg,height:Rg}=pg();const Sg=Mg/25.4*Editor.DPI,Yg=Rg/25.4*Editor.DPI;let xg,Og;Vg.pageShape==="Ellipse"?(xg=Sg/2,Og=Yg/2):xg=Og=Vg.pageShape==="Rectangle"?0:16,console.log("wpx======",Vg),$g.use(WorkspacePlugin,{width:Sg,height:Yg,backgroundColor:Vg.backgroundColor||"#FFFFFFFF",backgroundImage:Vg.backgroundImage||"",backgroundImageCover:Vg.backgroundImageCover!==!1,rx:xg,ry:Og,type:Vg.pageShape}),nextTick(()=>{var Dg;if(vg==null||vg.enabled(),Xg){const Fg=$g.getPlugin("WorkspacePlugin");Fg==null||Fg.showGrid()}(Dg=$g.getCanvas())==null||Dg.requestRenderAll(),wg($g)})}function Zg($g){var Yg;const Ng=ng.config;$g.labelConfig=Ng,$g.filePath=ng.filePath,Ng.DPI&&(Editor.DPI=Ng.DPI);let{width:vg,height:Xg}=pg();const Vg=vg/25.4*Editor.DPI,Mg=Xg/25.4*Editor.DPI;let Rg,Sg;Ng.pageShape==="Ellipse"?(Rg=Vg/2,Sg=Mg/2):Rg=Sg=Ng.pageShape==="Rectangle"?0:16,$g.use(WorkspacePlugin,{width:Vg,height:Mg,backgroundColor:Ng.backgroundColor||"#FFFFFFFF",backgroundImage:Ng.backgroundImage||"",backgroundImageCover:Ng.backgroundImageCover!==!1,rx:Rg,ry:Sg,type:Ng.pageShape}).use(ContextMenuPlugin).use(RulerPlugin).use(GuidelinesPlugin,{margin:4}).use(DringPlugin).use(LockPlugin).use(LayerPlugin).use(ControlsPlugin,{verticalImg:ControlMiddleVerticalImg,horizontalImg:ControlMiddleHorizontalImg,rotateImg:ControlRotateImage,edgeImg:ControlEdgeImage}).use(AlignPlugin).use(GroupPlugin).use(HistoryPlugin).use(MoveHotKeyPlugin).use(DeletePlugin).use(AddObjectPlugin).use(CopyPlugin).use(SelectPlugin).use(LineContorlPlugin),Ig.init($g),Ig.bind(),fg($g),wg($g),emitter.emit("editor-switch",{editor:$g,editorCtrl:Ig}),(Yg=$g.getCanvas())==null||Yg.on("custom:rfid",yg),nextTick(()=>{let xg=Ig.getObjects();initCountObjsName(xg,$g.getCanvas())})}const yg=$g=>{lg.value=$g.isShow,mg&&(mg._isHasRfid=$g.isShow)},Bg=()=>{var $g;mg&&(($g=mg==null?void 0:mg.getCanvas())==null||$g.requestRenderAll())},Wg=$g=>{if(!mg||!$g)return;const Ng=mg.getCanvas();if(Ng){const vg=getAllObjectMap(Ng,"init"),Xg=[].concat(...Object.values(vg));applyJsonFieldDiff($g,Xg),Ng.requestRenderAll(),Ng.fire("custom:object:history",{})}};return onMounted(()=>{watch(sg,$g=>{$g?(emitter.on("refresh-editor",Gg),emitter.on("refreshCanvasFont",Bg),emitter.on("file-field-json-changed",Wg),nextTick(async()=>{var vg,Xg;const Ng=(vg=ng.config)==null?void 0:vg.DPI;Ng&&(Editor.DPI=Ng),mg?((Xg=mg==null?void 0:mg.getCanvas())==null||Xg.requestRenderAll(),await nextTick(),await new Promise(Vg=>requestAnimationFrame(()=>Vg())),emitter.emit("editor-switch",{editor:mg,editorCtrl:Ig})):hg(),mg._isShown=!0})):(mg&&(mg._isShown=!1),emitter.off("refresh-editor",Gg),emitter.off("refreshCanvasFont",Bg),emitter.off("file-field-json-changed",Wg))})}),onUnmounted(()=>{var $g;console.log("Canvas onUnmounted"),mg&&(($g=mg.getCanvas())==null||$g.off("custom:rfid",yg),delEditor(mg))}),onErrorCaptured(($g,Ng,vg)=>{console.log("onErrorCaptured",$g,Ng,vg)}),($g,Ng)=>unref(Cg)?createCommentVNode("",!0):withDirectives((openBlock(),createElementBlock("div",{key:0,id:"workspace",ref_key:"workspace",ref:ag},[unref(lg)?(openBlock(),createBlock(rfidIcon,{key:0})):createCommentVNode("",!0),Ng[0]||(Ng[0]=createBaseVNode("div",{class:"canvas-box"},[createBaseVNode("div",{class:"inside-shadow"}),createBaseVNode("canvas",{id:"canvas",class:normalizeClass("design-stage-grid")})],-1))],512)),[[vShow,unref(sg)]])}}),Canvas=_export_sfc(_sfc_main$3,[["__scopeId","data-v-d1c6f728"]]),IconClose="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='10.000091552734375'%20height='10'%20viewBox='0%200%2010.000091552734375%2010'%3e%3cg%3e%3cg%3e%3cellipse%20cx='5.000091552734375'%20cy='4.999980926513672'%20rx='5'%20ry='5'%20fill='%23D8D8D8'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,1.414311092185244,-3.413998686404966)'%3e%3cpath%20d='M8.941986552734374,0.4573170671386719Q8.941986552734374,0.4122980671386719,8.933206552734376,0.3681430671386719Q8.924416552734375,0.3239880671386719,8.907196552734375,0.2823960671386719Q8.889966552734375,0.24080306713867186,8.864956552734375,0.20337006713867187Q8.839936552734375,0.16593806713867187,8.808106552734376,0.13410406713867187Q8.776276552734375,0.10227006713867187,8.738836552734375,0.07725896713867188Q8.701406552734376,0.052247367138671875,8.659816552734375,0.035019167138671876Q8.618226552734376,0.017790867138671874,8.574066552734376,0.009007967138671875Q8.529916552734376,0.000225067138671875,8.484896552734375,0.000225067138671875Q8.439876552734376,0.000225067138671875,8.395716552734374,0.009007967138671875Q8.351566552734376,0.017790867138671874,8.309976552734375,0.035019167138671876Q8.268376552734376,0.052247367138671875,8.230946552734375,0.07725896713867188Q8.193516552734375,0.10227006713867187,8.161676552734376,0.13410406713867187Q8.129846552734374,0.16593806713867187,8.104836552734374,0.20337006713867187Q8.079826552734374,0.24080306713867186,8.062596552734375,0.2823960671386719Q8.045366552734375,0.3239880671386719,8.036586552734375,0.3681430671386719Q8.027796552734376,0.4122980671386719,8.027796552734376,0.4573170671386719L8.027796552734376,2.9870450671386717L5.254974552734375,2.9870450671386717Q5.212942552734375,2.9870450671386717,5.171717552734375,2.9952450671386717Q5.130493552734375,3.0034450671386717,5.091661552734375,3.0195250671386717Q5.052828552734375,3.035615067138672,5.017880552734375,3.0589650671386717Q4.982932552734375,3.082315067138672,4.953210552734375,3.112035067138672Q4.923489952734375,3.141755067138672,4.900138152734375,3.176705067138672Q4.876786452734375,3.211655067138672,4.860701552734375,3.250485067138672Q4.844616652734375,3.2893150671386717,4.836416582734375,3.330545067138672Q4.828216552734375,3.371765067138672,4.828216552734375,3.413795067138672Q4.828216552734375,3.455835067138672,4.836416582734375,3.497055067138672Q4.844616652734375,3.538275067138672,4.860701552734375,3.577115067138672Q4.876786452734375,3.615945067138672,4.900138152734375,3.6508950671386717Q4.923489952734375,3.685845067138672,4.953210552734375,3.7155650671386717Q4.982932552734375,3.745285067138672,5.017880552734375,3.7686350671386717Q5.052828552734375,3.791985067138672,5.091661552734375,3.808075067138672Q5.130493552734375,3.8241550671386717,5.171717552734375,3.8323550671386717Q5.212942552734375,3.8405550671386717,5.254974552734375,3.8405550671386717L8.027796552734376,3.8405550671386717L8.027796552734376,6.371255067138672Q8.027796552734376,6.416275067138672,8.036586552734375,6.460435067138672Q8.045366552734375,6.504585067138672,8.062596552734375,6.546175067138672Q8.079826552734374,6.587775067138672,8.104836552734374,6.625205067138672Q8.129846552734374,6.662635067138672,8.161676552734376,6.694465067138672Q8.193516552734375,6.7263050671386715,8.230946552734375,6.7513150671386715Q8.268376552734376,6.776325067138671,8.309976552734375,6.793555067138672Q8.351566552734376,6.810785067138672,8.395716552734374,6.819565067138672Q8.439876552734376,6.828345067138672,8.484896552734375,6.828345067138672Q8.529916552734376,6.828345067138672,8.574066552734376,6.819565067138672Q8.618226552734376,6.810785067138672,8.659816552734375,6.793555067138672Q8.701406552734376,6.776325067138671,8.738836552734375,6.7513150671386715Q8.776276552734375,6.7263050671386715,8.808106552734376,6.694465067138672Q8.839936552734375,6.662635067138672,8.864956552734375,6.625205067138672Q8.889966552734375,6.587775067138672,8.907196552734375,6.546175067138672Q8.924416552734375,6.504585067138672,8.933206552734376,6.460435067138672Q8.941986552734374,6.416275067138672,8.941986552734374,6.371255067138672L8.941986552734374,3.8405550671386717L11.714936552734375,3.8405550671386717Q11.756966552734376,3.8405550671386717,11.798186552734375,3.8323550671386717Q11.839416552734374,3.8241550671386717,11.878246552734375,3.808075067138672Q11.917076552734375,3.791985067138672,11.952026552734374,3.7686350671386717Q11.986976552734376,3.745285067138672,12.016696552734375,3.7155650671386717Q12.046416552734375,3.685845067138672,12.069766552734375,3.6508950671386717Q12.093126552734375,3.615945067138672,12.109206552734374,3.577115067138672Q12.125296552734376,3.538275067138672,12.133496552734375,3.497055067138672Q12.141686552734374,3.455835067138672,12.141696552734375,3.413795067138672Q12.141686552734374,3.371765067138672,12.133486552734375,3.330545067138672Q12.125286552734375,3.2893150671386717,12.109206552734374,3.250485067138672Q12.093116552734376,3.211655067138672,12.069766552734375,3.176705067138672Q12.046416552734375,3.141755067138672,12.016696552734375,3.112035067138672Q11.986976552734376,3.082315067138672,11.952026552734374,3.0589650671386717Q11.917076552734375,3.035615067138672,11.878246552734375,3.0195250671386717Q11.839416552734374,3.0034450671386717,11.798186552734375,2.9952450671386717Q11.756966552734376,2.9870450671386717,11.714936552734375,2.9870450671386717L8.941986552734374,2.9870450671386717L8.941986552734374,0.4573170671386719Z'%20fill-rule='evenodd'%20fill='%2362708D'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";async function activateAfterViewUpdate(tg,eg){return await tg(),eg()}const _hoisted_1$2={key:0,class:"file-list-box"},_hoisted_2=["onClick","title"],_hoisted_3={class:"file-item-name"},_hoisted_4={key:0,class:"un-save-tag"},_hoisted_5=["src","onClick"],_hoisted_6={class:"file-tool"},_sfc_main$2=defineComponent({__name:"index",props:{isHasInitFile:{type:Boolean,default:!1}},setup(tg){const{t:eg}=useI18n(),gg=tg,ig=inject("isCanvasReady"),ng=getCheckDirtyState();function og(){const Vg=getSysConfigState(),Mg=[];for(let Rg=0;Rg<1;Rg++){const Sg=Object.assign({},getTempLabelConfig(),{DPI:Vg.DPI});Sg.fileId=v4(),Sg.fileName=eg("editor.remaining.newFileNumber",{number:Rg+1});const Yg={id:Sg.fileId,config:Sg};normalizeLayers(Yg,eg),Mg.push(Yg)}return Mg}const ag=ref([]),Ig=ref(),sg=ref(-1),Cg=ref(),lg=ref(new Map),Ag=ref(),cg=ref(new Map);let rg=-1;function ug(Vg){var Rg,Sg;const Mg=((Rg=Vg.layers)==null?void 0:Rg.find(Yg=>Yg.id===Vg.activeLayerId))||((Sg=Vg.layers)==null?void 0:Sg[0]);return(Mg==null?void 0:Mg.canvas)||Vg.canvas}function dg(Vg){var Sg;const Mg=cg.value.get(Vg.id),Rg=getActiveLayer(Vg);!Mg||!Rg||isLayerCanvasStable()&&(Rg.canvas=(Sg=Mg.getCanvasJson)==null?void 0:Sg.call(Mg),Vg.canvas=Rg.canvas)}function bg(Vg){return Array.isArray(Vg.canvas)&&Vg.canvas.length>1||Array.isArray(Vg.layers)&&Vg.layers.length>1}function mg(Vg){const Mg=Array.isArray(Vg.canvas)?Vg.canvas.length:0,Rg=Array.isArray(Vg.layers)?Vg.layers.length:0;return Math.max(Mg,Rg,getLayerMaxCountFromPayload(Vg))}function hg(Vg){return Vg.newFile?state$1.isSeparateLayerMode:Vg.labelConfig.separateLayerMode===!0}function pg(Vg,Mg){return Vg.newFile?state$1.separateLayerCount:getLayerMaxCount(Vg.labelConfig.separateLayerCount??Mg)}function fg(Vg){const Mg=Vg.newFile?state$1.separateLayerNames:Vg.labelConfig.separateLayerNames;return Array.isArray(Mg)?Mg.map(Rg=>String(Rg||"").trim()).filter(Boolean):[]}const wg=(Vg,Mg)=>{ng[Vg]=!1,yg(Mg)};async function Gg(Vg,Mg){Vg.stopPropagation(),Vg.preventDefault();const Rg=ag.value[Mg];if(!ng[Rg.id]){disconnDatabase(),yg(Mg);return}rg=Mg,Bg(null,rg),await showCloseFileDirtyModal(Rg)==="no-save"&&wg(Rg.id,rg)}function Zg(Vg){if(Vg.flag==="close")yg(rg);else if(Vg.success&&Vg.name){const Mg=ag.value.find(Rg=>Rg.id===Vg.fileId);if(Mg){let Rg;const Sg=Vg.name.lastIndexOf(".");Sg>0?Rg=Vg.name.substring(0,Sg):Rg=Vg.name,Mg.config.fileName=Rg}}}function yg(Vg){const Mg=ag.value.splice(Vg,1);if(Mg.length>0){const Rg=Mg[0].id;cg.value.get(Rg).remove(),console.log("fileItemClose",Vg,sg.value,Rg)}Vg===sg.value&&(sg.value>0?Bg(null,sg.value-1):(sg.value=-1,ag.value.length>0&&Bg(null,0))),ag.value.length===0&&($g.activeId="",emitter.emit("editor-empty"))}function Bg(Vg,Mg){if(console.log("fileItemClick",Mg,sg.value),Mg!==sg.value){const Rg=ag.value[Mg].id;state$1.isShowEditTabs&&(Cg.value&&Cg.value.classList.remove("active"),Cg.value=lg.value.get(Rg),Cg.value.classList.add("active")),Ag.value&&Ag.value.show(!1);const Sg=cg.value.get(Rg);Ag.value=Sg;const Yg=ag.value[Mg],xg=getActiveLayer(Yg);xg&&setTabActiveLayer(Yg,xg),Sg.show(!0),sg.value=Mg,$g.activeId=Rg}}function Wg(Vg){var Og,Kg,Dg,Fg;const Mg=mg(Vg),Rg=hg(Vg),Sg=pg(Vg,Mg),Yg=fg(Vg),xg=Rg?Sg:Math.max(getLayerMaxCountFromPayload(Vg),Mg);if(Vg.labelConfig.separateLayerMode=Rg,Vg.labelConfig.separateLayerCount=Sg,Vg.labelConfig.separateLayerNames=Yg,Vg.labelConfig.layerMaxCount=xg,bg(Vg)&&(state$1.isMultiLayerEnabled=!0),Vg.newFile){resetLaserPresetsFromExternal();const Tg=Vg.labelConfig.fileName,Jg=ag.value.filter(Eg=>Eg.config.fileName.startsWith(Tg));if(Jg.length>0){let Eg=1;Jg.forEach(co=>{const ma=co.config.fileName.substring(Tg.length);try{const pa=parseInt(ma);pa>=Eg&&(Eg=pa+1)}catch(pa){console.log(pa)}}),Vg.labelConfig.fileName=Tg+Eg}}else{let Tg=-1;for(let Jg=0;Jg<ag.value.length;Jg++){const Eg=ag.value[Jg];if(Eg.id===Vg.labelConfig.fileId){Eg.filePath===Vg.filePath?Tg=Jg:Vg.labelConfig.fileId=v4();break}}if(Tg>-1){if(ag.value[Tg]){Vg.labelConfig.ribbonBorder||(Vg.labelConfig.ribbonBorder={pattern:(Vg==null?void 0:Vg.ribbonBorderPattern)||"none"});const Jg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:Vg.labelConfig.ribbonBorder.pattern||Vg.ribbonBorderPattern||"none",filePath:Vg.filePath,refreshKey:new Date().getTime()};if(applySeparateLayerMode(Jg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Jg,xg),applyLayerMeta(Jg,Vg.layers),applyCanvasPayload(Jg,Vg.canvas),Vg.activeLayerId){Jg.activeLayerId=Vg.activeLayerId;const co=getActiveLayer(Jg);co&&setTabActiveLayer(Jg,co)}normalizeLayers(Jg),ag.value[Tg]=Jg;const Eg=Vg.labelConfig.fileId;activateAfterViewUpdate(()=>nextTick(),()=>cg.value.get(Eg)?(Ag.value=void 0,sg.value=-1,Bg(null,Tg),!0):!1)}$g.storeTabs(ag.value),Message.success(eg("editor.remaining.alreadyOpen"));return}}if(Vg.labelConfig.ribbonBorder||(Vg.labelConfig.ribbonBorder={pattern:(Vg==null?void 0:Vg.ribbonBorderPattern)||"none"}),state$1.isShowEditTabs){const Tg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:((Kg=(Og=Vg.labelConfig)==null?void 0:Og.ribbonBorder)==null?void 0:Kg.pattern)||(Vg==null?void 0:Vg.ribbonBorderPattern)||"none",filePath:Vg.filePath};if(applySeparateLayerMode(Tg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Tg,xg),applyLayerMeta(Tg,Vg.layers),applyCanvasPayload(Tg,Vg.canvas),Vg.activeLayerId){Tg.activeLayerId=Vg.activeLayerId;const Jg=getActiveLayer(Tg);Jg&&setTabActiveLayer(Tg,Jg)}normalizeLayers(Tg),ag.value.unshift(Tg)}else{const Tg={id:Vg.labelConfig.fileId,config:Vg.labelConfig,database:Vg.databaseConfig,rfid:Vg.rfidConfig,ribbonBorderPattern:((Fg=(Dg=Vg.labelConfig)==null?void 0:Dg.ribbonBorder)==null?void 0:Fg.pattern)||(Vg==null?void 0:Vg.ribbonBorderPattern)||"none",filePath:Vg.filePath};if(applySeparateLayerMode(Tg,Rg,{count:Sg,names:Yg}),applyLayerMaxCount(Tg,xg),applyLayerMeta(Tg,Vg.layers),applyCanvasPayload(Tg,Vg.canvas),Vg.activeLayerId){Tg.activeLayerId=Vg.activeLayerId;const Eg=getActiveLayer(Tg);Eg&&setTabActiveLayer(Tg,Eg)}normalizeLayers(Tg);let Jg=ag.value.find(Eg=>{if(Eg.id===Tg.id)return Eg});ag.value=Jg?[Jg]:[Tg]}console.log("fileList.value==========",ag.value),$g.storeTabs(ag.value),nextTick(()=>{sg.value>=0&&(sg.value+=1),Bg(null,0),emitter.emit("label-ready")})}const $g=useTabsStore(),Ng=useAppStore();let vg=!1;const Xg=async()=>{if(vg)return;vg=!0;let Vg={},Mg=[];for(ag.value.forEach((Rg,Sg)=>{Vg[Rg.id]=Sg,Mg.push(Rg)});Mg.length;){let Rg=Mg.pop(),Sg=Vg[Rg.id];if(ng[Rg.id]){Bg(null,Sg);let Yg=await showCloseFileDirtyModal(Rg);if(Yg==="no-save")wg(Rg.id,Sg);else if(Yg==="cancel")break}else wg(Rg.id,Sg)}vg=!1};return emitter.on("checkFileSave",Vg=>{let Mg=!0;for(let Rg of ag.value)if(ng[Rg.id]){Mg=!1;break}Vg&&Vg(Mg)}),emitter.on("label-config",Wg),onMounted(async()=>{if(ig&&(ig.value=!0),$g.tabs.length===0&&(!Ng.firstOpen&&!gg.isHasInitFile&&(ag.value=og(),$g.storeTabs(ag.value),Ng.firstOpen=!0),gg.isHasInitFile&&(Ng.firstOpen=!0)),ag.value=$g.tabs,ag.value.forEach(Vg=>normalizeLayers(Vg)),Ig.value){const Vg=Ig.value;Vg.addEventListener("wheel",Mg=>{Mg.buttons===0&&(Mg.preventDefault(),Vg.scrollLeft+=Mg.deltaY)}),nextTick(()=>{var Mg;if(cg.value.size>0){const Rg=$g.activeId;if(Vg.children.length){const Sg=lg.value.get(Rg);Sg?(Cg.value=Sg,ag.value.forEach((Yg,xg)=>{Yg.id===Rg&&(sg.value=xg)})):(Cg.value=Vg.children[0],sg.value=0),Cg.value.classList.add("active")}Rg&&(Ag.value=cg.value.get(Rg)),Ag.value||(Ag.value=cg.value.get(ag.value[0].id),$g.activeId=ag.value[0].id),(Mg=Ag.value)==null||Mg.show(!0)}}).then(()=>{})}emitter.on("save-file",Zg),emitter.on("sync-active-layer",Vg=>{const Mg=ag.value.find(Rg=>Rg.id===Vg)||ag.value.find(Rg=>Rg.id===$g.activeId);Mg&&dg(Mg)}),emitter.on("separate-layer-config-change",({count:Vg,names:Mg})=>{ag.value.forEach(Rg=>{applySeparateLayerMode(Rg,state$1.isSeparateLayerMode,{count:Vg,names:Mg}),normalizeLayers(Rg)}),$g.storeTabs(ag.value)})}),onUnmounted(()=>{emitter.off("save-file",Zg),emitter.off("label-config",Wg),emitter.off("sync-active-layer"),emitter.off("separate-layer-config-change")}),(Vg,Mg)=>{const Rg=__unplugin_components_0$6,Sg=Menu,Yg=Dropdown;return openBlock(),createElementBlock(Fragment,null,[unref(state$1).isShowEditTabs?(openBlock(),createElementBlock("div",_hoisted_1$2,[createBaseVNode("div",{id:"file-list",ref_key:"fileListWrap",ref:Ig,class:"file-list-scroll"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(ag),(xg,Og)=>(openBlock(),createElementBlock("div",{key:xg.id,ref_for:!0,ref:Kg=>{Kg?unref(lg).set(xg.id,Kg):unref(lg).delete(xg.id)},class:"file-item",style:{"min-width":"150px"},onClick:Kg=>Bg(Kg,Og),title:xg.filePath},[createBaseVNode("div",_hoisted_3,toDisplayString$1(xg.config.fileName),1),unref(ng)[xg.id]?(openBlock(),createElementBlock("div",_hoisted_4,"*")):createCommentVNode("",!0),createBaseVNode("img",{src:unref(IconClose),onClick:Kg=>Gg(Kg,Og),class:"icon-close"},null,8,_hoisted_5)],8,_hoisted_2))),128))],512),createBaseVNode("div",_hoisted_6,[createVNode(Yg,{trigger:["click"]},{overlay:withCtx(()=>[createVNode(Sg,null,{default:withCtx(()=>[createVNode(Rg,{onClick:Xg},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(eg)("editor.remaining.closeAllTabs")),1)]),_:1})]),_:1})]),default:withCtx(()=>[createVNode(unref(EllipsisOutlined))]),_:1})])])):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(ag),(xg,Og)=>(openBlock(),createBlock(Canvas,{config:xg.config,canvas:ug(xg),"rfid-config":xg.rfid,"database-config":xg.database,"file-path":xg.filePath,"ribbon-border-pattern":xg.ribbonBorderPattern,key:xg.id+(xg.refreshKey||""),ref_for:!0,ref:Kg=>{Kg?unref(cg).set(xg.id,Kg):unref(cg).delete(xg.id)}},null,8,["config","canvas","rfid-config","database-config","file-path","ribbon-border-pattern"]))),128))],64)}}}),Index=_export_sfc(_sfc_main$2,[["__scopeId","data-v-e9fc7c8c"]]),_hoisted_1$1={key:0,class:"tran-modal"},_sfc_main$1=defineComponent({__name:"index",setup(tg){const eg=useAppStore(),gg=ref(!1),ig=ref(!0),ng=computed(()=>{const sg=getEditorConfig();return sg.visibleMenus?sg.visibleMenus.length>0:!0}),og=computed(()=>ng.value?"calc(100vh - 96px)":"calc(100vh - 48px)");provide("isCanvasReady",gg);const ag=sg=>{ig.value=!ig.value,ig.value&&nextTick(()=>{emitter.emit("editor-switch",sg)}),console.log("toggleShowRightSideBar",ig.value)},Ig=computed(()=>eg.isShowTranparentModal);return onMounted(()=>{emitter.on("toggle-show-props",ag),(eg.clearLocalStore===void 0||eg.clearLocalStore===null||eg.clearLocalStore)&&(eg.clearLocalStore=!1)}),onUnmounted(()=>{emitter.off("toggle-show-props",ag)}),(sg,Cg)=>{const lg=LayoutHeader,Ag=LayoutSider,cg=LayoutContent,rg=__unplugin_components_3$1,ug=App,dg=ConfigProvider;return openBlock(),createElementBlock(Fragment,null,[createVNode(dg,{theme:{algorithm:unref(theme).compactAlgorithm,components:{Layout:{colorBgHeader:"#FFFFFF;",colorBgBody:"#FFFFFF;"},Collapse:{colorFillAlter:"#EFEFEF",colorBgContainer:"#FFFFFF"},Switch:{colorPrimary:"#0C8CE9",colorPrimaryHover:"#0C8CE9"},Input:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"},InputNumber:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"},Divider:{colorBgBase:"#D8D8D8"},Select:{colorBorder:"#DFECFF",colorBgContainer:"#F7F9FC"}},token:{colorPrimary:"#0C8CE9"}}},{default:withCtx(()=>[createVNode(ug,null,{default:withCtx(()=>[createVNode(rg,null,{default:withCtx(()=>[unref(gg)&&unref(ng)?(openBlock(),createBlock(lg,{key:0,style:{"padding-inline":"0px",display:"flex","align-items":"center",height:"48px","border-bottom":"1px solid #e9e9e9","min-width":"fit-content"}},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(MenuBar)))]),_:1})):createCommentVNode("",!0),createVNode(lg,{style:{"padding-inline":"0px",display:"flex","align-items":"center",height:"48px","min-width":"fit-content","border-bottom":"1px solid #e9e9e9"}},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(ToolBar),{key:0})):createCommentVNode("",!0)]),_:1}),createVNode(rg,{style:normalizeStyle$1({height:unref(og)})},{default:withCtx(()=>[createVNode(Ag,{style:{"background-color":"white","border-right":"1px solid #d8d8d8"},width:"258"},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(LeftSideBar),{key:0})):createCommentVNode("",!0)]),_:1}),createVNode(cg,null,{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Index)))]),_:1}),unref(ig)?(openBlock(),createBlock(Ag,{key:0,style:{"border-left":"1px solid #d8d8d8"},width:"300"},{default:withCtx(()=>[unref(gg)?(openBlock(),createBlock(resolveDynamicComponent(RightSideBar),{key:0})):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0)]),_:1},8,["style"])]),_:1})]),_:1})]),_:1},8,["theme"]),unref(Ig)?(openBlock(),createElementBlock("div",_hoisted_1$1)):createCommentVNode("",!0)],64)}}}),home=_export_sfc(_sfc_main$1,[["__scopeId","data-v-37406acf"]]),_hoisted_1={class:"le-editor"},_sfc_main=defineComponent({__name:"App",setup(tg){const{locale:eg}=useI18n(),gg=useEditorAntLocale(eg);return onMounted(async()=>{window.myThreshold=200;const{dpi:ig}=getEditorConfig();o.DPI=ig,setSysConfigState({DPI:ig})}),(ig,ng)=>{const og=ConfigProvider;return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(og,{locale:unref(gg)},{default:withCtx(()=>[createVNode(home)]),_:1},8,["locale"])])}}});/*!
956
956
  * Vue-Lazyload.js v3.0.0
957
957
  * (c) 2023 Awe <hilongjw@gmail.com>
958
958
  * Released under the MIT License.
959
959
  */function createCommonjsModule(tg,eg){return eg={exports:{}},tg(eg,eg.exports),eg.exports}var assignSymbols$1=createCommonjsModule(function(tg){const eg=Object.prototype.toString,gg=Object.prototype.propertyIsEnumerable,ig=Object.getOwnPropertySymbols;tg.exports=(og,...ag)=>{if(!ng(og))throw new TypeError("expected the first argument to be an object");if(ag.length===0||typeof Symbol!="function"||typeof ig!="function")return og;for(let Ig of ag){let sg=ig(Ig);for(let Cg of sg)gg.call(Ig,Cg)&&(og[Cg]=Ig[Cg])}return og};function ng(og){return typeof og=="function"||eg.call(og)==="[object Object]"||Array.isArray(og)}}),assignSymbols$2=Object.freeze({__proto__:null,default:assignSymbols$1,__moduleExports:assignSymbols$1}),assignSymbols=assignSymbols$2&&assignSymbols$1||assignSymbols$2,assignDeep=createCommonjsModule(function(tg){const eg=Object.prototype.toString,gg=ag=>ag!=="__proto__"&&ag!=="constructor"&&ag!=="prototype",ig=tg.exports=(ag,...Ig)=>{let sg=0;for(og(ag)&&(ag=Ig[sg++]),ag||(ag={});sg<Ig.length;sg++)if(ng(Ig[sg])){for(const Cg of Object.keys(Ig[sg]))gg(Cg)&&(ng(ag[Cg])&&ng(Ig[sg][Cg])?ig(ag[Cg],Ig[sg][Cg]):ag[Cg]=Ig[sg][Cg]);assignSymbols(ag,Ig[sg])}return ag};function ng(ag){return typeof ag=="function"||eg.call(ag)==="[object Object]"}function og(ag){return typeof ag=="object"?ag===null:typeof ag!="function"}});const inBrowser=typeof window<"u"&&window!==null,hasIntersectionObserver=checkIntersectionObserver();function checkIntersectionObserver(){return inBrowser&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}),!0):!1}const modeType={event:"event",observer:"observer"};function remove(tg,eg){if(!tg.length)return;const gg=tg.indexOf(eg);if(gg>-1)return tg.splice(gg,1)}function getBestSelectionFromSrcset(tg,eg){if(tg.tagName!=="IMG"||!tg.getAttribute("data-srcset"))return"";let gg=tg.getAttribute("data-srcset").trim().split(",");const ig=[],og=tg.parentNode.offsetWidth*eg;let ag,Ig,sg;gg.forEach(Ag=>{Ag=Ag.trim(),ag=Ag.lastIndexOf(" "),ag===-1?(Ig=Ag,sg=99999):(Ig=Ag.substr(0,ag),sg=parseInt(Ag.substr(ag+1,Ag.length-ag-2),10)),ig.push([sg,Ig])}),ig.sort((Ag,cg)=>{if(Ag[0]<cg[0])return 1;if(Ag[0]>cg[0])return-1;if(Ag[0]===cg[0]){if(cg[1].indexOf(".webp",cg[1].length-5)!==-1)return 1;if(Ag[1].indexOf(".webp",Ag[1].length-5)!==-1)return-1}return 0});let Cg="",lg;for(let Ag=0;Ag<ig.length;Ag++){lg=ig[Ag],Cg=lg[1];const cg=ig[Ag+1];if(cg&&cg[0]<og){Cg=lg[1];break}else if(!cg){Cg=lg[1];break}}return Cg}const getDPR=(tg=1)=>inBrowser&&window.devicePixelRatio||tg;function supportWebp(){if(!inBrowser)return!1;let tg=!0;function eg(gg,ig){const ng={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"},og=new Image;og.onload=function(){const ag=og.width>0&&og.height>0;ig(ag)},og.onerror=function(){ig(!1)},og.src="data:image/webp;base64,"+ng[gg]}return eg("lossy",gg=>{tg=gg}),eg("lossless",gg=>{tg=gg}),eg("alpha",gg=>{tg=gg}),eg("animation",gg=>{tg=gg}),tg}function throttle(tg,eg){let gg=null,ig=0;return function(){if(gg)return;const ng=Date.now()-ig,og=this,ag=arguments,Ig=function(){ig=Date.now(),gg=!1,tg.apply(og,ag)};ng>=eg?Ig():gg=setTimeout(Ig,eg)}}function testSupportsPassive(){if(!inBrowser)return!1;let tg=!1;try{const eg=Object.defineProperty({},"passive",{get:function(){tg=!0}});window.addEventListener("test",noop,eg)}catch{}return tg}const supportsPassive=testSupportsPassive(),_={on(tg,eg,gg,ig=!1){supportsPassive?tg.addEventListener(eg,gg,{capture:ig,passive:!0}):tg.addEventListener(eg,gg,ig)},off(tg,eg,gg,ig=!1){tg.removeEventListener(eg,gg,ig)}},loadImageAsync=(tg,eg,gg)=>{let ig=new Image;if(!tg||!tg.src){const ng=new Error("image src is required");return gg(ng)}tg.cors&&(ig.crossOrigin=tg.cors),ig.src=tg.src,ig.onload=function(){eg({naturalHeight:ig.naturalHeight,naturalWidth:ig.naturalWidth,src:ig.src}),ig=null},ig.onerror=function(ng){gg(ng)}},style=(tg,eg)=>typeof getComputedStyle<"u"?getComputedStyle(tg,null).getPropertyValue(eg):tg.style[eg],overflow=tg=>style(tg,"overflow")+style(tg,"overflowY")+style(tg,"overflowX"),scrollParent=tg=>{if(!inBrowser)return;if(!(tg instanceof Element))return window;let eg=tg;for(;eg&&!(eg===document.body||eg===document.documentElement||!eg.parentNode);){if(/(scroll|auto)/.test(overflow(eg)))return eg;eg=eg.parentNode}return window};function isObject(tg){return tg!==null&&typeof tg=="object"}function noop(){}class ImageCache{constructor(eg){this.max=eg||100,this._caches=[]}has(eg){return this._caches.indexOf(eg)>-1}add(eg){this.has(eg)||(this._caches.push(eg),this._caches.length>this.max&&this.free())}free(){this._caches.shift()}}class ReactiveListener{constructor(eg,gg,ig,ng,og,ag,Ig,sg,Cg,lg){this.el=eg,this.src=gg,this.error=ig,this.loading=ng,this.bindType=og,this.attempt=0,this.cors=sg,this.naturalHeight=0,this.naturalWidth=0,this.options=Ig,this.rect={},this.$parent=ag,this.elRenderer=Cg,this._imageCache=lg,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}initState(){"dataset"in this.el?this.el.dataset.src=this.src:this.el.setAttribute("data-src",this.src),this.state={loading:!1,error:!1,loaded:!1,rendered:!1}}record(eg){this.performanceData[eg]=Date.now()}update(eg){const gg=this.src;this.src=eg.src,this.loading=eg.loading,this.error=eg.error,this.filter(),gg!==this.src&&(this.attempt=0,this.initState())}getRect(){this.rect=this.el.getBoundingClientRect()}checkInView(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}filter(){for(const eg in this.options.filter)this.options.filter[eg](this,this.options)}renderLoading(eg){this.state.loading=!0,loadImageAsync({src:this.loading,cors:this.cors},()=>{this.render("loading",!1),this.state.loading=!1,eg()},()=>{eg(),this.state.loading=!1,this.options.silent||console.warn(`VueLazyload log: load failed with loading image(${this.loading})`)})}load(eg=noop){if(this.attempt>this.options.attempt-1&&this.state.error){this.options.silent||console.log(`VueLazyload log: ${this.src} tried too more than ${this.options.attempt} times`),eg();return}if(!(this.state.rendered&&this.state.loaded)){if(this._imageCache.has(this.src))return this.state.loaded=!0,this.render("loaded",!0),this.state.rendered=!0,eg();this.renderLoading(()=>{this.attempt++,this.options.adapter.beforeLoad&&this.options.adapter.beforeLoad(this,this.options),this.record("loadStart"),loadImageAsync({src:this.src,cors:this.cors},gg=>{this.naturalHeight=gg.naturalHeight,this.naturalWidth=gg.naturalWidth,this.state.loaded=!0,this.state.error=!1,this.record("loadEnd"),this.render("loaded",!1),this.state.rendered=!0,this._imageCache.add(this.src),eg()},gg=>{!this.options.silent&&console.error(gg),this.state.error=!0,this.state.loaded=!1,this.render("error",!1)})})}}render(eg,gg){this.elRenderer(this,eg,gg)}performance(){let eg="loading",gg=0;return this.state.loaded&&(eg="loaded",gg=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(eg="error"),{src:this.src,state:eg,time:gg}}$destroy(){this.el=null,this.src="",this.error=null,this.loading="",this.bindType=null,this.attempt=0}}const DEFAULT_URL="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",DEFAULT_EVENTS=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],DEFAULT_OBSERVER_OPTIONS={rootMargin:"0px",threshold:0};class Lazy{constructor({preLoad:eg,error:gg,throttleWait:ig,preLoadTop:ng,dispatchEvent:og,loading:ag,attempt:Ig,silent:sg=!0,scale:Cg,listenEvents:lg,filter:Ag,adapter:cg,observer:rg,observerOptions:ug}){this.version='"3.0.0"',this.lazyContainerMananger=null,this.mode=modeType.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:sg,dispatchEvent:!!og,throttleWait:ig||200,preLoad:eg||1.3,preLoadTop:ng||0,error:gg||DEFAULT_URL,loading:ag||DEFAULT_URL,attempt:Ig||3,scale:Cg||getDPR(Cg),listenEvents:lg||DEFAULT_EVENTS,supportWebp:supportWebp(),filter:Ag||{},adapter:cg||{},observer:!!rg,observerOptions:ug||DEFAULT_OBSERVER_OPTIONS},this._initEvent(),this._imageCache=new ImageCache(200),this.lazyLoadHandler=throttle(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?modeType.observer:modeType.event)}performance(){const eg=[];return this.ListenerQueue.map(gg=>eg.push(gg.performance())),eg}addLazyBox(eg){this.ListenerQueue.push(eg),inBrowser&&(this._addListenerTarget(window),this._observer&&this._observer.observe(eg.el),eg.$el&&eg.$el.parentNode&&this._addListenerTarget(eg.$el.parentNode))}add(eg,gg,ig){if(this.ListenerQueue.some(sg=>sg.el===eg))return this.update(eg,gg),nextTick(this.lazyLoadHandler);let{src:ng,loading:og,error:ag,cors:Ig}=this._valueFormatter(gg.value);nextTick(()=>{ng=getBestSelectionFromSrcset(eg,this.options.scale)||ng,this._observer&&this._observer.observe(eg);const sg=Object.keys(gg.modifiers)[0];let Cg;sg&&(Cg=gg.instance.$refs[sg],Cg=Cg?Cg.el||Cg:document.getElementById(sg)),Cg||(Cg=scrollParent(eg));const lg=new ReactiveListener(eg,ng,ag,og,gg.arg,Cg,this.options,Ig,this._elRenderer.bind(this),this._imageCache);this.ListenerQueue.push(lg),inBrowser&&(this._addListenerTarget(window),this._addListenerTarget(Cg)),nextTick(this.lazyLoadHandler)})}update(eg,gg,ig){let{src:ng,loading:og,error:ag}=this._valueFormatter(gg.value);ng=getBestSelectionFromSrcset(eg,this.options.scale)||ng;const Ig=this.ListenerQueue.find(sg=>sg.el===eg);Ig?Ig.update({src:ng,loading:og,error:ag}):(eg.getAttribute("lazy")!=="loaded"||eg.dataset.src!==ng)&&this.add(eg,gg,ig),this._observer&&(this._observer.unobserve(eg),this._observer.observe(eg)),nextTick(this.lazyLoadHandler)}remove(eg){if(!eg)return;this._observer&&this._observer.unobserve(eg);const gg=this.ListenerQueue.find(ig=>ig.el===eg);gg&&(this._removeListenerTarget(gg.$parent),this._removeListenerTarget(window),remove(this.ListenerQueue,gg),gg.$destroy&&gg.$destroy())}removeComponent(eg){eg&&(remove(this.ListenerQueue,eg),this._observer&&this._observer.unobserve(eg.el),eg.$parent&&eg.$el.parentNode&&this._removeListenerTarget(eg.$el.parentNode),this._removeListenerTarget(window))}setMode(eg){!hasIntersectionObserver&&eg===modeType.observer&&(eg=modeType.event),this.mode=eg,eg===modeType.event?(this._observer&&(this.ListenerQueue.forEach(gg=>{this._observer.unobserve(gg.el)}),this._observer=null),this.TargetQueue.forEach(gg=>{this._initListen(gg.el,!0)})):(this.TargetQueue.forEach(gg=>{this._initListen(gg.el,!1)}),this._initIntersectionObserver())}_addListenerTarget(eg){if(!eg)return;let gg=this.TargetQueue.find(ig=>ig.el===eg);return gg?gg.childrenCount++:(gg={el:eg,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===modeType.event&&this._initListen(gg.el,!0),this.TargetQueue.push(gg)),this.TargetIndex}_removeListenerTarget(eg){this.TargetQueue.forEach((gg,ig)=>{gg.el===eg&&(gg.childrenCount--,gg.childrenCount||(this._initListen(gg.el,!1),this.TargetQueue.splice(ig,1),gg=null))})}_initListen(eg,gg){this.options.listenEvents.forEach(ig=>_[gg?"on":"off"](eg,ig,this.lazyLoadHandler))}_initEvent(){this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=(eg,gg)=>{this.Event.listeners[eg]||(this.Event.listeners[eg]=[]),this.Event.listeners[eg].push(gg)},this.$once=(eg,gg)=>{const ig=this;function ng(){ig.$off(eg,ng),gg.apply(ig,arguments)}this.$on(eg,ng)},this.$off=(eg,gg)=>{if(!gg){if(!this.Event.listeners[eg])return;this.Event.listeners[eg].length=0;return}remove(this.Event.listeners[eg],gg)},this.$emit=(eg,gg,ig)=>{this.Event.listeners[eg]&&this.Event.listeners[eg].forEach(ng=>ng(gg,ig))}}_lazyLoadHandler(){const eg=[];this.ListenerQueue.forEach((gg,ig)=>{(!gg.el||!gg.el.parentNode||gg.state.loaded)&&eg.push(gg),gg.checkInView()&&(gg.state.loaded||gg.load())}),eg.forEach(gg=>{remove(this.ListenerQueue,gg),gg.$destroy&&gg.$destroy()})}_initIntersectionObserver(){hasIntersectionObserver&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(eg=>{this._observer.observe(eg.el)}))}_observerHandler(eg){eg.forEach(gg=>{gg.isIntersecting&&this.ListenerQueue.forEach(ig=>{if(ig.el===gg.target){if(ig.state.loaded)return this._observer.unobserve(ig.el);ig.load()}})})}_elRenderer(eg,gg,ig){if(!eg.el)return;const{el:ng,bindType:og}=eg;let ag;switch(gg){case"loading":ag=eg.loading;break;case"error":ag=eg.error;break;default:ag=eg.src;break}if(og?ng.style[og]='url("'+ag+'")':ng.getAttribute("src")!==ag&&ng.setAttribute("src",ag),ng.setAttribute("lazy",gg),this.$emit(gg,eg,ig),this.options.adapter[gg]&&this.options.adapter[gg](eg,this.options),this.options.dispatchEvent){const Ig=new CustomEvent(gg,{detail:eg});ng.dispatchEvent(Ig)}}_valueFormatter(eg){return isObject(eg)?(!eg.src&&!this.options.silent&&console.error("Vue Lazyload warning: miss src with "+eg),{src:eg.src,loading:eg.loading||this.options.loading,error:eg.error||this.options.error,cors:this.options.cors}):{src:eg,loading:this.options.loading,error:this.options.error,cors:this.options.cors}}}const useCheckInView=(tg,eg)=>{let gg=reactive({});const ig=()=>{gg=tg.value.getBoundingClientRect()};return{rect:gg,checkInView:()=>(ig(),inBrowser&&gg.top<window.innerHeight*eg&&gg.bottom>0&&gg.left<window.innerWidth*eg&&gg.right>0)}};var LazyComponent=(tg=>defineComponent({props:{tag:{type:String,default:"div"}},emits:["show"],setup(eg,{emit:gg,slots:ig}){const ng=ref(),og=reactive({loaded:!1,error:!1,attempt:0}),ag=ref(!1),{rect:Ig,checkInView:sg}=useCheckInView(ng,tg.options.preLoad),Cg=()=>{ag.value=!0,og.loaded=!0,gg("show",ag.value)},lg=computed(()=>({el:ng.value,rect:Ig,checkInView:sg,load:Cg,state:og}));return onMounted(()=>{tg.addLazyBox(lg.value),tg.lazyLoadHandler()}),onUnmounted(()=>{tg.removeComponent(lg.value)}),()=>{var Ag;return createVNode(eg.tag,{ref:ng},[ag.value&&((Ag=ig.default)===null||Ag===void 0?void 0:Ag.call(ig))])}}}));class LazyContainerMananger{constructor(eg){this.lazy=eg,eg.lazyContainerMananger=this,this._queue=[]}bind(eg,gg,ig){const ng=new LazyContainer(eg,gg,ig,this.lazy);this._queue.push(ng)}update(eg,gg,ig){const ng=this._queue.find(og=>og.el===eg);ng&&ng.update(eg,gg)}unbind(eg,gg,ig){const ng=this._queue.find(og=>og.el===eg);ng&&(ng.clear(),remove(this._queue,ng))}}const defaultOptions={selector:"img",error:"",loading:""};class LazyContainer{constructor(eg,gg,ig,ng){this.el=eg,this.vnode=ig,this.binding=gg,this.options={},this.lazy=ng,this._queue=[],this.update(eg,gg)}update(eg,gg){this.el=eg,this.options=assignDeep({},defaultOptions,gg.value),this.getImgs().forEach(ng=>{this.lazy.add(ng,assignDeep({},this.binding,{value:{src:ng.getAttribute("data-src")||ng.dataset.src,error:ng.getAttribute("data-error")||ng.dataset.error||this.options.error,loading:ng.getAttribute("data-loading")||ng.dataset.loading||this.options.loading}}),this.vnode)})}getImgs(){return Array.from(this.el.querySelectorAll(this.options.selector))}clear(){this.getImgs().forEach(gg=>this.lazy.remove(gg)),this.vnode=null,this.binding=null,this.lazy=null}}var LazyImage=(tg=>defineComponent({setup(eg,{slots:gg}){const ig=ref(),ng=reactive({src:"",error:"",loading:"",attempt:tg.options.attempt}),og=reactive({loaded:!1,error:!1,attempt:0}),{rect:ag,checkInView:Ig}=useCheckInView(ig,tg.options.preLoad),sg=ref(""),Cg=(cg=noop)=>{if(og.attempt>ng.attempt-1&&og.error)return tg.options.silent||console.log(`VueLazyload log: ${ng.src} tried too more than ${ng.attempt} times`),cg();const rg=ng.src;loadImageAsync({src:rg},({src:ug})=>{sg.value=ug,og.loaded=!0},()=>{og.attempt++,sg.value=ng.error,og.error=!0})},lg=computed(()=>({el:ig.value,rect:ag,checkInView:Ig,load:Cg,state:og}));onMounted(()=>{tg.addLazyBox(lg.value),tg.lazyLoadHandler()}),onUnmounted(()=>{tg.removeComponent(lg.value)});const Ag=()=>{const{src:cg,loading:rg,error:ug}=tg._valueFormatter(eg.src);og.loaded=!1,ng.src=cg,ng.error=ug,ng.loading=rg,sg.value=ng.loading};return watch(()=>eg.src,()=>{Ag(),tg.addLazyBox(lg.value),tg.lazyLoadHandler()},{immediate:!0}),()=>{var cg;return createVNode(eg.tag||"img",{src:sg.value,ref:ig},[(cg=gg.default)===null||cg===void 0?void 0:cg.call(gg)])}}})),index={install(tg,eg={}){const gg=new Lazy(eg),ig=new LazyContainerMananger(gg);if(Number(tg.version.split(".")[0])<3)return new Error("Vue version at least 3.0");tg.config.globalProperties.$Lazyload=gg,tg.provide("Lazyload",gg),eg.lazyComponent&&tg.component("lazy-component",LazyComponent(gg)),eg.lazyImage&&tg.component("lazy-image",LazyImage(gg)),tg.directive("lazy",{beforeMount:gg.add.bind(gg),beforeUpdate:gg.update.bind(gg),updated:gg.lazyLoadHandler.bind(gg),unmounted:gg.remove.bind(gg)}),tg.directive("lazy-container",{beforeMount:ig.bind.bind(ig),updated:ig.update.bind(ig),unmounted:ig.unbind.bind(ig)})}};function createPiniaInstance(){return createPinia()}createPiniaInstance();const DEFAULT_USE_STATE={isShowEditTabs:!0,isMultiLayerEnabled:!0,isSeparateLayerMode:!1,separateLayerCount:2,separateLayerNames:[]},DEFAULT_SETTING_STATE={isShowRuler:!0,isShowGrid:!1},DEFAULT_SYS_CONFIG={config:{layerMaxCount:1}},DEFAULT_EDITOR_CONFIG={width:85.6,height:54,dpi:203,showVarnish:!1,showLaser:0,layerMaxCount:1,separateLayerMode:!1,layerStyleIndependent:!1,separateLayerCount:2,separateLayerNames:[],enabledTools:null,disabledTools:[],visibleMenus:null,enabledMenuItems:null,disabledMenuItems:[]};function resetAllModuleState(){Object.assign(state$1,DEFAULT_USE_STATE),state$1.separateLayerNames=[],Object.assign(getSettingState(),DEFAULT_SETTING_STATE),Object.assign(getSysState(),DEFAULT_SYS_CONFIG),getSysState().config.layerMaxCount=1;const tg=dirtyState();Object.keys(tg).forEach(gg=>delete tg[gg]),Object.assign(getEditorConfig(),DEFAULT_EDITOR_CONFIG),getEditorConfig().separateLayerNames=[],getLaserPresets().value=[],getExternalLaserList().value=[];const eg=getLastSyncResult();eg&&(eg.value=null),resetEditorStack();try{resetDatabaseRuntimeState()}catch{}try{resetBarcodeMap()}catch{}try{hotkeys.unbind()}catch{}}const CMD_LIST=["ReplaceContent","AddPositionOffset","RecoverOriginalHSpacings","RemoveIndexs","RemoveNames","OnlyNames"],DEFAULT_LABEL_CONFIG={pageWidth:85.6,pageHeight:54,DPI:203,backgroundColor:"white",pageShape:"Rectangle",rows:1,columns:1,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,horizontalSpacing:0,verticalSpacing:0,orderStartAngle:"LeftTop",orderDirection:"Horizontal"};function parseJsonData(tg){return typeof tg=="string"?JSON.parse(tg):tg}function parseCanvasJson(tg){return typeof tg=="string"?JSON.parse(tg):tg}function normalizeCanvasJsonList(tg){const eg=parseCanvasJson(tg);return(Array.isArray(eg)?eg:[eg]).filter(Boolean).map(ig=>parseCanvasJson(ig))}function getCanvasLayerId(tg){var eg;try{return(eg=parseCanvasJson(tg))==null?void 0:eg.id}catch{return}}function resolveLayerRenderConfig(tg,eg,gg){const ig=(tg==null?void 0:tg.labelConfig)||{};if(ig.layerStyleIndependent!==!0)return{...ig};const ng=Array.isArray(tg==null?void 0:tg.layers)?tg.layers:[],og=getCanvasLayerId(eg),ag=og&&ng.find(Ig=>(Ig==null?void 0:Ig.id)===og)||ng[gg];return{...ig,...(ag==null?void 0:ag.style)||{}}}function shouldIncludeLayerWorkspace(tg,eg,gg="merged"){var ig;return((ig=tg==null?void 0:tg.labelConfig)==null?void 0:ig.layerStyleIndependent)===!0||gg==="separate"||eg===0}function cloneJsonData(tg){return JSON.parse(JSON.stringify(tg))}function stringifyCanvasLikeSource(tg,eg){return typeof tg=="string"?JSON.stringify(eg):eg}function detectImageMimeFromBase64(tg){try{const eg=tg.replace(/^data:image\/\w+;base64,/,""),gg=atob(eg.slice(0,24)),ig=Array.from(gg).map(og=>og.charCodeAt(0)),ng=og=>og.every((ag,Ig)=>ig[Ig]===ag);if(ng([137,80,78,71]))return"png";if(ng([255,216,255]))return"jpeg";if(ng([71,73,70,56]))return"gif";if(ng([82,73,70,70])&&ig[8]===87&&ig[9]===69&&ig[10]===66&&ig[11]===80)return"webp";if(ng([66,77]))return"bmp"}catch{}return""}function getCmdObjectKey(tg){return tg!=null&&tg.fromJson?tg.jsonFieldKey||tg.name:tg==null?void 0:tg.name}function isCmdMatchObject(tg,eg,gg){const ig=String((tg==null?void 0:tg.type)||"").toLowerCase(),ng=getCmdObjectKey(tg);return gg.name!=null?ng===gg.name:gg.index!=null?eg===Number(gg.index):gg.type!=null?ig===String(gg.type).toLowerCase():!1}function setImageReplaceContent(tg,eg,gg){const ig=eg.content;if(tg.imgScaleType="1",eg.scale||eg.scale===0)switch(Number(eg.scale)){case 0:tg.imgScaleType="1";break;case 1:tg.imgScaleType="3";break;case 2:tg.imgScaleType="2";break}else eg.isScaleToPreviousWidth&&eg.isScaleToPreviousHeight?tg.imgScaleType="1":eg.isScaleToPreviousWidth?tg.imgScaleType="3":eg.isScaleToPreviousHeight&&(tg.imgScaleType="2");if(!ig||typeof ig!="string")return;const ng=ig.match(/url:/i),og=ig.match(/data:image/);if(ng&&ng.index===0){const ag=ig.replace(/url:/i,"");tg.src=gg?gg(ag):ag}else if(og&&og.index===0)tg.src=ig;else{const ag=detectImageMimeFromBase64(ig);ag&&(tg.src=`data:image/${ag};base64,${ig}`)}}function replaceCmdData(tg=[],eg=[],gg="",ig){const ng=[];let og=0;for(const ag of tg){const Ig=String((ag==null?void 0:ag.type)||"").toLowerCase(),sg=(ag==null?void 0:ag.objects)||(ag==null?void 0:ag._objects);if(Ig==="group"&&Array.isArray(sg)){const Ag=replaceCmdData(sg,eg,"inGroup",ig);ag.objects&&(ag.objects=Ag),ag._objects&&(ag._objects=Ag)}let Cg=!1;const lg=getCmdObjectKey(ag);for(const Ag of eg){if(!Ag||!CMD_LIST.includes(Ag.cmd))continue;const cg=Ag.content;switch(Ag.cmd){case"ReplaceContent":if(!isCmdMatchObject(ag,og,Ag))break;switch(Ig){case"text":case"textname":ag.text=cg;break;case"barcode":ag.barcodeOptions&&(ag.barcodeOptions.text=cg);break;case"barcode2d":ag.barcode2dOptions&&(ag.barcode2dOptions.text=cg);break;case"image":setImageReplaceContent(ag,Ag,ig);break}break;case"AddPositionOffset":Number(Ag.x)&&(ag.left+=Number(Ag.x)),Number(Ag.y)&&(ag.top+=Number(Ag.y));break;case"RecoverOriginalHSpacings":break;case"RemoveIndexs":gg!=="inGroup"&&(Ag.indexs||[]).map(ug=>Number(ug)).includes(og)&&(Cg=!0);break;case"RemoveNames":{(Ag.names||[]).includes(lg)&&(Cg=!0),Ig==="group"&&Array.isArray(ag.objects)&&ag.objects.length===0&&(Cg=!0);break}case"OnlyNames":{const rg=Ag.names;Array.isArray(rg)&&!rg.includes(lg)&&(Cg=!0),Ig==="group"&&Array.isArray(ag.objects)&&ag.objects.length>0&&(Cg=!1);break}}}og++,Cg||ng.push(ag)}return ng}function replaceCanvasCmdData(tg,eg=[],gg){if(!eg.length)return tg;const ig=cloneJsonData(tg),ng=og=>{if(!og)return og;const Ig=(Array.isArray(og)?og:[og]).map(sg=>{const Cg=parseCanvasJson(sg);return Cg.objects=replaceCmdData(Cg.objects||[],eg,"",gg),stringifyCanvasLikeSource(sg,Cg)});return Array.isArray(og)?Ig:Ig[0]};return ig.canvas=ng(ig.canvas),Array.isArray(ig.layers)&&(ig.layers=ig.layers.map(og=>({...og,canvas:ng(og==null?void 0:og.canvas)}))),ig}function loadImage(tg){return tg?new Promise(eg=>{const gg=new Image;gg.onload=()=>eg(gg),gg.onerror=()=>eg(null),gg.src=tg}):Promise.resolve(null)}function getAllCanvasObjects(tg){const eg=[],gg=ig=>{ig.type==="group"&&ig._objects?ig._objects.forEach(ng=>gg(ng)):ig.id!=="workspace"&&eg.push(ig)};return tg.getObjects().forEach(ig=>gg(ig)),eg}async function createExportWorkspace({labelConfig:tg,width:eg,height:gg}){const ig=(tg==null?void 0:tg.backgroundColor)||"white",ng=(tg==null?void 0:tg.backgroundImage)||"",og=(tg==null?void 0:tg.backgroundImageCover)!==!1,ag=(tg==null?void 0:tg.ribbonBorder)||null,Ig=(tg==null?void 0:tg.pageShape)||"Rectangle",sg=ng?await loadImage(ng):null;let Cg=null,lg=null;ag!=null&&ag.pattern&&ag.pattern!=="none"&&([Cg,lg]=await Promise.all([loadImage(ag.left||""),loadImage(ag.right||"")]));const Ag=Ig==="Ellipse"?new _o({fill:ig,width:eg,height:gg,rx:eg/2,ry:gg/2,strokeWidth:0}):new Er({fill:ig,width:eg,height:gg,rx:Ig==="RoundedRectangle"&&(tg==null?void 0:tg.rx)||0,ry:Ig==="RoundedRectangle"&&(tg==null?void 0:tg.ry)||0,strokeWidth:0});if(Ag.set("id","workspace"),Ag.set("selectable",!1),Ag.set("hasControls",!1),Ag.excludeFromExport=!1,sg||Cg&&lg){const cg=Ag._render.bind(Ag);Ag._render=rg=>{if(cg(rg),sg){const ug=sg.naturalWidth||sg.width,dg=sg.naturalHeight||sg.height;if(ug&&dg){const bg=og?eg:ug,mg=og?gg:dg;rg.save(),rg.beginPath(),rg.rect(-eg/2,-gg/2,eg,gg),rg.clip(),rg.drawImage(sg,-bg/2,-mg/2,bg,mg),rg.restore()}}ag!=null&&ag.pattern&&ag.pattern!=="none"&&Cg&&lg&&drawRibbonBorder(rg,ag.pattern,{left:-eg/2,top:-gg/2,width:eg,height:gg},{left:Cg,right:lg})}}return Ag}async function renderCanvasLayer({canvasJson:tg,includeWorkspace:eg,includeFullDataUrl:gg=!1,width:ig,height:ng,labelDPI:og,multiplier:ag,scaleList:Ig=[],resTarget:sg="img",labelConfig:Cg}){let lg=document.createElement("canvas"),Ag=new se(lg,{width:ig,height:ng,imageSmoothingEnabled:!1,fireMiddleClick:!0,fireRightClick:!0,stopContextMenu:!1,controlsAboveOverlay:!0,preserveObjectStacking:!0,selectionKey:"ctrlKey"});try{Ag.leRenderEnv="transform";const cg=await Ag.loadFromJSON(tg);if(eg){const mg=await createExportWorkspace({labelConfig:Cg,width:ig,height:ng});cg.insertAt(0,mg)}const rg=getAllCanvasObjects(cg),ug=[];let dg=!1;rg.forEach(mg=>{if(mg.type==="text"&&(mg.set({left:Math.trunc(mg.left),top:Math.trunc(mg.top)}),mg.width=Math.trunc(mg.width),mg.height=Math.trunc(mg.height),mg.fontFamily&&mg.fontFamily.indexOf("宋体")>-1&&!mg.strokeWidth&&mg.set({strokeWidth:.3})),mg.type==="image"){let hg=!1;if(Ig&&Ig.length){for(const pg of Ig)if(pg.name===mg.name){hg=!0;break}}hg||(mg.imgScaleType=mg.imgScaleType||"1"),Number(mg.imgScaleType)>1&&(mg.isScaleOtherSidedys=!0),mg.imageAlign&&mg.imageAlign!=="leftTop"&&ug.push(mg),mg.isSetSharpen&&(dg=!0)}}),cg.renderAll(),ug.forEach(mg=>{typeof mg.refreshAlignCoords=="function"&&mg.refreshAlignCoords(og)}),cg.renderAll();const bg={};if(sg==="img"||sg==="all"){if(gg)return{fullDataUrl:Ag.toDataURL({format:"png",quality:1,multiplier:ag})};const mg=["text","counter","textname","group","table"];bg.textDataUrl=Ag.toDataURL({multiplier:ag,filter:pg=>mg.includes(pg.type)&&pg.id!=="workspace"});const hg=["image","barcode","barcode2d","rect","circle","line","triangle"];bg.imgDataUrl=Ag.toDataURL({multiplier:ag,filter:pg=>(hg.includes(pg.type)||pg.id==="workspace")&&!pg.isSetSharpen}),bg.sharpenDataUrl="",dg&&(bg.sharpenDataUrl=Ag.toDataURL({multiplier:ag,filter:pg=>pg.type==="image"&&pg.isSetSharpen}))}return(sg==="json"||sg==="all")&&(bg.dataJson=Ag.toJSON()),bg}finally{Ag==null||Ag.dispose(),Ag=null,lg=null}}async function composeDataUrlsToPng(tg,eg,gg){const ig=tg.filter(Boolean);if(!ig.length)return"";if(ig.length===1)return ig[0];const ng=document.createElement("canvas");ng.width=Math.max(1,Math.round(eg)),ng.height=Math.max(1,Math.round(gg));const og=ng.getContext("2d");if(!og)return ig[0];for(const ag of ig){const Ig=await loadImage(ag);Ig&&og.drawImage(Ig,0,0,ng.width,ng.height)}return ng.toDataURL("image/png",1)}async function composeDataUrlsHorizontally(tg,eg,gg,ig=130){const ng=tg.filter(Boolean);if(!ng.length)return"";if(ng.length===1)return ng[0];const og=document.createElement("canvas");og.width=Math.max(1,Math.round(ng.length*eg+(ng.length-1)*ig)),og.height=Math.max(1,Math.round(gg));const ag=og.getContext("2d");if(!ag)return ng[0];ag.imageSmoothingEnabled=!1;for(let Ig=0;Ig<ng.length;Ig++){const sg=await loadImage(ng[Ig]);sg&&ag.drawImage(sg,Ig*(eg+ig),0,eg,gg)}return og.toDataURL("image/png",1)}function getRenderMetrics(tg,eg={}){const gg={...DEFAULT_LABEL_CONFIG,...tg.labelConfig||{}},ig=Number(gg.DPI||eg.dpi)||203,ng=Number(eg.width||gg.pageWidth)||85.6,og=Number(eg.height||gg.pageHeight)||54,ag=ng*ig/25.4,Ig=og*ig/25.4;return{labelConfig:gg,labelDPI:ig,width:ag,height:Ig}}async function withTimeout(tg,eg=5e3,gg="加载 json 图片超时"){return new Promise((ig,ng)=>{const og=window.setTimeout(()=>{ng(new Error(gg))},eg);tg.then(ag=>ig(ag)).catch(ag=>ng(ag)).finally(()=>window.clearTimeout(og))})}function hasCounterInCanvas(tg){var ig,ng;if(!tg)return!1;const eg=typeof tg=="string"?JSON.parse(tg):tg,gg=(eg==null?void 0:eg.objects)||[];for(const og of gg){if(String((og==null?void 0:og.type)||"").toLowerCase()==="counter"&&((ig=og==null?void 0:og._props)==null?void 0:ig.mode)==="1"||og!=null&&og.counterProps&&(og.counterProps.value||og.counterProps.value===0))return!0;const Ig=(og==null?void 0:og.objects)||(og==null?void 0:og._objects);if(Array.isArray(Ig)){for(const sg of Ig)if(String((sg==null?void 0:sg.type)||"").toLowerCase()==="counter"&&((ng=sg==null?void 0:sg._props)==null?void 0:ng.mode)==="1"||sg!=null&&sg.counterProps&&(sg.counterProps.value||sg.counterProps.value===0))return!0}}return!1}function hasCounterObjects(tg){return tg.some(eg=>hasCounterInCanvas(eg))}function computeCounterValueAt(tg,eg){if(eg<=0)return tg.value;const gg=tg.valueType==="letter"?"letter":"number",ng=(Math.trunc(Number(tg.incremental))||0)*eg;if(gg==="letter"){const ag=Cg=>String(Cg??"").toUpperCase().replace(/[^A-Z]/g,"").split("").reduce((lg,Ag)=>lg*26+Ag.charCodeAt(0)-64,0)||1,Ig=Cg=>{let lg=Math.max(1,Math.trunc(Cg)),Ag="";for(;lg>0;)lg--,Ag=String.fromCharCode(65+lg%26)+Ag,lg=Math.floor(lg/26);return Ag||"A"},sg=ag(String(tg.value));return Ig(sg+ng)}const og=Number(tg.value);return Number.isFinite(og)?og+ng:tg.value}function applyCounterOffsetToObjects(tg,eg){var gg,ig;for(const ng of tg){const og=String((ng==null?void 0:ng.type)||"").toLowerCase(),ag=(ng==null?void 0:ng.objects)||(ng==null?void 0:ng._objects);if(og==="group"&&Array.isArray(ag)&&applyCounterOffsetToObjects(ag,eg),og==="counter"&&((gg=ng==null?void 0:ng._props)==null?void 0:gg.mode)==="1"&&((ig=ng==null?void 0:ng._props)!=null&&ig.args)){const Ig=ng._props.args;if(Ig.value||Ig.value===0){const sg={value:Ig.value,incremental:Ig.incremental,length:Ig.length,zeroPadding:Ig.zeroPadding,valueType:Ig.valueType},Cg=computeCounterValueAt(sg,eg);Ig.value=Cg}}if(ng!=null&&ng.counterProps&&(ng.counterProps.value||ng.counterProps.value===0)){const Ig={value:ng.counterProps.value,incremental:ng.counterProps.incremental,length:ng.counterProps.length,zeroPadding:ng.counterProps.zeroPadding,valueType:ng.counterProps.valueType},sg=computeCounterValueAt(Ig,eg);ng.counterProps.value=sg}}}function cloneCanvasWithCounterOffset(tg,eg){return eg<=0?tg:tg.map(gg=>{const ig=typeof gg=="string"?JSON.parse(gg):gg,ng=JSON.parse(JSON.stringify(ig));return ng!=null&&ng.objects&&applyCounterOffsetToObjects(ng.objects,eg),typeof gg=="string"?JSON.stringify(ng):ng})}async function composeMultiTagsImageWithCounters(tg,eg,gg,ig,ng,og,ag,Ig,sg,Cg){const{rows:lg,columns:Ag,count:cg}=getMultiTagCount(eg);if(cg<=1)return"";const rg=ag/25.4,ug=Math.round(ng),dg=Math.round(og),bg=Math.round((Number(eg.paddingLeft)||0)*rg),mg=Math.round((Number(eg.paddingTop)||0)*rg),hg=Math.round((Number(eg.horizontalSpacing)||0)*rg),pg=Math.round((Number(eg.verticalSpacing)||0)*rg),fg=getOrderTable(lg,Ag,eg.orderStartAngle||"LeftTop",eg.orderDirection||"Horizontal"),wg=document.createElement("canvas");wg.width=Math.max(1,Math.round(gg)),wg.height=Math.max(1,Math.round(ig));const Gg=wg.getContext("2d");if(!Gg)return"";Gg.imageSmoothingEnabled=!1;const Zg=o.DPI;try{o.DPI=ag;for(let yg=0;yg<cg;yg++){const Bg=cloneCanvasWithCounterOffset(tg,yg),Wg=[];for(let Rg=0;Rg<Bg.length;Rg++){const Sg={...sg,labelConfig:Ig},Yg=await renderCanvasLayer({canvasJson:Bg[Rg],includeWorkspace:shouldIncludeLayerWorkspace(Sg,Rg,Cg),includeFullDataUrl:!0,width:ng,height:og,labelDPI:ag,multiplier:1,scaleList:[],resTarget:"img",labelConfig:resolveLayerRenderConfig(Sg,Bg[Rg],Rg)});Wg.push(Yg.fullDataUrl||"")}const $g=await composeDataUrlsToPng(Wg,ng,og),Ng=await loadImage($g);if(!Ng)continue;const[vg,Xg]=fg[yg]||[Math.floor(yg/Ag),yg%Ag],Vg=bg+Xg*(ug+hg),Mg=mg+vg*(dg+pg);Gg.drawImage(Ng,Vg,Mg,ug,dg)}}finally{o.DPI=Zg}return wg.toDataURL("image/png",1)}function getMultiTagCount(tg){const eg=Math.max(1,Math.floor(Number(tg==null?void 0:tg.rows)||1)),gg=Math.max(1,Math.floor(Number(tg==null?void 0:tg.columns)||1));return{rows:eg,columns:gg,count:eg*gg}}function getTagSizeMM(tg){const eg=Number(tg==null?void 0:tg.pageWidth)||0,gg=Number(tg==null?void 0:tg.pageHeight)||0;let ig=Number(tg==null?void 0:tg.tagWidth)||0,ng=Number(tg==null?void 0:tg.tagHeight)||0;if(!ig||!ng||ig===eg&&ng===gg){const og=Number(tg==null?void 0:tg.columns)||1,ag=Number(tg==null?void 0:tg.rows)||1;ig=Math.floor((eg-Number((tg==null?void 0:tg.paddingLeft)||0)-Number((tg==null?void 0:tg.paddingRight)||0)-Number((tg==null?void 0:tg.horizontalSpacing)||0)*(og-1))/og*100)/100,ng=Math.floor((gg-Number((tg==null?void 0:tg.paddingTop)||0)-Number((tg==null?void 0:tg.paddingBottom)||0)-Number((tg==null?void 0:tg.verticalSpacing)||0)*(ag-1))/ag*100)/100}return{width:ig,height:ng}}function getOrderTable(tg,eg,gg="LeftTop",ig="Horizontal"){const ng=[];if(ig==="Horizontal"){const og=gg==="LeftTop"||gg==="RightTop"?[...Array(tg).keys()]:[...Array(tg).keys()].reverse(),ag=gg==="LeftTop"||gg==="LeftBottom"?[...Array(eg).keys()]:[...Array(eg).keys()].reverse();for(const Ig of og)for(const sg of ag)ng.push([Ig,sg])}else{const og=gg==="LeftTop"||gg==="LeftBottom"?[...Array(eg).keys()]:[...Array(eg).keys()].reverse(),ag=gg==="LeftTop"||gg==="RightTop"?[...Array(tg).keys()]:[...Array(tg).keys()].reverse();for(const Ig of og)for(const sg of ag)ng.push([sg,Ig])}return ng}async function composeMultiTagsImage(tg,eg,gg,ig,ng,og,ag){if(!tg)return"";const{rows:Ig,columns:sg,count:Cg}=getMultiTagCount(eg);if(Cg<=1)return tg;const lg=await loadImage(tg);if(!lg)return tg;const Ag=ag/25.4,cg=Math.round(ng),rg=Math.round(og),ug=Math.round((Number(eg.paddingLeft)||0)*Ag),dg=Math.round((Number(eg.paddingTop)||0)*Ag),bg=Math.round((Number(eg.horizontalSpacing)||0)*Ag),mg=Math.round((Number(eg.verticalSpacing)||0)*Ag),hg=getOrderTable(Ig,sg,eg.orderStartAngle||"LeftTop",eg.orderDirection||"Horizontal"),pg=document.createElement("canvas");pg.width=Math.max(1,Math.round(gg)),pg.height=Math.max(1,Math.round(ig));const fg=pg.getContext("2d");if(!fg)return tg;fg.imageSmoothingEnabled=!1;for(let wg=0;wg<Cg;wg++){const[Gg,Zg]=hg[wg]||[Math.floor(wg/sg),wg%sg],yg=ug+Zg*(cg+bg),Bg=dg+Gg*(rg+mg);fg.drawImage(lg,yg,Bg,cg,rg)}return pg.toDataURL("image/png",1)}async function loadJsonToImageBase64(tg,eg={}){const{cmds:gg=[],timeout:ig=5e3,returnDataUrl:ng=!0,imageUrlResolver:og,mode:ag="merged",gap:Ig=50}=eg,sg=replaceCanvasCmdData(parseJsonData(tg),gg,og),{labelConfig:Cg,labelDPI:lg,width:Ag,height:cg}=getRenderMetrics(sg,{dpi:eg.dpi,width:eg.width,height:eg.height}),{count:rg}=getMultiTagCount(Cg),ug=rg>1;let dg=Ag,bg=cg;if(ug){const Wg=getTagSizeMM(Cg);dg=Wg.width*lg/25.4,bg=Wg.height*lg/25.4}const mg=o.DPI,hg=normalizeCanvasJsonList(sg.canvas),pg={...sg,labelConfig:Cg},fg=[],wg=ug&&hasCounterObjects(hg),Gg=(async()=>{try{if(o.DPI=lg,wg)return composeMultiTagsImageWithCounters(hg,Cg,Ag,cg,dg,bg,lg,Cg,pg,ag);for(let $g=0;$g<hg.length;$g++){const Ng=await renderCanvasLayer({canvasJson:hg[$g],includeWorkspace:shouldIncludeLayerWorkspace(pg,$g,ag),includeFullDataUrl:!0,width:dg,height:bg,labelDPI:lg,multiplier:1,scaleList:[],resTarget:"img",labelConfig:resolveLayerRenderConfig(pg,hg[$g],$g)});fg.push(Ng.fullDataUrl||"")}if(ag==="separate"){const $g=await composeDataUrlsHorizontally(fg,dg,bg,Ig);return{images:fg,composedImage:$g}}const Wg=await composeDataUrlsToPng(fg,dg,bg);return ug?composeMultiTagsImage(Wg,Cg,Ag,cg,dg,bg,lg):Wg}finally{o.DPI=mg}})(),Zg=wg?Math.max(ig,ig*rg):ig,yg=await withTimeout(Gg,Zg),Bg=Wg=>ng?Wg:Wg.replace(/^data:image\/\w+;base64,/,"");return typeof yg=="string"?Bg(yg):{images:yg.images.map(Bg),composedImage:Bg(yg.composedImage)}}let _activeInstance=null,_laserWarnShown=!1;function normalizeFileFieldJson(tg){if(typeof tg=="string"){const gg=tg.trim();return gg?(JSON.parse(gg),gg):""}const eg=JSON.stringify(tg,null,2);if(eg===void 0)throw new Error("Invalid fileFieldJson");return JSON.parse(eg),eg}function countSize(tg,eg="MB"){const gg=new TextEncoder().encode(tg).length;return eg==="KB"?gg/1024:gg/(1024*1024)}class LabelEditor{constructor(eg,gg){tl(this,"_autoSaveTimer",null);tl(this,"_insertFileFieldJsonTimer",null);tl(this,"_pendingFileFieldJson",null);tl(this,"_fileFieldJsonLabelReadyHandler",null);tl(this,"_app",null);tl(this,"_el",null);tl(this,"_initialLang",null);tl(this,"_localeController");tl(this,"_releaseActiveI18n",null);tl(this,"_stopLocaleWatch",null);tl(this,"_destroyed",!1);tl(this,"_isReplaceFont",!1);tl(this,"_maxSize",0);const ig=gg||{},ng=!!ig.__offscreenRender;if(!ng&&_activeInstance&&!_activeInstance._destroyed&&_activeInstance._el===eg)return console.warn("[LabelEditor] 同一容器已有活跃实例,复用现有实例"),ig.messages&&_activeInstance.setMessages(ig.messages),reuseEditorWithLocale(_activeInstance,ig.locale);if(!ng&&_activeInstance&&!_activeInstance._destroyed&&(console.warn("[LabelEditor] 检测到其他容器上的活跃实例,先销毁旧实例"),_activeInstance.destroy()),gg!=null&&gg.maxSize&&(this._maxSize=gg==null?void 0:gg.maxSize),gg&&!ng){const Cg={...gg};delete Cg.__offscreenRender,delete Cg.locale,delete Cg.messages,Cg.separateLayerMode=Cg.separateLayerMode===!0,Object.keys(Cg).length&&setEditorConfig(Cg),this.setSeparateLayerMode(!!getEditorConfig().separateLayerMode),getEditorConfig().separateLayerMode?this.setLayerMaxCount(getEditorConfig().separateLayerCount):this.setLayerMaxCount(Cg.layerMaxCount??1)}resetFontState();const og=ng?LabelEditor._pauseVueDevtoolsForOffscreenRender():()=>{},ag=createApp(_sfc_main),Ig=createEditorI18n(ig.locale,ig.messages),{i18n:sg}=Ig;this._localeController=Ig,this._initialLang=eg.getAttribute("lang"),ng&&(ag.config.devtools=!1),ag.config.errorHandler=(Cg,lg,Ag)=>{console.error("全局错误:",Cg,lg,Ag)};try{const Cg=createPiniaInstance();this._stopLocaleWatch=mountEditorApplication(ag,eg,Ig,()=>{ag.use(sg),ag.use(Cg).use(index,{}).use(modalInstall).use(loadingInstall)})}finally{og()}this._app=ag,this._el=eg,ng||(this._releaseActiveI18n=activateEditorI18n(Ig),_activeInstance=this)}static _pauseVueDevtoolsForOffscreenRender(){const eg=window,gg="__VUE_DEVTOOLS_GLOBAL_HOOK__",ig=Object.prototype.hasOwnProperty.call(eg,gg),ng=eg[gg];if(!ng)return()=>{};try{return eg[gg]=void 0,()=>{ig?eg[gg]=ng:delete eg[gg]}}catch{const og=ng.enabled;return ng.enabled=!1,()=>{ng.enabled=og}}}static async loadJsonToImageBase64(eg,gg={}){return LabelEditor.exportImage({...gg,data:eg})}static async exportImage(eg){const{data:gg,...ig}=eg;return loadJsonToImageBase64(gg,ig)}get loadedFonts(){return loadedFonts}setLocale(eg){return this._localeController.setLocale(eg)}getLocale(){return this._localeController.locale.value}destroy(){var eg,gg,ig;if(!this._destroyed){this._destroyed=!0,_laserWarnShown=!1,clearInterval(this._autoSaveTimer),this._autoSaveTimer=null,clearTimeout(this._insertFileFieldJsonTimer),this._insertFileFieldJsonTimer=null,this._pendingFileFieldJson=null,this._fileFieldJsonLabelReadyHandler&&(emitter.off("label-ready",this._fileFieldJsonLabelReadyHandler),this._fileFieldJsonLabelReadyHandler=null),(eg=this._stopLocaleWatch)==null||eg.call(this),this._stopLocaleWatch=null,(gg=this._releaseActiveI18n)==null||gg.call(this),this._releaseActiveI18n=null,this._app&&(this._app.unmount(),this._app=null);try{setActivePinia(this._pinia);const ng=useTabsStore();(ig=ng.$reset)==null||ig.call(ng)}catch{}try{getActivePinia()===this._pinia&&setActivePinia(null)}catch{}this._pinia=null,resetDatabaseRuntimeState(),emitter.all.clear(),canvasEventBus.all.clear();try{resetFontState()}catch{}try{resetAllModuleState()}catch{}this._el&&(this._initialLang==null?this._el.removeAttribute("lang"):this._el.setAttribute("lang",this._initialLang),this._el.innerHTML="",this._el=null),this._initialLang=null,_activeInstance===this&&(_activeInstance=null)}}filterLoadFontByName(eg){let gg=Array.from(this.loadedFonts);return eg.filter(ng=>{let og=!0;if(og=!gg.includes(ng),!this._isReplaceFont){for(let ag of fontListDefault)if(ag.label===ng){og=!1;break}}return og})}loadJson(eg,{newFile:gg=!1}={}){let ng=typeof eg=="string"?JSON.parse(eg):eg;const og=new Set(extractFontNames(ng.canvas));if(Array.isArray(ng.layers)&&ng.layers.forEach(sg=>{sg!=null&&sg.canvas&&extractFontNames(sg.canvas).forEach(Cg=>og.add(Cg))}),og.size){let sg=Array.from(og);emitter.emit("selectFontCallback",sg)}gg?resetLaserPresetsFromExternal():ng.laserConfigList&&Array.isArray(ng.laserConfigList)?setLaserPresets(ng.laserConfigList):resetLaserPresetsFromExternal();const ag=ng.labelConfig||getTempLabelConfig();ag.layerStyleIndependent==null&&(ag.layerStyleIndependent=getEditorConfig().layerStyleIndependent),emitter.emit("label-config",{labelConfig:ag,canvas:ng.canvas,layers:ng.layers,activeLayerId:ng.activeLayerId,newFile:gg});const Ig=syncExternalPresets();this.notifyLaserSyncWarning(Ig,ng)}notifyLaserSyncWarning(eg,gg){const ig=[];if(eg.deletedNames.length>0&&ig.push(translate("editor.specialist.laser.deletedWarning",{deletedNames:eg.deletedNames.join('"、"')})),eg.newPresets.length>0){const og=getLaserMaxPresets();og>0&&this.countUsedLaserPresets(gg)+eg.newPresets.length>og&&ig.push(translate("editor.specialist.laser.limitWarning",{maxPresets:og}))}if(ig.length===0)return;const ng=ig.join(`
960
- `);_laserWarnShown||(_laserWarnShown=!0,setTimeout(()=>{Modal$1.warning({title:translate("editor.specialist.laser.title"),content:ng,okText:translate("common.actions.confirm"),centered:!0})},0))}countUsedLaserPresets(eg){if(!eg)return 0;const gg=new Set,ig=ng=>{try{(JSON.parse(ng).objects||[]).forEach(ag=>{var sg;const Ig=(sg=ag.customExportFields)==null?void 0:sg.laserConfigId;Ig&&gg.add(Ig)})}catch{}};return typeof eg.canvas=="string"?ig(eg.canvas):Array.isArray(eg.canvas)&&eg.canvas.forEach(ng=>ig(ng)),Array.isArray(eg.layers)&&eg.layers.forEach(ng=>{typeof(ng==null?void 0:ng.canvas)=="string"&&ig(ng.canvas)}),gg.size}exportJson(eg="checkFile"){return new Promise((gg,ig)=>{emitter.emit("toTemplateJson",ng=>{try{const og=JSON.parse(ng||"{}"),ag=extractFontNames(og.canvas),Ig=getCustomFonts(ag);Ig.length&&(og.labelConfig.customFonts=Ig);const sg=new Set,Cg=cg=>{try{(JSON.parse(cg).objects||[]).forEach(ug=>{var bg;const dg=(bg=ug.customExportFields)==null?void 0:bg.laserConfigId;dg&&sg.add(dg)})}catch{}};typeof og.canvas=="string"?Cg(og.canvas):Array.isArray(og.canvas)&&og.canvas.forEach(cg=>Cg(cg));const lg=getLaserPresets();lg.value.length>0&&(og.laserConfigList=lg.value.filter(cg=>sg.has(cg.configId)),og.laserConfigList.length===0&&delete og.laserConfigList);let Ag=JSON.stringify(og);if(eg==="checkFile"&&this._maxSize&&countSize(Ag)>this._maxSize){ig(`画布大于${this._maxSize}MB, 不能保存`);return}gg(Ag)}catch(og){ig(og)}})})}async getFileJsonSize(){let eg=await this.exportJson("noCheck"),gg=countSize(eg,"KB");return gg=Number(gg.toFixed(2)),gg}addCustomFontList(eg){emitter.emit("addCustomFontList",eg)}replaceFontList(eg){this._isReplaceFont=!0,emitter.emit("replaceFontList",eg)}setLaserConfigList(eg){const gg=setLaserConfigList(eg);gg&&this.notifyLaserSyncWarning(gg)}selectFontCallback(eg){emitter.off("selectFontCallback"),emitter.on("selectFontCallback",gg=>{let ig=this.filterLoadFontByName(gg)||[];eg&&ig.length&&eg(ig)})}async loadFontFile(eg){const{fontName:gg,blob:ig}=eg;return!gg||!ig?!1:loadFontFromBlob(gg,ig)}exportImage(eg={}){return new Promise(gg=>{emitter.emit("exportImage",{options:eg,callback:ig=>{gg(ig)}})})}toggleMultiLayer(eg=!0){state$1.isMultiLayerEnabled=!!eg}setMultiLayerEnabled(eg=!0){this.toggleMultiLayer(eg)}setMessages(eg){this._localeController.setMessages(eg)}async setLayerStyleIndependent(eg=!0){const gg=async()=>{var ag;const ig=useTabsStore(),ng=(ag=ig.getActiveTab)==null?void 0:ag.call(ig);if(!(ng!=null&&ng.config))return!1;applyLayerStyleIndependent(ng,eg),ig.storeTabs(ig.tabs),setFileDirty(ng.id);const og=emitter.all.get("layer-style-independent-change");return og!=null&&og.length&&await new Promise(Ig=>{let sg=!1;const Cg=()=>{sg||(sg=!0,Ig())};emitter.emit("layer-style-independent-change",{done:Cg})}),!0};if(!await gg())return new Promise(ig=>{const ng=setTimeout(()=>{emitter.off("label-ready",og),gg(),ig()},3e3),og=()=>{clearTimeout(ng),emitter.off("label-ready",og),gg().finally(ig)};emitter.on("label-ready",og)})}setLayerMaxCount(eg=1){setSysConfigState({...getSysConfigState(),layerMaxCount:state$1.isSeparateLayerMode?state$1.separateLayerCount:getLayerMaxCount(eg)})}_applyFileFieldJson(eg){const gg=useTabsStore(),ig=gg.getActiveTab();if(!(ig!=null&&ig.config))return!1;const ng=ig.config.fileFieldJson||"",og=this._computeFileFieldJsonDiff(ng,eg);return ig.config.fileFieldJson=eg,gg.storeTabs(gg.tabs),setFileDirty(ig.id),og&&emitter.emit("file-field-json-changed",og),!0}_computeFileFieldJsonDiff(eg,gg){if(!eg&&!gg)return null;let ig={},ng={};try{ig=JSON.parse(eg||"{}")}catch{}try{ng=JSON.parse(gg||"{}")}catch{}(typeof ig!="object"||ig===null||Array.isArray(ig))&&(ig={}),(typeof ng!="object"||ng===null||Array.isArray(ng))&&(ng={});const og={renamed:[],removed:[],added:[],valueChanged:[]},ag=Object.keys(ig),Ig=Object.keys(ng),sg=new Set(ag),Cg=new Set(Ig);for(const lg of ag)Cg.has(lg)?String(ig[lg])!==String(ng[lg])&&og.valueChanged.push({key:lg,oldValue:String(ig[lg]??""),newValue:String(ng[lg]??"")}):og.removed.push(lg);for(const lg of Ig)sg.has(lg)||og.added.push(lg);return!og.renamed.length&&!og.removed.length&&!og.added.length&&!og.valueChanged.length?null:og}insertFileFieldJson(eg){try{const gg=normalizeFileFieldJson(eg);if(!gg)return!1;if(this._applyFileFieldJson(gg))return!0;this._cleanupFileFieldJsonPending(),this._pendingFileFieldJson=gg;const ig=()=>{this._destroyed||this._applyFileFieldJson(gg)&&this._cleanupFileFieldJsonPending()};return this._fileFieldJsonLabelReadyHandler=ig,emitter.on("label-ready",ig),this._insertFileFieldJsonTimer=setTimeout(()=>{this._destroyed||(this._applyFileFieldJson(gg),this._cleanupFileFieldJsonPending())},3e3),!0}catch(gg){return console.error("[LabelEditor] insertFileFieldJson failed:",gg),!1}}_cleanupFileFieldJsonPending(){this._fileFieldJsonLabelReadyHandler&&(emitter.off("label-ready",this._fileFieldJsonLabelReadyHandler),this._fileFieldJsonLabelReadyHandler=null),clearTimeout(this._insertFileFieldJsonTimer),this._insertFileFieldJsonTimer=null,this._pendingFileFieldJson=null}setSeparateLayerMode(eg=!0){state$1.isSeparateLayerMode=!!eg,state$1.isSeparateLayerMode&&(state$1.isMultiLayerEnabled=!0,state$1.separateLayerCount=getEditorConfig().separateLayerCount,state$1.separateLayerNames=[...getEditorConfig().separateLayerNames],this.setLayerMaxCount(state$1.separateLayerCount))}async getThumbnailImage(eg={}){const ig=useTabsStore().getActiveTab();if(!(ig!=null&&ig.config))return"";let og=ig==null?void 0:ig.config,ag="";og.separateLayerMode?ag=await this.getDoubleRibbonsImage(eg):ag=await this.getImage(eg);let Ig=document.createElement("canvas"),sg=Ig.getContext("2d"),Cg=og.pageWidth,Ag=og.pageHeight/Cg,cg=300,rg=cg*Ag;Ig.width=cg,Ig.height=rg;let ug=await this.loadImage(ag);return sg==null||sg.drawImage(ug,0,0,cg,rg),Ig.toDataURL()}loadImage(eg){return new Promise((gg,ig)=>{const ng=new Image;ng.onload=()=>gg(ng),ng.onerror=ig,ng.src=eg,ng.complete&&gg(ng)})}getImage(eg={}){return this.exportImage(eg)}getDoubleRibbonsImage(eg={}){return new Promise(gg=>{this.exportImage({...eg,mode:"separate",layout:"doubleRibbons"}).then(ig=>{gg((ig==null?void 0:ig.composedImage)||ig)})})}enterDoubleRibbons(){state$1.isSeparateLayerMode=!0,state$1.isMultiLayerEnabled=!0,state$1.separateLayerCount=2,state$1.separateLayerNames=[this._localeController.translate("editor.remaining.upperLayer"),this._localeController.translate("editor.remaining.lowerLayer")],this.setLayerMaxCount(state$1.separateLayerCount),emitter.emit("separate-layer-config-change",{count:state$1.separateLayerCount,names:[...state$1.separateLayerNames]})}setSeparateLayerConfig(eg={}){eg.count!=null&&(state$1.separateLayerCount=getLayerMaxCount(eg.count)),eg.names!=null&&(state$1.separateLayerNames=Array.isArray(eg.names)?eg.names.map(gg=>String(gg||"").trim()).filter(Boolean):[]),state$1.isSeparateLayerMode&&(this.setLayerMaxCount(state$1.separateLayerCount),emitter.emit("separate-layer-config-change",{count:state$1.separateLayerCount,names:[...state$1.separateLayerNames]}))}toggleEditTabs(eg=!0){state$1.isShowEditTabs=!!eg}checkFileSave(){return new Promise(eg=>{emitter.emit("checkFileSave",gg=>{eg(gg)})})}openAutoSave(eg,gg=5e3){clearInterval(this._autoSaveTimer),this._autoSaveTimer=setInterval(async()=>{if(!await this.checkFileSave()){let ng=await this.exportJson();eg&&eg(ng)}},gg)}}function commonjsRequire(tg){throw new Error('Could not dynamically require "'+tg+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);var hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,(function(module,exports){(function(eg,gg){module.exports=eg.pdfjsLib=gg()})(globalThis,()=>(()=>{var __webpack_modules__=[,((tg,eg)=>{var CI;Object.defineProperty(eg,"__esModule",{value:!0}),eg.VerbosityLevel=eg.Util=eg.UnknownErrorException=eg.UnexpectedResponseException=eg.TextRenderingMode=eg.RenderingIntentFlag=eg.PromiseCapability=eg.PermissionFlag=eg.PasswordResponses=eg.PasswordException=eg.PageActionEventType=eg.OPS=eg.MissingPDFException=eg.MAX_IMAGE_SIZE_TO_CACHE=eg.LINE_FACTOR=eg.LINE_DESCENT_FACTOR=eg.InvalidPDFException=eg.ImageKind=eg.IDENTITY_MATRIX=eg.FormatError=eg.FeatureTest=eg.FONT_IDENTITY_MATRIX=eg.DocumentActionEventType=eg.CMapCompressionType=eg.BaseException=eg.BASELINE_FACTOR=eg.AnnotationType=eg.AnnotationReplyType=eg.AnnotationPrefix=eg.AnnotationMode=eg.AnnotationFlag=eg.AnnotationFieldFlag=eg.AnnotationEditorType=eg.AnnotationEditorPrefix=eg.AnnotationEditorParamsType=eg.AnnotationBorderStyleType=eg.AnnotationActionEventType=eg.AbortException=void 0,eg.assert=Yg,eg.bytesToString=pa,eg.createValidAbsoluteUrl=Og,eg.getModificationDate=nI,eg.getUuid=La,eg.getVerbosityLevel=Vg,eg.info=Mg,eg.isArrayBuffer=oa,eg.isArrayEqual=ha,eg.isNodeJS=void 0,eg.normalizeUnicode=Ug,eg.objectFromMap=uo,eg.objectSize=Ca,eg.setVerbosityLevel=Xg,eg.shadow=Kg,eg.string32=Qg,eg.stringToBytes=eI,eg.stringToPDFString=ya,eg.stringToUTF8String=oI,eg.unreachable=Sg,eg.utf8StringToString=iI,eg.warn=Rg;const gg=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");eg.isNodeJS=gg;const ig=[1,0,0,1,0,0];eg.IDENTITY_MATRIX=ig;const ng=[.001,0,0,.001,0,0];eg.FONT_IDENTITY_MATRIX=ng;const og=1e7;eg.MAX_IMAGE_SIZE_TO_CACHE=og;const ag=1.35;eg.LINE_FACTOR=ag;const Ig=.35;eg.LINE_DESCENT_FACTOR=Ig;const sg=Ig/ag;eg.BASELINE_FACTOR=sg;const Cg={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};eg.RenderingIntentFlag=Cg;const lg={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};eg.AnnotationMode=lg;const Ag="pdfjs_internal_editor_";eg.AnnotationEditorPrefix=Ag;const cg={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};eg.AnnotationEditorType=cg;const rg={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};eg.AnnotationEditorParamsType=rg;const ug={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};eg.PermissionFlag=ug;const dg={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};eg.TextRenderingMode=dg;const bg={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};eg.ImageKind=bg;const mg={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};eg.AnnotationType=mg;const hg={GROUP:"Group",REPLY:"R"};eg.AnnotationReplyType=hg;const pg={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};eg.AnnotationFlag=pg;const fg={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};eg.AnnotationFieldFlag=fg;const wg={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};eg.AnnotationBorderStyleType=wg;const Gg={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};eg.AnnotationActionEventType=Gg;const Zg={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};eg.DocumentActionEventType=Zg;const yg={O:"PageOpen",C:"PageClose"};eg.PageActionEventType=yg;const Bg={ERRORS:0,WARNINGS:1,INFOS:5};eg.VerbosityLevel=Bg;const Wg={NONE:0,BINARY:1};eg.CMapCompressionType=Wg;const $g={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};eg.OPS=$g;const Ng={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};eg.PasswordResponses=Ng;let vg=Bg.WARNINGS;function Xg(fa){Number.isInteger(fa)&&(vg=fa)}function Vg(){return vg}function Mg(fa){vg>=Bg.INFOS&&console.log(`Info: ${fa}`)}function Rg(fa){vg>=Bg.WARNINGS&&console.log(`Warning: ${fa}`)}function Sg(fa){throw new Error(fa)}function Yg(fa,zg){fa||Sg(zg)}function xg(fa){switch(fa==null?void 0:fa.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Og(fa,zg=null,Hg=null){if(!fa)return null;try{if(Hg&&typeof fa=="string"){if(Hg.addDefaultProtocol&&fa.startsWith("www.")){const tI=fa.match(/\./g);(tI==null?void 0:tI.length)>=2&&(fa=`http://${fa}`)}if(Hg.tryConvertEncoding)try{fa=oI(fa)}catch{}}const ca=zg?new URL(fa,zg):new URL(fa);if(xg(ca))return ca}catch{}return null}function Kg(fa,zg,Hg,ca=!1){return Object.defineProperty(fa,zg,{value:Hg,enumerable:!ca,configurable:!0,writable:!1}),Hg}const Dg=(function(){function zg(Hg,ca){this.constructor===zg&&Sg("Cannot initialize BaseException."),this.message=Hg,this.name=ca}return zg.prototype=new Error,zg.constructor=zg,zg})();eg.BaseException=Dg;class Fg extends Dg{constructor(zg,Hg){super(zg,"PasswordException"),this.code=Hg}}eg.PasswordException=Fg;class Tg extends Dg{constructor(zg,Hg){super(zg,"UnknownErrorException"),this.details=Hg}}eg.UnknownErrorException=Tg;class Jg extends Dg{constructor(zg){super(zg,"InvalidPDFException")}}eg.InvalidPDFException=Jg;class Eg extends Dg{constructor(zg){super(zg,"MissingPDFException")}}eg.MissingPDFException=Eg;class co extends Dg{constructor(zg,Hg){super(zg,"UnexpectedResponseException"),this.status=Hg}}eg.UnexpectedResponseException=co;class da extends Dg{constructor(zg){super(zg,"FormatError")}}eg.FormatError=da;class ma extends Dg{constructor(zg){super(zg,"AbortException")}}eg.AbortException=ma;function pa(fa){(typeof fa!="object"||(fa==null?void 0:fa.length)===void 0)&&Sg("Invalid argument for bytesToString");const zg=fa.length,Hg=8192;if(zg<Hg)return String.fromCharCode.apply(null,fa);const ca=[];for(let tI=0;tI<zg;tI+=Hg){const jg=Math.min(tI+Hg,zg),lo=fa.subarray(tI,jg);ca.push(String.fromCharCode.apply(null,lo))}return ca.join("")}function eI(fa){typeof fa!="string"&&Sg("Invalid argument for stringToBytes");const zg=fa.length,Hg=new Uint8Array(zg);for(let ca=0;ca<zg;++ca)Hg[ca]=fa.charCodeAt(ca)&255;return Hg}function Qg(fa){return String.fromCharCode(fa>>24&255,fa>>16&255,fa>>8&255,fa&255)}function Ca(fa){return Object.keys(fa).length}function uo(fa){const zg=Object.create(null);for(const[Hg,ca]of fa)zg[Hg]=ca;return zg}function eo(){const fa=new Uint8Array(4);return fa[0]=1,new Uint32Array(fa.buffer,0,1)[0]===1}function no(){try{return new Function(""),!0}catch{return!1}}class kg{static get isLittleEndian(){return Kg(this,"isLittleEndian",eo())}static get isEvalSupported(){return Kg(this,"isEvalSupported",no())}static get isOffscreenCanvasSupported(){return Kg(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Kg(this,"platform",{isWin:!1,isMac:!1}):Kg(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var zg,Hg;return Kg(this,"isCSSRoundSupported",(Hg=(zg=globalThis.CSS)==null?void 0:zg.supports)==null?void 0:Hg.call(zg,"width: round(1.5px, 1px)"))}}eg.FeatureTest=kg;const Lg=[...Array(256).keys()].map(fa=>fa.toString(16).padStart(2,"0"));class Pg{static makeHexColor(zg,Hg,ca){return`#${Lg[zg]}${Lg[Hg]}${Lg[ca]}`}static scaleMinMax(zg,Hg){let ca;zg[0]?(zg[0]<0&&(ca=Hg[0],Hg[0]=Hg[1],Hg[1]=ca),Hg[0]*=zg[0],Hg[1]*=zg[0],zg[3]<0&&(ca=Hg[2],Hg[2]=Hg[3],Hg[3]=ca),Hg[2]*=zg[3],Hg[3]*=zg[3]):(ca=Hg[0],Hg[0]=Hg[2],Hg[2]=ca,ca=Hg[1],Hg[1]=Hg[3],Hg[3]=ca,zg[1]<0&&(ca=Hg[2],Hg[2]=Hg[3],Hg[3]=ca),Hg[2]*=zg[1],Hg[3]*=zg[1],zg[2]<0&&(ca=Hg[0],Hg[0]=Hg[1],Hg[1]=ca),Hg[0]*=zg[2],Hg[1]*=zg[2]),Hg[0]+=zg[4],Hg[1]+=zg[4],Hg[2]+=zg[5],Hg[3]+=zg[5]}static transform(zg,Hg){return[zg[0]*Hg[0]+zg[2]*Hg[1],zg[1]*Hg[0]+zg[3]*Hg[1],zg[0]*Hg[2]+zg[2]*Hg[3],zg[1]*Hg[2]+zg[3]*Hg[3],zg[0]*Hg[4]+zg[2]*Hg[5]+zg[4],zg[1]*Hg[4]+zg[3]*Hg[5]+zg[5]]}static applyTransform(zg,Hg){const ca=zg[0]*Hg[0]+zg[1]*Hg[2]+Hg[4],tI=zg[0]*Hg[1]+zg[1]*Hg[3]+Hg[5];return[ca,tI]}static applyInverseTransform(zg,Hg){const ca=Hg[0]*Hg[3]-Hg[1]*Hg[2],tI=(zg[0]*Hg[3]-zg[1]*Hg[2]+Hg[2]*Hg[5]-Hg[4]*Hg[3])/ca,jg=(-zg[0]*Hg[1]+zg[1]*Hg[0]+Hg[4]*Hg[1]-Hg[5]*Hg[0])/ca;return[tI,jg]}static getAxialAlignedBoundingBox(zg,Hg){const ca=this.applyTransform(zg,Hg),tI=this.applyTransform(zg.slice(2,4),Hg),jg=this.applyTransform([zg[0],zg[3]],Hg),lo=this.applyTransform([zg[2],zg[1]],Hg);return[Math.min(ca[0],tI[0],jg[0],lo[0]),Math.min(ca[1],tI[1],jg[1],lo[1]),Math.max(ca[0],tI[0],jg[0],lo[0]),Math.max(ca[1],tI[1],jg[1],lo[1])]}static inverseTransform(zg){const Hg=zg[0]*zg[3]-zg[1]*zg[2];return[zg[3]/Hg,-zg[1]/Hg,-zg[2]/Hg,zg[0]/Hg,(zg[2]*zg[5]-zg[4]*zg[3])/Hg,(zg[4]*zg[1]-zg[5]*zg[0])/Hg]}static singularValueDecompose2dScale(zg){const Hg=[zg[0],zg[2],zg[1],zg[3]],ca=zg[0]*Hg[0]+zg[1]*Hg[2],tI=zg[0]*Hg[1]+zg[1]*Hg[3],jg=zg[2]*Hg[0]+zg[3]*Hg[2],lo=zg[2]*Hg[1]+zg[3]*Hg[3],sa=(ca+lo)/2,qg=Math.sqrt((ca+lo)**2-4*(ca*lo-jg*tI))/2,ga=sa+qg||1,va=sa-qg||1;return[Math.sqrt(ga),Math.sqrt(va)]}static normalizeRect(zg){const Hg=zg.slice(0);return zg[0]>zg[2]&&(Hg[0]=zg[2],Hg[2]=zg[0]),zg[1]>zg[3]&&(Hg[1]=zg[3],Hg[3]=zg[1]),Hg}static intersect(zg,Hg){const ca=Math.max(Math.min(zg[0],zg[2]),Math.min(Hg[0],Hg[2])),tI=Math.min(Math.max(zg[0],zg[2]),Math.max(Hg[0],Hg[2]));if(ca>tI)return null;const jg=Math.max(Math.min(zg[1],zg[3]),Math.min(Hg[1],Hg[3])),lo=Math.min(Math.max(zg[1],zg[3]),Math.max(Hg[1],Hg[3]));return jg>lo?null:[ca,jg,tI,lo]}static bezierBoundingBox(zg,Hg,ca,tI,jg,lo,sa,qg){const ga=[],va=[[],[]];let sI,aa,_g,xa,lI,gI,II,AI;for(let WI=0;WI<2;++WI){if(WI===0?(aa=6*zg-12*ca+6*jg,sI=-3*zg+9*ca-9*jg+3*sa,_g=3*ca-3*zg):(aa=6*Hg-12*tI+6*lo,sI=-3*Hg+9*tI-9*lo+3*qg,_g=3*tI-3*Hg),Math.abs(sI)<1e-12){if(Math.abs(aa)<1e-12)continue;xa=-_g/aa,0<xa&&xa<1&&ga.push(xa);continue}II=aa*aa-4*_g*sI,AI=Math.sqrt(II),!(II<0)&&(lI=(-aa+AI)/(2*sI),0<lI&&lI<1&&ga.push(lI),gI=(-aa-AI)/(2*sI),0<gI&&gI<1&&ga.push(gI))}let rI=ga.length,bI;const hI=rI;for(;rI--;)xa=ga[rI],bI=1-xa,va[0][rI]=bI*bI*bI*zg+3*bI*bI*xa*ca+3*bI*xa*xa*jg+xa*xa*xa*sa,va[1][rI]=bI*bI*bI*Hg+3*bI*bI*xa*tI+3*bI*xa*xa*lo+xa*xa*xa*qg;return va[0][hI]=zg,va[1][hI]=Hg,va[0][hI+1]=sa,va[1][hI+1]=qg,va[0].length=va[1].length=hI+2,[Math.min(...va[0]),Math.min(...va[1]),Math.max(...va[0]),Math.max(...va[1])]}}eg.Util=Pg;const ua=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function ya(fa){if(fa[0]>="ï"){let Hg;if(fa[0]==="þ"&&fa[1]==="ÿ"?Hg="utf-16be":fa[0]==="ÿ"&&fa[1]==="þ"?Hg="utf-16le":fa[0]==="ï"&&fa[1]==="»"&&fa[2]==="¿"&&(Hg="utf-8"),Hg)try{const ca=new TextDecoder(Hg,{fatal:!0}),tI=eI(fa);return ca.decode(tI)}catch(ca){Rg(`stringToPDFString: "${ca}".`)}}const zg=[];for(let Hg=0,ca=fa.length;Hg<ca;Hg++){const tI=ua[fa.charCodeAt(Hg)];zg.push(tI?String.fromCharCode(tI):fa.charAt(Hg))}return zg.join("")}function oI(fa){return decodeURIComponent(escape(fa))}function iI(fa){return unescape(encodeURIComponent(fa))}function oa(fa){return typeof fa=="object"&&(fa==null?void 0:fa.byteLength)!==void 0}function ha(fa,zg){if(fa.length!==zg.length)return!1;for(let Hg=0,ca=fa.length;Hg<ca;Hg++)if(fa[Hg]!==zg[Hg])return!1;return!0}function nI(fa=new Date){return[fa.getUTCFullYear().toString(),(fa.getUTCMonth()+1).toString().padStart(2,"0"),fa.getUTCDate().toString().padStart(2,"0"),fa.getUTCHours().toString().padStart(2,"0"),fa.getUTCMinutes().toString().padStart(2,"0"),fa.getUTCSeconds().toString().padStart(2,"0")].join("")}class cI{constructor(){yI(this,CI,!1);this.promise=new Promise((zg,Hg)=>{this.resolve=ca=>{BI(this,CI,!0),zg(ca)},this.reject=ca=>{BI(this,CI,!0),Hg(ca)}})}get settled(){return la(this,CI)}}CI=new WeakMap,eg.PromiseCapability=cI;let dI=null,pI=null;function Ug(fa){return dI||(dI=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,pI=new Map([["ſt","ſt"]])),fa.replaceAll(dI,(zg,Hg,ca)=>Hg?Hg.normalize("NFKC"):pI.get(ca))}function La(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const fa=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(fa);else for(let zg=0;zg<32;zg++)fa[zg]=Math.floor(Math.random()*255);return pa(fa)}const aI="pdfjs_internal_id_";eg.AnnotationPrefix=aI}),((__unused_webpack_module,exports,__w_pdfjs_require__)=>{var tg,gg,ig,ng,sd,Jd,Ig,sg,Cg,lg,Ag,cg,rg,ug,dg,Ed,mg,hg,c0,fg,wg;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(Zg){if(typeof Zg=="string"||Zg instanceof URL?Zg={url:Zg}:(0,_util.isArrayBuffer)(Zg)&&(Zg={data:Zg}),typeof Zg!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Zg.url&&!Zg.data&&!Zg.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const yg=new PDFDocumentLoadingTask,{docId:Bg}=yg,Wg=Zg.url?getUrlProp(Zg.url):null,$g=Zg.data?getDataProp(Zg.data):null,Ng=Zg.httpHeaders||null,vg=Zg.withCredentials===!0,Xg=Zg.password??null,Vg=Zg.range instanceof PDFDataRangeTransport?Zg.range:null,Mg=Number.isInteger(Zg.rangeChunkSize)&&Zg.rangeChunkSize>0?Zg.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Rg=Zg.worker instanceof PDFWorker?Zg.worker:null;const Sg=Zg.verbosity,Yg=typeof Zg.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Zg.docBaseUrl)?Zg.docBaseUrl:null,xg=typeof Zg.cMapUrl=="string"?Zg.cMapUrl:null,Og=Zg.cMapPacked!==!1,Kg=Zg.CMapReaderFactory||DefaultCMapReaderFactory,Dg=typeof Zg.standardFontDataUrl=="string"?Zg.standardFontDataUrl:null,Fg=Zg.StandardFontDataFactory||DefaultStandardFontDataFactory,Tg=Zg.stopAtErrors!==!0,Jg=Number.isInteger(Zg.maxImageSize)&&Zg.maxImageSize>-1?Zg.maxImageSize:-1,Eg=Zg.isEvalSupported!==!1,co=typeof Zg.isOffscreenCanvasSupported=="boolean"?Zg.isOffscreenCanvasSupported:!_util.isNodeJS,da=Number.isInteger(Zg.canvasMaxAreaInBytes)?Zg.canvasMaxAreaInBytes:-1,ma=typeof Zg.disableFontFace=="boolean"?Zg.disableFontFace:_util.isNodeJS,pa=Zg.fontExtraProperties===!0,eI=Zg.enableXfa===!0,Qg=Zg.ownerDocument||globalThis.document,Ca=Zg.disableRange===!0,uo=Zg.disableStream===!0,eo=Zg.disableAutoFetch===!0,no=Zg.pdfBug===!0,kg=Vg?Vg.length:Zg.length??NaN,Lg=typeof Zg.useSystemFonts=="boolean"?Zg.useSystemFonts:!_util.isNodeJS&&!ma,Pg=typeof Zg.useWorkerFetch=="boolean"?Zg.useWorkerFetch:Kg===_display_utils.DOMCMapReaderFactory&&Fg===_display_utils.DOMStandardFontDataFactory&&xg&&Dg&&(0,_display_utils.isValidFetchUrl)(xg,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(Dg,document.baseURI),ua=Zg.canvasFactory||new DefaultCanvasFactory({ownerDocument:Qg}),ya=Zg.filterFactory||new DefaultFilterFactory({docId:Bg,ownerDocument:Qg}),oI=null;(0,_util.setVerbosityLevel)(Sg);const iI={canvasFactory:ua,filterFactory:ya};if(Pg||(iI.cMapReaderFactory=new Kg({baseUrl:xg,isCompressed:Og}),iI.standardFontDataFactory=new Fg({baseUrl:Dg})),!Rg){const nI={verbosity:Sg,port:_worker_options.GlobalWorkerOptions.workerPort};Rg=nI.port?PDFWorker.fromPort(nI):new PDFWorker(nI),yg._worker=Rg}const oa={docId:Bg,apiVersion:"3.11.174",data:$g,password:Xg,disableAutoFetch:eo,rangeChunkSize:Mg,length:kg,docBaseUrl:Yg,enableXfa:eI,evaluatorOptions:{maxImageSize:Jg,disableFontFace:ma,ignoreErrors:Tg,isEvalSupported:Eg,isOffscreenCanvasSupported:co,canvasMaxAreaInBytes:da,fontExtraProperties:pa,useSystemFonts:Lg,cMapUrl:Pg?xg:null,standardFontDataUrl:Pg?Dg:null}},ha={ignoreErrors:Tg,isEvalSupported:Eg,disableFontFace:ma,fontExtraProperties:pa,enableXfa:eI,ownerDocument:Qg,disableAutoFetch:eo,pdfBug:no,styleElement:oI};return Rg.promise.then(function(){if(yg.destroyed)throw new Error("Loading aborted");const nI=_fetchDocument(Rg,oa),cI=new Promise(function(dI){let pI;Vg?pI=new _transport_stream.PDFDataTransportStream({length:kg,initialData:Vg.initialData,progressiveDone:Vg.progressiveDone,contentDispositionFilename:Vg.contentDispositionFilename,disableRange:Ca,disableStream:uo},Vg):$g||(pI=(La=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(La):(0,_display_utils.isValidFetchUrl)(La.url)?new _displayFetch_stream.PDFFetchStream(La):new _displayNetwork.PDFNetworkStream(La))({url:Wg,length:kg,httpHeaders:Ng,withCredentials:vg,rangeChunkSize:Mg,disableRange:Ca,disableStream:uo})),dI(pI)});return Promise.all([nI,cI]).then(function([dI,pI]){if(yg.destroyed)throw new Error("Loading aborted");const Ug=new _message_handler.MessageHandler(Bg,dI,Rg.port),La=new WorkerTransport(Ug,yg,pI,ha,iI);yg._transport=La,Ug.send("Ready",null)})}).catch(yg._capability.reject),yg}async function _fetchDocument(Zg,yg){if(Zg.destroyed)throw new Error("Worker was destroyed");const Bg=await Zg.messageHandler.sendWithPromise("GetDocRequest",yg,yg.data?[yg.data.buffer]:null);if(Zg.destroyed)throw new Error("Worker was destroyed");return Bg}function getUrlProp(Zg){if(Zg instanceof URL)return Zg.href;try{return new URL(Zg,window.location).href}catch{if(_util.isNodeJS&&typeof Zg=="string")return Zg}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Zg){if(_util.isNodeJS&&typeof Buffer<"u"&&Zg instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(Zg instanceof Uint8Array&&Zg.byteLength===Zg.buffer.byteLength)return Zg;if(typeof Zg=="string")return(0,_util.stringToBytes)(Zg);if(typeof Zg=="object"&&!isNaN(Zg==null?void 0:Zg.length)||(0,_util.isArrayBuffer)(Zg))return new Uint8Array(Zg);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const eg=class eg{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Wd(eg,tg)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var yg,Bg,Wg;this.destroyed=!0;try{(yg=this._worker)!=null&&yg.port&&(this._worker._pendingDestroy=!0),await((Bg=this._transport)==null?void 0:Bg.destroy())}catch($g){throw(Wg=this._worker)!=null&&Wg.port&&delete this._worker._pendingDestroy,$g}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};tg=new WeakMap,yI(eg,tg,0);let PDFDocumentLoadingTask=eg;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(yg,Bg,Wg=!1,$g=null){this.length=yg,this.initialData=Bg,this.progressiveDone=Wg,this.contentDispositionFilename=$g,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(yg){this._rangeListeners.push(yg)}addProgressListener(yg){this._progressListeners.push(yg)}addProgressiveReadListener(yg){this._progressiveReadListeners.push(yg)}addProgressiveDoneListener(yg){this._progressiveDoneListeners.push(yg)}onDataRange(yg,Bg){for(const Wg of this._rangeListeners)Wg(yg,Bg)}onDataProgress(yg,Bg){this._readyCapability.promise.then(()=>{for(const Wg of this._progressListeners)Wg(yg,Bg)})}onDataProgressiveRead(yg){this._readyCapability.promise.then(()=>{for(const Bg of this._progressiveReadListeners)Bg(yg)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const yg of this._progressiveDoneListeners)yg()})}transportReady(){this._readyCapability.resolve()}requestDataRange(yg,Bg){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(yg,Bg){this._pdfInfo=yg,this._transport=Bg,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(Wg=>{if(!Wg)return Wg;const $g=[];for(const Ng in Wg)$g.push(...Wg[Ng]);return $g}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(yg){return this._transport.getPage(yg)}getPageIndex(yg){return this._transport.getPageIndex(yg)}getDestinations(){return this._transport.getDestinations()}getDestination(yg){return this._transport.getDestination(yg)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(yg=!1){return this._transport.startCleanup(yg||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(yg,Bg,Wg,$g=!1){yI(this,ng);yI(this,gg,null);yI(this,ig,!1);this._pageIndex=yg,this._pageInfo=Bg,this._transport=Wg,this._stats=$g?new _display_utils.StatTimer:null,this._pdfBug=$g,this.commonObjs=Wg.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:yg,rotation:Bg=this.rotate,offsetX:Wg=0,offsetY:$g=0,dontFlip:Ng=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:yg,rotation:Bg,offsetX:Wg,offsetY:$g,dontFlip:Ng})}getAnnotations({intent:yg="display"}={}){const Bg=this._transport.getRenderingIntent(yg);return this._transport.getAnnotations(this._pageIndex,Bg.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var yg;return((yg=this._transport._htmlForXfa)==null?void 0:yg.children[this._pageIndex])||null}render({canvasContext:yg,viewport:Bg,intent:Wg="display",annotationMode:$g=_util.AnnotationMode.ENABLE,transform:Ng=null,background:vg=null,optionalContentConfigPromise:Xg=null,annotationCanvasMap:Vg=null,pageColors:Mg=null,printAnnotationStorage:Rg=null}){var Fg,Tg;(Fg=this._stats)==null||Fg.time("Overall");const Sg=this._transport.getRenderingIntent(Wg,$g,Rg);BI(this,ig,!1),ZI(this,ng,Jd).call(this),Xg||(Xg=this._transport.getOptionalContentConfig());let Yg=this._intentStates.get(Sg.cacheKey);Yg||(Yg=Object.create(null),this._intentStates.set(Sg.cacheKey,Yg)),Yg.streamReaderCancelTimeout&&(clearTimeout(Yg.streamReaderCancelTimeout),Yg.streamReaderCancelTimeout=null);const xg=!!(Sg.renderingIntent&_util.RenderingIntentFlag.PRINT);Yg.displayReadyCapability||(Yg.displayReadyCapability=new _util.PromiseCapability,Yg.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Tg=this._stats)==null||Tg.time("Page Request"),this._pumpOperatorList(Sg));const Og=Jg=>{var Eg,co;Yg.renderTasks.delete(Kg),(this._maybeCleanupAfterRender||xg)&&BI(this,ig,!0),ZI(this,ng,sd).call(this,!xg),Jg?(Kg.capability.reject(Jg),this._abortOperatorList({intentState:Yg,reason:Jg instanceof Error?Jg:new Error(Jg)})):Kg.capability.resolve(),(Eg=this._stats)==null||Eg.timeEnd("Rendering"),(co=this._stats)==null||co.timeEnd("Overall")},Kg=new InternalRenderTask({callback:Og,params:{canvasContext:yg,viewport:Bg,transform:Ng,background:vg},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Vg,operatorList:Yg.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!xg,pdfBug:this._pdfBug,pageColors:Mg});(Yg.renderTasks||(Yg.renderTasks=new Set)).add(Kg);const Dg=Kg.task;return Promise.all([Yg.displayReadyCapability.promise,Xg]).then(([Jg,Eg])=>{var co;if(this.destroyed){Og();return}(co=this._stats)==null||co.time("Rendering"),Kg.initializeGraphics({transparency:Jg,optionalContentConfig:Eg}),Kg.operatorListChanged()}).catch(Og),Dg}getOperatorList({intent:yg="display",annotationMode:Bg=_util.AnnotationMode.ENABLE,printAnnotationStorage:Wg=null}={}){var Vg;function $g(){vg.operatorList.lastChunk&&(vg.opListReadCapability.resolve(vg.operatorList),vg.renderTasks.delete(Xg))}const Ng=this._transport.getRenderingIntent(yg,Bg,Wg,!0);let vg=this._intentStates.get(Ng.cacheKey);vg||(vg=Object.create(null),this._intentStates.set(Ng.cacheKey,vg));let Xg;return vg.opListReadCapability||(Xg=Object.create(null),Xg.operatorListChanged=$g,vg.opListReadCapability=new _util.PromiseCapability,(vg.renderTasks||(vg.renderTasks=new Set)).add(Xg),vg.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Vg=this._stats)==null||Vg.time("Page Request"),this._pumpOperatorList(Ng)),vg.opListReadCapability.promise}streamTextContent({includeMarkedContent:yg=!1,disableNormalization:Bg=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:yg===!0,disableNormalization:Bg===!0},{highWaterMark:100,size($g){return $g.items.length}})}getTextContent(yg={}){if(this._transport._htmlForXfa)return this.getXfa().then(Wg=>_xfa_text.XfaText.textContent(Wg));const Bg=this.streamTextContent(yg);return new Promise(function(Wg,$g){function Ng(){vg.read().then(function({value:Vg,done:Mg}){if(Mg){Wg(Xg);return}Object.assign(Xg.styles,Vg.styles),Xg.items.push(...Vg.items),Ng()},$g)}const vg=Bg.getReader(),Xg={items:[],styles:Object.create(null)};Ng()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const yg=[];for(const Bg of this._intentStates.values())if(this._abortOperatorList({intentState:Bg,reason:new Error("Page was destroyed."),force:!0}),!Bg.opListReadCapability)for(const Wg of Bg.renderTasks)yg.push(Wg.completed),Wg.cancel();return this.objs.clear(),BI(this,ig,!1),ZI(this,ng,Jd).call(this),Promise.all(yg)}cleanup(yg=!1){BI(this,ig,!0);const Bg=ZI(this,ng,sd).call(this,!1);return yg&&Bg&&this._stats&&(this._stats=new _display_utils.StatTimer),Bg}_startRenderPage(yg,Bg){var $g,Ng;const Wg=this._intentStates.get(Bg);Wg&&(($g=this._stats)==null||$g.timeEnd("Page Request"),(Ng=Wg.displayReadyCapability)==null||Ng.resolve(yg))}_renderPageChunk(yg,Bg){for(let Wg=0,$g=yg.length;Wg<$g;Wg++)Bg.operatorList.fnArray.push(yg.fnArray[Wg]),Bg.operatorList.argsArray.push(yg.argsArray[Wg]);Bg.operatorList.lastChunk=yg.lastChunk,Bg.operatorList.separateAnnots=yg.separateAnnots;for(const Wg of Bg.renderTasks)Wg.operatorListChanged();yg.lastChunk&&ZI(this,ng,sd).call(this,!0)}_pumpOperatorList({renderingIntent:yg,cacheKey:Bg,annotationStorageSerializable:Wg}){const{map:$g,transfers:Ng}=Wg,Xg=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:yg,cacheKey:Bg,annotationStorage:$g},Ng).getReader(),Vg=this._intentStates.get(Bg);Vg.streamReader=Xg;const Mg=()=>{Xg.read().then(({value:Rg,done:Sg})=>{if(Sg){Vg.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Rg,Vg),Mg())},Rg=>{if(Vg.streamReader=null,!this._transport.destroyed){if(Vg.operatorList){Vg.operatorList.lastChunk=!0;for(const Sg of Vg.renderTasks)Sg.operatorListChanged();ZI(this,ng,sd).call(this,!0)}if(Vg.displayReadyCapability)Vg.displayReadyCapability.reject(Rg);else if(Vg.opListReadCapability)Vg.opListReadCapability.reject(Rg);else throw Rg}})};Mg()}_abortOperatorList({intentState:yg,reason:Bg,force:Wg=!1}){if(yg.streamReader){if(yg.streamReaderCancelTimeout&&(clearTimeout(yg.streamReaderCancelTimeout),yg.streamReaderCancelTimeout=null),!Wg){if(yg.renderTasks.size>0)return;if(Bg instanceof _display_utils.RenderingCancelledException){let $g=RENDERING_CANCELLED_TIMEOUT;Bg.extraDelay>0&&Bg.extraDelay<1e3&&($g+=Bg.extraDelay),yg.streamReaderCancelTimeout=setTimeout(()=>{yg.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:yg,reason:Bg,force:!0})},$g);return}}if(yg.streamReader.cancel(new _util.AbortException(Bg.message)).catch(()=>{}),yg.streamReader=null,!this._transport.destroyed){for(const[$g,Ng]of this._intentStates)if(Ng===yg){this._intentStates.delete($g);break}this.cleanup()}}}get stats(){return this._stats}}gg=new WeakMap,ig=new WeakMap,ng=new WeakSet,sd=function(yg=!1){if(ZI(this,ng,Jd).call(this),!la(this,ig)||this.destroyed)return!1;if(yg)return BI(this,gg,setTimeout(()=>{BI(this,gg,null),ZI(this,ng,sd).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Bg,operatorList:Wg}of this._intentStates.values())if(Bg.size>0||!Wg.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),BI(this,ig,!1),!0},Jd=function(){la(this,gg)&&(clearTimeout(la(this,gg)),BI(this,gg,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){yI(this,Ig,new Set);yI(this,sg,Promise.resolve())}postMessage(yg,Bg){const Wg={data:structuredClone(yg,Bg?{transfer:Bg}:null)};la(this,sg).then(()=>{for(const $g of la(this,Ig))$g.call(this,Wg)})}addEventListener(yg,Bg){la(this,Ig).add(Bg)}removeEventListener(yg,Bg){la(this,Ig).delete(Bg)}terminate(){la(this,Ig).clear()}}Ig=new WeakMap,sg=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Zg=(Cg=document==null?void 0:document.currentScript)==null?void 0:Cg.src;Zg&&(PDFWorkerUtil.fallbackWorkerSrc=Zg.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Zg,yg){let Bg;try{if(Bg=new URL(Zg),!Bg.origin||Bg.origin==="null")return!1}catch{return!1}const Wg=new URL(yg,Bg);return Bg.origin===Wg.origin},PDFWorkerUtil.createCDNWrapper=function(Zg){const yg=`importScripts("${Zg}");`;return URL.createObjectURL(new Blob([yg]))}}const _PDFWorker=class _PDFWorker{constructor({name:Zg=null,port:yg=null,verbosity:Bg=(0,_util.getVerbosityLevel)()}={}){var Wg;if(this.name=Zg,this.destroyed=!1,this.verbosity=Bg,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,yg){if((Wg=la(_PDFWorker,lg))!=null&&Wg.has(yg))throw new Error("Cannot use more than one PDFWorker per port.");(la(_PDFWorker,lg)||BI(_PDFWorker,lg,new WeakMap)).set(yg,this),this._initializeFromPort(yg);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Zg){this._port=Zg,this._messageHandler=new _message_handler.MessageHandler("main","worker",Zg),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Zg}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Zg)||(Zg=PDFWorkerUtil.createCDNWrapper(new URL(Zg,window.location).href));const yg=new Worker(Zg),Bg=new _message_handler.MessageHandler("main","worker",yg),Wg=()=>{yg.removeEventListener("error",$g),Bg.destroy(),yg.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},$g=()=>{this._webWorker||Wg()};yg.addEventListener("error",$g),Bg.on("test",vg=>{if(yg.removeEventListener("error",$g),this.destroyed){Wg();return}vg?(this._messageHandler=Bg,this._port=yg,this._webWorker=yg,this._readyCapability.resolve(),Bg.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Bg.destroy(),yg.terminate())}),Bg.on("ready",vg=>{if(yg.removeEventListener("error",$g),this.destroyed){Wg();return}try{Ng()}catch{this._setupFakeWorker()}});const Ng=()=>{const vg=new Uint8Array;Bg.send("test",vg,[vg.buffer])};Ng();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Zg=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const yg=new LoopbackPort;this._port=yg;const Bg=`fake${PDFWorkerUtil.fakeWorkerId++}`,Wg=new _message_handler.MessageHandler(Bg+"_worker",Bg,yg);Zg.setup(Wg,yg);const $g=new _message_handler.MessageHandler(Bg,Bg+"_worker",yg);this._messageHandler=$g,this._readyCapability.resolve(),$g.send("configure",{verbosity:this.verbosity})}).catch(Zg=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${Zg.message}".`))})}destroy(){var Zg;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(Zg=la(_PDFWorker,lg))==null||Zg.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Zg){var Bg;if(!(Zg!=null&&Zg.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const yg=(Bg=la(this,lg))==null?void 0:Bg.get(Zg.port);if(yg){if(yg._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return yg}return new _PDFWorker(Zg)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Zg;try{return((Zg=globalThis.pdfjsWorker)==null?void 0:Zg.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};lg=new WeakMap,yI(_PDFWorker,lg);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(yg,Bg,Wg,$g,Ng){yI(this,dg);yI(this,Ag,new Map);yI(this,cg,new Map);yI(this,rg,new Map);yI(this,ug,null);this.messageHandler=yg,this.loadingTask=Bg,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:$g.ownerDocument,styleElement:$g.styleElement}),this._params=$g,this.canvasFactory=Ng.canvasFactory,this.filterFactory=Ng.filterFactory,this.cMapReaderFactory=Ng.cMapReaderFactory,this.standardFontDataFactory=Ng.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Wg,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(yg,Bg=_util.AnnotationMode.ENABLE,Wg=null,$g=!1){let Ng=_util.RenderingIntentFlag.DISPLAY,vg=_annotation_storage.SerializableEmpty;switch(yg){case"any":Ng=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":Ng=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${yg}`)}switch(Bg){case _util.AnnotationMode.DISABLE:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,vg=(Ng&_util.RenderingIntentFlag.PRINT&&Wg instanceof _annotation_storage.PrintAnnotationStorage?Wg:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Bg}`)}return $g&&(Ng+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:Ng,cacheKey:`${Ng}_${vg.hash}`,annotationStorageSerializable:vg}}destroy(){var Wg;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(Wg=la(this,ug))==null||Wg.reject(new Error("Worker was destroyed during onPassword callback"));const yg=[];for(const $g of la(this,cg).values())yg.push($g._destroy());la(this,cg).clear(),la(this,rg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Bg=this.messageHandler.sendWithPromise("Terminate",null);return yg.push(Bg),Promise.all(yg).then(()=>{var $g;this.commonObjs.clear(),this.fontLoader.clear(),la(this,Ag).clear(),this.filterFactory.destroy(),($g=this._networkStream)==null||$g.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:yg,loadingTask:Bg}=this;yg.on("GetReader",(Wg,$g)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=Ng=>{this._lastProgress={loaded:Ng.loaded,total:Ng.total}},$g.onPull=()=>{this._fullReader.read().then(function({value:Ng,done:vg}){if(vg){$g.close();return}(0,_util.assert)(Ng instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),$g.enqueue(new Uint8Array(Ng),1,[Ng])}).catch(Ng=>{$g.error(Ng)})},$g.onCancel=Ng=>{this._fullReader.cancel(Ng),$g.ready.catch(vg=>{if(!this.destroyed)throw vg})}}),yg.on("ReaderHeadersReady",Wg=>{const $g=new _util.PromiseCapability,Ng=this._fullReader;return Ng.headersReady.then(()=>{var vg;(!Ng.isStreamingSupported||!Ng.isRangeSupported)&&(this._lastProgress&&((vg=Bg.onProgress)==null||vg.call(Bg,this._lastProgress)),Ng.onProgress=Xg=>{var Vg;(Vg=Bg.onProgress)==null||Vg.call(Bg,{loaded:Xg.loaded,total:Xg.total})}),$g.resolve({isStreamingSupported:Ng.isStreamingSupported,isRangeSupported:Ng.isRangeSupported,contentLength:Ng.contentLength})},$g.reject),$g.promise}),yg.on("GetRangeReader",(Wg,$g)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const Ng=this._networkStream.getRangeReader(Wg.begin,Wg.end);if(!Ng){$g.close();return}$g.onPull=()=>{Ng.read().then(function({value:vg,done:Xg}){if(Xg){$g.close();return}(0,_util.assert)(vg instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),$g.enqueue(new Uint8Array(vg),1,[vg])}).catch(vg=>{$g.error(vg)})},$g.onCancel=vg=>{Ng.cancel(vg),$g.ready.catch(Xg=>{if(!this.destroyed)throw Xg})}}),yg.on("GetDoc",({pdfInfo:Wg})=>{this._numPages=Wg.numPages,this._htmlForXfa=Wg.htmlForXfa,delete Wg.htmlForXfa,Bg._capability.resolve(new PDFDocumentProxy(Wg,this))}),yg.on("DocException",function(Wg){let $g;switch(Wg.name){case"PasswordException":$g=new _util.PasswordException(Wg.message,Wg.code);break;case"InvalidPDFException":$g=new _util.InvalidPDFException(Wg.message);break;case"MissingPDFException":$g=new _util.MissingPDFException(Wg.message);break;case"UnexpectedResponseException":$g=new _util.UnexpectedResponseException(Wg.message,Wg.status);break;case"UnknownErrorException":$g=new _util.UnknownErrorException(Wg.message,Wg.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Bg._capability.reject($g)}),yg.on("PasswordRequest",Wg=>{if(BI(this,ug,new _util.PromiseCapability),Bg.onPassword){const $g=Ng=>{Ng instanceof Error?la(this,ug).reject(Ng):la(this,ug).resolve({password:Ng})};try{Bg.onPassword($g,Wg.code)}catch(Ng){la(this,ug).reject(Ng)}}else la(this,ug).reject(new _util.PasswordException(Wg.message,Wg.code));return la(this,ug).promise}),yg.on("DataLoaded",Wg=>{var $g;($g=Bg.onProgress)==null||$g.call(Bg,{loaded:Wg.length,total:Wg.length}),this.downloadInfoCapability.resolve(Wg)}),yg.on("StartRenderPage",Wg=>{if(this.destroyed)return;la(this,cg).get(Wg.pageIndex)._startRenderPage(Wg.transparency,Wg.cacheKey)}),yg.on("commonobj",([Wg,$g,Ng])=>{var vg;if(!this.destroyed&&!this.commonObjs.has(Wg))switch($g){case"Font":const Xg=this._params;if("error"in Ng){const Rg=Ng.error;(0,_util.warn)(`Error during font loading: ${Rg}`),this.commonObjs.resolve(Wg,Rg);break}const Vg=Xg.pdfBug&&((vg=globalThis.FontInspector)!=null&&vg.enabled)?(Rg,Sg)=>globalThis.FontInspector.fontAdded(Rg,Sg):null,Mg=new _font_loader.FontFaceObject(Ng,{isEvalSupported:Xg.isEvalSupported,disableFontFace:Xg.disableFontFace,ignoreErrors:Xg.ignoreErrors,inspectFont:Vg});this.fontLoader.bind(Mg).catch(Rg=>yg.sendWithPromise("FontFallback",{id:Wg})).finally(()=>{!Xg.fontExtraProperties&&Mg.data&&(Mg.data=null),this.commonObjs.resolve(Wg,Mg)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Wg,Ng);break;default:throw new Error(`Got unknown common object type ${$g}`)}}),yg.on("obj",([Wg,$g,Ng,vg])=>{var Vg;if(this.destroyed)return;const Xg=la(this,cg).get($g);if(!Xg.objs.has(Wg))switch(Ng){case"Image":if(Xg.objs.resolve(Wg,vg),vg){let Mg;if(vg.bitmap){const{width:Rg,height:Sg}=vg;Mg=Rg*Sg*4}else Mg=((Vg=vg.data)==null?void 0:Vg.length)||0;Mg>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xg._maybeCleanupAfterRender=!0)}break;case"Pattern":Xg.objs.resolve(Wg,vg);break;default:throw new Error(`Got unknown object type ${Ng}`)}}),yg.on("DocProgress",Wg=>{var $g;this.destroyed||($g=Bg.onProgress)==null||$g.call(Bg,{loaded:Wg.loaded,total:Wg.total})}),yg.on("FetchBuiltInCMap",Wg=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Wg):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),yg.on("FetchStandardFontData",Wg=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Wg):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var Wg;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:yg,transfers:Bg}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:yg,filename:((Wg=this._fullReader)==null?void 0:Wg.filename)??null},Bg).finally(()=>{this.annotationStorage.resetModified()})}getPage(yg){if(!Number.isInteger(yg)||yg<=0||yg>this._numPages)return Promise.reject(new Error("Invalid page request."));const Bg=yg-1,Wg=la(this,rg).get(Bg);if(Wg)return Wg;const $g=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Bg}).then(Ng=>{if(this.destroyed)throw new Error("Transport destroyed");const vg=new PDFPageProxy(Bg,Ng,this,this._params.pdfBug);return la(this,cg).set(Bg,vg),vg});return la(this,rg).set(Bg,$g),$g}getPageIndex(yg){return typeof yg!="object"||yg===null||!Number.isInteger(yg.num)||yg.num<0||!Number.isInteger(yg.gen)||yg.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:yg.num,gen:yg.gen})}getAnnotations(yg,Bg){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:yg,intent:Bg})}getFieldObjects(){return ZI(this,dg,Ed).call(this,"GetFieldObjects")}hasJSActions(){return ZI(this,dg,Ed).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(yg){return typeof yg!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:yg})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return ZI(this,dg,Ed).call(this,"GetDocJSActions")}getPageJSActions(yg){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:yg})}getStructTree(yg){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:yg})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(yg=>new _optional_content_config.OptionalContentConfig(yg))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const yg="GetMetadata",Bg=la(this,Ag).get(yg);if(Bg)return Bg;const Wg=this.messageHandler.sendWithPromise(yg,null).then($g=>{var Ng,vg;return{info:$g[0],metadata:$g[1]?new _metadata.Metadata($g[1]):null,contentDispositionFilename:((Ng=this._fullReader)==null?void 0:Ng.filename)??null,contentLength:((vg=this._fullReader)==null?void 0:vg.contentLength)??null}});return la(this,Ag).set(yg,Wg),Wg}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(yg=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Bg of la(this,cg).values())if(!Bg.cleanup())throw new Error(`startCleanup: Page ${Bg.pageNumber} is currently rendering.`);this.commonObjs.clear(),yg||this.fontLoader.clear(),la(this,Ag).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:yg,enableXfa:Bg}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:yg,enableXfa:Bg})}}Ag=new WeakMap,cg=new WeakMap,rg=new WeakMap,ug=new WeakMap,dg=new WeakSet,Ed=function(yg,Bg=null){const Wg=la(this,Ag).get(yg);if(Wg)return Wg;const $g=this.messageHandler.sendWithPromise(yg,Bg);return la(this,Ag).set(yg,$g),$g};class PDFObjects{constructor(){yI(this,hg);yI(this,mg,Object.create(null))}get(yg,Bg=null){if(Bg){const $g=ZI(this,hg,c0).call(this,yg);return $g.capability.promise.then(()=>Bg($g.data)),null}const Wg=la(this,mg)[yg];if(!(Wg!=null&&Wg.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${yg}.`);return Wg.data}has(yg){const Bg=la(this,mg)[yg];return(Bg==null?void 0:Bg.capability.settled)||!1}resolve(yg,Bg=null){const Wg=ZI(this,hg,c0).call(this,yg);Wg.data=Bg,Wg.capability.resolve()}clear(){var yg;for(const Bg in la(this,mg)){const{data:Wg}=la(this,mg)[Bg];(yg=Wg==null?void 0:Wg.bitmap)==null||yg.close()}BI(this,mg,Object.create(null))}}mg=new WeakMap,hg=new WeakSet,c0=function(yg){var Bg;return(Bg=la(this,mg))[yg]||(Bg[yg]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(yg){yI(this,fg,null);BI(this,fg,yg),this.onContinue=null}get promise(){return la(this,fg).capability.promise}cancel(yg=0){la(this,fg).cancel(null,yg)}get separateAnnots(){const{separateAnnots:yg}=la(this,fg).operatorList;if(!yg)return!1;const{annotationCanvasMap:Bg}=la(this,fg);return yg.form||yg.canvas&&(Bg==null?void 0:Bg.size)>0}}fg=new WeakMap,exports.RenderTask=RenderTask;const Gg=class Gg{constructor({callback:yg,params:Bg,objs:Wg,commonObjs:$g,annotationCanvasMap:Ng,operatorList:vg,pageIndex:Xg,canvasFactory:Vg,filterFactory:Mg,useRequestAnimationFrame:Rg=!1,pdfBug:Sg=!1,pageColors:Yg=null}){this.callback=yg,this.params=Bg,this.objs=Wg,this.commonObjs=$g,this.annotationCanvasMap=Ng,this.operatorListIdx=null,this.operatorList=vg,this._pageIndex=Xg,this.canvasFactory=Vg,this.filterFactory=Mg,this._pdfBug=Sg,this.pageColors=Yg,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Rg===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Bg.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:yg=!1,optionalContentConfig:Bg}){var Xg,Vg;if(this.cancelled)return;if(this._canvas){if(la(Gg,wg).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");la(Gg,wg).add(this._canvas)}this._pdfBug&&((Xg=globalThis.StepperManager)!=null&&Xg.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Wg,viewport:$g,transform:Ng,background:vg}=this.params;this.gfx=new _canvas.CanvasGraphics(Wg,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Bg},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:Ng,viewport:$g,transparency:yg,background:vg}),this.operatorListIdx=0,this.graphicsReady=!0,(Vg=this.graphicsReadyCallback)==null||Vg.call(this)}cancel(yg=null,Bg=0){var Wg;this.running=!1,this.cancelled=!0,(Wg=this.gfx)==null||Wg.endDrawing(),la(Gg,wg).delete(this._canvas),this.callback(yg||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Bg))}operatorListChanged(){var yg;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(yg=this.stepper)==null||yg.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),la(Gg,wg).delete(this._canvas),this.callback())))}};wg=new WeakMap,yI(Gg,wg,new WeakSet);let InternalRenderTask=Gg;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build}),((tg,eg,gg)=>{var Cg,lg,Ag,Sb,rg;Object.defineProperty(eg,"__esModule",{value:!0}),eg.SerializableEmpty=eg.PrintAnnotationStorage=eg.AnnotationStorage=void 0;var ig=gg(1),ng=gg(4),og=gg(8);const ag=Object.freeze({map:null,hash:"",transfers:void 0});eg.SerializableEmpty=ag;class Ig{constructor(){yI(this,Ag);yI(this,Cg,!1);yI(this,lg,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(dg,bg){const mg=la(this,lg).get(dg);return mg===void 0?bg:Object.assign(bg,mg)}getRawValue(dg){return la(this,lg).get(dg)}remove(dg){if(la(this,lg).delete(dg),la(this,lg).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const bg of la(this,lg).values())if(bg instanceof ng.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(dg,bg){const mg=la(this,lg).get(dg);let hg=!1;if(mg!==void 0)for(const[pg,fg]of Object.entries(bg))mg[pg]!==fg&&(hg=!0,mg[pg]=fg);else hg=!0,la(this,lg).set(dg,bg);hg&&ZI(this,Ag,Sb).call(this),bg instanceof ng.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(bg.constructor._type)}has(dg){return la(this,lg).has(dg)}getAll(){return la(this,lg).size>0?(0,ig.objectFromMap)(la(this,lg)):null}setAll(dg){for(const[bg,mg]of Object.entries(dg))this.setValue(bg,mg)}get size(){return la(this,lg).size}resetModified(){la(this,Cg)&&(BI(this,Cg,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new sg(this)}get serializable(){if(la(this,lg).size===0)return ag;const dg=new Map,bg=new og.MurmurHash3_64,mg=[],hg=Object.create(null);let pg=!1;for(const[fg,wg]of la(this,lg)){const Gg=wg instanceof ng.AnnotationEditor?wg.serialize(!1,hg):wg;Gg&&(dg.set(fg,Gg),bg.update(`${fg}:${JSON.stringify(Gg)}`),pg||(pg=!!Gg.bitmap))}if(pg)for(const fg of dg.values())fg.bitmap&&mg.push(fg.bitmap);return dg.size>0?{map:dg,hash:bg.hexdigest(),transfers:mg}:ag}}Cg=new WeakMap,lg=new WeakMap,Ag=new WeakSet,Sb=function(){la(this,Cg)||(BI(this,Cg,!0),typeof this.onSetModified=="function"&&this.onSetModified())},eg.AnnotationStorage=Ig;class sg extends Ig{constructor(bg){super();yI(this,rg);const{map:mg,hash:hg,transfers:pg}=bg.serializable,fg=structuredClone(mg,pg?{transfer:pg}:null);BI(this,rg,{map:fg,hash:hg,transfers:pg})}get print(){(0,ig.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return la(this,rg)}}rg=new WeakMap,eg.PrintAnnotationStorage=sg}),((tg,eg,gg)=>{var sg,Cg,lg,Ag,cg,rg,ug,dg,bg,mg,hg,pg,fg,wg,Gg,r0,d0,Bg,u0,m0,Mb,Xb,Db,b0,Hb;Object.defineProperty(eg,"__esModule",{value:!0}),eg.AnnotationEditor=void 0;var ig=gg(5),ng=gg(1),og=gg(6);const Rg=class Rg{constructor(Yg){yI(this,Gg);yI(this,sg,"");yI(this,Cg,!1);yI(this,lg,null);yI(this,Ag,null);yI(this,cg,null);yI(this,rg,!1);yI(this,ug,null);yI(this,dg,this.focusin.bind(this));yI(this,bg,this.focusout.bind(this));yI(this,mg,!1);yI(this,hg,!1);yI(this,pg,!1);tl(this,"_initialOptions",Object.create(null));tl(this,"_uiManager",null);tl(this,"_focusEventsAllowed",!0);tl(this,"_l10nPromise",null);yI(this,fg,!1);yI(this,wg,Rg._zIndex++);this.constructor===Rg&&(0,ng.unreachable)("Cannot initialize AnnotationEditor."),this.parent=Yg.parent,this.id=Yg.id,this.width=this.height=null,this.pageIndex=Yg.parent.pageIndex,this.name=Yg.name,this.div=null,this._uiManager=Yg.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=Yg.isCentered,this._structTreeParentId=null;const{rotation:xg,rawDims:{pageWidth:Og,pageHeight:Kg,pageX:Dg,pageY:Fg}}=this.parent.viewport;this.rotation=xg,this.pageRotation=(360+xg-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[Og,Kg],this.pageTranslation=[Dg,Fg];const[Tg,Jg]=this.parentDimensions;this.x=Yg.x/Tg,this.y=Yg.y/Jg,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,ng.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(Yg){const xg=new Ig({id:Yg.parent.getNextId(),parent:Yg.parent,uiManager:Yg._uiManager});xg.annotationElementId=Yg.annotationElementId,xg.deleted=!0,xg._uiManager.addToAnnotationStorage(xg)}static initialize(Yg,xg=null){if(Rg._l10nPromise||(Rg._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Kg=>[Kg,Yg.get(Kg)]))),xg!=null&&xg.strings)for(const Kg of xg.strings)Rg._l10nPromise.set(Kg,Yg.get(Kg));if(Rg._borderLineWidth!==-1)return;const Og=getComputedStyle(document.documentElement);Rg._borderLineWidth=parseFloat(Og.getPropertyValue("--outline-width"))||0}static updateDefaultParams(Yg,xg){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(Yg){return!1}static paste(Yg,xg){(0,ng.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return la(this,fg)}set _isDraggable(Yg){var xg;BI(this,fg,Yg),(xg=this.div)==null||xg.classList.toggle("draggable",Yg)}center(){const[Yg,xg]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*xg/(Yg*2),this.y+=this.width*Yg/(xg*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*xg/(Yg*2),this.y-=this.width*Yg/(xg*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(Yg){this._uiManager.addCommands(Yg)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=la(this,wg)}setParent(Yg){Yg!==null&&(this.pageIndex=Yg.pageIndex,this.pageDimensions=Yg.pageDimensions),this.parent=Yg}focusin(Yg){this._focusEventsAllowed&&(la(this,mg)?BI(this,mg,!1):this.parent.setSelected(this))}focusout(Yg){var Og;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const xg=Yg.relatedTarget;xg!=null&&xg.closest(`#${this.id}`)||(Yg.preventDefault(),(Og=this.parent)!=null&&Og.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(Yg,xg,Og,Kg){const[Dg,Fg]=this.parentDimensions;[Og,Kg]=this.screenToPageTranslation(Og,Kg),this.x=(Yg+Og)/Dg,this.y=(xg+Kg)/Fg,this.fixAndSetPosition()}translate(Yg,xg){ZI(this,Gg,r0).call(this,this.parentDimensions,Yg,xg)}translateInPage(Yg,xg){ZI(this,Gg,r0).call(this,this.pageDimensions,Yg,xg),this.div.scrollIntoView({block:"nearest"})}drag(Yg,xg){const[Og,Kg]=this.parentDimensions;if(this.x+=Yg/Og,this.y+=xg/Kg,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Eg,y:co}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Eg,co)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Dg,y:Fg}=this;const[Tg,Jg]=ZI(this,Gg,d0).call(this);Dg+=Tg,Fg+=Jg,this.div.style.left=`${(100*Dg).toFixed(2)}%`,this.div.style.top=`${(100*Fg).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[Yg,xg]=this.pageDimensions;let{x:Og,y:Kg,width:Dg,height:Fg}=this;switch(Dg*=Yg,Fg*=xg,Og*=Yg,Kg*=xg,this.rotation){case 0:Og=Math.max(0,Math.min(Yg-Dg,Og)),Kg=Math.max(0,Math.min(xg-Fg,Kg));break;case 90:Og=Math.max(0,Math.min(Yg-Fg,Og)),Kg=Math.min(xg,Math.max(Dg,Kg));break;case 180:Og=Math.min(Yg,Math.max(Dg,Og)),Kg=Math.min(xg,Math.max(Fg,Kg));break;case 270:Og=Math.min(Yg,Math.max(Fg,Og)),Kg=Math.max(0,Math.min(xg-Dg,Kg));break}this.x=Og/=Yg,this.y=Kg/=xg;const[Tg,Jg]=ZI(this,Gg,d0).call(this);Og+=Tg,Kg+=Jg;const{style:Eg}=this.div;Eg.left=`${(100*Og).toFixed(2)}%`,Eg.top=`${(100*Kg).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(Yg,xg){var Og;return ZI(Og=Rg,Bg,u0).call(Og,Yg,xg,this.parentRotation)}pageTranslationToScreen(Yg,xg){var Og;return ZI(Og=Rg,Bg,u0).call(Og,Yg,xg,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:Yg,pageDimensions:[xg,Og]}=this,Kg=xg*Yg,Dg=Og*Yg;return ng.FeatureTest.isCSSRoundSupported?[Math.round(Kg),Math.round(Dg)]:[Kg,Dg]}setDims(Yg,xg){var Dg;const[Og,Kg]=this.parentDimensions;this.div.style.width=`${(100*Yg/Og).toFixed(2)}%`,la(this,rg)||(this.div.style.height=`${(100*xg/Kg).toFixed(2)}%`),(Dg=la(this,lg))==null||Dg.classList.toggle("small",Yg<Rg.SMALL_EDITOR_SIZE||xg<Rg.SMALL_EDITOR_SIZE)}fixDims(){const{style:Yg}=this.div,{height:xg,width:Og}=Yg,Kg=Og.endsWith("%"),Dg=!la(this,rg)&&xg.endsWith("%");if(Kg&&Dg)return;const[Fg,Tg]=this.parentDimensions;Kg||(Yg.width=`${(100*parseFloat(Og)/Fg).toFixed(2)}%`),!la(this,rg)&&!Dg&&(Yg.height=`${(100*parseFloat(xg)/Tg).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(la(this,lg))return;const Yg=BI(this,lg,document.createElement("button"));Yg.className="altText";const xg=await Rg._l10nPromise.get("editor_alt_text_button_label");Yg.textContent=xg,Yg.setAttribute("aria-label",xg),Yg.tabIndex="0",Yg.addEventListener("contextmenu",og.noContextMenu),Yg.addEventListener("pointerdown",Og=>Og.stopPropagation()),Yg.addEventListener("click",Og=>{Og.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),Yg.addEventListener("keydown",Og=>{Og.target===Yg&&Og.key==="Enter"&&(Og.preventDefault(),this._uiManager.editAltText(this))}),ZI(this,Gg,b0).call(this),this.div.append(Yg),Rg.SMALL_EDITOR_SIZE||(Rg.SMALL_EDITOR_SIZE=Math.min(128,Math.round(Yg.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:la(this,sg),decorative:la(this,Cg)}}set altTextData({altText:Yg,decorative:xg}){la(this,sg)===Yg&&la(this,Cg)===xg||(BI(this,sg,Yg),BI(this,Cg,xg),ZI(this,Gg,b0).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",la(this,dg)),this.div.addEventListener("focusout",la(this,bg));const[Yg,xg]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*xg/Yg).toFixed(2)}%`,this.div.style.maxHeight=`${(100*Yg/xg).toFixed(2)}%`);const[Og,Kg]=this.getInitialTranslation();return this.translate(Og,Kg),(0,ig.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(Yg){const{isMac:xg}=ng.FeatureTest.platform;if(Yg.button!==0||Yg.ctrlKey&&xg){Yg.preventDefault();return}BI(this,mg,!0),ZI(this,Gg,Hb).call(this,Yg)}moveInDOM(){var Yg;(Yg=this.parent)==null||Yg.moveEditorInDOM(this)}_setParentAndPosition(Yg,xg,Og){Yg.changeParent(this),this.x=xg,this.y=Og,this.fixAndSetPosition()}getRect(Yg,xg){const Og=this.parentScale,[Kg,Dg]=this.pageDimensions,[Fg,Tg]=this.pageTranslation,Jg=Yg/Og,Eg=xg/Og,co=this.x*Kg,da=this.y*Dg,ma=this.width*Kg,pa=this.height*Dg;switch(this.rotation){case 0:return[co+Jg+Fg,Dg-da-Eg-pa+Tg,co+Jg+ma+Fg,Dg-da-Eg+Tg];case 90:return[co+Eg+Fg,Dg-da+Jg+Tg,co+Eg+pa+Fg,Dg-da+Jg+ma+Tg];case 180:return[co-Jg-ma+Fg,Dg-da+Eg+Tg,co-Jg+Fg,Dg-da+Eg+pa+Tg];case 270:return[co-Eg-pa+Fg,Dg-da-Jg-ma+Tg,co-Eg+Fg,Dg-da-Jg+Tg];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(Yg,xg){const[Og,Kg,Dg,Fg]=Yg,Tg=Dg-Og,Jg=Fg-Kg;switch(this.rotation){case 0:return[Og,xg-Fg,Tg,Jg];case 90:return[Og,xg-Kg,Jg,Tg];case 180:return[Dg,xg-Kg,Tg,Jg];case 270:return[Dg,xg-Fg,Jg,Tg];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){BI(this,pg,!0)}disableEditMode(){BI(this,pg,!1)}isInEditMode(){return la(this,pg)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var Yg,xg;(Yg=this.div)==null||Yg.addEventListener("focusin",la(this,dg)),(xg=this.div)==null||xg.addEventListener("focusout",la(this,bg))}serialize(Yg=!1,xg=null){(0,ng.unreachable)("An editor must be serializable")}static deserialize(Yg,xg,Og){const Kg=new this.prototype.constructor({parent:xg,id:xg.getNextId(),uiManager:Og});Kg.rotation=Yg.rotation;const[Dg,Fg]=Kg.pageDimensions,[Tg,Jg,Eg,co]=Kg.getRectInCurrentCoords(Yg.rect,Fg);return Kg.x=Tg/Dg,Kg.y=Jg/Fg,Kg.width=Eg/Dg,Kg.height=co/Fg,Kg}remove(){var Yg;this.div.removeEventListener("focusin",la(this,dg)),this.div.removeEventListener("focusout",la(this,bg)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(Yg=la(this,lg))==null||Yg.remove(),BI(this,lg,null),BI(this,Ag,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(ZI(this,Gg,Mb).call(this),la(this,ug).classList.remove("hidden"))}select(){var Yg;this.makeResizable(),(Yg=this.div)==null||Yg.classList.add("selectedEditor")}unselect(){var Yg,xg,Og;(Yg=la(this,ug))==null||Yg.classList.add("hidden"),(xg=this.div)==null||xg.classList.remove("selectedEditor"),(Og=this.div)!=null&&Og.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(Yg,xg){}disableEditing(){la(this,lg)&&(la(this,lg).hidden=!0)}enableEditing(){la(this,lg)&&(la(this,lg).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return la(this,hg)}set isEditing(Yg){BI(this,hg,Yg),this.parent&&(Yg?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(Yg,xg){BI(this,rg,!0);const Og=Yg/xg,{style:Kg}=this.div;Kg.aspectRatio=Og,Kg.height="auto"}static get MIN_SIZE(){return 16}};sg=new WeakMap,Cg=new WeakMap,lg=new WeakMap,Ag=new WeakMap,cg=new WeakMap,rg=new WeakMap,ug=new WeakMap,dg=new WeakMap,bg=new WeakMap,mg=new WeakMap,hg=new WeakMap,pg=new WeakMap,fg=new WeakMap,wg=new WeakMap,Gg=new WeakSet,r0=function([Yg,xg],Og,Kg){[Og,Kg]=this.screenToPageTranslation(Og,Kg),this.x+=Og/Yg,this.y+=Kg/xg,this.fixAndSetPosition()},d0=function(){const[Yg,xg]=this.parentDimensions,{_borderLineWidth:Og}=Rg,Kg=Og/Yg,Dg=Og/xg;switch(this.rotation){case 90:return[-Kg,Dg];case 180:return[Kg,Dg];case 270:return[Kg,-Dg];default:return[-Kg,-Dg]}},Bg=new WeakSet,u0=function(Yg,xg,Og){switch(Og){case 90:return[xg,-Yg];case 180:return[-Yg,-xg];case 270:return[-xg,Yg];default:return[Yg,xg]}},m0=function(Yg){switch(Yg){case 90:{const[xg,Og]=this.pageDimensions;return[0,-xg/Og,Og/xg,0]}case 180:return[-1,0,0,-1];case 270:{const[xg,Og]=this.pageDimensions;return[0,xg/Og,-Og/xg,0]}default:return[1,0,0,1]}},Mb=function(){if(la(this,ug))return;BI(this,ug,document.createElement("div")),la(this,ug).classList.add("resizers");const Yg=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||Yg.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const xg of Yg){const Og=document.createElement("div");la(this,ug).append(Og),Og.classList.add("resizer",xg),Og.addEventListener("pointerdown",ZI(this,Gg,Xb).bind(this,xg)),Og.addEventListener("contextmenu",og.noContextMenu)}this.div.prepend(la(this,ug))},Xb=function(Yg,xg){xg.preventDefault();const{isMac:Og}=ng.FeatureTest.platform;if(xg.button!==0||xg.ctrlKey&&Og)return;const Kg=ZI(this,Gg,Db).bind(this,Yg),Dg=this._isDraggable;this._isDraggable=!1;const Fg={passive:!0,capture:!0};window.addEventListener("pointermove",Kg,Fg);const Tg=this.x,Jg=this.y,Eg=this.width,co=this.height,da=this.parent.div.style.cursor,ma=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(xg.target).cursor;const pa=()=>{this._isDraggable=Dg,window.removeEventListener("pointerup",pa),window.removeEventListener("blur",pa),window.removeEventListener("pointermove",Kg,Fg),this.parent.div.style.cursor=da,this.div.style.cursor=ma;const eI=this.x,Qg=this.y,Ca=this.width,uo=this.height;eI===Tg&&Qg===Jg&&Ca===Eg&&uo===co||this.addCommands({cmd:()=>{this.width=Ca,this.height=uo,this.x=eI,this.y=Qg;const[eo,no]=this.parentDimensions;this.setDims(eo*Ca,no*uo),this.fixAndSetPosition()},undo:()=>{this.width=Eg,this.height=co,this.x=Tg,this.y=Jg;const[eo,no]=this.parentDimensions;this.setDims(eo*Eg,no*co),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",pa),window.addEventListener("blur",pa)},Db=function(Yg,xg){const[Og,Kg]=this.parentDimensions,Dg=this.x,Fg=this.y,Tg=this.width,Jg=this.height,Eg=Rg.MIN_SIZE/Og,co=Rg.MIN_SIZE/Kg,da=Ug=>Math.round(Ug*1e4)/1e4,ma=ZI(this,Gg,m0).call(this,this.rotation),pa=(Ug,La)=>[ma[0]*Ug+ma[2]*La,ma[1]*Ug+ma[3]*La],eI=ZI(this,Gg,m0).call(this,360-this.rotation),Qg=(Ug,La)=>[eI[0]*Ug+eI[2]*La,eI[1]*Ug+eI[3]*La];let Ca,uo,eo=!1,no=!1;switch(Yg){case"topLeft":eo=!0,Ca=(Ug,La)=>[0,0],uo=(Ug,La)=>[Ug,La];break;case"topMiddle":Ca=(Ug,La)=>[Ug/2,0],uo=(Ug,La)=>[Ug/2,La];break;case"topRight":eo=!0,Ca=(Ug,La)=>[Ug,0],uo=(Ug,La)=>[0,La];break;case"middleRight":no=!0,Ca=(Ug,La)=>[Ug,La/2],uo=(Ug,La)=>[0,La/2];break;case"bottomRight":eo=!0,Ca=(Ug,La)=>[Ug,La],uo=(Ug,La)=>[0,0];break;case"bottomMiddle":Ca=(Ug,La)=>[Ug/2,La],uo=(Ug,La)=>[Ug/2,0];break;case"bottomLeft":eo=!0,Ca=(Ug,La)=>[0,La],uo=(Ug,La)=>[Ug,0];break;case"middleLeft":no=!0,Ca=(Ug,La)=>[0,La/2],uo=(Ug,La)=>[Ug,La/2];break}const kg=Ca(Tg,Jg),Lg=uo(Tg,Jg);let Pg=pa(...Lg);const ua=da(Dg+Pg[0]),ya=da(Fg+Pg[1]);let oI=1,iI=1,[oa,ha]=this.screenToPageTranslation(xg.movementX,xg.movementY);if([oa,ha]=Qg(oa/Og,ha/Kg),eo){const Ug=Math.hypot(Tg,Jg);oI=iI=Math.max(Math.min(Math.hypot(Lg[0]-kg[0]-oa,Lg[1]-kg[1]-ha)/Ug,1/Tg,1/Jg),Eg/Tg,co/Jg)}else no?oI=Math.max(Eg,Math.min(1,Math.abs(Lg[0]-kg[0]-oa)))/Tg:iI=Math.max(co,Math.min(1,Math.abs(Lg[1]-kg[1]-ha)))/Jg;const nI=da(Tg*oI),cI=da(Jg*iI);Pg=pa(...uo(nI,cI));const dI=ua-Pg[0],pI=ya-Pg[1];this.width=nI,this.height=cI,this.x=dI,this.y=pI,this.setDims(Og*nI,Kg*cI),this.fixAndSetPosition()},b0=async function(){var Og;const Yg=la(this,lg);if(!Yg)return;if(!la(this,sg)&&!la(this,Cg)){Yg.classList.remove("done"),(Og=la(this,Ag))==null||Og.remove();return}Rg._l10nPromise.get("editor_alt_text_edit_button_label").then(Kg=>{Yg.setAttribute("aria-label",Kg)});let xg=la(this,Ag);if(!xg){BI(this,Ag,xg=document.createElement("span")),xg.className="tooltip",xg.setAttribute("role","tooltip");const Kg=xg.id=`alt-text-tooltip-${this.id}`;Yg.setAttribute("aria-describedby",Kg);const Dg=100;Yg.addEventListener("mouseenter",()=>{BI(this,cg,setTimeout(()=>{BI(this,cg,null),la(this,Ag).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Dg))}),Yg.addEventListener("mouseleave",()=>{var Fg;clearTimeout(la(this,cg)),BI(this,cg,null),(Fg=la(this,Ag))==null||Fg.classList.remove("show")})}Yg.classList.add("done"),xg.innerText=la(this,Cg)?await Rg._l10nPromise.get("editor_alt_text_decorative_tooltip"):la(this,sg),xg.parentNode||Yg.append(xg)},Hb=function(Yg){if(!this._isDraggable)return;const xg=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let Og,Kg;xg&&(Og={passive:!0,capture:!0},Kg=Fg=>{const[Tg,Jg]=this.screenToPageTranslation(Fg.movementX,Fg.movementY);this._uiManager.dragSelectedEditors(Tg,Jg)},window.addEventListener("pointermove",Kg,Og));const Dg=()=>{if(window.removeEventListener("pointerup",Dg),window.removeEventListener("blur",Dg),xg&&window.removeEventListener("pointermove",Kg,Og),BI(this,mg,!1),!this._uiManager.endDragSession()){const{isMac:Fg}=ng.FeatureTest.platform;Yg.ctrlKey&&!Fg||Yg.shiftKey||Yg.metaKey&&Fg?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Dg),window.addEventListener("blur",Dg)},yI(Rg,Bg),tl(Rg,"_borderLineWidth",-1),tl(Rg,"_colorManager",new ig.ColorManager),tl(Rg,"_zIndex",1),tl(Rg,"SMALL_EDITOR_SIZE",0);let ag=Rg;eg.AnnotationEditor=ag;class Ig extends ag{constructor(Yg){super(Yg),this.annotationElementId=Yg.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}}),((tg,eg,gg)=>{var rg,ug,dg,bg,mg,h0,fg,wg,Gg,Zg,yg,jb,$g,Ng,vg,Xg,Vg,Mg,Rg,Sg,Yg,xg,Og,Kg,Dg,Fg,Tg,Jg,Eg,co,da,ma,pa,eI,Qg,Ca,uo,eo,no,kg,Lg,Pg,ua,ya,oI,iI,oa,Fb,p0,w0,_d,Z0,f0,uc,Nd,xb,Kb,G0,vd,y0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.KeyboardManager=eg.CommandManager=eg.ColorManager=eg.AnnotationEditorUIManager=void 0,eg.bindEvents=og,eg.opacityToHex=ag;var ig=gg(1),ng=gg(6);function og(jg,lo,sa){for(const qg of sa)lo.addEventListener(qg,jg[qg].bind(jg))}function ag(jg){return Math.round(Math.min(255,Math.max(1,255*jg))).toString(16).padStart(2,"0")}class Ig{constructor(){yI(this,rg,0)}getId(){return`${ig.AnnotationEditorPrefix}${Wd(this,rg)._++}`}}rg=new WeakMap;const pg=class pg{constructor(){yI(this,mg);yI(this,ug,(0,ig.getUuid)());yI(this,dg,0);yI(this,bg,null)}static get _isSVGFittingCanvas(){const lo='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',qg=new OffscreenCanvas(1,3).getContext("2d"),ga=new Image;ga.src=lo;const va=ga.decode().then(()=>(qg.drawImage(ga,0,0,1,1,0,0,1,3),new Uint32Array(qg.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,ig.shadow)(this,"_isSVGFittingCanvas",va)}async getFromFile(lo){const{lastModified:sa,name:qg,size:ga,type:va}=lo;return ZI(this,mg,h0).call(this,`${sa}_${qg}_${ga}_${va}`,lo)}async getFromUrl(lo){return ZI(this,mg,h0).call(this,lo,lo)}async getFromId(lo){la(this,bg)||BI(this,bg,new Map);const sa=la(this,bg).get(lo);return sa?sa.bitmap?(sa.refCounter+=1,sa):sa.file?this.getFromFile(sa.file):this.getFromUrl(sa.url):null}getSvgUrl(lo){const sa=la(this,bg).get(lo);return sa!=null&&sa.isSvg?sa.svgUrl:null}deleteId(lo){la(this,bg)||BI(this,bg,new Map);const sa=la(this,bg).get(lo);sa&&(sa.refCounter-=1,sa.refCounter===0&&(sa.bitmap=null))}isValidId(lo){return lo.startsWith(`image_${la(this,ug)}_`)}};ug=new WeakMap,dg=new WeakMap,bg=new WeakMap,mg=new WeakSet,h0=async function(lo,sa){la(this,bg)||BI(this,bg,new Map);let qg=la(this,bg).get(lo);if(qg===null)return null;if(qg!=null&&qg.bitmap)return qg.refCounter+=1,qg;try{qg||(qg={bitmap:null,id:`image_${la(this,ug)}_${Wd(this,dg)._++}`,refCounter:0,isSvg:!1});let ga;if(typeof sa=="string"){qg.url=sa;const va=await fetch(sa);if(!va.ok)throw new Error(va.statusText);ga=await va.blob()}else ga=qg.file=sa;if(ga.type==="image/svg+xml"){const va=pg._isSVGFittingCanvas,sI=new FileReader,aa=new Image,_g=new Promise((xa,lI)=>{aa.onload=()=>{qg.bitmap=aa,qg.isSvg=!0,xa()},sI.onload=async()=>{const gI=qg.svgUrl=sI.result;aa.src=await va?`${gI}#svgView(preserveAspectRatio(none))`:gI},aa.onerror=sI.onerror=lI});sI.readAsDataURL(ga),await _g}else qg.bitmap=await createImageBitmap(ga);qg.refCounter=1}catch(ga){console.error(ga),qg=null}return la(this,bg).set(lo,qg),qg&&la(this,bg).set(qg.id,qg),qg};let sg=pg;class Cg{constructor(lo=128){yI(this,fg,[]);yI(this,wg,!1);yI(this,Gg);yI(this,Zg,-1);BI(this,Gg,lo)}add({cmd:lo,undo:sa,mustExec:qg,type:ga=NaN,overwriteIfSameType:va=!1,keepUndo:sI=!1}){if(qg&&lo(),la(this,wg))return;const aa={cmd:lo,undo:sa,type:ga};if(la(this,Zg)===-1){la(this,fg).length>0&&(la(this,fg).length=0),BI(this,Zg,0),la(this,fg).push(aa);return}if(va&&la(this,fg)[la(this,Zg)].type===ga){sI&&(aa.undo=la(this,fg)[la(this,Zg)].undo),la(this,fg)[la(this,Zg)]=aa;return}const _g=la(this,Zg)+1;_g===la(this,Gg)?la(this,fg).splice(0,1):(BI(this,Zg,_g),_g<la(this,fg).length&&la(this,fg).splice(_g)),la(this,fg).push(aa)}undo(){la(this,Zg)!==-1&&(BI(this,wg,!0),la(this,fg)[la(this,Zg)].undo(),BI(this,wg,!1),BI(this,Zg,la(this,Zg)-1))}redo(){la(this,Zg)<la(this,fg).length-1&&(BI(this,Zg,la(this,Zg)+1),BI(this,wg,!0),la(this,fg)[la(this,Zg)].cmd(),BI(this,wg,!1))}hasSomethingToUndo(){return la(this,Zg)!==-1}hasSomethingToRedo(){return la(this,Zg)<la(this,fg).length-1}destroy(){BI(this,fg,null)}}fg=new WeakMap,wg=new WeakMap,Gg=new WeakMap,Zg=new WeakMap,eg.CommandManager=Cg;class lg{constructor(lo){yI(this,yg);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:sa}=ig.FeatureTest.platform;for(const[qg,ga,va={}]of lo)for(const sI of qg){const aa=sI.startsWith("mac+");sa&&aa?(this.callbacks.set(sI.slice(4),{callback:ga,options:va}),this.allKeys.add(sI.split("+").at(-1))):!sa&&!aa&&(this.callbacks.set(sI,{callback:ga,options:va}),this.allKeys.add(sI.split("+").at(-1)))}}exec(lo,sa){if(!this.allKeys.has(sa.key))return;const qg=this.callbacks.get(ZI(this,yg,jb).call(this,sa));if(!qg)return;const{callback:ga,options:{bubbles:va=!1,args:sI=[],checker:aa=null}}=qg;aa&&!aa(lo,sa)||(ga.bind(lo,...sI)(),va||(sa.stopPropagation(),sa.preventDefault()))}}yg=new WeakSet,jb=function(lo){lo.altKey&&this.buffer.push("alt"),lo.ctrlKey&&this.buffer.push("ctrl"),lo.metaKey&&this.buffer.push("meta"),lo.shiftKey&&this.buffer.push("shift"),this.buffer.push(lo.key);const sa=this.buffer.join("+");return this.buffer.length=0,sa},eg.KeyboardManager=lg;const Wg=class Wg{get _colors(){const lo=new Map([["CanvasText",null],["Canvas",null]]);return(0,ng.getColorValues)(lo),(0,ig.shadow)(this,"_colors",lo)}convert(lo){const sa=(0,ng.getRGB)(lo);if(!window.matchMedia("(forced-colors: active)").matches)return sa;for(const[qg,ga]of this._colors)if(ga.every((va,sI)=>va===sa[sI]))return Wg._colorsMapping.get(qg);return sa}getHexCode(lo){const sa=this._colors.get(lo);return sa?ig.Util.makeHexColor(...sa):lo}};tl(Wg,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let Ag=Wg;eg.ColorManager=Ag;const tI=class tI{constructor(lo,sa,qg,ga,va,sI){yI(this,oa);yI(this,$g,null);yI(this,Ng,new Map);yI(this,vg,new Map);yI(this,Xg,null);yI(this,Vg,null);yI(this,Mg,new Cg);yI(this,Rg,0);yI(this,Sg,new Set);yI(this,Yg,null);yI(this,xg,null);yI(this,Og,new Set);yI(this,Kg,null);yI(this,Dg,new Ig);yI(this,Fg,!1);yI(this,Tg,!1);yI(this,Jg,null);yI(this,Eg,ig.AnnotationEditorType.NONE);yI(this,co,new Set);yI(this,da,null);yI(this,ma,this.blur.bind(this));yI(this,pa,this.focus.bind(this));yI(this,eI,this.copy.bind(this));yI(this,Qg,this.cut.bind(this));yI(this,Ca,this.paste.bind(this));yI(this,uo,this.keydown.bind(this));yI(this,eo,this.onEditingAction.bind(this));yI(this,no,this.onPageChanging.bind(this));yI(this,kg,this.onScaleChanging.bind(this));yI(this,Lg,this.onRotationChanging.bind(this));yI(this,Pg,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});yI(this,ua,[0,0]);yI(this,ya,null);yI(this,oI,null);yI(this,iI,null);BI(this,oI,lo),BI(this,iI,sa),BI(this,Xg,qg),this._eventBus=ga,this._eventBus._on("editingaction",la(this,eo)),this._eventBus._on("pagechanging",la(this,no)),this._eventBus._on("scalechanging",la(this,kg)),this._eventBus._on("rotationchanging",la(this,Lg)),BI(this,Vg,va.annotationStorage),BI(this,Kg,va.filterFactory),BI(this,da,sI),this.viewParameters={realScale:ng.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const lo=tI.prototype,sa=va=>{const{activeElement:sI}=document;return sI&&la(va,oI).contains(sI)&&va.hasSomethingToControl()},qg=this.TRANSLATE_SMALL,ga=this.TRANSLATE_BIG;return(0,ig.shadow)(this,"_keyboardManager",new lg([[["ctrl+a","mac+meta+a"],lo.selectAll],[["ctrl+z","mac+meta+z"],lo.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],lo.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],lo.delete],[["Escape","mac+Escape"],lo.unselectAll],[["ArrowLeft","mac+ArrowLeft"],lo.translateSelectedEditors,{args:[-qg,0],checker:sa}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],lo.translateSelectedEditors,{args:[-ga,0],checker:sa}],[["ArrowRight","mac+ArrowRight"],lo.translateSelectedEditors,{args:[qg,0],checker:sa}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],lo.translateSelectedEditors,{args:[ga,0],checker:sa}],[["ArrowUp","mac+ArrowUp"],lo.translateSelectedEditors,{args:[0,-qg],checker:sa}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],lo.translateSelectedEditors,{args:[0,-ga],checker:sa}],[["ArrowDown","mac+ArrowDown"],lo.translateSelectedEditors,{args:[0,qg],checker:sa}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],lo.translateSelectedEditors,{args:[0,ga],checker:sa}]]))}destroy(){ZI(this,oa,_d).call(this),ZI(this,oa,p0).call(this),this._eventBus._off("editingaction",la(this,eo)),this._eventBus._off("pagechanging",la(this,no)),this._eventBus._off("scalechanging",la(this,kg)),this._eventBus._off("rotationchanging",la(this,Lg));for(const lo of la(this,vg).values())lo.destroy();la(this,vg).clear(),la(this,Ng).clear(),la(this,Og).clear(),BI(this,$g,null),la(this,co).clear(),la(this,Mg).destroy(),la(this,Xg).destroy()}get hcmFilter(){return(0,ig.shadow)(this,"hcmFilter",la(this,da)?la(this,Kg).addHCMFilter(la(this,da).foreground,la(this,da).background):"none")}get direction(){return(0,ig.shadow)(this,"direction",getComputedStyle(la(this,oI)).direction)}editAltText(lo){var sa;(sa=la(this,Xg))==null||sa.editAltText(this,lo)}onPageChanging({pageNumber:lo}){BI(this,Rg,lo-1)}focusMainContainer(){la(this,oI).focus()}findParent(lo,sa){for(const qg of la(this,vg).values()){const{x:ga,y:va,width:sI,height:aa}=qg.div.getBoundingClientRect();if(lo>=ga&&lo<=ga+sI&&sa>=va&&sa<=va+aa)return qg}return null}disableUserSelect(lo=!1){la(this,iI).classList.toggle("noUserSelect",lo)}addShouldRescale(lo){la(this,Og).add(lo)}removeShouldRescale(lo){la(this,Og).delete(lo)}onScaleChanging({scale:lo}){this.commitOrRemove(),this.viewParameters.realScale=lo*ng.PixelsPerInch.PDF_TO_CSS_UNITS;for(const sa of la(this,Og))sa.onScaleChanging()}onRotationChanging({pagesRotation:lo}){this.commitOrRemove(),this.viewParameters.rotation=lo}addToAnnotationStorage(lo){!lo.isEmpty()&&la(this,Vg)&&!la(this,Vg).has(lo.id)&&la(this,Vg).setValue(lo.id,lo)}blur(){if(!this.hasSelection)return;const{activeElement:lo}=document;for(const sa of la(this,co))if(sa.div.contains(lo)){BI(this,Jg,[sa,lo]),sa._focusEventsAllowed=!1;break}}focus(){if(!la(this,Jg))return;const[lo,sa]=la(this,Jg);BI(this,Jg,null),sa.addEventListener("focusin",()=>{lo._focusEventsAllowed=!0},{once:!0}),sa.focus()}addEditListeners(){ZI(this,oa,w0).call(this),ZI(this,oa,Z0).call(this)}removeEditListeners(){ZI(this,oa,_d).call(this),ZI(this,oa,f0).call(this)}copy(lo){var qg;if(lo.preventDefault(),(qg=la(this,$g))==null||qg.commitOrRemove(),!this.hasSelection)return;const sa=[];for(const ga of la(this,co)){const va=ga.serialize(!0);va&&sa.push(va)}sa.length!==0&&lo.clipboardData.setData("application/pdfjs",JSON.stringify(sa))}cut(lo){this.copy(lo),this.delete()}paste(lo){lo.preventDefault();const{clipboardData:sa}=lo;for(const va of sa.items)for(const sI of la(this,xg))if(sI.isHandlingMimeForPasting(va.type)){sI.paste(va,this.currentLayer);return}let qg=sa.getData("application/pdfjs");if(!qg)return;try{qg=JSON.parse(qg)}catch(va){(0,ig.warn)(`paste: "${va.message}".`);return}if(!Array.isArray(qg))return;this.unselectAll();const ga=this.currentLayer;try{const va=[];for(const _g of qg){const xa=ga.deserialize(_g);if(!xa)return;va.push(xa)}const sI=()=>{for(const _g of va)ZI(this,oa,G0).call(this,_g);ZI(this,oa,y0).call(this,va)},aa=()=>{for(const _g of va)_g.remove()};this.addCommands({cmd:sI,undo:aa,mustExec:!0})}catch(va){(0,ig.warn)(`paste: "${va.message}".`)}}keydown(lo){var sa;(sa=this.getActive())!=null&&sa.shouldGetKeyboardEvents()||tI._keyboardManager.exec(this,lo)}onEditingAction(lo){["undo","redo","delete","selectAll"].includes(lo.name)&&this[lo.name]()}setEditingState(lo){lo?(ZI(this,oa,Fb).call(this),ZI(this,oa,w0).call(this),ZI(this,oa,Z0).call(this),ZI(this,oa,uc).call(this,{isEditing:la(this,Eg)!==ig.AnnotationEditorType.NONE,isEmpty:ZI(this,oa,vd).call(this),hasSomethingToUndo:la(this,Mg).hasSomethingToUndo(),hasSomethingToRedo:la(this,Mg).hasSomethingToRedo(),hasSelectedEditor:!1})):(ZI(this,oa,p0).call(this),ZI(this,oa,_d).call(this),ZI(this,oa,f0).call(this),ZI(this,oa,uc).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(lo){if(!la(this,xg)){BI(this,xg,lo);for(const sa of la(this,xg))ZI(this,oa,Nd).call(this,sa.defaultPropertiesToUpdate)}}getId(){return la(this,Dg).getId()}get currentLayer(){return la(this,vg).get(la(this,Rg))}getLayer(lo){return la(this,vg).get(lo)}get currentPageIndex(){return la(this,Rg)}addLayer(lo){la(this,vg).set(lo.pageIndex,lo),la(this,Fg)?lo.enable():lo.disable()}removeLayer(lo){la(this,vg).delete(lo.pageIndex)}updateMode(lo,sa=null){if(la(this,Eg)!==lo){if(BI(this,Eg,lo),lo===ig.AnnotationEditorType.NONE){this.setEditingState(!1),ZI(this,oa,Kb).call(this);return}this.setEditingState(!0),ZI(this,oa,xb).call(this),this.unselectAll();for(const qg of la(this,vg).values())qg.updateMode(lo);if(sa){for(const qg of la(this,Ng).values())if(qg.annotationElementId===sa){this.setSelected(qg),qg.enterInEditMode();break}}}}updateToolbar(lo){lo!==la(this,Eg)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:lo})}updateParams(lo,sa){if(la(this,xg)){if(lo===ig.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(lo);return}for(const qg of la(this,co))qg.updateParams(lo,sa);for(const qg of la(this,xg))qg.updateDefaultParams(lo,sa)}}enableWaiting(lo=!1){if(la(this,Tg)!==lo){BI(this,Tg,lo);for(const sa of la(this,vg).values())lo?sa.disableClick():sa.enableClick(),sa.div.classList.toggle("waiting",lo)}}getEditors(lo){const sa=[];for(const qg of la(this,Ng).values())qg.pageIndex===lo&&sa.push(qg);return sa}getEditor(lo){return la(this,Ng).get(lo)}addEditor(lo){la(this,Ng).set(lo.id,lo)}removeEditor(lo){var sa;la(this,Ng).delete(lo.id),this.unselect(lo),(!lo.annotationElementId||!la(this,Sg).has(lo.annotationElementId))&&((sa=la(this,Vg))==null||sa.remove(lo.id))}addDeletedAnnotationElement(lo){la(this,Sg).add(lo.annotationElementId),lo.deleted=!0}isDeletedAnnotationElement(lo){return la(this,Sg).has(lo)}removeDeletedAnnotationElement(lo){la(this,Sg).delete(lo.annotationElementId),lo.deleted=!1}setActiveEditor(lo){la(this,$g)!==lo&&(BI(this,$g,lo),lo&&ZI(this,oa,Nd).call(this,lo.propertiesToUpdate))}toggleSelected(lo){if(la(this,co).has(lo)){la(this,co).delete(lo),lo.unselect(),ZI(this,oa,uc).call(this,{hasSelectedEditor:this.hasSelection});return}la(this,co).add(lo),lo.select(),ZI(this,oa,Nd).call(this,lo.propertiesToUpdate),ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})}setSelected(lo){for(const sa of la(this,co))sa!==lo&&sa.unselect();la(this,co).clear(),la(this,co).add(lo),lo.select(),ZI(this,oa,Nd).call(this,lo.propertiesToUpdate),ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})}isSelected(lo){return la(this,co).has(lo)}unselect(lo){lo.unselect(),la(this,co).delete(lo),ZI(this,oa,uc).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return la(this,co).size!==0}undo(){la(this,Mg).undo(),ZI(this,oa,uc).call(this,{hasSomethingToUndo:la(this,Mg).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:ZI(this,oa,vd).call(this)})}redo(){la(this,Mg).redo(),ZI(this,oa,uc).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:la(this,Mg).hasSomethingToRedo(),isEmpty:ZI(this,oa,vd).call(this)})}addCommands(lo){la(this,Mg).add(lo),ZI(this,oa,uc).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:ZI(this,oa,vd).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const lo=[...la(this,co)],sa=()=>{for(const ga of lo)ga.remove()},qg=()=>{for(const ga of lo)ZI(this,oa,G0).call(this,ga)};this.addCommands({cmd:sa,undo:qg,mustExec:!0})}commitOrRemove(){var lo;(lo=la(this,$g))==null||lo.commitOrRemove()}hasSomethingToControl(){return la(this,$g)||this.hasSelection}selectAll(){for(const lo of la(this,co))lo.commit();ZI(this,oa,y0).call(this,la(this,Ng).values())}unselectAll(){if(la(this,$g)){la(this,$g).commitOrRemove();return}if(this.hasSelection){for(const lo of la(this,co))lo.unselect();la(this,co).clear(),ZI(this,oa,uc).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(lo,sa,qg=!1){if(qg||this.commitOrRemove(),!this.hasSelection)return;la(this,ua)[0]+=lo,la(this,ua)[1]+=sa;const[ga,va]=la(this,ua),sI=[...la(this,co)],aa=1e3;la(this,ya)&&clearTimeout(la(this,ya)),BI(this,ya,setTimeout(()=>{BI(this,ya,null),la(this,ua)[0]=la(this,ua)[1]=0,this.addCommands({cmd:()=>{for(const _g of sI)la(this,Ng).has(_g.id)&&_g.translateInPage(ga,va)},undo:()=>{for(const _g of sI)la(this,Ng).has(_g.id)&&_g.translateInPage(-ga,-va)},mustExec:!1})},aa));for(const _g of sI)_g.translateInPage(lo,sa)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),BI(this,Yg,new Map);for(const lo of la(this,co))la(this,Yg).set(lo,{savedX:lo.x,savedY:lo.y,savedPageIndex:lo.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!la(this,Yg))return!1;this.disableUserSelect(!1);const lo=la(this,Yg);BI(this,Yg,null);let sa=!1;for(const[{x:ga,y:va,pageIndex:sI},aa]of lo)aa.newX=ga,aa.newY=va,aa.newPageIndex=sI,sa||(sa=ga!==aa.savedX||va!==aa.savedY||sI!==aa.savedPageIndex);if(!sa)return!1;const qg=(ga,va,sI,aa)=>{if(la(this,Ng).has(ga.id)){const _g=la(this,vg).get(aa);_g?ga._setParentAndPosition(_g,va,sI):(ga.pageIndex=aa,ga.x=va,ga.y=sI)}};return this.addCommands({cmd:()=>{for(const[ga,{newX:va,newY:sI,newPageIndex:aa}]of lo)qg(ga,va,sI,aa)},undo:()=>{for(const[ga,{savedX:va,savedY:sI,savedPageIndex:aa}]of lo)qg(ga,va,sI,aa)},mustExec:!0}),!0}dragSelectedEditors(lo,sa){if(la(this,Yg))for(const qg of la(this,Yg).keys())qg.drag(lo,sa)}rebuild(lo){if(lo.parent===null){const sa=this.getLayer(lo.pageIndex);sa?(sa.changeParent(lo),sa.addOrRebuild(lo)):(this.addEditor(lo),this.addToAnnotationStorage(lo),lo.rebuild())}else lo.parent.addOrRebuild(lo)}isActive(lo){return la(this,$g)===lo}getActive(){return la(this,$g)}getMode(){return la(this,Eg)}get imageManager(){return(0,ig.shadow)(this,"imageManager",new sg)}};$g=new WeakMap,Ng=new WeakMap,vg=new WeakMap,Xg=new WeakMap,Vg=new WeakMap,Mg=new WeakMap,Rg=new WeakMap,Sg=new WeakMap,Yg=new WeakMap,xg=new WeakMap,Og=new WeakMap,Kg=new WeakMap,Dg=new WeakMap,Fg=new WeakMap,Tg=new WeakMap,Jg=new WeakMap,Eg=new WeakMap,co=new WeakMap,da=new WeakMap,ma=new WeakMap,pa=new WeakMap,eI=new WeakMap,Qg=new WeakMap,Ca=new WeakMap,uo=new WeakMap,eo=new WeakMap,no=new WeakMap,kg=new WeakMap,Lg=new WeakMap,Pg=new WeakMap,ua=new WeakMap,ya=new WeakMap,oI=new WeakMap,iI=new WeakMap,oa=new WeakSet,Fb=function(){window.addEventListener("focus",la(this,pa)),window.addEventListener("blur",la(this,ma))},p0=function(){window.removeEventListener("focus",la(this,pa)),window.removeEventListener("blur",la(this,ma))},w0=function(){window.addEventListener("keydown",la(this,uo),{capture:!0})},_d=function(){window.removeEventListener("keydown",la(this,uo),{capture:!0})},Z0=function(){document.addEventListener("copy",la(this,eI)),document.addEventListener("cut",la(this,Qg)),document.addEventListener("paste",la(this,Ca))},f0=function(){document.removeEventListener("copy",la(this,eI)),document.removeEventListener("cut",la(this,Qg)),document.removeEventListener("paste",la(this,Ca))},uc=function(lo){Object.entries(lo).some(([qg,ga])=>la(this,Pg)[qg]!==ga)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(la(this,Pg),lo)})},Nd=function(lo){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:lo})},xb=function(){if(!la(this,Fg)){BI(this,Fg,!0);for(const lo of la(this,vg).values())lo.enable()}},Kb=function(){if(this.unselectAll(),la(this,Fg)){BI(this,Fg,!1);for(const lo of la(this,vg).values())lo.disable()}},G0=function(lo){const sa=la(this,vg).get(lo.pageIndex);sa?sa.addOrRebuild(lo):this.addEditor(lo)},vd=function(){if(la(this,Ng).size===0)return!0;if(la(this,Ng).size===1)for(const lo of la(this,Ng).values())return lo.isEmpty();return!1},y0=function(lo){la(this,co).clear();for(const sa of lo)sa.isEmpty()||(la(this,co).add(sa),sa.select());ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})},tl(tI,"TRANSLATE_SMALL",1),tl(tI,"TRANSLATE_BIG",10);let cg=tI;eg.AnnotationEditorUIManager=cg}),((tg,eg,gg)=>{var Rg,Sg,Yg,xg,Og,Kg,Dg,Fg,Tg,Jg,Eg,co,ld,Cd,$0,Qd,Ud,Vd,Yd;Object.defineProperty(eg,"__esModule",{value:!0}),eg.StatTimer=eg.RenderingCancelledException=eg.PixelsPerInch=eg.PageViewport=eg.PDFDateString=eg.DOMStandardFontDataFactory=eg.DOMSVGFactory=eg.DOMFilterFactory=eg.DOMCanvasFactory=eg.DOMCMapReaderFactory=void 0,eg.deprecated=Zg,eg.getColorValues=Ng,eg.getCurrentTransform=vg,eg.getCurrentTransformInverse=Xg,eg.getFilenameFromUrl=mg,eg.getPdfFilenameFromUrl=hg,eg.getRGB=$g,eg.getXfaPageViewport=Wg,eg.isDataScheme=dg,eg.isPdfFile=bg,eg.isValidFetchUrl=fg,eg.loadScript=Gg,eg.noContextMenu=wg,eg.setLayerDimensions=Vg;var ig=gg(7),ng=gg(1);const og="http://www.w3.org/2000/svg",Mg=class Mg{};tl(Mg,"CSS",96),tl(Mg,"PDF",72),tl(Mg,"PDF_TO_CSS_UNITS",Mg.CSS/Mg.PDF);let ag=Mg;eg.PixelsPerInch=ag;class Ig extends ig.BaseFilterFactory{constructor({docId:kg,ownerDocument:Lg=globalThis.document}={}){super();yI(this,co);yI(this,Rg);yI(this,Sg);yI(this,Yg);yI(this,xg);yI(this,Og);yI(this,Kg);yI(this,Dg);yI(this,Fg);yI(this,Tg);yI(this,Jg);yI(this,Eg,0);BI(this,Yg,kg),BI(this,xg,Lg)}addFilter(kg){if(!kg)return"none";let Lg=la(this,co,ld).get(kg);if(Lg)return Lg;let Pg,ua,ya,oI;if(kg.length===1){const nI=kg[0],cI=new Array(256);for(let dI=0;dI<256;dI++)cI[dI]=nI[dI]/255;oI=Pg=ua=ya=cI.join(",")}else{const[nI,cI,dI]=kg,pI=new Array(256),Ug=new Array(256),La=new Array(256);for(let aI=0;aI<256;aI++)pI[aI]=nI[aI]/255,Ug[aI]=cI[aI]/255,La[aI]=dI[aI]/255;Pg=pI.join(","),ua=Ug.join(","),ya=La.join(","),oI=`${Pg}${ua}${ya}`}if(Lg=la(this,co,ld).get(oI),Lg)return la(this,co,ld).set(kg,Lg),Lg;const iI=`g_${la(this,Yg)}_transfer_map_${Wd(this,Eg)._++}`,oa=`url(#${iI})`;la(this,co,ld).set(kg,oa),la(this,co,ld).set(oI,oa);const ha=ZI(this,co,Qd).call(this,iI);return ZI(this,co,Vd).call(this,Pg,ua,ya,ha),oa}addHCMFilter(kg,Lg){var cI;const Pg=`${kg}-${Lg}`;if(la(this,Kg)===Pg)return la(this,Dg);if(BI(this,Kg,Pg),BI(this,Dg,"none"),(cI=la(this,Og))==null||cI.remove(),!kg||!Lg)return la(this,Dg);const ua=ZI(this,co,Yd).call(this,kg);kg=ng.Util.makeHexColor(...ua);const ya=ZI(this,co,Yd).call(this,Lg);if(Lg=ng.Util.makeHexColor(...ya),la(this,co,Cd).style.color="",kg==="#000000"&&Lg==="#ffffff"||kg===Lg)return la(this,Dg);const oI=new Array(256);for(let dI=0;dI<=255;dI++){const pI=dI/255;oI[dI]=pI<=.03928?pI/12.92:((pI+.055)/1.055)**2.4}const iI=oI.join(","),oa=`g_${la(this,Yg)}_hcm_filter`,ha=BI(this,Fg,ZI(this,co,Qd).call(this,oa));ZI(this,co,Vd).call(this,iI,iI,iI,ha),ZI(this,co,$0).call(this,ha);const nI=(dI,pI)=>{const Ug=ua[dI]/255,La=ya[dI]/255,aI=new Array(pI+1);for(let CI=0;CI<=pI;CI++)aI[CI]=Ug+CI/pI*(La-Ug);return aI.join(",")};return ZI(this,co,Vd).call(this,nI(0,5),nI(1,5),nI(2,5),ha),BI(this,Dg,`url(#${oa})`),la(this,Dg)}addHighlightHCMFilter(kg,Lg,Pg,ua){var La;const ya=`${kg}-${Lg}-${Pg}-${ua}`;if(la(this,Tg)===ya)return la(this,Jg);if(BI(this,Tg,ya),BI(this,Jg,"none"),(La=la(this,Fg))==null||La.remove(),!kg||!Lg)return la(this,Jg);const[oI,iI]=[kg,Lg].map(ZI(this,co,Yd).bind(this));let oa=Math.round(.2126*oI[0]+.7152*oI[1]+.0722*oI[2]),ha=Math.round(.2126*iI[0]+.7152*iI[1]+.0722*iI[2]),[nI,cI]=[Pg,ua].map(ZI(this,co,Yd).bind(this));ha<oa&&([oa,ha,nI,cI]=[ha,oa,cI,nI]),la(this,co,Cd).style.color="";const dI=(aI,CI,fa)=>{const zg=new Array(256),Hg=(ha-oa)/fa,ca=aI/255,tI=(CI-aI)/(255*fa);let jg=0;for(let lo=0;lo<=fa;lo++){const sa=Math.round(oa+lo*Hg),qg=ca+lo*tI;for(let ga=jg;ga<=sa;ga++)zg[ga]=qg;jg=sa+1}for(let lo=jg;lo<256;lo++)zg[lo]=zg[jg-1];return zg.join(",")},pI=`g_${la(this,Yg)}_hcm_highlight_filter`,Ug=BI(this,Fg,ZI(this,co,Qd).call(this,pI));return ZI(this,co,$0).call(this,Ug),ZI(this,co,Vd).call(this,dI(nI[0],cI[0],5),dI(nI[1],cI[1],5),dI(nI[2],cI[2],5),Ug),BI(this,Jg,`url(#${pI})`),la(this,Jg)}destroy(kg=!1){kg&&(la(this,Dg)||la(this,Jg))||(la(this,Sg)&&(la(this,Sg).parentNode.parentNode.remove(),BI(this,Sg,null)),la(this,Rg)&&(la(this,Rg).clear(),BI(this,Rg,null)),BI(this,Eg,0))}}Rg=new WeakMap,Sg=new WeakMap,Yg=new WeakMap,xg=new WeakMap,Og=new WeakMap,Kg=new WeakMap,Dg=new WeakMap,Fg=new WeakMap,Tg=new WeakMap,Jg=new WeakMap,Eg=new WeakMap,co=new WeakSet,ld=function(){return la(this,Rg)||BI(this,Rg,new Map)},Cd=function(){if(!la(this,Sg)){const kg=la(this,xg).createElement("div"),{style:Lg}=kg;Lg.visibility="hidden",Lg.contain="strict",Lg.width=Lg.height=0,Lg.position="absolute",Lg.top=Lg.left=0,Lg.zIndex=-1;const Pg=la(this,xg).createElementNS(og,"svg");Pg.setAttribute("width",0),Pg.setAttribute("height",0),BI(this,Sg,la(this,xg).createElementNS(og,"defs")),kg.append(Pg),Pg.append(la(this,Sg)),la(this,xg).body.append(kg)}return la(this,Sg)},$0=function(kg){const Lg=la(this,xg).createElementNS(og,"feColorMatrix");Lg.setAttribute("type","matrix"),Lg.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),kg.append(Lg)},Qd=function(kg){const Lg=la(this,xg).createElementNS(og,"filter");return Lg.setAttribute("color-interpolation-filters","sRGB"),Lg.setAttribute("id",kg),la(this,co,Cd).append(Lg),Lg},Ud=function(kg,Lg,Pg){const ua=la(this,xg).createElementNS(og,Lg);ua.setAttribute("type","discrete"),ua.setAttribute("tableValues",Pg),kg.append(ua)},Vd=function(kg,Lg,Pg,ua){const ya=la(this,xg).createElementNS(og,"feComponentTransfer");ua.append(ya),ZI(this,co,Ud).call(this,ya,"feFuncR",kg),ZI(this,co,Ud).call(this,ya,"feFuncG",Lg),ZI(this,co,Ud).call(this,ya,"feFuncB",Pg)},Yd=function(kg){return la(this,co,Cd).style.color=kg,$g(getComputedStyle(la(this,co,Cd)).getPropertyValue("color"))},eg.DOMFilterFactory=Ig;class sg extends ig.BaseCanvasFactory{constructor({ownerDocument:no=globalThis.document}={}){super(),this._document=no}_createCanvas(no,kg){const Lg=this._document.createElement("canvas");return Lg.width=no,Lg.height=kg,Lg}}eg.DOMCanvasFactory=sg;async function Cg(eo,no=!1){if(fg(eo,document.baseURI)){const kg=await fetch(eo);if(!kg.ok)throw new Error(kg.statusText);return no?new Uint8Array(await kg.arrayBuffer()):(0,ng.stringToBytes)(await kg.text())}return new Promise((kg,Lg)=>{const Pg=new XMLHttpRequest;Pg.open("GET",eo,!0),no&&(Pg.responseType="arraybuffer"),Pg.onreadystatechange=()=>{if(Pg.readyState===XMLHttpRequest.DONE){if(Pg.status===200||Pg.status===0){let ua;if(no&&Pg.response?ua=new Uint8Array(Pg.response):!no&&Pg.responseText&&(ua=(0,ng.stringToBytes)(Pg.responseText)),ua){kg(ua);return}}Lg(new Error(Pg.statusText))}},Pg.send(null)})}class lg extends ig.BaseCMapReaderFactory{_fetchData(no,kg){return Cg(no,this.isCompressed).then(Lg=>({cMapData:Lg,compressionType:kg}))}}eg.DOMCMapReaderFactory=lg;class Ag extends ig.BaseStandardFontDataFactory{_fetchData(no){return Cg(no,!0)}}eg.DOMStandardFontDataFactory=Ag;class cg extends ig.BaseSVGFactory{_createSVG(no){return document.createElementNS(og,no)}}eg.DOMSVGFactory=cg;class rg{constructor({viewBox:no,scale:kg,rotation:Lg,offsetX:Pg=0,offsetY:ua=0,dontFlip:ya=!1}){this.viewBox=no,this.scale=kg,this.rotation=Lg,this.offsetX=Pg,this.offsetY=ua;const oI=(no[2]+no[0])/2,iI=(no[3]+no[1])/2;let oa,ha,nI,cI;switch(Lg%=360,Lg<0&&(Lg+=360),Lg){case 180:oa=-1,ha=0,nI=0,cI=1;break;case 90:oa=0,ha=1,nI=1,cI=0;break;case 270:oa=0,ha=-1,nI=-1,cI=0;break;case 0:oa=1,ha=0,nI=0,cI=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}ya&&(nI=-nI,cI=-cI);let dI,pI,Ug,La;oa===0?(dI=Math.abs(iI-no[1])*kg+Pg,pI=Math.abs(oI-no[0])*kg+ua,Ug=(no[3]-no[1])*kg,La=(no[2]-no[0])*kg):(dI=Math.abs(oI-no[0])*kg+Pg,pI=Math.abs(iI-no[1])*kg+ua,Ug=(no[2]-no[0])*kg,La=(no[3]-no[1])*kg),this.transform=[oa*kg,ha*kg,nI*kg,cI*kg,dI-oa*kg*oI-nI*kg*iI,pI-ha*kg*oI-cI*kg*iI],this.width=Ug,this.height=La}get rawDims(){const{viewBox:no}=this;return(0,ng.shadow)(this,"rawDims",{pageWidth:no[2]-no[0],pageHeight:no[3]-no[1],pageX:no[0],pageY:no[1]})}clone({scale:no=this.scale,rotation:kg=this.rotation,offsetX:Lg=this.offsetX,offsetY:Pg=this.offsetY,dontFlip:ua=!1}={}){return new rg({viewBox:this.viewBox.slice(),scale:no,rotation:kg,offsetX:Lg,offsetY:Pg,dontFlip:ua})}convertToViewportPoint(no,kg){return ng.Util.applyTransform([no,kg],this.transform)}convertToViewportRectangle(no){const kg=ng.Util.applyTransform([no[0],no[1]],this.transform),Lg=ng.Util.applyTransform([no[2],no[3]],this.transform);return[kg[0],kg[1],Lg[0],Lg[1]]}convertToPdfPoint(no,kg){return ng.Util.applyInverseTransform([no,kg],this.transform)}}eg.PageViewport=rg;class ug extends ng.BaseException{constructor(no,kg=0){super(no,"RenderingCancelledException"),this.extraDelay=kg}}eg.RenderingCancelledException=ug;function dg(eo){const no=eo.length;let kg=0;for(;kg<no&&eo[kg].trim()==="";)kg++;return eo.substring(kg,kg+5).toLowerCase()==="data:"}function bg(eo){return typeof eo=="string"&&/\.pdf$/i.test(eo)}function mg(eo,no=!1){return no||([eo]=eo.split(/[#?]/,1)),eo.substring(eo.lastIndexOf("/")+1)}function hg(eo,no="document.pdf"){if(typeof eo!="string")return no;if(dg(eo))return(0,ng.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),no;const kg=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Lg=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Pg=kg.exec(eo);let ua=Lg.exec(Pg[1])||Lg.exec(Pg[2])||Lg.exec(Pg[3]);if(ua&&(ua=ua[0],ua.includes("%")))try{ua=Lg.exec(decodeURIComponent(ua))[0]}catch{}return ua||no}class pg{constructor(){tl(this,"started",Object.create(null));tl(this,"times",[])}time(no){no in this.started&&(0,ng.warn)(`Timer is already running for ${no}`),this.started[no]=Date.now()}timeEnd(no){no in this.started||(0,ng.warn)(`Timer has not been started for ${no}`),this.times.push({name:no,start:this.started[no],end:Date.now()}),delete this.started[no]}toString(){const no=[];let kg=0;for(const{name:Lg}of this.times)kg=Math.max(Lg.length,kg);for(const{name:Lg,start:Pg,end:ua}of this.times)no.push(`${Lg.padEnd(kg)} ${ua-Pg}ms
960
+ `);_laserWarnShown||(_laserWarnShown=!0,setTimeout(()=>{Modal$1.warning({title:translate("editor.specialist.laser.title"),content:ng,okText:translate("common.actions.confirm"),centered:!0})},0))}countUsedLaserPresets(eg){if(!eg)return 0;const gg=new Set,ig=ng=>{try{(JSON.parse(ng).objects||[]).forEach(ag=>{var sg;const Ig=(sg=ag.customExportFields)==null?void 0:sg.laserConfigId;Ig&&gg.add(Ig)})}catch{}};return typeof eg.canvas=="string"?ig(eg.canvas):Array.isArray(eg.canvas)&&eg.canvas.forEach(ng=>ig(ng)),Array.isArray(eg.layers)&&eg.layers.forEach(ng=>{typeof(ng==null?void 0:ng.canvas)=="string"&&ig(ng.canvas)}),gg.size}exportJson(eg="checkFile"){return new Promise((gg,ig)=>{emitter.emit("toTemplateJson",ng=>{try{const og=JSON.parse(ng||"{}"),ag=extractFontNames(og.canvas),Ig=getCustomFonts(ag);Ig.length&&(og.labelConfig.customFonts=Ig);const sg=new Set,Cg=cg=>{try{(JSON.parse(cg).objects||[]).forEach(ug=>{var bg;const dg=(bg=ug.customExportFields)==null?void 0:bg.laserConfigId;dg&&sg.add(dg)})}catch{}};typeof og.canvas=="string"?Cg(og.canvas):Array.isArray(og.canvas)&&og.canvas.forEach(cg=>Cg(cg));const lg=getLaserPresets();lg.value.length>0&&(og.laserConfigList=lg.value.filter(cg=>sg.has(cg.configId)),og.laserConfigList.length===0&&delete og.laserConfigList);let Ag=JSON.stringify(og);if(eg==="checkFile"&&this._maxSize&&countSize(Ag)>this._maxSize){ig(`画布大于${this._maxSize}MB, 不能保存`);return}gg(Ag)}catch(og){ig(og)}})})}async getFileJsonSize(){let eg=await this.exportJson("noCheck"),gg=countSize(eg,"KB");return gg=Number(gg.toFixed(2)),gg}addCustomFontList(eg){emitter.emit("addCustomFontList",eg)}replaceFontList(eg){this._isReplaceFont=!0,emitter.emit("replaceFontList",eg)}setLaserConfigList(eg){getLaserPresets().value.length===0&&setLaserPresets(eg);const gg=setLaserConfigList(eg);gg&&this.notifyLaserSyncWarning(gg)}selectFontCallback(eg){emitter.off("selectFontCallback"),emitter.on("selectFontCallback",gg=>{let ig=this.filterLoadFontByName(gg)||[];eg&&ig.length&&eg(ig)})}async loadFontFile(eg){const{fontName:gg,blob:ig}=eg;return!gg||!ig?!1:loadFontFromBlob(gg,ig)}exportImage(eg={}){return new Promise(gg=>{emitter.emit("exportImage",{options:eg,callback:ig=>{gg(ig)}})})}toggleMultiLayer(eg=!0){state$1.isMultiLayerEnabled=!!eg}setMultiLayerEnabled(eg=!0){this.toggleMultiLayer(eg)}setMessages(eg){this._localeController.setMessages(eg)}async setLayerStyleIndependent(eg=!0){const gg=async()=>{var ag;const ig=useTabsStore(),ng=(ag=ig.getActiveTab)==null?void 0:ag.call(ig);if(!(ng!=null&&ng.config))return!1;applyLayerStyleIndependent(ng,eg),ig.storeTabs(ig.tabs),setFileDirty(ng.id);const og=emitter.all.get("layer-style-independent-change");return og!=null&&og.length&&await new Promise(Ig=>{let sg=!1;const Cg=()=>{sg||(sg=!0,Ig())};emitter.emit("layer-style-independent-change",{done:Cg})}),!0};if(!await gg())return new Promise(ig=>{const ng=setTimeout(()=>{emitter.off("label-ready",og),gg(),ig()},3e3),og=()=>{clearTimeout(ng),emitter.off("label-ready",og),gg().finally(ig)};emitter.on("label-ready",og)})}setLayerMaxCount(eg=1){setSysConfigState({...getSysConfigState(),layerMaxCount:state$1.isSeparateLayerMode?state$1.separateLayerCount:getLayerMaxCount(eg)})}_applyFileFieldJson(eg){const gg=useTabsStore(),ig=gg.getActiveTab();if(!(ig!=null&&ig.config))return!1;const ng=ig.config.fileFieldJson||"",og=this._computeFileFieldJsonDiff(ng,eg);return ig.config.fileFieldJson=eg,gg.storeTabs(gg.tabs),setFileDirty(ig.id),og&&emitter.emit("file-field-json-changed",og),!0}_computeFileFieldJsonDiff(eg,gg){if(!eg&&!gg)return null;let ig={},ng={};try{ig=JSON.parse(eg||"{}")}catch{}try{ng=JSON.parse(gg||"{}")}catch{}(typeof ig!="object"||ig===null||Array.isArray(ig))&&(ig={}),(typeof ng!="object"||ng===null||Array.isArray(ng))&&(ng={});const og={renamed:[],removed:[],added:[],valueChanged:[]},ag=Object.keys(ig),Ig=Object.keys(ng),sg=new Set(ag),Cg=new Set(Ig);for(const lg of ag)Cg.has(lg)?String(ig[lg])!==String(ng[lg])&&og.valueChanged.push({key:lg,oldValue:String(ig[lg]??""),newValue:String(ng[lg]??"")}):og.removed.push(lg);for(const lg of Ig)sg.has(lg)||og.added.push(lg);return!og.renamed.length&&!og.removed.length&&!og.added.length&&!og.valueChanged.length?null:og}insertFileFieldJson(eg){try{const gg=normalizeFileFieldJson(eg);if(!gg)return!1;if(this._applyFileFieldJson(gg))return!0;this._cleanupFileFieldJsonPending(),this._pendingFileFieldJson=gg;const ig=()=>{this._destroyed||this._applyFileFieldJson(gg)&&this._cleanupFileFieldJsonPending()};return this._fileFieldJsonLabelReadyHandler=ig,emitter.on("label-ready",ig),this._insertFileFieldJsonTimer=setTimeout(()=>{this._destroyed||(this._applyFileFieldJson(gg),this._cleanupFileFieldJsonPending())},3e3),!0}catch(gg){return console.error("[LabelEditor] insertFileFieldJson failed:",gg),!1}}_cleanupFileFieldJsonPending(){this._fileFieldJsonLabelReadyHandler&&(emitter.off("label-ready",this._fileFieldJsonLabelReadyHandler),this._fileFieldJsonLabelReadyHandler=null),clearTimeout(this._insertFileFieldJsonTimer),this._insertFileFieldJsonTimer=null,this._pendingFileFieldJson=null}setSeparateLayerMode(eg=!0){state$1.isSeparateLayerMode=!!eg,state$1.isSeparateLayerMode&&(state$1.isMultiLayerEnabled=!0,state$1.separateLayerCount=getEditorConfig().separateLayerCount,state$1.separateLayerNames=[...getEditorConfig().separateLayerNames],this.setLayerMaxCount(state$1.separateLayerCount))}async getThumbnailImage(eg={}){const ig=useTabsStore().getActiveTab();if(!(ig!=null&&ig.config))return"";let og=ig==null?void 0:ig.config,ag="";og.separateLayerMode?ag=await this.getDoubleRibbonsImage(eg):ag=await this.getImage(eg);let Ig=document.createElement("canvas"),sg=Ig.getContext("2d"),Cg=og.pageWidth,Ag=og.pageHeight/Cg,cg=300,rg=cg*Ag;Ig.width=cg,Ig.height=rg;let ug=await this.loadImage(ag);return sg==null||sg.drawImage(ug,0,0,cg,rg),Ig.toDataURL()}loadImage(eg){return new Promise((gg,ig)=>{const ng=new Image;ng.onload=()=>gg(ng),ng.onerror=ig,ng.src=eg,ng.complete&&gg(ng)})}getImage(eg={}){return this.exportImage(eg)}getDoubleRibbonsImage(eg={}){return new Promise(gg=>{this.exportImage({...eg,mode:"separate",layout:"doubleRibbons"}).then(ig=>{gg((ig==null?void 0:ig.composedImage)||ig)})})}enterDoubleRibbons(){state$1.isSeparateLayerMode=!0,state$1.isMultiLayerEnabled=!0,state$1.separateLayerCount=2,state$1.separateLayerNames=[this._localeController.translate("editor.remaining.upperLayer"),this._localeController.translate("editor.remaining.lowerLayer")],this.setLayerMaxCount(state$1.separateLayerCount),emitter.emit("separate-layer-config-change",{count:state$1.separateLayerCount,names:[...state$1.separateLayerNames]})}setSeparateLayerConfig(eg={}){eg.count!=null&&(state$1.separateLayerCount=getLayerMaxCount(eg.count)),eg.names!=null&&(state$1.separateLayerNames=Array.isArray(eg.names)?eg.names.map(gg=>String(gg||"").trim()).filter(Boolean):[]),state$1.isSeparateLayerMode&&(this.setLayerMaxCount(state$1.separateLayerCount),emitter.emit("separate-layer-config-change",{count:state$1.separateLayerCount,names:[...state$1.separateLayerNames]}))}toggleEditTabs(eg=!0){state$1.isShowEditTabs=!!eg}checkFileSave(){return new Promise(eg=>{emitter.emit("checkFileSave",gg=>{eg(gg)})})}openAutoSave(eg,gg=5e3){clearInterval(this._autoSaveTimer),this._autoSaveTimer=setInterval(async()=>{if(!await this.checkFileSave()){let ng=await this.exportJson();eg&&eg(ng)}},gg)}}function commonjsRequire(tg){throw new Error('Could not dynamically require "'+tg+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);var hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,(function(module,exports){(function(eg,gg){module.exports=eg.pdfjsLib=gg()})(globalThis,()=>(()=>{var __webpack_modules__=[,((tg,eg)=>{var CI;Object.defineProperty(eg,"__esModule",{value:!0}),eg.VerbosityLevel=eg.Util=eg.UnknownErrorException=eg.UnexpectedResponseException=eg.TextRenderingMode=eg.RenderingIntentFlag=eg.PromiseCapability=eg.PermissionFlag=eg.PasswordResponses=eg.PasswordException=eg.PageActionEventType=eg.OPS=eg.MissingPDFException=eg.MAX_IMAGE_SIZE_TO_CACHE=eg.LINE_FACTOR=eg.LINE_DESCENT_FACTOR=eg.InvalidPDFException=eg.ImageKind=eg.IDENTITY_MATRIX=eg.FormatError=eg.FeatureTest=eg.FONT_IDENTITY_MATRIX=eg.DocumentActionEventType=eg.CMapCompressionType=eg.BaseException=eg.BASELINE_FACTOR=eg.AnnotationType=eg.AnnotationReplyType=eg.AnnotationPrefix=eg.AnnotationMode=eg.AnnotationFlag=eg.AnnotationFieldFlag=eg.AnnotationEditorType=eg.AnnotationEditorPrefix=eg.AnnotationEditorParamsType=eg.AnnotationBorderStyleType=eg.AnnotationActionEventType=eg.AbortException=void 0,eg.assert=Yg,eg.bytesToString=pa,eg.createValidAbsoluteUrl=Og,eg.getModificationDate=nI,eg.getUuid=La,eg.getVerbosityLevel=Vg,eg.info=Mg,eg.isArrayBuffer=oa,eg.isArrayEqual=ha,eg.isNodeJS=void 0,eg.normalizeUnicode=Ug,eg.objectFromMap=uo,eg.objectSize=Ca,eg.setVerbosityLevel=Xg,eg.shadow=Kg,eg.string32=Qg,eg.stringToBytes=eI,eg.stringToPDFString=ya,eg.stringToUTF8String=oI,eg.unreachable=Sg,eg.utf8StringToString=iI,eg.warn=Rg;const gg=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");eg.isNodeJS=gg;const ig=[1,0,0,1,0,0];eg.IDENTITY_MATRIX=ig;const ng=[.001,0,0,.001,0,0];eg.FONT_IDENTITY_MATRIX=ng;const og=1e7;eg.MAX_IMAGE_SIZE_TO_CACHE=og;const ag=1.35;eg.LINE_FACTOR=ag;const Ig=.35;eg.LINE_DESCENT_FACTOR=Ig;const sg=Ig/ag;eg.BASELINE_FACTOR=sg;const Cg={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};eg.RenderingIntentFlag=Cg;const lg={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};eg.AnnotationMode=lg;const Ag="pdfjs_internal_editor_";eg.AnnotationEditorPrefix=Ag;const cg={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};eg.AnnotationEditorType=cg;const rg={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};eg.AnnotationEditorParamsType=rg;const ug={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};eg.PermissionFlag=ug;const dg={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};eg.TextRenderingMode=dg;const bg={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};eg.ImageKind=bg;const mg={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};eg.AnnotationType=mg;const hg={GROUP:"Group",REPLY:"R"};eg.AnnotationReplyType=hg;const pg={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};eg.AnnotationFlag=pg;const fg={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};eg.AnnotationFieldFlag=fg;const wg={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};eg.AnnotationBorderStyleType=wg;const Gg={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};eg.AnnotationActionEventType=Gg;const Zg={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};eg.DocumentActionEventType=Zg;const yg={O:"PageOpen",C:"PageClose"};eg.PageActionEventType=yg;const Bg={ERRORS:0,WARNINGS:1,INFOS:5};eg.VerbosityLevel=Bg;const Wg={NONE:0,BINARY:1};eg.CMapCompressionType=Wg;const $g={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};eg.OPS=$g;const Ng={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};eg.PasswordResponses=Ng;let vg=Bg.WARNINGS;function Xg(fa){Number.isInteger(fa)&&(vg=fa)}function Vg(){return vg}function Mg(fa){vg>=Bg.INFOS&&console.log(`Info: ${fa}`)}function Rg(fa){vg>=Bg.WARNINGS&&console.log(`Warning: ${fa}`)}function Sg(fa){throw new Error(fa)}function Yg(fa,zg){fa||Sg(zg)}function xg(fa){switch(fa==null?void 0:fa.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Og(fa,zg=null,Hg=null){if(!fa)return null;try{if(Hg&&typeof fa=="string"){if(Hg.addDefaultProtocol&&fa.startsWith("www.")){const tI=fa.match(/\./g);(tI==null?void 0:tI.length)>=2&&(fa=`http://${fa}`)}if(Hg.tryConvertEncoding)try{fa=oI(fa)}catch{}}const ca=zg?new URL(fa,zg):new URL(fa);if(xg(ca))return ca}catch{}return null}function Kg(fa,zg,Hg,ca=!1){return Object.defineProperty(fa,zg,{value:Hg,enumerable:!ca,configurable:!0,writable:!1}),Hg}const Dg=(function(){function zg(Hg,ca){this.constructor===zg&&Sg("Cannot initialize BaseException."),this.message=Hg,this.name=ca}return zg.prototype=new Error,zg.constructor=zg,zg})();eg.BaseException=Dg;class Fg extends Dg{constructor(zg,Hg){super(zg,"PasswordException"),this.code=Hg}}eg.PasswordException=Fg;class Tg extends Dg{constructor(zg,Hg){super(zg,"UnknownErrorException"),this.details=Hg}}eg.UnknownErrorException=Tg;class Jg extends Dg{constructor(zg){super(zg,"InvalidPDFException")}}eg.InvalidPDFException=Jg;class Eg extends Dg{constructor(zg){super(zg,"MissingPDFException")}}eg.MissingPDFException=Eg;class co extends Dg{constructor(zg,Hg){super(zg,"UnexpectedResponseException"),this.status=Hg}}eg.UnexpectedResponseException=co;class da extends Dg{constructor(zg){super(zg,"FormatError")}}eg.FormatError=da;class ma extends Dg{constructor(zg){super(zg,"AbortException")}}eg.AbortException=ma;function pa(fa){(typeof fa!="object"||(fa==null?void 0:fa.length)===void 0)&&Sg("Invalid argument for bytesToString");const zg=fa.length,Hg=8192;if(zg<Hg)return String.fromCharCode.apply(null,fa);const ca=[];for(let tI=0;tI<zg;tI+=Hg){const jg=Math.min(tI+Hg,zg),lo=fa.subarray(tI,jg);ca.push(String.fromCharCode.apply(null,lo))}return ca.join("")}function eI(fa){typeof fa!="string"&&Sg("Invalid argument for stringToBytes");const zg=fa.length,Hg=new Uint8Array(zg);for(let ca=0;ca<zg;++ca)Hg[ca]=fa.charCodeAt(ca)&255;return Hg}function Qg(fa){return String.fromCharCode(fa>>24&255,fa>>16&255,fa>>8&255,fa&255)}function Ca(fa){return Object.keys(fa).length}function uo(fa){const zg=Object.create(null);for(const[Hg,ca]of fa)zg[Hg]=ca;return zg}function eo(){const fa=new Uint8Array(4);return fa[0]=1,new Uint32Array(fa.buffer,0,1)[0]===1}function no(){try{return new Function(""),!0}catch{return!1}}class kg{static get isLittleEndian(){return Kg(this,"isLittleEndian",eo())}static get isEvalSupported(){return Kg(this,"isEvalSupported",no())}static get isOffscreenCanvasSupported(){return Kg(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Kg(this,"platform",{isWin:!1,isMac:!1}):Kg(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var zg,Hg;return Kg(this,"isCSSRoundSupported",(Hg=(zg=globalThis.CSS)==null?void 0:zg.supports)==null?void 0:Hg.call(zg,"width: round(1.5px, 1px)"))}}eg.FeatureTest=kg;const Lg=[...Array(256).keys()].map(fa=>fa.toString(16).padStart(2,"0"));class Pg{static makeHexColor(zg,Hg,ca){return`#${Lg[zg]}${Lg[Hg]}${Lg[ca]}`}static scaleMinMax(zg,Hg){let ca;zg[0]?(zg[0]<0&&(ca=Hg[0],Hg[0]=Hg[1],Hg[1]=ca),Hg[0]*=zg[0],Hg[1]*=zg[0],zg[3]<0&&(ca=Hg[2],Hg[2]=Hg[3],Hg[3]=ca),Hg[2]*=zg[3],Hg[3]*=zg[3]):(ca=Hg[0],Hg[0]=Hg[2],Hg[2]=ca,ca=Hg[1],Hg[1]=Hg[3],Hg[3]=ca,zg[1]<0&&(ca=Hg[2],Hg[2]=Hg[3],Hg[3]=ca),Hg[2]*=zg[1],Hg[3]*=zg[1],zg[2]<0&&(ca=Hg[0],Hg[0]=Hg[1],Hg[1]=ca),Hg[0]*=zg[2],Hg[1]*=zg[2]),Hg[0]+=zg[4],Hg[1]+=zg[4],Hg[2]+=zg[5],Hg[3]+=zg[5]}static transform(zg,Hg){return[zg[0]*Hg[0]+zg[2]*Hg[1],zg[1]*Hg[0]+zg[3]*Hg[1],zg[0]*Hg[2]+zg[2]*Hg[3],zg[1]*Hg[2]+zg[3]*Hg[3],zg[0]*Hg[4]+zg[2]*Hg[5]+zg[4],zg[1]*Hg[4]+zg[3]*Hg[5]+zg[5]]}static applyTransform(zg,Hg){const ca=zg[0]*Hg[0]+zg[1]*Hg[2]+Hg[4],tI=zg[0]*Hg[1]+zg[1]*Hg[3]+Hg[5];return[ca,tI]}static applyInverseTransform(zg,Hg){const ca=Hg[0]*Hg[3]-Hg[1]*Hg[2],tI=(zg[0]*Hg[3]-zg[1]*Hg[2]+Hg[2]*Hg[5]-Hg[4]*Hg[3])/ca,jg=(-zg[0]*Hg[1]+zg[1]*Hg[0]+Hg[4]*Hg[1]-Hg[5]*Hg[0])/ca;return[tI,jg]}static getAxialAlignedBoundingBox(zg,Hg){const ca=this.applyTransform(zg,Hg),tI=this.applyTransform(zg.slice(2,4),Hg),jg=this.applyTransform([zg[0],zg[3]],Hg),lo=this.applyTransform([zg[2],zg[1]],Hg);return[Math.min(ca[0],tI[0],jg[0],lo[0]),Math.min(ca[1],tI[1],jg[1],lo[1]),Math.max(ca[0],tI[0],jg[0],lo[0]),Math.max(ca[1],tI[1],jg[1],lo[1])]}static inverseTransform(zg){const Hg=zg[0]*zg[3]-zg[1]*zg[2];return[zg[3]/Hg,-zg[1]/Hg,-zg[2]/Hg,zg[0]/Hg,(zg[2]*zg[5]-zg[4]*zg[3])/Hg,(zg[4]*zg[1]-zg[5]*zg[0])/Hg]}static singularValueDecompose2dScale(zg){const Hg=[zg[0],zg[2],zg[1],zg[3]],ca=zg[0]*Hg[0]+zg[1]*Hg[2],tI=zg[0]*Hg[1]+zg[1]*Hg[3],jg=zg[2]*Hg[0]+zg[3]*Hg[2],lo=zg[2]*Hg[1]+zg[3]*Hg[3],sa=(ca+lo)/2,qg=Math.sqrt((ca+lo)**2-4*(ca*lo-jg*tI))/2,ga=sa+qg||1,va=sa-qg||1;return[Math.sqrt(ga),Math.sqrt(va)]}static normalizeRect(zg){const Hg=zg.slice(0);return zg[0]>zg[2]&&(Hg[0]=zg[2],Hg[2]=zg[0]),zg[1]>zg[3]&&(Hg[1]=zg[3],Hg[3]=zg[1]),Hg}static intersect(zg,Hg){const ca=Math.max(Math.min(zg[0],zg[2]),Math.min(Hg[0],Hg[2])),tI=Math.min(Math.max(zg[0],zg[2]),Math.max(Hg[0],Hg[2]));if(ca>tI)return null;const jg=Math.max(Math.min(zg[1],zg[3]),Math.min(Hg[1],Hg[3])),lo=Math.min(Math.max(zg[1],zg[3]),Math.max(Hg[1],Hg[3]));return jg>lo?null:[ca,jg,tI,lo]}static bezierBoundingBox(zg,Hg,ca,tI,jg,lo,sa,qg){const ga=[],va=[[],[]];let sI,aa,_g,xa,lI,gI,II,AI;for(let WI=0;WI<2;++WI){if(WI===0?(aa=6*zg-12*ca+6*jg,sI=-3*zg+9*ca-9*jg+3*sa,_g=3*ca-3*zg):(aa=6*Hg-12*tI+6*lo,sI=-3*Hg+9*tI-9*lo+3*qg,_g=3*tI-3*Hg),Math.abs(sI)<1e-12){if(Math.abs(aa)<1e-12)continue;xa=-_g/aa,0<xa&&xa<1&&ga.push(xa);continue}II=aa*aa-4*_g*sI,AI=Math.sqrt(II),!(II<0)&&(lI=(-aa+AI)/(2*sI),0<lI&&lI<1&&ga.push(lI),gI=(-aa-AI)/(2*sI),0<gI&&gI<1&&ga.push(gI))}let rI=ga.length,bI;const hI=rI;for(;rI--;)xa=ga[rI],bI=1-xa,va[0][rI]=bI*bI*bI*zg+3*bI*bI*xa*ca+3*bI*xa*xa*jg+xa*xa*xa*sa,va[1][rI]=bI*bI*bI*Hg+3*bI*bI*xa*tI+3*bI*xa*xa*lo+xa*xa*xa*qg;return va[0][hI]=zg,va[1][hI]=Hg,va[0][hI+1]=sa,va[1][hI+1]=qg,va[0].length=va[1].length=hI+2,[Math.min(...va[0]),Math.min(...va[1]),Math.max(...va[0]),Math.max(...va[1])]}}eg.Util=Pg;const ua=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function ya(fa){if(fa[0]>="ï"){let Hg;if(fa[0]==="þ"&&fa[1]==="ÿ"?Hg="utf-16be":fa[0]==="ÿ"&&fa[1]==="þ"?Hg="utf-16le":fa[0]==="ï"&&fa[1]==="»"&&fa[2]==="¿"&&(Hg="utf-8"),Hg)try{const ca=new TextDecoder(Hg,{fatal:!0}),tI=eI(fa);return ca.decode(tI)}catch(ca){Rg(`stringToPDFString: "${ca}".`)}}const zg=[];for(let Hg=0,ca=fa.length;Hg<ca;Hg++){const tI=ua[fa.charCodeAt(Hg)];zg.push(tI?String.fromCharCode(tI):fa.charAt(Hg))}return zg.join("")}function oI(fa){return decodeURIComponent(escape(fa))}function iI(fa){return unescape(encodeURIComponent(fa))}function oa(fa){return typeof fa=="object"&&(fa==null?void 0:fa.byteLength)!==void 0}function ha(fa,zg){if(fa.length!==zg.length)return!1;for(let Hg=0,ca=fa.length;Hg<ca;Hg++)if(fa[Hg]!==zg[Hg])return!1;return!0}function nI(fa=new Date){return[fa.getUTCFullYear().toString(),(fa.getUTCMonth()+1).toString().padStart(2,"0"),fa.getUTCDate().toString().padStart(2,"0"),fa.getUTCHours().toString().padStart(2,"0"),fa.getUTCMinutes().toString().padStart(2,"0"),fa.getUTCSeconds().toString().padStart(2,"0")].join("")}class cI{constructor(){yI(this,CI,!1);this.promise=new Promise((zg,Hg)=>{this.resolve=ca=>{BI(this,CI,!0),zg(ca)},this.reject=ca=>{BI(this,CI,!0),Hg(ca)}})}get settled(){return la(this,CI)}}CI=new WeakMap,eg.PromiseCapability=cI;let dI=null,pI=null;function Ug(fa){return dI||(dI=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,pI=new Map([["ſt","ſt"]])),fa.replaceAll(dI,(zg,Hg,ca)=>Hg?Hg.normalize("NFKC"):pI.get(ca))}function La(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const fa=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(fa);else for(let zg=0;zg<32;zg++)fa[zg]=Math.floor(Math.random()*255);return pa(fa)}const aI="pdfjs_internal_id_";eg.AnnotationPrefix=aI}),((__unused_webpack_module,exports,__w_pdfjs_require__)=>{var tg,gg,ig,ng,sd,Jd,Ig,sg,Cg,lg,Ag,cg,rg,ug,dg,Ed,mg,hg,c0,fg,wg;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(Zg){if(typeof Zg=="string"||Zg instanceof URL?Zg={url:Zg}:(0,_util.isArrayBuffer)(Zg)&&(Zg={data:Zg}),typeof Zg!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Zg.url&&!Zg.data&&!Zg.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const yg=new PDFDocumentLoadingTask,{docId:Bg}=yg,Wg=Zg.url?getUrlProp(Zg.url):null,$g=Zg.data?getDataProp(Zg.data):null,Ng=Zg.httpHeaders||null,vg=Zg.withCredentials===!0,Xg=Zg.password??null,Vg=Zg.range instanceof PDFDataRangeTransport?Zg.range:null,Mg=Number.isInteger(Zg.rangeChunkSize)&&Zg.rangeChunkSize>0?Zg.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Rg=Zg.worker instanceof PDFWorker?Zg.worker:null;const Sg=Zg.verbosity,Yg=typeof Zg.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Zg.docBaseUrl)?Zg.docBaseUrl:null,xg=typeof Zg.cMapUrl=="string"?Zg.cMapUrl:null,Og=Zg.cMapPacked!==!1,Kg=Zg.CMapReaderFactory||DefaultCMapReaderFactory,Dg=typeof Zg.standardFontDataUrl=="string"?Zg.standardFontDataUrl:null,Fg=Zg.StandardFontDataFactory||DefaultStandardFontDataFactory,Tg=Zg.stopAtErrors!==!0,Jg=Number.isInteger(Zg.maxImageSize)&&Zg.maxImageSize>-1?Zg.maxImageSize:-1,Eg=Zg.isEvalSupported!==!1,co=typeof Zg.isOffscreenCanvasSupported=="boolean"?Zg.isOffscreenCanvasSupported:!_util.isNodeJS,da=Number.isInteger(Zg.canvasMaxAreaInBytes)?Zg.canvasMaxAreaInBytes:-1,ma=typeof Zg.disableFontFace=="boolean"?Zg.disableFontFace:_util.isNodeJS,pa=Zg.fontExtraProperties===!0,eI=Zg.enableXfa===!0,Qg=Zg.ownerDocument||globalThis.document,Ca=Zg.disableRange===!0,uo=Zg.disableStream===!0,eo=Zg.disableAutoFetch===!0,no=Zg.pdfBug===!0,kg=Vg?Vg.length:Zg.length??NaN,Lg=typeof Zg.useSystemFonts=="boolean"?Zg.useSystemFonts:!_util.isNodeJS&&!ma,Pg=typeof Zg.useWorkerFetch=="boolean"?Zg.useWorkerFetch:Kg===_display_utils.DOMCMapReaderFactory&&Fg===_display_utils.DOMStandardFontDataFactory&&xg&&Dg&&(0,_display_utils.isValidFetchUrl)(xg,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(Dg,document.baseURI),ua=Zg.canvasFactory||new DefaultCanvasFactory({ownerDocument:Qg}),ya=Zg.filterFactory||new DefaultFilterFactory({docId:Bg,ownerDocument:Qg}),oI=null;(0,_util.setVerbosityLevel)(Sg);const iI={canvasFactory:ua,filterFactory:ya};if(Pg||(iI.cMapReaderFactory=new Kg({baseUrl:xg,isCompressed:Og}),iI.standardFontDataFactory=new Fg({baseUrl:Dg})),!Rg){const nI={verbosity:Sg,port:_worker_options.GlobalWorkerOptions.workerPort};Rg=nI.port?PDFWorker.fromPort(nI):new PDFWorker(nI),yg._worker=Rg}const oa={docId:Bg,apiVersion:"3.11.174",data:$g,password:Xg,disableAutoFetch:eo,rangeChunkSize:Mg,length:kg,docBaseUrl:Yg,enableXfa:eI,evaluatorOptions:{maxImageSize:Jg,disableFontFace:ma,ignoreErrors:Tg,isEvalSupported:Eg,isOffscreenCanvasSupported:co,canvasMaxAreaInBytes:da,fontExtraProperties:pa,useSystemFonts:Lg,cMapUrl:Pg?xg:null,standardFontDataUrl:Pg?Dg:null}},ha={ignoreErrors:Tg,isEvalSupported:Eg,disableFontFace:ma,fontExtraProperties:pa,enableXfa:eI,ownerDocument:Qg,disableAutoFetch:eo,pdfBug:no,styleElement:oI};return Rg.promise.then(function(){if(yg.destroyed)throw new Error("Loading aborted");const nI=_fetchDocument(Rg,oa),cI=new Promise(function(dI){let pI;Vg?pI=new _transport_stream.PDFDataTransportStream({length:kg,initialData:Vg.initialData,progressiveDone:Vg.progressiveDone,contentDispositionFilename:Vg.contentDispositionFilename,disableRange:Ca,disableStream:uo},Vg):$g||(pI=(La=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(La):(0,_display_utils.isValidFetchUrl)(La.url)?new _displayFetch_stream.PDFFetchStream(La):new _displayNetwork.PDFNetworkStream(La))({url:Wg,length:kg,httpHeaders:Ng,withCredentials:vg,rangeChunkSize:Mg,disableRange:Ca,disableStream:uo})),dI(pI)});return Promise.all([nI,cI]).then(function([dI,pI]){if(yg.destroyed)throw new Error("Loading aborted");const Ug=new _message_handler.MessageHandler(Bg,dI,Rg.port),La=new WorkerTransport(Ug,yg,pI,ha,iI);yg._transport=La,Ug.send("Ready",null)})}).catch(yg._capability.reject),yg}async function _fetchDocument(Zg,yg){if(Zg.destroyed)throw new Error("Worker was destroyed");const Bg=await Zg.messageHandler.sendWithPromise("GetDocRequest",yg,yg.data?[yg.data.buffer]:null);if(Zg.destroyed)throw new Error("Worker was destroyed");return Bg}function getUrlProp(Zg){if(Zg instanceof URL)return Zg.href;try{return new URL(Zg,window.location).href}catch{if(_util.isNodeJS&&typeof Zg=="string")return Zg}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Zg){if(_util.isNodeJS&&typeof Buffer<"u"&&Zg instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(Zg instanceof Uint8Array&&Zg.byteLength===Zg.buffer.byteLength)return Zg;if(typeof Zg=="string")return(0,_util.stringToBytes)(Zg);if(typeof Zg=="object"&&!isNaN(Zg==null?void 0:Zg.length)||(0,_util.isArrayBuffer)(Zg))return new Uint8Array(Zg);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const eg=class eg{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Wd(eg,tg)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var yg,Bg,Wg;this.destroyed=!0;try{(yg=this._worker)!=null&&yg.port&&(this._worker._pendingDestroy=!0),await((Bg=this._transport)==null?void 0:Bg.destroy())}catch($g){throw(Wg=this._worker)!=null&&Wg.port&&delete this._worker._pendingDestroy,$g}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};tg=new WeakMap,yI(eg,tg,0);let PDFDocumentLoadingTask=eg;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(yg,Bg,Wg=!1,$g=null){this.length=yg,this.initialData=Bg,this.progressiveDone=Wg,this.contentDispositionFilename=$g,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(yg){this._rangeListeners.push(yg)}addProgressListener(yg){this._progressListeners.push(yg)}addProgressiveReadListener(yg){this._progressiveReadListeners.push(yg)}addProgressiveDoneListener(yg){this._progressiveDoneListeners.push(yg)}onDataRange(yg,Bg){for(const Wg of this._rangeListeners)Wg(yg,Bg)}onDataProgress(yg,Bg){this._readyCapability.promise.then(()=>{for(const Wg of this._progressListeners)Wg(yg,Bg)})}onDataProgressiveRead(yg){this._readyCapability.promise.then(()=>{for(const Bg of this._progressiveReadListeners)Bg(yg)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const yg of this._progressiveDoneListeners)yg()})}transportReady(){this._readyCapability.resolve()}requestDataRange(yg,Bg){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(yg,Bg){this._pdfInfo=yg,this._transport=Bg,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(Wg=>{if(!Wg)return Wg;const $g=[];for(const Ng in Wg)$g.push(...Wg[Ng]);return $g}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(yg){return this._transport.getPage(yg)}getPageIndex(yg){return this._transport.getPageIndex(yg)}getDestinations(){return this._transport.getDestinations()}getDestination(yg){return this._transport.getDestination(yg)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(yg=!1){return this._transport.startCleanup(yg||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(yg,Bg,Wg,$g=!1){yI(this,ng);yI(this,gg,null);yI(this,ig,!1);this._pageIndex=yg,this._pageInfo=Bg,this._transport=Wg,this._stats=$g?new _display_utils.StatTimer:null,this._pdfBug=$g,this.commonObjs=Wg.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:yg,rotation:Bg=this.rotate,offsetX:Wg=0,offsetY:$g=0,dontFlip:Ng=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:yg,rotation:Bg,offsetX:Wg,offsetY:$g,dontFlip:Ng})}getAnnotations({intent:yg="display"}={}){const Bg=this._transport.getRenderingIntent(yg);return this._transport.getAnnotations(this._pageIndex,Bg.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var yg;return((yg=this._transport._htmlForXfa)==null?void 0:yg.children[this._pageIndex])||null}render({canvasContext:yg,viewport:Bg,intent:Wg="display",annotationMode:$g=_util.AnnotationMode.ENABLE,transform:Ng=null,background:vg=null,optionalContentConfigPromise:Xg=null,annotationCanvasMap:Vg=null,pageColors:Mg=null,printAnnotationStorage:Rg=null}){var Fg,Tg;(Fg=this._stats)==null||Fg.time("Overall");const Sg=this._transport.getRenderingIntent(Wg,$g,Rg);BI(this,ig,!1),ZI(this,ng,Jd).call(this),Xg||(Xg=this._transport.getOptionalContentConfig());let Yg=this._intentStates.get(Sg.cacheKey);Yg||(Yg=Object.create(null),this._intentStates.set(Sg.cacheKey,Yg)),Yg.streamReaderCancelTimeout&&(clearTimeout(Yg.streamReaderCancelTimeout),Yg.streamReaderCancelTimeout=null);const xg=!!(Sg.renderingIntent&_util.RenderingIntentFlag.PRINT);Yg.displayReadyCapability||(Yg.displayReadyCapability=new _util.PromiseCapability,Yg.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Tg=this._stats)==null||Tg.time("Page Request"),this._pumpOperatorList(Sg));const Og=Jg=>{var Eg,co;Yg.renderTasks.delete(Kg),(this._maybeCleanupAfterRender||xg)&&BI(this,ig,!0),ZI(this,ng,sd).call(this,!xg),Jg?(Kg.capability.reject(Jg),this._abortOperatorList({intentState:Yg,reason:Jg instanceof Error?Jg:new Error(Jg)})):Kg.capability.resolve(),(Eg=this._stats)==null||Eg.timeEnd("Rendering"),(co=this._stats)==null||co.timeEnd("Overall")},Kg=new InternalRenderTask({callback:Og,params:{canvasContext:yg,viewport:Bg,transform:Ng,background:vg},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Vg,operatorList:Yg.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!xg,pdfBug:this._pdfBug,pageColors:Mg});(Yg.renderTasks||(Yg.renderTasks=new Set)).add(Kg);const Dg=Kg.task;return Promise.all([Yg.displayReadyCapability.promise,Xg]).then(([Jg,Eg])=>{var co;if(this.destroyed){Og();return}(co=this._stats)==null||co.time("Rendering"),Kg.initializeGraphics({transparency:Jg,optionalContentConfig:Eg}),Kg.operatorListChanged()}).catch(Og),Dg}getOperatorList({intent:yg="display",annotationMode:Bg=_util.AnnotationMode.ENABLE,printAnnotationStorage:Wg=null}={}){var Vg;function $g(){vg.operatorList.lastChunk&&(vg.opListReadCapability.resolve(vg.operatorList),vg.renderTasks.delete(Xg))}const Ng=this._transport.getRenderingIntent(yg,Bg,Wg,!0);let vg=this._intentStates.get(Ng.cacheKey);vg||(vg=Object.create(null),this._intentStates.set(Ng.cacheKey,vg));let Xg;return vg.opListReadCapability||(Xg=Object.create(null),Xg.operatorListChanged=$g,vg.opListReadCapability=new _util.PromiseCapability,(vg.renderTasks||(vg.renderTasks=new Set)).add(Xg),vg.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Vg=this._stats)==null||Vg.time("Page Request"),this._pumpOperatorList(Ng)),vg.opListReadCapability.promise}streamTextContent({includeMarkedContent:yg=!1,disableNormalization:Bg=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:yg===!0,disableNormalization:Bg===!0},{highWaterMark:100,size($g){return $g.items.length}})}getTextContent(yg={}){if(this._transport._htmlForXfa)return this.getXfa().then(Wg=>_xfa_text.XfaText.textContent(Wg));const Bg=this.streamTextContent(yg);return new Promise(function(Wg,$g){function Ng(){vg.read().then(function({value:Vg,done:Mg}){if(Mg){Wg(Xg);return}Object.assign(Xg.styles,Vg.styles),Xg.items.push(...Vg.items),Ng()},$g)}const vg=Bg.getReader(),Xg={items:[],styles:Object.create(null)};Ng()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const yg=[];for(const Bg of this._intentStates.values())if(this._abortOperatorList({intentState:Bg,reason:new Error("Page was destroyed."),force:!0}),!Bg.opListReadCapability)for(const Wg of Bg.renderTasks)yg.push(Wg.completed),Wg.cancel();return this.objs.clear(),BI(this,ig,!1),ZI(this,ng,Jd).call(this),Promise.all(yg)}cleanup(yg=!1){BI(this,ig,!0);const Bg=ZI(this,ng,sd).call(this,!1);return yg&&Bg&&this._stats&&(this._stats=new _display_utils.StatTimer),Bg}_startRenderPage(yg,Bg){var $g,Ng;const Wg=this._intentStates.get(Bg);Wg&&(($g=this._stats)==null||$g.timeEnd("Page Request"),(Ng=Wg.displayReadyCapability)==null||Ng.resolve(yg))}_renderPageChunk(yg,Bg){for(let Wg=0,$g=yg.length;Wg<$g;Wg++)Bg.operatorList.fnArray.push(yg.fnArray[Wg]),Bg.operatorList.argsArray.push(yg.argsArray[Wg]);Bg.operatorList.lastChunk=yg.lastChunk,Bg.operatorList.separateAnnots=yg.separateAnnots;for(const Wg of Bg.renderTasks)Wg.operatorListChanged();yg.lastChunk&&ZI(this,ng,sd).call(this,!0)}_pumpOperatorList({renderingIntent:yg,cacheKey:Bg,annotationStorageSerializable:Wg}){const{map:$g,transfers:Ng}=Wg,Xg=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:yg,cacheKey:Bg,annotationStorage:$g},Ng).getReader(),Vg=this._intentStates.get(Bg);Vg.streamReader=Xg;const Mg=()=>{Xg.read().then(({value:Rg,done:Sg})=>{if(Sg){Vg.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Rg,Vg),Mg())},Rg=>{if(Vg.streamReader=null,!this._transport.destroyed){if(Vg.operatorList){Vg.operatorList.lastChunk=!0;for(const Sg of Vg.renderTasks)Sg.operatorListChanged();ZI(this,ng,sd).call(this,!0)}if(Vg.displayReadyCapability)Vg.displayReadyCapability.reject(Rg);else if(Vg.opListReadCapability)Vg.opListReadCapability.reject(Rg);else throw Rg}})};Mg()}_abortOperatorList({intentState:yg,reason:Bg,force:Wg=!1}){if(yg.streamReader){if(yg.streamReaderCancelTimeout&&(clearTimeout(yg.streamReaderCancelTimeout),yg.streamReaderCancelTimeout=null),!Wg){if(yg.renderTasks.size>0)return;if(Bg instanceof _display_utils.RenderingCancelledException){let $g=RENDERING_CANCELLED_TIMEOUT;Bg.extraDelay>0&&Bg.extraDelay<1e3&&($g+=Bg.extraDelay),yg.streamReaderCancelTimeout=setTimeout(()=>{yg.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:yg,reason:Bg,force:!0})},$g);return}}if(yg.streamReader.cancel(new _util.AbortException(Bg.message)).catch(()=>{}),yg.streamReader=null,!this._transport.destroyed){for(const[$g,Ng]of this._intentStates)if(Ng===yg){this._intentStates.delete($g);break}this.cleanup()}}}get stats(){return this._stats}}gg=new WeakMap,ig=new WeakMap,ng=new WeakSet,sd=function(yg=!1){if(ZI(this,ng,Jd).call(this),!la(this,ig)||this.destroyed)return!1;if(yg)return BI(this,gg,setTimeout(()=>{BI(this,gg,null),ZI(this,ng,sd).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Bg,operatorList:Wg}of this._intentStates.values())if(Bg.size>0||!Wg.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),BI(this,ig,!1),!0},Jd=function(){la(this,gg)&&(clearTimeout(la(this,gg)),BI(this,gg,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){yI(this,Ig,new Set);yI(this,sg,Promise.resolve())}postMessage(yg,Bg){const Wg={data:structuredClone(yg,Bg?{transfer:Bg}:null)};la(this,sg).then(()=>{for(const $g of la(this,Ig))$g.call(this,Wg)})}addEventListener(yg,Bg){la(this,Ig).add(Bg)}removeEventListener(yg,Bg){la(this,Ig).delete(Bg)}terminate(){la(this,Ig).clear()}}Ig=new WeakMap,sg=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Zg=(Cg=document==null?void 0:document.currentScript)==null?void 0:Cg.src;Zg&&(PDFWorkerUtil.fallbackWorkerSrc=Zg.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Zg,yg){let Bg;try{if(Bg=new URL(Zg),!Bg.origin||Bg.origin==="null")return!1}catch{return!1}const Wg=new URL(yg,Bg);return Bg.origin===Wg.origin},PDFWorkerUtil.createCDNWrapper=function(Zg){const yg=`importScripts("${Zg}");`;return URL.createObjectURL(new Blob([yg]))}}const _PDFWorker=class _PDFWorker{constructor({name:Zg=null,port:yg=null,verbosity:Bg=(0,_util.getVerbosityLevel)()}={}){var Wg;if(this.name=Zg,this.destroyed=!1,this.verbosity=Bg,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,yg){if((Wg=la(_PDFWorker,lg))!=null&&Wg.has(yg))throw new Error("Cannot use more than one PDFWorker per port.");(la(_PDFWorker,lg)||BI(_PDFWorker,lg,new WeakMap)).set(yg,this),this._initializeFromPort(yg);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Zg){this._port=Zg,this._messageHandler=new _message_handler.MessageHandler("main","worker",Zg),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Zg}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Zg)||(Zg=PDFWorkerUtil.createCDNWrapper(new URL(Zg,window.location).href));const yg=new Worker(Zg),Bg=new _message_handler.MessageHandler("main","worker",yg),Wg=()=>{yg.removeEventListener("error",$g),Bg.destroy(),yg.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},$g=()=>{this._webWorker||Wg()};yg.addEventListener("error",$g),Bg.on("test",vg=>{if(yg.removeEventListener("error",$g),this.destroyed){Wg();return}vg?(this._messageHandler=Bg,this._port=yg,this._webWorker=yg,this._readyCapability.resolve(),Bg.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Bg.destroy(),yg.terminate())}),Bg.on("ready",vg=>{if(yg.removeEventListener("error",$g),this.destroyed){Wg();return}try{Ng()}catch{this._setupFakeWorker()}});const Ng=()=>{const vg=new Uint8Array;Bg.send("test",vg,[vg.buffer])};Ng();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Zg=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const yg=new LoopbackPort;this._port=yg;const Bg=`fake${PDFWorkerUtil.fakeWorkerId++}`,Wg=new _message_handler.MessageHandler(Bg+"_worker",Bg,yg);Zg.setup(Wg,yg);const $g=new _message_handler.MessageHandler(Bg,Bg+"_worker",yg);this._messageHandler=$g,this._readyCapability.resolve(),$g.send("configure",{verbosity:this.verbosity})}).catch(Zg=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${Zg.message}".`))})}destroy(){var Zg;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(Zg=la(_PDFWorker,lg))==null||Zg.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Zg){var Bg;if(!(Zg!=null&&Zg.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const yg=(Bg=la(this,lg))==null?void 0:Bg.get(Zg.port);if(yg){if(yg._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return yg}return new _PDFWorker(Zg)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Zg;try{return((Zg=globalThis.pdfjsWorker)==null?void 0:Zg.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};lg=new WeakMap,yI(_PDFWorker,lg);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(yg,Bg,Wg,$g,Ng){yI(this,dg);yI(this,Ag,new Map);yI(this,cg,new Map);yI(this,rg,new Map);yI(this,ug,null);this.messageHandler=yg,this.loadingTask=Bg,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:$g.ownerDocument,styleElement:$g.styleElement}),this._params=$g,this.canvasFactory=Ng.canvasFactory,this.filterFactory=Ng.filterFactory,this.cMapReaderFactory=Ng.cMapReaderFactory,this.standardFontDataFactory=Ng.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Wg,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(yg,Bg=_util.AnnotationMode.ENABLE,Wg=null,$g=!1){let Ng=_util.RenderingIntentFlag.DISPLAY,vg=_annotation_storage.SerializableEmpty;switch(yg){case"any":Ng=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":Ng=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${yg}`)}switch(Bg){case _util.AnnotationMode.DISABLE:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:Ng+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,vg=(Ng&_util.RenderingIntentFlag.PRINT&&Wg instanceof _annotation_storage.PrintAnnotationStorage?Wg:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Bg}`)}return $g&&(Ng+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:Ng,cacheKey:`${Ng}_${vg.hash}`,annotationStorageSerializable:vg}}destroy(){var Wg;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(Wg=la(this,ug))==null||Wg.reject(new Error("Worker was destroyed during onPassword callback"));const yg=[];for(const $g of la(this,cg).values())yg.push($g._destroy());la(this,cg).clear(),la(this,rg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Bg=this.messageHandler.sendWithPromise("Terminate",null);return yg.push(Bg),Promise.all(yg).then(()=>{var $g;this.commonObjs.clear(),this.fontLoader.clear(),la(this,Ag).clear(),this.filterFactory.destroy(),($g=this._networkStream)==null||$g.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:yg,loadingTask:Bg}=this;yg.on("GetReader",(Wg,$g)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=Ng=>{this._lastProgress={loaded:Ng.loaded,total:Ng.total}},$g.onPull=()=>{this._fullReader.read().then(function({value:Ng,done:vg}){if(vg){$g.close();return}(0,_util.assert)(Ng instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),$g.enqueue(new Uint8Array(Ng),1,[Ng])}).catch(Ng=>{$g.error(Ng)})},$g.onCancel=Ng=>{this._fullReader.cancel(Ng),$g.ready.catch(vg=>{if(!this.destroyed)throw vg})}}),yg.on("ReaderHeadersReady",Wg=>{const $g=new _util.PromiseCapability,Ng=this._fullReader;return Ng.headersReady.then(()=>{var vg;(!Ng.isStreamingSupported||!Ng.isRangeSupported)&&(this._lastProgress&&((vg=Bg.onProgress)==null||vg.call(Bg,this._lastProgress)),Ng.onProgress=Xg=>{var Vg;(Vg=Bg.onProgress)==null||Vg.call(Bg,{loaded:Xg.loaded,total:Xg.total})}),$g.resolve({isStreamingSupported:Ng.isStreamingSupported,isRangeSupported:Ng.isRangeSupported,contentLength:Ng.contentLength})},$g.reject),$g.promise}),yg.on("GetRangeReader",(Wg,$g)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const Ng=this._networkStream.getRangeReader(Wg.begin,Wg.end);if(!Ng){$g.close();return}$g.onPull=()=>{Ng.read().then(function({value:vg,done:Xg}){if(Xg){$g.close();return}(0,_util.assert)(vg instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),$g.enqueue(new Uint8Array(vg),1,[vg])}).catch(vg=>{$g.error(vg)})},$g.onCancel=vg=>{Ng.cancel(vg),$g.ready.catch(Xg=>{if(!this.destroyed)throw Xg})}}),yg.on("GetDoc",({pdfInfo:Wg})=>{this._numPages=Wg.numPages,this._htmlForXfa=Wg.htmlForXfa,delete Wg.htmlForXfa,Bg._capability.resolve(new PDFDocumentProxy(Wg,this))}),yg.on("DocException",function(Wg){let $g;switch(Wg.name){case"PasswordException":$g=new _util.PasswordException(Wg.message,Wg.code);break;case"InvalidPDFException":$g=new _util.InvalidPDFException(Wg.message);break;case"MissingPDFException":$g=new _util.MissingPDFException(Wg.message);break;case"UnexpectedResponseException":$g=new _util.UnexpectedResponseException(Wg.message,Wg.status);break;case"UnknownErrorException":$g=new _util.UnknownErrorException(Wg.message,Wg.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Bg._capability.reject($g)}),yg.on("PasswordRequest",Wg=>{if(BI(this,ug,new _util.PromiseCapability),Bg.onPassword){const $g=Ng=>{Ng instanceof Error?la(this,ug).reject(Ng):la(this,ug).resolve({password:Ng})};try{Bg.onPassword($g,Wg.code)}catch(Ng){la(this,ug).reject(Ng)}}else la(this,ug).reject(new _util.PasswordException(Wg.message,Wg.code));return la(this,ug).promise}),yg.on("DataLoaded",Wg=>{var $g;($g=Bg.onProgress)==null||$g.call(Bg,{loaded:Wg.length,total:Wg.length}),this.downloadInfoCapability.resolve(Wg)}),yg.on("StartRenderPage",Wg=>{if(this.destroyed)return;la(this,cg).get(Wg.pageIndex)._startRenderPage(Wg.transparency,Wg.cacheKey)}),yg.on("commonobj",([Wg,$g,Ng])=>{var vg;if(!this.destroyed&&!this.commonObjs.has(Wg))switch($g){case"Font":const Xg=this._params;if("error"in Ng){const Rg=Ng.error;(0,_util.warn)(`Error during font loading: ${Rg}`),this.commonObjs.resolve(Wg,Rg);break}const Vg=Xg.pdfBug&&((vg=globalThis.FontInspector)!=null&&vg.enabled)?(Rg,Sg)=>globalThis.FontInspector.fontAdded(Rg,Sg):null,Mg=new _font_loader.FontFaceObject(Ng,{isEvalSupported:Xg.isEvalSupported,disableFontFace:Xg.disableFontFace,ignoreErrors:Xg.ignoreErrors,inspectFont:Vg});this.fontLoader.bind(Mg).catch(Rg=>yg.sendWithPromise("FontFallback",{id:Wg})).finally(()=>{!Xg.fontExtraProperties&&Mg.data&&(Mg.data=null),this.commonObjs.resolve(Wg,Mg)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Wg,Ng);break;default:throw new Error(`Got unknown common object type ${$g}`)}}),yg.on("obj",([Wg,$g,Ng,vg])=>{var Vg;if(this.destroyed)return;const Xg=la(this,cg).get($g);if(!Xg.objs.has(Wg))switch(Ng){case"Image":if(Xg.objs.resolve(Wg,vg),vg){let Mg;if(vg.bitmap){const{width:Rg,height:Sg}=vg;Mg=Rg*Sg*4}else Mg=((Vg=vg.data)==null?void 0:Vg.length)||0;Mg>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xg._maybeCleanupAfterRender=!0)}break;case"Pattern":Xg.objs.resolve(Wg,vg);break;default:throw new Error(`Got unknown object type ${Ng}`)}}),yg.on("DocProgress",Wg=>{var $g;this.destroyed||($g=Bg.onProgress)==null||$g.call(Bg,{loaded:Wg.loaded,total:Wg.total})}),yg.on("FetchBuiltInCMap",Wg=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Wg):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),yg.on("FetchStandardFontData",Wg=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Wg):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var Wg;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:yg,transfers:Bg}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:yg,filename:((Wg=this._fullReader)==null?void 0:Wg.filename)??null},Bg).finally(()=>{this.annotationStorage.resetModified()})}getPage(yg){if(!Number.isInteger(yg)||yg<=0||yg>this._numPages)return Promise.reject(new Error("Invalid page request."));const Bg=yg-1,Wg=la(this,rg).get(Bg);if(Wg)return Wg;const $g=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Bg}).then(Ng=>{if(this.destroyed)throw new Error("Transport destroyed");const vg=new PDFPageProxy(Bg,Ng,this,this._params.pdfBug);return la(this,cg).set(Bg,vg),vg});return la(this,rg).set(Bg,$g),$g}getPageIndex(yg){return typeof yg!="object"||yg===null||!Number.isInteger(yg.num)||yg.num<0||!Number.isInteger(yg.gen)||yg.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:yg.num,gen:yg.gen})}getAnnotations(yg,Bg){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:yg,intent:Bg})}getFieldObjects(){return ZI(this,dg,Ed).call(this,"GetFieldObjects")}hasJSActions(){return ZI(this,dg,Ed).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(yg){return typeof yg!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:yg})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return ZI(this,dg,Ed).call(this,"GetDocJSActions")}getPageJSActions(yg){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:yg})}getStructTree(yg){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:yg})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(yg=>new _optional_content_config.OptionalContentConfig(yg))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const yg="GetMetadata",Bg=la(this,Ag).get(yg);if(Bg)return Bg;const Wg=this.messageHandler.sendWithPromise(yg,null).then($g=>{var Ng,vg;return{info:$g[0],metadata:$g[1]?new _metadata.Metadata($g[1]):null,contentDispositionFilename:((Ng=this._fullReader)==null?void 0:Ng.filename)??null,contentLength:((vg=this._fullReader)==null?void 0:vg.contentLength)??null}});return la(this,Ag).set(yg,Wg),Wg}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(yg=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Bg of la(this,cg).values())if(!Bg.cleanup())throw new Error(`startCleanup: Page ${Bg.pageNumber} is currently rendering.`);this.commonObjs.clear(),yg||this.fontLoader.clear(),la(this,Ag).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:yg,enableXfa:Bg}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:yg,enableXfa:Bg})}}Ag=new WeakMap,cg=new WeakMap,rg=new WeakMap,ug=new WeakMap,dg=new WeakSet,Ed=function(yg,Bg=null){const Wg=la(this,Ag).get(yg);if(Wg)return Wg;const $g=this.messageHandler.sendWithPromise(yg,Bg);return la(this,Ag).set(yg,$g),$g};class PDFObjects{constructor(){yI(this,hg);yI(this,mg,Object.create(null))}get(yg,Bg=null){if(Bg){const $g=ZI(this,hg,c0).call(this,yg);return $g.capability.promise.then(()=>Bg($g.data)),null}const Wg=la(this,mg)[yg];if(!(Wg!=null&&Wg.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${yg}.`);return Wg.data}has(yg){const Bg=la(this,mg)[yg];return(Bg==null?void 0:Bg.capability.settled)||!1}resolve(yg,Bg=null){const Wg=ZI(this,hg,c0).call(this,yg);Wg.data=Bg,Wg.capability.resolve()}clear(){var yg;for(const Bg in la(this,mg)){const{data:Wg}=la(this,mg)[Bg];(yg=Wg==null?void 0:Wg.bitmap)==null||yg.close()}BI(this,mg,Object.create(null))}}mg=new WeakMap,hg=new WeakSet,c0=function(yg){var Bg;return(Bg=la(this,mg))[yg]||(Bg[yg]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(yg){yI(this,fg,null);BI(this,fg,yg),this.onContinue=null}get promise(){return la(this,fg).capability.promise}cancel(yg=0){la(this,fg).cancel(null,yg)}get separateAnnots(){const{separateAnnots:yg}=la(this,fg).operatorList;if(!yg)return!1;const{annotationCanvasMap:Bg}=la(this,fg);return yg.form||yg.canvas&&(Bg==null?void 0:Bg.size)>0}}fg=new WeakMap,exports.RenderTask=RenderTask;const Gg=class Gg{constructor({callback:yg,params:Bg,objs:Wg,commonObjs:$g,annotationCanvasMap:Ng,operatorList:vg,pageIndex:Xg,canvasFactory:Vg,filterFactory:Mg,useRequestAnimationFrame:Rg=!1,pdfBug:Sg=!1,pageColors:Yg=null}){this.callback=yg,this.params=Bg,this.objs=Wg,this.commonObjs=$g,this.annotationCanvasMap=Ng,this.operatorListIdx=null,this.operatorList=vg,this._pageIndex=Xg,this.canvasFactory=Vg,this.filterFactory=Mg,this._pdfBug=Sg,this.pageColors=Yg,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Rg===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Bg.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:yg=!1,optionalContentConfig:Bg}){var Xg,Vg;if(this.cancelled)return;if(this._canvas){if(la(Gg,wg).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");la(Gg,wg).add(this._canvas)}this._pdfBug&&((Xg=globalThis.StepperManager)!=null&&Xg.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Wg,viewport:$g,transform:Ng,background:vg}=this.params;this.gfx=new _canvas.CanvasGraphics(Wg,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Bg},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:Ng,viewport:$g,transparency:yg,background:vg}),this.operatorListIdx=0,this.graphicsReady=!0,(Vg=this.graphicsReadyCallback)==null||Vg.call(this)}cancel(yg=null,Bg=0){var Wg;this.running=!1,this.cancelled=!0,(Wg=this.gfx)==null||Wg.endDrawing(),la(Gg,wg).delete(this._canvas),this.callback(yg||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Bg))}operatorListChanged(){var yg;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(yg=this.stepper)==null||yg.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),la(Gg,wg).delete(this._canvas),this.callback())))}};wg=new WeakMap,yI(Gg,wg,new WeakSet);let InternalRenderTask=Gg;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build}),((tg,eg,gg)=>{var Cg,lg,Ag,Sb,rg;Object.defineProperty(eg,"__esModule",{value:!0}),eg.SerializableEmpty=eg.PrintAnnotationStorage=eg.AnnotationStorage=void 0;var ig=gg(1),ng=gg(4),og=gg(8);const ag=Object.freeze({map:null,hash:"",transfers:void 0});eg.SerializableEmpty=ag;class Ig{constructor(){yI(this,Ag);yI(this,Cg,!1);yI(this,lg,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(dg,bg){const mg=la(this,lg).get(dg);return mg===void 0?bg:Object.assign(bg,mg)}getRawValue(dg){return la(this,lg).get(dg)}remove(dg){if(la(this,lg).delete(dg),la(this,lg).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const bg of la(this,lg).values())if(bg instanceof ng.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(dg,bg){const mg=la(this,lg).get(dg);let hg=!1;if(mg!==void 0)for(const[pg,fg]of Object.entries(bg))mg[pg]!==fg&&(hg=!0,mg[pg]=fg);else hg=!0,la(this,lg).set(dg,bg);hg&&ZI(this,Ag,Sb).call(this),bg instanceof ng.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(bg.constructor._type)}has(dg){return la(this,lg).has(dg)}getAll(){return la(this,lg).size>0?(0,ig.objectFromMap)(la(this,lg)):null}setAll(dg){for(const[bg,mg]of Object.entries(dg))this.setValue(bg,mg)}get size(){return la(this,lg).size}resetModified(){la(this,Cg)&&(BI(this,Cg,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new sg(this)}get serializable(){if(la(this,lg).size===0)return ag;const dg=new Map,bg=new og.MurmurHash3_64,mg=[],hg=Object.create(null);let pg=!1;for(const[fg,wg]of la(this,lg)){const Gg=wg instanceof ng.AnnotationEditor?wg.serialize(!1,hg):wg;Gg&&(dg.set(fg,Gg),bg.update(`${fg}:${JSON.stringify(Gg)}`),pg||(pg=!!Gg.bitmap))}if(pg)for(const fg of dg.values())fg.bitmap&&mg.push(fg.bitmap);return dg.size>0?{map:dg,hash:bg.hexdigest(),transfers:mg}:ag}}Cg=new WeakMap,lg=new WeakMap,Ag=new WeakSet,Sb=function(){la(this,Cg)||(BI(this,Cg,!0),typeof this.onSetModified=="function"&&this.onSetModified())},eg.AnnotationStorage=Ig;class sg extends Ig{constructor(bg){super();yI(this,rg);const{map:mg,hash:hg,transfers:pg}=bg.serializable,fg=structuredClone(mg,pg?{transfer:pg}:null);BI(this,rg,{map:fg,hash:hg,transfers:pg})}get print(){(0,ig.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return la(this,rg)}}rg=new WeakMap,eg.PrintAnnotationStorage=sg}),((tg,eg,gg)=>{var sg,Cg,lg,Ag,cg,rg,ug,dg,bg,mg,hg,pg,fg,wg,Gg,r0,d0,Bg,u0,m0,Mb,Xb,Db,b0,Hb;Object.defineProperty(eg,"__esModule",{value:!0}),eg.AnnotationEditor=void 0;var ig=gg(5),ng=gg(1),og=gg(6);const Rg=class Rg{constructor(Yg){yI(this,Gg);yI(this,sg,"");yI(this,Cg,!1);yI(this,lg,null);yI(this,Ag,null);yI(this,cg,null);yI(this,rg,!1);yI(this,ug,null);yI(this,dg,this.focusin.bind(this));yI(this,bg,this.focusout.bind(this));yI(this,mg,!1);yI(this,hg,!1);yI(this,pg,!1);tl(this,"_initialOptions",Object.create(null));tl(this,"_uiManager",null);tl(this,"_focusEventsAllowed",!0);tl(this,"_l10nPromise",null);yI(this,fg,!1);yI(this,wg,Rg._zIndex++);this.constructor===Rg&&(0,ng.unreachable)("Cannot initialize AnnotationEditor."),this.parent=Yg.parent,this.id=Yg.id,this.width=this.height=null,this.pageIndex=Yg.parent.pageIndex,this.name=Yg.name,this.div=null,this._uiManager=Yg.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=Yg.isCentered,this._structTreeParentId=null;const{rotation:xg,rawDims:{pageWidth:Og,pageHeight:Kg,pageX:Dg,pageY:Fg}}=this.parent.viewport;this.rotation=xg,this.pageRotation=(360+xg-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[Og,Kg],this.pageTranslation=[Dg,Fg];const[Tg,Jg]=this.parentDimensions;this.x=Yg.x/Tg,this.y=Yg.y/Jg,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,ng.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(Yg){const xg=new Ig({id:Yg.parent.getNextId(),parent:Yg.parent,uiManager:Yg._uiManager});xg.annotationElementId=Yg.annotationElementId,xg.deleted=!0,xg._uiManager.addToAnnotationStorage(xg)}static initialize(Yg,xg=null){if(Rg._l10nPromise||(Rg._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Kg=>[Kg,Yg.get(Kg)]))),xg!=null&&xg.strings)for(const Kg of xg.strings)Rg._l10nPromise.set(Kg,Yg.get(Kg));if(Rg._borderLineWidth!==-1)return;const Og=getComputedStyle(document.documentElement);Rg._borderLineWidth=parseFloat(Og.getPropertyValue("--outline-width"))||0}static updateDefaultParams(Yg,xg){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(Yg){return!1}static paste(Yg,xg){(0,ng.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return la(this,fg)}set _isDraggable(Yg){var xg;BI(this,fg,Yg),(xg=this.div)==null||xg.classList.toggle("draggable",Yg)}center(){const[Yg,xg]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*xg/(Yg*2),this.y+=this.width*Yg/(xg*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*xg/(Yg*2),this.y-=this.width*Yg/(xg*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(Yg){this._uiManager.addCommands(Yg)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=la(this,wg)}setParent(Yg){Yg!==null&&(this.pageIndex=Yg.pageIndex,this.pageDimensions=Yg.pageDimensions),this.parent=Yg}focusin(Yg){this._focusEventsAllowed&&(la(this,mg)?BI(this,mg,!1):this.parent.setSelected(this))}focusout(Yg){var Og;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const xg=Yg.relatedTarget;xg!=null&&xg.closest(`#${this.id}`)||(Yg.preventDefault(),(Og=this.parent)!=null&&Og.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(Yg,xg,Og,Kg){const[Dg,Fg]=this.parentDimensions;[Og,Kg]=this.screenToPageTranslation(Og,Kg),this.x=(Yg+Og)/Dg,this.y=(xg+Kg)/Fg,this.fixAndSetPosition()}translate(Yg,xg){ZI(this,Gg,r0).call(this,this.parentDimensions,Yg,xg)}translateInPage(Yg,xg){ZI(this,Gg,r0).call(this,this.pageDimensions,Yg,xg),this.div.scrollIntoView({block:"nearest"})}drag(Yg,xg){const[Og,Kg]=this.parentDimensions;if(this.x+=Yg/Og,this.y+=xg/Kg,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Eg,y:co}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Eg,co)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Dg,y:Fg}=this;const[Tg,Jg]=ZI(this,Gg,d0).call(this);Dg+=Tg,Fg+=Jg,this.div.style.left=`${(100*Dg).toFixed(2)}%`,this.div.style.top=`${(100*Fg).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[Yg,xg]=this.pageDimensions;let{x:Og,y:Kg,width:Dg,height:Fg}=this;switch(Dg*=Yg,Fg*=xg,Og*=Yg,Kg*=xg,this.rotation){case 0:Og=Math.max(0,Math.min(Yg-Dg,Og)),Kg=Math.max(0,Math.min(xg-Fg,Kg));break;case 90:Og=Math.max(0,Math.min(Yg-Fg,Og)),Kg=Math.min(xg,Math.max(Dg,Kg));break;case 180:Og=Math.min(Yg,Math.max(Dg,Og)),Kg=Math.min(xg,Math.max(Fg,Kg));break;case 270:Og=Math.min(Yg,Math.max(Fg,Og)),Kg=Math.max(0,Math.min(xg-Dg,Kg));break}this.x=Og/=Yg,this.y=Kg/=xg;const[Tg,Jg]=ZI(this,Gg,d0).call(this);Og+=Tg,Kg+=Jg;const{style:Eg}=this.div;Eg.left=`${(100*Og).toFixed(2)}%`,Eg.top=`${(100*Kg).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(Yg,xg){var Og;return ZI(Og=Rg,Bg,u0).call(Og,Yg,xg,this.parentRotation)}pageTranslationToScreen(Yg,xg){var Og;return ZI(Og=Rg,Bg,u0).call(Og,Yg,xg,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:Yg,pageDimensions:[xg,Og]}=this,Kg=xg*Yg,Dg=Og*Yg;return ng.FeatureTest.isCSSRoundSupported?[Math.round(Kg),Math.round(Dg)]:[Kg,Dg]}setDims(Yg,xg){var Dg;const[Og,Kg]=this.parentDimensions;this.div.style.width=`${(100*Yg/Og).toFixed(2)}%`,la(this,rg)||(this.div.style.height=`${(100*xg/Kg).toFixed(2)}%`),(Dg=la(this,lg))==null||Dg.classList.toggle("small",Yg<Rg.SMALL_EDITOR_SIZE||xg<Rg.SMALL_EDITOR_SIZE)}fixDims(){const{style:Yg}=this.div,{height:xg,width:Og}=Yg,Kg=Og.endsWith("%"),Dg=!la(this,rg)&&xg.endsWith("%");if(Kg&&Dg)return;const[Fg,Tg]=this.parentDimensions;Kg||(Yg.width=`${(100*parseFloat(Og)/Fg).toFixed(2)}%`),!la(this,rg)&&!Dg&&(Yg.height=`${(100*parseFloat(xg)/Tg).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(la(this,lg))return;const Yg=BI(this,lg,document.createElement("button"));Yg.className="altText";const xg=await Rg._l10nPromise.get("editor_alt_text_button_label");Yg.textContent=xg,Yg.setAttribute("aria-label",xg),Yg.tabIndex="0",Yg.addEventListener("contextmenu",og.noContextMenu),Yg.addEventListener("pointerdown",Og=>Og.stopPropagation()),Yg.addEventListener("click",Og=>{Og.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),Yg.addEventListener("keydown",Og=>{Og.target===Yg&&Og.key==="Enter"&&(Og.preventDefault(),this._uiManager.editAltText(this))}),ZI(this,Gg,b0).call(this),this.div.append(Yg),Rg.SMALL_EDITOR_SIZE||(Rg.SMALL_EDITOR_SIZE=Math.min(128,Math.round(Yg.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:la(this,sg),decorative:la(this,Cg)}}set altTextData({altText:Yg,decorative:xg}){la(this,sg)===Yg&&la(this,Cg)===xg||(BI(this,sg,Yg),BI(this,Cg,xg),ZI(this,Gg,b0).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",la(this,dg)),this.div.addEventListener("focusout",la(this,bg));const[Yg,xg]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*xg/Yg).toFixed(2)}%`,this.div.style.maxHeight=`${(100*Yg/xg).toFixed(2)}%`);const[Og,Kg]=this.getInitialTranslation();return this.translate(Og,Kg),(0,ig.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(Yg){const{isMac:xg}=ng.FeatureTest.platform;if(Yg.button!==0||Yg.ctrlKey&&xg){Yg.preventDefault();return}BI(this,mg,!0),ZI(this,Gg,Hb).call(this,Yg)}moveInDOM(){var Yg;(Yg=this.parent)==null||Yg.moveEditorInDOM(this)}_setParentAndPosition(Yg,xg,Og){Yg.changeParent(this),this.x=xg,this.y=Og,this.fixAndSetPosition()}getRect(Yg,xg){const Og=this.parentScale,[Kg,Dg]=this.pageDimensions,[Fg,Tg]=this.pageTranslation,Jg=Yg/Og,Eg=xg/Og,co=this.x*Kg,da=this.y*Dg,ma=this.width*Kg,pa=this.height*Dg;switch(this.rotation){case 0:return[co+Jg+Fg,Dg-da-Eg-pa+Tg,co+Jg+ma+Fg,Dg-da-Eg+Tg];case 90:return[co+Eg+Fg,Dg-da+Jg+Tg,co+Eg+pa+Fg,Dg-da+Jg+ma+Tg];case 180:return[co-Jg-ma+Fg,Dg-da+Eg+Tg,co-Jg+Fg,Dg-da+Eg+pa+Tg];case 270:return[co-Eg-pa+Fg,Dg-da-Jg-ma+Tg,co-Eg+Fg,Dg-da-Jg+Tg];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(Yg,xg){const[Og,Kg,Dg,Fg]=Yg,Tg=Dg-Og,Jg=Fg-Kg;switch(this.rotation){case 0:return[Og,xg-Fg,Tg,Jg];case 90:return[Og,xg-Kg,Jg,Tg];case 180:return[Dg,xg-Kg,Tg,Jg];case 270:return[Dg,xg-Fg,Jg,Tg];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){BI(this,pg,!0)}disableEditMode(){BI(this,pg,!1)}isInEditMode(){return la(this,pg)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var Yg,xg;(Yg=this.div)==null||Yg.addEventListener("focusin",la(this,dg)),(xg=this.div)==null||xg.addEventListener("focusout",la(this,bg))}serialize(Yg=!1,xg=null){(0,ng.unreachable)("An editor must be serializable")}static deserialize(Yg,xg,Og){const Kg=new this.prototype.constructor({parent:xg,id:xg.getNextId(),uiManager:Og});Kg.rotation=Yg.rotation;const[Dg,Fg]=Kg.pageDimensions,[Tg,Jg,Eg,co]=Kg.getRectInCurrentCoords(Yg.rect,Fg);return Kg.x=Tg/Dg,Kg.y=Jg/Fg,Kg.width=Eg/Dg,Kg.height=co/Fg,Kg}remove(){var Yg;this.div.removeEventListener("focusin",la(this,dg)),this.div.removeEventListener("focusout",la(this,bg)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(Yg=la(this,lg))==null||Yg.remove(),BI(this,lg,null),BI(this,Ag,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(ZI(this,Gg,Mb).call(this),la(this,ug).classList.remove("hidden"))}select(){var Yg;this.makeResizable(),(Yg=this.div)==null||Yg.classList.add("selectedEditor")}unselect(){var Yg,xg,Og;(Yg=la(this,ug))==null||Yg.classList.add("hidden"),(xg=this.div)==null||xg.classList.remove("selectedEditor"),(Og=this.div)!=null&&Og.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(Yg,xg){}disableEditing(){la(this,lg)&&(la(this,lg).hidden=!0)}enableEditing(){la(this,lg)&&(la(this,lg).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return la(this,hg)}set isEditing(Yg){BI(this,hg,Yg),this.parent&&(Yg?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(Yg,xg){BI(this,rg,!0);const Og=Yg/xg,{style:Kg}=this.div;Kg.aspectRatio=Og,Kg.height="auto"}static get MIN_SIZE(){return 16}};sg=new WeakMap,Cg=new WeakMap,lg=new WeakMap,Ag=new WeakMap,cg=new WeakMap,rg=new WeakMap,ug=new WeakMap,dg=new WeakMap,bg=new WeakMap,mg=new WeakMap,hg=new WeakMap,pg=new WeakMap,fg=new WeakMap,wg=new WeakMap,Gg=new WeakSet,r0=function([Yg,xg],Og,Kg){[Og,Kg]=this.screenToPageTranslation(Og,Kg),this.x+=Og/Yg,this.y+=Kg/xg,this.fixAndSetPosition()},d0=function(){const[Yg,xg]=this.parentDimensions,{_borderLineWidth:Og}=Rg,Kg=Og/Yg,Dg=Og/xg;switch(this.rotation){case 90:return[-Kg,Dg];case 180:return[Kg,Dg];case 270:return[Kg,-Dg];default:return[-Kg,-Dg]}},Bg=new WeakSet,u0=function(Yg,xg,Og){switch(Og){case 90:return[xg,-Yg];case 180:return[-Yg,-xg];case 270:return[-xg,Yg];default:return[Yg,xg]}},m0=function(Yg){switch(Yg){case 90:{const[xg,Og]=this.pageDimensions;return[0,-xg/Og,Og/xg,0]}case 180:return[-1,0,0,-1];case 270:{const[xg,Og]=this.pageDimensions;return[0,xg/Og,-Og/xg,0]}default:return[1,0,0,1]}},Mb=function(){if(la(this,ug))return;BI(this,ug,document.createElement("div")),la(this,ug).classList.add("resizers");const Yg=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||Yg.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const xg of Yg){const Og=document.createElement("div");la(this,ug).append(Og),Og.classList.add("resizer",xg),Og.addEventListener("pointerdown",ZI(this,Gg,Xb).bind(this,xg)),Og.addEventListener("contextmenu",og.noContextMenu)}this.div.prepend(la(this,ug))},Xb=function(Yg,xg){xg.preventDefault();const{isMac:Og}=ng.FeatureTest.platform;if(xg.button!==0||xg.ctrlKey&&Og)return;const Kg=ZI(this,Gg,Db).bind(this,Yg),Dg=this._isDraggable;this._isDraggable=!1;const Fg={passive:!0,capture:!0};window.addEventListener("pointermove",Kg,Fg);const Tg=this.x,Jg=this.y,Eg=this.width,co=this.height,da=this.parent.div.style.cursor,ma=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(xg.target).cursor;const pa=()=>{this._isDraggable=Dg,window.removeEventListener("pointerup",pa),window.removeEventListener("blur",pa),window.removeEventListener("pointermove",Kg,Fg),this.parent.div.style.cursor=da,this.div.style.cursor=ma;const eI=this.x,Qg=this.y,Ca=this.width,uo=this.height;eI===Tg&&Qg===Jg&&Ca===Eg&&uo===co||this.addCommands({cmd:()=>{this.width=Ca,this.height=uo,this.x=eI,this.y=Qg;const[eo,no]=this.parentDimensions;this.setDims(eo*Ca,no*uo),this.fixAndSetPosition()},undo:()=>{this.width=Eg,this.height=co,this.x=Tg,this.y=Jg;const[eo,no]=this.parentDimensions;this.setDims(eo*Eg,no*co),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",pa),window.addEventListener("blur",pa)},Db=function(Yg,xg){const[Og,Kg]=this.parentDimensions,Dg=this.x,Fg=this.y,Tg=this.width,Jg=this.height,Eg=Rg.MIN_SIZE/Og,co=Rg.MIN_SIZE/Kg,da=Ug=>Math.round(Ug*1e4)/1e4,ma=ZI(this,Gg,m0).call(this,this.rotation),pa=(Ug,La)=>[ma[0]*Ug+ma[2]*La,ma[1]*Ug+ma[3]*La],eI=ZI(this,Gg,m0).call(this,360-this.rotation),Qg=(Ug,La)=>[eI[0]*Ug+eI[2]*La,eI[1]*Ug+eI[3]*La];let Ca,uo,eo=!1,no=!1;switch(Yg){case"topLeft":eo=!0,Ca=(Ug,La)=>[0,0],uo=(Ug,La)=>[Ug,La];break;case"topMiddle":Ca=(Ug,La)=>[Ug/2,0],uo=(Ug,La)=>[Ug/2,La];break;case"topRight":eo=!0,Ca=(Ug,La)=>[Ug,0],uo=(Ug,La)=>[0,La];break;case"middleRight":no=!0,Ca=(Ug,La)=>[Ug,La/2],uo=(Ug,La)=>[0,La/2];break;case"bottomRight":eo=!0,Ca=(Ug,La)=>[Ug,La],uo=(Ug,La)=>[0,0];break;case"bottomMiddle":Ca=(Ug,La)=>[Ug/2,La],uo=(Ug,La)=>[Ug/2,0];break;case"bottomLeft":eo=!0,Ca=(Ug,La)=>[0,La],uo=(Ug,La)=>[Ug,0];break;case"middleLeft":no=!0,Ca=(Ug,La)=>[0,La/2],uo=(Ug,La)=>[Ug,La/2];break}const kg=Ca(Tg,Jg),Lg=uo(Tg,Jg);let Pg=pa(...Lg);const ua=da(Dg+Pg[0]),ya=da(Fg+Pg[1]);let oI=1,iI=1,[oa,ha]=this.screenToPageTranslation(xg.movementX,xg.movementY);if([oa,ha]=Qg(oa/Og,ha/Kg),eo){const Ug=Math.hypot(Tg,Jg);oI=iI=Math.max(Math.min(Math.hypot(Lg[0]-kg[0]-oa,Lg[1]-kg[1]-ha)/Ug,1/Tg,1/Jg),Eg/Tg,co/Jg)}else no?oI=Math.max(Eg,Math.min(1,Math.abs(Lg[0]-kg[0]-oa)))/Tg:iI=Math.max(co,Math.min(1,Math.abs(Lg[1]-kg[1]-ha)))/Jg;const nI=da(Tg*oI),cI=da(Jg*iI);Pg=pa(...uo(nI,cI));const dI=ua-Pg[0],pI=ya-Pg[1];this.width=nI,this.height=cI,this.x=dI,this.y=pI,this.setDims(Og*nI,Kg*cI),this.fixAndSetPosition()},b0=async function(){var Og;const Yg=la(this,lg);if(!Yg)return;if(!la(this,sg)&&!la(this,Cg)){Yg.classList.remove("done"),(Og=la(this,Ag))==null||Og.remove();return}Rg._l10nPromise.get("editor_alt_text_edit_button_label").then(Kg=>{Yg.setAttribute("aria-label",Kg)});let xg=la(this,Ag);if(!xg){BI(this,Ag,xg=document.createElement("span")),xg.className="tooltip",xg.setAttribute("role","tooltip");const Kg=xg.id=`alt-text-tooltip-${this.id}`;Yg.setAttribute("aria-describedby",Kg);const Dg=100;Yg.addEventListener("mouseenter",()=>{BI(this,cg,setTimeout(()=>{BI(this,cg,null),la(this,Ag).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Dg))}),Yg.addEventListener("mouseleave",()=>{var Fg;clearTimeout(la(this,cg)),BI(this,cg,null),(Fg=la(this,Ag))==null||Fg.classList.remove("show")})}Yg.classList.add("done"),xg.innerText=la(this,Cg)?await Rg._l10nPromise.get("editor_alt_text_decorative_tooltip"):la(this,sg),xg.parentNode||Yg.append(xg)},Hb=function(Yg){if(!this._isDraggable)return;const xg=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let Og,Kg;xg&&(Og={passive:!0,capture:!0},Kg=Fg=>{const[Tg,Jg]=this.screenToPageTranslation(Fg.movementX,Fg.movementY);this._uiManager.dragSelectedEditors(Tg,Jg)},window.addEventListener("pointermove",Kg,Og));const Dg=()=>{if(window.removeEventListener("pointerup",Dg),window.removeEventListener("blur",Dg),xg&&window.removeEventListener("pointermove",Kg,Og),BI(this,mg,!1),!this._uiManager.endDragSession()){const{isMac:Fg}=ng.FeatureTest.platform;Yg.ctrlKey&&!Fg||Yg.shiftKey||Yg.metaKey&&Fg?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Dg),window.addEventListener("blur",Dg)},yI(Rg,Bg),tl(Rg,"_borderLineWidth",-1),tl(Rg,"_colorManager",new ig.ColorManager),tl(Rg,"_zIndex",1),tl(Rg,"SMALL_EDITOR_SIZE",0);let ag=Rg;eg.AnnotationEditor=ag;class Ig extends ag{constructor(Yg){super(Yg),this.annotationElementId=Yg.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}}),((tg,eg,gg)=>{var rg,ug,dg,bg,mg,h0,fg,wg,Gg,Zg,yg,jb,$g,Ng,vg,Xg,Vg,Mg,Rg,Sg,Yg,xg,Og,Kg,Dg,Fg,Tg,Jg,Eg,co,da,ma,pa,eI,Qg,Ca,uo,eo,no,kg,Lg,Pg,ua,ya,oI,iI,oa,Fb,p0,w0,_d,Z0,f0,uc,Nd,xb,Kb,G0,vd,y0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.KeyboardManager=eg.CommandManager=eg.ColorManager=eg.AnnotationEditorUIManager=void 0,eg.bindEvents=og,eg.opacityToHex=ag;var ig=gg(1),ng=gg(6);function og(jg,lo,sa){for(const qg of sa)lo.addEventListener(qg,jg[qg].bind(jg))}function ag(jg){return Math.round(Math.min(255,Math.max(1,255*jg))).toString(16).padStart(2,"0")}class Ig{constructor(){yI(this,rg,0)}getId(){return`${ig.AnnotationEditorPrefix}${Wd(this,rg)._++}`}}rg=new WeakMap;const pg=class pg{constructor(){yI(this,mg);yI(this,ug,(0,ig.getUuid)());yI(this,dg,0);yI(this,bg,null)}static get _isSVGFittingCanvas(){const lo='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',qg=new OffscreenCanvas(1,3).getContext("2d"),ga=new Image;ga.src=lo;const va=ga.decode().then(()=>(qg.drawImage(ga,0,0,1,1,0,0,1,3),new Uint32Array(qg.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,ig.shadow)(this,"_isSVGFittingCanvas",va)}async getFromFile(lo){const{lastModified:sa,name:qg,size:ga,type:va}=lo;return ZI(this,mg,h0).call(this,`${sa}_${qg}_${ga}_${va}`,lo)}async getFromUrl(lo){return ZI(this,mg,h0).call(this,lo,lo)}async getFromId(lo){la(this,bg)||BI(this,bg,new Map);const sa=la(this,bg).get(lo);return sa?sa.bitmap?(sa.refCounter+=1,sa):sa.file?this.getFromFile(sa.file):this.getFromUrl(sa.url):null}getSvgUrl(lo){const sa=la(this,bg).get(lo);return sa!=null&&sa.isSvg?sa.svgUrl:null}deleteId(lo){la(this,bg)||BI(this,bg,new Map);const sa=la(this,bg).get(lo);sa&&(sa.refCounter-=1,sa.refCounter===0&&(sa.bitmap=null))}isValidId(lo){return lo.startsWith(`image_${la(this,ug)}_`)}};ug=new WeakMap,dg=new WeakMap,bg=new WeakMap,mg=new WeakSet,h0=async function(lo,sa){la(this,bg)||BI(this,bg,new Map);let qg=la(this,bg).get(lo);if(qg===null)return null;if(qg!=null&&qg.bitmap)return qg.refCounter+=1,qg;try{qg||(qg={bitmap:null,id:`image_${la(this,ug)}_${Wd(this,dg)._++}`,refCounter:0,isSvg:!1});let ga;if(typeof sa=="string"){qg.url=sa;const va=await fetch(sa);if(!va.ok)throw new Error(va.statusText);ga=await va.blob()}else ga=qg.file=sa;if(ga.type==="image/svg+xml"){const va=pg._isSVGFittingCanvas,sI=new FileReader,aa=new Image,_g=new Promise((xa,lI)=>{aa.onload=()=>{qg.bitmap=aa,qg.isSvg=!0,xa()},sI.onload=async()=>{const gI=qg.svgUrl=sI.result;aa.src=await va?`${gI}#svgView(preserveAspectRatio(none))`:gI},aa.onerror=sI.onerror=lI});sI.readAsDataURL(ga),await _g}else qg.bitmap=await createImageBitmap(ga);qg.refCounter=1}catch(ga){console.error(ga),qg=null}return la(this,bg).set(lo,qg),qg&&la(this,bg).set(qg.id,qg),qg};let sg=pg;class Cg{constructor(lo=128){yI(this,fg,[]);yI(this,wg,!1);yI(this,Gg);yI(this,Zg,-1);BI(this,Gg,lo)}add({cmd:lo,undo:sa,mustExec:qg,type:ga=NaN,overwriteIfSameType:va=!1,keepUndo:sI=!1}){if(qg&&lo(),la(this,wg))return;const aa={cmd:lo,undo:sa,type:ga};if(la(this,Zg)===-1){la(this,fg).length>0&&(la(this,fg).length=0),BI(this,Zg,0),la(this,fg).push(aa);return}if(va&&la(this,fg)[la(this,Zg)].type===ga){sI&&(aa.undo=la(this,fg)[la(this,Zg)].undo),la(this,fg)[la(this,Zg)]=aa;return}const _g=la(this,Zg)+1;_g===la(this,Gg)?la(this,fg).splice(0,1):(BI(this,Zg,_g),_g<la(this,fg).length&&la(this,fg).splice(_g)),la(this,fg).push(aa)}undo(){la(this,Zg)!==-1&&(BI(this,wg,!0),la(this,fg)[la(this,Zg)].undo(),BI(this,wg,!1),BI(this,Zg,la(this,Zg)-1))}redo(){la(this,Zg)<la(this,fg).length-1&&(BI(this,Zg,la(this,Zg)+1),BI(this,wg,!0),la(this,fg)[la(this,Zg)].cmd(),BI(this,wg,!1))}hasSomethingToUndo(){return la(this,Zg)!==-1}hasSomethingToRedo(){return la(this,Zg)<la(this,fg).length-1}destroy(){BI(this,fg,null)}}fg=new WeakMap,wg=new WeakMap,Gg=new WeakMap,Zg=new WeakMap,eg.CommandManager=Cg;class lg{constructor(lo){yI(this,yg);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:sa}=ig.FeatureTest.platform;for(const[qg,ga,va={}]of lo)for(const sI of qg){const aa=sI.startsWith("mac+");sa&&aa?(this.callbacks.set(sI.slice(4),{callback:ga,options:va}),this.allKeys.add(sI.split("+").at(-1))):!sa&&!aa&&(this.callbacks.set(sI,{callback:ga,options:va}),this.allKeys.add(sI.split("+").at(-1)))}}exec(lo,sa){if(!this.allKeys.has(sa.key))return;const qg=this.callbacks.get(ZI(this,yg,jb).call(this,sa));if(!qg)return;const{callback:ga,options:{bubbles:va=!1,args:sI=[],checker:aa=null}}=qg;aa&&!aa(lo,sa)||(ga.bind(lo,...sI)(),va||(sa.stopPropagation(),sa.preventDefault()))}}yg=new WeakSet,jb=function(lo){lo.altKey&&this.buffer.push("alt"),lo.ctrlKey&&this.buffer.push("ctrl"),lo.metaKey&&this.buffer.push("meta"),lo.shiftKey&&this.buffer.push("shift"),this.buffer.push(lo.key);const sa=this.buffer.join("+");return this.buffer.length=0,sa},eg.KeyboardManager=lg;const Wg=class Wg{get _colors(){const lo=new Map([["CanvasText",null],["Canvas",null]]);return(0,ng.getColorValues)(lo),(0,ig.shadow)(this,"_colors",lo)}convert(lo){const sa=(0,ng.getRGB)(lo);if(!window.matchMedia("(forced-colors: active)").matches)return sa;for(const[qg,ga]of this._colors)if(ga.every((va,sI)=>va===sa[sI]))return Wg._colorsMapping.get(qg);return sa}getHexCode(lo){const sa=this._colors.get(lo);return sa?ig.Util.makeHexColor(...sa):lo}};tl(Wg,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let Ag=Wg;eg.ColorManager=Ag;const tI=class tI{constructor(lo,sa,qg,ga,va,sI){yI(this,oa);yI(this,$g,null);yI(this,Ng,new Map);yI(this,vg,new Map);yI(this,Xg,null);yI(this,Vg,null);yI(this,Mg,new Cg);yI(this,Rg,0);yI(this,Sg,new Set);yI(this,Yg,null);yI(this,xg,null);yI(this,Og,new Set);yI(this,Kg,null);yI(this,Dg,new Ig);yI(this,Fg,!1);yI(this,Tg,!1);yI(this,Jg,null);yI(this,Eg,ig.AnnotationEditorType.NONE);yI(this,co,new Set);yI(this,da,null);yI(this,ma,this.blur.bind(this));yI(this,pa,this.focus.bind(this));yI(this,eI,this.copy.bind(this));yI(this,Qg,this.cut.bind(this));yI(this,Ca,this.paste.bind(this));yI(this,uo,this.keydown.bind(this));yI(this,eo,this.onEditingAction.bind(this));yI(this,no,this.onPageChanging.bind(this));yI(this,kg,this.onScaleChanging.bind(this));yI(this,Lg,this.onRotationChanging.bind(this));yI(this,Pg,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});yI(this,ua,[0,0]);yI(this,ya,null);yI(this,oI,null);yI(this,iI,null);BI(this,oI,lo),BI(this,iI,sa),BI(this,Xg,qg),this._eventBus=ga,this._eventBus._on("editingaction",la(this,eo)),this._eventBus._on("pagechanging",la(this,no)),this._eventBus._on("scalechanging",la(this,kg)),this._eventBus._on("rotationchanging",la(this,Lg)),BI(this,Vg,va.annotationStorage),BI(this,Kg,va.filterFactory),BI(this,da,sI),this.viewParameters={realScale:ng.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const lo=tI.prototype,sa=va=>{const{activeElement:sI}=document;return sI&&la(va,oI).contains(sI)&&va.hasSomethingToControl()},qg=this.TRANSLATE_SMALL,ga=this.TRANSLATE_BIG;return(0,ig.shadow)(this,"_keyboardManager",new lg([[["ctrl+a","mac+meta+a"],lo.selectAll],[["ctrl+z","mac+meta+z"],lo.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],lo.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],lo.delete],[["Escape","mac+Escape"],lo.unselectAll],[["ArrowLeft","mac+ArrowLeft"],lo.translateSelectedEditors,{args:[-qg,0],checker:sa}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],lo.translateSelectedEditors,{args:[-ga,0],checker:sa}],[["ArrowRight","mac+ArrowRight"],lo.translateSelectedEditors,{args:[qg,0],checker:sa}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],lo.translateSelectedEditors,{args:[ga,0],checker:sa}],[["ArrowUp","mac+ArrowUp"],lo.translateSelectedEditors,{args:[0,-qg],checker:sa}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],lo.translateSelectedEditors,{args:[0,-ga],checker:sa}],[["ArrowDown","mac+ArrowDown"],lo.translateSelectedEditors,{args:[0,qg],checker:sa}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],lo.translateSelectedEditors,{args:[0,ga],checker:sa}]]))}destroy(){ZI(this,oa,_d).call(this),ZI(this,oa,p0).call(this),this._eventBus._off("editingaction",la(this,eo)),this._eventBus._off("pagechanging",la(this,no)),this._eventBus._off("scalechanging",la(this,kg)),this._eventBus._off("rotationchanging",la(this,Lg));for(const lo of la(this,vg).values())lo.destroy();la(this,vg).clear(),la(this,Ng).clear(),la(this,Og).clear(),BI(this,$g,null),la(this,co).clear(),la(this,Mg).destroy(),la(this,Xg).destroy()}get hcmFilter(){return(0,ig.shadow)(this,"hcmFilter",la(this,da)?la(this,Kg).addHCMFilter(la(this,da).foreground,la(this,da).background):"none")}get direction(){return(0,ig.shadow)(this,"direction",getComputedStyle(la(this,oI)).direction)}editAltText(lo){var sa;(sa=la(this,Xg))==null||sa.editAltText(this,lo)}onPageChanging({pageNumber:lo}){BI(this,Rg,lo-1)}focusMainContainer(){la(this,oI).focus()}findParent(lo,sa){for(const qg of la(this,vg).values()){const{x:ga,y:va,width:sI,height:aa}=qg.div.getBoundingClientRect();if(lo>=ga&&lo<=ga+sI&&sa>=va&&sa<=va+aa)return qg}return null}disableUserSelect(lo=!1){la(this,iI).classList.toggle("noUserSelect",lo)}addShouldRescale(lo){la(this,Og).add(lo)}removeShouldRescale(lo){la(this,Og).delete(lo)}onScaleChanging({scale:lo}){this.commitOrRemove(),this.viewParameters.realScale=lo*ng.PixelsPerInch.PDF_TO_CSS_UNITS;for(const sa of la(this,Og))sa.onScaleChanging()}onRotationChanging({pagesRotation:lo}){this.commitOrRemove(),this.viewParameters.rotation=lo}addToAnnotationStorage(lo){!lo.isEmpty()&&la(this,Vg)&&!la(this,Vg).has(lo.id)&&la(this,Vg).setValue(lo.id,lo)}blur(){if(!this.hasSelection)return;const{activeElement:lo}=document;for(const sa of la(this,co))if(sa.div.contains(lo)){BI(this,Jg,[sa,lo]),sa._focusEventsAllowed=!1;break}}focus(){if(!la(this,Jg))return;const[lo,sa]=la(this,Jg);BI(this,Jg,null),sa.addEventListener("focusin",()=>{lo._focusEventsAllowed=!0},{once:!0}),sa.focus()}addEditListeners(){ZI(this,oa,w0).call(this),ZI(this,oa,Z0).call(this)}removeEditListeners(){ZI(this,oa,_d).call(this),ZI(this,oa,f0).call(this)}copy(lo){var qg;if(lo.preventDefault(),(qg=la(this,$g))==null||qg.commitOrRemove(),!this.hasSelection)return;const sa=[];for(const ga of la(this,co)){const va=ga.serialize(!0);va&&sa.push(va)}sa.length!==0&&lo.clipboardData.setData("application/pdfjs",JSON.stringify(sa))}cut(lo){this.copy(lo),this.delete()}paste(lo){lo.preventDefault();const{clipboardData:sa}=lo;for(const va of sa.items)for(const sI of la(this,xg))if(sI.isHandlingMimeForPasting(va.type)){sI.paste(va,this.currentLayer);return}let qg=sa.getData("application/pdfjs");if(!qg)return;try{qg=JSON.parse(qg)}catch(va){(0,ig.warn)(`paste: "${va.message}".`);return}if(!Array.isArray(qg))return;this.unselectAll();const ga=this.currentLayer;try{const va=[];for(const _g of qg){const xa=ga.deserialize(_g);if(!xa)return;va.push(xa)}const sI=()=>{for(const _g of va)ZI(this,oa,G0).call(this,_g);ZI(this,oa,y0).call(this,va)},aa=()=>{for(const _g of va)_g.remove()};this.addCommands({cmd:sI,undo:aa,mustExec:!0})}catch(va){(0,ig.warn)(`paste: "${va.message}".`)}}keydown(lo){var sa;(sa=this.getActive())!=null&&sa.shouldGetKeyboardEvents()||tI._keyboardManager.exec(this,lo)}onEditingAction(lo){["undo","redo","delete","selectAll"].includes(lo.name)&&this[lo.name]()}setEditingState(lo){lo?(ZI(this,oa,Fb).call(this),ZI(this,oa,w0).call(this),ZI(this,oa,Z0).call(this),ZI(this,oa,uc).call(this,{isEditing:la(this,Eg)!==ig.AnnotationEditorType.NONE,isEmpty:ZI(this,oa,vd).call(this),hasSomethingToUndo:la(this,Mg).hasSomethingToUndo(),hasSomethingToRedo:la(this,Mg).hasSomethingToRedo(),hasSelectedEditor:!1})):(ZI(this,oa,p0).call(this),ZI(this,oa,_d).call(this),ZI(this,oa,f0).call(this),ZI(this,oa,uc).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(lo){if(!la(this,xg)){BI(this,xg,lo);for(const sa of la(this,xg))ZI(this,oa,Nd).call(this,sa.defaultPropertiesToUpdate)}}getId(){return la(this,Dg).getId()}get currentLayer(){return la(this,vg).get(la(this,Rg))}getLayer(lo){return la(this,vg).get(lo)}get currentPageIndex(){return la(this,Rg)}addLayer(lo){la(this,vg).set(lo.pageIndex,lo),la(this,Fg)?lo.enable():lo.disable()}removeLayer(lo){la(this,vg).delete(lo.pageIndex)}updateMode(lo,sa=null){if(la(this,Eg)!==lo){if(BI(this,Eg,lo),lo===ig.AnnotationEditorType.NONE){this.setEditingState(!1),ZI(this,oa,Kb).call(this);return}this.setEditingState(!0),ZI(this,oa,xb).call(this),this.unselectAll();for(const qg of la(this,vg).values())qg.updateMode(lo);if(sa){for(const qg of la(this,Ng).values())if(qg.annotationElementId===sa){this.setSelected(qg),qg.enterInEditMode();break}}}}updateToolbar(lo){lo!==la(this,Eg)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:lo})}updateParams(lo,sa){if(la(this,xg)){if(lo===ig.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(lo);return}for(const qg of la(this,co))qg.updateParams(lo,sa);for(const qg of la(this,xg))qg.updateDefaultParams(lo,sa)}}enableWaiting(lo=!1){if(la(this,Tg)!==lo){BI(this,Tg,lo);for(const sa of la(this,vg).values())lo?sa.disableClick():sa.enableClick(),sa.div.classList.toggle("waiting",lo)}}getEditors(lo){const sa=[];for(const qg of la(this,Ng).values())qg.pageIndex===lo&&sa.push(qg);return sa}getEditor(lo){return la(this,Ng).get(lo)}addEditor(lo){la(this,Ng).set(lo.id,lo)}removeEditor(lo){var sa;la(this,Ng).delete(lo.id),this.unselect(lo),(!lo.annotationElementId||!la(this,Sg).has(lo.annotationElementId))&&((sa=la(this,Vg))==null||sa.remove(lo.id))}addDeletedAnnotationElement(lo){la(this,Sg).add(lo.annotationElementId),lo.deleted=!0}isDeletedAnnotationElement(lo){return la(this,Sg).has(lo)}removeDeletedAnnotationElement(lo){la(this,Sg).delete(lo.annotationElementId),lo.deleted=!1}setActiveEditor(lo){la(this,$g)!==lo&&(BI(this,$g,lo),lo&&ZI(this,oa,Nd).call(this,lo.propertiesToUpdate))}toggleSelected(lo){if(la(this,co).has(lo)){la(this,co).delete(lo),lo.unselect(),ZI(this,oa,uc).call(this,{hasSelectedEditor:this.hasSelection});return}la(this,co).add(lo),lo.select(),ZI(this,oa,Nd).call(this,lo.propertiesToUpdate),ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})}setSelected(lo){for(const sa of la(this,co))sa!==lo&&sa.unselect();la(this,co).clear(),la(this,co).add(lo),lo.select(),ZI(this,oa,Nd).call(this,lo.propertiesToUpdate),ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})}isSelected(lo){return la(this,co).has(lo)}unselect(lo){lo.unselect(),la(this,co).delete(lo),ZI(this,oa,uc).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return la(this,co).size!==0}undo(){la(this,Mg).undo(),ZI(this,oa,uc).call(this,{hasSomethingToUndo:la(this,Mg).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:ZI(this,oa,vd).call(this)})}redo(){la(this,Mg).redo(),ZI(this,oa,uc).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:la(this,Mg).hasSomethingToRedo(),isEmpty:ZI(this,oa,vd).call(this)})}addCommands(lo){la(this,Mg).add(lo),ZI(this,oa,uc).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:ZI(this,oa,vd).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const lo=[...la(this,co)],sa=()=>{for(const ga of lo)ga.remove()},qg=()=>{for(const ga of lo)ZI(this,oa,G0).call(this,ga)};this.addCommands({cmd:sa,undo:qg,mustExec:!0})}commitOrRemove(){var lo;(lo=la(this,$g))==null||lo.commitOrRemove()}hasSomethingToControl(){return la(this,$g)||this.hasSelection}selectAll(){for(const lo of la(this,co))lo.commit();ZI(this,oa,y0).call(this,la(this,Ng).values())}unselectAll(){if(la(this,$g)){la(this,$g).commitOrRemove();return}if(this.hasSelection){for(const lo of la(this,co))lo.unselect();la(this,co).clear(),ZI(this,oa,uc).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(lo,sa,qg=!1){if(qg||this.commitOrRemove(),!this.hasSelection)return;la(this,ua)[0]+=lo,la(this,ua)[1]+=sa;const[ga,va]=la(this,ua),sI=[...la(this,co)],aa=1e3;la(this,ya)&&clearTimeout(la(this,ya)),BI(this,ya,setTimeout(()=>{BI(this,ya,null),la(this,ua)[0]=la(this,ua)[1]=0,this.addCommands({cmd:()=>{for(const _g of sI)la(this,Ng).has(_g.id)&&_g.translateInPage(ga,va)},undo:()=>{for(const _g of sI)la(this,Ng).has(_g.id)&&_g.translateInPage(-ga,-va)},mustExec:!1})},aa));for(const _g of sI)_g.translateInPage(lo,sa)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),BI(this,Yg,new Map);for(const lo of la(this,co))la(this,Yg).set(lo,{savedX:lo.x,savedY:lo.y,savedPageIndex:lo.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!la(this,Yg))return!1;this.disableUserSelect(!1);const lo=la(this,Yg);BI(this,Yg,null);let sa=!1;for(const[{x:ga,y:va,pageIndex:sI},aa]of lo)aa.newX=ga,aa.newY=va,aa.newPageIndex=sI,sa||(sa=ga!==aa.savedX||va!==aa.savedY||sI!==aa.savedPageIndex);if(!sa)return!1;const qg=(ga,va,sI,aa)=>{if(la(this,Ng).has(ga.id)){const _g=la(this,vg).get(aa);_g?ga._setParentAndPosition(_g,va,sI):(ga.pageIndex=aa,ga.x=va,ga.y=sI)}};return this.addCommands({cmd:()=>{for(const[ga,{newX:va,newY:sI,newPageIndex:aa}]of lo)qg(ga,va,sI,aa)},undo:()=>{for(const[ga,{savedX:va,savedY:sI,savedPageIndex:aa}]of lo)qg(ga,va,sI,aa)},mustExec:!0}),!0}dragSelectedEditors(lo,sa){if(la(this,Yg))for(const qg of la(this,Yg).keys())qg.drag(lo,sa)}rebuild(lo){if(lo.parent===null){const sa=this.getLayer(lo.pageIndex);sa?(sa.changeParent(lo),sa.addOrRebuild(lo)):(this.addEditor(lo),this.addToAnnotationStorage(lo),lo.rebuild())}else lo.parent.addOrRebuild(lo)}isActive(lo){return la(this,$g)===lo}getActive(){return la(this,$g)}getMode(){return la(this,Eg)}get imageManager(){return(0,ig.shadow)(this,"imageManager",new sg)}};$g=new WeakMap,Ng=new WeakMap,vg=new WeakMap,Xg=new WeakMap,Vg=new WeakMap,Mg=new WeakMap,Rg=new WeakMap,Sg=new WeakMap,Yg=new WeakMap,xg=new WeakMap,Og=new WeakMap,Kg=new WeakMap,Dg=new WeakMap,Fg=new WeakMap,Tg=new WeakMap,Jg=new WeakMap,Eg=new WeakMap,co=new WeakMap,da=new WeakMap,ma=new WeakMap,pa=new WeakMap,eI=new WeakMap,Qg=new WeakMap,Ca=new WeakMap,uo=new WeakMap,eo=new WeakMap,no=new WeakMap,kg=new WeakMap,Lg=new WeakMap,Pg=new WeakMap,ua=new WeakMap,ya=new WeakMap,oI=new WeakMap,iI=new WeakMap,oa=new WeakSet,Fb=function(){window.addEventListener("focus",la(this,pa)),window.addEventListener("blur",la(this,ma))},p0=function(){window.removeEventListener("focus",la(this,pa)),window.removeEventListener("blur",la(this,ma))},w0=function(){window.addEventListener("keydown",la(this,uo),{capture:!0})},_d=function(){window.removeEventListener("keydown",la(this,uo),{capture:!0})},Z0=function(){document.addEventListener("copy",la(this,eI)),document.addEventListener("cut",la(this,Qg)),document.addEventListener("paste",la(this,Ca))},f0=function(){document.removeEventListener("copy",la(this,eI)),document.removeEventListener("cut",la(this,Qg)),document.removeEventListener("paste",la(this,Ca))},uc=function(lo){Object.entries(lo).some(([qg,ga])=>la(this,Pg)[qg]!==ga)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(la(this,Pg),lo)})},Nd=function(lo){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:lo})},xb=function(){if(!la(this,Fg)){BI(this,Fg,!0);for(const lo of la(this,vg).values())lo.enable()}},Kb=function(){if(this.unselectAll(),la(this,Fg)){BI(this,Fg,!1);for(const lo of la(this,vg).values())lo.disable()}},G0=function(lo){const sa=la(this,vg).get(lo.pageIndex);sa?sa.addOrRebuild(lo):this.addEditor(lo)},vd=function(){if(la(this,Ng).size===0)return!0;if(la(this,Ng).size===1)for(const lo of la(this,Ng).values())return lo.isEmpty();return!1},y0=function(lo){la(this,co).clear();for(const sa of lo)sa.isEmpty()||(la(this,co).add(sa),sa.select());ZI(this,oa,uc).call(this,{hasSelectedEditor:!0})},tl(tI,"TRANSLATE_SMALL",1),tl(tI,"TRANSLATE_BIG",10);let cg=tI;eg.AnnotationEditorUIManager=cg}),((tg,eg,gg)=>{var Rg,Sg,Yg,xg,Og,Kg,Dg,Fg,Tg,Jg,Eg,co,ld,Cd,$0,Qd,Ud,Vd,Yd;Object.defineProperty(eg,"__esModule",{value:!0}),eg.StatTimer=eg.RenderingCancelledException=eg.PixelsPerInch=eg.PageViewport=eg.PDFDateString=eg.DOMStandardFontDataFactory=eg.DOMSVGFactory=eg.DOMFilterFactory=eg.DOMCanvasFactory=eg.DOMCMapReaderFactory=void 0,eg.deprecated=Zg,eg.getColorValues=Ng,eg.getCurrentTransform=vg,eg.getCurrentTransformInverse=Xg,eg.getFilenameFromUrl=mg,eg.getPdfFilenameFromUrl=hg,eg.getRGB=$g,eg.getXfaPageViewport=Wg,eg.isDataScheme=dg,eg.isPdfFile=bg,eg.isValidFetchUrl=fg,eg.loadScript=Gg,eg.noContextMenu=wg,eg.setLayerDimensions=Vg;var ig=gg(7),ng=gg(1);const og="http://www.w3.org/2000/svg",Mg=class Mg{};tl(Mg,"CSS",96),tl(Mg,"PDF",72),tl(Mg,"PDF_TO_CSS_UNITS",Mg.CSS/Mg.PDF);let ag=Mg;eg.PixelsPerInch=ag;class Ig extends ig.BaseFilterFactory{constructor({docId:kg,ownerDocument:Lg=globalThis.document}={}){super();yI(this,co);yI(this,Rg);yI(this,Sg);yI(this,Yg);yI(this,xg);yI(this,Og);yI(this,Kg);yI(this,Dg);yI(this,Fg);yI(this,Tg);yI(this,Jg);yI(this,Eg,0);BI(this,Yg,kg),BI(this,xg,Lg)}addFilter(kg){if(!kg)return"none";let Lg=la(this,co,ld).get(kg);if(Lg)return Lg;let Pg,ua,ya,oI;if(kg.length===1){const nI=kg[0],cI=new Array(256);for(let dI=0;dI<256;dI++)cI[dI]=nI[dI]/255;oI=Pg=ua=ya=cI.join(",")}else{const[nI,cI,dI]=kg,pI=new Array(256),Ug=new Array(256),La=new Array(256);for(let aI=0;aI<256;aI++)pI[aI]=nI[aI]/255,Ug[aI]=cI[aI]/255,La[aI]=dI[aI]/255;Pg=pI.join(","),ua=Ug.join(","),ya=La.join(","),oI=`${Pg}${ua}${ya}`}if(Lg=la(this,co,ld).get(oI),Lg)return la(this,co,ld).set(kg,Lg),Lg;const iI=`g_${la(this,Yg)}_transfer_map_${Wd(this,Eg)._++}`,oa=`url(#${iI})`;la(this,co,ld).set(kg,oa),la(this,co,ld).set(oI,oa);const ha=ZI(this,co,Qd).call(this,iI);return ZI(this,co,Vd).call(this,Pg,ua,ya,ha),oa}addHCMFilter(kg,Lg){var cI;const Pg=`${kg}-${Lg}`;if(la(this,Kg)===Pg)return la(this,Dg);if(BI(this,Kg,Pg),BI(this,Dg,"none"),(cI=la(this,Og))==null||cI.remove(),!kg||!Lg)return la(this,Dg);const ua=ZI(this,co,Yd).call(this,kg);kg=ng.Util.makeHexColor(...ua);const ya=ZI(this,co,Yd).call(this,Lg);if(Lg=ng.Util.makeHexColor(...ya),la(this,co,Cd).style.color="",kg==="#000000"&&Lg==="#ffffff"||kg===Lg)return la(this,Dg);const oI=new Array(256);for(let dI=0;dI<=255;dI++){const pI=dI/255;oI[dI]=pI<=.03928?pI/12.92:((pI+.055)/1.055)**2.4}const iI=oI.join(","),oa=`g_${la(this,Yg)}_hcm_filter`,ha=BI(this,Fg,ZI(this,co,Qd).call(this,oa));ZI(this,co,Vd).call(this,iI,iI,iI,ha),ZI(this,co,$0).call(this,ha);const nI=(dI,pI)=>{const Ug=ua[dI]/255,La=ya[dI]/255,aI=new Array(pI+1);for(let CI=0;CI<=pI;CI++)aI[CI]=Ug+CI/pI*(La-Ug);return aI.join(",")};return ZI(this,co,Vd).call(this,nI(0,5),nI(1,5),nI(2,5),ha),BI(this,Dg,`url(#${oa})`),la(this,Dg)}addHighlightHCMFilter(kg,Lg,Pg,ua){var La;const ya=`${kg}-${Lg}-${Pg}-${ua}`;if(la(this,Tg)===ya)return la(this,Jg);if(BI(this,Tg,ya),BI(this,Jg,"none"),(La=la(this,Fg))==null||La.remove(),!kg||!Lg)return la(this,Jg);const[oI,iI]=[kg,Lg].map(ZI(this,co,Yd).bind(this));let oa=Math.round(.2126*oI[0]+.7152*oI[1]+.0722*oI[2]),ha=Math.round(.2126*iI[0]+.7152*iI[1]+.0722*iI[2]),[nI,cI]=[Pg,ua].map(ZI(this,co,Yd).bind(this));ha<oa&&([oa,ha,nI,cI]=[ha,oa,cI,nI]),la(this,co,Cd).style.color="";const dI=(aI,CI,fa)=>{const zg=new Array(256),Hg=(ha-oa)/fa,ca=aI/255,tI=(CI-aI)/(255*fa);let jg=0;for(let lo=0;lo<=fa;lo++){const sa=Math.round(oa+lo*Hg),qg=ca+lo*tI;for(let ga=jg;ga<=sa;ga++)zg[ga]=qg;jg=sa+1}for(let lo=jg;lo<256;lo++)zg[lo]=zg[jg-1];return zg.join(",")},pI=`g_${la(this,Yg)}_hcm_highlight_filter`,Ug=BI(this,Fg,ZI(this,co,Qd).call(this,pI));return ZI(this,co,$0).call(this,Ug),ZI(this,co,Vd).call(this,dI(nI[0],cI[0],5),dI(nI[1],cI[1],5),dI(nI[2],cI[2],5),Ug),BI(this,Jg,`url(#${pI})`),la(this,Jg)}destroy(kg=!1){kg&&(la(this,Dg)||la(this,Jg))||(la(this,Sg)&&(la(this,Sg).parentNode.parentNode.remove(),BI(this,Sg,null)),la(this,Rg)&&(la(this,Rg).clear(),BI(this,Rg,null)),BI(this,Eg,0))}}Rg=new WeakMap,Sg=new WeakMap,Yg=new WeakMap,xg=new WeakMap,Og=new WeakMap,Kg=new WeakMap,Dg=new WeakMap,Fg=new WeakMap,Tg=new WeakMap,Jg=new WeakMap,Eg=new WeakMap,co=new WeakSet,ld=function(){return la(this,Rg)||BI(this,Rg,new Map)},Cd=function(){if(!la(this,Sg)){const kg=la(this,xg).createElement("div"),{style:Lg}=kg;Lg.visibility="hidden",Lg.contain="strict",Lg.width=Lg.height=0,Lg.position="absolute",Lg.top=Lg.left=0,Lg.zIndex=-1;const Pg=la(this,xg).createElementNS(og,"svg");Pg.setAttribute("width",0),Pg.setAttribute("height",0),BI(this,Sg,la(this,xg).createElementNS(og,"defs")),kg.append(Pg),Pg.append(la(this,Sg)),la(this,xg).body.append(kg)}return la(this,Sg)},$0=function(kg){const Lg=la(this,xg).createElementNS(og,"feColorMatrix");Lg.setAttribute("type","matrix"),Lg.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),kg.append(Lg)},Qd=function(kg){const Lg=la(this,xg).createElementNS(og,"filter");return Lg.setAttribute("color-interpolation-filters","sRGB"),Lg.setAttribute("id",kg),la(this,co,Cd).append(Lg),Lg},Ud=function(kg,Lg,Pg){const ua=la(this,xg).createElementNS(og,Lg);ua.setAttribute("type","discrete"),ua.setAttribute("tableValues",Pg),kg.append(ua)},Vd=function(kg,Lg,Pg,ua){const ya=la(this,xg).createElementNS(og,"feComponentTransfer");ua.append(ya),ZI(this,co,Ud).call(this,ya,"feFuncR",kg),ZI(this,co,Ud).call(this,ya,"feFuncG",Lg),ZI(this,co,Ud).call(this,ya,"feFuncB",Pg)},Yd=function(kg){return la(this,co,Cd).style.color=kg,$g(getComputedStyle(la(this,co,Cd)).getPropertyValue("color"))},eg.DOMFilterFactory=Ig;class sg extends ig.BaseCanvasFactory{constructor({ownerDocument:no=globalThis.document}={}){super(),this._document=no}_createCanvas(no,kg){const Lg=this._document.createElement("canvas");return Lg.width=no,Lg.height=kg,Lg}}eg.DOMCanvasFactory=sg;async function Cg(eo,no=!1){if(fg(eo,document.baseURI)){const kg=await fetch(eo);if(!kg.ok)throw new Error(kg.statusText);return no?new Uint8Array(await kg.arrayBuffer()):(0,ng.stringToBytes)(await kg.text())}return new Promise((kg,Lg)=>{const Pg=new XMLHttpRequest;Pg.open("GET",eo,!0),no&&(Pg.responseType="arraybuffer"),Pg.onreadystatechange=()=>{if(Pg.readyState===XMLHttpRequest.DONE){if(Pg.status===200||Pg.status===0){let ua;if(no&&Pg.response?ua=new Uint8Array(Pg.response):!no&&Pg.responseText&&(ua=(0,ng.stringToBytes)(Pg.responseText)),ua){kg(ua);return}}Lg(new Error(Pg.statusText))}},Pg.send(null)})}class lg extends ig.BaseCMapReaderFactory{_fetchData(no,kg){return Cg(no,this.isCompressed).then(Lg=>({cMapData:Lg,compressionType:kg}))}}eg.DOMCMapReaderFactory=lg;class Ag extends ig.BaseStandardFontDataFactory{_fetchData(no){return Cg(no,!0)}}eg.DOMStandardFontDataFactory=Ag;class cg extends ig.BaseSVGFactory{_createSVG(no){return document.createElementNS(og,no)}}eg.DOMSVGFactory=cg;class rg{constructor({viewBox:no,scale:kg,rotation:Lg,offsetX:Pg=0,offsetY:ua=0,dontFlip:ya=!1}){this.viewBox=no,this.scale=kg,this.rotation=Lg,this.offsetX=Pg,this.offsetY=ua;const oI=(no[2]+no[0])/2,iI=(no[3]+no[1])/2;let oa,ha,nI,cI;switch(Lg%=360,Lg<0&&(Lg+=360),Lg){case 180:oa=-1,ha=0,nI=0,cI=1;break;case 90:oa=0,ha=1,nI=1,cI=0;break;case 270:oa=0,ha=-1,nI=-1,cI=0;break;case 0:oa=1,ha=0,nI=0,cI=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}ya&&(nI=-nI,cI=-cI);let dI,pI,Ug,La;oa===0?(dI=Math.abs(iI-no[1])*kg+Pg,pI=Math.abs(oI-no[0])*kg+ua,Ug=(no[3]-no[1])*kg,La=(no[2]-no[0])*kg):(dI=Math.abs(oI-no[0])*kg+Pg,pI=Math.abs(iI-no[1])*kg+ua,Ug=(no[2]-no[0])*kg,La=(no[3]-no[1])*kg),this.transform=[oa*kg,ha*kg,nI*kg,cI*kg,dI-oa*kg*oI-nI*kg*iI,pI-ha*kg*oI-cI*kg*iI],this.width=Ug,this.height=La}get rawDims(){const{viewBox:no}=this;return(0,ng.shadow)(this,"rawDims",{pageWidth:no[2]-no[0],pageHeight:no[3]-no[1],pageX:no[0],pageY:no[1]})}clone({scale:no=this.scale,rotation:kg=this.rotation,offsetX:Lg=this.offsetX,offsetY:Pg=this.offsetY,dontFlip:ua=!1}={}){return new rg({viewBox:this.viewBox.slice(),scale:no,rotation:kg,offsetX:Lg,offsetY:Pg,dontFlip:ua})}convertToViewportPoint(no,kg){return ng.Util.applyTransform([no,kg],this.transform)}convertToViewportRectangle(no){const kg=ng.Util.applyTransform([no[0],no[1]],this.transform),Lg=ng.Util.applyTransform([no[2],no[3]],this.transform);return[kg[0],kg[1],Lg[0],Lg[1]]}convertToPdfPoint(no,kg){return ng.Util.applyInverseTransform([no,kg],this.transform)}}eg.PageViewport=rg;class ug extends ng.BaseException{constructor(no,kg=0){super(no,"RenderingCancelledException"),this.extraDelay=kg}}eg.RenderingCancelledException=ug;function dg(eo){const no=eo.length;let kg=0;for(;kg<no&&eo[kg].trim()==="";)kg++;return eo.substring(kg,kg+5).toLowerCase()==="data:"}function bg(eo){return typeof eo=="string"&&/\.pdf$/i.test(eo)}function mg(eo,no=!1){return no||([eo]=eo.split(/[#?]/,1)),eo.substring(eo.lastIndexOf("/")+1)}function hg(eo,no="document.pdf"){if(typeof eo!="string")return no;if(dg(eo))return(0,ng.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),no;const kg=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Lg=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Pg=kg.exec(eo);let ua=Lg.exec(Pg[1])||Lg.exec(Pg[2])||Lg.exec(Pg[3]);if(ua&&(ua=ua[0],ua.includes("%")))try{ua=Lg.exec(decodeURIComponent(ua))[0]}catch{}return ua||no}class pg{constructor(){tl(this,"started",Object.create(null));tl(this,"times",[])}time(no){no in this.started&&(0,ng.warn)(`Timer is already running for ${no}`),this.started[no]=Date.now()}timeEnd(no){no in this.started||(0,ng.warn)(`Timer has not been started for ${no}`),this.times.push({name:no,start:this.started[no],end:Date.now()}),delete this.started[no]}toString(){const no=[];let kg=0;for(const{name:Lg}of this.times)kg=Math.max(Lg.length,kg);for(const{name:Lg,start:Pg,end:ua}of this.times)no.push(`${Lg.padEnd(kg)} ${ua-Pg}ms
961
961
  `);return no.join("")}}eg.StatTimer=pg;function fg(eo,no){try{const{protocol:kg}=no?new URL(eo,no):new URL(eo);return kg==="http:"||kg==="https:"}catch{return!1}}function wg(eo){eo.preventDefault()}function Gg(eo,no=!1){return new Promise((kg,Lg)=>{const Pg=document.createElement("script");Pg.src=eo,Pg.onload=function(ua){no&&Pg.remove(),kg(ua)},Pg.onerror=function(){Lg(new Error(`Cannot load script at: ${Pg.src}`))},(document.head||document.documentElement).append(Pg)})}function Zg(eo){console.log("Deprecated API usage: "+eo)}let yg;class Bg{static toDateObject(no){if(!no||typeof no!="string")return null;yg||(yg=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const kg=yg.exec(no);if(!kg)return null;const Lg=parseInt(kg[1],10);let Pg=parseInt(kg[2],10);Pg=Pg>=1&&Pg<=12?Pg-1:0;let ua=parseInt(kg[3],10);ua=ua>=1&&ua<=31?ua:1;let ya=parseInt(kg[4],10);ya=ya>=0&&ya<=23?ya:0;let oI=parseInt(kg[5],10);oI=oI>=0&&oI<=59?oI:0;let iI=parseInt(kg[6],10);iI=iI>=0&&iI<=59?iI:0;const oa=kg[7]||"Z";let ha=parseInt(kg[8],10);ha=ha>=0&&ha<=23?ha:0;let nI=parseInt(kg[9],10)||0;return nI=nI>=0&&nI<=59?nI:0,oa==="-"?(ya+=ha,oI+=nI):oa==="+"&&(ya-=ha,oI-=nI),new Date(Date.UTC(Lg,Pg,ua,ya,oI,iI))}}eg.PDFDateString=Bg;function Wg(eo,{scale:no=1,rotation:kg=0}){const{width:Lg,height:Pg}=eo.attributes.style,ua=[0,0,parseInt(Lg),parseInt(Pg)];return new rg({viewBox:ua,scale:no,rotation:kg})}function $g(eo){if(eo.startsWith("#")){const no=parseInt(eo.slice(1),16);return[(no&16711680)>>16,(no&65280)>>8,no&255]}return eo.startsWith("rgb(")?eo.slice(4,-1).split(",").map(no=>parseInt(no)):eo.startsWith("rgba(")?eo.slice(5,-1).split(",").map(no=>parseInt(no)).slice(0,3):((0,ng.warn)(`Not a valid color format: "${eo}"`),[0,0,0])}function Ng(eo){const no=document.createElement("span");no.style.visibility="hidden",document.body.append(no);for(const kg of eo.keys()){no.style.color=kg;const Lg=window.getComputedStyle(no).color;eo.set(kg,$g(Lg))}no.remove()}function vg(eo){const{a:no,b:kg,c:Lg,d:Pg,e:ua,f:ya}=eo.getTransform();return[no,kg,Lg,Pg,ua,ya]}function Xg(eo){const{a:no,b:kg,c:Lg,d:Pg,e:ua,f:ya}=eo.getTransform().invertSelf();return[no,kg,Lg,Pg,ua,ya]}function Vg(eo,no,kg=!1,Lg=!0){if(no instanceof rg){const{pageWidth:Pg,pageHeight:ua}=no.rawDims,{style:ya}=eo,oI=ng.FeatureTest.isCSSRoundSupported,iI=`var(--scale-factor) * ${Pg}px`,oa=`var(--scale-factor) * ${ua}px`,ha=oI?`round(${iI}, 1px)`:`calc(${iI})`,nI=oI?`round(${oa}, 1px)`:`calc(${oa})`;!kg||no.rotation%180===0?(ya.width=ha,ya.height=nI):(ya.width=nI,ya.height=ha)}Lg&&eo.setAttribute("data-main-rotation",no.rotation)}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.BaseStandardFontDataFactory=eg.BaseSVGFactory=eg.BaseFilterFactory=eg.BaseCanvasFactory=eg.BaseCMapReaderFactory=void 0;var ig=gg(1);class ng{constructor(){this.constructor===ng&&(0,ig.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(lg){return"none"}addHCMFilter(lg,Ag){return"none"}addHighlightHCMFilter(lg,Ag,cg,rg){return"none"}destroy(lg=!1){}}eg.BaseFilterFactory=ng;class og{constructor(){this.constructor===og&&(0,ig.unreachable)("Cannot initialize BaseCanvasFactory.")}create(lg,Ag){if(lg<=0||Ag<=0)throw new Error("Invalid canvas size");const cg=this._createCanvas(lg,Ag);return{canvas:cg,context:cg.getContext("2d")}}reset(lg,Ag,cg){if(!lg.canvas)throw new Error("Canvas is not specified");if(Ag<=0||cg<=0)throw new Error("Invalid canvas size");lg.canvas.width=Ag,lg.canvas.height=cg}destroy(lg){if(!lg.canvas)throw new Error("Canvas is not specified");lg.canvas.width=0,lg.canvas.height=0,lg.canvas=null,lg.context=null}_createCanvas(lg,Ag){(0,ig.unreachable)("Abstract method `_createCanvas` called.")}}eg.BaseCanvasFactory=og;class ag{constructor({baseUrl:lg=null,isCompressed:Ag=!0}){this.constructor===ag&&(0,ig.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=lg,this.isCompressed=Ag}async fetch({name:lg}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!lg)throw new Error("CMap name must be specified.");const Ag=this.baseUrl+lg+(this.isCompressed?".bcmap":""),cg=this.isCompressed?ig.CMapCompressionType.BINARY:ig.CMapCompressionType.NONE;return this._fetchData(Ag,cg).catch(rg=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${Ag}`)})}_fetchData(lg,Ag){(0,ig.unreachable)("Abstract method `_fetchData` called.")}}eg.BaseCMapReaderFactory=ag;class Ig{constructor({baseUrl:lg=null}){this.constructor===Ig&&(0,ig.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=lg}async fetch({filename:lg}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!lg)throw new Error("Font filename must be specified.");const Ag=`${this.baseUrl}${lg}`;return this._fetchData(Ag).catch(cg=>{throw new Error(`Unable to load font data at: ${Ag}`)})}_fetchData(lg){(0,ig.unreachable)("Abstract method `_fetchData` called.")}}eg.BaseStandardFontDataFactory=Ig;class sg{constructor(){this.constructor===sg&&(0,ig.unreachable)("Cannot initialize BaseSVGFactory.")}create(lg,Ag,cg=!1){if(lg<=0||Ag<=0)throw new Error("Invalid SVG dimensions");const rg=this._createSVG("svg:svg");return rg.setAttribute("version","1.1"),cg||(rg.setAttribute("width",`${lg}px`),rg.setAttribute("height",`${Ag}px`)),rg.setAttribute("preserveAspectRatio","none"),rg.setAttribute("viewBox",`0 0 ${lg} ${Ag}`),rg}createElement(lg){if(typeof lg!="string")throw new Error("Invalid SVG element type");return this._createSVG(lg)}_createSVG(lg){(0,ig.unreachable)("Abstract method `_createSVG` called.")}}eg.BaseSVGFactory=sg}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.MurmurHash3_64=void 0;var ig=gg(1);const ng=3285377520,og=4294901760,ag=65535;class Ig{constructor(Cg){this.h1=Cg?Cg&4294967295:ng,this.h2=Cg?Cg&4294967295:ng}update(Cg){let lg,Ag;if(typeof Cg=="string"){lg=new Uint8Array(Cg.length*2),Ag=0;for(let Zg=0,yg=Cg.length;Zg<yg;Zg++){const Bg=Cg.charCodeAt(Zg);Bg<=255?lg[Ag++]=Bg:(lg[Ag++]=Bg>>>8,lg[Ag++]=Bg&255)}}else if((0,ig.isArrayBuffer)(Cg))lg=Cg.slice(),Ag=lg.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const cg=Ag>>2,rg=Ag-cg*4,ug=new Uint32Array(lg.buffer,0,cg);let dg=0,bg=0,mg=this.h1,hg=this.h2;const pg=3432918353,fg=461845907,wg=pg&ag,Gg=fg&ag;for(let Zg=0;Zg<cg;Zg++)Zg&1?(dg=ug[Zg],dg=dg*pg&og|dg*wg&ag,dg=dg<<15|dg>>>17,dg=dg*fg&og|dg*Gg&ag,mg^=dg,mg=mg<<13|mg>>>19,mg=mg*5+3864292196):(bg=ug[Zg],bg=bg*pg&og|bg*wg&ag,bg=bg<<15|bg>>>17,bg=bg*fg&og|bg*Gg&ag,hg^=bg,hg=hg<<13|hg>>>19,hg=hg*5+3864292196);switch(dg=0,rg){case 3:dg^=lg[cg*4+2]<<16;case 2:dg^=lg[cg*4+1]<<8;case 1:dg^=lg[cg*4],dg=dg*pg&og|dg*wg&ag,dg=dg<<15|dg>>>17,dg=dg*fg&og|dg*Gg&ag,cg&1?mg^=dg:hg^=dg}this.h1=mg,this.h2=hg}hexdigest(){let Cg=this.h1,lg=this.h2;return Cg^=lg>>>1,Cg=Cg*3981806797&og|Cg*36045&ag,lg=lg*4283543511&og|((lg<<16|Cg>>>16)*2950163797&og)>>>16,Cg^=lg>>>1,Cg=Cg*444984403&og|Cg*60499&ag,lg=lg*3301882366&og|((lg<<16|Cg>>>16)*3120437893&og)>>>16,Cg^=lg>>>1,(Cg>>>0).toString(16).padStart(8,"0")+(lg>>>0).toString(16).padStart(8,"0")}}eg.MurmurHash3_64=Ig}),((tg,eg,gg)=>{var ag;Object.defineProperty(eg,"__esModule",{value:!0}),eg.FontLoader=eg.FontFaceObject=void 0;var ig=gg(1);class ng{constructor({ownerDocument:sg=globalThis.document,styleElement:Cg=null}){yI(this,ag,new Set);this._document=sg,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(sg){this.nativeFontFaces.add(sg),this._document.fonts.add(sg)}removeNativeFontFace(sg){this.nativeFontFaces.delete(sg),this._document.fonts.delete(sg)}insertRule(sg){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const Cg=this.styleElement.sheet;Cg.insertRule(sg,Cg.cssRules.length)}clear(){for(const sg of this.nativeFontFaces)this._document.fonts.delete(sg);this.nativeFontFaces.clear(),la(this,ag).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(sg){if(!(!sg||la(this,ag).has(sg.loadedName))){if((0,ig.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:Cg,src:lg,style:Ag}=sg,cg=new FontFace(Cg,lg,Ag);this.addNativeFontFace(cg);try{await cg.load(),la(this,ag).add(Cg)}catch{(0,ig.warn)(`Cannot load system font: ${sg.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(cg)}return}(0,ig.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(sg){if(sg.attached||sg.missingFile&&!sg.systemFontInfo)return;if(sg.attached=!0,sg.systemFontInfo){await this.loadSystemFont(sg.systemFontInfo);return}if(this.isFontLoadingAPISupported){const lg=sg.createNativeFontFace();if(lg){this.addNativeFontFace(lg);try{await lg.loaded}catch(Ag){throw(0,ig.warn)(`Failed to load font '${lg.family}': '${Ag}'.`),sg.disableFontFace=!0,Ag}}return}const Cg=sg.createFontFaceRule();if(Cg){if(this.insertRule(Cg),this.isSyncFontLoadingSupported)return;await new Promise(lg=>{const Ag=this._queueLoadingCallback(lg);this._prepareFontLoadEvent(sg,Ag)})}}get isFontLoadingAPISupported(){var Cg;const sg=!!((Cg=this._document)!=null&&Cg.fonts);return(0,ig.shadow)(this,"isFontLoadingAPISupported",sg)}get isSyncFontLoadingSupported(){let sg=!1;return(ig.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(sg=!0),(0,ig.shadow)(this,"isSyncFontLoadingSupported",sg)}_queueLoadingCallback(sg){function Cg(){for((0,ig.assert)(!Ag.done,"completeRequest() cannot be called twice."),Ag.done=!0;lg.length>0&&lg[0].done;){const cg=lg.shift();setTimeout(cg.callback,0)}}const{loadingRequests:lg}=this,Ag={done:!1,complete:Cg,callback:sg};return lg.push(Ag),Ag}get _loadTestFont(){const sg=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,ig.shadow)(this,"_loadTestFont",sg)}_prepareFontLoadEvent(sg,Cg){function lg($g,Ng){return $g.charCodeAt(Ng)<<24|$g.charCodeAt(Ng+1)<<16|$g.charCodeAt(Ng+2)<<8|$g.charCodeAt(Ng+3)&255}function Ag($g,Ng,vg,Xg){const Vg=$g.substring(0,Ng),Mg=$g.substring(Ng+vg);return Vg+Xg+Mg}let cg,rg;const ug=this._document.createElement("canvas");ug.width=1,ug.height=1;const dg=ug.getContext("2d");let bg=0;function mg($g,Ng){if(++bg>30){(0,ig.warn)("Load test font never loaded."),Ng();return}if(dg.font="30px "+$g,dg.fillText(".",0,20),dg.getImageData(0,0,1,1).data[3]>0){Ng();return}setTimeout(mg.bind(null,$g,Ng))}const hg=`lt${Date.now()}${this.loadTestFontId++}`;let pg=this._loadTestFont;pg=Ag(pg,976,hg.length,hg);const wg=16,Gg=1482184792;let Zg=lg(pg,wg);for(cg=0,rg=hg.length-3;cg<rg;cg+=4)Zg=Zg-Gg+lg(hg,cg)|0;cg<hg.length&&(Zg=Zg-Gg+lg(hg+"XXX",cg)|0),pg=Ag(pg,wg,4,(0,ig.string32)(Zg));const yg=`url(data:font/opentype;base64,${btoa(pg)});`,Bg=`@font-face {font-family:"${hg}";src:${yg}}`;this.insertRule(Bg);const Wg=this._document.createElement("div");Wg.style.visibility="hidden",Wg.style.width=Wg.style.height="10px",Wg.style.position="absolute",Wg.style.top=Wg.style.left="0px";for(const $g of[sg.loadedName,hg]){const Ng=this._document.createElement("span");Ng.textContent="Hi",Ng.style.fontFamily=$g,Wg.append(Ng)}this._document.body.append(Wg),mg(hg,()=>{Wg.remove(),Cg.complete()})}}ag=new WeakMap,eg.FontLoader=ng;class og{constructor(sg,{isEvalSupported:Cg=!0,disableFontFace:lg=!1,ignoreErrors:Ag=!1,inspectFont:cg=null}){this.compiledGlyphs=Object.create(null);for(const rg in sg)this[rg]=sg[rg];this.isEvalSupported=Cg!==!1,this.disableFontFace=lg===!0,this.ignoreErrors=Ag===!0,this._inspectFont=cg}createNativeFontFace(){var Cg;if(!this.data||this.disableFontFace)return null;let sg;if(!this.cssFontInfo)sg=new FontFace(this.loadedName,this.data,{});else{const lg={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(lg.style=`oblique ${this.cssFontInfo.italicAngle}deg`),sg=new FontFace(this.cssFontInfo.fontFamily,this.data,lg)}return(Cg=this._inspectFont)==null||Cg.call(this,this),sg}createFontFaceRule(){var Ag;if(!this.data||this.disableFontFace)return null;const sg=(0,ig.bytesToString)(this.data),Cg=`url(data:${this.mimetype};base64,${btoa(sg)});`;let lg;if(!this.cssFontInfo)lg=`@font-face {font-family:"${this.loadedName}";src:${Cg}}`;else{let cg=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(cg+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),lg=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${cg}src:${Cg}}`}return(Ag=this._inspectFont)==null||Ag.call(this,this,Cg),lg}getPathGenerator(sg,Cg){if(this.compiledGlyphs[Cg]!==void 0)return this.compiledGlyphs[Cg];let lg;try{lg=sg.get(this.loadedName+"_path_"+Cg)}catch(Ag){if(!this.ignoreErrors)throw Ag;return(0,ig.warn)(`getPathGenerator - ignoring character: "${Ag}".`),this.compiledGlyphs[Cg]=function(cg,rg){}}if(this.isEvalSupported&&ig.FeatureTest.isEvalSupported){const Ag=[];for(const cg of lg){const rg=cg.args!==void 0?cg.args.join(","):"";Ag.push("c.",cg.cmd,"(",rg,`);
962
962
  `)}return this.compiledGlyphs[Cg]=new Function("c","size",Ag.join(""))}return this.compiledGlyphs[Cg]=function(Ag,cg){for(const rg of lg)rg.cmd==="scale"&&(rg.args=[cg,-cg]),Ag[rg.cmd].apply(Ag,rg.args)}}}eg.FontFaceObject=og}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.NodeStandardFontDataFactory=eg.NodeFilterFactory=eg.NodeCanvasFactory=eg.NodeCMapReaderFactory=void 0;var ig=gg(7);gg(1);const ng=function(Cg){return new Promise((lg,Ag)=>{require$$5.readFile(Cg,(rg,ug)=>{if(rg||!ug){Ag(new Error(rg));return}lg(new Uint8Array(ug))})})};class og extends ig.BaseFilterFactory{}eg.NodeFilterFactory=og;class ag extends ig.BaseCanvasFactory{_createCanvas(lg,Ag){return require$$5.createCanvas(lg,Ag)}}eg.NodeCanvasFactory=ag;class Ig extends ig.BaseCMapReaderFactory{_fetchData(lg,Ag){return ng(lg).then(cg=>({cMapData:cg,compressionType:Ag}))}}eg.NodeCMapReaderFactory=Ig;class sg extends ig.BaseStandardFontDataFactory{_fetchData(lg){return ng(lg)}}eg.NodeStandardFontDataFactory=sg}),((tg,eg,gg)=>{var Sg,B0,W0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.CanvasGraphics=void 0;var ig=gg(1),ng=gg(6),og=gg(12),ag=gg(13);const Ig=16,sg=100,Cg=4096,lg=15,Ag=10,cg=1e3,rg=16;function ug(Kg,Dg){if(Kg._removeMirroring)throw new Error("Context is already forwarding operations.");Kg.__originalSave=Kg.save,Kg.__originalRestore=Kg.restore,Kg.__originalRotate=Kg.rotate,Kg.__originalScale=Kg.scale,Kg.__originalTranslate=Kg.translate,Kg.__originalTransform=Kg.transform,Kg.__originalSetTransform=Kg.setTransform,Kg.__originalResetTransform=Kg.resetTransform,Kg.__originalClip=Kg.clip,Kg.__originalMoveTo=Kg.moveTo,Kg.__originalLineTo=Kg.lineTo,Kg.__originalBezierCurveTo=Kg.bezierCurveTo,Kg.__originalRect=Kg.rect,Kg.__originalClosePath=Kg.closePath,Kg.__originalBeginPath=Kg.beginPath,Kg._removeMirroring=()=>{Kg.save=Kg.__originalSave,Kg.restore=Kg.__originalRestore,Kg.rotate=Kg.__originalRotate,Kg.scale=Kg.__originalScale,Kg.translate=Kg.__originalTranslate,Kg.transform=Kg.__originalTransform,Kg.setTransform=Kg.__originalSetTransform,Kg.resetTransform=Kg.__originalResetTransform,Kg.clip=Kg.__originalClip,Kg.moveTo=Kg.__originalMoveTo,Kg.lineTo=Kg.__originalLineTo,Kg.bezierCurveTo=Kg.__originalBezierCurveTo,Kg.rect=Kg.__originalRect,Kg.closePath=Kg.__originalClosePath,Kg.beginPath=Kg.__originalBeginPath,delete Kg._removeMirroring},Kg.save=function(){Dg.save(),this.__originalSave()},Kg.restore=function(){Dg.restore(),this.__originalRestore()},Kg.translate=function(Tg,Jg){Dg.translate(Tg,Jg),this.__originalTranslate(Tg,Jg)},Kg.scale=function(Tg,Jg){Dg.scale(Tg,Jg),this.__originalScale(Tg,Jg)},Kg.transform=function(Tg,Jg,Eg,co,da,ma){Dg.transform(Tg,Jg,Eg,co,da,ma),this.__originalTransform(Tg,Jg,Eg,co,da,ma)},Kg.setTransform=function(Tg,Jg,Eg,co,da,ma){Dg.setTransform(Tg,Jg,Eg,co,da,ma),this.__originalSetTransform(Tg,Jg,Eg,co,da,ma)},Kg.resetTransform=function(){Dg.resetTransform(),this.__originalResetTransform()},Kg.rotate=function(Tg){Dg.rotate(Tg),this.__originalRotate(Tg)},Kg.clip=function(Tg){Dg.clip(Tg),this.__originalClip(Tg)},Kg.moveTo=function(Fg,Tg){Dg.moveTo(Fg,Tg),this.__originalMoveTo(Fg,Tg)},Kg.lineTo=function(Fg,Tg){Dg.lineTo(Fg,Tg),this.__originalLineTo(Fg,Tg)},Kg.bezierCurveTo=function(Fg,Tg,Jg,Eg,co,da){Dg.bezierCurveTo(Fg,Tg,Jg,Eg,co,da),this.__originalBezierCurveTo(Fg,Tg,Jg,Eg,co,da)},Kg.rect=function(Fg,Tg,Jg,Eg){Dg.rect(Fg,Tg,Jg,Eg),this.__originalRect(Fg,Tg,Jg,Eg)},Kg.closePath=function(){Dg.closePath(),this.__originalClosePath()},Kg.beginPath=function(){Dg.beginPath(),this.__originalBeginPath()}}class dg{constructor(Dg){this.canvasFactory=Dg,this.cache=Object.create(null)}getCanvas(Dg,Fg,Tg){let Jg;return this.cache[Dg]!==void 0?(Jg=this.cache[Dg],this.canvasFactory.reset(Jg,Fg,Tg)):(Jg=this.canvasFactory.create(Fg,Tg),this.cache[Dg]=Jg),Jg}delete(Dg){delete this.cache[Dg]}clear(){for(const Dg in this.cache){const Fg=this.cache[Dg];this.canvasFactory.destroy(Fg),delete this.cache[Dg]}}}function bg(Kg,Dg,Fg,Tg,Jg,Eg,co,da,ma,pa){const[eI,Qg,Ca,uo,eo,no]=(0,ng.getCurrentTransform)(Kg);if(Qg===0&&Ca===0){const Pg=co*eI+eo,ua=Math.round(Pg),ya=da*uo+no,oI=Math.round(ya),iI=(co+ma)*eI+eo,oa=Math.abs(Math.round(iI)-ua)||1,ha=(da+pa)*uo+no,nI=Math.abs(Math.round(ha)-oI)||1;return Kg.setTransform(Math.sign(eI),0,0,Math.sign(uo),ua,oI),Kg.drawImage(Dg,Fg,Tg,Jg,Eg,0,0,oa,nI),Kg.setTransform(eI,Qg,Ca,uo,eo,no),[oa,nI]}if(eI===0&&uo===0){const Pg=da*Ca+eo,ua=Math.round(Pg),ya=co*Qg+no,oI=Math.round(ya),iI=(da+pa)*Ca+eo,oa=Math.abs(Math.round(iI)-ua)||1,ha=(co+ma)*Qg+no,nI=Math.abs(Math.round(ha)-oI)||1;return Kg.setTransform(0,Math.sign(Qg),Math.sign(Ca),0,ua,oI),Kg.drawImage(Dg,Fg,Tg,Jg,Eg,0,0,nI,oa),Kg.setTransform(eI,Qg,Ca,uo,eo,no),[nI,oa]}Kg.drawImage(Dg,Fg,Tg,Jg,Eg,co,da,ma,pa);const kg=Math.hypot(eI,Qg),Lg=Math.hypot(Ca,uo);return[kg*ma,Lg*pa]}function mg(Kg){const{width:Dg,height:Fg}=Kg;if(Dg>cg||Fg>cg)return null;const Tg=1e3,Jg=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),Eg=Dg+1;let co=new Uint8Array(Eg*(Fg+1)),da,ma,pa;const eI=Dg+7&-8;let Qg=new Uint8Array(eI*Fg),Ca=0;for(const Lg of Kg.data){let Pg=128;for(;Pg>0;)Qg[Ca++]=Lg&Pg?0:255,Pg>>=1}let uo=0;for(Ca=0,Qg[Ca]!==0&&(co[0]=1,++uo),ma=1;ma<Dg;ma++)Qg[Ca]!==Qg[Ca+1]&&(co[ma]=Qg[Ca]?2:1,++uo),Ca++;for(Qg[Ca]!==0&&(co[ma]=2,++uo),da=1;da<Fg;da++){Ca=da*eI,pa=da*Eg,Qg[Ca-eI]!==Qg[Ca]&&(co[pa]=Qg[Ca]?1:8,++uo);let Lg=(Qg[Ca]?4:0)+(Qg[Ca-eI]?8:0);for(ma=1;ma<Dg;ma++)Lg=(Lg>>2)+(Qg[Ca+1]?4:0)+(Qg[Ca-eI+1]?8:0),Jg[Lg]&&(co[pa+ma]=Jg[Lg],++uo),Ca++;if(Qg[Ca-eI]!==Qg[Ca]&&(co[pa+ma]=Qg[Ca]?2:4,++uo),uo>Tg)return null}for(Ca=eI*(Fg-1),pa=da*Eg,Qg[Ca]!==0&&(co[pa]=8,++uo),ma=1;ma<Dg;ma++)Qg[Ca]!==Qg[Ca+1]&&(co[pa+ma]=Qg[Ca]?4:8,++uo),Ca++;if(Qg[Ca]!==0&&(co[pa+ma]=4,++uo),uo>Tg)return null;const eo=new Int32Array([0,Eg,-1,0,-Eg,0,0,0,1]),no=new Path2D;for(da=0;uo&&da<=Fg;da++){let Lg=da*Eg;const Pg=Lg+Dg;for(;Lg<Pg&&!co[Lg];)Lg++;if(Lg===Pg)continue;no.moveTo(Lg%Eg,da);const ua=Lg;let ya=co[Lg];do{const oI=eo[ya];do Lg+=oI;while(!co[Lg]);const iI=co[Lg];iI!==5&&iI!==10?(ya=iI,co[Lg]=0):(ya=iI&51*ya>>4,co[Lg]&=ya>>2|ya<<2),no.lineTo(Lg%Eg,Lg/Eg|0),co[Lg]||--uo}while(ua!==Lg);--da}return Qg=null,co=null,function(Lg){Lg.save(),Lg.scale(1/Dg,-1/Fg),Lg.translate(0,-Fg),Lg.fill(no),Lg.beginPath(),Lg.restore()}}class hg{constructor(Dg,Fg){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=ig.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=ig.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=ig.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,Dg,Fg])}clone(){const Dg=Object.create(this);return Dg.clipBox=this.clipBox.slice(),Dg}setCurrentPoint(Dg,Fg){this.x=Dg,this.y=Fg}updatePathMinMax(Dg,Fg,Tg){[Fg,Tg]=ig.Util.applyTransform([Fg,Tg],Dg),this.minX=Math.min(this.minX,Fg),this.minY=Math.min(this.minY,Tg),this.maxX=Math.max(this.maxX,Fg),this.maxY=Math.max(this.maxY,Tg)}updateRectMinMax(Dg,Fg){const Tg=ig.Util.applyTransform(Fg,Dg),Jg=ig.Util.applyTransform(Fg.slice(2),Dg);this.minX=Math.min(this.minX,Tg[0],Jg[0]),this.minY=Math.min(this.minY,Tg[1],Jg[1]),this.maxX=Math.max(this.maxX,Tg[0],Jg[0]),this.maxY=Math.max(this.maxY,Tg[1],Jg[1])}updateScalingPathMinMax(Dg,Fg){ig.Util.scaleMinMax(Dg,Fg),this.minX=Math.min(this.minX,Fg[0]),this.maxX=Math.max(this.maxX,Fg[1]),this.minY=Math.min(this.minY,Fg[2]),this.maxY=Math.max(this.maxY,Fg[3])}updateCurvePathMinMax(Dg,Fg,Tg,Jg,Eg,co,da,ma,pa,eI){const Qg=ig.Util.bezierBoundingBox(Fg,Tg,Jg,Eg,co,da,ma,pa);if(eI){eI[0]=Math.min(eI[0],Qg[0],Qg[2]),eI[1]=Math.max(eI[1],Qg[0],Qg[2]),eI[2]=Math.min(eI[2],Qg[1],Qg[3]),eI[3]=Math.max(eI[3],Qg[1],Qg[3]);return}this.updateRectMinMax(Dg,Qg)}getPathBoundingBox(Dg=og.PathType.FILL,Fg=null){const Tg=[this.minX,this.minY,this.maxX,this.maxY];if(Dg===og.PathType.STROKE){Fg||(0,ig.unreachable)("Stroke bounding box must include transform.");const Jg=ig.Util.singularValueDecompose2dScale(Fg),Eg=Jg[0]*this.lineWidth/2,co=Jg[1]*this.lineWidth/2;Tg[0]-=Eg,Tg[1]-=co,Tg[2]+=Eg,Tg[3]+=co}return Tg}updateClipFromPath(){const Dg=ig.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(Dg||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(Dg){this.clipBox=Dg,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(Dg=og.PathType.FILL,Fg=null){return ig.Util.intersect(this.clipBox,this.getPathBoundingBox(Dg,Fg))}}function pg(Kg,Dg){if(typeof ImageData<"u"&&Dg instanceof ImageData){Kg.putImageData(Dg,0,0);return}const Fg=Dg.height,Tg=Dg.width,Jg=Fg%rg,Eg=(Fg-Jg)/rg,co=Jg===0?Eg:Eg+1,da=Kg.createImageData(Tg,rg);let ma=0,pa;const eI=Dg.data,Qg=da.data;let Ca,uo,eo,no;if(Dg.kind===ig.ImageKind.GRAYSCALE_1BPP){const kg=eI.byteLength,Lg=new Uint32Array(Qg.buffer,0,Qg.byteLength>>2),Pg=Lg.length,ua=Tg+7>>3,ya=4294967295,oI=ig.FeatureTest.isLittleEndian?4278190080:255;for(Ca=0;Ca<co;Ca++){for(eo=Ca<Eg?rg:Jg,pa=0,uo=0;uo<eo;uo++){const iI=kg-ma;let oa=0;const ha=iI>ua?Tg:iI*8-7,nI=ha&-8;let cI=0,dI=0;for(;oa<nI;oa+=8)dI=eI[ma++],Lg[pa++]=dI&128?ya:oI,Lg[pa++]=dI&64?ya:oI,Lg[pa++]=dI&32?ya:oI,Lg[pa++]=dI&16?ya:oI,Lg[pa++]=dI&8?ya:oI,Lg[pa++]=dI&4?ya:oI,Lg[pa++]=dI&2?ya:oI,Lg[pa++]=dI&1?ya:oI;for(;oa<ha;oa++)cI===0&&(dI=eI[ma++],cI=128),Lg[pa++]=dI&cI?ya:oI,cI>>=1}for(;pa<Pg;)Lg[pa++]=0;Kg.putImageData(da,0,Ca*rg)}}else if(Dg.kind===ig.ImageKind.RGBA_32BPP){for(uo=0,no=Tg*rg*4,Ca=0;Ca<Eg;Ca++)Qg.set(eI.subarray(ma,ma+no)),ma+=no,Kg.putImageData(da,0,uo),uo+=rg;Ca<co&&(no=Tg*Jg*4,Qg.set(eI.subarray(ma,ma+no)),Kg.putImageData(da,0,uo))}else if(Dg.kind===ig.ImageKind.RGB_24BPP)for(eo=rg,no=Tg*eo,Ca=0;Ca<co;Ca++){for(Ca>=Eg&&(eo=Jg,no=Tg*eo),pa=0,uo=no;uo--;)Qg[pa++]=eI[ma++],Qg[pa++]=eI[ma++],Qg[pa++]=eI[ma++],Qg[pa++]=255;Kg.putImageData(da,0,Ca*rg)}else throw new Error(`bad image kind: ${Dg.kind}`)}function fg(Kg,Dg){if(Dg.bitmap){Kg.drawImage(Dg.bitmap,0,0);return}const Fg=Dg.height,Tg=Dg.width,Jg=Fg%rg,Eg=(Fg-Jg)/rg,co=Jg===0?Eg:Eg+1,da=Kg.createImageData(Tg,rg);let ma=0;const pa=Dg.data,eI=da.data;for(let Qg=0;Qg<co;Qg++){const Ca=Qg<Eg?rg:Jg;({srcPos:ma}=(0,ag.convertBlackAndWhiteToRGBA)({src:pa,srcPos:ma,dest:eI,width:Tg,height:Ca,nonBlackColor:0})),Kg.putImageData(da,0,Qg*rg)}}function wg(Kg,Dg){const Fg=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const Tg of Fg)Kg[Tg]!==void 0&&(Dg[Tg]=Kg[Tg]);Kg.setLineDash!==void 0&&(Dg.setLineDash(Kg.getLineDash()),Dg.lineDashOffset=Kg.lineDashOffset)}function Gg(Kg){if(Kg.strokeStyle=Kg.fillStyle="#000000",Kg.fillRule="nonzero",Kg.globalAlpha=1,Kg.lineWidth=1,Kg.lineCap="butt",Kg.lineJoin="miter",Kg.miterLimit=10,Kg.globalCompositeOperation="source-over",Kg.font="10px sans-serif",Kg.setLineDash!==void 0&&(Kg.setLineDash([]),Kg.lineDashOffset=0),!ig.isNodeJS){const{filter:Dg}=Kg;Dg!=="none"&&Dg!==""&&(Kg.filter="none")}}function Zg(Kg,Dg,Fg,Tg){const Jg=Kg.length;for(let Eg=3;Eg<Jg;Eg+=4){const co=Kg[Eg];if(co===0)Kg[Eg-3]=Dg,Kg[Eg-2]=Fg,Kg[Eg-1]=Tg;else if(co<255){const da=255-co;Kg[Eg-3]=Kg[Eg-3]*co+Dg*da>>8,Kg[Eg-2]=Kg[Eg-2]*co+Fg*da>>8,Kg[Eg-1]=Kg[Eg-1]*co+Tg*da>>8}}}function yg(Kg,Dg,Fg){const Tg=Kg.length,Jg=1/255;for(let Eg=3;Eg<Tg;Eg+=4){const co=Fg?Fg[Kg[Eg]]:Kg[Eg];Dg[Eg]=Dg[Eg]*co*Jg|0}}function Bg(Kg,Dg,Fg){const Tg=Kg.length;for(let Jg=3;Jg<Tg;Jg+=4){const Eg=Kg[Jg-3]*77+Kg[Jg-2]*152+Kg[Jg-1]*28;Dg[Jg]=Fg?Dg[Jg]*Fg[Eg>>8]>>8:Dg[Jg]*Eg>>16}}function Wg(Kg,Dg,Fg,Tg,Jg,Eg,co,da,ma,pa,eI){const Qg=!!Eg,Ca=Qg?Eg[0]:0,uo=Qg?Eg[1]:0,eo=Qg?Eg[2]:0,no=Jg==="Luminosity"?Bg:yg,Lg=Math.min(Tg,Math.ceil(1048576/Fg));for(let Pg=0;Pg<Tg;Pg+=Lg){const ua=Math.min(Lg,Tg-Pg),ya=Kg.getImageData(da-pa,Pg+(ma-eI),Fg,ua),oI=Dg.getImageData(da,Pg+ma,Fg,ua);Qg&&Zg(ya.data,Ca,uo,eo),no(ya.data,oI.data,co),Dg.putImageData(oI,da,Pg+ma)}}function $g(Kg,Dg,Fg,Tg){const Jg=Tg[0],Eg=Tg[1],co=Tg[2]-Jg,da=Tg[3]-Eg;co===0||da===0||(Wg(Dg.context,Fg,co,da,Dg.subtype,Dg.backdrop,Dg.transferMap,Jg,Eg,Dg.offsetX,Dg.offsetY),Kg.save(),Kg.globalAlpha=1,Kg.globalCompositeOperation="source-over",Kg.setTransform(1,0,0,1,0,0),Kg.drawImage(Fg.canvas,0,0),Kg.restore())}function Ng(Kg,Dg){const Fg=ig.Util.singularValueDecompose2dScale(Kg);Fg[0]=Math.fround(Fg[0]),Fg[1]=Math.fround(Fg[1]);const Tg=Math.fround((globalThis.devicePixelRatio||1)*ng.PixelsPerInch.PDF_TO_CSS_UNITS);return Dg!==void 0?Dg:Fg[0]<=Tg||Fg[1]<=Tg}const vg=["butt","round","square"],Xg=["miter","round","bevel"],Vg={},Mg={},Og=class Og{constructor(Dg,Fg,Tg,Jg,Eg,{optionalContentConfig:co,markedContentStack:da=null},ma,pa){yI(this,Sg);this.ctx=Dg,this.current=new hg(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=Fg,this.objs=Tg,this.canvasFactory=Jg,this.filterFactory=Eg,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=da||[],this.optionalContentConfig=co,this.cachedCanvases=new dg(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=ma,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=pa,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(Dg,Fg=null){return typeof Dg=="string"?Dg.startsWith("g_")?this.commonObjs.get(Dg):this.objs.get(Dg):Fg}beginDrawing({transform:Dg,viewport:Fg,transparency:Tg=!1,background:Jg=null}){const Eg=this.ctx.canvas.width,co=this.ctx.canvas.height,da=this.ctx.fillStyle;if(this.ctx.fillStyle=Jg||"#ffffff",this.ctx.fillRect(0,0,Eg,co),this.ctx.fillStyle=da,Tg){const ma=this.cachedCanvases.getCanvas("transparent",Eg,co);this.compositeCtx=this.ctx,this.transparentCanvas=ma.canvas,this.ctx=ma.context,this.ctx.save(),this.ctx.transform(...(0,ng.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Gg(this.ctx),Dg&&(this.ctx.transform(...Dg),this.outputScaleX=Dg[0],this.outputScaleY=Dg[0]),this.ctx.transform(...Fg.transform),this.viewportScale=Fg.scale,this.baseTransform=(0,ng.getCurrentTransform)(this.ctx)}executeOperatorList(Dg,Fg,Tg,Jg){const Eg=Dg.argsArray,co=Dg.fnArray;let da=Fg||0;const ma=Eg.length;if(ma===da)return da;const pa=ma-da>Ag&&typeof Tg=="function",eI=pa?Date.now()+lg:0;let Qg=0;const Ca=this.commonObjs,uo=this.objs;let eo;for(;;){if(Jg!==void 0&&da===Jg.nextBreakPoint)return Jg.breakIt(da,Tg),da;if(eo=co[da],eo!==ig.OPS.dependency)this[eo].apply(this,Eg[da]);else for(const no of Eg[da]){const kg=no.startsWith("g_")?Ca:uo;if(!kg.has(no))return kg.get(no,Tg),da}if(da++,da===ma)return da;if(pa&&++Qg>Ag){if(Date.now()>eI)return Tg(),da;Qg=0}}}endDrawing(){ZI(this,Sg,B0).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const Dg of this._cachedBitmapsMap.values()){for(const Fg of Dg.values())typeof HTMLCanvasElement<"u"&&Fg instanceof HTMLCanvasElement&&(Fg.width=Fg.height=0);Dg.clear()}this._cachedBitmapsMap.clear(),ZI(this,Sg,W0).call(this)}_scaleImage(Dg,Fg){const Tg=Dg.width,Jg=Dg.height;let Eg=Math.max(Math.hypot(Fg[0],Fg[1]),1),co=Math.max(Math.hypot(Fg[2],Fg[3]),1),da=Tg,ma=Jg,pa="prescale1",eI,Qg;for(;Eg>2&&da>1||co>2&&ma>1;){let Ca=da,uo=ma;Eg>2&&da>1&&(Ca=da>=16384?Math.floor(da/2)-1||1:Math.ceil(da/2),Eg/=da/Ca),co>2&&ma>1&&(uo=ma>=16384?Math.floor(ma/2)-1||1:Math.ceil(ma)/2,co/=ma/uo),eI=this.cachedCanvases.getCanvas(pa,Ca,uo),Qg=eI.context,Qg.clearRect(0,0,Ca,uo),Qg.drawImage(Dg,0,0,da,ma,0,0,Ca,uo),Dg=eI.canvas,da=Ca,ma=uo,pa=pa==="prescale1"?"prescale2":"prescale1"}return{img:Dg,paintWidth:da,paintHeight:ma}}_createMaskCanvas(Dg){const Fg=this.ctx,{width:Tg,height:Jg}=Dg,Eg=this.current.fillColor,co=this.current.patternFill,da=(0,ng.getCurrentTransform)(Fg);let ma,pa,eI,Qg;if((Dg.bitmap||Dg.data)&&Dg.count>1){const oa=Dg.bitmap||Dg.data.buffer;pa=JSON.stringify(co?da:[da.slice(0,4),Eg]),ma=this._cachedBitmapsMap.get(oa),ma||(ma=new Map,this._cachedBitmapsMap.set(oa,ma));const ha=ma.get(pa);if(ha&&!co){const nI=Math.round(Math.min(da[0],da[2])+da[4]),cI=Math.round(Math.min(da[1],da[3])+da[5]);return{canvas:ha,offsetX:nI,offsetY:cI}}eI=ha}eI||(Qg=this.cachedCanvases.getCanvas("maskCanvas",Tg,Jg),fg(Qg.context,Dg));let Ca=ig.Util.transform(da,[1/Tg,0,0,-1/Jg,0,0]);Ca=ig.Util.transform(Ca,[1,0,0,1,0,-Jg]);const uo=ig.Util.applyTransform([0,0],Ca),eo=ig.Util.applyTransform([Tg,Jg],Ca),no=ig.Util.normalizeRect([uo[0],uo[1],eo[0],eo[1]]),kg=Math.round(no[2]-no[0])||1,Lg=Math.round(no[3]-no[1])||1,Pg=this.cachedCanvases.getCanvas("fillCanvas",kg,Lg),ua=Pg.context,ya=Math.min(uo[0],eo[0]),oI=Math.min(uo[1],eo[1]);ua.translate(-ya,-oI),ua.transform(...Ca),eI||(eI=this._scaleImage(Qg.canvas,(0,ng.getCurrentTransformInverse)(ua)),eI=eI.img,ma&&co&&ma.set(pa,eI)),ua.imageSmoothingEnabled=Ng((0,ng.getCurrentTransform)(ua),Dg.interpolate),bg(ua,eI,0,0,eI.width,eI.height,0,0,Tg,Jg),ua.globalCompositeOperation="source-in";const iI=ig.Util.transform((0,ng.getCurrentTransformInverse)(ua),[1,0,0,1,-ya,-oI]);return ua.fillStyle=co?Eg.getPattern(Fg,this,iI,og.PathType.FILL):Eg,ua.fillRect(0,0,Tg,Jg),ma&&!co&&(this.cachedCanvases.delete("fillCanvas"),ma.set(pa,Pg.canvas)),{canvas:Pg.canvas,offsetX:Math.round(ya),offsetY:Math.round(oI)}}setLineWidth(Dg){Dg!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=Dg,this.ctx.lineWidth=Dg}setLineCap(Dg){this.ctx.lineCap=vg[Dg]}setLineJoin(Dg){this.ctx.lineJoin=Xg[Dg]}setMiterLimit(Dg){this.ctx.miterLimit=Dg}setDash(Dg,Fg){const Tg=this.ctx;Tg.setLineDash!==void 0&&(Tg.setLineDash(Dg),Tg.lineDashOffset=Fg)}setRenderingIntent(Dg){}setFlatness(Dg){}setGState(Dg){for(const[Fg,Tg]of Dg)switch(Fg){case"LW":this.setLineWidth(Tg);break;case"LC":this.setLineCap(Tg);break;case"LJ":this.setLineJoin(Tg);break;case"ML":this.setMiterLimit(Tg);break;case"D":this.setDash(Tg[0],Tg[1]);break;case"RI":this.setRenderingIntent(Tg);break;case"FL":this.setFlatness(Tg);break;case"Font":this.setFont(Tg[0],Tg[1]);break;case"CA":this.current.strokeAlpha=Tg;break;case"ca":this.current.fillAlpha=Tg,this.ctx.globalAlpha=Tg;break;case"BM":this.ctx.globalCompositeOperation=Tg;break;case"SMask":this.current.activeSMask=Tg?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(Tg);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const Dg=this.inSMaskMode;this.current.activeSMask&&!Dg?this.beginSMaskMode():!this.current.activeSMask&&Dg&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const Dg=this.ctx.canvas.width,Fg=this.ctx.canvas.height,Tg="smaskGroupAt"+this.groupLevel,Jg=this.cachedCanvases.getCanvas(Tg,Dg,Fg);this.suspendedCtx=this.ctx,this.ctx=Jg.context;const Eg=this.ctx;Eg.setTransform(...(0,ng.getCurrentTransform)(this.suspendedCtx)),wg(this.suspendedCtx,Eg),ug(Eg,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),wg(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(Dg){if(!this.current.activeSMask)return;Dg?(Dg[0]=Math.floor(Dg[0]),Dg[1]=Math.floor(Dg[1]),Dg[2]=Math.ceil(Dg[2]),Dg[3]=Math.ceil(Dg[3])):Dg=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const Fg=this.current.activeSMask,Tg=this.suspendedCtx;$g(Tg,Fg,this.ctx,Dg),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(wg(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const Dg=this.current;this.stateStack.push(Dg),this.current=Dg.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),wg(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(Dg,Fg,Tg,Jg,Eg,co){this.ctx.transform(Dg,Fg,Tg,Jg,Eg,co),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(Dg,Fg,Tg){const Jg=this.ctx,Eg=this.current;let co=Eg.x,da=Eg.y,ma,pa;const eI=(0,ng.getCurrentTransform)(Jg),Qg=eI[0]===0&&eI[3]===0||eI[1]===0&&eI[2]===0,Ca=Qg?Tg.slice(0):null;for(let uo=0,eo=0,no=Dg.length;uo<no;uo++)switch(Dg[uo]|0){case ig.OPS.rectangle:co=Fg[eo++],da=Fg[eo++];const kg=Fg[eo++],Lg=Fg[eo++],Pg=co+kg,ua=da+Lg;Jg.moveTo(co,da),kg===0||Lg===0?Jg.lineTo(Pg,ua):(Jg.lineTo(Pg,da),Jg.lineTo(Pg,ua),Jg.lineTo(co,ua)),Qg||Eg.updateRectMinMax(eI,[co,da,Pg,ua]),Jg.closePath();break;case ig.OPS.moveTo:co=Fg[eo++],da=Fg[eo++],Jg.moveTo(co,da),Qg||Eg.updatePathMinMax(eI,co,da);break;case ig.OPS.lineTo:co=Fg[eo++],da=Fg[eo++],Jg.lineTo(co,da),Qg||Eg.updatePathMinMax(eI,co,da);break;case ig.OPS.curveTo:ma=co,pa=da,co=Fg[eo+4],da=Fg[eo+5],Jg.bezierCurveTo(Fg[eo],Fg[eo+1],Fg[eo+2],Fg[eo+3],co,da),Eg.updateCurvePathMinMax(eI,ma,pa,Fg[eo],Fg[eo+1],Fg[eo+2],Fg[eo+3],co,da,Ca),eo+=6;break;case ig.OPS.curveTo2:ma=co,pa=da,Jg.bezierCurveTo(co,da,Fg[eo],Fg[eo+1],Fg[eo+2],Fg[eo+3]),Eg.updateCurvePathMinMax(eI,ma,pa,co,da,Fg[eo],Fg[eo+1],Fg[eo+2],Fg[eo+3],Ca),co=Fg[eo+2],da=Fg[eo+3],eo+=4;break;case ig.OPS.curveTo3:ma=co,pa=da,co=Fg[eo+2],da=Fg[eo+3],Jg.bezierCurveTo(Fg[eo],Fg[eo+1],co,da,co,da),Eg.updateCurvePathMinMax(eI,ma,pa,Fg[eo],Fg[eo+1],co,da,co,da,Ca),eo+=4;break;case ig.OPS.closePath:Jg.closePath();break}Qg&&Eg.updateScalingPathMinMax(eI,Ca),Eg.setCurrentPoint(co,da)}closePath(){this.ctx.closePath()}stroke(Dg=!0){const Fg=this.ctx,Tg=this.current.strokeColor;Fg.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof Tg=="object"&&(Tg!=null&&Tg.getPattern)?(Fg.save(),Fg.strokeStyle=Tg.getPattern(Fg,this,(0,ng.getCurrentTransformInverse)(Fg),og.PathType.STROKE),this.rescaleAndStroke(!1),Fg.restore()):this.rescaleAndStroke(!0)),Dg&&this.consumePath(this.current.getClippedPathBoundingBox()),Fg.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(Dg=!0){const Fg=this.ctx,Tg=this.current.fillColor,Jg=this.current.patternFill;let Eg=!1;Jg&&(Fg.save(),Fg.fillStyle=Tg.getPattern(Fg,this,(0,ng.getCurrentTransformInverse)(Fg),og.PathType.FILL),Eg=!0);const co=this.current.getClippedPathBoundingBox();this.contentVisible&&co!==null&&(this.pendingEOFill?(Fg.fill("evenodd"),this.pendingEOFill=!1):Fg.fill()),Eg&&Fg.restore(),Dg&&this.consumePath(co)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Vg}eoClip(){this.pendingClip=Mg}beginText(){this.current.textMatrix=ig.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const Dg=this.pendingTextPaths,Fg=this.ctx;if(Dg===void 0){Fg.beginPath();return}Fg.save(),Fg.beginPath();for(const Tg of Dg)Fg.setTransform(...Tg.transform),Fg.translate(Tg.x,Tg.y),Tg.addToPath(Fg,Tg.fontSize);Fg.restore(),Fg.clip(),Fg.beginPath(),delete this.pendingTextPaths}setCharSpacing(Dg){this.current.charSpacing=Dg}setWordSpacing(Dg){this.current.wordSpacing=Dg}setHScale(Dg){this.current.textHScale=Dg/100}setLeading(Dg){this.current.leading=-Dg}setFont(Dg,Fg){var eI;const Tg=this.commonObjs.get(Dg),Jg=this.current;if(!Tg)throw new Error(`Can't find font for ${Dg}`);if(Jg.fontMatrix=Tg.fontMatrix||ig.FONT_IDENTITY_MATRIX,(Jg.fontMatrix[0]===0||Jg.fontMatrix[3]===0)&&(0,ig.warn)("Invalid font matrix for font "+Dg),Fg<0?(Fg=-Fg,Jg.fontDirection=-1):Jg.fontDirection=1,this.current.font=Tg,this.current.fontSize=Fg,Tg.isType3Font)return;const Eg=Tg.loadedName||"sans-serif",co=((eI=Tg.systemFontInfo)==null?void 0:eI.css)||`"${Eg}", ${Tg.fallbackName}`;let da="normal";Tg.black?da="900":Tg.bold&&(da="bold");const ma=Tg.italic?"italic":"normal";let pa=Fg;Fg<Ig?pa=Ig:Fg>sg&&(pa=sg),this.current.fontSizeScale=Fg/pa,this.ctx.font=`${ma} ${da} ${pa}px ${co}`}setTextRenderingMode(Dg){this.current.textRenderingMode=Dg}setTextRise(Dg){this.current.textRise=Dg}moveText(Dg,Fg){this.current.x=this.current.lineX+=Dg,this.current.y=this.current.lineY+=Fg}setLeadingMoveText(Dg,Fg){this.setLeading(-Fg),this.moveText(Dg,Fg)}setTextMatrix(Dg,Fg,Tg,Jg,Eg,co){this.current.textMatrix=[Dg,Fg,Tg,Jg,Eg,co],this.current.textMatrixScale=Math.hypot(Dg,Fg),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(Dg,Fg,Tg,Jg){const Eg=this.ctx,co=this.current,da=co.font,ma=co.textRenderingMode,pa=co.fontSize/co.fontSizeScale,eI=ma&ig.TextRenderingMode.FILL_STROKE_MASK,Qg=!!(ma&ig.TextRenderingMode.ADD_TO_PATH_FLAG),Ca=co.patternFill&&!da.missingFile;let uo;(da.disableFontFace||Qg||Ca)&&(uo=da.getPathGenerator(this.commonObjs,Dg)),da.disableFontFace||Ca?(Eg.save(),Eg.translate(Fg,Tg),Eg.beginPath(),uo(Eg,pa),Jg&&Eg.setTransform(...Jg),(eI===ig.TextRenderingMode.FILL||eI===ig.TextRenderingMode.FILL_STROKE)&&Eg.fill(),(eI===ig.TextRenderingMode.STROKE||eI===ig.TextRenderingMode.FILL_STROKE)&&Eg.stroke(),Eg.restore()):((eI===ig.TextRenderingMode.FILL||eI===ig.TextRenderingMode.FILL_STROKE)&&Eg.fillText(Dg,Fg,Tg),(eI===ig.TextRenderingMode.STROKE||eI===ig.TextRenderingMode.FILL_STROKE)&&Eg.strokeText(Dg,Fg,Tg)),Qg&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,ng.getCurrentTransform)(Eg),x:Fg,y:Tg,fontSize:pa,addToPath:uo})}get isFontSubpixelAAEnabled(){const{context:Dg}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);Dg.scale(1.5,1),Dg.fillText("I",0,10);const Fg=Dg.getImageData(0,0,10,10).data;let Tg=!1;for(let Jg=3;Jg<Fg.length;Jg+=4)if(Fg[Jg]>0&&Fg[Jg]<255){Tg=!0;break}return(0,ig.shadow)(this,"isFontSubpixelAAEnabled",Tg)}showText(Dg){const Fg=this.current,Tg=Fg.font;if(Tg.isType3Font)return this.showType3Text(Dg);const Jg=Fg.fontSize;if(Jg===0)return;const Eg=this.ctx,co=Fg.fontSizeScale,da=Fg.charSpacing,ma=Fg.wordSpacing,pa=Fg.fontDirection,eI=Fg.textHScale*pa,Qg=Dg.length,Ca=Tg.vertical,uo=Ca?1:-1,eo=Tg.defaultVMetrics,no=Jg*Fg.fontMatrix[0],kg=Fg.textRenderingMode===ig.TextRenderingMode.FILL&&!Tg.disableFontFace&&!Fg.patternFill;Eg.save(),Eg.transform(...Fg.textMatrix),Eg.translate(Fg.x,Fg.y+Fg.textRise),pa>0?Eg.scale(eI,-1):Eg.scale(eI,1);let Lg;if(Fg.patternFill){Eg.save();const iI=Fg.fillColor.getPattern(Eg,this,(0,ng.getCurrentTransformInverse)(Eg),og.PathType.FILL);Lg=(0,ng.getCurrentTransform)(Eg),Eg.restore(),Eg.fillStyle=iI}let Pg=Fg.lineWidth;const ua=Fg.textMatrixScale;if(ua===0||Pg===0){const iI=Fg.textRenderingMode&ig.TextRenderingMode.FILL_STROKE_MASK;(iI===ig.TextRenderingMode.STROKE||iI===ig.TextRenderingMode.FILL_STROKE)&&(Pg=this.getSinglePixelWidth())}else Pg/=ua;if(co!==1&&(Eg.scale(co,co),Pg/=co),Eg.lineWidth=Pg,Tg.isInvalidPDFjsFont){const iI=[];let oa=0;for(const ha of Dg)iI.push(ha.unicode),oa+=ha.width;Eg.fillText(iI.join(""),0,0),Fg.x+=oa*no*eI,Eg.restore(),this.compose();return}let ya=0,oI;for(oI=0;oI<Qg;++oI){const iI=Dg[oI];if(typeof iI=="number"){ya+=uo*iI*Jg/1e3;continue}let oa=!1;const ha=(iI.isSpace?ma:0)+da,nI=iI.fontChar,cI=iI.accent;let dI,pI,Ug=iI.width;if(Ca){const aI=iI.vmetric||eo,CI=-(iI.vmetric?aI[1]:Ug*.5)*no,fa=aI[2]*no;Ug=aI?-aI[0]:Ug,dI=CI/co,pI=(ya+fa)/co}else dI=ya/co,pI=0;if(Tg.remeasure&&Ug>0){const aI=Eg.measureText(nI).width*1e3/Jg*co;if(Ug<aI&&this.isFontSubpixelAAEnabled){const CI=Ug/aI;oa=!0,Eg.save(),Eg.scale(CI,1),dI/=CI}else Ug!==aI&&(dI+=(Ug-aI)/2e3*Jg/co)}if(this.contentVisible&&(iI.isInFont||Tg.missingFile)){if(kg&&!cI)Eg.fillText(nI,dI,pI);else if(this.paintChar(nI,dI,pI,Lg),cI){const aI=dI+Jg*cI.offset.x/co,CI=pI-Jg*cI.offset.y/co;this.paintChar(cI.fontChar,aI,CI,Lg)}}const La=Ca?Ug*no-ha*pa:Ug*no+ha*pa;ya+=La,oa&&Eg.restore()}Ca?Fg.y-=ya:Fg.x+=ya*eI,Eg.restore(),this.compose()}showType3Text(Dg){const Fg=this.ctx,Tg=this.current,Jg=Tg.font,Eg=Tg.fontSize,co=Tg.fontDirection,da=Jg.vertical?1:-1,ma=Tg.charSpacing,pa=Tg.wordSpacing,eI=Tg.textHScale*co,Qg=Tg.fontMatrix||ig.FONT_IDENTITY_MATRIX,Ca=Dg.length,uo=Tg.textRenderingMode===ig.TextRenderingMode.INVISIBLE;let eo,no,kg,Lg;if(!(uo||Eg===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,Fg.save(),Fg.transform(...Tg.textMatrix),Fg.translate(Tg.x,Tg.y),Fg.scale(eI,co),eo=0;eo<Ca;++eo){if(no=Dg[eo],typeof no=="number"){Lg=da*no*Eg/1e3,this.ctx.translate(Lg,0),Tg.x+=Lg*eI;continue}const Pg=(no.isSpace?pa:0)+ma,ua=Jg.charProcOperatorList[no.operatorListId];if(!ua){(0,ig.warn)(`Type3 character "${no.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=no,this.save(),Fg.scale(Eg,Eg),Fg.transform(...Qg),this.executeOperatorList(ua),this.restore()),kg=ig.Util.applyTransform([no.width,0],Qg)[0]*Eg+Pg,Fg.translate(kg,0),Tg.x+=kg*eI}Fg.restore(),this.processingType3=null}}setCharWidth(Dg,Fg){}setCharWidthAndBounds(Dg,Fg,Tg,Jg,Eg,co){this.ctx.rect(Tg,Jg,Eg-Tg,co-Jg),this.ctx.clip(),this.endPath()}getColorN_Pattern(Dg){let Fg;if(Dg[0]==="TilingPattern"){const Tg=Dg[1],Jg=this.baseTransform||(0,ng.getCurrentTransform)(this.ctx),Eg={createCanvasGraphics:co=>new Og(co,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};Fg=new og.TilingPattern(Dg,Tg,this.ctx,Eg,Jg)}else Fg=this._getPattern(Dg[1],Dg[2]);return Fg}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(Dg,Fg,Tg){const Jg=ig.Util.makeHexColor(Dg,Fg,Tg);this.ctx.strokeStyle=Jg,this.current.strokeColor=Jg}setFillRGBColor(Dg,Fg,Tg){const Jg=ig.Util.makeHexColor(Dg,Fg,Tg);this.ctx.fillStyle=Jg,this.current.fillColor=Jg,this.current.patternFill=!1}_getPattern(Dg,Fg=null){let Tg;return this.cachedPatterns.has(Dg)?Tg=this.cachedPatterns.get(Dg):(Tg=(0,og.getShadingPattern)(this.getObject(Dg)),this.cachedPatterns.set(Dg,Tg)),Fg&&(Tg.matrix=Fg),Tg}shadingFill(Dg){if(!this.contentVisible)return;const Fg=this.ctx;this.save();const Tg=this._getPattern(Dg);Fg.fillStyle=Tg.getPattern(Fg,this,(0,ng.getCurrentTransformInverse)(Fg),og.PathType.SHADING);const Jg=(0,ng.getCurrentTransformInverse)(Fg);if(Jg){const{width:Eg,height:co}=Fg.canvas,[da,ma,pa,eI]=ig.Util.getAxialAlignedBoundingBox([0,0,Eg,co],Jg);this.ctx.fillRect(da,ma,pa-da,eI-ma)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,ig.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,ig.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(Dg,Fg){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(Dg)&&Dg.length===6&&this.transform(...Dg),this.baseTransform=(0,ng.getCurrentTransform)(this.ctx),Fg)){const Tg=Fg[2]-Fg[0],Jg=Fg[3]-Fg[1];this.ctx.rect(Fg[0],Fg[1],Tg,Jg),this.current.updateRectMinMax((0,ng.getCurrentTransform)(this.ctx),Fg),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(Dg){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const Fg=this.ctx;Dg.isolated||(0,ig.info)("TODO: Support non-isolated groups."),Dg.knockout&&(0,ig.warn)("Knockout groups not supported.");const Tg=(0,ng.getCurrentTransform)(Fg);if(Dg.matrix&&Fg.transform(...Dg.matrix),!Dg.bbox)throw new Error("Bounding box is required.");let Jg=ig.Util.getAxialAlignedBoundingBox(Dg.bbox,(0,ng.getCurrentTransform)(Fg));const Eg=[0,0,Fg.canvas.width,Fg.canvas.height];Jg=ig.Util.intersect(Jg,Eg)||[0,0,0,0];const co=Math.floor(Jg[0]),da=Math.floor(Jg[1]);let ma=Math.max(Math.ceil(Jg[2])-co,1),pa=Math.max(Math.ceil(Jg[3])-da,1),eI=1,Qg=1;ma>Cg&&(eI=ma/Cg,ma=Cg),pa>Cg&&(Qg=pa/Cg,pa=Cg),this.current.startNewPathAndClipBox([0,0,ma,pa]);let Ca="groupAt"+this.groupLevel;Dg.smask&&(Ca+="_smask_"+this.smaskCounter++%2);const uo=this.cachedCanvases.getCanvas(Ca,ma,pa),eo=uo.context;eo.scale(1/eI,1/Qg),eo.translate(-co,-da),eo.transform(...Tg),Dg.smask?this.smaskStack.push({canvas:uo.canvas,context:eo,offsetX:co,offsetY:da,scaleX:eI,scaleY:Qg,subtype:Dg.smask.subtype,backdrop:Dg.smask.backdrop,transferMap:Dg.smask.transferMap||null,startTransformInverse:null}):(Fg.setTransform(1,0,0,1,0,0),Fg.translate(co,da),Fg.scale(eI,Qg),Fg.save()),wg(Fg,eo),this.ctx=eo,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(Fg),this.groupLevel++}endGroup(Dg){if(!this.contentVisible)return;this.groupLevel--;const Fg=this.ctx,Tg=this.groupStack.pop();if(this.ctx=Tg,this.ctx.imageSmoothingEnabled=!1,Dg.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Jg=(0,ng.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Jg);const Eg=ig.Util.getAxialAlignedBoundingBox([0,0,Fg.canvas.width,Fg.canvas.height],Jg);this.ctx.drawImage(Fg.canvas,0,0),this.ctx.restore(),this.compose(Eg)}}beginAnnotation(Dg,Fg,Tg,Jg,Eg){if(ZI(this,Sg,B0).call(this),Gg(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(Fg)&&Fg.length===4){const co=Fg[2]-Fg[0],da=Fg[3]-Fg[1];if(Eg&&this.annotationCanvasMap){Tg=Tg.slice(),Tg[4]-=Fg[0],Tg[5]-=Fg[1],Fg=Fg.slice(),Fg[0]=Fg[1]=0,Fg[2]=co,Fg[3]=da;const[ma,pa]=ig.Util.singularValueDecompose2dScale((0,ng.getCurrentTransform)(this.ctx)),{viewportScale:eI}=this,Qg=Math.ceil(co*this.outputScaleX*eI),Ca=Math.ceil(da*this.outputScaleY*eI);this.annotationCanvas=this.canvasFactory.create(Qg,Ca);const{canvas:uo,context:eo}=this.annotationCanvas;this.annotationCanvasMap.set(Dg,uo),this.annotationCanvas.savedCtx=this.ctx,this.ctx=eo,this.ctx.save(),this.ctx.setTransform(ma,0,0,-pa,0,da*pa),Gg(this.ctx)}else Gg(this.ctx),this.ctx.rect(Fg[0],Fg[1],co,da),this.ctx.clip(),this.endPath()}this.current=new hg(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...Tg),this.transform(...Jg)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),ZI(this,Sg,W0).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(Dg){if(!this.contentVisible)return;const Fg=Dg.count;Dg=this.getObject(Dg.data,Dg),Dg.count=Fg;const Tg=this.ctx,Jg=this.processingType3;if(Jg&&(Jg.compiled===void 0&&(Jg.compiled=mg(Dg)),Jg.compiled)){Jg.compiled(Tg);return}const Eg=this._createMaskCanvas(Dg),co=Eg.canvas;Tg.save(),Tg.setTransform(1,0,0,1,0,0),Tg.drawImage(co,Eg.offsetX,Eg.offsetY),Tg.restore(),this.compose()}paintImageMaskXObjectRepeat(Dg,Fg,Tg=0,Jg=0,Eg,co){if(!this.contentVisible)return;Dg=this.getObject(Dg.data,Dg);const da=this.ctx;da.save();const ma=(0,ng.getCurrentTransform)(da);da.transform(Fg,Tg,Jg,Eg,0,0);const pa=this._createMaskCanvas(Dg);da.setTransform(1,0,0,1,pa.offsetX-ma[4],pa.offsetY-ma[5]);for(let eI=0,Qg=co.length;eI<Qg;eI+=2){const Ca=ig.Util.transform(ma,[Fg,Tg,Jg,Eg,co[eI],co[eI+1]]),[uo,eo]=ig.Util.applyTransform([0,0],Ca);da.drawImage(pa.canvas,uo,eo)}da.restore(),this.compose()}paintImageMaskXObjectGroup(Dg){if(!this.contentVisible)return;const Fg=this.ctx,Tg=this.current.fillColor,Jg=this.current.patternFill;for(const Eg of Dg){const{data:co,width:da,height:ma,transform:pa}=Eg,eI=this.cachedCanvases.getCanvas("maskCanvas",da,ma),Qg=eI.context;Qg.save();const Ca=this.getObject(co,Eg);fg(Qg,Ca),Qg.globalCompositeOperation="source-in",Qg.fillStyle=Jg?Tg.getPattern(Qg,this,(0,ng.getCurrentTransformInverse)(Fg),og.PathType.FILL):Tg,Qg.fillRect(0,0,da,ma),Qg.restore(),Fg.save(),Fg.transform(...pa),Fg.scale(1,-1),bg(Fg,eI.canvas,0,0,da,ma,0,-1,1,1),Fg.restore()}this.compose()}paintImageXObject(Dg){if(!this.contentVisible)return;const Fg=this.getObject(Dg);if(!Fg){(0,ig.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(Fg)}paintImageXObjectRepeat(Dg,Fg,Tg,Jg){if(!this.contentVisible)return;const Eg=this.getObject(Dg);if(!Eg){(0,ig.warn)("Dependent image isn't ready yet");return}const co=Eg.width,da=Eg.height,ma=[];for(let pa=0,eI=Jg.length;pa<eI;pa+=2)ma.push({transform:[Fg,0,0,Tg,Jg[pa],Jg[pa+1]],x:0,y:0,w:co,h:da});this.paintInlineImageXObjectGroup(Eg,ma)}applyTransferMapsToCanvas(Dg){return this.current.transferMaps!=="none"&&(Dg.filter=this.current.transferMaps,Dg.drawImage(Dg.canvas,0,0),Dg.filter="none"),Dg.canvas}applyTransferMapsToBitmap(Dg){if(this.current.transferMaps==="none")return Dg.bitmap;const{bitmap:Fg,width:Tg,height:Jg}=Dg,Eg=this.cachedCanvases.getCanvas("inlineImage",Tg,Jg),co=Eg.context;return co.filter=this.current.transferMaps,co.drawImage(Fg,0,0),co.filter="none",Eg.canvas}paintInlineImageXObject(Dg){if(!this.contentVisible)return;const Fg=Dg.width,Tg=Dg.height,Jg=this.ctx;if(this.save(),!ig.isNodeJS){const{filter:da}=Jg;da!=="none"&&da!==""&&(Jg.filter="none")}Jg.scale(1/Fg,-1/Tg);let Eg;if(Dg.bitmap)Eg=this.applyTransferMapsToBitmap(Dg);else if(typeof HTMLElement=="function"&&Dg instanceof HTMLElement||!Dg.data)Eg=Dg;else{const ma=this.cachedCanvases.getCanvas("inlineImage",Fg,Tg).context;pg(ma,Dg),Eg=this.applyTransferMapsToCanvas(ma)}const co=this._scaleImage(Eg,(0,ng.getCurrentTransformInverse)(Jg));Jg.imageSmoothingEnabled=Ng((0,ng.getCurrentTransform)(Jg),Dg.interpolate),bg(Jg,co.img,0,0,co.paintWidth,co.paintHeight,0,-Tg,Fg,Tg),this.compose(),this.restore()}paintInlineImageXObjectGroup(Dg,Fg){if(!this.contentVisible)return;const Tg=this.ctx;let Jg;if(Dg.bitmap)Jg=Dg.bitmap;else{const Eg=Dg.width,co=Dg.height,ma=this.cachedCanvases.getCanvas("inlineImage",Eg,co).context;pg(ma,Dg),Jg=this.applyTransferMapsToCanvas(ma)}for(const Eg of Fg)Tg.save(),Tg.transform(...Eg.transform),Tg.scale(1,-1),bg(Tg,Jg,Eg.x,Eg.y,Eg.w,Eg.h,0,-1,1,1),Tg.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(Dg){}markPointProps(Dg,Fg){}beginMarkedContent(Dg){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(Dg,Fg){Dg==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(Fg)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(Dg){const Fg=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(Dg);const Tg=this.ctx;this.pendingClip&&(Fg||(this.pendingClip===Mg?Tg.clip("evenodd"):Tg.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),Tg.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const Dg=(0,ng.getCurrentTransform)(this.ctx);if(Dg[1]===0&&Dg[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(Dg[0]),Math.abs(Dg[3]));else{const Fg=Math.abs(Dg[0]*Dg[3]-Dg[2]*Dg[1]),Tg=Math.hypot(Dg[0],Dg[2]),Jg=Math.hypot(Dg[1],Dg[3]);this._cachedGetSinglePixelWidth=Math.max(Tg,Jg)/Fg}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:Dg}=this.current,{a:Fg,b:Tg,c:Jg,d:Eg}=this.ctx.getTransform();let co,da;if(Tg===0&&Jg===0){const ma=Math.abs(Fg),pa=Math.abs(Eg);if(ma===pa)if(Dg===0)co=da=1/ma;else{const eI=ma*Dg;co=da=eI<1?1/eI:1}else if(Dg===0)co=1/ma,da=1/pa;else{const eI=ma*Dg,Qg=pa*Dg;co=eI<1?1/eI:1,da=Qg<1?1/Qg:1}}else{const ma=Math.abs(Fg*Eg-Tg*Jg),pa=Math.hypot(Fg,Tg),eI=Math.hypot(Jg,Eg);if(Dg===0)co=eI/ma,da=pa/ma;else{const Qg=Dg*ma;co=eI>Qg?eI/Qg:1,da=pa>Qg?pa/Qg:1}}this._cachedScaleForStroking[0]=co,this._cachedScaleForStroking[1]=da}return this._cachedScaleForStroking}rescaleAndStroke(Dg){const{ctx:Fg}=this,{lineWidth:Tg}=this.current,[Jg,Eg]=this.getScaleForStroking();if(Fg.lineWidth=Tg||1,Jg===1&&Eg===1){Fg.stroke();return}const co=Fg.getLineDash();if(Dg&&Fg.save(),Fg.scale(Jg,Eg),co.length>0){const da=Math.max(Jg,Eg);Fg.setLineDash(co.map(ma=>ma/da)),Fg.lineDashOffset/=da}Fg.stroke(),Dg&&Fg.restore()}isContentVisible(){for(let Dg=this.markedContentStack.length-1;Dg>=0;Dg--)if(!this.markedContentStack[Dg].visible)return!1;return!0}};Sg=new WeakSet,B0=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},W0=function(){if(this.pageColors){const Dg=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(Dg!=="none"){const Fg=this.ctx.filter;this.ctx.filter=Dg,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=Fg}}};let Rg=Og;eg.CanvasGraphics=Rg;for(const Kg in ig.OPS)Rg.prototype[Kg]!==void 0&&(Rg.prototype[ig.OPS[Kg]]=Rg.prototype[Kg])}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.TilingPattern=eg.PathType=void 0,eg.getShadingPattern=rg;var ig=gg(1),ng=gg(6);const og={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};eg.PathType=og;function ag(mg,hg){if(!hg)return;const pg=hg[2]-hg[0],fg=hg[3]-hg[1],wg=new Path2D;wg.rect(hg[0],hg[1],pg,fg),mg.clip(wg)}class Ig{constructor(){this.constructor===Ig&&(0,ig.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,ig.unreachable)("Abstract method `getPattern` called.")}}class sg extends Ig{constructor(hg){super(),this._type=hg[1],this._bbox=hg[2],this._colorStops=hg[3],this._p0=hg[4],this._p1=hg[5],this._r0=hg[6],this._r1=hg[7],this.matrix=null}_createGradient(hg){let pg;this._type==="axial"?pg=hg.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(pg=hg.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const fg of this._colorStops)pg.addColorStop(fg[0],fg[1]);return pg}getPattern(hg,pg,fg,wg){let Gg;if(wg===og.STROKE||wg===og.FILL){const Zg=pg.current.getClippedPathBoundingBox(wg,(0,ng.getCurrentTransform)(hg))||[0,0,0,0],yg=Math.ceil(Zg[2]-Zg[0])||1,Bg=Math.ceil(Zg[3]-Zg[1])||1,Wg=pg.cachedCanvases.getCanvas("pattern",yg,Bg,!0),$g=Wg.context;$g.clearRect(0,0,$g.canvas.width,$g.canvas.height),$g.beginPath(),$g.rect(0,0,$g.canvas.width,$g.canvas.height),$g.translate(-Zg[0],-Zg[1]),fg=ig.Util.transform(fg,[1,0,0,1,Zg[0],Zg[1]]),$g.transform(...pg.baseTransform),this.matrix&&$g.transform(...this.matrix),ag($g,this._bbox),$g.fillStyle=this._createGradient($g),$g.fill(),Gg=hg.createPattern(Wg.canvas,"no-repeat");const Ng=new DOMMatrix(fg);Gg.setTransform(Ng)}else ag(hg,this._bbox),Gg=this._createGradient(hg);return Gg}}function Cg(mg,hg,pg,fg,wg,Gg,Zg,yg){const Bg=hg.coords,Wg=hg.colors,$g=mg.data,Ng=mg.width*4;let vg;Bg[pg+1]>Bg[fg+1]&&(vg=pg,pg=fg,fg=vg,vg=Gg,Gg=Zg,Zg=vg),Bg[fg+1]>Bg[wg+1]&&(vg=fg,fg=wg,wg=vg,vg=Zg,Zg=yg,yg=vg),Bg[pg+1]>Bg[fg+1]&&(vg=pg,pg=fg,fg=vg,vg=Gg,Gg=Zg,Zg=vg);const Xg=(Bg[pg]+hg.offsetX)*hg.scaleX,Vg=(Bg[pg+1]+hg.offsetY)*hg.scaleY,Mg=(Bg[fg]+hg.offsetX)*hg.scaleX,Rg=(Bg[fg+1]+hg.offsetY)*hg.scaleY,Sg=(Bg[wg]+hg.offsetX)*hg.scaleX,Yg=(Bg[wg+1]+hg.offsetY)*hg.scaleY;if(Vg>=Yg)return;const xg=Wg[Gg],Og=Wg[Gg+1],Kg=Wg[Gg+2],Dg=Wg[Zg],Fg=Wg[Zg+1],Tg=Wg[Zg+2],Jg=Wg[yg],Eg=Wg[yg+1],co=Wg[yg+2],da=Math.round(Vg),ma=Math.round(Yg);let pa,eI,Qg,Ca,uo,eo,no,kg;for(let Lg=da;Lg<=ma;Lg++){if(Lg<Rg){const iI=Lg<Vg?0:(Vg-Lg)/(Vg-Rg);pa=Xg-(Xg-Mg)*iI,eI=xg-(xg-Dg)*iI,Qg=Og-(Og-Fg)*iI,Ca=Kg-(Kg-Tg)*iI}else{let iI;Lg>Yg?iI=1:Rg===Yg?iI=0:iI=(Rg-Lg)/(Rg-Yg),pa=Mg-(Mg-Sg)*iI,eI=Dg-(Dg-Jg)*iI,Qg=Fg-(Fg-Eg)*iI,Ca=Tg-(Tg-co)*iI}let Pg;Lg<Vg?Pg=0:Lg>Yg?Pg=1:Pg=(Vg-Lg)/(Vg-Yg),uo=Xg-(Xg-Sg)*Pg,eo=xg-(xg-Jg)*Pg,no=Og-(Og-Eg)*Pg,kg=Kg-(Kg-co)*Pg;const ua=Math.round(Math.min(pa,uo)),ya=Math.round(Math.max(pa,uo));let oI=Ng*Lg+ua*4;for(let iI=ua;iI<=ya;iI++)Pg=(pa-iI)/(pa-uo),Pg<0?Pg=0:Pg>1&&(Pg=1),$g[oI++]=eI-(eI-eo)*Pg|0,$g[oI++]=Qg-(Qg-no)*Pg|0,$g[oI++]=Ca-(Ca-kg)*Pg|0,$g[oI++]=255}}function lg(mg,hg,pg){const fg=hg.coords,wg=hg.colors;let Gg,Zg;switch(hg.type){case"lattice":const yg=hg.verticesPerRow,Bg=Math.floor(fg.length/yg)-1,Wg=yg-1;for(Gg=0;Gg<Bg;Gg++){let $g=Gg*yg;for(let Ng=0;Ng<Wg;Ng++,$g++)Cg(mg,pg,fg[$g],fg[$g+1],fg[$g+yg],wg[$g],wg[$g+1],wg[$g+yg]),Cg(mg,pg,fg[$g+yg+1],fg[$g+1],fg[$g+yg],wg[$g+yg+1],wg[$g+1],wg[$g+yg])}break;case"triangles":for(Gg=0,Zg=fg.length;Gg<Zg;Gg+=3)Cg(mg,pg,fg[Gg],fg[Gg+1],fg[Gg+2],wg[Gg],wg[Gg+1],wg[Gg+2]);break;default:throw new Error("illegal figure")}}class Ag extends Ig{constructor(hg){super(),this._coords=hg[2],this._colors=hg[3],this._figures=hg[4],this._bounds=hg[5],this._bbox=hg[7],this._background=hg[8],this.matrix=null}_createMeshCanvas(hg,pg,fg){const yg=Math.floor(this._bounds[0]),Bg=Math.floor(this._bounds[1]),Wg=Math.ceil(this._bounds[2])-yg,$g=Math.ceil(this._bounds[3])-Bg,Ng=Math.min(Math.ceil(Math.abs(Wg*hg[0]*1.1)),3e3),vg=Math.min(Math.ceil(Math.abs($g*hg[1]*1.1)),3e3),Xg=Wg/Ng,Vg=$g/vg,Mg={coords:this._coords,colors:this._colors,offsetX:-yg,offsetY:-Bg,scaleX:1/Xg,scaleY:1/Vg},Rg=Ng+4,Sg=vg+4,Yg=fg.getCanvas("mesh",Rg,Sg,!1),xg=Yg.context,Og=xg.createImageData(Ng,vg);if(pg){const Dg=Og.data;for(let Fg=0,Tg=Dg.length;Fg<Tg;Fg+=4)Dg[Fg]=pg[0],Dg[Fg+1]=pg[1],Dg[Fg+2]=pg[2],Dg[Fg+3]=255}for(const Dg of this._figures)lg(Og,Dg,Mg);return xg.putImageData(Og,2,2),{canvas:Yg.canvas,offsetX:yg-2*Xg,offsetY:Bg-2*Vg,scaleX:Xg,scaleY:Vg}}getPattern(hg,pg,fg,wg){ag(hg,this._bbox);let Gg;if(wg===og.SHADING)Gg=ig.Util.singularValueDecompose2dScale((0,ng.getCurrentTransform)(hg));else if(Gg=ig.Util.singularValueDecompose2dScale(pg.baseTransform),this.matrix){const yg=ig.Util.singularValueDecompose2dScale(this.matrix);Gg=[Gg[0]*yg[0],Gg[1]*yg[1]]}const Zg=this._createMeshCanvas(Gg,wg===og.SHADING?null:this._background,pg.cachedCanvases);return wg!==og.SHADING&&(hg.setTransform(...pg.baseTransform),this.matrix&&hg.transform(...this.matrix)),hg.translate(Zg.offsetX,Zg.offsetY),hg.scale(Zg.scaleX,Zg.scaleY),hg.createPattern(Zg.canvas,"no-repeat")}}class cg extends Ig{getPattern(){return"hotpink"}}function rg(mg){switch(mg[0]){case"RadialAxial":return new sg(mg);case"Mesh":return new Ag(mg);case"Dummy":return new cg}throw new Error(`Unknown IR type: ${mg[0]}`)}const ug={COLORED:1,UNCOLORED:2},bg=class bg{constructor(hg,pg,fg,wg,Gg){this.operatorList=hg[2],this.matrix=hg[3]||[1,0,0,1,0,0],this.bbox=hg[4],this.xstep=hg[5],this.ystep=hg[6],this.paintType=hg[7],this.tilingType=hg[8],this.color=pg,this.ctx=fg,this.canvasGraphicsFactory=wg,this.baseTransform=Gg}createPatternCanvas(hg){const pg=this.operatorList,fg=this.bbox,wg=this.xstep,Gg=this.ystep,Zg=this.paintType,yg=this.tilingType,Bg=this.color,Wg=this.canvasGraphicsFactory;(0,ig.info)("TilingType: "+yg);const $g=fg[0],Ng=fg[1],vg=fg[2],Xg=fg[3],Vg=ig.Util.singularValueDecompose2dScale(this.matrix),Mg=ig.Util.singularValueDecompose2dScale(this.baseTransform),Rg=[Vg[0]*Mg[0],Vg[1]*Mg[1]],Sg=this.getSizeAndScale(wg,this.ctx.canvas.width,Rg[0]),Yg=this.getSizeAndScale(Gg,this.ctx.canvas.height,Rg[1]),xg=hg.cachedCanvases.getCanvas("pattern",Sg.size,Yg.size,!0),Og=xg.context,Kg=Wg.createCanvasGraphics(Og);Kg.groupLevel=hg.groupLevel,this.setFillAndStrokeStyleToContext(Kg,Zg,Bg);let Dg=$g,Fg=Ng,Tg=vg,Jg=Xg;return $g<0&&(Dg=0,Tg+=Math.abs($g)),Ng<0&&(Fg=0,Jg+=Math.abs(Ng)),Og.translate(-(Sg.scale*Dg),-(Yg.scale*Fg)),Kg.transform(Sg.scale,0,0,Yg.scale,0,0),Og.save(),this.clipBbox(Kg,Dg,Fg,Tg,Jg),Kg.baseTransform=(0,ng.getCurrentTransform)(Kg.ctx),Kg.executeOperatorList(pg),Kg.endDrawing(),{canvas:xg.canvas,scaleX:Sg.scale,scaleY:Yg.scale,offsetX:Dg,offsetY:Fg}}getSizeAndScale(hg,pg,fg){hg=Math.abs(hg);const wg=Math.max(bg.MAX_PATTERN_SIZE,pg);let Gg=Math.ceil(hg*fg);return Gg>=wg?Gg=wg:fg=Gg/hg,{scale:fg,size:Gg}}clipBbox(hg,pg,fg,wg,Gg){const Zg=wg-pg,yg=Gg-fg;hg.ctx.rect(pg,fg,Zg,yg),hg.current.updateRectMinMax((0,ng.getCurrentTransform)(hg.ctx),[pg,fg,wg,Gg]),hg.clip(),hg.endPath()}setFillAndStrokeStyleToContext(hg,pg,fg){const wg=hg.ctx,Gg=hg.current;switch(pg){case ug.COLORED:const Zg=this.ctx;wg.fillStyle=Zg.fillStyle,wg.strokeStyle=Zg.strokeStyle,Gg.fillColor=Zg.fillStyle,Gg.strokeColor=Zg.strokeStyle;break;case ug.UNCOLORED:const yg=ig.Util.makeHexColor(fg[0],fg[1],fg[2]);wg.fillStyle=yg,wg.strokeStyle=yg,Gg.fillColor=yg,Gg.strokeColor=yg;break;default:throw new ig.FormatError(`Unsupported paint type: ${pg}`)}}getPattern(hg,pg,fg,wg){let Gg=fg;wg!==og.SHADING&&(Gg=ig.Util.transform(Gg,pg.baseTransform),this.matrix&&(Gg=ig.Util.transform(Gg,this.matrix)));const Zg=this.createPatternCanvas(pg);let yg=new DOMMatrix(Gg);yg=yg.translate(Zg.offsetX,Zg.offsetY),yg=yg.scale(1/Zg.scaleX,1/Zg.scaleY);const Bg=hg.createPattern(Zg.canvas,"repeat");return Bg.setTransform(yg),Bg}};tl(bg,"MAX_PATTERN_SIZE",3e3);let dg=bg;eg.TilingPattern=dg}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.convertBlackAndWhiteToRGBA=og,eg.convertToRGBA=ng,eg.grayToRGBA=Ig;var ig=gg(1);function ng(sg){switch(sg.kind){case ig.ImageKind.GRAYSCALE_1BPP:return og(sg);case ig.ImageKind.RGB_24BPP:return ag(sg)}return null}function og({src:sg,srcPos:Cg=0,dest:lg,width:Ag,height:cg,nonBlackColor:rg=4294967295,inverseDecode:ug=!1}){const dg=ig.FeatureTest.isLittleEndian?4278190080:255,[bg,mg]=ug?[rg,dg]:[dg,rg],hg=Ag>>3,pg=Ag&7,fg=sg.length;lg=new Uint32Array(lg.buffer);let wg=0;for(let Gg=0;Gg<cg;Gg++){for(const yg=Cg+hg;Cg<yg;Cg++){const Bg=Cg<fg?sg[Cg]:255;lg[wg++]=Bg&128?mg:bg,lg[wg++]=Bg&64?mg:bg,lg[wg++]=Bg&32?mg:bg,lg[wg++]=Bg&16?mg:bg,lg[wg++]=Bg&8?mg:bg,lg[wg++]=Bg&4?mg:bg,lg[wg++]=Bg&2?mg:bg,lg[wg++]=Bg&1?mg:bg}if(pg===0)continue;const Zg=Cg<fg?sg[Cg++]:255;for(let yg=0;yg<pg;yg++)lg[wg++]=Zg&1<<7-yg?mg:bg}return{srcPos:Cg,destPos:wg}}function ag({src:sg,srcPos:Cg=0,dest:lg,destPos:Ag=0,width:cg,height:rg}){let ug=0;const dg=sg.length>>2,bg=new Uint32Array(sg.buffer,Cg,dg);if(ig.FeatureTest.isLittleEndian){for(;ug<dg-2;ug+=3,Ag+=4){const mg=bg[ug],hg=bg[ug+1],pg=bg[ug+2];lg[Ag]=mg|4278190080,lg[Ag+1]=mg>>>24|hg<<8|4278190080,lg[Ag+2]=hg>>>16|pg<<16|4278190080,lg[Ag+3]=pg>>>8|4278190080}for(let mg=ug*4,hg=sg.length;mg<hg;mg+=3)lg[Ag++]=sg[mg]|sg[mg+1]<<8|sg[mg+2]<<16|4278190080}else{for(;ug<dg-2;ug+=3,Ag+=4){const mg=bg[ug],hg=bg[ug+1],pg=bg[ug+2];lg[Ag]=mg|255,lg[Ag+1]=mg<<24|hg>>>8|255,lg[Ag+2]=hg<<16|pg>>>16|255,lg[Ag+3]=pg<<8|255}for(let mg=ug*4,hg=sg.length;mg<hg;mg+=3)lg[Ag++]=sg[mg]<<24|sg[mg+1]<<16|sg[mg+2]<<8|255}return{srcPos:Cg,destPos:Ag}}function Ig(sg,Cg){if(ig.FeatureTest.isLittleEndian)for(let lg=0,Ag=sg.length;lg<Ag;lg++)Cg[lg]=sg[lg]*65793|4278190080;else for(let lg=0,Ag=sg.length;lg<Ag;lg++)Cg[lg]=sg[lg]*16843008|255}}),((tg,eg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.GlobalWorkerOptions=void 0;const gg=Object.create(null);eg.GlobalWorkerOptions=gg,gg.workerPort=null,gg.workerSrc=""}),((tg,eg,gg)=>{var sg,zb,Tb,Pd;Object.defineProperty(eg,"__esModule",{value:!0}),eg.MessageHandler=void 0;var ig=gg(1);const ng={DATA:1,ERROR:2},og={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function ag(cg){switch(cg instanceof Error||typeof cg=="object"&&cg!==null||(0,ig.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),cg.name){case"AbortException":return new ig.AbortException(cg.message);case"MissingPDFException":return new ig.MissingPDFException(cg.message);case"PasswordException":return new ig.PasswordException(cg.message,cg.code);case"UnexpectedResponseException":return new ig.UnexpectedResponseException(cg.message,cg.status);case"UnknownErrorException":return new ig.UnknownErrorException(cg.message,cg.details);default:return new ig.UnknownErrorException(cg.message,cg.toString())}}class Ig{constructor(rg,ug,dg){yI(this,sg);this.sourceName=rg,this.targetName=ug,this.comObj=dg,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=bg=>{const mg=bg.data;if(mg.targetName!==this.sourceName)return;if(mg.stream){ZI(this,sg,Tb).call(this,mg);return}if(mg.callback){const pg=mg.callbackId,fg=this.callbackCapabilities[pg];if(!fg)throw new Error(`Cannot resolve callback ${pg}`);if(delete this.callbackCapabilities[pg],mg.callback===ng.DATA)fg.resolve(mg.data);else if(mg.callback===ng.ERROR)fg.reject(ag(mg.reason));else throw new Error("Unexpected callback case");return}const hg=this.actionHandler[mg.action];if(!hg)throw new Error(`Unknown action from worker: ${mg.action}`);if(mg.callbackId){const pg=this.sourceName,fg=mg.sourceName;new Promise(function(wg){wg(hg(mg.data))}).then(function(wg){dg.postMessage({sourceName:pg,targetName:fg,callback:ng.DATA,callbackId:mg.callbackId,data:wg})},function(wg){dg.postMessage({sourceName:pg,targetName:fg,callback:ng.ERROR,callbackId:mg.callbackId,reason:ag(wg)})});return}if(mg.streamId){ZI(this,sg,zb).call(this,mg);return}hg(mg.data)},dg.addEventListener("message",this._onComObjOnMessage)}on(rg,ug){const dg=this.actionHandler;if(dg[rg])throw new Error(`There is already an actionName called "${rg}"`);dg[rg]=ug}send(rg,ug,dg){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:rg,data:ug},dg)}sendWithPromise(rg,ug,dg){const bg=this.callbackId++,mg=new ig.PromiseCapability;this.callbackCapabilities[bg]=mg;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:rg,callbackId:bg,data:ug},dg)}catch(hg){mg.reject(hg)}return mg.promise}sendWithStream(rg,ug,dg,bg){const mg=this.streamId++,hg=this.sourceName,pg=this.targetName,fg=this.comObj;return new ReadableStream({start:wg=>{const Gg=new ig.PromiseCapability;return this.streamControllers[mg]={controller:wg,startCall:Gg,pullCall:null,cancelCall:null,isClosed:!1},fg.postMessage({sourceName:hg,targetName:pg,action:rg,streamId:mg,data:ug,desiredSize:wg.desiredSize},bg),Gg.promise},pull:wg=>{const Gg=new ig.PromiseCapability;return this.streamControllers[mg].pullCall=Gg,fg.postMessage({sourceName:hg,targetName:pg,stream:og.PULL,streamId:mg,desiredSize:wg.desiredSize}),Gg.promise},cancel:wg=>{(0,ig.assert)(wg instanceof Error,"cancel must have a valid reason");const Gg=new ig.PromiseCapability;return this.streamControllers[mg].cancelCall=Gg,this.streamControllers[mg].isClosed=!0,fg.postMessage({sourceName:hg,targetName:pg,stream:og.CANCEL,streamId:mg,reason:ag(wg)}),Gg.promise}},dg)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}sg=new WeakSet,zb=function(rg){const ug=rg.streamId,dg=this.sourceName,bg=rg.sourceName,mg=this.comObj,hg=this,pg=this.actionHandler[rg.action],fg={enqueue(wg,Gg=1,Zg){if(this.isCancelled)return;const yg=this.desiredSize;this.desiredSize-=Gg,yg>0&&this.desiredSize<=0&&(this.sinkCapability=new ig.PromiseCapability,this.ready=this.sinkCapability.promise),mg.postMessage({sourceName:dg,targetName:bg,stream:og.ENQUEUE,streamId:ug,chunk:wg},Zg)},close(){this.isCancelled||(this.isCancelled=!0,mg.postMessage({sourceName:dg,targetName:bg,stream:og.CLOSE,streamId:ug}),delete hg.streamSinks[ug])},error(wg){(0,ig.assert)(wg instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,mg.postMessage({sourceName:dg,targetName:bg,stream:og.ERROR,streamId:ug,reason:ag(wg)}))},sinkCapability:new ig.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:rg.desiredSize,ready:null};fg.sinkCapability.resolve(),fg.ready=fg.sinkCapability.promise,this.streamSinks[ug]=fg,new Promise(function(wg){wg(pg(rg.data,fg))}).then(function(){mg.postMessage({sourceName:dg,targetName:bg,stream:og.START_COMPLETE,streamId:ug,success:!0})},function(wg){mg.postMessage({sourceName:dg,targetName:bg,stream:og.START_COMPLETE,streamId:ug,reason:ag(wg)})})},Tb=function(rg){const ug=rg.streamId,dg=this.sourceName,bg=rg.sourceName,mg=this.comObj,hg=this.streamControllers[ug],pg=this.streamSinks[ug];switch(rg.stream){case og.START_COMPLETE:rg.success?hg.startCall.resolve():hg.startCall.reject(ag(rg.reason));break;case og.PULL_COMPLETE:rg.success?hg.pullCall.resolve():hg.pullCall.reject(ag(rg.reason));break;case og.PULL:if(!pg){mg.postMessage({sourceName:dg,targetName:bg,stream:og.PULL_COMPLETE,streamId:ug,success:!0});break}pg.desiredSize<=0&&rg.desiredSize>0&&pg.sinkCapability.resolve(),pg.desiredSize=rg.desiredSize,new Promise(function(fg){var wg;fg((wg=pg.onPull)==null?void 0:wg.call(pg))}).then(function(){mg.postMessage({sourceName:dg,targetName:bg,stream:og.PULL_COMPLETE,streamId:ug,success:!0})},function(fg){mg.postMessage({sourceName:dg,targetName:bg,stream:og.PULL_COMPLETE,streamId:ug,reason:ag(fg)})});break;case og.ENQUEUE:if((0,ig.assert)(hg,"enqueue should have stream controller"),hg.isClosed)break;hg.controller.enqueue(rg.chunk);break;case og.CLOSE:if((0,ig.assert)(hg,"close should have stream controller"),hg.isClosed)break;hg.isClosed=!0,hg.controller.close(),ZI(this,sg,Pd).call(this,hg,ug);break;case og.ERROR:(0,ig.assert)(hg,"error should have stream controller"),hg.controller.error(ag(rg.reason)),ZI(this,sg,Pd).call(this,hg,ug);break;case og.CANCEL_COMPLETE:rg.success?hg.cancelCall.resolve():hg.cancelCall.reject(ag(rg.reason)),ZI(this,sg,Pd).call(this,hg,ug);break;case og.CANCEL:if(!pg)break;new Promise(function(fg){var wg;fg((wg=pg.onCancel)==null?void 0:wg.call(pg,ag(rg.reason)))}).then(function(){mg.postMessage({sourceName:dg,targetName:bg,stream:og.CANCEL_COMPLETE,streamId:ug,success:!0})},function(fg){mg.postMessage({sourceName:dg,targetName:bg,stream:og.CANCEL_COMPLETE,streamId:ug,reason:ag(fg)})}),pg.sinkCapability.reject(ag(rg.reason)),pg.isCancelled=!0,delete this.streamSinks[ug];break;default:throw new Error("Unexpected stream case")}},Pd=async function(rg,ug){var dg,bg,mg;await Promise.allSettled([(dg=rg.startCall)==null?void 0:dg.promise,(bg=rg.pullCall)==null?void 0:bg.promise,(mg=rg.cancelCall)==null?void 0:mg.promise]),delete this.streamControllers[ug]},eg.MessageHandler=Ig}),((tg,eg,gg)=>{var og,ag;Object.defineProperty(eg,"__esModule",{value:!0}),eg.Metadata=void 0;var ig=gg(1);class ng{constructor({parsedData:sg,rawData:Cg}){yI(this,og);yI(this,ag);BI(this,og,sg),BI(this,ag,Cg)}getRaw(){return la(this,ag)}get(sg){return la(this,og).get(sg)??null}getAll(){return(0,ig.objectFromMap)(la(this,og))}has(sg){return la(this,og).has(sg)}}og=new WeakMap,ag=new WeakMap,eg.Metadata=ng}),((tg,eg,gg)=>{var sg,Cg,lg,Ag,cg,rg,N0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.OptionalContentConfig=void 0;var ig=gg(1),ng=gg(8);const og=Symbol("INTERNAL");class ag{constructor(bg,mg){yI(this,sg,!0);this.name=bg,this.intent=mg}get visible(){return la(this,sg)}_setVisible(bg,mg){bg!==og&&(0,ig.unreachable)("Internal method `_setVisible` called."),BI(this,sg,mg)}}sg=new WeakMap;class Ig{constructor(bg){yI(this,rg);yI(this,Cg,null);yI(this,lg,new Map);yI(this,Ag,null);yI(this,cg,null);if(this.name=null,this.creator=null,bg!==null){this.name=bg.name,this.creator=bg.creator,BI(this,cg,bg.order);for(const mg of bg.groups)la(this,lg).set(mg.id,new ag(mg.name,mg.intent));if(bg.baseState==="OFF")for(const mg of la(this,lg).values())mg._setVisible(og,!1);for(const mg of bg.on)la(this,lg).get(mg)._setVisible(og,!0);for(const mg of bg.off)la(this,lg).get(mg)._setVisible(og,!1);BI(this,Ag,this.getHash())}}isVisible(bg){if(la(this,lg).size===0)return!0;if(!bg)return(0,ig.warn)("Optional content group not defined."),!0;if(bg.type==="OCG")return la(this,lg).has(bg.id)?la(this,lg).get(bg.id).visible:((0,ig.warn)(`Optional content group not found: ${bg.id}`),!0);if(bg.type==="OCMD"){if(bg.expression)return ZI(this,rg,N0).call(this,bg.expression);if(!bg.policy||bg.policy==="AnyOn"){for(const mg of bg.ids){if(!la(this,lg).has(mg))return(0,ig.warn)(`Optional content group not found: ${mg}`),!0;if(la(this,lg).get(mg).visible)return!0}return!1}else if(bg.policy==="AllOn"){for(const mg of bg.ids){if(!la(this,lg).has(mg))return(0,ig.warn)(`Optional content group not found: ${mg}`),!0;if(!la(this,lg).get(mg).visible)return!1}return!0}else if(bg.policy==="AnyOff"){for(const mg of bg.ids){if(!la(this,lg).has(mg))return(0,ig.warn)(`Optional content group not found: ${mg}`),!0;if(!la(this,lg).get(mg).visible)return!0}return!1}else if(bg.policy==="AllOff"){for(const mg of bg.ids){if(!la(this,lg).has(mg))return(0,ig.warn)(`Optional content group not found: ${mg}`),!0;if(la(this,lg).get(mg).visible)return!1}return!0}return(0,ig.warn)(`Unknown optional content policy ${bg.policy}.`),!0}return(0,ig.warn)(`Unknown group type ${bg.type}.`),!0}setVisibility(bg,mg=!0){if(!la(this,lg).has(bg)){(0,ig.warn)(`Optional content group not found: ${bg}`);return}la(this,lg).get(bg)._setVisible(og,!!mg),BI(this,Cg,null)}get hasInitialVisibility(){return la(this,Ag)===null||this.getHash()===la(this,Ag)}getOrder(){return la(this,lg).size?la(this,cg)?la(this,cg).slice():[...la(this,lg).keys()]:null}getGroups(){return la(this,lg).size>0?(0,ig.objectFromMap)(la(this,lg)):null}getGroup(bg){return la(this,lg).get(bg)||null}getHash(){if(la(this,Cg)!==null)return la(this,Cg);const bg=new ng.MurmurHash3_64;for(const[mg,hg]of la(this,lg))bg.update(`${mg}:${hg.visible}`);return BI(this,Cg,bg.hexdigest())}}Cg=new WeakMap,lg=new WeakMap,Ag=new WeakMap,cg=new WeakMap,rg=new WeakSet,N0=function(bg){const mg=bg.length;if(mg<2)return!0;const hg=bg[0];for(let pg=1;pg<mg;pg++){const fg=bg[pg];let wg;if(Array.isArray(fg))wg=ZI(this,rg,N0).call(this,fg);else if(la(this,lg).has(fg))wg=la(this,lg).get(fg).visible;else return(0,ig.warn)(`Optional content group not found: ${fg}`),!0;switch(hg){case"And":if(!wg)return!1;break;case"Or":if(wg)return!0;break;case"Not":return!wg;default:return!0}}return hg==="And"},eg.OptionalContentConfig=Ig}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.PDFDataTransportStream=void 0;var ig=gg(1),ng=gg(6);class og{constructor({length:Cg,initialData:lg,progressiveDone:Ag=!1,contentDispositionFilename:cg=null,disableRange:rg=!1,disableStream:ug=!1},dg){if((0,ig.assert)(dg,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=Ag,this._contentDispositionFilename=cg,(lg==null?void 0:lg.length)>0){const bg=lg instanceof Uint8Array&&lg.byteLength===lg.buffer.byteLength?lg.buffer:new Uint8Array(lg).buffer;this._queuedChunks.push(bg)}this._pdfDataRangeTransport=dg,this._isStreamingSupported=!ug,this._isRangeSupported=!rg,this._contentLength=Cg,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((bg,mg)=>{this._onReceiveData({begin:bg,chunk:mg})}),this._pdfDataRangeTransport.addProgressListener((bg,mg)=>{this._onProgress({loaded:bg,total:mg})}),this._pdfDataRangeTransport.addProgressiveReadListener(bg=>{this._onReceiveData({chunk:bg})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:Cg,chunk:lg}){const Ag=lg instanceof Uint8Array&&lg.byteLength===lg.buffer.byteLength?lg.buffer:new Uint8Array(lg).buffer;if(Cg===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(Ag):this._queuedChunks.push(Ag);else{const cg=this._rangeReaders.some(function(rg){return rg._begin!==Cg?!1:(rg._enqueue(Ag),!0)});(0,ig.assert)(cg,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var Cg;return((Cg=this._fullRequestReader)==null?void 0:Cg._loaded)??0}_onProgress(Cg){var lg,Ag,cg,rg;Cg.total===void 0?(Ag=(lg=this._rangeReaders[0])==null?void 0:lg.onProgress)==null||Ag.call(lg,{loaded:Cg.loaded}):(rg=(cg=this._fullRequestReader)==null?void 0:cg.onProgress)==null||rg.call(cg,{loaded:Cg.loaded,total:Cg.total})}_onProgressiveDone(){var Cg;(Cg=this._fullRequestReader)==null||Cg.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(Cg){const lg=this._rangeReaders.indexOf(Cg);lg>=0&&this._rangeReaders.splice(lg,1)}getFullReader(){(0,ig.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const Cg=this._queuedChunks;return this._queuedChunks=null,new ag(this,Cg,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(Cg,lg){if(lg<=this._progressiveDataLength)return null;const Ag=new Ig(this,Cg,lg);return this._pdfDataRangeTransport.requestDataRange(Cg,lg),this._rangeReaders.push(Ag),Ag}cancelAllRequests(Cg){var lg;(lg=this._fullRequestReader)==null||lg.cancel(Cg);for(const Ag of this._rangeReaders.slice(0))Ag.cancel(Cg);this._pdfDataRangeTransport.abort()}}eg.PDFDataTransportStream=og;class ag{constructor(Cg,lg,Ag=!1,cg=null){this._stream=Cg,this._done=Ag||!1,this._filename=(0,ng.isPdfFile)(cg)?cg:null,this._queuedChunks=lg||[],this._loaded=0;for(const rg of this._queuedChunks)this._loaded+=rg.byteLength;this._requests=[],this._headersReady=Promise.resolve(),Cg._fullRequestReader=this,this.onProgress=null}_enqueue(Cg){this._done||(this._requests.length>0?this._requests.shift().resolve({value:Cg,done:!1}):this._queuedChunks.push(Cg),this._loaded+=Cg.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const Cg=new ig.PromiseCapability;return this._requests.push(Cg),Cg.promise}cancel(Cg){this._done=!0;for(const lg of this._requests)lg.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ig{constructor(Cg,lg,Ag){this._stream=Cg,this._begin=lg,this._end=Ag,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(Cg){if(!this._done){if(this._requests.length===0)this._queuedChunk=Cg;else{this._requests.shift().resolve({value:Cg,done:!1});for(const Ag of this._requests)Ag.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const lg=this._queuedChunk;return this._queuedChunk=null,{value:lg,done:!1}}if(this._done)return{value:void 0,done:!0};const Cg=new ig.PromiseCapability;return this._requests.push(Cg),Cg.promise}cancel(Cg){this._done=!0;for(const lg of this._requests)lg.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.PDFFetchStream=void 0;var ig=gg(1),ng=gg(20);function og(Ag,cg,rg){return{method:"GET",headers:Ag,signal:rg.signal,mode:"cors",credentials:cg?"include":"same-origin",redirect:"follow"}}function ag(Ag){const cg=new Headers;for(const rg in Ag){const ug=Ag[rg];ug!==void 0&&cg.append(rg,ug)}return cg}function Ig(Ag){return Ag instanceof Uint8Array?Ag.buffer:Ag instanceof ArrayBuffer?Ag:((0,ig.warn)(`getArrayBuffer - unexpected data format: ${Ag}`),new Uint8Array(Ag).buffer)}class sg{constructor(cg){this.source=cg,this.isHttp=/^https?:/i.test(cg.url),this.httpHeaders=this.isHttp&&cg.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var cg;return((cg=this._fullRequestReader)==null?void 0:cg._loaded)??0}getFullReader(){return(0,ig.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Cg(this),this._fullRequestReader}getRangeReader(cg,rg){if(rg<=this._progressiveDataLength)return null;const ug=new lg(this,cg,rg);return this._rangeRequestReaders.push(ug),ug}cancelAllRequests(cg){var rg;(rg=this._fullRequestReader)==null||rg.cancel(cg);for(const ug of this._rangeRequestReaders.slice(0))ug.cancel(cg)}}eg.PDFFetchStream=sg;class Cg{constructor(cg){this._stream=cg,this._reader=null,this._loaded=0,this._filename=null;const rg=cg.source;this._withCredentials=rg.withCredentials||!1,this._contentLength=rg.length,this._headersCapability=new ig.PromiseCapability,this._disableRange=rg.disableRange||!1,this._rangeChunkSize=rg.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!rg.disableStream,this._isRangeSupported=!rg.disableRange,this._headers=ag(this._stream.httpHeaders);const ug=rg.url;fetch(ug,og(this._headers,this._withCredentials,this._abortController)).then(dg=>{if(!(0,ng.validateResponseStatus)(dg.status))throw(0,ng.createResponseStatusError)(dg.status,ug);this._reader=dg.body.getReader(),this._headersCapability.resolve();const bg=pg=>dg.headers.get(pg),{allowRangeRequests:mg,suggestedLength:hg}=(0,ng.validateRangeRequestCapabilities)({getResponseHeader:bg,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=mg,this._contentLength=hg||this._contentLength,this._filename=(0,ng.extractFilenameFromHeader)(bg),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ig.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var ug;await this._headersCapability.promise;const{value:cg,done:rg}=await this._reader.read();return rg?{value:cg,done:rg}:(this._loaded+=cg.byteLength,(ug=this.onProgress)==null||ug.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Ig(cg),done:!1})}cancel(cg){var rg;(rg=this._reader)==null||rg.cancel(cg),this._abortController.abort()}}class lg{constructor(cg,rg,ug){this._stream=cg,this._reader=null,this._loaded=0;const dg=cg.source;this._withCredentials=dg.withCredentials||!1,this._readCapability=new ig.PromiseCapability,this._isStreamingSupported=!dg.disableStream,this._abortController=new AbortController,this._headers=ag(this._stream.httpHeaders),this._headers.append("Range",`bytes=${rg}-${ug-1}`);const bg=dg.url;fetch(bg,og(this._headers,this._withCredentials,this._abortController)).then(mg=>{if(!(0,ng.validateResponseStatus)(mg.status))throw(0,ng.createResponseStatusError)(mg.status,bg);this._readCapability.resolve(),this._reader=mg.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var ug;await this._readCapability.promise;const{value:cg,done:rg}=await this._reader.read();return rg?{value:cg,done:rg}:(this._loaded+=cg.byteLength,(ug=this.onProgress)==null||ug.call(this,{loaded:this._loaded}),{value:Ig(cg),done:!1})}cancel(cg){var rg;(rg=this._reader)==null||rg.cancel(cg),this._abortController.abort()}}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.createResponseStatusError=sg,eg.extractFilenameFromHeader=Ig,eg.validateRangeRequestCapabilities=ag,eg.validateResponseStatus=Cg;var ig=gg(1),ng=gg(21),og=gg(6);function ag({getResponseHeader:lg,isHttp:Ag,rangeChunkSize:cg,disableRange:rg}){const ug={allowRangeRequests:!1,suggestedLength:void 0},dg=parseInt(lg("Content-Length"),10);return!Number.isInteger(dg)||(ug.suggestedLength=dg,dg<=2*cg)||rg||!Ag||lg("Accept-Ranges")!=="bytes"||(lg("Content-Encoding")||"identity")!=="identity"||(ug.allowRangeRequests=!0),ug}function Ig(lg){const Ag=lg("Content-Disposition");if(Ag){let cg=(0,ng.getFilenameFromContentDispositionHeader)(Ag);if(cg.includes("%"))try{cg=decodeURIComponent(cg)}catch{}if((0,og.isPdfFile)(cg))return cg}return null}function sg(lg,Ag){return lg===404||lg===0&&Ag.startsWith("file:")?new ig.MissingPDFException('Missing PDF "'+Ag+'".'):new ig.UnexpectedResponseException(`Unexpected server response (${lg}) while retrieving PDF "${Ag}".`,lg)}function Cg(lg){return lg===200||lg===206}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.getFilenameFromContentDispositionHeader=ng;var ig=gg(1);function ng(og){let ag=!0,Ig=sg("filename\\*","i").exec(og);if(Ig){Ig=Ig[1];let dg=cg(Ig);return dg=unescape(dg),dg=rg(dg),dg=ug(dg),lg(dg)}if(Ig=Ag(og),Ig){const dg=ug(Ig);return lg(dg)}if(Ig=sg("filename","i").exec(og),Ig){Ig=Ig[1];let dg=cg(Ig);return dg=ug(dg),lg(dg)}function sg(dg,bg){return new RegExp("(?:^|;)\\s*"+dg+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',bg)}function Cg(dg,bg){if(dg){if(!/^[\x00-\xFF]+$/.test(bg))return bg;try{const mg=new TextDecoder(dg,{fatal:!0}),hg=(0,ig.stringToBytes)(bg);bg=mg.decode(hg),ag=!1}catch{}}return bg}function lg(dg){return ag&&/[\x80-\xff]/.test(dg)&&(dg=Cg("utf-8",dg),ag&&(dg=Cg("iso-8859-1",dg))),dg}function Ag(dg){const bg=[];let mg;const hg=sg("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(mg=hg.exec(dg))!==null;){let[,fg,wg,Gg]=mg;if(fg=parseInt(fg,10),fg in bg){if(fg===0)break;continue}bg[fg]=[wg,Gg]}const pg=[];for(let fg=0;fg<bg.length&&fg in bg;++fg){let[wg,Gg]=bg[fg];Gg=cg(Gg),wg&&(Gg=unescape(Gg),fg===0&&(Gg=rg(Gg))),pg.push(Gg)}return pg.join("")}function cg(dg){if(dg.startsWith('"')){const bg=dg.slice(1).split('\\"');for(let mg=0;mg<bg.length;++mg){const hg=bg[mg].indexOf('"');hg!==-1&&(bg[mg]=bg[mg].slice(0,hg),bg.length=mg+1),bg[mg]=bg[mg].replaceAll(/\\(.)/g,"$1")}dg=bg.join('"')}return dg}function rg(dg){const bg=dg.indexOf("'");if(bg===-1)return dg;const mg=dg.slice(0,bg),pg=dg.slice(bg+1).replace(/^[^']*'/,"");return Cg(mg,pg)}function ug(dg){return!dg.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(dg)?dg:dg.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(bg,mg,hg,pg){if(hg==="q"||hg==="Q")return pg=pg.replaceAll("_"," "),pg=pg.replaceAll(/=([0-9a-fA-F]{2})/g,function(fg,wg){return String.fromCharCode(parseInt(wg,16))}),Cg(mg,pg);try{pg=atob(pg)}catch{}return Cg(mg,pg)})}return""}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.PDFNetworkStream=void 0;var ig=gg(1),ng=gg(20);const og=200,ag=206;function Ig(cg){const rg=cg.response;return typeof rg!="string"?rg:(0,ig.stringToBytes)(rg).buffer}class sg{constructor(rg,ug={}){this.url=rg,this.isHttp=/^https?:/i.test(rg),this.httpHeaders=this.isHttp&&ug.httpHeaders||Object.create(null),this.withCredentials=ug.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(rg,ug,dg){const bg={begin:rg,end:ug};for(const mg in dg)bg[mg]=dg[mg];return this.request(bg)}requestFull(rg){return this.request(rg)}request(rg){const ug=new XMLHttpRequest,dg=this.currXhrId++,bg=this.pendingRequests[dg]={xhr:ug};ug.open("GET",this.url),ug.withCredentials=this.withCredentials;for(const mg in this.httpHeaders){const hg=this.httpHeaders[mg];hg!==void 0&&ug.setRequestHeader(mg,hg)}return this.isHttp&&"begin"in rg&&"end"in rg?(ug.setRequestHeader("Range",`bytes=${rg.begin}-${rg.end-1}`),bg.expectedStatus=ag):bg.expectedStatus=og,ug.responseType="arraybuffer",rg.onError&&(ug.onerror=function(mg){rg.onError(ug.status)}),ug.onreadystatechange=this.onStateChange.bind(this,dg),ug.onprogress=this.onProgress.bind(this,dg),bg.onHeadersReceived=rg.onHeadersReceived,bg.onDone=rg.onDone,bg.onError=rg.onError,bg.onProgress=rg.onProgress,ug.send(null),dg}onProgress(rg,ug){var bg;const dg=this.pendingRequests[rg];dg&&((bg=dg.onProgress)==null||bg.call(dg,ug))}onStateChange(rg,ug){var fg,wg,Gg;const dg=this.pendingRequests[rg];if(!dg)return;const bg=dg.xhr;if(bg.readyState>=2&&dg.onHeadersReceived&&(dg.onHeadersReceived(),delete dg.onHeadersReceived),bg.readyState!==4||!(rg in this.pendingRequests))return;if(delete this.pendingRequests[rg],bg.status===0&&this.isHttp){(fg=dg.onError)==null||fg.call(dg,bg.status);return}const mg=bg.status||og;if(!(mg===og&&dg.expectedStatus===ag)&&mg!==dg.expectedStatus){(wg=dg.onError)==null||wg.call(dg,bg.status);return}const pg=Ig(bg);if(mg===ag){const Zg=bg.getResponseHeader("Content-Range"),yg=/bytes (\d+)-(\d+)\/(\d+)/.exec(Zg);dg.onDone({begin:parseInt(yg[1],10),chunk:pg})}else pg?dg.onDone({begin:0,chunk:pg}):(Gg=dg.onError)==null||Gg.call(dg,bg.status)}getRequestXhr(rg){return this.pendingRequests[rg].xhr}isPendingRequest(rg){return rg in this.pendingRequests}abortRequest(rg){const ug=this.pendingRequests[rg].xhr;delete this.pendingRequests[rg],ug.abort()}}class Cg{constructor(rg){this._source=rg,this._manager=new sg(rg.url,{httpHeaders:rg.httpHeaders,withCredentials:rg.withCredentials}),this._rangeChunkSize=rg.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(rg){const ug=this._rangeRequestReaders.indexOf(rg);ug>=0&&this._rangeRequestReaders.splice(ug,1)}getFullReader(){return(0,ig.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new lg(this._manager,this._source),this._fullRequestReader}getRangeReader(rg,ug){const dg=new Ag(this._manager,rg,ug);return dg.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(dg),dg}cancelAllRequests(rg){var ug;(ug=this._fullRequestReader)==null||ug.cancel(rg);for(const dg of this._rangeRequestReaders.slice(0))dg.cancel(rg)}}eg.PDFNetworkStream=Cg;class lg{constructor(rg,ug){this._manager=rg;const dg={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=ug.url,this._fullRequestId=rg.requestFull(dg),this._headersReceivedCapability=new ig.PromiseCapability,this._disableRange=ug.disableRange||!1,this._contentLength=ug.length,this._rangeChunkSize=ug.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const rg=this._fullRequestId,ug=this._manager.getRequestXhr(rg),dg=hg=>ug.getResponseHeader(hg),{allowRangeRequests:bg,suggestedLength:mg}=(0,ng.validateRangeRequestCapabilities)({getResponseHeader:dg,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});bg&&(this._isRangeSupported=!0),this._contentLength=mg||this._contentLength,this._filename=(0,ng.extractFilenameFromHeader)(dg),this._isRangeSupported&&this._manager.abortRequest(rg),this._headersReceivedCapability.resolve()}_onDone(rg){if(rg&&(this._requests.length>0?this._requests.shift().resolve({value:rg.chunk,done:!1}):this._cachedChunks.push(rg.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const ug of this._requests)ug.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(rg){this._storedError=(0,ng.createResponseStatusError)(rg,this._url),this._headersReceivedCapability.reject(this._storedError);for(const ug of this._requests)ug.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(rg){var ug;(ug=this.onProgress)==null||ug.call(this,{loaded:rg.loaded,total:rg.lengthComputable?rg.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const rg=new ig.PromiseCapability;return this._requests.push(rg),rg.promise}cancel(rg){this._done=!0,this._headersReceivedCapability.reject(rg);for(const ug of this._requests)ug.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Ag{constructor(rg,ug,dg){this._manager=rg;const bg={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=rg.url,this._requestId=rg.requestRange(ug,dg,bg),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var rg;(rg=this.onClosed)==null||rg.call(this,this)}_onDone(rg){const ug=rg.chunk;this._requests.length>0?this._requests.shift().resolve({value:ug,done:!1}):this._queuedChunk=ug,this._done=!0;for(const dg of this._requests)dg.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(rg){this._storedError=(0,ng.createResponseStatusError)(rg,this._url);for(const ug of this._requests)ug.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(rg){var ug;this.isStreamingSupported||(ug=this.onProgress)==null||ug.call(this,{loaded:rg.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const ug=this._queuedChunk;return this._queuedChunk=null,{value:ug,done:!1}}if(this._done)return{value:void 0,done:!0};const rg=new ig.PromiseCapability;return this._requests.push(rg),rg.promise}cancel(rg){this._done=!0;for(const ug of this._requests)ug.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.PDFNodeStream=void 0;var ig=gg(1),ng=gg(20);const og=/^file:\/\/\/[a-zA-Z]:\//;function ag(dg){const bg=require$$5,mg=bg.parse(dg);return mg.protocol==="file:"||mg.host?mg:/^[a-z]:[/\\]/i.test(dg)?bg.parse(`file:///${dg}`):(mg.host||(mg.protocol="file:"),mg)}class Ig{constructor(bg){this.source=bg,this.url=ag(bg.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&bg.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var bg;return((bg=this._fullRequestReader)==null?void 0:bg._loaded)??0}getFullReader(){return(0,ig.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new rg(this):new Ag(this),this._fullRequestReader}getRangeReader(bg,mg){if(mg<=this._progressiveDataLength)return null;const hg=this.isFsUrl?new ug(this,bg,mg):new cg(this,bg,mg);return this._rangeRequestReaders.push(hg),hg}cancelAllRequests(bg){var mg;(mg=this._fullRequestReader)==null||mg.cancel(bg);for(const hg of this._rangeRequestReaders.slice(0))hg.cancel(bg)}}eg.PDFNodeStream=Ig;class sg{constructor(bg){this._url=bg.url,this._done=!1,this._storedError=null,this.onProgress=null;const mg=bg.source;this._contentLength=mg.length,this._loaded=0,this._filename=null,this._disableRange=mg.disableRange||!1,this._rangeChunkSize=mg.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!mg.disableStream,this._isRangeSupported=!mg.disableRange,this._readableStream=null,this._readCapability=new ig.PromiseCapability,this._headersCapability=new ig.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var hg;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const bg=this._readableStream.read();return bg===null?(this._readCapability=new ig.PromiseCapability,this.read()):(this._loaded+=bg.length,(hg=this.onProgress)==null||hg.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(bg).buffer,done:!1})}cancel(bg){if(!this._readableStream){this._error(bg);return}this._readableStream.destroy(bg)}_error(bg){this._storedError=bg,this._readCapability.resolve()}_setReadableStream(bg){this._readableStream=bg,bg.on("readable",()=>{this._readCapability.resolve()}),bg.on("end",()=>{bg.destroy(),this._done=!0,this._readCapability.resolve()}),bg.on("error",mg=>{this._error(mg)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ig.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Cg{constructor(bg){this._url=bg.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new ig.PromiseCapability;const mg=bg.source;this._isStreamingSupported=!mg.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var hg;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const bg=this._readableStream.read();return bg===null?(this._readCapability=new ig.PromiseCapability,this.read()):(this._loaded+=bg.length,(hg=this.onProgress)==null||hg.call(this,{loaded:this._loaded}),{value:new Uint8Array(bg).buffer,done:!1})}cancel(bg){if(!this._readableStream){this._error(bg);return}this._readableStream.destroy(bg)}_error(bg){this._storedError=bg,this._readCapability.resolve()}_setReadableStream(bg){this._readableStream=bg,bg.on("readable",()=>{this._readCapability.resolve()}),bg.on("end",()=>{bg.destroy(),this._done=!0,this._readCapability.resolve()}),bg.on("error",mg=>{this._error(mg)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function lg(dg,bg){return{protocol:dg.protocol,auth:dg.auth,host:dg.hostname,port:dg.port,path:dg.path,method:"GET",headers:bg}}class Ag extends sg{constructor(bg){super(bg);const mg=hg=>{if(hg.statusCode===404){const Gg=new ig.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=Gg,this._headersCapability.reject(Gg);return}this._headersCapability.resolve(),this._setReadableStream(hg);const pg=Gg=>this._readableStream.headers[Gg.toLowerCase()],{allowRangeRequests:fg,suggestedLength:wg}=(0,ng.validateRangeRequestCapabilities)({getResponseHeader:pg,isHttp:bg.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=fg,this._contentLength=wg||this._contentLength,this._filename=(0,ng.extractFilenameFromHeader)(pg)};if(this._request=null,this._url.protocol==="http:"){const hg=require$$5;this._request=hg.request(lg(this._url,bg.httpHeaders),mg)}else{const hg=require$$5;this._request=hg.request(lg(this._url,bg.httpHeaders),mg)}this._request.on("error",hg=>{this._storedError=hg,this._headersCapability.reject(hg)}),this._request.end()}}class cg extends Cg{constructor(bg,mg,hg){super(bg),this._httpHeaders={};for(const fg in bg.httpHeaders){const wg=bg.httpHeaders[fg];wg!==void 0&&(this._httpHeaders[fg]=wg)}this._httpHeaders.Range=`bytes=${mg}-${hg-1}`;const pg=fg=>{if(fg.statusCode===404){const wg=new ig.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=wg;return}this._setReadableStream(fg)};if(this._request=null,this._url.protocol==="http:"){const fg=require$$5;this._request=fg.request(lg(this._url,this._httpHeaders),pg)}else{const fg=require$$5;this._request=fg.request(lg(this._url,this._httpHeaders),pg)}this._request.on("error",fg=>{this._storedError=fg}),this._request.end()}}class rg extends sg{constructor(bg){super(bg);let mg=decodeURIComponent(this._url.path);og.test(this._url.href)&&(mg=mg.replace(/^\//,""));const hg=require$$5;hg.lstat(mg,(pg,fg)=>{if(pg){pg.code==="ENOENT"&&(pg=new ig.MissingPDFException(`Missing PDF "${mg}".`)),this._storedError=pg,this._headersCapability.reject(pg);return}this._contentLength=fg.size,this._setReadableStream(hg.createReadStream(mg)),this._headersCapability.resolve()})}}class ug extends Cg{constructor(bg,mg,hg){super(bg);let pg=decodeURIComponent(this._url.path);og.test(this._url.href)&&(pg=pg.replace(/^\//,""));const fg=require$$5;this._setReadableStream(fg.createReadStream(pg,{start:mg,end:hg-1}))}}}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.SVGGraphics=void 0;var ig=gg(6),ng=gg(1);const og={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},ag="http://www.w3.org/XML/1998/namespace",Ig="http://www.w3.org/1999/xlink",sg=["butt","round","square"],Cg=["miter","round","bevel"],lg=function(fg,wg="",Gg=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!Gg)return URL.createObjectURL(new Blob([fg],{type:wg}));const Zg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let yg=`data:${wg};base64,`;for(let Bg=0,Wg=fg.length;Bg<Wg;Bg+=3){const $g=fg[Bg]&255,Ng=fg[Bg+1]&255,vg=fg[Bg+2]&255,Xg=$g>>2,Vg=($g&3)<<4|Ng>>4,Mg=Bg+1<Wg?(Ng&15)<<2|vg>>6:64,Rg=Bg+2<Wg?vg&63:64;yg+=Zg[Xg]+Zg[Vg]+Zg[Mg]+Zg[Rg]}return yg},Ag=(function(){const fg=new Uint8Array([137,80,78,71,13,10,26,10]),wg=12,Gg=new Int32Array(256);for(let vg=0;vg<256;vg++){let Xg=vg;for(let Vg=0;Vg<8;Vg++)Xg=Xg&1?3988292384^Xg>>1&2147483647:Xg>>1&2147483647;Gg[vg]=Xg}function Zg(vg,Xg,Vg){let Mg=-1;for(let Rg=Xg;Rg<Vg;Rg++){const Sg=(Mg^vg[Rg])&255,Yg=Gg[Sg];Mg=Mg>>>8^Yg}return Mg^-1}function yg(vg,Xg,Vg,Mg){let Rg=Mg;const Sg=Xg.length;Vg[Rg]=Sg>>24&255,Vg[Rg+1]=Sg>>16&255,Vg[Rg+2]=Sg>>8&255,Vg[Rg+3]=Sg&255,Rg+=4,Vg[Rg]=vg.charCodeAt(0)&255,Vg[Rg+1]=vg.charCodeAt(1)&255,Vg[Rg+2]=vg.charCodeAt(2)&255,Vg[Rg+3]=vg.charCodeAt(3)&255,Rg+=4,Vg.set(Xg,Rg),Rg+=Xg.length;const Yg=Zg(Vg,Mg+4,Rg);Vg[Rg]=Yg>>24&255,Vg[Rg+1]=Yg>>16&255,Vg[Rg+2]=Yg>>8&255,Vg[Rg+3]=Yg&255}function Bg(vg,Xg,Vg){let Mg=1,Rg=0;for(let Sg=Xg;Sg<Vg;++Sg)Mg=(Mg+(vg[Sg]&255))%65521,Rg=(Rg+Mg)%65521;return Rg<<16|Mg}function Wg(vg){if(!ng.isNodeJS)return $g(vg);try{const Xg=parseInt(process.versions.node)>=8?vg:Buffer.from(vg),Vg=require$$5.deflateSync(Xg,{level:9});return Vg instanceof Uint8Array?Vg:new Uint8Array(Vg)}catch(Xg){(0,ng.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Xg)}return $g(vg)}function $g(vg){let Xg=vg.length;const Vg=65535,Mg=Math.ceil(Xg/Vg),Rg=new Uint8Array(2+Xg+Mg*5+4);let Sg=0;Rg[Sg++]=120,Rg[Sg++]=156;let Yg=0;for(;Xg>Vg;)Rg[Sg++]=0,Rg[Sg++]=255,Rg[Sg++]=255,Rg[Sg++]=0,Rg[Sg++]=0,Rg.set(vg.subarray(Yg,Yg+Vg),Sg),Sg+=Vg,Yg+=Vg,Xg-=Vg;Rg[Sg++]=1,Rg[Sg++]=Xg&255,Rg[Sg++]=Xg>>8&255,Rg[Sg++]=~Xg&65535&255,Rg[Sg++]=(~Xg&65535)>>8&255,Rg.set(vg.subarray(Yg),Sg),Sg+=vg.length-Yg;const xg=Bg(vg,0,vg.length);return Rg[Sg++]=xg>>24&255,Rg[Sg++]=xg>>16&255,Rg[Sg++]=xg>>8&255,Rg[Sg++]=xg&255,Rg}function Ng(vg,Xg,Vg,Mg){const Rg=vg.width,Sg=vg.height;let Yg,xg,Og;const Kg=vg.data;switch(Xg){case ng.ImageKind.GRAYSCALE_1BPP:xg=0,Yg=1,Og=Rg+7>>3;break;case ng.ImageKind.RGB_24BPP:xg=2,Yg=8,Og=Rg*3;break;case ng.ImageKind.RGBA_32BPP:xg=6,Yg=8,Og=Rg*4;break;default:throw new Error("invalid format")}const Dg=new Uint8Array((1+Og)*Sg);let Fg=0,Tg=0;for(let pa=0;pa<Sg;++pa)Dg[Fg++]=0,Dg.set(Kg.subarray(Tg,Tg+Og),Fg),Tg+=Og,Fg+=Og;if(Xg===ng.ImageKind.GRAYSCALE_1BPP&&Mg){Fg=0;for(let pa=0;pa<Sg;pa++){Fg++;for(let eI=0;eI<Og;eI++)Dg[Fg++]^=255}}const Jg=new Uint8Array([Rg>>24&255,Rg>>16&255,Rg>>8&255,Rg&255,Sg>>24&255,Sg>>16&255,Sg>>8&255,Sg&255,Yg,xg,0,0,0]),Eg=Wg(Dg),co=fg.length+wg*3+Jg.length+Eg.length,da=new Uint8Array(co);let ma=0;return da.set(fg,ma),ma+=fg.length,yg("IHDR",Jg,da,ma),ma+=wg+Jg.length,yg("IDATA",Eg,da,ma),ma+=wg+Eg.length,yg("IEND",new Uint8Array(0),da,ma),lg(da,"image/png",Vg)}return function(Xg,Vg,Mg){const Rg=Xg.kind===void 0?ng.ImageKind.GRAYSCALE_1BPP:Xg.kind;return Ng(Xg,Rg,Vg,Mg)}})();class cg{constructor(){this.fontSizeScale=1,this.fontWeight=og.fontWeight,this.fontSize=0,this.textMatrix=ng.IDENTITY_MATRIX,this.fontMatrix=ng.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=ng.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=og.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(wg,Gg){this.x=wg,this.y=Gg}}function rg(fg){let wg=[];const Gg=[];for(const Zg of fg){if(Zg.fn==="save"){wg.push({fnId:92,fn:"group",items:[]}),Gg.push(wg),wg=wg.at(-1).items;continue}Zg.fn==="restore"?wg=Gg.pop():wg.push(Zg)}return wg}function ug(fg){if(Number.isInteger(fg))return fg.toString();const wg=fg.toFixed(10);let Gg=wg.length-1;if(wg[Gg]!=="0")return wg;do Gg--;while(wg[Gg]==="0");return wg.substring(0,wg[Gg]==="."?Gg:Gg+1)}function dg(fg){if(fg[4]===0&&fg[5]===0){if(fg[1]===0&&fg[2]===0)return fg[0]===1&&fg[3]===1?"":`scale(${ug(fg[0])} ${ug(fg[3])})`;if(fg[0]===fg[3]&&fg[1]===-fg[2]){const wg=Math.acos(fg[0])*180/Math.PI;return`rotate(${ug(wg)})`}}else if(fg[0]===1&&fg[1]===0&&fg[2]===0&&fg[3]===1)return`translate(${ug(fg[4])} ${ug(fg[5])})`;return`matrix(${ug(fg[0])} ${ug(fg[1])} ${ug(fg[2])} ${ug(fg[3])} ${ug(fg[4])} ${ug(fg[5])})`}let bg=0,mg=0,hg=0;class pg{constructor(wg,Gg,Zg=!1){(0,ig.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new ig.DOMSVGFactory,this.current=new cg,this.transformMatrix=ng.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=wg,this.objs=Gg,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!Zg,this._operatorIdMapping=[];for(const yg in ng.OPS)this._operatorIdMapping[ng.OPS[yg]]=yg}getObject(wg,Gg=null){return typeof wg=="string"?wg.startsWith("g_")?this.commonObjs.get(wg):this.objs.get(wg):Gg}save(){this.transformStack.push(this.transformMatrix);const wg=this.current;this.extraStack.push(wg),this.current=wg.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(wg){this.save(),this.executeOpTree(wg),this.restore()}loadDependencies(wg){const Gg=wg.fnArray,Zg=wg.argsArray;for(let yg=0,Bg=Gg.length;yg<Bg;yg++)if(Gg[yg]===ng.OPS.dependency)for(const Wg of Zg[yg]){const $g=Wg.startsWith("g_")?this.commonObjs:this.objs,Ng=new Promise(vg=>{$g.get(Wg,vg)});this.current.dependencies.push(Ng)}return Promise.all(this.current.dependencies)}transform(wg,Gg,Zg,yg,Bg,Wg){const $g=[wg,Gg,Zg,yg,Bg,Wg];this.transformMatrix=ng.Util.transform(this.transformMatrix,$g),this.tgrp=null}getSVG(wg,Gg){this.viewport=Gg;const Zg=this._initialize(Gg);return this.loadDependencies(wg).then(()=>(this.transformMatrix=ng.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(wg)),Zg))}convertOpList(wg){const Gg=this._operatorIdMapping,Zg=wg.argsArray,yg=wg.fnArray,Bg=[];for(let Wg=0,$g=yg.length;Wg<$g;Wg++){const Ng=yg[Wg];Bg.push({fnId:Ng,fn:Gg[Ng],args:Zg[Wg]})}return rg(Bg)}executeOpTree(wg){for(const Gg of wg){const Zg=Gg.fn,yg=Gg.fnId,Bg=Gg.args;switch(yg|0){case ng.OPS.beginText:this.beginText();break;case ng.OPS.dependency:break;case ng.OPS.setLeading:this.setLeading(Bg);break;case ng.OPS.setLeadingMoveText:this.setLeadingMoveText(Bg[0],Bg[1]);break;case ng.OPS.setFont:this.setFont(Bg);break;case ng.OPS.showText:this.showText(Bg[0]);break;case ng.OPS.showSpacedText:this.showText(Bg[0]);break;case ng.OPS.endText:this.endText();break;case ng.OPS.moveText:this.moveText(Bg[0],Bg[1]);break;case ng.OPS.setCharSpacing:this.setCharSpacing(Bg[0]);break;case ng.OPS.setWordSpacing:this.setWordSpacing(Bg[0]);break;case ng.OPS.setHScale:this.setHScale(Bg[0]);break;case ng.OPS.setTextMatrix:this.setTextMatrix(Bg[0],Bg[1],Bg[2],Bg[3],Bg[4],Bg[5]);break;case ng.OPS.setTextRise:this.setTextRise(Bg[0]);break;case ng.OPS.setTextRenderingMode:this.setTextRenderingMode(Bg[0]);break;case ng.OPS.setLineWidth:this.setLineWidth(Bg[0]);break;case ng.OPS.setLineJoin:this.setLineJoin(Bg[0]);break;case ng.OPS.setLineCap:this.setLineCap(Bg[0]);break;case ng.OPS.setMiterLimit:this.setMiterLimit(Bg[0]);break;case ng.OPS.setFillRGBColor:this.setFillRGBColor(Bg[0],Bg[1],Bg[2]);break;case ng.OPS.setStrokeRGBColor:this.setStrokeRGBColor(Bg[0],Bg[1],Bg[2]);break;case ng.OPS.setStrokeColorN:this.setStrokeColorN(Bg);break;case ng.OPS.setFillColorN:this.setFillColorN(Bg);break;case ng.OPS.shadingFill:this.shadingFill(Bg[0]);break;case ng.OPS.setDash:this.setDash(Bg[0],Bg[1]);break;case ng.OPS.setRenderingIntent:this.setRenderingIntent(Bg[0]);break;case ng.OPS.setFlatness:this.setFlatness(Bg[0]);break;case ng.OPS.setGState:this.setGState(Bg[0]);break;case ng.OPS.fill:this.fill();break;case ng.OPS.eoFill:this.eoFill();break;case ng.OPS.stroke:this.stroke();break;case ng.OPS.fillStroke:this.fillStroke();break;case ng.OPS.eoFillStroke:this.eoFillStroke();break;case ng.OPS.clip:this.clip("nonzero");break;case ng.OPS.eoClip:this.clip("evenodd");break;case ng.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case ng.OPS.paintImageXObject:this.paintImageXObject(Bg[0]);break;case ng.OPS.paintInlineImageXObject:this.paintInlineImageXObject(Bg[0]);break;case ng.OPS.paintImageMaskXObject:this.paintImageMaskXObject(Bg[0]);break;case ng.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(Bg[0],Bg[1]);break;case ng.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case ng.OPS.closePath:this.closePath();break;case ng.OPS.closeStroke:this.closeStroke();break;case ng.OPS.closeFillStroke:this.closeFillStroke();break;case ng.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case ng.OPS.nextLine:this.nextLine();break;case ng.OPS.transform:this.transform(Bg[0],Bg[1],Bg[2],Bg[3],Bg[4],Bg[5]);break;case ng.OPS.constructPath:this.constructPath(Bg[0],Bg[1]);break;case ng.OPS.endPath:this.endPath();break;case 92:this.group(Gg.items);break;default:(0,ng.warn)(`Unimplemented operator ${Zg}`);break}}}setWordSpacing(wg){this.current.wordSpacing=wg}setCharSpacing(wg){this.current.charSpacing=wg}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(wg,Gg,Zg,yg,Bg,Wg){const $g=this.current;$g.textMatrix=$g.lineMatrix=[wg,Gg,Zg,yg,Bg,Wg],$g.textMatrixScale=Math.hypot(wg,Gg),$g.x=$g.lineX=0,$g.y=$g.lineY=0,$g.xcoords=[],$g.ycoords=[],$g.tspan=this.svgFactory.createElement("svg:tspan"),$g.tspan.setAttributeNS(null,"font-family",$g.fontFamily),$g.tspan.setAttributeNS(null,"font-size",`${ug($g.fontSize)}px`),$g.tspan.setAttributeNS(null,"y",ug(-$g.y)),$g.txtElement=this.svgFactory.createElement("svg:text"),$g.txtElement.append($g.tspan)}beginText(){const wg=this.current;wg.x=wg.lineX=0,wg.y=wg.lineY=0,wg.textMatrix=ng.IDENTITY_MATRIX,wg.lineMatrix=ng.IDENTITY_MATRIX,wg.textMatrixScale=1,wg.tspan=this.svgFactory.createElement("svg:tspan"),wg.txtElement=this.svgFactory.createElement("svg:text"),wg.txtgrp=this.svgFactory.createElement("svg:g"),wg.xcoords=[],wg.ycoords=[]}moveText(wg,Gg){const Zg=this.current;Zg.x=Zg.lineX+=wg,Zg.y=Zg.lineY+=Gg,Zg.xcoords=[],Zg.ycoords=[],Zg.tspan=this.svgFactory.createElement("svg:tspan"),Zg.tspan.setAttributeNS(null,"font-family",Zg.fontFamily),Zg.tspan.setAttributeNS(null,"font-size",`${ug(Zg.fontSize)}px`),Zg.tspan.setAttributeNS(null,"y",ug(-Zg.y))}showText(wg){const Gg=this.current,Zg=Gg.font,yg=Gg.fontSize;if(yg===0)return;const Bg=Gg.fontSizeScale,Wg=Gg.charSpacing,$g=Gg.wordSpacing,Ng=Gg.fontDirection,vg=Gg.textHScale*Ng,Xg=Zg.vertical,Vg=Xg?1:-1,Mg=Zg.defaultVMetrics,Rg=yg*Gg.fontMatrix[0];let Sg=0;for(const Og of wg){if(Og===null){Sg+=Ng*$g;continue}else if(typeof Og=="number"){Sg+=Vg*Og*yg/1e3;continue}const Kg=(Og.isSpace?$g:0)+Wg,Dg=Og.fontChar;let Fg,Tg,Jg=Og.width;if(Xg){let co;const da=Og.vmetric||Mg;co=Og.vmetric?da[1]:Jg*.5,co=-co*Rg;const ma=da[2]*Rg;Jg=da?-da[0]:Jg,Fg=co/Bg,Tg=(Sg+ma)/Bg}else Fg=Sg/Bg,Tg=0;(Og.isInFont||Zg.missingFile)&&(Gg.xcoords.push(Gg.x+Fg),Xg&&Gg.ycoords.push(-Gg.y+Tg),Gg.tspan.textContent+=Dg);const Eg=Xg?Jg*Rg-Kg*Ng:Jg*Rg+Kg*Ng;Sg+=Eg}Gg.tspan.setAttributeNS(null,"x",Gg.xcoords.map(ug).join(" ")),Xg?Gg.tspan.setAttributeNS(null,"y",Gg.ycoords.map(ug).join(" ")):Gg.tspan.setAttributeNS(null,"y",ug(-Gg.y)),Xg?Gg.y-=Sg:Gg.x+=Sg*vg,Gg.tspan.setAttributeNS(null,"font-family",Gg.fontFamily),Gg.tspan.setAttributeNS(null,"font-size",`${ug(Gg.fontSize)}px`),Gg.fontStyle!==og.fontStyle&&Gg.tspan.setAttributeNS(null,"font-style",Gg.fontStyle),Gg.fontWeight!==og.fontWeight&&Gg.tspan.setAttributeNS(null,"font-weight",Gg.fontWeight);const Yg=Gg.textRenderingMode&ng.TextRenderingMode.FILL_STROKE_MASK;if(Yg===ng.TextRenderingMode.FILL||Yg===ng.TextRenderingMode.FILL_STROKE?(Gg.fillColor!==og.fillColor&&Gg.tspan.setAttributeNS(null,"fill",Gg.fillColor),Gg.fillAlpha<1&&Gg.tspan.setAttributeNS(null,"fill-opacity",Gg.fillAlpha)):Gg.textRenderingMode===ng.TextRenderingMode.ADD_TO_PATH?Gg.tspan.setAttributeNS(null,"fill","transparent"):Gg.tspan.setAttributeNS(null,"fill","none"),Yg===ng.TextRenderingMode.STROKE||Yg===ng.TextRenderingMode.FILL_STROKE){const Og=1/(Gg.textMatrixScale||1);this._setStrokeAttributes(Gg.tspan,Og)}let xg=Gg.textMatrix;Gg.textRise!==0&&(xg=xg.slice(),xg[5]+=Gg.textRise),Gg.txtElement.setAttributeNS(null,"transform",`${dg(xg)} scale(${ug(vg)}, -1)`),Gg.txtElement.setAttributeNS(ag,"xml:space","preserve"),Gg.txtElement.append(Gg.tspan),Gg.txtgrp.append(Gg.txtElement),this._ensureTransformGroup().append(Gg.txtElement)}setLeadingMoveText(wg,Gg){this.setLeading(-Gg),this.moveText(wg,Gg)}addFontStyle(wg){if(!wg.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const Gg=lg(wg.data,wg.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${wg.loadedName}"; src: url(${Gg}); }
963
963
  `}setFont(wg){const Gg=this.current,Zg=this.commonObjs.get(wg[0]);let yg=wg[1];Gg.font=Zg,this.embedFonts&&!Zg.missingFile&&!this.embeddedFonts[Zg.loadedName]&&(this.addFontStyle(Zg),this.embeddedFonts[Zg.loadedName]=Zg),Gg.fontMatrix=Zg.fontMatrix||ng.FONT_IDENTITY_MATRIX;let Bg="normal";Zg.black?Bg="900":Zg.bold&&(Bg="bold");const Wg=Zg.italic?"italic":"normal";yg<0?(yg=-yg,Gg.fontDirection=-1):Gg.fontDirection=1,Gg.fontSize=yg,Gg.fontFamily=Zg.loadedName,Gg.fontWeight=Bg,Gg.fontStyle=Wg,Gg.tspan=this.svgFactory.createElement("svg:tspan"),Gg.tspan.setAttributeNS(null,"y",ug(-Gg.y)),Gg.xcoords=[],Gg.ycoords=[]}endText(){var Gg;const wg=this.current;wg.textRenderingMode&ng.TextRenderingMode.ADD_TO_PATH_FLAG&&((Gg=wg.txtElement)!=null&&Gg.hasChildNodes())&&(wg.element=wg.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(wg){wg>0&&(this.current.lineWidth=wg)}setLineCap(wg){this.current.lineCap=sg[wg]}setLineJoin(wg){this.current.lineJoin=Cg[wg]}setMiterLimit(wg){this.current.miterLimit=wg}setStrokeAlpha(wg){this.current.strokeAlpha=wg}setStrokeRGBColor(wg,Gg,Zg){this.current.strokeColor=ng.Util.makeHexColor(wg,Gg,Zg)}setFillAlpha(wg){this.current.fillAlpha=wg}setFillRGBColor(wg,Gg,Zg){this.current.fillColor=ng.Util.makeHexColor(wg,Gg,Zg),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(wg){this.current.strokeColor=this._makeColorN_Pattern(wg)}setFillColorN(wg){this.current.fillColor=this._makeColorN_Pattern(wg)}shadingFill(wg){const{width:Gg,height:Zg}=this.viewport,yg=ng.Util.inverseTransform(this.transformMatrix),[Bg,Wg,$g,Ng]=ng.Util.getAxialAlignedBoundingBox([0,0,Gg,Zg],yg),vg=this.svgFactory.createElement("svg:rect");vg.setAttributeNS(null,"x",Bg),vg.setAttributeNS(null,"y",Wg),vg.setAttributeNS(null,"width",$g-Bg),vg.setAttributeNS(null,"height",Ng-Wg),vg.setAttributeNS(null,"fill",this._makeShadingPattern(wg)),this.current.fillAlpha<1&&vg.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(vg)}_makeColorN_Pattern(wg){return wg[0]==="TilingPattern"?this._makeTilingPattern(wg):this._makeShadingPattern(wg)}_makeTilingPattern(wg){const Gg=wg[1],Zg=wg[2],yg=wg[3]||ng.IDENTITY_MATRIX,[Bg,Wg,$g,Ng]=wg[4],vg=wg[5],Xg=wg[6],Vg=wg[7],Mg=`shading${hg++}`,[Rg,Sg,Yg,xg]=ng.Util.normalizeRect([...ng.Util.applyTransform([Bg,Wg],yg),...ng.Util.applyTransform([$g,Ng],yg)]),[Og,Kg]=ng.Util.singularValueDecompose2dScale(yg),Dg=vg*Og,Fg=Xg*Kg,Tg=this.svgFactory.createElement("svg:pattern");Tg.setAttributeNS(null,"id",Mg),Tg.setAttributeNS(null,"patternUnits","userSpaceOnUse"),Tg.setAttributeNS(null,"width",Dg),Tg.setAttributeNS(null,"height",Fg),Tg.setAttributeNS(null,"x",`${Rg}`),Tg.setAttributeNS(null,"y",`${Sg}`);const Jg=this.svg,Eg=this.transformMatrix,co=this.current.fillColor,da=this.current.strokeColor,ma=this.svgFactory.create(Yg-Rg,xg-Sg);if(this.svg=ma,this.transformMatrix=yg,Vg===2){const pa=ng.Util.makeHexColor(...Gg);this.current.fillColor=pa,this.current.strokeColor=pa}return this.executeOpTree(this.convertOpList(Zg)),this.svg=Jg,this.transformMatrix=Eg,this.current.fillColor=co,this.current.strokeColor=da,Tg.append(ma.childNodes[0]),this.defs.append(Tg),`url(#${Mg})`}_makeShadingPattern(wg){switch(typeof wg=="string"&&(wg=this.objs.get(wg)),wg[0]){case"RadialAxial":const Gg=`shading${hg++}`,Zg=wg[3];let yg;switch(wg[1]){case"axial":const Bg=wg[4],Wg=wg[5];yg=this.svgFactory.createElement("svg:linearGradient"),yg.setAttributeNS(null,"id",Gg),yg.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),yg.setAttributeNS(null,"x1",Bg[0]),yg.setAttributeNS(null,"y1",Bg[1]),yg.setAttributeNS(null,"x2",Wg[0]),yg.setAttributeNS(null,"y2",Wg[1]);break;case"radial":const $g=wg[4],Ng=wg[5],vg=wg[6],Xg=wg[7];yg=this.svgFactory.createElement("svg:radialGradient"),yg.setAttributeNS(null,"id",Gg),yg.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),yg.setAttributeNS(null,"cx",Ng[0]),yg.setAttributeNS(null,"cy",Ng[1]),yg.setAttributeNS(null,"r",Xg),yg.setAttributeNS(null,"fx",$g[0]),yg.setAttributeNS(null,"fy",$g[1]),yg.setAttributeNS(null,"fr",vg);break;default:throw new Error(`Unknown RadialAxial type: ${wg[1]}`)}for(const Bg of Zg){const Wg=this.svgFactory.createElement("svg:stop");Wg.setAttributeNS(null,"offset",Bg[0]),Wg.setAttributeNS(null,"stop-color",Bg[1]),yg.append(Wg)}return this.defs.append(yg),`url(#${Gg})`;case"Mesh":return(0,ng.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${wg[0]}`)}}setDash(wg,Gg){this.current.dashArray=wg,this.current.dashPhase=Gg}constructPath(wg,Gg){const Zg=this.current;let yg=Zg.x,Bg=Zg.y,Wg=[],$g=0;for(const Ng of wg)switch(Ng|0){case ng.OPS.rectangle:yg=Gg[$g++],Bg=Gg[$g++];const vg=Gg[$g++],Xg=Gg[$g++],Vg=yg+vg,Mg=Bg+Xg;Wg.push("M",ug(yg),ug(Bg),"L",ug(Vg),ug(Bg),"L",ug(Vg),ug(Mg),"L",ug(yg),ug(Mg),"Z");break;case ng.OPS.moveTo:yg=Gg[$g++],Bg=Gg[$g++],Wg.push("M",ug(yg),ug(Bg));break;case ng.OPS.lineTo:yg=Gg[$g++],Bg=Gg[$g++],Wg.push("L",ug(yg),ug(Bg));break;case ng.OPS.curveTo:yg=Gg[$g+4],Bg=Gg[$g+5],Wg.push("C",ug(Gg[$g]),ug(Gg[$g+1]),ug(Gg[$g+2]),ug(Gg[$g+3]),ug(yg),ug(Bg)),$g+=6;break;case ng.OPS.curveTo2:Wg.push("C",ug(yg),ug(Bg),ug(Gg[$g]),ug(Gg[$g+1]),ug(Gg[$g+2]),ug(Gg[$g+3])),yg=Gg[$g+2],Bg=Gg[$g+3],$g+=4;break;case ng.OPS.curveTo3:yg=Gg[$g+2],Bg=Gg[$g+3],Wg.push("C",ug(Gg[$g]),ug(Gg[$g+1]),ug(yg),ug(Bg),ug(yg),ug(Bg)),$g+=4;break;case ng.OPS.closePath:Wg.push("Z");break}Wg=Wg.join(" "),Zg.path&&wg.length>0&&wg[0]!==ng.OPS.rectangle&&wg[0]!==ng.OPS.moveTo?Wg=Zg.path.getAttributeNS(null,"d")+Wg:(Zg.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(Zg.path)),Zg.path.setAttributeNS(null,"d",Wg),Zg.path.setAttributeNS(null,"fill","none"),Zg.element=Zg.path,Zg.setCurrentPoint(yg,Bg)}endPath(){const wg=this.current;if(wg.path=null,!this.pendingClip)return;if(!wg.element){this.pendingClip=null;return}const Gg=`clippath${bg++}`,Zg=this.svgFactory.createElement("svg:clipPath");Zg.setAttributeNS(null,"id",Gg),Zg.setAttributeNS(null,"transform",dg(this.transformMatrix));const yg=wg.element.cloneNode(!0);if(this.pendingClip==="evenodd"?yg.setAttributeNS(null,"clip-rule","evenodd"):yg.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,Zg.append(yg),this.defs.append(Zg),wg.activeClipUrl){wg.clipGroup=null;for(const Bg of this.extraStack)Bg.clipGroup=null;Zg.setAttributeNS(null,"clip-path",wg.activeClipUrl)}wg.activeClipUrl=`url(#${Gg})`,this.tgrp=null}clip(wg){this.pendingClip=wg}closePath(){const wg=this.current;if(wg.path){const Gg=`${wg.path.getAttributeNS(null,"d")}Z`;wg.path.setAttributeNS(null,"d",Gg)}}setLeading(wg){this.current.leading=-wg}setTextRise(wg){this.current.textRise=wg}setTextRenderingMode(wg){this.current.textRenderingMode=wg}setHScale(wg){this.current.textHScale=wg/100}setRenderingIntent(wg){}setFlatness(wg){}setGState(wg){for(const[Gg,Zg]of wg)switch(Gg){case"LW":this.setLineWidth(Zg);break;case"LC":this.setLineCap(Zg);break;case"LJ":this.setLineJoin(Zg);break;case"ML":this.setMiterLimit(Zg);break;case"D":this.setDash(Zg[0],Zg[1]);break;case"RI":this.setRenderingIntent(Zg);break;case"FL":this.setFlatness(Zg);break;case"Font":this.setFont(Zg);break;case"CA":this.setStrokeAlpha(Zg);break;case"ca":this.setFillAlpha(Zg);break;default:(0,ng.warn)(`Unimplemented graphic state operator ${Gg}`);break}}fill(){const wg=this.current;wg.element&&(wg.element.setAttributeNS(null,"fill",wg.fillColor),wg.element.setAttributeNS(null,"fill-opacity",wg.fillAlpha),this.endPath())}stroke(){const wg=this.current;wg.element&&(this._setStrokeAttributes(wg.element),wg.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(wg,Gg=1){const Zg=this.current;let yg=Zg.dashArray;Gg!==1&&yg.length>0&&(yg=yg.map(function(Bg){return Gg*Bg})),wg.setAttributeNS(null,"stroke",Zg.strokeColor),wg.setAttributeNS(null,"stroke-opacity",Zg.strokeAlpha),wg.setAttributeNS(null,"stroke-miterlimit",ug(Zg.miterLimit)),wg.setAttributeNS(null,"stroke-linecap",Zg.lineCap),wg.setAttributeNS(null,"stroke-linejoin",Zg.lineJoin),wg.setAttributeNS(null,"stroke-width",ug(Gg*Zg.lineWidth)+"px"),wg.setAttributeNS(null,"stroke-dasharray",yg.map(ug).join(" ")),wg.setAttributeNS(null,"stroke-dashoffset",ug(Gg*Zg.dashPhase)+"px")}eoFill(){var wg;(wg=this.current.element)==null||wg.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var wg;(wg=this.current.element)==null||wg.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const wg=this.svgFactory.createElement("svg:rect");wg.setAttributeNS(null,"x","0"),wg.setAttributeNS(null,"y","0"),wg.setAttributeNS(null,"width","1px"),wg.setAttributeNS(null,"height","1px"),wg.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(wg)}paintImageXObject(wg){const Gg=this.getObject(wg);if(!Gg){(0,ng.warn)(`Dependent image with object ID ${wg} is not ready yet`);return}this.paintInlineImageXObject(Gg)}paintInlineImageXObject(wg,Gg){const Zg=wg.width,yg=wg.height,Bg=Ag(wg,this.forceDataSchema,!!Gg),Wg=this.svgFactory.createElement("svg:rect");Wg.setAttributeNS(null,"x","0"),Wg.setAttributeNS(null,"y","0"),Wg.setAttributeNS(null,"width",ug(Zg)),Wg.setAttributeNS(null,"height",ug(yg)),this.current.element=Wg,this.clip("nonzero");const $g=this.svgFactory.createElement("svg:image");$g.setAttributeNS(Ig,"xlink:href",Bg),$g.setAttributeNS(null,"x","0"),$g.setAttributeNS(null,"y",ug(-yg)),$g.setAttributeNS(null,"width",ug(Zg)+"px"),$g.setAttributeNS(null,"height",ug(yg)+"px"),$g.setAttributeNS(null,"transform",`scale(${ug(1/Zg)} ${ug(-1/yg)})`),Gg?Gg.append($g):this._ensureTransformGroup().append($g)}paintImageMaskXObject(wg){const Gg=this.getObject(wg.data,wg);if(Gg.bitmap){(0,ng.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const Zg=this.current,yg=Gg.width,Bg=Gg.height,Wg=Zg.fillColor;Zg.maskId=`mask${mg++}`;const $g=this.svgFactory.createElement("svg:mask");$g.setAttributeNS(null,"id",Zg.maskId);const Ng=this.svgFactory.createElement("svg:rect");Ng.setAttributeNS(null,"x","0"),Ng.setAttributeNS(null,"y","0"),Ng.setAttributeNS(null,"width",ug(yg)),Ng.setAttributeNS(null,"height",ug(Bg)),Ng.setAttributeNS(null,"fill",Wg),Ng.setAttributeNS(null,"mask",`url(#${Zg.maskId})`),this.defs.append($g),this._ensureTransformGroup().append(Ng),this.paintInlineImageXObject(Gg,$g)}paintFormXObjectBegin(wg,Gg){if(Array.isArray(wg)&&wg.length===6&&this.transform(wg[0],wg[1],wg[2],wg[3],wg[4],wg[5]),Gg){const Zg=Gg[2]-Gg[0],yg=Gg[3]-Gg[1],Bg=this.svgFactory.createElement("svg:rect");Bg.setAttributeNS(null,"x",Gg[0]),Bg.setAttributeNS(null,"y",Gg[1]),Bg.setAttributeNS(null,"width",ug(Zg)),Bg.setAttributeNS(null,"height",ug(yg)),this.current.element=Bg,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(wg){const Gg=this.svgFactory.create(wg.width,wg.height),Zg=this.svgFactory.createElement("svg:defs");Gg.append(Zg),this.defs=Zg;const yg=this.svgFactory.createElement("svg:g");return yg.setAttributeNS(null,"transform",dg(wg.transform)),Gg.append(yg),this.svg=yg,Gg}_ensureClipGroup(){if(!this.current.clipGroup){const wg=this.svgFactory.createElement("svg:g");wg.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(wg),this.current.clipGroup=wg}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",dg(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}eg.SVGGraphics=pg}),((tg,eg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.XfaText=void 0;class gg{static textContent(ng){const og=[],ag={items:og,styles:Object.create(null)};function Ig(sg){var Ag;if(!sg)return;let Cg=null;const lg=sg.name;if(lg==="#text")Cg=sg.value;else if(gg.shouldBuildText(lg))(Ag=sg==null?void 0:sg.attributes)!=null&&Ag.textContent?Cg=sg.attributes.textContent:sg.value&&(Cg=sg.value);else return;if(Cg!==null&&og.push({str:Cg}),!!sg.children)for(const cg of sg.children)Ig(cg)}return Ig(ng),ag}static shouldBuildText(ng){return!(ng==="textarea"||ng==="input"||ng==="option"||ng==="select")}}eg.XfaText=gg}),((tg,eg,gg)=>{Object.defineProperty(eg,"__esModule",{value:!0}),eg.TextLayerRenderTask=void 0,eg.renderTextLayer=dg,eg.updateTextLayer=bg;var ig=gg(1),ng=gg(6);const og=1e5,ag=30,Ig=.8,sg=new Map;function Cg(mg,hg){let pg;if(hg&&ig.FeatureTest.isOffscreenCanvasSupported)pg=new OffscreenCanvas(mg,mg).getContext("2d",{alpha:!1});else{const fg=document.createElement("canvas");fg.width=fg.height=mg,pg=fg.getContext("2d",{alpha:!1})}return pg}function lg(mg,hg){const pg=sg.get(mg);if(pg)return pg;const fg=Cg(ag,hg);fg.font=`${ag}px ${mg}`;const wg=fg.measureText("");let Gg=wg.fontBoundingBoxAscent,Zg=Math.abs(wg.fontBoundingBoxDescent);if(Gg){const Bg=Gg/(Gg+Zg);return sg.set(mg,Bg),fg.canvas.width=fg.canvas.height=0,Bg}fg.strokeStyle="red",fg.clearRect(0,0,ag,ag),fg.strokeText("g",0,0);let yg=fg.getImageData(0,0,ag,ag).data;Zg=0;for(let Bg=yg.length-1-3;Bg>=0;Bg-=4)if(yg[Bg]>0){Zg=Math.ceil(Bg/4/ag);break}fg.clearRect(0,0,ag,ag),fg.strokeText("A",0,ag),yg=fg.getImageData(0,0,ag,ag).data,Gg=0;for(let Bg=0,Wg=yg.length;Bg<Wg;Bg+=4)if(yg[Bg]>0){Gg=ag-Math.floor(Bg/4/ag);break}if(fg.canvas.width=fg.canvas.height=0,Gg){const Bg=Gg/(Gg+Zg);return sg.set(mg,Bg),Bg}return sg.set(mg,Ig),Ig}function Ag(mg,hg,pg){const fg=document.createElement("span"),wg={angle:0,canvasWidth:0,hasText:hg.str!=="",hasEOL:hg.hasEOL,fontSize:0};mg._textDivs.push(fg);const Gg=ig.Util.transform(mg._transform,hg.transform);let Zg=Math.atan2(Gg[1],Gg[0]);const yg=pg[hg.fontName];yg.vertical&&(Zg+=Math.PI/2);const Bg=Math.hypot(Gg[2],Gg[3]),Wg=Bg*lg(yg.fontFamily,mg._isOffscreenCanvasSupported);let $g,Ng;Zg===0?($g=Gg[4],Ng=Gg[5]-Wg):($g=Gg[4]+Wg*Math.sin(Zg),Ng=Gg[5]-Wg*Math.cos(Zg));const vg="calc(var(--scale-factor)*",Xg=fg.style;mg._container===mg._rootContainer?(Xg.left=`${(100*$g/mg._pageWidth).toFixed(2)}%`,Xg.top=`${(100*Ng/mg._pageHeight).toFixed(2)}%`):(Xg.left=`${vg}${$g.toFixed(2)}px)`,Xg.top=`${vg}${Ng.toFixed(2)}px)`),Xg.fontSize=`${vg}${Bg.toFixed(2)}px)`,Xg.fontFamily=yg.fontFamily,wg.fontSize=Bg,fg.setAttribute("role","presentation"),fg.textContent=hg.str,fg.dir=hg.dir,mg._fontInspectorEnabled&&(fg.dataset.fontName=hg.fontName),Zg!==0&&(wg.angle=Zg*(180/Math.PI));let Vg=!1;if(hg.str.length>1)Vg=!0;else if(hg.str!==" "&&hg.transform[0]!==hg.transform[3]){const Mg=Math.abs(hg.transform[0]),Rg=Math.abs(hg.transform[3]);Mg!==Rg&&Math.max(Mg,Rg)/Math.min(Mg,Rg)>1.5&&(Vg=!0)}Vg&&(wg.canvasWidth=yg.vertical?hg.height:hg.width),mg._textDivProperties.set(fg,wg),mg._isReadableStream&&mg._layoutText(fg)}function cg(mg){const{div:hg,scale:pg,properties:fg,ctx:wg,prevFontSize:Gg,prevFontFamily:Zg}=mg,{style:yg}=hg;let Bg="";if(fg.canvasWidth!==0&&fg.hasText){const{fontFamily:Wg}=yg,{canvasWidth:$g,fontSize:Ng}=fg;(Gg!==Ng||Zg!==Wg)&&(wg.font=`${Ng*pg}px ${Wg}`,mg.prevFontSize=Ng,mg.prevFontFamily=Wg);const{width:vg}=wg.measureText(hg.textContent);vg>0&&(Bg=`scaleX(${$g*pg/vg})`)}fg.angle!==0&&(Bg=`rotate(${fg.angle}deg) ${Bg}`),Bg.length>0&&(yg.transform=Bg)}function rg(mg){if(mg._canceled)return;const hg=mg._textDivs,pg=mg._capability;if(hg.length>og){pg.resolve();return}if(!mg._isReadableStream)for(const wg of hg)mg._layoutText(wg);pg.resolve()}class ug{constructor({textContentSource:hg,container:pg,viewport:fg,textDivs:wg,textDivProperties:Gg,textContentItemsStr:Zg,isOffscreenCanvasSupported:yg}){var vg;this._textContentSource=hg,this._isReadableStream=hg instanceof ReadableStream,this._container=this._rootContainer=pg,this._textDivs=wg||[],this._textContentItemsStr=Zg||[],this._isOffscreenCanvasSupported=yg,this._fontInspectorEnabled=!!((vg=globalThis.FontInspector)!=null&&vg.enabled),this._reader=null,this._textDivProperties=Gg||new WeakMap,this._canceled=!1,this._capability=new ig.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:fg.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:Cg(0,yg)};const{pageWidth:Bg,pageHeight:Wg,pageX:$g,pageY:Ng}=fg.rawDims;this._transform=[1,0,0,-1,-$g,Ng+Wg],this._pageWidth=Bg,this._pageHeight=Wg,(0,ng.setLayerDimensions)(pg,fg),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new ig.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new ig.AbortException("TextLayer task cancelled."))}_processItems(hg,pg){for(const fg of hg){if(fg.str===void 0){if(fg.type==="beginMarkedContentProps"||fg.type==="beginMarkedContent"){const wg=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),fg.id!==null&&this._container.setAttribute("id",`${fg.id}`),wg.append(this._container)}else fg.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(fg.str),Ag(this,fg,pg)}}_layoutText(hg){const pg=this._layoutTextParams.properties=this._textDivProperties.get(hg);if(this._layoutTextParams.div=hg,cg(this._layoutTextParams),pg.hasText&&this._container.append(hg),pg.hasEOL){const fg=document.createElement("br");fg.setAttribute("role","presentation"),this._container.append(fg)}}_render(){const hg=new ig.PromiseCapability;let pg=Object.create(null);if(this._isReadableStream){const fg=()=>{this._reader.read().then(({value:wg,done:Gg})=>{if(Gg){hg.resolve();return}Object.assign(pg,wg.styles),this._processItems(wg.items,pg),fg()},hg.reject)};this._reader=this._textContentSource.getReader(),fg()}else if(this._textContentSource){const{items:fg,styles:wg}=this._textContentSource;this._processItems(fg,wg),hg.resolve()}else throw new Error('No "textContentSource" parameter specified.');hg.promise.then(()=>{pg=null,rg(this)},this._capability.reject)}}eg.TextLayerRenderTask=ug;function dg(mg){!mg.textContentSource&&(mg.textContent||mg.textContentStream)&&((0,ng.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),mg.textContentSource=mg.textContent||mg.textContentStream);const{container:hg,viewport:pg}=mg,fg=getComputedStyle(hg),wg=fg.getPropertyValue("visibility"),Gg=parseFloat(fg.getPropertyValue("--scale-factor"));wg==="visible"&&(!Gg||Math.abs(Gg-pg.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const Zg=new ug(mg);return Zg._render(),Zg}function bg({container:mg,viewport:hg,textDivs:pg,textDivProperties:fg,isOffscreenCanvasSupported:wg,mustRotate:Gg=!0,mustRescale:Zg=!0}){if(Gg&&(0,ng.setLayerDimensions)(mg,{rotation:hg.rotation}),Zg){const yg=Cg(0,wg),Wg={prevFontSize:null,prevFontFamily:null,div:null,scale:hg.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:yg};for(const $g of pg)Wg.properties=fg.get($g),Wg.div=$g,cg(Wg)}}}),((tg,eg,gg)=>{var lg,Ag,cg,rg,ug,dg,bg,mg,hg,pg,fg,v0,qd,V0,Y0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.AnnotationEditorLayer=void 0;var ig=gg(1),ng=gg(4),og=gg(28),ag=gg(33),Ig=gg(6),sg=gg(34);const Bg=class Bg{constructor({uiManager:$g,pageIndex:Ng,div:vg,accessibilityManager:Xg,annotationLayer:Vg,viewport:Mg,l10n:Rg}){yI(this,fg);yI(this,lg);yI(this,Ag,!1);yI(this,cg,null);yI(this,rg,this.pointerup.bind(this));yI(this,ug,this.pointerdown.bind(this));yI(this,dg,new Map);yI(this,bg,!1);yI(this,mg,!1);yI(this,hg,!1);yI(this,pg);const Sg=[og.FreeTextEditor,ag.InkEditor,sg.StampEditor];if(!Bg._initialized){Bg._initialized=!0;for(const Yg of Sg)Yg.initialize(Rg)}$g.registerEditorTypes(Sg),BI(this,pg,$g),this.pageIndex=Ng,this.div=vg,BI(this,lg,Xg),BI(this,cg,Vg),this.viewport=Mg,la(this,pg).addLayer(this)}get isEmpty(){return la(this,dg).size===0}updateToolbar($g){la(this,pg).updateToolbar($g)}updateMode($g=la(this,pg).getMode()){ZI(this,fg,Y0).call(this),$g===ig.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),$g!==ig.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",$g===ig.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",$g===ig.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",$g===ig.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded($g){if(!$g&&la(this,pg).getMode()!==ig.AnnotationEditorType.INK)return;if(!$g){for(const vg of la(this,dg).values())if(vg.isEmpty()){vg.setInBackground();return}}ZI(this,fg,qd).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState($g){la(this,pg).setEditingState($g)}addCommands($g){la(this,pg).addCommands($g)}enable(){this.div.style.pointerEvents="auto";const $g=new Set;for(const vg of la(this,dg).values())vg.enableEditing(),vg.annotationElementId&&$g.add(vg.annotationElementId);if(!la(this,cg))return;const Ng=la(this,cg).getEditableAnnotations();for(const vg of Ng){if(vg.hide(),la(this,pg).isDeletedAnnotationElement(vg.data.id)||$g.has(vg.data.id))continue;const Xg=this.deserialize(vg);Xg&&(this.addOrRebuild(Xg),Xg.enableEditing())}}disable(){var Ng;BI(this,hg,!0),this.div.style.pointerEvents="none";const $g=new Set;for(const vg of la(this,dg).values()){if(vg.disableEditing(),!vg.annotationElementId||vg.serialize()!==null){$g.add(vg.annotationElementId);continue}(Ng=this.getEditableAnnotation(vg.annotationElementId))==null||Ng.show(),vg.remove()}if(la(this,cg)){const vg=la(this,cg).getEditableAnnotations();for(const Xg of vg){const{id:Vg}=Xg.data;$g.has(Vg)||la(this,pg).isDeletedAnnotationElement(Vg)||Xg.show()}}ZI(this,fg,Y0).call(this),this.isEmpty&&(this.div.hidden=!0),BI(this,hg,!1)}getEditableAnnotation($g){var Ng;return((Ng=la(this,cg))==null?void 0:Ng.getEditableAnnotation($g))||null}setActiveEditor($g){la(this,pg).getActive()!==$g&&la(this,pg).setActiveEditor($g)}enableClick(){this.div.addEventListener("pointerdown",la(this,ug)),this.div.addEventListener("pointerup",la(this,rg))}disableClick(){this.div.removeEventListener("pointerdown",la(this,ug)),this.div.removeEventListener("pointerup",la(this,rg))}attach($g){la(this,dg).set($g.id,$g);const{annotationElementId:Ng}=$g;Ng&&la(this,pg).isDeletedAnnotationElement(Ng)&&la(this,pg).removeDeletedAnnotationElement($g)}detach($g){var Ng;la(this,dg).delete($g.id),(Ng=la(this,lg))==null||Ng.removePointerInTextLayer($g.contentDiv),!la(this,hg)&&$g.annotationElementId&&la(this,pg).addDeletedAnnotationElement($g)}remove($g){this.detach($g),la(this,pg).removeEditor($g),$g.div.contains(document.activeElement)&&setTimeout(()=>{la(this,pg).focusMainContainer()},0),$g.div.remove(),$g.isAttachedToDOM=!1,la(this,mg)||this.addInkEditorIfNeeded(!1)}changeParent($g){var Ng;$g.parent!==this&&($g.annotationElementId&&(la(this,pg).addDeletedAnnotationElement($g.annotationElementId),ng.AnnotationEditor.deleteAnnotationElement($g),$g.annotationElementId=null),this.attach($g),(Ng=$g.parent)==null||Ng.detach($g),$g.setParent(this),$g.div&&$g.isAttachedToDOM&&($g.div.remove(),this.div.append($g.div)))}add($g){if(this.changeParent($g),la(this,pg).addEditor($g),this.attach($g),!$g.isAttachedToDOM){const Ng=$g.render();this.div.append(Ng),$g.isAttachedToDOM=!0}$g.fixAndSetPosition(),$g.onceAdded(),la(this,pg).addToAnnotationStorage($g)}moveEditorInDOM($g){var vg;if(!$g.isAttachedToDOM)return;const{activeElement:Ng}=document;$g.div.contains(Ng)&&($g._focusEventsAllowed=!1,setTimeout(()=>{$g.div.contains(document.activeElement)?$g._focusEventsAllowed=!0:($g.div.addEventListener("focusin",()=>{$g._focusEventsAllowed=!0},{once:!0}),Ng.focus())},0)),$g._structTreeParentId=(vg=la(this,lg))==null?void 0:vg.moveElementInDOM(this.div,$g.div,$g.contentDiv,!0)}addOrRebuild($g){$g.needsToBeRebuilt()?$g.rebuild():this.add($g)}addUndoableEditor($g){const Ng=()=>$g._uiManager.rebuild($g),vg=()=>{$g.remove()};this.addCommands({cmd:Ng,undo:vg,mustExec:!1})}getNextId(){return la(this,pg).getId()}pasteEditor($g,Ng){la(this,pg).updateToolbar($g),la(this,pg).updateMode($g);const{offsetX:vg,offsetY:Xg}=ZI(this,fg,V0).call(this),Vg=this.getNextId(),Mg=ZI(this,fg,v0).call(this,{parent:this,id:Vg,x:vg,y:Xg,uiManager:la(this,pg),isCentered:!0,...Ng});Mg&&this.add(Mg)}deserialize($g){switch($g.annotationType??$g.annotationEditorType){case ig.AnnotationEditorType.FREETEXT:return og.FreeTextEditor.deserialize($g,this,la(this,pg));case ig.AnnotationEditorType.INK:return ag.InkEditor.deserialize($g,this,la(this,pg));case ig.AnnotationEditorType.STAMP:return sg.StampEditor.deserialize($g,this,la(this,pg))}return null}addNewEditor(){ZI(this,fg,qd).call(this,ZI(this,fg,V0).call(this),!0)}setSelected($g){la(this,pg).setSelected($g)}toggleSelected($g){la(this,pg).toggleSelected($g)}isSelected($g){return la(this,pg).isSelected($g)}unselect($g){la(this,pg).unselect($g)}pointerup($g){const{isMac:Ng}=ig.FeatureTest.platform;if(!($g.button!==0||$g.ctrlKey&&Ng)&&$g.target===this.div&&la(this,bg)){if(BI(this,bg,!1),!la(this,Ag)){BI(this,Ag,!0);return}if(la(this,pg).getMode()===ig.AnnotationEditorType.STAMP){la(this,pg).unselectAll();return}ZI(this,fg,qd).call(this,$g,!1)}}pointerdown($g){if(la(this,bg)){BI(this,bg,!1);return}const{isMac:Ng}=ig.FeatureTest.platform;if($g.button!==0||$g.ctrlKey&&Ng||$g.target!==this.div)return;BI(this,bg,!0);const vg=la(this,pg).getActive();BI(this,Ag,!vg||vg.isEmpty())}findNewParent($g,Ng,vg){const Xg=la(this,pg).findParent(Ng,vg);return Xg===null||Xg===this?!1:(Xg.changeParent($g),!0)}destroy(){var $g,Ng;(($g=la(this,pg).getActive())==null?void 0:$g.parent)===this&&(la(this,pg).commitOrRemove(),la(this,pg).setActiveEditor(null));for(const vg of la(this,dg).values())(Ng=la(this,lg))==null||Ng.removePointerInTextLayer(vg.contentDiv),vg.setParent(null),vg.isAttachedToDOM=!1,vg.div.remove();this.div=null,la(this,dg).clear(),la(this,pg).removeLayer(this)}render({viewport:$g}){this.viewport=$g,(0,Ig.setLayerDimensions)(this.div,$g);for(const Ng of la(this,pg).getEditors(this.pageIndex))this.add(Ng);this.updateMode()}update({viewport:$g}){la(this,pg).commitOrRemove(),this.viewport=$g,(0,Ig.setLayerDimensions)(this.div,{rotation:$g.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:$g,pageHeight:Ng}=this.viewport.rawDims;return[$g,Ng]}};lg=new WeakMap,Ag=new WeakMap,cg=new WeakMap,rg=new WeakMap,ug=new WeakMap,dg=new WeakMap,bg=new WeakMap,mg=new WeakMap,hg=new WeakMap,pg=new WeakMap,fg=new WeakSet,v0=function($g){switch(la(this,pg).getMode()){case ig.AnnotationEditorType.FREETEXT:return new og.FreeTextEditor($g);case ig.AnnotationEditorType.INK:return new ag.InkEditor($g);case ig.AnnotationEditorType.STAMP:return new sg.StampEditor($g)}return null},qd=function($g,Ng){const vg=this.getNextId(),Xg=ZI(this,fg,v0).call(this,{parent:this,id:vg,x:$g.offsetX,y:$g.offsetY,uiManager:la(this,pg),isCentered:Ng});return Xg&&this.add(Xg),Xg},V0=function(){const{x:$g,y:Ng,width:vg,height:Xg}=this.div.getBoundingClientRect(),Vg=Math.max(0,$g),Mg=Math.max(0,Ng),Rg=Math.min(window.innerWidth,$g+vg),Sg=Math.min(window.innerHeight,Ng+Xg),Yg=(Vg+Rg)/2-$g,xg=(Mg+Sg)/2-Ng,[Og,Kg]=this.viewport.rotation%180===0?[Yg,xg]:[xg,Yg];return{offsetX:Og,offsetY:Kg}},Y0=function(){BI(this,mg,!0);for(const $g of la(this,dg).values())$g.isEmpty()&&$g.remove();BI(this,mg,!1)},tl(Bg,"_initialized",!1);let Cg=Bg;eg.AnnotationEditorLayer=Cg}),((tg,eg,gg)=>{var sg,Cg,lg,Ag,cg,rg,ug,dg,bg,mg,Lb,Ob,Jb,kd,k0,Eb,R0;Object.defineProperty(eg,"__esModule",{value:!0}),eg.FreeTextEditor=void 0;var ig=gg(1),ng=gg(5),og=gg(4),ag=gg(29);const Bg=class Bg extends og.AnnotationEditor{constructor(Ng){super({...Ng,name:"freeTextEditor"});yI(this,mg);yI(this,sg,this.editorDivBlur.bind(this));yI(this,Cg,this.editorDivFocus.bind(this));yI(this,lg,this.editorDivInput.bind(this));yI(this,Ag,this.editorDivKeydown.bind(this));yI(this,cg);yI(this,rg,"");yI(this,ug,`${this.id}-editor`);yI(this,dg);yI(this,bg,null);BI(this,cg,Ng.color||Bg._defaultColor||og.AnnotationEditor._defaultLineColor),BI(this,dg,Ng.fontSize||Bg._defaultFontSize)}static get _keyboardManager(){const Ng=Bg.prototype,vg=Mg=>Mg.isEmpty(),Xg=ng.AnnotationEditorUIManager.TRANSLATE_SMALL,Vg=ng.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,ig.shadow)(this,"_keyboardManager",new ng.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Ng.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Ng.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Ng._translateEmpty,{args:[-Xg,0],checker:vg}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Ng._translateEmpty,{args:[-Vg,0],checker:vg}],[["ArrowRight","mac+ArrowRight"],Ng._translateEmpty,{args:[Xg,0],checker:vg}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Ng._translateEmpty,{args:[Vg,0],checker:vg}],[["ArrowUp","mac+ArrowUp"],Ng._translateEmpty,{args:[0,-Xg],checker:vg}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Ng._translateEmpty,{args:[0,-Vg],checker:vg}],[["ArrowDown","mac+ArrowDown"],Ng._translateEmpty,{args:[0,Xg],checker:vg}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Ng._translateEmpty,{args:[0,Vg],checker:vg}]]))}static initialize(Ng){og.AnnotationEditor.initialize(Ng,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const vg=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(vg.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Ng,vg){switch(Ng){case ig.AnnotationEditorParamsType.FREETEXT_SIZE:Bg._defaultFontSize=vg;break;case ig.AnnotationEditorParamsType.FREETEXT_COLOR:Bg._defaultColor=vg;break}}updateParams(Ng,vg){switch(Ng){case ig.AnnotationEditorParamsType.FREETEXT_SIZE:ZI(this,mg,Lb).call(this,vg);break;case ig.AnnotationEditorParamsType.FREETEXT_COLOR:ZI(this,mg,Ob).call(this,vg);break}}static get defaultPropertiesToUpdate(){return[[ig.AnnotationEditorParamsType.FREETEXT_SIZE,Bg._defaultFontSize],[ig.AnnotationEditorParamsType.FREETEXT_COLOR,Bg._defaultColor||og.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[ig.AnnotationEditorParamsType.FREETEXT_SIZE,la(this,dg)],[ig.AnnotationEditorParamsType.FREETEXT_COLOR,la(this,cg)]]}_translateEmpty(Ng,vg){this._uiManager.translateSelectedEditors(Ng,vg,!0)}getInitialTranslation(){const Ng=this.parentScale;return[-Bg._internalPadding*Ng,-(Bg._internalPadding+la(this,dg))*Ng]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(ig.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",la(this,Ag)),this.editorDiv.addEventListener("focus",la(this,Cg)),this.editorDiv.addEventListener("blur",la(this,sg)),this.editorDiv.addEventListener("input",la(this,lg)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",la(this,ug)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",la(this,Ag)),this.editorDiv.removeEventListener("focus",la(this,Cg)),this.editorDiv.removeEventListener("blur",la(this,sg)),this.editorDiv.removeEventListener("input",la(this,lg)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Ng){this._focusEventsAllowed&&(super.focusin(Ng),Ng.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Ng;if(this.width){ZI(this,mg,R0).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Ng=this._initialOptions)!=null&&Ng.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Ng=la(this,rg),vg=BI(this,rg,ZI(this,mg,Jb).call(this).trimEnd());if(Ng===vg)return;const Xg=Vg=>{if(BI(this,rg,Vg),!Vg){this.remove();return}ZI(this,mg,k0).call(this),this._uiManager.rebuild(this),ZI(this,mg,kd).call(this)};this.addCommands({cmd:()=>{Xg(vg)},undo:()=>{Xg(Ng)},mustExec:!1}),ZI(this,mg,kd).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Ng){this.enterInEditMode()}keydown(Ng){Ng.target===this.div&&Ng.key==="Enter"&&(this.enterInEditMode(),Ng.preventDefault())}editorDivKeydown(Ng){Bg._keyboardManager.exec(this,Ng)}editorDivFocus(Ng){this.isEditing=!0}editorDivBlur(Ng){this.isEditing=!1}editorDivInput(Ng){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Ng,vg;this.width&&(Ng=this.x,vg=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",la(this,ug)),this.enableEditing(),og.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(Vg=>{var Mg;return(Mg=this.editorDiv)==null?void 0:Mg.setAttribute("aria-label",Vg)}),og.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(Vg=>{var Mg;return(Mg=this.editorDiv)==null?void 0:Mg.setAttribute("default-content",Vg)}),this.editorDiv.contentEditable=!0;const{style:Xg}=this.editorDiv;if(Xg.fontSize=`calc(${la(this,dg)}px * var(--scale-factor))`,Xg.color=la(this,cg),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,ng.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Vg,Mg]=this.parentDimensions;if(this.annotationElementId){const{position:Rg}=la(this,bg);let[Sg,Yg]=this.getInitialTranslation();[Sg,Yg]=this.pageTranslationToScreen(Sg,Yg);const[xg,Og]=this.pageDimensions,[Kg,Dg]=this.pageTranslation;let Fg,Tg;switch(this.rotation){case 0:Fg=Ng+(Rg[0]-Kg)/xg,Tg=vg+this.height-(Rg[1]-Dg)/Og;break;case 90:Fg=Ng+(Rg[0]-Kg)/xg,Tg=vg-(Rg[1]-Dg)/Og,[Sg,Yg]=[Yg,-Sg];break;case 180:Fg=Ng-this.width+(Rg[0]-Kg)/xg,Tg=vg-(Rg[1]-Dg)/Og,[Sg,Yg]=[-Sg,-Yg];break;case 270:Fg=Ng+(Rg[0]-Kg-this.height*Og)/xg,Tg=vg+(Rg[1]-Dg-this.width*xg)/Og,[Sg,Yg]=[-Yg,Sg];break}this.setAt(Fg*Vg,Tg*Mg,Sg,Yg)}else this.setAt(Ng*Vg,vg*Mg,this.width*Vg,this.height*Mg);ZI(this,mg,k0).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Ng,vg,Xg){let Vg=null;if(Ng instanceof ag.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:Rg,fontColor:Sg},rect:Yg,rotation:xg,id:Og},textContent:Kg,textPosition:Dg,parent:{page:{pageNumber:Fg}}}=Ng;if(!Kg||Kg.length===0)return null;Vg=Ng={annotationType:ig.AnnotationEditorType.FREETEXT,color:Array.from(Sg),fontSize:Rg,value:Kg.join(`